discourse_math_bundle 1.0.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.
- checksums.yaml +7 -0
- data/lib/discourse_math_bundle/version.rb +7 -0
- data/lib/discourse_math_bundle.rb +55 -0
- data/vendor/assets/katex/contrib/copy-tex.min.js +1 -0
- data/vendor/assets/katex/contrib/mhchem.min.js +1 -0
- data/vendor/assets/katex/fonts/KaTeX_AMS-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-Bold.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-Italic.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Math-Italic.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Script-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size1-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size2-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size3-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size4-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- data/vendor/assets/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- data/vendor/assets/katex/katex.min.css +1 -0
- data/vendor/assets/katex/katex.min.js +1 -0
- data/vendor/assets/mathjax/a11y/assistive-mml.js +1 -0
- data/vendor/assets/mathjax/a11y/complexity.js +1 -0
- data/vendor/assets/mathjax/a11y/explorer.js +1 -0
- data/vendor/assets/mathjax/a11y/semantic-enrich.js +1 -0
- data/vendor/assets/mathjax/a11y/speech.js +1 -0
- data/vendor/assets/mathjax/a11y/sre.js +1 -0
- data/vendor/assets/mathjax/adaptors/jsdom.js +1 -0
- data/vendor/assets/mathjax/adaptors/linkedom.js +1 -0
- data/vendor/assets/mathjax/adaptors/liteDOM.js +1 -0
- data/vendor/assets/mathjax/core.js +1 -0
- data/vendor/assets/mathjax/input/asciimath.js +1 -0
- data/vendor/assets/mathjax/input/mml/entities.js +1 -0
- data/vendor/assets/mathjax/input/mml/extensions/mml3.js +1 -0
- data/vendor/assets/mathjax/input/mml/extensions/mml3.sef.json +1 -0
- data/vendor/assets/mathjax/input/mml.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/action.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/ams.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/amscd.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/autoload.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/bbm.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/bboldx.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/bbox.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/begingroup.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/boldsymbol.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/braket.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/bussproofs.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/cancel.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/cases.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/centernot.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/color.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/colortbl.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/colorv2.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/configmacros.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/dsfont.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/empheq.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/enclose.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/extpfeil.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/gensymb.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/html.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/mathtools.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/mhchem.js +34 -0
- data/vendor/assets/mathjax/input/tex/extensions/newcommand.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/noerrors.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/noundefined.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/physics.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/require.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/setoptions.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/tagformat.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/texhtml.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/textcomp.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/textmacros.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/unicode.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/units.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/upgreek.js +1 -0
- data/vendor/assets/mathjax/input/tex/extensions/verb.js +1 -0
- data/vendor/assets/mathjax/input/tex-base.js +1 -0
- data/vendor/assets/mathjax/input/tex.js +1 -0
- data/vendor/assets/mathjax/loader.js +1 -0
- data/vendor/assets/mathjax/mml-chtml-nofont.js +1 -0
- data/vendor/assets/mathjax/mml-chtml.js +1 -0
- data/vendor/assets/mathjax/mml-svg-nofont.js +1 -0
- data/vendor/assets/mathjax/mml-svg.js +1 -0
- data/vendor/assets/mathjax/output/chtml.js +1 -0
- data/vendor/assets/mathjax/output/svg.js +1 -0
- data/vendor/assets/mathjax/sre/mathmaps/af.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/base.json +137 -0
- data/vendor/assets/mathjax/sre/mathmaps/ca.json +140 -0
- data/vendor/assets/mathjax/sre/mathmaps/da.json +140 -0
- data/vendor/assets/mathjax/sre/mathmaps/de.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/en.json +158 -0
- data/vendor/assets/mathjax/sre/mathmaps/es.json +140 -0
- data/vendor/assets/mathjax/sre/mathmaps/euro.json +32 -0
- data/vendor/assets/mathjax/sre/mathmaps/fr.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/hi.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/it.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/ko.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/nb.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/nemeth.json +125 -0
- data/vendor/assets/mathjax/sre/mathmaps/nn.json +146 -0
- data/vendor/assets/mathjax/sre/mathmaps/sv.json +146 -0
- data/vendor/assets/mathjax/sre/require.d.mts +1 -0
- data/vendor/assets/mathjax/sre/require.mjs +2 -0
- data/vendor/assets/mathjax/sre/speech-worker.js +1 -0
- data/vendor/assets/mathjax/startup.js +1 -0
- data/vendor/assets/mathjax/tex-chtml-nofont.js +1 -0
- data/vendor/assets/mathjax/tex-chtml.js +1 -0
- data/vendor/assets/mathjax/tex-mml-chtml-nofont.js +1 -0
- data/vendor/assets/mathjax/tex-mml-chtml.js +1 -0
- data/vendor/assets/mathjax/tex-mml-svg-nofont.js +1 -0
- data/vendor/assets/mathjax/tex-mml-svg.js +1 -0
- data/vendor/assets/mathjax/tex-svg-nofont.js +1 -0
- data/vendor/assets/mathjax/tex-svg.js +1 -0
- data/vendor/assets/mathjax/ui/lazy.js +1 -0
- data/vendor/assets/mathjax/ui/menu.js +1 -0
- data/vendor/assets/mathjax/ui/safe.js +1 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ab.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-abi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ai.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ar.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-arl.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-b-a.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-b.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-bi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-br.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-brd.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-brk.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-c.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ch.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-chb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-chbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-chi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cy.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cybi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyss.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyssb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyssbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyssi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ds.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-dv.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-em.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-f.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-fb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gk.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gki.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkss.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkssb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkssbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkssi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-he.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-heb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-hebi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-hei.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-i.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-lb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-li.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-lib.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-lo.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-lr.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-lt.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-m.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-mar.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-mi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ml.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-mm.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-msh.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-mx.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-n.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ob.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-os.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ph.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phss.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phssb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phssbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-phssi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-pu.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-pub.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-pubi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-pui.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-rb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-s.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-s3.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-s4.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-s5.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-s6.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-s7.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sh.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-shb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-shbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-shi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-so.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ss.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssbi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssbix.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssbx.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssix.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sslb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssli.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sslib.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sslr.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssx.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sy.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-syb.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-sybi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-syi.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-u-a.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-u.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-v.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-vx.woff2 +0 -0
- data/vendor/assets/mathjax/woff-v2/mjx-ncm-zero.woff2 +0 -0
- metadata +304 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var __webpack_modules__={159:(t,e,i)=>{"use strict";var s=i(870).freeze;e.XML_ENTITIES=s({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),e.HTML_ENTITIES=s({Aacute:"\xc1",aacute:"\xe1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"\u0410",acy:"\u0430",AElig:"\xc6",aelig:"\xe6",af:"\u2061",Afr:"\u{1d504}",afr:"\u{1d51e}",Agrave:"\xc0",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",AMP:"&",amp:"&",And:"\u2a53",and:"\u2227",andand:"\u2a55",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1d538}",aopf:"\u{1d552}",ap:"\u2248",apacir:"\u2a6f",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\xc5",aring:"\xe5",Ascr:"\u{1d49c}",ascr:"\u{1d4b6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\u{1d505}",bfr:"\u{1d51f}",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\u{1d539}",bopf:"\u{1d553}",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250c",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252c",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxUL:"\u255d",boxUl:"\u255c",boxuL:"\u255b",boxul:"\u2518",boxUR:"\u255a",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256c",boxVh:"\u256b",boxvH:"\u256a",boxvh:"\u253c",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255f",boxvR:"\u255e",boxvr:"\u251c",bprime:"\u2035",Breve:"\u02d8",breve:"\u02d8",brvbar:"\xa6",Bscr:"\u212c",bscr:"\u{1d4b7}",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsol:"\\",bsolb:"\u29c5",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22d2",cap:"\u2229",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d",Ccaron:"\u010c",ccaron:"\u010d",Ccedil:"\xc7",ccedil:"\xe7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"\u29b2",cent:"\xa2",CenterDot:"\xb7",centerdot:"\xb7",Cfr:"\u212d",cfr:"\u{1d520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",cir:"\u25cb",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\xae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",Conint:"\u222f",conint:"\u222e",ContourIntegral:"\u222e",Copf:"\u2102",copf:"\u{1d554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xa9",copy:"\xa9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",Cross:"\u2a2f",cross:"\u2717",Cscr:"\u{1d49e}",cscr:"\u{1d4b8}",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",Cup:"\u22d3",cup:"\u222a",cupbrcap:"\u2a48",CupCap:"\u224d",cupcap:"\u2a46",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21a1",dArr:"\u21d3",darr:"\u2193",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21ca",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\xb0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\u{1d507}",dfr:"\u{1d521}",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",diam:"\u22c4",Diamond:"\u22c4",diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\u{1d53b}",dopf:"\u{1d555}",Dot:"\xa8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21d3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVector:"\u21bd",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295f",DownRightVector:"\u21c1",DownRightVectorBar:"\u2957",DownTee:"\u22a4",DownTeeArrow:"\u21a7",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\u{1d49f}",dscr:"\u{1d4b9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\xc9",eacute:"\xe9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",ecir:"\u2256",Ecirc:"\xca",ecirc:"\xea",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1d508}",efr:"\u{1d522}",eg:"\u2a9a",Egrave:"\xc8",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1d53c}",eopf:"\u{1d556}",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",Equal:"\u2a75",equals:"=",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212f",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\u{1d509}",ffr:"\u{1d523}",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\u{1d53d}",fopf:"\u{1d557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1d4bb}",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",ges:"\u2a7e",gescc:"\u2aa9",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\u{1d50a}",gfr:"\u{1d524}",Gg:"\u22d9",gg:"\u226b",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2aa5",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gnE:"\u2269",gne:"\u2a88",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\u{1d53e}",gopf:"\u{1d558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\u{1d4a2}",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",Gt:"\u226b",GT:">",gt:">",gtcc:"\u2aa7",gtcir:"\u2a7a",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",HARDcy:"\u042a",hardcy:"\u044a",hArr:"\u21d4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",Hfr:"\u210c",hfr:"\u{1d525}",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",Hopf:"\u210d",hopf:"\u{1d559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210b",hscr:"\u{1d4bd}",hslash:"\u210f",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xcd",iacute:"\xed",ic:"\u2063",Icirc:"\xce",icirc:"\xee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",Ifr:"\u2111",ifr:"\u{1d526}",Igrave:"\xcc",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",in:"\u2208",incare:"\u2105",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",Int:"\u222c",int:"\u222b",intcal:"\u22ba",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\u{1d540}",iopf:"\u{1d55a}",Iota:"\u0399",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",Iscr:"\u2110",iscr:"\u{1d4be}",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xcf",iuml:"\xef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1d50d}",jfr:"\u{1d527}",jmath:"\u0237",Jopf:"\u{1d541}",jopf:"\u{1d55b}",Jscr:"\u{1d4a5}",jscr:"\u{1d4bf}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\u{1d50e}",kfr:"\u{1d528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\u{1d542}",kopf:"\u{1d55c}",Kscr:"\u{1d4a6}",kscr:"\u{1d4c0}",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",Lang:"\u27ea",lang:"\u27e8",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",Larr:"\u219e",lArr:"\u21d0",larr:"\u2190",larrb:"\u21e4",larrbfs:"\u291f",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",lat:"\u2aab",lAtail:"\u291b",latail:"\u2919",late:"\u2aad",lates:"\u2aad\ufe00",lBarr:"\u290e",lbarr:"\u290c",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27e8",LeftArrow:"\u2190",Leftarrow:"\u21d0",leftarrow:"\u2190",LeftArrowBar:"\u21e4",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21c3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrow:"\u2194",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTee:"\u22a3",LeftTeeArrow:"\u21a4",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangle:"\u22b2",LeftTriangleBar:"\u29cf",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21bf",LeftUpVectorBar:"\u2958",LeftVector:"\u21bc",LeftVectorBar:"\u2952",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",les:"\u2a7d",lescc:"\u2aa8",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\u{1d50f}",lfr:"\u{1d529}",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22d8",ll:"\u226a",llarr:"\u21c7",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoust:"\u23b0",lmoustache:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lnE:"\u2268",lne:"\u2a87",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftarrow:"\u27f5",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longleftrightarrow:"\u27f7",longmapsto:"\u27fc",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",longrightarrow:"\u27f6",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\u{1d543}",lopf:"\u{1d55d}",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1d4c1}",Lsh:"\u21b0",lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226a",LT:"<",lt:"<",ltcc:"\u2aa6",ltcir:"\u2a79",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\u{1d510}",mfr:"\u{1d52a}",mho:"\u2127",micro:"\xb5",mid:"\u2223",midast:"*",midcir:"\u2af0",middot:"\xb7",minus:"\u2212",minusb:"\u229f",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\u{1d544}",mopf:"\u{1d55e}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1d4c2}",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266e",natural:"\u266e",naturals:"\u2115",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21d7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1d511}",nfr:"\u{1d52b}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nhArr:"\u21ce",nharr:"\u21ae",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlArr:"\u21cd",nlarr:"\u219a",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21cd",nleftarrow:"\u219a",nLeftrightarrow:"\u21ce",nleftrightarrow:"\u21ae",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xa0",Nopf:"\u2115",nopf:"\u{1d55f}",Not:"\u2aec",not:"\xac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangle:"\u22ea",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangle:"\u22eb",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",npre:"\u2aaf\u0338",nprec:"\u2280",npreceq:"\u2aaf\u0338",nrArr:"\u21cf",nrarr:"\u219b",nrarrc:"\u2933\u0338",nrarrw:"\u219d\u0338",nRightarrow:"\u21cf",nrightarrow:"\u219b",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\u{1d4a9}",nscr:"\u{1d4c3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nVDash:"\u22af",nVdash:"\u22ae",nvDash:"\u22ad",nvdash:"\u22ac",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvHarr:"\u2904",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwArr:"\u21d6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xd3",oacute:"\xf3",oast:"\u229b",ocir:"\u229a",Ocirc:"\xd4",ocirc:"\xf4",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\u{1d512}",ofr:"\u{1d52c}",ogon:"\u02db",Ograve:"\xd2",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\u{1d546}",oopf:"\u{1d560}",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",Or:"\u2a54",or:"\u2228",orarr:"\u21bb",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\u{1d4aa}",oscr:"\u2134",Oslash:"\xd8",oslash:"\xf8",osol:"\u2298",Otilde:"\xd5",otilde:"\xf5",Otimes:"\u2a37",otimes:"\u2297",otimesas:"\u2a36",Ouml:"\xd6",ouml:"\xf6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",par:"\u2225",para:"\xb6",parallel:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202",Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\u{1d513}",pfr:"\u{1d52d}",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plus:"+",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",Poincareplane:"\u210c",pointint:"\u2a15",Popf:"\u2119",popf:"\u{1d561}",pound:"\xa3",Pr:"\u2abb",pr:"\u227a",prap:"\u2ab7",prcue:"\u227c",prE:"\u2ab3",pre:"\u2aaf",prec:"\u227a",precapprox:"\u2ab7",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",precsim:"\u227e",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportion:"\u2237",Proportional:"\u221d",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\u{1d4ab}",pscr:"\u{1d4c5}",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\u{1d514}",qfr:"\u{1d52e}",qint:"\u2a0c",Qopf:"\u211a",qopf:"\u{1d562}",qprime:"\u2057",Qscr:"\u{1d4ac}",qscr:"\u{1d4c6}",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",QUOT:'"',quot:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",Rang:"\u27eb",rang:"\u27e9",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",Rarr:"\u21a0",rArr:"\u21d2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",rAtail:"\u291c",ratail:"\u291a",ratio:"\u2236",rationals:"\u211a",RBarr:"\u2910",rBarr:"\u290f",rbarr:"\u290d",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",Re:"\u211c",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",rect:"\u25ad",REG:"\xae",reg:"\xae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",Rfr:"\u211c",rfr:"\u{1d52f}",rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u03f1",RightAngleBracket:"\u27e9",RightArrow:"\u2192",Rightarrow:"\u21d2",rightarrow:"\u2192",RightArrowBar:"\u21e5",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVector:"\u21c2",RightDownVectorBar:"\u2955",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTee:"\u22a2",RightTeeArrow:"\u21a6",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangle:"\u22b3",RightTriangleBar:"\u29d0",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVector:"\u21be",RightUpVectorBar:"\u2954",RightVector:"\u21c0",RightVectorBar:"\u2953",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoust:"\u23b1",rmoustache:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",Ropf:"\u211d",ropf:"\u{1d563}",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",Rscr:"\u211b",rscr:"\u{1d4c7}",Rsh:"\u21b1",rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b",sbquo:"\u201a",Sc:"\u2abc",sc:"\u227b",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227d",scE:"\u2ab4",sce:"\u2ab0",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdot:"\u22c5",sdotb:"\u22a1",sdote:"\u2a66",searhk:"\u2925",seArr:"\u21d8",searr:"\u2198",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1d516}",sfr:"\u{1d530}",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",sol:"/",solb:"\u29c4",solbar:"\u233f",Sopf:"\u{1d54a}",sopf:"\u{1d564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25a1",Square:"\u25a1",square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squf:"\u25aa",srarr:"\u2192",Sscr:"\u{1d4ae}",sscr:"\u{1d4c8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",Sub:"\u22d0",sub:"\u2282",subdot:"\u2abd",subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",Subset:"\u22d0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succ:"\u227b",succapprox:"\u2ab8",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",Sum:"\u2211",sum:"\u2211",sung:"\u266a",Sup:"\u22d1",sup:"\u2283",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",Supset:"\u22d1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swArr:"\u21d9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\u{1d517}",tfr:"\u{1d531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",ThickSpace:"\u205f\u200a",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\xde",thorn:"\xfe",Tilde:"\u223c",tilde:"\u02dc",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xd7",timesb:"\u22a0",timesbar:"\u2a31",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",top:"\u22a4",topbot:"\u2336",topcir:"\u2af1",Topf:"\u{1d54b}",topf:"\u{1d565}",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\u{1d4af}",tscr:"\u{1d4c9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\xda",uacute:"\xfa",Uarr:"\u219f",uArr:"\u21d1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\u{1d518}",ufr:"\u{1d532}",Ugrave:"\xd9",ugrave:"\xf9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\xa8",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1d54c}",uopf:"\u{1d566}",UpArrow:"\u2191",Uparrow:"\u21d1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21c5",UpDownArrow:"\u2195",Updownarrow:"\u21d5",updownarrow:"\u2195",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03d2",upsi:"\u03c5",upsih:"\u03d2",Upsilon:"\u03a5",upsilon:"\u03c5",UpTee:"\u22a5",UpTeeArrow:"\u21a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\u{1d4b0}",uscr:"\u{1d4ca}",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\xdc",uuml:"\xfc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",vArr:"\u21d5",varr:"\u2195",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",Vbar:"\u2aeb",vBar:"\u2ae8",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22ab",Vdash:"\u22a9",vDash:"\u22a8",vdash:"\u22a2",Vdashl:"\u2ae6",Vee:"\u22c1",vee:"\u2228",veebar:"\u22bb",veeeq:"\u225a",vellip:"\u22ee",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\u{1d519}",vfr:"\u{1d533}",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\u{1d54d}",vopf:"\u{1d567}",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\u{1d4b1}",vscr:"\u{1d4cb}",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",Wedge:"\u22c0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1d51a}",wfr:"\u{1d534}",Wopf:"\u{1d54e}",wopf:"\u{1d568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1d4b2}",wscr:"\u{1d4cc}",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\u{1d51b}",xfr:"\u{1d535}",xhArr:"\u27fa",xharr:"\u27f7",Xi:"\u039e",xi:"\u03be",xlArr:"\u27f8",xlarr:"\u27f5",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",Xopf:"\u{1d54f}",xopf:"\u{1d569}",xoplus:"\u2a01",xotime:"\u2a02",xrArr:"\u27f9",xrarr:"\u27f6",Xscr:"\u{1d4b3}",xscr:"\u{1d4cd}",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\xdd",yacute:"\xfd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\xa5",Yfr:"\u{1d51c}",yfr:"\u{1d536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1d550}",yopf:"\u{1d56a}",Yscr:"\u{1d4b4}",yscr:"\u{1d4ce}",YUcy:"\u042e",yucy:"\u044e",Yuml:"\u0178",yuml:"\xff",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",Zfr:"\u2128",zfr:"\u{1d537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",Zopf:"\u2124",zopf:"\u{1d56b}",Zscr:"\u{1d4b5}",zscr:"\u{1d4cf}",zwj:"\u200d",zwnj:"\u200c"}),e.entityMap=e.HTML_ENTITIES},546:(t,e,i)=>{"use strict";var s=i(870);e.assign=s.assign,e.hasDefaultHTMLNamespace=s.hasDefaultHTMLNamespace,e.isHTMLMimeType=s.isHTMLMimeType,e.isValidMimeType=s.isValidMimeType,e.MIME_TYPE=s.MIME_TYPE,e.NAMESPACE=s.NAMESPACE;var r=i(767);e.DOMException=r.DOMException,e.DOMExceptionName=r.DOMExceptionName,e.ExceptionCode=r.ExceptionCode,e.ParseError=r.ParseError;var n=i(786);e.Attr=n.Attr,e.CDATASection=n.CDATASection,e.CharacterData=n.CharacterData,e.Comment=n.Comment,e.Document=n.Document,e.DocumentFragment=n.DocumentFragment,e.DocumentType=n.DocumentType,e.DOMImplementation=n.DOMImplementation,e.Element=n.Element,e.Entity=n.Entity,e.EntityReference=n.EntityReference,e.LiveNodeList=n.LiveNodeList,e.NamedNodeMap=n.NamedNodeMap,e.Node=n.Node,e.NodeList=n.NodeList,e.Notation=n.Notation,e.ProcessingInstruction=n.ProcessingInstruction,e.Text=n.Text,e.XMLSerializer=n.XMLSerializer;var o=i(576);e.DOMParser=o.DOMParser,e.normalizeLineEndings=o.normalizeLineEndings,e.onErrorStopParsing=o.onErrorStopParsing,e.onWarningStopParsing=o.onWarningStopParsing},556:(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{f:()=>SystemExternal});var _variables_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(904),_lib_external_js__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(750);const windowSupported=!("undefined"==typeof window),documentSupported=windowSupported&&!(void 0===window.document),webworker=!("undefined"==typeof DedicatedWorkerGlobalScope),nodeRequire=()=>{try{return eval("require")}catch(t){return t=>null}},SystemExternal={extRequire:t=>"undefined"!=typeof process&&"undefined"!=typeof require?nodeRequire()(t):null,windowSupported,documentSupported,webworker,xmldom:_lib_external_js__WEBPACK_IMPORTED_MODULE_1__.Gb,document:_lib_external_js__WEBPACK_IMPORTED_MODULE_1__.Al,fs:documentSupported||webworker?null:nodeRequire()("fs"),url:_variables_js__WEBPACK_IMPORTED_MODULE_0__.u.url,jsonPath:function(){if(documentSupported||webworker)return _variables_js__WEBPACK_IMPORTED_MODULE_0__.u.url;if(process.env.SRE_JSON_PATH||__webpack_require__.g.SRE_JSON_PATH)return process.env.SRE_JSON_PATH||__webpack_require__.g.SRE_JSON_PATH;try{return nodeRequire().resolve("speech-rule-engine").replace(/sre\.js$/,"")+"mathmaps"}catch(t){}try{return nodeRequire().resolve(".").replace(/sre\.js$/,"")+"mathmaps"}catch(t){}return"undefined"!=typeof __dirname?__dirname+(__dirname.match(/lib?$/)?"/mathmaps":"/lib/mathmaps"):process.cwd()+"/lib/mathmaps"}(),xpath:_lib_external_js__WEBPACK_IMPORTED_MODULE_1__.Oe}},576:(t,e,i)=>{"use strict";var s=i(870),r=i(786),n=i(767),o=i(159),a=i(802),l=r.DOMImplementation,c=s.hasDefaultHTMLNamespace,h=s.isHTMLMimeType,d=s.isValidMimeType,u=s.MIME_TYPE,p=s.NAMESPACE,m=n.ParseError,f=a.XMLReader;function g(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028\u2029]/g,"\n")}function b(t){if(void 0===(t=t||{}).locator&&(t.locator=!0),this.assign=t.assign||s.assign,this.domHandler=t.domHandler||E,this.onError=t.onError||t.errorHandler,t.errorHandler&&"function"!=typeof t.errorHandler)throw new TypeError("errorHandler object is no longer supported, switch to onError!");t.errorHandler&&t.errorHandler("warning","The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=t.normalizeLineEndings||g,this.locator=!!t.locator,this.xmlns=this.assign(Object.create(null),t.xmlns)}function E(t){var e=t||{};this.mimeType=e.mimeType||u.XML_APPLICATION,this.defaultNamespace=e.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=e.onError}function x(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function y(t,e,i){return"string"==typeof t?t.substr(e,i):t.length>=e+i||e?new java.lang.String(t,e,i)+"":t}function N(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}b.prototype.parseFromString=function(t,e){if(!d(e))throw new TypeError('DOMParser.parseFromString: the provided mimeType "'+e+'" is not valid.');var i=this.assign(Object.create(null),this.xmlns),r=o.XML_ENTITIES,n=i[""]||null;c(e)?(r=o.HTML_ENTITIES,n=p.HTML):e===u.XML_SVG_IMAGE&&(n=p.SVG),i[""]=n,i.xml=i.xml||p.XML;var a=new this.domHandler({mimeType:e,defaultNamespace:n,onError:this.onError}),l=this.locator?{}:void 0;this.locator&&a.setDocumentLocator(l);var h=new f;return h.errorHandler=a,h.domBuilder=a,!s.isHTMLMimeType(e)&&"string"!=typeof t&&h.errorHandler.fatalError("source is not a string"),h.parse(this.normalizeLineEndings(String(t)),i,r),a.doc.documentElement||h.errorHandler.fatalError("missing root element"),a.doc},E.prototype={startDocument:function(){var t=new l;this.doc=h(this.mimeType)?t.createHTMLDocument(!1):t.createDocument(this.defaultNamespace,"")},startElement:function(t,e,i,s){var r=this.doc,n=r.createElementNS(t,i||e),o=s.length;N(this,n),this.currentElement=n,this.locator&&x(this.locator,n);for(var a=0;a<o;a++){t=s.getURI(a);var l=s.getValue(a),c=(i=s.getQName(a),r.createAttributeNS(t,i));this.locator&&x(s.getLocator(a),c),c.value=c.nodeValue=l,n.setAttributeNode(c)}},endElement:function(t,e,i){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(t,e){},endPrefixMapping:function(t){},processingInstruction:function(t,e){var i=this.doc.createProcessingInstruction(t,e);this.locator&&x(this.locator,i),N(this,i)},ignorableWhitespace:function(t,e,i){},characters:function(t,e,i){if(t=y.apply(this,arguments)){if(this.cdata)var s=this.doc.createCDATASection(t);else s=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(s):/^\s*$/.test(t)&&this.doc.appendChild(s),this.locator&&x(this.locator,s)}},skippedEntity:function(t){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){t&&(t.lineNumber=0),this.locator=t},comment:function(t,e,i){t=y.apply(this,arguments);var s=this.doc.createComment(t);this.locator&&x(this.locator,s),N(this,s)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,i,s){var r=this.doc.implementation;if(r&&r.createDocumentType){var n=r.createDocumentType(t,e,i,s);this.locator&&x(this.locator,n),N(this,n),this.doc.doctype=n}},reportError:function(t,e){if("function"==typeof this.onError)try{this.onError(t,e,this)}catch(i){throw new m("Reporting "+t+' "'+e+'" caused '+i,this.locator)}else console.error("[xmldom "+t+"]\t"+e,function(t){if(t)return"\n@#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}(this.locator))},warning:function(t){this.reportError("warning",t)},error:function(t){this.reportError("error",t)},fatalError:function(t){throw this.reportError("fatalError",t),new m(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){E.prototype[t]=function(){return null}})),e.__DOMHandler=E,e.DOMParser=b,e.normalizeLineEndings=g,e.onErrorStopParsing=function(t){if("error"===t)throw"onErrorStopParsing"},e.onWarningStopParsing=function(){throw"onWarningStopParsing"}},731:(t,e)=>{"use strict";function i(t){try{"function"!=typeof t&&(t=RegExp);var e=new t("\u{1d306}","u").exec("\u{1d306}");return!!e&&2===e[0].length}catch(t){}return!1}var s=i();function r(t){if("["!==t.source[0])throw new Error(t+" can not be used with chars");return t.source.slice(1,t.source.lastIndexOf("]"))}function n(t,e){if("["!==t.source[0])throw new Error("/"+t.source+"/ can not be used with chars_without");if(!e||"string"!=typeof e)throw new Error(JSON.stringify(e)+" is not a valid search");if(-1===t.source.indexOf(e))throw new Error('"'+e+'" is not is /'+t.source+"/");if("-"===e&&1!==t.source.indexOf(e))throw new Error('"'+e+'" is not at the first postion of /'+t.source+"/");return new RegExp(t.source.replace(e,""),s?"u":"")}function o(t){var e=this;return new RegExp(Array.prototype.slice.call(arguments).map((function(t){var i="string"==typeof t;if(i&&void 0===e&&"|"===t)throw new Error("use regg instead of reg to wrap expressions with `|`!");return i?t:t.source})).join(""),s?"mu":"m")}function a(t){if(0===arguments.length)throw new Error("no parameters provided");return o.apply(a,["(?:"].concat(Array.prototype.slice.call(arguments),[")"]))}var l=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;s&&(l=o("[",r(l),"\\u{10000}-\\u{10FFFF}","]"));var c=/[\x20\x09\x0D\x0A]/,h=r(c),d=o(c,"+"),u=o(c,"*"),p=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;s&&(p=o("[",r(p),"\\u{10000}-\\u{10FFFF}","]"));var m=o("[",r(p),r(/[-.0-9\xB7]/),r(/[\u0300-\u036F\u203F-\u2040]/),"]"),f=o(p,m,"*"),g=o(m,"+"),b=o("&",f,";"),E=a(/&#[0-9]+;|&#x[0-9a-fA-F]+;/),x=a(b,"|",E),y=o("%",f,";"),N=a(o('"',a(/[^%&"]/,"|",y,"|",x),"*",'"'),"|",o("'",a(/[^%&']/,"|",y,"|",x),"*","'")),v=a('"',a(/[^<&"]/,"|",x),"*",'"',"|","'",a(/[^<&']/,"|",x),"*","'"),T=o(n(p,":"),n(m,":"),"*"),_=o(T,a(":",T),"?"),L=o("^",_,"$"),C=o("(",_,")"),R=a(/"[^"]*"|'[^']*'/),w=o(/^<\?/,"(",f,")",a(d,"(",l,"*?)"),"?",/\?>/),I=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,S=a('"',I,'*"',"|","'",n(I,"'"),"*'"),A="\x3c!--",O=o(A,a(n(l,"-"),"|",o("-",n(l,"-"))),"*","--\x3e"),M="#PCDATA",k=a(o(/\(/,u,M,a(u,/\|/,u,_),"*",u,/\)\*/),"|",o(/\(/,u,M,u,/\)/)),D=a("EMPTY","|","ANY","|",k,"|",o(/\([^>]+\)/,/[?*+]?/)),P=o("<!ELEMENT",d,a(_,"|",y),d,a(D,"|",y),u,">"),B=o("NOTATION",d,/\(/,u,f,a(u,/\|/,u,f),"*",u,/\)/),j=o(/\(/,u,g,a(u,/\|/,u,g),"*",u,/\)/),F=a(B,"|",j),U=a(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,"|",F),H=a(/#REQUIRED|#IMPLIED/,"|",a(a("#FIXED",d),"?",v)),q=o("<!ATTLIST",d,f,a(d,f,d,U,d,H),"*",u,">"),W="about:legacy-compat",V=a('"'+W+'"',"|","'"+W+"'"),X="SYSTEM",z="PUBLIC",G=a(a(X,d,R),"|",a(z,d,S,d,R)),J=o("^",a(a(X,d,"(?<SystemLiteralOnly>",R,")"),"|",a(z,d,"(?<PubidLiteral>",S,")",d,"(?<SystemLiteral>",R,")"))),K=a(d,"NDATA",d,f),$="<!ENTITY",Y=o($,d,f,d,a(N,"|",a(G,K,"?")),u,">"),Q=a(N,"|",G),Z=a(Y,"|",o($,d,"%",d,f,d,Q,u,">")),tt=o(z,d,S),et=o("<!NOTATION",d,f,d,a(G,"|",tt),u,">"),it=o(u,"=",u),st=/1[.]\d+/,rt=o(d,"version",it,a("'",st,"'","|",'"',st,'"')),nt=/[A-Za-z][-A-Za-z0-9._]*/,ot=o(/^<\?xml/,rt,a(d,"encoding",it,a('"',nt,'"',"|","'",nt,"'")),"?",a(d,"standalone",it,a("'",a("yes","|","no"),"'","|",'"',a("yes","|","no"),'"')),"?",u,/\?>/),at=o(l,"*?",/\]\]>/),lt=o(/<!\[CDATA\[/,at);e.chars=r,e.chars_without=n,e.detectUnicodeSupport=i,e.reg=o,e.regg=a,e.ABOUT_LEGACY_COMPAT=W,e.ABOUT_LEGACY_COMPAT_SystemLiteral=V,e.AttlistDecl=q,e.CDATA_START="<![CDATA[",e.CDATA_END="]]>",e.CDSect=lt,e.Char=l,e.Comment=O,e.COMMENT_START=A,e.COMMENT_END="--\x3e",e.DOCTYPE_DECL_START="<!DOCTYPE",e.elementdecl=P,e.EntityDecl=Z,e.EntityValue=N,e.ExternalID=G,e.ExternalID_match=J,e.Name=f,e.NotationDecl=et,e.Reference=x,e.PEReference=y,e.PI=w,e.PUBLIC=z,e.PubidLiteral=S,e.QName=_,e.QName_exact=L,e.QName_group=C,e.S=d,e.SChar_s=h,e.S_OPT=u,e.SYSTEM=X,e.SystemLiteral=R,e.UNICODE_REPLACEMENT_CHARACTER="\ufffd",e.UNICODE_SUPPORT=s,e.XMLDecl=ot},750:(t,e,i)=>{"use strict";var s,r;i.d(e,{Al:()=>l,Gb:()=>a,Oe:()=>d});var n=i(546),o=i(999);const a=s||(s=i.t(n,2)),l=(new a.DOMImplementation).createDocument("",""),c=(null===(r||(r=i.t(o,2)))||void 0===(r||(r=i.t(o,2)))?void 0:o.install)||window.wgxpath.install,h=function(){const t={document:{},XPathResult:{}};return c(t),t.document.XPathResult=t.XPathResult,t.document}(),d={currentDocument:l,evaluate:h.evaluate,result:h.XPathResult,createNSResolver:h.createNSResolver}},767:(t,e,i)=>{"use strict";function s(t,e){t.prototype=Object.create(Error.prototype,{constructor:{value:t},name:{value:t.name,enumerable:!0,writable:e}})}var r=i(870).freeze({Error:"Error",IndexSizeError:"IndexSizeError",DomstringSizeError:"DomstringSizeError",HierarchyRequestError:"HierarchyRequestError",WrongDocumentError:"WrongDocumentError",InvalidCharacterError:"InvalidCharacterError",NoDataAllowedError:"NoDataAllowedError",NoModificationAllowedError:"NoModificationAllowedError",NotFoundError:"NotFoundError",NotSupportedError:"NotSupportedError",InUseAttributeError:"InUseAttributeError",InvalidStateError:"InvalidStateError",SyntaxError:"SyntaxError",InvalidModificationError:"InvalidModificationError",NamespaceError:"NamespaceError",InvalidAccessError:"InvalidAccessError",ValidationError:"ValidationError",TypeMismatchError:"TypeMismatchError",SecurityError:"SecurityError",NetworkError:"NetworkError",AbortError:"AbortError",URLMismatchError:"URLMismatchError",QuotaExceededError:"QuotaExceededError",TimeoutError:"TimeoutError",InvalidNodeTypeError:"InvalidNodeTypeError",DataCloneError:"DataCloneError",EncodingError:"EncodingError",NotReadableError:"NotReadableError",UnknownError:"UnknownError",ConstraintError:"ConstraintError",DataError:"DataError",TransactionInactiveError:"TransactionInactiveError",ReadOnlyError:"ReadOnlyError",VersionError:"VersionError",OperationError:"OperationError",NotAllowedError:"NotAllowedError",OptOutError:"OptOutError"}),n=Object.keys(r);function o(t){return"number"==typeof t&&t>=1&&t<=25}function a(t,e){var i;o(t)?(this.name=n[t],this.message=e||""):(this.message=t,this.name="string"==typeof(i=e)&&i.substring(i.length-r.Error.length)===r.Error?e:r.Error),Error.captureStackTrace&&Error.captureStackTrace(this,a)}s(a,!0),Object.defineProperties(a.prototype,{code:{enumerable:!0,get:function(){var t=n.indexOf(this.name);return o(t)?t:0}}});for(var l={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},c=Object.entries(l),h=0;h<c.length;h++){a[c[h][0]]=c[h][1]}function d(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,d)}s(d),e.DOMException=a,e.DOMExceptionName=r,e.ExceptionCode=l,e.ParseError=d},786:(t,e,i)=>{"use strict";var s=i(870),r=s.find,n=s.hasDefaultHTMLNamespace,o=s.hasOwn,a=s.isHTMLMimeType,l=s.isHTMLRawTextElement,c=s.isHTMLVoidElement,h=s.MIME_TYPE,d=s.NAMESPACE,u=Symbol(),p=i(767),m=p.DOMException,f=p.DOMExceptionName,g=i(731);function b(t){if(t!==u)throw new TypeError("Illegal constructor")}function E(t){return""!==t}function x(t,e){return o(t,e)||(t[e]=!0),t}function y(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(E):[]}(t);return Object.keys(e.reduce(x,{}))}function N(t){if(!g.QName_exact.test(t))throw new m(m.INVALID_CHARACTER_ERR,'invalid character in qualified name "'+t+'"')}function v(t,e){N(e),t=t||null;var i=null,r=e;if(e.indexOf(":")>=0){var n=e.split(":");i=n[0],r=n[1]}if(null!==i&&null===t)throw new m(m.NAMESPACE_ERR,"prefix is non-null and namespace is null");if("xml"===i&&t!==s.NAMESPACE.XML)throw new m(m.NAMESPACE_ERR,'prefix is "xml" and namespace is not the XML namespace');if(("xmlns"===i||"xmlns"===e)&&t!==s.NAMESPACE.XMLNS)throw new m(m.NAMESPACE_ERR,'either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace');if(t===s.NAMESPACE.XMLNS&&"xmlns"!==i&&"xmlns"!==e)throw new m(m.NAMESPACE_ERR,'namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"');return[t,i,r]}function T(t,e){for(var i in t)o(t,i)&&(e[i]=t[i])}function _(t,e){var i=t.prototype;if(!(i instanceof e)){function s(){}s.prototype=e.prototype,T(i,s=new s),t.prototype=i=s}i.constructor!=t&&("function"!=typeof t&&console.error("unknown Class:"+t),i.constructor=t)}var L={},C=L.ELEMENT_NODE=1,R=L.ATTRIBUTE_NODE=2,w=L.TEXT_NODE=3,I=L.CDATA_SECTION_NODE=4,S=L.ENTITY_REFERENCE_NODE=5,A=L.ENTITY_NODE=6,O=L.PROCESSING_INSTRUCTION_NODE=7,M=L.COMMENT_NODE=8,k=L.DOCUMENT_NODE=9,D=L.DOCUMENT_TYPE_NODE=10,P=L.DOCUMENT_FRAGMENT_NODE=11,B=L.NOTATION_NODE=12,j=s.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function F(t,e){if(e.length<t.length)return F(e,t);var i=null;for(var s in t){if(t[s]!==e[s])return i;i=t[s]}return i}function U(t){return t.guid||(t.guid=Math.random()),t.guid}function H(){}function q(t,e){this._node=t,this._refresh=e,W(this)}function W(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var i=t._refresh(t._node);if(St(t,"length",i.length),!t.$$length||i.length<t.$$length)for(var s=i.length;s in t;s++)o(t,s)&&delete t[s];T(i,t),t._inc=e}}function V(){}function X(t,e){for(var i=0;i<t.length;){if(t[i]===e)return i;i++}}function z(t,e,i,s){if(s?e[X(e,s)]=i:(e[e.length]=i,e.length++),t){i.ownerElement=t;var r=t.ownerDocument;r&&(s&&Z(r,t,s),function(t,e,i){t&&t._inc++;var s=i.namespaceURI;s===d.XMLNS&&(e._nsMap[i.prefix?i.localName:""]=i.value)}(r,t,i))}}function G(t,e,i){var s=X(e,i);if(s>=0){for(var r=e.length-1;s<=r;)e[s]=e[++s];if(e.length=r,t){var n=t.ownerDocument;n&&Z(n,t,i),i.ownerElement=null}}}function J(){}function K(t){b(t)}function $(t){return("<"==t?"<":">"==t&&">")||"&"==t&&"&"||'"'==t&&"""||"&#"+t.charCodeAt()+";"}function Y(t,e){if(e(t))return!0;if(t=t.firstChild)do{if(Y(t,e))return!0}while(t=t.nextSibling)}function Q(t,e){b(t);var i=e||{};this.ownerDocument=this,this.contentType=i.contentType||h.XML_APPLICATION,this.type=a(this.contentType)?"html":"xml"}function Z(t,e,i,s){t&&t._inc++,i.namespaceURI===d.XMLNS&&delete e._nsMap[i.prefix?i.localName:""]}function tt(t,e,i){if(t&&t._inc){t._inc++;var s=e.childNodes;if(i&&!i.nextSibling)s[s.length++]=i;else{for(var r=e.firstChild,n=0;r;)s[n++]=r,r=r.nextSibling;s.length=n,delete s[s.length]}}}function et(t,e){if(t!==e.parentNode)throw new m(m.NOT_FOUND_ERR,"child's parent is not parent");var i=e.previousSibling,s=e.nextSibling;return i?i.nextSibling=s:t.firstChild=s,s?s.previousSibling=i:t.lastChild=i,tt(t.ownerDocument,t),e.parentNode=null,e.previousSibling=null,e.nextSibling=null,e}function it(t){return t&&t.nodeType===K.DOCUMENT_TYPE_NODE}function st(t){return t&&t.nodeType===K.ELEMENT_NODE}function rt(t){return t&&t.nodeType===K.TEXT_NODE}function nt(t,e){var i=t.childNodes||[];if(r(i,st)||it(e))return!1;var s=r(i,it);return!(e&&s&&i.indexOf(s)>i.indexOf(e))}function ot(t,e){var i=t.childNodes||[];if(r(i,(function(t){return st(t)&&t!==e})))return!1;var s=r(i,it);return!(e&&s&&i.indexOf(s)>i.indexOf(e))}function at(t,e,i){if(!function(t){return t&&(t.nodeType===K.DOCUMENT_NODE||t.nodeType===K.DOCUMENT_FRAGMENT_NODE||t.nodeType===K.ELEMENT_NODE)}(t))throw new m(m.HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+t.nodeType);if(i&&i.parentNode!==t)throw new m(m.NOT_FOUND_ERR,"child not in parent");if(!function(t){return t&&(t.nodeType===K.CDATA_SECTION_NODE||t.nodeType===K.COMMENT_NODE||t.nodeType===K.DOCUMENT_FRAGMENT_NODE||t.nodeType===K.DOCUMENT_TYPE_NODE||t.nodeType===K.ELEMENT_NODE||t.nodeType===K.PROCESSING_INSTRUCTION_NODE||t.nodeType===K.TEXT_NODE)}(e)||it(e)&&t.nodeType!==K.DOCUMENT_NODE)throw new m(m.HIERARCHY_REQUEST_ERR,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function lt(t,e,i){var s=t.childNodes||[],n=e.childNodes||[];if(e.nodeType===K.DOCUMENT_FRAGMENT_NODE){var o=n.filter(st);if(o.length>1||r(n,rt))throw new m(m.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===o.length&&!nt(t,i))throw new m(m.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(st(e)&&!nt(t,i))throw new m(m.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(it(e)){if(r(s,it))throw new m(m.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=r(s,st);if(i&&s.indexOf(a)<s.indexOf(i))throw new m(m.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element");if(!i&&a)throw new m(m.HIERARCHY_REQUEST_ERR,"Doctype can not be appended since element is present")}}function ct(t,e,i){var s=t.childNodes||[],n=e.childNodes||[];if(e.nodeType===K.DOCUMENT_FRAGMENT_NODE){var o=n.filter(st);if(o.length>1||r(n,rt))throw new m(m.HIERARCHY_REQUEST_ERR,"More than one element or text in fragment");if(1===o.length&&!ot(t,i))throw new m(m.HIERARCHY_REQUEST_ERR,"Element in fragment can not be inserted before doctype")}if(st(e)&&!ot(t,i))throw new m(m.HIERARCHY_REQUEST_ERR,"Only one element can be added and only after doctype");if(it(e)){function l(t){return it(t)&&t!==i}if(r(s,l))throw new m(m.HIERARCHY_REQUEST_ERR,"Only one doctype is allowed");var a=r(s,st);if(i&&s.indexOf(a)<s.indexOf(i))throw new m(m.HIERARCHY_REQUEST_ERR,"Doctype can only be inserted before an element")}}function ht(t,e,i,s){at(t,e,i),t.nodeType===K.DOCUMENT_NODE&&(s||lt)(t,e,i);var r=e.parentNode;if(r&&r.removeChild(e),e.nodeType===P){var n=e.firstChild;if(null==n)return e;var o=e.lastChild}else n=o=e;var a=i?i.previousSibling:t.lastChild;n.previousSibling=a,o.nextSibling=i,a?a.nextSibling=n:t.firstChild=n,null==i?t.lastChild=o:i.previousSibling=o;do{n.parentNode=t}while(n!==o&&(n=n.nextSibling));return tt(t.ownerDocument||t,t,e),e.nodeType==P&&(e.firstChild=e.lastChild=null),e}function dt(t){b(t),this._nsMap=Object.create(null)}function ut(t){b(t),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}function pt(t){b(t)}function mt(t){b(t)}function ft(t){b(t)}function gt(t){b(t)}function bt(t){b(t)}function Et(t){b(t)}function xt(t){b(t)}function yt(t){b(t)}function Nt(t){b(t)}function vt(t){b(t)}function Tt(){}function _t(t){var e=[],i=this.nodeType===k&&this.documentElement||this,s=i.prefix,r=i.namespaceURI;if(r&&null==s&&null==(s=i.lookupPrefix(r)))var n=[{namespace:r,prefix:null}];return Rt(this,e,t,n),e.join("")}function Lt(t,e,i){var s=t.prefix||"",r=t.namespaceURI;if(!r)return!1;if("xml"===s&&r===d.XML||r===d.XMLNS)return!1;for(var n=i.length;n--;){var o=i[n];if(o.prefix===s)return o.namespace!==r}return!0}function Ct(t,e,i){t.push(" ",e,'="',i.replace(/[<>&"\t\n\r]/g,$),'"')}function Rt(t,e,i,s){s||(s=[]);var r="html"===(t.nodeType===k?t:t.ownerDocument).type;if(i){if(!(t=i(t)))return;if("string"==typeof t)return void e.push(t)}switch(t.nodeType){case C:var n=t.attributes,o=n.length,a=t.firstChild,h=t.tagName,u=h;if(!r&&!t.prefix&&t.namespaceURI){for(var p,m=0;m<n.length;m++)if("xmlns"===n.item(m).name){p=n.item(m).value;break}if(!p)for(var f=s.length-1;f>=0;f--){if(""===(b=s[f]).prefix&&b.namespace===t.namespaceURI){p=b.namespace;break}}if(p!==t.namespaceURI)for(f=s.length-1;f>=0;f--){var b;if((b=s[f]).namespace===t.namespaceURI){b.prefix&&(u=b.prefix+":"+h);break}}}e.push("<",u);for(var E=0;E<o;E++){"xmlns"==(x=n.item(E)).prefix?s.push({prefix:x.localName,namespace:x.value}):"xmlns"==x.nodeName&&s.push({prefix:"",namespace:x.value})}for(E=0;E<o;E++){var x,y,N;if(Lt(x=n.item(E),0,s))Ct(e,(y=x.prefix||"")?"xmlns:"+y:"xmlns",N=x.namespaceURI),s.push({prefix:y,namespace:N});Rt(x,e,i,s)}if(h===u&&Lt(t,0,s))Ct(e,(y=t.prefix||"")?"xmlns:"+y:"xmlns",N=t.namespaceURI),s.push({prefix:y,namespace:N});var v=!a;if(v&&(r||t.namespaceURI===d.HTML)&&(v=c(h)),v)e.push("/>");else{if(e.push(">"),r&&l(h))for(;a;)a.data?e.push(a.data):Rt(a,e,i,s.slice()),a=a.nextSibling;else for(;a;)Rt(a,e,i,s.slice()),a=a.nextSibling;e.push("</",u,">")}return;case k:case P:for(a=t.firstChild;a;)Rt(a,e,i,s.slice()),a=a.nextSibling;return;case R:return Ct(e,t.name,t.value);case w:return e.push(t.data.replace(/[<&>]/g,$));case I:return e.push(g.CDATA_START,t.data,g.CDATA_END);case M:return e.push(g.COMMENT_START,t.data,g.COMMENT_END);case D:var T=t.publicId,_=t.systemId;return e.push(g.DOCTYPE_DECL_START," ",t.name),T?(e.push(" ",g.PUBLIC," ",T),_&&"."!==_&&e.push(" ",_)):_&&"."!==_&&e.push(" ",g.SYSTEM," ",_),t.internalSubset&&e.push(" [",t.internalSubset,"]"),void e.push(">");case O:return e.push("<?",t.target," ",t.data,"?>");case S:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function wt(t,e,i){var s;switch(e.nodeType){case C:(s=e.cloneNode(!1)).ownerDocument=t;case P:break;case R:i=!0}if(s||(s=e.cloneNode(!1)),s.ownerDocument=t,s.parentNode=null,i)for(var r=e.firstChild;r;)s.appendChild(wt(t,r,i)),r=r.nextSibling;return s}function It(t,e,i){var s=new e.constructor(u);for(var r in e)if(o(e,r)){var n=e[r];"object"!=typeof n&&n!=s[r]&&(s[r]=n)}switch(e.childNodes&&(s.childNodes=new H),s.ownerDocument=t,s.nodeType){case C:var a=e.attributes,l=s.attributes=new V,c=a.length;l._ownerElement=s;for(var h=0;h<c;h++)s.setAttributeNode(It(t,a.item(h),!0));break;case R:i=!0}if(i)for(var d=e.firstChild;d;)s.appendChild(It(t,d,i)),d=d.nextSibling;return s}function St(t,e,i){t[e]=i}H.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t){for(var e=[],i=0;i<this.length;i++)Rt(this[i],e,t);return e.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}},H.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}},q.prototype.item=function(t){return W(this),this[t]||null},_(q,H),V.prototype={length:0,item:H.prototype.item,getNamedItem:function(t){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());for(var e=0;e<this.length;){var i=this[e];if(i.nodeName===t)return i;e++}return null},setNamedItem:function(t){var e=t.ownerElement;if(e&&e!==this._ownerElement)throw new m(m.INUSE_ATTRIBUTE_ERR);var i=this.getNamedItemNS(t.namespaceURI,t.localName);return i===t?t:(z(this._ownerElement,this,t,i),i)},setNamedItemNS:function(t){return this.setNamedItem(t)},removeNamedItem:function(t){var e=this.getNamedItem(t);if(!e)throw new m(m.NOT_FOUND_ERR,t);return G(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var i=this.getNamedItemNS(t,e);if(!i)throw new m(m.NOT_FOUND_ERR,t?t+" : "+e:e);return G(this._ownerElement,this,i),i},getNamedItemNS:function(t,e){t||(t=null);for(var i=0;i<this.length;){var s=this[i];if(s.localName===e&&s.namespaceURI===t)return s;i++}return null}},V.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){return e<t.length?{value:t[e++],done:!1}:{done:!0}},return:function(){return{done:!0}}}},J.prototype={hasFeature:function(t,e){return!0},createDocument:function(t,e,i){var s=h.XML_APPLICATION;t===d.HTML?s=h.XML_XHTML_APPLICATION:t===d.SVG&&(s=h.XML_SVG_IMAGE);var r=new Q(u,{contentType:s});if(r.implementation=this,r.childNodes=new H,r.doctype=i||null,i&&r.appendChild(i),e){var n=r.createElementNS(t,e);r.appendChild(n)}return r},createDocumentType:function(t,e,i,s){N(t);var r=new bt(u);return r.name=t,r.nodeName=t,r.publicId=e||"",r.systemId=i||"",r.internalSubset=s||"",r.childNodes=new H,r},createHTMLDocument:function(t){var e=new Q(u,{contentType:h.HTML});if(e.implementation=this,e.childNodes=new H,!1!==t){e.doctype=this.createDocumentType("html"),e.doctype.ownerDocument=e,e.appendChild(e.doctype);var i=e.createElement("html");e.appendChild(i);var s=e.createElement("head");if(i.appendChild(s),"string"==typeof t){var r=e.createElement("title");r.appendChild(e.createTextNode(t)),s.appendChild(r)}i.appendChild(e.createElement("body"))}return e}},K.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:"about:blank",get isConnected(){var t=this.getRootNode();return t&&t.nodeType===t.DOCUMENT_NODE},contains:function(t){if(!t)return!1;var e=t;do{if(this===e)return!0;e=t.parentNode}while(e);return!1},getRootNode:function(t){var e=this;do{if(!e.parentNode)return e;e=e.parentNode}while(e)},isEqualNode:function(t){if(!t)return!1;if(this.nodeType!==t.nodeType)return!1;switch(this.nodeType){case this.DOCUMENT_TYPE_NODE:if(this.name!==t.name)return!1;if(this.publicId!==t.publicId)return!1;if(this.systemId!==t.systemId)return!1;break;case this.ELEMENT_NODE:if(this.namespaceURI!==t.namespaceURI)return!1;if(this.prefix!==t.prefix)return!1;if(this.localName!==t.localName)return!1;if(this.attributes.length!==t.attributes.length)return!1;for(var e=0;e<this.attributes.length;e++){var i=this.attributes.item(e);if(!i.isEqualNode(t.getAttributeNodeNS(i.namespaceURI,i.localName)))return!1}break;case this.ATTRIBUTE_NODE:if(this.namespaceURI!==t.namespaceURI)return!1;if(this.localName!==t.localName)return!1;if(this.value!==t.value)return!1;break;case this.PROCESSING_INSTRUCTION_NODE:if(this.target!==t.target||this.data!==t.data)return!1;break;case this.TEXT_NODE:case this.COMMENT_NODE:if(this.data!==t.data)return!1}if(this.childNodes.length!==t.childNodes.length)return!1;for(e=0;e<this.childNodes.length;e++)if(!this.childNodes[e].isEqualNode(t.childNodes[e]))return!1;return!0},isSameNode:function(t){return this===t},insertBefore:function(t,e){return ht(this,t,e)},replaceChild:function(t,e){ht(this,t,e,ct),e&&this.removeChild(e)},removeChild:function(t){return et(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return It(this.ownerDocument||this,this,t)},normalize:function(){for(var t=this.firstChild;t;){var e=t.nextSibling;e&&e.nodeType==w&&t.nodeType==w?(this.removeChild(e),t.appendData(e.data)):(t.normalize(),t=e)}},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},lookupPrefix:function(t){for(var e=this;e;){var i=e._nsMap;if(i)for(var s in i)if(o(i,s)&&i[s]===t)return s;e=e.nodeType==R?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var i=e._nsMap;if(i&&o(i,t))return i[t];e=e.nodeType==R?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)},compareDocumentPosition:function(t){if(this===t)return 0;var e=t,i=this,s=null,r=null;if(e instanceof ut&&(e=(s=e).ownerElement),i instanceof ut&&(i=(r=i).ownerElement,s&&e&&i===e))for(var n,o=0;n=i.attributes[o];o++){if(n===s)return j.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+j.DOCUMENT_POSITION_PRECEDING;if(n===r)return j.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+j.DOCUMENT_POSITION_FOLLOWING}if(!e||!i||i.ownerDocument!==e.ownerDocument)return j.DOCUMENT_POSITION_DISCONNECTED+j.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(U(i.ownerDocument)>U(e.ownerDocument)?j.DOCUMENT_POSITION_FOLLOWING:j.DOCUMENT_POSITION_PRECEDING);if(r&&e===i)return j.DOCUMENT_POSITION_CONTAINS+j.DOCUMENT_POSITION_PRECEDING;if(s&&e===i)return j.DOCUMENT_POSITION_CONTAINED_BY+j.DOCUMENT_POSITION_FOLLOWING;for(var a=[],l=e.parentNode;l;){if(!r&&l===i)return j.DOCUMENT_POSITION_CONTAINED_BY+j.DOCUMENT_POSITION_FOLLOWING;a.push(l),l=l.parentNode}a.reverse();for(var c=[],h=i.parentNode;h;){if(!s&&h===e)return j.DOCUMENT_POSITION_CONTAINS+j.DOCUMENT_POSITION_PRECEDING;c.push(h),h=h.parentNode}c.reverse();var d=F(a,c);for(var u in d.childNodes){var p=d.childNodes[u];if(p===i)return j.DOCUMENT_POSITION_FOLLOWING;if(p===e)return j.DOCUMENT_POSITION_PRECEDING;if(c.indexOf(p)>=0)return j.DOCUMENT_POSITION_FOLLOWING;if(a.indexOf(p)>=0)return j.DOCUMENT_POSITION_PRECEDING}return 0}},T(L,K),T(L,K.prototype),T(j,K),T(j,K.prototype),Q.prototype={implementation:null,nodeName:"#document",nodeType:k,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType===P){for(var i=t.firstChild;i;){var s=i.nextSibling;this.insertBefore(i,e),i=s}return t}return ht(this,t,e),t.ownerDocument=this,null===this.documentElement&&t.nodeType===C&&(this.documentElement=t),t},removeChild:function(t){var e=et(this,t);return e===this.documentElement&&(this.documentElement=null),e},replaceChild:function(t,e){ht(this,t,e,ct),t.ownerDocument=this,e&&this.removeChild(e),st(t)&&(this.documentElement=t)},importNode:function(t,e){return wt(this,t,e)},getElementById:function(t){var e=null;return Y(this.documentElement,(function(i){if(i.nodeType==C&&i.getAttribute("id")==t)return e=i,!0})),e},createElement:function(t){var e=new dt(u);return e.ownerDocument=this,"html"===this.type&&(t=t.toLowerCase()),n(this.contentType)&&(e.namespaceURI=d.HTML),e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new H,(e.attributes=new V)._ownerElement=e,e},createDocumentFragment:function(){var t=new Nt(u);return t.ownerDocument=this,t.childNodes=new H,t},createTextNode:function(t){var e=new mt(u);return e.ownerDocument=this,e.childNodes=new H,e.appendData(t),e},createComment:function(t){var e=new ft(u);return e.ownerDocument=this,e.childNodes=new H,e.appendData(t),e},createCDATASection:function(t){var e=new gt(u);return e.ownerDocument=this,e.childNodes=new H,e.appendData(t),e},createProcessingInstruction:function(t,e){var i=new vt(u);return i.ownerDocument=this,i.childNodes=new H,i.nodeName=i.target=t,i.nodeValue=i.data=e,i},createAttribute:function(t){if(!g.QName_exact.test(t))throw new m(m.INVALID_CHARACTER_ERR,'invalid character in name "'+t+'"');return"html"===this.type&&(t=t.toLowerCase()),this._createAttribute(t)},_createAttribute:function(t){var e=new ut(u);return e.ownerDocument=this,e.childNodes=new H,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){if(!g.Name.test(t))throw new m(m.INVALID_CHARACTER_ERR,'not a valid xml name "'+t+'"');if("html"===this.type)throw new m("document is an html document",f.NotSupportedError);var e=new yt(u);return e.ownerDocument=this,e.childNodes=new H,e.nodeName=t,e},createElementNS:function(t,e){var i=v(t,e),s=new dt(u),r=s.attributes=new V;return s.childNodes=new H,s.ownerDocument=this,s.nodeName=e,s.tagName=e,s.namespaceURI=i[0],s.prefix=i[1],s.localName=i[2],r._ownerElement=s,s},createAttributeNS:function(t,e){var i=v(t,e),s=new ut(u);return s.ownerDocument=this,s.childNodes=new H,s.nodeName=e,s.name=e,s.specified=!0,s.namespaceURI=i[0],s.prefix=i[1],s.localName=i[2],s}},_(Q,K),dt.prototype={nodeType:C,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+":"+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return"html"===this.ownerDocument.type&&this.namespaceURI===d.HTML},hasAttributes:function(){return!(!this.attributes||!this.attributes.length)},hasAttribute:function(t){return!!this.getAttributeNode(t)},getAttribute:function(t){var e=this.getAttributeNode(t);return e?e.value:null},getAttributeNode:function(t){return this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase()),this.attributes.getNamedItem(t)},setAttribute:function(t,e){this._isInHTMLDocumentAndNamespace()&&(t=t.toLowerCase());var i=this.getAttributeNode(t);i?i.value=i.nodeValue=""+e:((i=this.ownerDocument._createAttribute(t)).value=i.nodeValue=""+e,this.setAttributeNode(i))},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);i&&this.removeAttributeNode(i)},hasAttributeNS:function(t,e){return null!=this.getAttributeNodeNS(t,e)},getAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);return i?i.value:null},setAttributeNS:function(t,e,i){var s=v(t,e)[2],r=this.getAttributeNodeNS(t,s);r?r.value=r.nodeValue=""+i:((r=this.ownerDocument.createAttributeNS(t,e)).value=r.nodeValue=""+i,this.setAttributeNode(r))},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByClassName:function(t){var e=y(t);return new q(this,(function(i){var s=[];return e.length>0&&Y(i,(function(r){if(r!==i&&r.nodeType===C){var n=r.getAttribute("class");if(n){var o=t===n;if(!o){var a=y(n);o=e.every((l=a,function(t){return l&&-1!==l.indexOf(t)}))}o&&s.push(r)}}var l})),s}))},getElementsByTagName:function(t){var e="html"===(this.nodeType===k?this:this.ownerDocument).type,i=t.toLowerCase();return new q(this,(function(s){var r=[];return Y(s,(function(n){n!==s&&n.nodeType===C&&(("*"===t||n.getQualifiedName()===(e&&n.namespaceURI===d.HTML?i:t))&&r.push(n))})),r}))},getElementsByTagNameNS:function(t,e){return new q(this,(function(i){var s=[];return Y(i,(function(r){r===i||r.nodeType!==C||"*"!==t&&r.namespaceURI!==t||"*"!==e&&r.localName!=e||s.push(r)})),s}))}},Q.prototype.getElementsByClassName=dt.prototype.getElementsByClassName,Q.prototype.getElementsByTagName=dt.prototype.getElementsByTagName,Q.prototype.getElementsByTagNameNS=dt.prototype.getElementsByTagNameNS,_(dt,K),ut.prototype.nodeType=R,_(ut,K),pt.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,i){i=this.data.substring(0,t)+i+this.data.substring(t+e),this.nodeValue=this.data=i,this.length=i.length}},_(pt,K),mt.prototype={nodeName:"#text",nodeType:w,splitText:function(t){var e=this.data,i=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var s=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}},_(mt,pt),ft.prototype={nodeName:"#comment",nodeType:M},_(ft,pt),gt.prototype={nodeName:"#cdata-section",nodeType:I},_(gt,mt),bt.prototype.nodeType=D,_(bt,K),Et.prototype.nodeType=B,_(Et,K),xt.prototype.nodeType=A,_(xt,K),yt.prototype.nodeType=S,_(yt,K),Nt.prototype.nodeName="#document-fragment",Nt.prototype.nodeType=P,_(Nt,K),vt.prototype.nodeType=O,_(vt,pt),Tt.prototype.serializeToString=function(t,e){return _t.call(t,e)},K.prototype.toString=_t;try{if(Object.defineProperty){function At(t){switch(t.nodeType){case C:case P:var e=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&e.push(At(t)),t=t.nextSibling;return e.join("");default:return t.nodeValue}}Object.defineProperty(q.prototype,"length",{get:function(){return W(this),this.$$length}}),Object.defineProperty(K.prototype,"textContent",{get:function(){return At(this)},set:function(t){switch(this.nodeType){case C:case P:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),St=function(t,e,i){t["$$"+e]=i}}}catch(Ot){}e._updateLiveList=W,e.Attr=ut,e.CDATASection=gt,e.CharacterData=pt,e.Comment=ft,e.Document=Q,e.DocumentFragment=Nt,e.DocumentType=bt,e.DOMImplementation=J,e.Element=dt,e.Entity=xt,e.EntityReference=yt,e.LiveNodeList=q,e.NamedNodeMap=V,e.Node=K,e.NodeList=H,e.Notation=Et,e.Text=mt,e.ProcessingInstruction=vt,e.XMLSerializer=Tt},802:(t,e,i)=>{"use strict";var s=i(870),r=i(731),n=i(767),o=s.isHTMLEscapableRawTextElement,a=s.isHTMLMimeType,l=s.isHTMLRawTextElement,c=s.hasOwn,h=s.NAMESPACE,d=n.ParseError,u=n.DOMException;function p(){}p.prototype={parse:function(t,e,i){var n=this.domBuilder;n.startDocument(),x(e,e=Object.create(null)),function(t,e,i,n,o){var l=a(n.mimeType);t.indexOf(r.UNICODE_REPLACEMENT_CHARACTER)>=0&&o.warning("Unicode replacement character detected, source encoding issues?");function h(t){if(t>65535){var e=55296+((t-=65536)>>10),i=56320+(1023&t);return String.fromCharCode(e,i)}return String.fromCharCode(t)}function p(t){var e=";"===t[t.length-1]?t:t+";";if(!l&&e!==t)return o.error("EntityRef: expecting ;"),t;var s=r.Reference.exec(e);if(!s||s[0].length!==e.length)return o.error("entity not matching Reference production: "+t),t;var n=e.slice(1,-1);return c(i,n)?i[n]:"#"===n.charAt(0)?h(parseInt(n.substring(1).replace("x","0x"))):(o.error("entity not found:"+t),t)}function x(e){if(e>S){var i=t.substring(S,e).replace(m,p);C&&R(S),n.characters(i,0,e-S),S=e}}var y=0,_=0,L=/\r\n?|\n|$/g,C=n.locator;function R(e,i){for(;e>=_&&(i=L.exec(t));)y=_,_=i.index+i[0].length,C.lineNumber++;C.columnNumber=e-y+1}var w=[{currentNSMap:e}],I=[],S=0;for(;;){try{var A=t.indexOf("<",S);if(A<0){if(!l&&I.length>0)return o.fatalError("unclosed xml tag(s): "+I.join(", "));if(!t.substring(S).match(/^\s*$/)){var O=n.doc,M=O.createTextNode(t.substring(S));if(O.documentElement)return o.error("Extra content at the end of the document");O.appendChild(M),n.currentElement=M}return}if(A>S){var k=t.substring(S,A);l||0!==I.length||(k=k.replace(new RegExp(r.S_OPT.source,"g"),""))&&o.error("Unexpected content outside root element: '"+k+"'"),x(A)}switch(t.charAt(A+1)){case"/":var D=t.indexOf(">",A+2),P=t.substring(A+2,D>0?D:void 0);if(!P)return o.fatalError("end tag name missing");var B=D>0&&r.reg("^",r.QName_group,r.S_OPT,"$").exec(P);if(!B)return o.fatalError('end tag name contains invalid characters: "'+P+'"');if(!n.currentElement&&!n.doc.documentElement)return;var j=I[I.length-1]||n.currentElement.tagName||n.doc.documentElement.tagName||"";if(j!==B[1]){var F=B[1].toLowerCase();if(!l||j.toLowerCase()!==F)return o.fatalError('Opening and ending tag mismatch: "'+j+'" != "'+P+'"')}var U=w.pop();I.pop();var H=U.localNSMap;if(n.endElement(U.uri,U.localName,j),H)for(var q in H)c(H,q)&&n.endPrefixMapping(q);D++;break;case"?":C&&R(A),D=v(t,A,n,o);break;case"!":C&&R(A),D=N(t,A,n,o,l);break;default:C&&R(A);var W=new T,V=w[w.length-1].currentNSMap,X=(D=g(t,A,W,V,p,o,l),W.length);if(W.closed||(l&&s.isHTMLVoidElement(W.tagName)?W.closed=!0:I.push(W.tagName)),C&&X){for(var z=f(C,{}),G=0;G<X;G++){var J=W[G];R(J.offset),J.locator=f(C,{})}n.locator=z,b(W,n,V)&&w.push(W),n.locator=C}else b(W,n,V)&&w.push(W);l&&!W.closed?D=E(t,D,W.tagName,p,n):D++}}catch(t){if(t instanceof d)throw t;if(t instanceof u)throw new d(t.name+": "+t.message,n.locator,t);o.error("element parse error: "+t),D=-1}D>S?S=D:x(Math.max(A,S)+1)}}(t,e,i,n,this.errorHandler),n.endDocument()}};var m=/&#?\w+;?/g;function f(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function g(t,e,i,s,r,n,o){function a(t,e,s){return c(i.attributeNames,t)?n.fatalError("Attribute "+t+" redefined"):!o&&e.indexOf("<")>=0?n.fatalError("Unescaped '<' not allowed in attributes values"):void i.addValue(t,e.replace(/[\t\n\r]/g," ").replace(m,r),s)}for(var l,h=++e,d=0;;){var u=t.charAt(h);switch(u){case"=":if(1===d)l=t.slice(e,h),d=3;else{if(2!==d)throw new Error("attribute equal must after attrName");d=3}break;case"'":case'"':if(3===d||1===d){if(1===d&&(n.warning('attribute value must after "="'),l=t.slice(e,h)),e=h+1,!((h=t.indexOf(u,e))>0))throw new Error("attribute value no end '"+u+"' match");a(l,p=t.slice(e,h),e-1),d=5}else{if(4!=d)throw new Error('attribute value must after "="');a(l,p=t.slice(e,h),e),n.warning('attribute "'+l+'" missed start quot('+u+")!!"),e=h+1,d=5}break;case"/":switch(d){case 0:i.setTagName(t.slice(e,h));case 5:case 6:case 7:d=7,i.closed=!0;case 4:case 1:break;case 2:i.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),0==d&&i.setTagName(t.slice(e,h)),h;case">":switch(d){case 0:i.setTagName(t.slice(e,h));case 5:case 6:case 7:break;case 4:case 1:"/"===(p=t.slice(e,h)).slice(-1)&&(i.closed=!0,p=p.slice(0,-1));case 2:2===d&&(p=l),4==d?(n.warning('attribute "'+p+'" missed quot(")!'),a(l,p,e)):(o||n.warning('attribute "'+p+'" missed value!! "'+p+'" instead!!'),a(p,p,e));break;case 3:if(!o)return n.fatalError("AttValue: ' or \" expected")}return h;case"\x80":u=" ";default:if(u<=" ")switch(d){case 0:i.setTagName(t.slice(e,h)),d=6;break;case 1:l=t.slice(e,h),d=2;break;case 4:var p=t.slice(e,h);n.warning('attribute "'+p+'" missed quot(")!!'),a(l,p,e);case 5:d=6}else switch(d){case 2:o||n.warning('attribute "'+l+'" missed value!! "'+l+'" instead2!!'),a(l,l,e),e=h,d=1;break;case 5:n.warning('attribute space is required"'+l+'"!!');case 6:d=1,e=h;break;case 3:d=4,e=h;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}h++}}function b(t,e,i){for(var s=t.tagName,r=null,n=t.length;n--;){var o=t[n],a=o.qName,l=o.value;if((m=a.indexOf(":"))>0)var d=o.prefix=a.slice(0,m),u=a.slice(m+1),p="xmlns"===d&&u;else u=a,d=null,p="xmlns"===a&&"";o.localName=u,!1!==p&&(null==r&&(r=Object.create(null),x(i,i=Object.create(null))),i[p]=r[p]=l,o.uri=h.XMLNS,e.startPrefixMapping(p,l))}for(n=t.length;n--;)(o=t[n]).prefix&&("xml"===o.prefix&&(o.uri=h.XML),"xmlns"!==o.prefix&&(o.uri=i[o.prefix]));var m;(m=s.indexOf(":"))>0?(d=t.prefix=s.slice(0,m),u=t.localName=s.slice(m+1)):(d=null,u=t.localName=s);var f=t.uri=i[d||""];if(e.startElement(f,u,s,t),!t.closed)return t.currentNSMap=i,t.localNSMap=r,!0;if(e.endElement(f,u,s),r)for(d in r)c(r,d)&&e.endPrefixMapping(d)}function E(t,e,i,s,r){var n=o(i);if(n||l(i)){var a=t.indexOf("</"+i+">",e),c=t.substring(e+1,a);return n&&(c=c.replace(m,s)),r.characters(c,0,c.length),a}return e+1}function x(t,e){for(var i in t)c(t,i)&&(e[i]=t[i])}function y(t,e){var i=e;function s(e){return e=e||0,t.charAt(i+e)}function n(t){i+=t=t||1}function o(){return t.substring(i)}return{char:s,getIndex:function(){return i},getMatch:function(t){var e=r.reg("^",t).exec(o());return e?(n(e[0].length),e[0]):null},getSource:function(){return t},skip:n,skipBlanks:function(){for(var e=0;i<t.length;){var r=s();if(" "!==r&&"\n"!==r&&"\t"!==r&&"\r"!==r)return e;e++,n()}return-1},substringFromIndex:o,substringStartsWith:function(e){return t.substring(i,i+e.length)===e},substringStartsWithCaseInsensitive:function(e){return t.substring(i,i+e.length).toUpperCase()===e.toUpperCase()}}}function N(t,e,i,s,n){var o=y(t,e);switch(n?o.char(2).toUpperCase():o.char(2)){case"-":var a=o.getMatch(r.Comment);return a?(i.comment(a,r.COMMENT_START.length,a.length-r.COMMENT_START.length-r.COMMENT_END.length),o.getIndex()):s.fatalError("comment is not well-formed at position "+o.getIndex());case"[":var l=o.getMatch(r.CDSect);return l?n||i.currentElement?(i.startCDATA(),i.characters(l,r.CDATA_START.length,l.length-r.CDATA_START.length-r.CDATA_END.length),i.endCDATA(),o.getIndex()):s.fatalError("CDATA outside of element"):s.fatalError("Invalid CDATA starting at position "+e);case"D":if(i.doc&&i.doc.documentElement)return s.fatalError("Doctype not allowed inside or after documentElement at position "+o.getIndex());if(n?!o.substringStartsWithCaseInsensitive(r.DOCTYPE_DECL_START):!o.substringStartsWith(r.DOCTYPE_DECL_START))return s.fatalError("Expected "+r.DOCTYPE_DECL_START+" at position "+o.getIndex());if(o.skip(r.DOCTYPE_DECL_START.length),o.skipBlanks()<1)return s.fatalError("Expected whitespace after "+r.DOCTYPE_DECL_START+" at position "+o.getIndex());var c={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(c.name=o.getMatch(r.Name),!c.name)return s.fatalError("doctype name missing or contains unexpected characters at position "+o.getIndex());if(n&&"html"!==c.name.toLowerCase()&&s.warning("Unexpected DOCTYPE in HTML document at position "+o.getIndex()),o.skipBlanks(),o.substringStartsWith(r.PUBLIC)||o.substringStartsWith(r.SYSTEM)){var h=r.ExternalID_match.exec(o.substringFromIndex());if(!h)return s.fatalError("doctype external id is not well-formed at position "+o.getIndex());void 0!==h.groups.SystemLiteralOnly?c.systemId=h.groups.SystemLiteralOnly:(c.systemId=h.groups.SystemLiteral,c.publicId=h.groups.PubidLiteral),o.skip(h[0].length)}else if(n&&o.substringStartsWithCaseInsensitive(r.SYSTEM)){if(o.skip(r.SYSTEM.length),o.skipBlanks()<1)return s.fatalError("Expected whitespace after "+r.SYSTEM+" at position "+o.getIndex());if(c.systemId=o.getMatch(r.ABOUT_LEGACY_COMPAT_SystemLiteral),!c.systemId)return s.fatalError("Expected "+r.ABOUT_LEGACY_COMPAT+" in single or double quotes after "+r.SYSTEM+" at position "+o.getIndex())}return n&&c.systemId&&!r.ABOUT_LEGACY_COMPAT_SystemLiteral.test(c.systemId)&&s.warning("Unexpected doctype.systemId in HTML document at position "+o.getIndex()),n||(o.skipBlanks(),c.internalSubset=function(t,e){function i(t,e){var i=r.PI.exec(t.substringFromIndex());return i?"xml"===i[1].toLowerCase()?e.fatalError("xml declaration is only allowed at the start of the document, but found at position "+t.getIndex()):(t.skip(i[0].length),i[0]):e.fatalError("processing instruction is not well-formed at position "+t.getIndex())}var s=t.getSource();if("["===t.char()){t.skip(1);for(var n=t.getIndex();t.getIndex()<s.length;){if(t.skipBlanks(),"]"===t.char()){var o=s.substring(n,t.getIndex());return t.skip(1),o}var a=null;if("<"===t.char()&&"!"===t.char(1))switch(t.char(2)){case"E":"L"===t.char(3)?a=t.getMatch(r.elementdecl):"N"===t.char(3)&&(a=t.getMatch(r.EntityDecl));break;case"A":a=t.getMatch(r.AttlistDecl);break;case"N":a=t.getMatch(r.NotationDecl);break;case"-":a=t.getMatch(r.Comment)}else if("<"===t.char()&&"?"===t.char(1))a=i(t,e);else{if("%"!==t.char())return e.fatalError("Error detected in Markup declaration");a=t.getMatch(r.PEReference)}if(!a)return e.fatalError("Error in internal subset at position "+t.getIndex())}return e.fatalError("doctype internal subset is not well-formed, missing ]")}}(o,s)),o.skipBlanks(),">"!==o.char()?s.fatalError("doctype not terminated with > at position "+o.getIndex()):(o.skip(1),i.startDTD(c.name,c.publicId,c.systemId,c.internalSubset),i.endDTD(),o.getIndex());default:return s.fatalError('Not well-formed XML starting with "<!" at position '+e)}}function v(t,e,i,s){var n=t.substring(e).match(r.PI);if(!n)return s.fatalError("Invalid processing instruction starting at position "+e);if("xml"===n[1].toLowerCase()){if(e>0)return s.fatalError("processing instruction at position "+e+" is an xml declaration which is only at the start of the document");if(!r.XMLDecl.test(t.substring(e)))return s.fatalError("xml declaration is not well-formed")}return i.processingInstruction(n[1],n[2]),e+n[0].length}function T(){this.attributeNames=Object.create(null)}T.prototype={setTagName:function(t){if(!r.QName_exact.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,i){if(!r.QName_exact.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:i}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}},e.XMLReader=p,e.parseUtils=y,e.parseDoctypeCommentOrCData=N},870:(t,e)=>{"use strict";function i(t,e){return void 0===e&&(e=Object),e&&"function"==typeof e.getOwnPropertyDescriptors&&(t=e.create(null,e.getOwnPropertyDescriptors(t))),e&&"function"==typeof e.freeze?e.freeze(t):t}function s(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var r=i({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0});var n=i({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});var o=i({script:!1,style:!1,textarea:!0,title:!0});function a(t){return t===l.HTML}var l=i({HTML:"text/html",XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),c=Object.keys(l).map((function(t){return l[t]}));var h=i({HTML:"http://www.w3.org/1999/xhtml",SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});e.assign=function(t,e){if(null===t||"object"!=typeof t)throw new TypeError("target is not an object");for(var i in e)s(e,i)&&(t[i]=e[i]);return t},e.find=function(t,e,i){if(void 0===i&&(i=Array.prototype),t&&"function"==typeof i.find)return i.find.call(t,e);for(var r=0;r<t.length;r++)if(s(t,r)){var n=t[r];if(e.call(void 0,n,r,t))return n}},e.freeze=i,e.HTML_BOOLEAN_ATTRIBUTES=r,e.HTML_RAW_TEXT_ELEMENTS=o,e.HTML_VOID_ELEMENTS=n,e.hasDefaultHTMLNamespace=function(t){return a(t)||t===l.XML_XHTML_APPLICATION},e.hasOwn=s,e.isHTMLBooleanAttribute=function(t){return s(r,t.toLowerCase())},e.isHTMLRawTextElement=function(t){var e=t.toLowerCase();return s(o,e)&&!o[e]},e.isHTMLEscapableRawTextElement=function(t){var e=t.toLowerCase();return s(o,e)&&o[e]},e.isHTMLMimeType=a,e.isHTMLVoidElement=function(t){return s(n,t.toLowerCase())},e.isValidMimeType=function(t){return c.indexOf(t)>-1},e.MIME_TYPE=l,e.NAMESPACE=h},904:(t,e,i)=>{"use strict";i.d(e,{u:()=>s});class s{static ensureLocale(t,e){return s.LOCALES.get(t)?t:(console.error(`Locale ${t} does not exist! Using ${s.LOCALES.get(e)} instead.`),e)}}s.VERSION="5.0.0-beta.3",s.LOCALES=new Map([["af","Afrikaans"],["ca","Catalan"],["da","Danish"],["de","German"],["en","English"],["es","Spanish"],["euro","Euro"],["fr","French"],["hi","Hindi"],["it","Italian"],["ko","Korean"],["nb","Bokm\xe5l"],["nn","Nynorsk"],["sv","Swedish"],["nemeth","Nemeth"]]),s.mathjaxVersion="4.0.0",s.url="https://cdn.jsdelivr.net/npm/speech-rule-engine@"+s.VERSION+"/lib/mathmaps"},999:(t,e,i)=>{(function(){"use strict";var e=this;function i(t){return"string"==typeof t}function s(t,e,i){return t.call.apply(t.bind,arguments)}function r(t,e,i){if(!t)throw Error();if(2<arguments.length){var s=Array.prototype.slice.call(arguments,2);return function(){var i=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(i,s),t.apply(e,i)}}return function(){return t.apply(e,arguments)}}function n(t,e,i){return(n=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?s:r).apply(null,arguments)}function o(t){var e=ot;function i(){}i.prototype=e.prototype,t.G=e.prototype,t.prototype=new i,t.prototype.constructor=t,t.F=function(t,i,s){for(var r=Array(arguments.length-2),n=2;n<arguments.length;n++)r[n-2]=arguments[n];return e.prototype[i].apply(t,r)}}var a=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};function l(t,e){return-1!=t.indexOf(e)}function c(t,e){return t<e?-1:t>e?1:0}var h,d=Array.prototype.indexOf?function(t,e,i){return Array.prototype.indexOf.call(t,e,i)}:function(t,e,s){if(s=null==s?0:0>s?Math.max(0,t.length+s):s,i(t))return i(e)&&1==e.length?t.indexOf(e,s):-1;for(;s<t.length;s++)if(s in t&&t[s]===e)return s;return-1},u=Array.prototype.forEach?function(t,e,i){Array.prototype.forEach.call(t,e,i)}:function(t,e,s){for(var r=t.length,n=i(t)?t.split(""):t,o=0;o<r;o++)o in n&&e.call(s,n[o],o,t)},p=Array.prototype.filter?function(t,e,i){return Array.prototype.filter.call(t,e,i)}:function(t,e,s){for(var r=t.length,n=[],o=0,a=i(t)?t.split(""):t,l=0;l<r;l++)if(l in a){var c=a[l];e.call(s,c,l,t)&&(n[o++]=c)}return n},m=Array.prototype.reduce?function(t,e,i,s){return s&&(e=n(e,s)),Array.prototype.reduce.call(t,e,i)}:function(t,e,i,s){var r=i;return u(t,(function(i,n){r=e.call(s,r,i,n,t)})),r},f=Array.prototype.some?function(t,e,i){return Array.prototype.some.call(t,e,i)}:function(t,e,s){for(var r=t.length,n=i(t)?t.split(""):t,o=0;o<r;o++)if(o in n&&e.call(s,n[o],o,t))return!0;return!1};t:{var g=e.navigator;if(g){var b=g.userAgent;if(b){h=b;break t}}h=""}var E,x,y=l(h,"Opera")||l(h,"OPR"),N=l(h,"Trident")||l(h,"MSIE"),v=l(h,"Edge"),T=l(h,"Gecko")&&!(l(h.toLowerCase(),"webkit")&&!l(h,"Edge"))&&!(l(h,"Trident")||l(h,"MSIE"))&&!l(h,"Edge"),_=l(h.toLowerCase(),"webkit")&&!l(h,"Edge");function L(){var t=e.document;return t?t.documentMode:void 0}t:{var C="",R=(x=h,T?/rv\:([^\);]+)(\)|;)/.exec(x):v?/Edge\/([\d\.]+)/.exec(x):N?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(x):_?/WebKit\/(\S+)/.exec(x):y?/(?:Version)[ \/]?(\S+)/.exec(x):void 0);if(R&&(C=R?R[1]:""),N){var w=L();if(null!=w&&w>parseFloat(C)){E=String(w);break t}}E=C}var I={};function S(t){if(!I[t]){for(var e=0,i=a(String(E)).split("."),s=a(String(t)).split("."),r=Math.max(i.length,s.length),n=0;0==e&&n<r;n++){var o=i[n]||"",l=s[n]||"",h=/(\d*)(\D*)/g,d=/(\d*)(\D*)/g;do{var u=h.exec(o)||["","",""],p=d.exec(l)||["","",""];if(0==u[0].length&&0==p[0].length)break;e=c(0==u[1].length?0:parseInt(u[1],10),0==p[1].length?0:parseInt(p[1],10))||c(0==u[2].length,0==p[2].length)||c(u[2],p[2])}while(0==e)}I[t]=0<=e}}var A=e.document,O=A&&N?L()||("CSS1Compat"==A.compatMode?parseInt(E,10):5):void 0,M=N&&!(9<=Number(O)),k=N&&!(8<=Number(O));function D(t,e,i,s){this.a=t,this.nodeName=i,this.nodeValue=s,this.nodeType=2,this.parentNode=this.ownerElement=e}function P(t,e){var i=k&&"href"==e.nodeName?t.getAttribute(e.nodeName,2):e.nodeValue;return new D(e,t,e.nodeName,i)}function B(t){var e=null;if(1==(i=t.nodeType)&&(e=null==(e=null==(e=t.textContent)||null==e?t.innerText:e)||null==e?"":e),"string"!=typeof e)if(M&&"title"==t.nodeName.toLowerCase()&&1==i)e=t.text;else if(9==i||1==i){t=9==i?t.documentElement:t.firstChild;var i=0,s=[];for(e="";t;){do{1!=t.nodeType&&(e+=t.nodeValue),M&&"title"==t.nodeName.toLowerCase()&&(e+=t.text),s[i++]=t}while(t=t.firstChild);for(;i&&!(t=s[--i].nextSibling););}}else e=t.nodeValue;return""+e}function j(t,e,i){if(null===e)return!0;try{if(!t.getAttribute)return!1}catch(t){return!1}return k&&"class"==e&&(e="className"),null==i?!!t.getAttribute(e):t.getAttribute(e,2)==i}function F(t,e,s,r,n){return(M?U:H).call(null,t,e,i(s)?s:null,i(r)?r:null,n||new $)}function U(t,e,i,s,r){if(t instanceof kt||8==t.b||i&&null===t.b){var n=e.all;if(!n)return r;if("*"!=(t=X(t))&&!(n=e.getElementsByTagName(t)))return r;if(i){for(var o=[],a=0;e=n[a++];)j(e,i,s)&&o.push(e);n=o}for(a=0;e=n[a++];)"*"==t&&"!"==e.tagName||tt(r,e);return r}return V(t,e,i,s,r),r}function H(t,e,i,s,r){return e.getElementsByName&&s&&"name"==i&&!N?(e=e.getElementsByName(s),u(e,(function(e){t.a(e)&&tt(r,e)}))):e.getElementsByClassName&&s&&"class"==i?(e=e.getElementsByClassName(s),u(e,(function(e){e.className==s&&t.a(e)&&tt(r,e)}))):t instanceof Lt?V(t,e,i,s,r):e.getElementsByTagName&&(e=e.getElementsByTagName(t.f()),u(e,(function(t){j(t,i,s)&&tt(r,t)}))),r}function q(t,e,i,s,r){var n;if((t instanceof kt||8==t.b||i&&null===t.b)&&(n=e.childNodes)){var o=X(t);return"*"==o||(n=p(n,(function(t){return t.tagName&&t.tagName.toLowerCase()==o})),n)?(i&&(n=p(n,(function(t){return j(t,i,s)}))),u(n,(function(t){"*"==o&&("!"==t.tagName||"*"==o&&1!=t.nodeType)||tt(r,t)})),r):r}return W(t,e,i,s,r)}function W(t,e,i,s,r){for(e=e.firstChild;e;e=e.nextSibling)j(e,i,s)&&t.a(e)&&tt(r,e);return r}function V(t,e,i,s,r){for(e=e.firstChild;e;e=e.nextSibling)j(e,i,s)&&t.a(e)&&tt(r,e),V(t,e,i,s,r)}function X(t){if(t instanceof Lt){if(8==t.b)return"!";if(null===t.b)return"*"}return t.f()}function z(t,e){if(!t||!e)return!1;if(t.contains&&1==e.nodeType)return t==e||t.contains(e);if(void 0!==t.compareDocumentPosition)return t==e||!!(16&t.compareDocumentPosition(e));for(;e&&t!=e;)e=e.parentNode;return e==t}function G(t,i){if(t==i)return 0;if(t.compareDocumentPosition)return 2&t.compareDocumentPosition(i)?1:-1;if(N&&!(9<=Number(O))){if(9==t.nodeType)return-1;if(9==i.nodeType)return 1}if("sourceIndex"in t||t.parentNode&&"sourceIndex"in t.parentNode){var s=1==t.nodeType,r=1==i.nodeType;if(s&&r)return t.sourceIndex-i.sourceIndex;var n=t.parentNode,o=i.parentNode;return n==o?K(t,i):!s&&z(n,i)?-1*J(t,i):!r&&z(o,t)?J(i,t):(s?t.sourceIndex:n.sourceIndex)-(r?i.sourceIndex:o.sourceIndex)}return(s=(r=9==t.nodeType?t:t.ownerDocument||t.document).createRange()).selectNode(t),s.collapse(!0),(r=r.createRange()).selectNode(i),r.collapse(!0),s.compareBoundaryPoints(e.Range.START_TO_END,r)}function J(t,e){var i=t.parentNode;if(i==e)return-1;for(var s=e;s.parentNode!=i;)s=s.parentNode;return K(s,t)}function K(t,e){for(var i=e;i=i.previousSibling;)if(i==t)return-1;return 1}function $(){this.b=this.a=null,this.l=0}function Y(t){this.node=t,this.a=this.b=null}function Q(t,e){if(!t.a)return e;if(!e.a)return t;for(var i=t.a,s=e.a,r=null,n=null,o=0;i&&s;){n=i.node;var a=s.node;n==a||n instanceof D&&a instanceof D&&n.a==a.a?(n=i,i=i.a,s=s.a):0<G(i.node,s.node)?(n=s,s=s.a):(n=i,i=i.a),(n.b=r)?r.a=n:t.a=n,r=n,o++}for(n=i||s;n;)n.b=r,r=r.a=n,o++,n=n.a;return t.b=r,t.l=o,t}function Z(t,e){var i=new Y(e);i.a=t.a,t.b?t.a.b=i:t.a=t.b=i,t.a=i,t.l++}function tt(t,e){var i=new Y(e);i.b=t.b,t.a?t.b.a=i:t.a=t.b=i,t.b=i,t.l++}function et(t){return(t=t.a)?t.node:null}function it(t){return(t=et(t))?B(t):""}function st(t,e){return new rt(t,!!e)}function rt(t,e){this.f=t,this.b=(this.c=e)?t.b:t.a,this.a=null}function nt(t){var e=t.b;if(null==e)return null;var i=t.a=e;return t.b=t.c?e.b:e.a,i.node}function ot(t){this.i=t,this.b=this.g=!1,this.f=null}function at(t){return"\n "+t.toString().split("\n").join("\n ")}function lt(t,e){t.g=e}function ct(t,e){t.b=e}function ht(t,e){var i=t.a(e);return i instanceof $?+it(i):+i}function dt(t,e){var i=t.a(e);return i instanceof $?it(i):""+i}function ut(t,e){var i=t.a(e);return i instanceof $?!!i.l:!!i}function pt(t,e,i){ot.call(this,t.i),this.c=t,this.h=e,this.o=i,this.g=e.g||i.g,this.b=e.b||i.b,this.c==Et&&(i.b||i.g||4==i.i||0==i.i||!e.f?e.b||e.g||4==e.i||0==e.i||!i.f||(this.f={name:i.f.name,s:e}):this.f={name:e.f.name,s:i})}function mt(t,e,i,s,r){var n;if(e=e.a(s),i=i.a(s),e instanceof $&&i instanceof $){for(s=nt(e=st(e));s;s=nt(e))for(n=nt(r=st(i));n;n=nt(r))if(t(B(s),B(n)))return!0;return!1}if(e instanceof $||i instanceof $){e instanceof $?(r=e,s=i):(r=i,s=e);for(var o=typeof s,a=nt(n=st(r));a;a=nt(n)){switch(o){case"number":a=+B(a);break;case"boolean":a=!!B(a);break;case"string":a=B(a);break;default:throw Error("Illegal primitive type for comparison.")}if(r==e&&t(a,s)||r==i&&t(s,a))return!0}return!1}return r?"boolean"==typeof e||"boolean"==typeof i?t(!!e,!!i):"number"==typeof e||"number"==typeof i?t(+e,+i):t(e,i):t(+e,+i)}function ft(t,e,i,s){this.a=t,this.w=e,this.i=i,this.m=s}!T&&!N||N&&9<=Number(O)||T&&S("1.9.1"),N&&S("9"),o(pt),pt.prototype.a=function(t){return this.c.m(this.h,this.o,t)},pt.prototype.toString=function(){return"Binary Expression: "+this.c+at(this.h)+at(this.o)},ft.prototype.toString=function(){return this.a};var gt={};function bt(t,e,i,s){if(gt.hasOwnProperty(t))throw Error("Binary operator already created: "+t);return t=new ft(t,e,i,s),gt[t.toString()]=t}bt("div",6,1,(function(t,e,i){return ht(t,i)/ht(e,i)})),bt("mod",6,1,(function(t,e,i){return ht(t,i)%ht(e,i)})),bt("*",6,1,(function(t,e,i){return ht(t,i)*ht(e,i)})),bt("+",5,1,(function(t,e,i){return ht(t,i)+ht(e,i)})),bt("-",5,1,(function(t,e,i){return ht(t,i)-ht(e,i)})),bt("<",4,2,(function(t,e,i){return mt((function(t,e){return t<e}),t,e,i)})),bt(">",4,2,(function(t,e,i){return mt((function(t,e){return t>e}),t,e,i)})),bt("<=",4,2,(function(t,e,i){return mt((function(t,e){return t<=e}),t,e,i)})),bt(">=",4,2,(function(t,e,i){return mt((function(t,e){return t>=e}),t,e,i)}));var Et=bt("=",3,2,(function(t,e,i){return mt((function(t,e){return t==e}),t,e,i,!0)}));function xt(t,e,i){this.a=t,this.b=e||1,this.f=i||1}function yt(t,e){if(e.a.length&&4!=t.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");ot.call(this,t.i),this.c=t,this.h=e,this.g=t.g,this.b=t.b}function Nt(t,e){if(e.length<t.A)throw Error("Function "+t.j+" expects at least"+t.A+" arguments, "+e.length+" given");if(null!==t.v&&e.length>t.v)throw Error("Function "+t.j+" expects at most "+t.v+" arguments, "+e.length+" given");t.B&&u(e,(function(e,i){if(4!=e.i)throw Error("Argument "+i+" to function "+t.j+" is not of type Nodeset: "+e)})),ot.call(this,t.i),this.h=t,this.c=e,lt(this,t.g||f(e,(function(t){return t.g}))),ct(this,t.D&&!e.length||t.C&&!!e.length||f(e,(function(t){return t.b})))}function vt(t,e,i,s,r,n,o,a,l){this.j=t,this.i=e,this.g=i,this.D=s,this.C=r,this.m=n,this.A=o,this.v=void 0!==a?a:o,this.B=!!l}bt("!=",3,2,(function(t,e,i){return mt((function(t,e){return t!=e}),t,e,i,!0)})),bt("and",2,2,(function(t,e,i){return ut(t,i)&&ut(e,i)})),bt("or",1,2,(function(t,e,i){return ut(t,i)||ut(e,i)})),o(yt),yt.prototype.a=function(t){return t=this.c.a(t),Ht(this.h,t)},yt.prototype.toString=function(){return"Filter:"+at(this.c)+at(this.h)},o(Nt),Nt.prototype.a=function(t){return this.h.m.apply(null,function(t){return Array.prototype.concat.apply(Array.prototype,arguments)}(t,this.c))},Nt.prototype.toString=function(){var t="Function: "+this.h;if(this.c.length){var e=m(this.c,(function(t,e){return t+at(e)}),"Arguments:");t=t+at(e)}return t},vt.prototype.toString=function(){return this.j};var Tt={};function _t(t,e,i,s,r,n,o,a){if(Tt.hasOwnProperty(t))throw Error("Function already created: "+t+".");Tt[t]=new vt(t,e,i,s,!1,r,n,o,a)}function Lt(t,e){switch(this.h=t,this.c=void 0!==e?e:null,this.b=null,t){case"comment":this.b=8;break;case"text":this.b=3;break;case"processing-instruction":this.b=7;break;case"node":break;default:throw Error("Unexpected argument")}}function Ct(t){return"comment"==t||"text"==t||"processing-instruction"==t||"node"==t}function Rt(t){this.b=t,this.a=0}_t("boolean",2,!1,!1,(function(t,e){return ut(e,t)}),1),_t("ceiling",1,!1,!1,(function(t,e){return Math.ceil(ht(e,t))}),1),_t("concat",3,!1,!1,(function(t,e){return m(function(t,e,i){return 2>=arguments.length?Array.prototype.slice.call(t,e):Array.prototype.slice.call(t,e,i)}(arguments,1),(function(e,i){return e+dt(i,t)}),"")}),2,null),_t("contains",2,!1,!1,(function(t,e,i){return l(dt(e,t),dt(i,t))}),2),_t("count",1,!1,!1,(function(t,e){return e.a(t).l}),1,1,!0),_t("false",2,!1,!1,(function(){return!1}),0),_t("floor",1,!1,!1,(function(t,e){return Math.floor(ht(e,t))}),1),_t("id",4,!1,!1,(function(t,e){function s(t){if(M){var e=r.all[t];if(e){if(e.nodeType&&t==e.id)return e;if(e.length)return function(t,e){var s;t:{s=t.length;for(var r=i(t)?t.split(""):t,n=0;n<s;n++)if(n in r&&e.call(void 0,r[n],n,t)){s=n;break t}s=-1}return 0>s?null:i(t)?t.charAt(s):t[s]}(e,(function(e){return t==e.id}))}return null}return r.getElementById(t)}var r=9==(n=t.a).nodeType?n:n.ownerDocument,n=dt(e,t).split(/\s+/),o=[];u(n,(function(t){!(t=s(t))||0<=d(o,t)||o.push(t)})),o.sort(G);var a=new $;return u(o,(function(t){tt(a,t)})),a}),1),_t("lang",2,!1,!1,(function(){return!1}),1),_t("last",1,!0,!1,(function(t){if(1!=arguments.length)throw Error("Function last expects ()");return t.f}),0),_t("local-name",3,!1,!0,(function(t,e){var i=e?et(e.a(t)):t.a;return i?i.localName||i.nodeName.toLowerCase():""}),0,1,!0),_t("name",3,!1,!0,(function(t,e){var i=e?et(e.a(t)):t.a;return i?i.nodeName.toLowerCase():""}),0,1,!0),_t("namespace-uri",3,!0,!1,(function(){return""}),0,1,!0),_t("normalize-space",3,!1,!0,(function(t,e){return(e?dt(e,t):B(t.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")}),0,1),_t("not",2,!1,!1,(function(t,e){return!ut(e,t)}),1),_t("number",1,!1,!0,(function(t,e){return e?ht(e,t):+B(t.a)}),0,1),_t("position",1,!0,!1,(function(t){return t.b}),0),_t("round",1,!1,!1,(function(t,e){return Math.round(ht(e,t))}),1),_t("starts-with",2,!1,!1,(function(t,e,i){return e=dt(e,t),t=dt(i,t),0==e.lastIndexOf(t,0)}),2),_t("string",3,!1,!0,(function(t,e){return e?dt(e,t):B(t.a)}),0,1),_t("string-length",1,!1,!0,(function(t,e){return(e?dt(e,t):B(t.a)).length}),0,1),_t("substring",3,!1,!1,(function(t,e,i,s){if(i=ht(i,t),isNaN(i)||1/0==i||-1/0==i)return"";if(s=s?ht(s,t):1/0,isNaN(s)||-1/0===s)return"";i=Math.round(i)-1;var r=Math.max(i,0);return t=dt(e,t),1/0==s?t.substring(r):t.substring(r,i+Math.round(s))}),2,3),_t("substring-after",3,!1,!1,(function(t,e,i){return e=dt(e,t),t=dt(i,t),-1==(i=e.indexOf(t))?"":e.substring(i+t.length)}),2),_t("substring-before",3,!1,!1,(function(t,e,i){return e=dt(e,t),t=dt(i,t),-1==(t=e.indexOf(t))?"":e.substring(0,t)}),2),_t("sum",1,!1,!1,(function(t,e){for(var i=st(e.a(t)),s=0,r=nt(i);r;r=nt(i))s+=+B(r);return s}),1,1,!0),_t("translate",3,!1,!1,(function(t,e,i,s){e=dt(e,t),i=dt(i,t);var r=dt(s,t);for(t={},s=0;s<i.length;s++){var n=i.charAt(s);n in t||(t[n]=r.charAt(s))}for(i="",s=0;s<e.length;s++)i+=(n=e.charAt(s))in t?t[n]:n;return i}),3),_t("true",2,!1,!1,(function(){return!0}),0),Lt.prototype.a=function(t){return null===this.b||this.b==t.nodeType},Lt.prototype.f=function(){return this.h},Lt.prototype.toString=function(){var t="Kind Test: "+this.h;return null===this.c||(t+=at(this.c)),t};var wt=/\$?(?:(?![0-9-\.])(?:\*|[\w-\.]+):)?(?![0-9-\.])(?:\*|[\w-\.]+)|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|\s+|./g,It=/^\s/;function St(t,e){return t.b[t.a+(e||0)]}function At(t){return t.b[t.a++]}function Ot(t){return t.b.length<=t.a}function Mt(t){ot.call(this,3),this.c=t.substring(1,t.length-1)}function kt(t,e){var i;this.j=t.toLowerCase(),i="*"==this.j?"*":"http://www.w3.org/1999/xhtml",this.c=e?e.toLowerCase():i}function Dt(t,e){if(ot.call(this,t.i),this.h=t,this.c=e,this.g=t.g,this.b=t.b,1==this.c.length){var i=this.c[0];i.u||i.c!=zt||"*"!=(i=i.o).f()&&(this.f={name:i.f(),s:null})}}function Pt(){ot.call(this,4)}function Bt(){ot.call(this,4)}function jt(t){return"/"==t||"//"==t}function Ft(t){ot.call(this,4),this.c=t,lt(this,f(this.c,(function(t){return t.g}))),ct(this,f(this.c,(function(t){return t.b})))}function Ut(t,e){this.a=t,this.b=!!e}function Ht(t,e,i){for(i=i||0;i<t.a.length;i++)for(var s,r=t.a[i],n=st(e),o=e.l,a=0;s=nt(n);a++){var l=t.b?o-a:a+1;if("number"==typeof(s=r.a(new xt(s,l,o))))l=l==s;else if("string"==typeof s||"boolean"==typeof s)l=!!s;else{if(!(s instanceof $))throw Error("Predicate.evaluate returned an unexpected type.");l=0<s.l}if(!l){if(s=(l=n).f,!(h=l.a))throw Error("Next must be called at least once before remove.");var c=h.b,h=h.a;c?c.a=h:s.a=h,h?h.b=c:s.b=c,s.l--,l.a=null}}return e}function qt(t,e,i,s){ot.call(this,4),this.c=t,this.o=e,this.h=i||new Ut([]),this.u=!!s,e=0<(e=this.h).a.length?e.a[0].f:null,t.b&&e&&(t=e.name,t=M?t.toLowerCase():t,this.f={name:t,s:e.s});t:{for(t=this.h,e=0;e<t.a.length;e++)if((i=t.a[e]).g||1==i.i||0==i.i){t=!0;break t}t=!1}this.g=t}function Wt(t,e,i,s){this.j=t,this.f=e,this.a=i,this.b=s}o(Mt),Mt.prototype.a=function(){return this.c},Mt.prototype.toString=function(){return"Literal: "+this.c},kt.prototype.a=function(t){var e=t.nodeType;return(1==e||2==e)&&(e=void 0!==t.localName?t.localName:t.nodeName,("*"==this.j||this.j==e.toLowerCase())&&("*"==this.c||this.c==(t.namespaceURI?t.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")))},kt.prototype.f=function(){return this.j},kt.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j},o(Dt),o(Pt),Pt.prototype.a=function(t){var e=new $;return 9==(t=t.a).nodeType?tt(e,t):tt(e,t.ownerDocument),e},Pt.prototype.toString=function(){return"Root Helper Expression"},o(Bt),Bt.prototype.a=function(t){var e=new $;return tt(e,t.a),e},Bt.prototype.toString=function(){return"Context Helper Expression"},Dt.prototype.a=function(t){var e=this.h.a(t);if(!(e instanceof $))throw Error("Filter expression must evaluate to nodeset.");for(var i=0,s=(t=this.c).length;i<s&&e.l;i++){var r,n=t[i],o=st(e,n.c.a);if(n.g||n.c!=Kt)if(n.g||n.c!=Yt)for(r=nt(o),e=n.a(new xt(r));null!=(r=nt(o));)e=Q(e,r=n.a(new xt(r)));else r=nt(o),e=n.a(new xt(r));else{for(r=nt(o);(e=nt(o))&&(!r.contains||r.contains(e))&&8&e.compareDocumentPosition(r);r=e);e=n.a(new xt(r))}}return e},Dt.prototype.toString=function(){var t;if(t="Path Expression:"+at(this.h),this.c.length){var e=m(this.c,(function(t,e){return t+at(e)}),"Steps:");t+=at(e)}return t},o(Ft),Ft.prototype.a=function(t){var e=new $;return u(this.c,(function(i){if(!((i=i.a(t))instanceof $))throw Error("Path expression must evaluate to NodeSet.");e=Q(e,i)})),e},Ft.prototype.toString=function(){return m(this.c,(function(t,e){return t+at(e)}),"Union Expression:")},Ut.prototype.toString=function(){return m(this.a,(function(t,e){return t+at(e)}),"Predicates:")},o(qt),qt.prototype.a=function(t){var e=t.a,i=null,s=null,r=null,n=0;if((i=this.f)&&(s=i.name,r=i.s?dt(i.s,t):null,n=1),this.u)if(this.g||this.c!=Gt)if(e=nt(t=st(new qt(Jt,new Lt("node")).a(t))))for(i=this.m(e,s,r,n);null!=(e=nt(t));)i=Q(i,this.m(e,s,r,n));else i=new $;else i=F(this.o,e,s,r),i=Ht(this.h,i,n);else i=this.m(t.a,s,r,n);return i},qt.prototype.m=function(t,e,i,s){return t=this.c.f(this.o,t,e,i),Ht(this.h,t,s)},qt.prototype.toString=function(){var t;if(t="Step:"+at("Operator: "+(this.u?"//":"/")),this.c.j&&(t+=at("Axis: "+this.c)),t+=at(this.o),this.h.a.length){var e=m(this.h.a,(function(t,e){return t+at(e)}),"Predicates:");t+=at(e)}return t},Wt.prototype.toString=function(){return this.j};var Vt={};function Xt(t,e,i,s){if(Vt.hasOwnProperty(t))throw Error("Axis already created: "+t);return e=new Wt(t,e,i,!!s),Vt[t]=e}Xt("ancestor",(function(t,e){for(var i=new $,s=e;s=s.parentNode;)t.a(s)&&Z(i,s);return i}),!0),Xt("ancestor-or-self",(function(t,e){var i=new $,s=e;do{t.a(s)&&Z(i,s)}while(s=s.parentNode);return i}),!0);var zt=Xt("attribute",(function(t,e){var i=new $;if("style"==(n=t.f())&&M&&e.style)return tt(i,new D(e.style,e,"style",e.style.cssText)),i;var s=e.attributes;if(s)if(t instanceof Lt&&null===t.b||"*"==n)for(var r,n=0;r=s[n];n++)M?r.nodeValue&&tt(i,P(e,r)):tt(i,r);else(r=s.getNamedItem(n))&&(M?r.nodeValue&&tt(i,P(e,r)):tt(i,r));return i}),!1),Gt=Xt("child",(function(t,e,s,r,n){return(M?q:W).call(null,t,e,i(s)?s:null,i(r)?r:null,n||new $)}),!1,!0);Xt("descendant",F,!1,!0);var Jt=Xt("descendant-or-self",(function(t,e,i,s){var r=new $;return j(e,i,s)&&t.a(e)&&tt(r,e),F(t,e,i,s,r)}),!1,!0),Kt=Xt("following",(function(t,e,i,s){var r=new $;do{for(var n=e;n=n.nextSibling;)j(n,i,s)&&t.a(n)&&tt(r,n),r=F(t,n,i,s,r)}while(e=e.parentNode);return r}),!1,!0);Xt("following-sibling",(function(t,e){for(var i=new $,s=e;s=s.nextSibling;)t.a(s)&&tt(i,s);return i}),!1),Xt("namespace",(function(){return new $}),!1);var $t=Xt("parent",(function(t,e){var i=new $;if(9==e.nodeType)return i;if(2==e.nodeType)return tt(i,e.ownerElement),i;var s=e.parentNode;return t.a(s)&&tt(i,s),i}),!1),Yt=Xt("preceding",(function(t,e,i,s){var r=new $,n=[];do{n.unshift(e)}while(e=e.parentNode);for(var o=1,a=n.length;o<a;o++){var l=[];for(e=n[o];e=e.previousSibling;)l.unshift(e);for(var c=0,h=l.length;c<h;c++)j(e=l[c],i,s)&&t.a(e)&&tt(r,e),r=F(t,e,i,s,r)}return r}),!0,!0);Xt("preceding-sibling",(function(t,e){for(var i=new $,s=e;s=s.previousSibling;)t.a(s)&&Z(i,s);return i}),!0);var Qt=Xt("self",(function(t,e){var i=new $;return t.a(e)&&tt(i,e),i}),!1);function Zt(t){ot.call(this,1),this.c=t,this.g=t.g,this.b=t.b}function te(t){ot.call(this,1),this.c=t}function ee(t,e){this.a=t,this.b=e}function ie(t){for(var e,i=[];;){se(t,"Missing right hand side of binary expression."),e=he(t);var s=At(t.a);if(!s)break;var r=(s=gt[s]||null)&&s.w;if(!r){t.a.a--;break}for(;i.length&&r<=i[i.length-1].w;)e=new pt(i.pop(),i.pop(),e);i.push(e,s)}for(;i.length;)e=new pt(i.pop(),i.pop(),e);return e}function se(t,e){if(Ot(t.a))throw Error(e)}function re(t,e){var i=At(t.a);if(i!=e)throw Error("Bad token, expected: "+e+" got: "+i)}function ne(t){if(")"!=(t=At(t.a)))throw Error("Bad token: "+t)}function oe(t){if(2>(t=At(t.a)).length)throw Error("Unclosed literal string");return new Mt(t)}function ae(t){var e,i,s=[];if(jt(St(t.a))){if(e=At(t.a),i=St(t.a),"/"==e&&(Ot(t.a)||"."!=i&&".."!=i&&"@"!=i&&"*"!=i&&!/(?![0-9])[\w]/.test(i)))return new Pt;i=new Pt,se(t,"Missing next location step."),e=le(t,e),s.push(e)}else{t:{switch(i=(e=St(t.a)).charAt(0)){case"$":throw Error("Variable reference not allowed in HTML XPath");case"(":At(t.a),e=ie(t),se(t,'unclosed "("'),re(t,")");break;case'"':case"'":e=oe(t);break;default:if(isNaN(+e)){if(Ct(e)||!/(?![0-9])[\w]/.test(i)||"("!=St(t.a,1)){e=null;break t}for(e=At(t.a),e=Tt[e]||null,At(t.a),i=[];")"!=St(t.a)&&(se(t,"Missing function argument list."),i.push(ie(t)),","==St(t.a));)At(t.a);se(t,"Unclosed function argument list."),ne(t),e=new Nt(e,i)}else e=new te(+At(t.a))}"["==St(t.a)&&(e=new yt(e,i=new Ut(ce(t))))}if(e){if(!jt(St(t.a)))return e;i=e}else e=le(t,"/"),i=new Bt,s.push(e)}for(;jt(St(t.a));)e=At(t.a),se(t,"Missing next location step."),e=le(t,e),s.push(e);return new Dt(i,s)}function le(t,e){var i,s,r,n;if("/"!=e&&"//"!=e)throw Error('Step op should be "/" or "//"');if("."==St(t.a))return s=new qt(Qt,new Lt("node")),At(t.a),s;if(".."==St(t.a))return s=new qt($t,new Lt("node")),At(t.a),s;if("@"==St(t.a))n=zt,At(t.a),se(t,"Missing attribute name");else if("::"==St(t.a,1)){if(!/(?![0-9])[\w]/.test(St(t.a).charAt(0)))throw Error("Bad token: "+At(t.a));if(i=At(t.a),!(n=Vt[i]||null))throw Error("No axis with name: "+i);At(t.a),se(t,"Missing node name")}else n=Gt;if(i=St(t.a),!/(?![0-9])[\w\*]/.test(i.charAt(0)))throw Error("Bad token: "+At(t.a));if("("==St(t.a,1)){if(!Ct(i))throw Error("Invalid node type: "+i);if(!Ct(i=At(t.a)))throw Error("Invalid type name: "+i);re(t,"("),se(t,"Bad nodetype");var o=null;'"'!=(r=St(t.a).charAt(0))&&"'"!=r||(o=oe(t)),se(t,"Bad nodetype"),ne(t),i=new Lt(i,o)}else if(-1==(r=(i=At(t.a)).indexOf(":")))i=new kt(i);else{var a;if("*"==(o=i.substring(0,r)))a="*";else if(!(a=t.b(o)))throw Error("Namespace prefix not declared: "+o);i=new kt(i=i.substr(r+1),a)}return r=new Ut(ce(t),n.a),s||new qt(n,i,r,"//"==e)}function ce(t){for(var e=[];"["==St(t.a);){At(t.a),se(t,"Missing predicate expression.");var i=ie(t);e.push(i),se(t,"Unclosed predicate expression."),re(t,"]")}return e}function he(t){if("-"==St(t.a))return At(t.a),new Zt(he(t));var e=ae(t);if("|"!=St(t.a))t=e;else{for(e=[e];"|"==At(t.a);)se(t,"Missing next union location path."),e.push(ae(t));t.a.a--,t=new Ft(e)}return t}function de(t){switch(t.nodeType){case 1:return function(t,e){var i=Array.prototype.slice.call(arguments,1);return function(){var e=i.slice();return e.push.apply(e,arguments),t.apply(this,e)}}(pe,t);case 9:return de(t.documentElement);case 11:case 10:case 6:case 12:return ue;default:return t.parentNode?de(t.parentNode):ue}}function ue(){return null}function pe(t,e){if(t.prefix==e)return t.namespaceURI||"http://www.w3.org/1999/xhtml";var i=t.getAttributeNode("xmlns:"+e);return i&&i.specified?i.value||null:t.parentNode&&9!=t.parentNode.nodeType?pe(t.parentNode,e):null}function me(t,e){if(!t.length)throw Error("Empty XPath expression.");var i=function(t){t=t.match(wt);for(var e=0;e<t.length;e++)It.test(t[e])&&t.splice(e,1);return new Rt(t)}(t);if(Ot(i))throw Error("Invalid XPath expression.");e?"function"==function(t){var e=typeof t;if("object"==e){if(!t)return"null";if(t instanceof Array)return"array";if(t instanceof Object)return e;var i=Object.prototype.toString.call(t);if("[object Window]"==i)return"object";if("[object Array]"==i||"number"==typeof t.length&&void 0!==t.splice&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("splice"))return"array";if("[object Function]"==i||void 0!==t.call&&void 0!==t.propertyIsEnumerable&&!t.propertyIsEnumerable("call"))return"function"}else if("function"==e&&void 0===t.call)return"object";return e}(e)||(e=n(e.lookupNamespaceURI,e)):e=function(){return null};var s=ie(new ee(i,e));if(!Ot(i))throw Error("Bad token: "+At(i));this.evaluate=function(t,e){return new fe(s.a(new xt(t)),e)}}function fe(t,e){if(0==e)if(t instanceof $)e=4;else if("string"==typeof t)e=2;else if("number"==typeof t)e=1;else{if("boolean"!=typeof t)throw Error("Unexpected evaluation result.");e=3}if(2!=e&&1!=e&&3!=e&&!(t instanceof $))throw Error("value could not be converted to the specified type");var i;switch(this.resultType=e,e){case 2:this.stringValue=t instanceof $?it(t):""+t;break;case 1:this.numberValue=t instanceof $?+it(t):+t;break;case 3:this.booleanValue=t instanceof $?0<t.l:!!t;break;case 4:case 5:case 6:case 7:var s=st(t);i=[];for(var r=nt(s);r;r=nt(s))i.push(r instanceof D?r.a:r);this.snapshotLength=t.l,this.invalidIteratorState=!1;break;case 8:case 9:s=et(t),this.singleNodeValue=s instanceof D?s.a:s;break;default:throw Error("Unknown XPathResult type.")}var n=0;this.iterateNext=function(){if(4!=e&&5!=e)throw Error("iterateNext called with wrong result type");return n>=i.length?null:i[n++]},this.snapshotItem=function(t){if(6!=e&&7!=e)throw Error("snapshotItem called with wrong result type");return t>=i.length||0>t?null:i[t]}}function ge(t){this.lookupNamespaceURI=de(t)}function be(t,i){var s=t||e,r=s.Document&&s.Document.prototype||s.document;r.evaluate&&!i||(s.XPathResult=fe,r.evaluate=function(t,e,i,s){return new me(t,i).evaluate(e,s)},r.createExpression=function(t,e){return new me(t,e)},r.createNSResolver=function(t){return new ge(t)})}o(Zt),Zt.prototype.a=function(t){return-ht(this.c,t)},Zt.prototype.toString=function(){return"Unary Expression: -"+at(this.c)},o(te),te.prototype.a=function(){return this.c},te.prototype.toString=function(){return"Number: "+this.c},fe.ANY_TYPE=0,fe.NUMBER_TYPE=1,fe.STRING_TYPE=2,fe.BOOLEAN_TYPE=3,fe.UNORDERED_NODE_ITERATOR_TYPE=4,fe.ORDERED_NODE_ITERATOR_TYPE=5,fe.UNORDERED_NODE_SNAPSHOT_TYPE=6,fe.ORDERED_NODE_SNAPSHOT_TYPE=7,fe.ANY_UNORDERED_NODE_TYPE=8,fe.FIRST_ORDERED_NODE_TYPE=9;var Ee,xe=["wgxpath","install"],ye=e;xe[0]in ye||!ye.execScript||ye.execScript("var "+xe[0]);for(;xe.length&&(Ee=xe.shift());)xe.length||void 0===be?ye=ye[Ee]?ye[Ee]:ye[Ee]={}:ye[Ee]=be;t.exports.install=be,t.exports.XPathResultType={ANY_TYPE:0,NUMBER_TYPE:1,STRING_TYPE:2,BOOLEAN_TYPE:3,UNORDERED_NODE_ITERATOR_TYPE:4,ORDERED_NODE_ITERATOR_TYPE:5,UNORDERED_NODE_SNAPSHOT_TYPE:6,ORDERED_NODE_SNAPSHOT_TYPE:7,ANY_UNORDERED_NODE_TYPE:8,FIRST_ORDERED_NODE_TYPE:9}}).call(i.g)}},__webpack_module_cache__={},leafPrototypes,getProto;function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var i=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](i,i.exports,__webpack_require__),i.exports}getProto=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,__webpack_require__.t=function(t,e){if(1&e&&(t=this(t)),8&e)return t;if("object"==typeof t&&t){if(4&e&&t.__esModule)return t;if(16&e&&"function"==typeof t.then)return t}var i=Object.create(null);__webpack_require__.r(i);var s={};leafPrototypes=leafPrototypes||[null,getProto({}),getProto([]),getProto(getProto)];for(var r=2&e&&t;("object"==typeof r||"function"==typeof r)&&!~leafPrototypes.indexOf(r);r=getProto(r))Object.getOwnPropertyNames(r).forEach((e=>s[e]=()=>t[e]));return s.default=()=>t,__webpack_require__.d(i,s),i},__webpack_require__.d=(t,e)=>{for(var i in e)__webpack_require__.o(e,i)&&!__webpack_require__.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),__webpack_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),__webpack_require__.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__={};(()=>{"use strict";var t={};__webpack_require__.r(t),__webpack_require__.d(t,{GLOBAL:()=>yi,MathJax:()=>Li,combineConfig:()=>vi,combineDefaults:()=>Ti,combineWithMathJax:()=>_i,isObject:()=>Ni});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{context:()=>Ri,hasWindow:()=>Ci});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{Package:()=>Ii,PackageError:()=>wi});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{PrioritizedList:()=>Si});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{FunctionList:()=>Ai});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{CONFIG:()=>ji,Loader:()=>Pi,MathJax:()=>Bi,PathFilters:()=>ki});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{APPEND:()=>Hi,Expandable:()=>Vi,OPTIONS:()=>Wi,REMOVE:()=>qi,copy:()=>Ji,defaultOptions:()=>$i,expandable:()=>Xi,insert:()=>Ki,isObject:()=>Ui,keys:()=>Gi,lookup:()=>es,makeArray:()=>zi,selectOptions:()=>Qi,selectOptionsFromKeys:()=>Zi,separateOptions:()=>ts,userOptions:()=>Yi});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{CONFIG:()=>ns,MathJax:()=>rs,Startup:()=>ss});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{AbstractDOMAdaptor:()=>as});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{HTMLAdaptor:()=>cs});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{browserAdaptor:()=>ds});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{AbstractFindMath:()=>us});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{AbstractInputJax:()=>ps});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{AbstractOutputJax:()=>ms});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{END:()=>fs,LinkedList:()=>bs,ListItem:()=>gs});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{AbstractMathList:()=>Es});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{AbstractMathItem:()=>ys,STATE:()=>Ns,newState:()=>vs,protoItem:()=>xs});var b={};__webpack_require__.r(b),__webpack_require__.d(b,{AbstractFactory:()=>Ts});var E={};__webpack_require__.r(E),__webpack_require__.d(E,{AbstractNodeFactory:()=>_s});var x={};__webpack_require__.r(x),__webpack_require__.d(x,{Attributes:()=>Cs,INHERIT:()=>Ls});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{AbstractEmptyNode:()=>ws,AbstractNode:()=>Rs});var N={};__webpack_require__.r(N),__webpack_require__.d(N,{AbstractMmlBaseNode:()=>js,AbstractMmlEmptyNode:()=>Fs,AbstractMmlLayoutNode:()=>Bs,AbstractMmlNode:()=>Ds,AbstractMmlTokenNode:()=>Ps,MATHVARIANTS:()=>Ms,TEXCLASS:()=>Is,TEXCLASSNAMES:()=>Ss,TextNode:()=>Us,XMLNode:()=>Hs,indentAttributes:()=>ks});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{MmlMath:()=>qs});var T={};__webpack_require__.r(T),__webpack_require__.d(T,{MmlMi:()=>Ws});var _={};__webpack_require__.r(_),__webpack_require__.d(_,{MmlMn:()=>Vs});var L={};__webpack_require__.r(L),__webpack_require__.d(L,{MMLSPACING:()=>Ks,MO:()=>zs,OPDEF:()=>Xs,OPTABLE:()=>$s,RANGES:()=>Gs,getRange:()=>Js});var C={};__webpack_require__.r(C),__webpack_require__.d(C,{isPercent:()=>er,quotePattern:()=>Qs,replaceUnicode:()=>sr,sortLength:()=>Ys,split:()=>ir,toEntity:()=>rr,unicodeChars:()=>Zs,unicodeString:()=>tr});var R={};__webpack_require__.r(R),__webpack_require__.d(R,{MmlMo:()=>nr});var w={};__webpack_require__.r(w),__webpack_require__.d(w,{MmlMtext:()=>or});var I={};__webpack_require__.r(I),__webpack_require__.d(I,{MmlMspace:()=>ar});var S={};__webpack_require__.r(S),__webpack_require__.d(S,{MmlMs:()=>lr});var A={};__webpack_require__.r(A),__webpack_require__.d(A,{MmlInferredMrow:()=>hr,MmlMrow:()=>cr});var O={};__webpack_require__.r(O),__webpack_require__.d(O,{MmlMfrac:()=>dr});var M={};__webpack_require__.r(M),__webpack_require__.d(M,{MmlMsqrt:()=>ur});var k={};__webpack_require__.r(k),__webpack_require__.d(k,{MmlMroot:()=>pr});var D={};__webpack_require__.r(D),__webpack_require__.d(D,{MmlMstyle:()=>mr});var P={};__webpack_require__.r(P),__webpack_require__.d(P,{MmlMerror:()=>fr});var B={};__webpack_require__.r(B),__webpack_require__.d(B,{MmlMpadded:()=>gr});var j={};__webpack_require__.r(j),__webpack_require__.d(j,{MmlMphantom:()=>br});var F={};__webpack_require__.r(F),__webpack_require__.d(F,{MmlMfenced:()=>Er});var U={};__webpack_require__.r(U),__webpack_require__.d(U,{MmlMenclose:()=>xr});var H={};__webpack_require__.r(H),__webpack_require__.d(H,{MmlMaction:()=>yr});var q={};__webpack_require__.r(q),__webpack_require__.d(q,{MmlMsub:()=>vr,MmlMsubsup:()=>Nr,MmlMsup:()=>Tr});var W={};__webpack_require__.r(W),__webpack_require__.d(W,{MmlMover:()=>Cr,MmlMunder:()=>Lr,MmlMunderover:()=>_r});var V={};__webpack_require__.r(V),__webpack_require__.d(V,{MmlMmultiscripts:()=>Rr,MmlMprescripts:()=>wr,MmlNone:()=>Ir});var X={};__webpack_require__.r(X),__webpack_require__.d(X,{MmlMtable:()=>Sr});var z={};__webpack_require__.r(z),__webpack_require__.d(z,{MmlMlabeledtr:()=>Or,MmlMtr:()=>Ar});var G={};__webpack_require__.r(G),__webpack_require__.d(G,{MmlMtd:()=>Mr});var J={};__webpack_require__.r(J),__webpack_require__.d(J,{MmlMaligngroup:()=>kr});var K={};__webpack_require__.r(K),__webpack_require__.d(K,{MmlMalignmark:()=>Dr});var $={};__webpack_require__.r($),__webpack_require__.d($,{MmlMglyph:()=>Pr});var Y={};__webpack_require__.r(Y),__webpack_require__.d(Y,{MmlAnnotation:()=>Fr,MmlAnnotationXML:()=>jr,MmlSemantics:()=>Br});var Q={};__webpack_require__.r(Q),__webpack_require__.d(Q,{TeXAtom:()=>Ur});var Z={};__webpack_require__.r(Z),__webpack_require__.d(Z,{MathChoice:()=>Hr});var tt={};__webpack_require__.r(tt),__webpack_require__.d(tt,{HtmlNode:()=>qr});var et={};__webpack_require__.r(et),__webpack_require__.d(et,{MML:()=>Wr});var it={};__webpack_require__.r(it),__webpack_require__.d(it,{MmlFactory:()=>Vr});var st={};__webpack_require__.r(st),__webpack_require__.d(st,{BitField:()=>Xr,BitFieldClass:()=>zr});var rt={};__webpack_require__.r(rt),__webpack_require__.d(rt,{handleRetriesFor:()=>Gr,retryAfter:()=>Jr});var nt={};__webpack_require__.r(nt),__webpack_require__.d(nt,{AbstractMathDocument:()=>sn,RenderList:()=>$r,resetAllOptions:()=>Qr,resetOptions:()=>Yr});var ot={};__webpack_require__.r(ot),__webpack_require__.d(ot,{AbstractHandler:()=>nn});var at={};__webpack_require__.r(at),__webpack_require__.d(at,{HandlerList:()=>on});var lt={};__webpack_require__.r(lt),__webpack_require__.d(lt,{AbstractVisitor:()=>an});var ct={};__webpack_require__.r(ct),__webpack_require__.d(ct,{DATAMJX:()=>ln,MmlVisitor:()=>cn});var ht={};__webpack_require__.r(ht),__webpack_require__.d(ht,{MathMLVisitor:()=>hn});var dt={};__webpack_require__.r(dt),__webpack_require__.d(dt,{SerializedMmlVisitor:()=>dn});var ut={};__webpack_require__.r(ut),__webpack_require__.d(ut,{AbstractWrapper:()=>un});var pt={};__webpack_require__.r(pt),__webpack_require__.d(pt,{AbstractWrapperFactory:()=>pn});var mt={};__webpack_require__.r(mt),__webpack_require__.d(mt,{mathjax:()=>mn});var ft={};__webpack_require__.r(ft),__webpack_require__.d(ft,{HTMLMathItem:()=>fn});var gt={};__webpack_require__.r(gt),__webpack_require__.d(gt,{HTMLMathList:()=>gn});var bt={};__webpack_require__.r(bt),__webpack_require__.d(bt,{HTMLDomStrings:()=>bn});var Et={};__webpack_require__.r(Et),__webpack_require__.d(Et,{HTMLDocument:()=>En});var xt={};__webpack_require__.r(xt),__webpack_require__.d(xt,{HTMLHandler:()=>xn});var yt={};__webpack_require__.r(yt),__webpack_require__.d(yt,{RegisterHTMLHandler:()=>yn});var Nt={};__webpack_require__.r(Nt),__webpack_require__.d(Nt,{StyleJsonSheet:()=>Nn});var vt={};__webpack_require__.r(vt),__webpack_require__.d(vt,{DraggableDialog:()=>_n,isDialog:()=>Tn});var Tt={};__webpack_require__.r(Tt),__webpack_require__.d(Tt,{InfoDialog:()=>Ln});var _t={};__webpack_require__.r(_t),__webpack_require__.d(_t,{asyncLoad:()=>Cn});var Lt={};__webpack_require__.r(Lt),__webpack_require__.d(Lt,{BIGDIMEN:()=>Rn,MATHSPACE:()=>Sn,RELUNITS:()=>In,UNITS:()=>wn,em:()=>Mn,length2em:()=>An,percent:()=>On,px:()=>kn});var Ct={};__webpack_require__.r(Ct),__webpack_require__.d(Ct,{BBox:()=>Dn});var Rt={};__webpack_require__.r(Rt),__webpack_require__.d(Rt,{add:()=>Fn,entities:()=>Bn,numeric:()=>Wn,options:()=>Pn,remove:()=>Un,translate:()=>Hn});var wt={};__webpack_require__.r(wt),__webpack_require__.d(wt,{Styles:()=>eo,TRBL:()=>Vn,WSC:()=>Xn});var It={};__webpack_require__.r(It),__webpack_require__.d(It,{max:()=>so,sum:()=>io});var St={};__webpack_require__.r(St),__webpack_require__.d(St,{FindMathML:()=>no});var At={};__webpack_require__.r(At),__webpack_require__.d(At,{MathMLCompile:()=>oo});var Ot={};__webpack_require__.r(Ot),__webpack_require__.d(Ot,{MathML:()=>ao});var Mt={};__webpack_require__.r(Mt),__webpack_require__.d(Mt,{DIRECTION:()=>lo,H:()=>ho,V:()=>co});var kt={};__webpack_require__.r(kt),__webpack_require__.d(kt,{DIRECTION:()=>lo,FontData:()=>fo,NOSTRETCH:()=>po,mergeOptions:()=>mo});var Dt={};__webpack_require__.r(Dt),__webpack_require__.d(Dt,{LineBBox:()=>go});var Pt={};__webpack_require__.r(Pt),__webpack_require__.d(Pt,{LinebreakVisitor:()=>xo,Linebreaks:()=>Eo,NOBREAK:()=>bo});var Bt={};__webpack_require__.r(Bt),__webpack_require__.d(Bt,{CommonOutputJax:()=>No,FONTPATH:()=>yo});var jt={};__webpack_require__.r(jt),__webpack_require__.d(jt,{CommonWrapperFactory:()=>vo});var Ft={};__webpack_require__.r(Ft),__webpack_require__.d(Ft,{CommonWrapper:()=>Ro,SPACE:()=>Co});var Ut={};__webpack_require__.r(Ut),__webpack_require__.d(Ut,{ChtmlWrapper:()=>Io,FONTSIZE:()=>wo});var Ht={};__webpack_require__.r(Ht),__webpack_require__.d(Ht,{CommonMathMixin:()=>So});var qt={};__webpack_require__.r(qt),__webpack_require__.d(qt,{ChtmlMath:()=>Ao});var Wt={};__webpack_require__.r(Wt),__webpack_require__.d(Wt,{CommonMiMixin:()=>Oo});var Vt={};__webpack_require__.r(Vt),__webpack_require__.d(Vt,{ChtmlMi:()=>Mo});var Xt={};__webpack_require__.r(Xt),__webpack_require__.d(Xt,{CommonMoMixin:()=>ko});var zt={};__webpack_require__.r(zt),__webpack_require__.d(zt,{Usage:()=>Do});var Gt={};__webpack_require__.r(Gt),__webpack_require__.d(Gt,{AddCSS:()=>Bo,ChtmlFontData:()=>Po,DIRECTION:()=>lo,FontData:()=>fo,NOSTRETCH:()=>po,mergeOptions:()=>mo});var Jt={};__webpack_require__.r(Jt),__webpack_require__.d(Jt,{ChtmlMo:()=>jo});var Kt={};__webpack_require__.r(Kt),__webpack_require__.d(Kt,{CommonMnMixin:()=>Fo});var $t={};__webpack_require__.r($t),__webpack_require__.d($t,{ChtmlMn:()=>Uo});var Yt={};__webpack_require__.r(Yt),__webpack_require__.d(Yt,{CommonMsMixin:()=>Ho});var Qt={};__webpack_require__.r(Qt),__webpack_require__.d(Qt,{ChtmlMs:()=>qo});var Zt={};__webpack_require__.r(Zt),__webpack_require__.d(Zt,{CommonMtextMixin:()=>Wo});var te={};__webpack_require__.r(te),__webpack_require__.d(te,{ChtmlMtext:()=>Vo});var ee={};__webpack_require__.r(ee),__webpack_require__.d(ee,{CommonMspaceMixin:()=>Xo});var ie={};__webpack_require__.r(ie),__webpack_require__.d(ie,{ChtmlMspace:()=>zo});var se={};__webpack_require__.r(se),__webpack_require__.d(se,{CommonMpaddedMixin:()=>Go});var re={};__webpack_require__.r(re),__webpack_require__.d(re,{ChtmlMpadded:()=>Jo});var ne={};__webpack_require__.r(ne),__webpack_require__.d(ne,{ARROWDX:()=>$o,ARROWX:()=>Ko,ARROWY:()=>Yo,CommonArrow:()=>ga,CommonBorder:()=>ua,CommonBorder2:()=>pa,CommonDiagonalArrow:()=>fa,CommonDiagonalStrike:()=>ma,PADDING:()=>Zo,SOLID:()=>ta,THICKNESS:()=>Qo,arrowBBox:()=>da,arrowBBoxHD:()=>aa,arrowBBoxW:()=>la,arrowDef:()=>ca,arrowHead:()=>oa,diagonalArrowDef:()=>ha,fullBBox:()=>sa,fullBorder:()=>na,fullPadding:()=>ra,sideIndex:()=>ea,sideNames:()=>ia});var oe={};__webpack_require__.r(oe),__webpack_require__.d(oe,{CommonMencloseMixin:()=>ba});var ae={};__webpack_require__.r(ae),__webpack_require__.d(ae,{ARROWDX:()=>$o,ARROWX:()=>Ko,ARROWY:()=>Yo,Arrow:()=>Ta,Border:()=>xa,Border2:()=>ya,CommonArrow:()=>ga,CommonBorder:()=>ua,CommonBorder2:()=>pa,CommonDiagonalArrow:()=>fa,CommonDiagonalStrike:()=>ma,DiagonalArrow:()=>va,DiagonalStrike:()=>Na,PADDING:()=>Zo,RenderElement:()=>Ea,SOLID:()=>ta,THICKNESS:()=>Qo,arrowBBox:()=>da,arrowBBoxHD:()=>aa,arrowBBoxW:()=>la,arrowDef:()=>ca,arrowHead:()=>oa,diagonalArrowDef:()=>ha,fullBBox:()=>sa,fullBorder:()=>na,fullPadding:()=>ra,sideIndex:()=>ea,sideNames:()=>ia});var le={};__webpack_require__.r(le),__webpack_require__.d(le,{ChtmlMenclose:()=>Ca});var ce={};__webpack_require__.r(ce),__webpack_require__.d(ce,{CommonInferredMrowMixin:()=>wa,CommonMrowMixin:()=>Ra});var he={};__webpack_require__.r(he),__webpack_require__.d(he,{ChtmlInferredMrow:()=>Sa,ChtmlMrow:()=>Ia});var de={};__webpack_require__.r(de),__webpack_require__.d(de,{CommonMfencedMixin:()=>Aa});var ue={};__webpack_require__.r(ue),__webpack_require__.d(ue,{ChtmlMfenced:()=>Oa});var pe={};__webpack_require__.r(pe),__webpack_require__.d(pe,{CommonMfracMixin:()=>Ma});var me={};__webpack_require__.r(me),__webpack_require__.d(me,{ChtmlMfrac:()=>ka});var fe={};__webpack_require__.r(fe),__webpack_require__.d(fe,{CommonMsqrtMixin:()=>Da});var ge={};__webpack_require__.r(ge),__webpack_require__.d(ge,{ChtmlMsqrt:()=>Pa});var be={};__webpack_require__.r(be),__webpack_require__.d(be,{CommonMrootMixin:()=>Ba});var Ee={};__webpack_require__.r(Ee),__webpack_require__.d(Ee,{ChtmlMroot:()=>ja});var xe={};__webpack_require__.r(xe),__webpack_require__.d(xe,{CommonMsubMixin:()=>Fa,CommonMsubsupMixin:()=>Ha,CommonMsupMixin:()=>Ua});var ye={};__webpack_require__.r(ye),__webpack_require__.d(ye,{CommonScriptbaseMixin:()=>qa});var Ne={};__webpack_require__.r(Ne),__webpack_require__.d(Ne,{ChtmlScriptbase:()=>Wa});var ve={};__webpack_require__.r(ve),__webpack_require__.d(ve,{ChtmlMsub:()=>Va,ChtmlMsubsup:()=>za,ChtmlMsup:()=>Xa});var Te={};__webpack_require__.r(Te),__webpack_require__.d(Te,{CommonMoverMixin:()=>Ja,CommonMunderMixin:()=>Ga,CommonMunderoverMixin:()=>Ka});var _e={};__webpack_require__.r(_e),__webpack_require__.d(_e,{ChtmlMover:()=>Ya,ChtmlMunder:()=>$a,ChtmlMunderover:()=>Qa});var Le={};__webpack_require__.r(Le),__webpack_require__.d(Le,{CommonMmultiscriptsMixin:()=>el,NextScript:()=>Za,ScriptNames:()=>tl});var Ce={};__webpack_require__.r(Ce),__webpack_require__.d(Ce,{ChtmlMmultiscripts:()=>il});var Re={};__webpack_require__.r(Re),__webpack_require__.d(Re,{BREAK_BELOW:()=>sl,CommonMtableMixin:()=>rl});var we={};__webpack_require__.r(we),__webpack_require__.d(we,{ChtmlMtable:()=>nl});var Ie={};__webpack_require__.r(Ie),__webpack_require__.d(Ie,{CommonMlabeledtrMixin:()=>al,CommonMtrMixin:()=>ol});var Se={};__webpack_require__.r(Se),__webpack_require__.d(Se,{ChtmlMlabeledtr:()=>cl,ChtmlMtr:()=>ll});var Ae={};__webpack_require__.r(Ae),__webpack_require__.d(Ae,{CommonMtdMixin:()=>hl});var Oe={};__webpack_require__.r(Oe),__webpack_require__.d(Oe,{ChtmlMtd:()=>dl});var Me={};__webpack_require__.r(Me),__webpack_require__.d(Me,{CommonMactionMixin:()=>pl,TooltipData:()=>ul});var ke={};__webpack_require__.r(ke),__webpack_require__.d(ke,{ChtmlMaction:()=>ml});var De={};__webpack_require__.r(De),__webpack_require__.d(De,{CommonMglyphMixin:()=>fl});var Pe={};__webpack_require__.r(Pe),__webpack_require__.d(Pe,{ChtmlMglyph:()=>gl});var Be={};__webpack_require__.r(Be),__webpack_require__.d(Be,{CommonSemanticsMixin:()=>bl});var je={};__webpack_require__.r(je),__webpack_require__.d(je,{CommonXmlNodeMixin:()=>El});var Fe={};__webpack_require__.r(Fe),__webpack_require__.d(Fe,{ChtmlAnnotation:()=>yl,ChtmlAnnotationXML:()=>Nl,ChtmlSemantics:()=>xl,ChtmlXmlNode:()=>vl});var Ue={};__webpack_require__.r(Ue),__webpack_require__.d(Ue,{CommonTeXAtomMixin:()=>Tl});var He={};__webpack_require__.r(He),__webpack_require__.d(He,{ChtmlTeXAtom:()=>_l});var qe={};__webpack_require__.r(qe),__webpack_require__.d(qe,{CommonTextNodeMixin:()=>Ll});var We={};__webpack_require__.r(We),__webpack_require__.d(We,{ChtmlTextNode:()=>Cl});var Ve={};__webpack_require__.r(Ve),__webpack_require__.d(Ve,{ChtmlHtmlNode:()=>Rl});var Xe={};__webpack_require__.r(Xe),__webpack_require__.d(Xe,{ChtmlWrappers:()=>wl});var ze={};__webpack_require__.r(ze),__webpack_require__.d(ze,{ChtmlWrapperFactory:()=>Il});var Ge={};__webpack_require__.r(Ge),__webpack_require__.d(Ge,{DefaultFont:()=>Al,fontName:()=>Sl});var Je={};__webpack_require__.r(Je),__webpack_require__.d(Je,{CHTML:()=>Ol});var Ke={};__webpack_require__.r(Ke),__webpack_require__.d(Ke,{AddFontIds:()=>Ml});var $e={};__webpack_require__.r($e),__webpack_require__.d($e,{MJContextMenu:()=>Oc});var Ye={};__webpack_require__.r(Ye),__webpack_require__.d(Ye,{addPreference:()=>Wp,engineSetup:()=>Up,fromPreference:()=>Vp,locales:()=>jp,parseDOM:()=>qp,setupEngine:()=>Fp,toEnriched:()=>Hp,toPreference:()=>Xp});var Qe={};__webpack_require__.r(Qe),__webpack_require__.d(Qe,{clearspeakMenu:()=>tm,localeMenu:()=>im});var Ze={};__webpack_require__.r(Ze),__webpack_require__.d(Ze,{copyToClipboard:()=>rm,isMac:()=>sm});var ti={};__webpack_require__.r(ti),__webpack_require__.d(ti,{annotation:()=>lm,copyAnnotations:()=>om,showAnnotations:()=>nm});var ei={};__webpack_require__.r(ei),__webpack_require__.d(ei,{RadioCompare:()=>dm});var ii={};__webpack_require__.r(ii),__webpack_require__.d(ii,{MmlVisitor:()=>um});var si={};__webpack_require__.r(si),__webpack_require__.d(si,{Menu:()=>fm});var ri={};__webpack_require__.r(ri),__webpack_require__.d(ri,{MenuHandler:()=>Em,MenuMathDocumentMixin:()=>bm,MenuMathItemMixin:()=>gm});var ni={};__webpack_require__.r(ni),__webpack_require__.d(ni,{EnrichHandler:()=>vm,EnrichedMathDocumentMixin:()=>Nm,EnrichedMathItemMixin:()=>ym,enrichVisitor:()=>xm});var oi={};__webpack_require__.r(oi),__webpack_require__.d(oi,{InPlace:()=>Mm,SemAttr:()=>km,buildLabel:()=>Sm,buildSpeech:()=>Am,honk:()=>Om,ssmlParsing:()=>_m});var ai={};__webpack_require__.r(ai),__webpack_require__.d(ai,{GeneratorPool:()=>Dm});var li={};__webpack_require__.r(li),__webpack_require__.d(li,{WorkerHandler:()=>jm});var ci={};__webpack_require__.r(ci),__webpack_require__.d(ci,{SpeechHandler:()=>Vm,SpeechMathDocumentMixin:()=>Wm,SpeechMathItemMixin:()=>qm});var hi={};__webpack_require__.r(hi),__webpack_require__.d(hi,{AbstractRegion:()=>Xm,DummyRegion:()=>zm,HoverRegion:()=>Ym,LiveRegion:()=>Km,SpeechRegion:()=>$m,StringRegion:()=>Gm,ToolTip:()=>Jm});var di={};__webpack_require__.r(di),__webpack_require__.d(di,{AbstractExplorer:()=>Qm});var ui={};__webpack_require__.r(ui),__webpack_require__.d(ui,{SpeechExplorer:()=>of,hasModifiers:()=>nf,isContainer:()=>rf});var pi={};__webpack_require__.r(pi),__webpack_require__.d(pi,{AbstractMouseExplorer:()=>lf,ContentHoverer:()=>df,FlameHoverer:()=>uf,Hoverer:()=>cf,ValueHoverer:()=>hf});var mi={};__webpack_require__.r(mi),__webpack_require__.d(mi,{AbstractTreeExplorer:()=>pf,ContrastPicker:()=>gf,FlameColorer:()=>mf,TreeColorer:()=>ff});var fi={};__webpack_require__.r(fi),__webpack_require__.d(fi,{ATTR:()=>xf,getHighlighter:()=>Tf});var gi={};__webpack_require__.r(gi),__webpack_require__.d(gi,{ExplorerPool:()=>Rf,RegionPool:()=>Lf});var bi={};__webpack_require__.r(bi),__webpack_require__.d(bi,{ExplorerHandler:()=>Af,ExplorerMathDocumentMixin:()=>Sf,ExplorerMathItemMixin:()=>If,setA11yOption:()=>Mf,setA11yOptions:()=>Of});const Ei="4.1.0",xi={},yi="undefined"!=typeof window?window:void 0!==__webpack_require__.g?__webpack_require__.g:"undefined"!=typeof globalThis?globalThis:xi;function Ni(t){return"object"==typeof t&&null!==t}function vi(t,e,i=!1){var s;for(const r of Object.keys(e))"__esModule"!==r&&t[r]!==e[r]&&null!==e[r]&&void 0!==e[r]&&(Ni(t[r])&&Ni(e[r])?vi(t[r],e[r],i||"_"===r):i&&(null===(s=Object.getOwnPropertyDescriptor(t,r))||void 0===s?void 0:s.get)||(t[r]=e[r]));return t}function Ti(t,e,i){t[e]||(t[e]={}),t=t[e];for(const e of Object.keys(i))Ni(t[e])&&Ni(i[e])?Ti(t,e,i[e]):null==t[e]&&null!=i[e]&&(t[e]=i[e]);return t}function _i(t){return vi(Li,t)}void 0!==yi.MathJax&&yi.MathJax.constructor==={}.constructor||(yi.MathJax={}),yi.MathJax.version||(yi.MathJax={version:Ei,_:{},config:yi.MathJax});const Li=yi.MathJax;!Object.hasOwn&&Li.config.startup.polyfillHasOwn&&(Object.hasOwn=function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)});const Ci="undefined"!=typeof window,Ri={window:Ci?window:null,document:Ci?window.document:null,os:(()=>{if(Ci&&window.navigator){const t=window.navigator.appVersion,e=[["Win","Windows"],["Mac","MacOS"],["X11","Unix"],["Linux","Unix"]];for(const[i,s]of e)if(t.includes(i))return s;if(window.navigator.userAgent.includes("Android"))return"Unix"}else if("undefined"!=typeof process)return{linux:"Unix",android:"Unix",aix:"Unix",freebsd:"Unix",netbsd:"Unix",openbsd:"Unix",sunos:"Unix",darwin:"MacOS",win32:"Windows",cygwin:"Windows"}[process.platform]||process.platform;return"unknown"})(),path:t=>t};"Windows"===Ri.os&&(Ri.path=t=>t.match(/^[/\\]?[a-zA-Z]:[/\\]/)?t.replace(/\\/g,"/").replace(/^\//,""):t);class wi extends Error{constructor(t,e){super(t),this.package=e}}class Ii{get canLoad(){return 0===this.dependencyCount&&!this.noLoad&&!this.isLoading&&!this.hasFailed}static loadPromise(t){const e=ji[t]||{},i=e.extraLoads?Pi.load(...e.extraLoads):Promise.resolve(),s=e.checkReady||(()=>Promise.resolve());return i.then((()=>s()))}static resolvePath(t,e=!0){const i={name:t,original:t,addExtension:e};return Pi.pathFilters.execute(i),i.name}static loadAll(){for(const t of this.packages.values())t.canLoad&&t.load()}constructor(t,e=!1){this.isLoaded=!1,this.result={},this.isLoading=!1,this.hasFailed=!1,this.dependents=[],this.dependencies=[],this.dependencyCount=0,this.provided=[],this.name=t,this.noLoad=e,Ii.packages.set(t,this),this.promise=this.makePromise(this.makeDependencies())}makeDependencies(){const t=[],e=Ii.packages,i=this.noLoad,s=this.name,r=[];Object.hasOwn(ji.dependencies,s)?r.push(...ji.dependencies[s]):"core"!==s&&r.push("core");for(const s of r){const r=e.get(s)||new Ii(s,i);this.dependencies.includes(r)||(r.addDependent(this,i),this.dependencies.push(r),r.isLoaded||(this.dependencyCount++,t.push(r.promise)))}return t}makePromise(t){let e=new Promise(((t,e)=>{this.resolve=t,this.reject=e}));const i=ji[this.name]||{};return i.ready&&(e=e.then((t=>i.ready(this.name)))),t.length&&(t.push(e),e=Promise.all(t).then((t=>t.join(", ")))),i.failed&&e.catch((t=>i.failed(new wi(t,this.name)))),e}load(){if(!this.isLoaded&&!this.isLoading&&!this.noLoad){this.isLoading=!0;const t=Ii.resolvePath(this.name);ji.require?this.loadCustom(t):this.loadScript(t)}}loadCustom(t){try{const e=ji.require(t);e instanceof Promise?e.then((t=>this.result=t)).then((()=>this.checkLoad())).catch((e=>this.failed("Can't load \""+t+'"\n'+e.message.trim()))):(this.result=e,this.checkLoad())}catch(t){this.failed(t.message)}}loadScript(t){const e=Ri.document.createElement("script");e.src=t,e.charset="UTF-8",e.onload=t=>this.checkLoad(),e.onerror=e=>this.failed("Can't load \""+t+'"'),Ri.document.head.appendChild(e)}loaded(){this.isLoaded=!0,this.isLoading=!1;for(const t of this.dependents)t.requirementSatisfied();for(const t of this.provided)t.loaded();this.resolve(this.name)}failed(t){this.hasFailed=!0,this.isLoading=!1,this.reject(new wi(t,this.name))}checkLoad(){Ii.loadPromise(this.name).then((()=>this.loaded())).catch((t=>this.failed(t)))}requirementSatisfied(){this.dependencyCount&&(this.dependencyCount--,this.canLoad&&this.load())}provides(t=[]){for(const e of t){let t=Ii.packages.get(e);t||(ji.dependencies[e]||(ji.dependencies[e]=[]),ji.dependencies[e].push(e),t=new Ii(e,!0),t.isLoading=!0),this.provided.push(t)}}addDependent(t,e){this.dependents.push(t),e||this.checkNoLoad()}checkNoLoad(){if(this.noLoad){this.noLoad=!1;for(const t of this.dependencies)t.checkNoLoad()}}}Ii.packages=new Map;class Si{constructor(){this.items=[],this.items=[]}[Symbol.iterator](){let t=0;const e=this.items;return{next:()=>({value:e[t++],done:t>e.length})}}add(t,e=Si.DEFAULTPRIORITY){let i=this.items.length;do{i--}while(i>=0&&e<this.items[i].priority);return this.items.splice(i+1,0,{item:t,priority:e}),t}remove(t){let e=this.items.length;do{e--}while(e>=0&&this.items[e].item!==t);return e>=0&&this.items.splice(e,1),this}}Si.DEFAULTPRIORITY=5;class Ai extends Si{constructor(t=null){super(),t&&this.addList(t)}addList(t){for(const e of t)Array.isArray(e)?this.add(e[0],e[1]):this.add(e)}execute(...t){for(const e of this){if(!1===e.item(...t))return!1}return!0}asyncExecute(...t){let e=-1;const i=this.items;return new Promise(((s,r)=>{!function n(){for(;++e<i.length;){const o=i[e].item(...t);if(o instanceof Promise)return void o.then(n).catch((t=>r(t)));if(!1===o)return void s(!1)}s(!0)}()}))}}const Oi=Li.config||{};var Mi=function(t,e,i,s){return new(i||(i=Promise))((function(r,n){function o(t){try{l(s.next(t))}catch(t){n(t)}}function a(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((s=s.apply(t,e||[])).next())}))};const ki={source:t=>(Object.hasOwn(ji.source,t.name)&&(t.name=ji.source[t.name]),!0),normalize:t=>{const e=t.name;return e.match(/^(?:[a-z]+:\/)?\/|[a-z]:[/\\]|\[/i)||(t.name="[mathjax]/"+e.replace(/^\.\//,"")),!0},prefix:t=>{let e;for(;(e=t.name.match(/^\[([^\]]*)\]/))&&Object.hasOwn(ji.paths,e[1]);)t.name=ji.paths[e[1]]+t.name.substring(e[0].length);return!0},addExtension:t=>(t.addExtension&&!t.name.match(/\.[^/]+$/)&&(t.name+=".js"),!0)},Di=Li.version,Pi={versions:new Map,nestedLoads:[],ready(...t){0===t.length&&(t=Array.from(Ii.packages.keys()));const e=[];for(const i of t){const t=Ii.packages.get(i)||new Ii(i,!0);e.push(t.promise)}return Promise.all(e)},load(...t){if(0===t.length)return Promise.resolve([]);let e=[];this.nestedLoads.unshift(e);const i=Promise.resolve().then((()=>Mi(this,void 0,void 0,(function*(){const i=[];for(const e of t){let t=Ii.packages.get(e);t||(t=new Ii(e),t.provides(ji.provides[e])),t.checkNoLoad(),i.push(t.promise.then((()=>(ji.versionWarnings&&t.isLoaded&&!Pi.versions.has(Ii.resolvePath(e))&&console.warn(`No version information available for component ${e}`),t.result))))}Ii.loadAll();const s=yield Promise.all(i);for(;e.length;){const t=Promise.all(e);e=this.nestedLoads[this.nestedLoads.indexOf(e)]=[],yield t}return this.nestedLoads.splice(this.nestedLoads.indexOf(e),1),s}))));return this.nestedLoads.slice(1).forEach((t=>t.push(i))),i},preLoaded(...t){for(const e of t){let t=Ii.packages.get(e);t||(t=new Ii(e,!0),t.provides(ji.provides[e])),t.loaded()}},addPackageData(t,e){let i=ji[t];i||(i=ji[t]={});for(const[t,s]of Object.entries(e))if(Array.isArray(s)){i[t]||(i[t]=[]);const e=new Set([...i[t],...s]);i[t]=[...e]}else i[t]=s},defaultReady(){void 0!==Bi.startup&&Bi.config.startup.ready()},getRoot(){if(Ri.document){const t=Ri.document.currentScript||Ri.document.getElementById("MathJax-script");if(t&&t instanceof HTMLScriptElement)return t.src.replace(/\/[^/]*$/,"")}return Oi?.loader?.paths?.mathjax||Oi?.__dirname||"/"},checkVersion(t,e,i){return this.saveVersion(t),!(!ji.versionWarnings||e===Di)&&(console.warn(`Component ${t} uses ${e} of MathJax; version in use is ${Di}`),!0)},saveVersion(t){Pi.versions.set(Ii.resolvePath(t),Di)},pathFilters:new Ai};Pi.pathFilters.add(ki.source,0),Pi.pathFilters.add(ki.normalize,10),Pi.pathFilters.add(ki.prefix,20),Pi.pathFilters.add(ki.addExtension,30);const Bi=Li;if(void 0===Bi.loader){Ti(Bi.config,"loader",{paths:{mathjax:Pi.getRoot(),fonts:Ri.window?"https://cdn.jsdelivr.net/npm/@mathjax":"@mathjax"},source:{},dependencies:{},provides:{},load:[],ready:Pi.defaultReady.bind(Pi),failed:t=>console.log(`MathJax(${t.package||"?"}): ${t.message}`),require:null,pathFilters:[],versionWarnings:!0}),_i({loader:Pi});for(const t of Bi.config.loader.pathFilters)Array.isArray(t)?Pi.pathFilters.add(t[0],t[1]):Pi.pathFilters.add(t)}const ji=Bi.config.loader,Fi={}.constructor;function Ui(t){return"object"==typeof t&&null!==t&&(t.constructor===Fi||t.constructor===Vi)}const Hi="[+]",qi="[-]",Wi={invalidOption:"warn",optionError:(t,e)=>{if("fatal"===Wi.invalidOption)throw new Error(t);console.warn("MathJax: "+t)}};class Vi{}function Xi(t){return Object.assign(Object.create(Vi.prototype),t)}function zi(t){return Array.isArray(t)?t:[t]}function Gi(t){return t?Object.keys(t).concat(Object.getOwnPropertySymbols(t)):[]}function Ji(t){const e={};for(const i of Gi(t)){const s=Object.getOwnPropertyDescriptor(t,i),r=s.value;Array.isArray(r)?s.value=Ki([],r,!1):Ui(r)&&(s.value=Ji(r)),s.enumerable&&(e[i]=s)}return Object.defineProperties(t.constructor===Vi?Xi({}):{},e)}function Ki(t,e,i=!0){for(let s of Gi(e)){if(i&&void 0===t[s]&&t.constructor!==Vi){"symbol"==typeof s&&(s=s.toString()),Wi.optionError(`Invalid option "${s}" (no default value).`,s);continue}const r=e[s];let n=t[s];if(!Ui(r)||null===n||"object"!=typeof n&&"function"!=typeof n)Array.isArray(r)?(t[s]=[],Ki(t[s],r,!1)):Ui(r)?t[s]=Ji(r):t[s]=r;else{const e=Gi(r);Array.isArray(n)&&(1===e.length&&(e[0]===Hi||e[0]===qi)&&Array.isArray(r[e[0]])||2===e.length&&e.sort().join(",")===Hi+","+qi&&Array.isArray(r[Hi])&&Array.isArray(r[qi]))?(r[qi]&&(n=t[s]=n.filter((t=>r[qi].indexOf(t)<0))),r[Hi]&&(t[s]=[...n,...r[Hi]])):Ki(n,r,i)}}return t}function $i(t,...e){return e.forEach((e=>Ki(t,e,!1))),t}function Yi(t,...e){return e.forEach((e=>Ki(t,e,!0))),t}function Qi(t,...e){const i={};for(const s of e)Object.hasOwn(t,s)&&(i[s]=t[s]);return i}function Zi(t,e){return Qi(t,...Object.keys(e))}function ts(t,...e){const i=[];for(const s of e){const e={},r={};for(const i of Object.keys(t||{}))(void 0===s[i]?r:e)[i]=t[i];i.push(e),t=r}return i.unshift(t),i}function es(t,e,i=null){return Object.hasOwn(e,t)?e[t]:i}var is=function(t,e,i,s){return new(i||(i=Promise))((function(r,n){function o(t){try{l(s.next(t))}catch(t){n(t)}}function a(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((s=s.apply(t,e||[])).next())}))};class ss{static toMML(t){return ss.visitor.visitTree(t,this.document)}static registerConstructor(t,e){ss.constructors[t]=e}static useHandler(t,e=!1){ns.handler&&!e||(ns.handler=t)}static useAdaptor(t,e=!1){ns.adaptor&&!e||(ns.adaptor=t)}static useInput(t,e=!1){os&&!e||ns.input.push(t)}static useOutput(t,e=!1){ns.output&&!e||(ns.output=t)}static extendHandler(t,e=10){ss.extensions.add(t,e)}static defaultReady(){ss.getComponents(),ss.makeMethods(),ss.pagePromise.then((()=>ns.pageReady())).then((()=>ss.promiseResolve())).catch((t=>ss.promiseReject(t)))}static defaultPageReady(){return(ns.loadAllFontFiles&&ss.output.font?ss.output.font.loadDynamicFiles():Promise.resolve()).then((()=>{var t;return null===(t=ss.document.menu)||void 0===t?void 0:t.loadingPromise})).then(ns.typeset&&rs.typesetPromise?()=>ss.typesetPromise(ns.elements):Promise.resolve()).then((()=>ss.promiseResolve()))}static typesetPromise(t){return this.hasTypeset=!0,ss.document.whenReady((()=>is(this,void 0,void 0,(function*(){ss.document.options.elements=t,ss.document.reset(),yield ss.document.renderPromise()}))))}static getComponents(){ss.visitor=new rs._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor,ss.mathjax=rs._.mathjax.mathjax,ss.input=ss.getInputJax(),ss.output=ss.getOutputJax(),ss.adaptor=ss.getAdaptor(),ss.handler&&ss.mathjax.handlers.unregister(ss.handler),ss.handler=ss.getHandler(),ss.handler&&(ss.mathjax.handlers.register(ss.handler),ss.document=ss.getDocument())}static makeMethods(){ss.input&&ss.output&&ss.makeTypesetMethods();const t=ss.output?ss.output.name.toLowerCase():"";for(const e of ss.input){const i=e.name.toLowerCase();ss.makeMmlMethods(i,e),ss.makeResetMethod(i,e),ss.output&&ss.makeOutputMethods(i,t,e)}rs.done=()=>ss.document.done(),rs.whenReady=t=>ss.document.whenReady(t)}static makeTypesetMethods(){rs.typeset=(t=null)=>{this.hasTypeset=!0,ss.document.options.elements=t,ss.document.reset(),ss.document.render()},rs.typesetPromise=(t=null)=>ss.typesetPromise(t),rs.typesetClear=(t=null)=>{t?ss.document.clearMathItemsWithin(t):ss.document.clear()}}static makeOutputMethods(t,e,i){const s=t+"2"+e;rs[s]=(t,e={})=>(e=Object.assign(Object.assign({},e),{format:i.name}),ss.document.convert(t,e)),rs[s+"Promise"]=(t,e={})=>(e=Object.assign(Object.assign({},e),{format:i.name}),ss.document.convertPromise(t,e)),rs[e+"Stylesheet"]=()=>ss.output.styleSheet(ss.document),"getMetricsFor"in ss.output&&(rs.getMetricsFor=(t,e)=>ss.output.getMetricsFor(t,e))}static makeMmlMethods(t,e){const i=rs._.core.MathItem.STATE;rs[t+"2mml"]=(t,s={})=>(s=Object.assign(Object.assign({},s),{end:i.CONVERT,format:e.name}),ss.toMML(ss.document.convert(t,s))),rs[t+"2mmlPromise"]=(t,...s)=>is(this,[t,...s],void 0,(function*(t,s={}){s=Object.assign(Object.assign({},s),{end:i.CONVERT,format:e.name});const r=yield ss.document.convertPromise(t,s);return ss.toMML(r)}))}static makeResetMethod(t,e){rs[t+"Reset"]=(...t)=>e.reset(...t)}static getInputJax(){const t=[];for(const e of ns.input){const i=ss.constructors[e];if(!i)throw Error('Input Jax "'+e+'" is not defined (has it been loaded?)');t[e]=new i(rs.config[e]),t.push(t[e])}return t}static getOutputJax(){const t=ns.output;if(!t)return null;const e=ss.constructors[t];if(!e)throw Error('Output Jax "'+t+'" is not defined (has it been loaded?)');return new e(rs.config[t])}static getAdaptor(){const t=ns.adaptor;if(!t||"none"===t)return null;const e=ss.constructors[t];if(!e)throw Error('DOMAdaptor "'+t+'" is not defined (has it been loaded?)');return e(rs.config[t])}static getHandler(){const t=ns.handler;if(!t||"none"===t||!ss.adaptor)return null;const e=ss.constructors[t];if(!e)throw Error('Handler "'+t+'" is not defined (has it been loaded?)');let i=new e(ss.adaptor,5);for(const t of ss.extensions)i=t.item(i);return i}static getDocument(t=null){return ss.mathjax.document(t||ns.document,Object.assign(Object.assign({},rs.config.options),{InputJax:ss.input,OutputJax:ss.output}))}}ss.extensions=new Si,ss.constructors={},ss.input=[],ss.output=null,ss.handler=null,ss.adaptor=null,ss.elements=null,ss.document=null,ss.promise=new Promise(((t,e)=>{ss.promiseResolve=t,ss.promiseReject=e})),ss.pagePromise=new Promise(((t,e)=>{const i=yi.document;if(i&&i.readyState&&"complete"!==i.readyState&&"interactive"!==i.readyState){const e=()=>t();i.defaultView.addEventListener("load",e,!0),i.defaultView.addEventListener("DOMContentLoaded",e,!0)}else t()})),ss.hasTypeset=!1,ss.defaultOptionError=Wi.optionError;const rs=Li;void 0===rs._.startup&&(Ti(rs.config,"startup",{input:[],output:"",handler:null,adaptor:null,document:Ri.document||"",elements:null,typeset:!0,ready:ss.defaultReady.bind(ss),pageReady:ss.defaultPageReady.bind(ss),polyfillHasOwn:!0}),_i({startup:ss,options:{}}),rs.config.startup.invalidOption&&(Wi.invalidOption=rs.config.startup.invalidOption),rs.config.startup.optionError&&(Wi.optionError=rs.config.startup.optionError));const ns=rs.config.startup,os=0!==ns.input.length;MathJax.loader&&MathJax.loader.checkVersion("startup",Ei,"startup"),_i({_:{components:{loader:n,package:i,startup:a}}});Pi.preLoaded("loader","startup"),Ti(MathJax.config.loader,"dependencies",{"a11y/semantic-enrich":["input/mml","a11y/sre"],"a11y/speech":["a11y/semantic-enrich"],"a11y/complexity":["a11y/semantic-enrich"],"a11y/explorer":["a11y/speech"],"[mml]/mml3":["input/mml"],"[tex]/action":["input/tex-base"],"[tex]/ams":["input/tex-base","[tex]/newcommand"],"[tex]/amscd":["input/tex-base"],"[tex]/autoload":["input/tex-base","[tex]/require"],"[tex]/bbm":["input/tex-base"],"[tex]/bboldx":["input/tex-base","[tex]/textmacros"],"[tex]/bbox":["input/tex-base"],"[tex]/begingroup":["input/tex-base","[tex]/newcommand"],"[tex]/boldsymbol":["input/tex-base"],"[tex]/braket":["input/tex-base"],"[tex]/bussproofs":["input/tex-base"],"[tex]/cancel":["input/tex-base","[tex]/enclose"],"[tex]/cases":["[tex]/empheq"],"[tex]/centernot":["input/tex-base"],"[tex]/color":["input/tex-base"],"[tex]/colortbl":["input/tex-base","[tex]/color"],"[tex]/colorv2":["input/tex-base"],"[tex]/configmacros":["input/tex-base","[tex]/newcommand"],"[tex]/dsfont":["input/tex-base"],"[tex]/empheq":["input/tex-base","[tex]/ams"],"[tex]/enclose":["input/tex-base"],"[tex]/extpfeil":["input/tex-base","[tex]/newcommand","[tex]/ams"],"[tex]/gensymb":["input/tex-base"],"[tex]/html":["input/tex-base"],"[tex]/mathtools":["input/tex-base","[tex]/newcommand","[tex]/ams","[tex]/boldsymbol"],"[tex]/mhchem":["input/tex-base","[tex]/ams"],"[tex]/newcommand":["input/tex-base"],"[tex]/noerrors":["input/tex-base"],"[tex]/noundefined":["input/tex-base"],"[tex]/physics":["input/tex-base"],"[tex]/require":["input/tex-base"],"[tex]/setoptions":["input/tex-base"],"[tex]/tagformat":["input/tex-base"],"[tex]/texhtml":["input/tex-base"],"[tex]/textcomp":["input/tex-base","[tex]/textmacros"],"[tex]/textmacros":["input/tex-base"],"[tex]/unicode":["input/tex-base"],"[tex]/units":["input/tex-base"],"[tex]/upgreek":["input/tex-base"],"[tex]/verb":["input/tex-base"],"ui/menu":["a11y/sre"]}),Ti(MathJax.config.loader,"paths",{tex:"[mathjax]/input/tex/extensions",mml:"[mathjax]/input/mml/extensions",sre:"[mathjax]/sre",mathmaps:"[sre]/mathmaps"}),Ti(MathJax.config.loader,"provides",{startup:["loader"],"input/tex":["input/tex-base","[tex]/ams","[tex]/newcommand","[tex]/textmacros","[tex]/noundefined","[tex]/require","[tex]/autoload","[tex]/configmacros"]}),Ti(MathJax.config.loader,"source",{"[tex]/amsCd":"[tex]/amscd","[tex]/colorV2":"[tex]/colorv2","[tex]/configMacros":"[tex]/configmacros","[tex]/tagFormat":"[tex]/tagformat"});class as{constructor(t=null){this.canMeasureNodes=!0,this.document=t}node(t,e={},i=[],s){const r=this.create(t,s);this.setAttributes(r,e);for(const t of i)this.append(r,t);return r}setProperty(t,e,i){t[e]=i}getProperty(t,e){return t[e]}setAttributes(t,e){if(e.style&&"string"!=typeof e.style)for(const i of Object.keys(e.style))this.setStyle(t,i.replace(/-([a-z])/g,((t,e)=>e.toUpperCase())),e.style[i]);if(e.properties)for(const i of Object.keys(e.properties))t[i]=e.properties[i];for(const i of Object.keys(e))"style"===i&&"string"!=typeof e.style||"properties"===i||this.setAttribute(t,i,e[i])}replace(t,e){return this.insert(t,e),this.remove(e),e}childNode(t,e){return this.childNodes(t)[e]}allClasses(t){const e=this.getAttribute(t,"class");return e?e.replace(/ +/g," ").replace(/^ /,"").replace(/ $/,"").split(/ /):[]}cssText(t){return"style"===this.kind(t)?this.textContent(t):""}}var ls=function(t,e,i,s){return new(i||(i=Promise))((function(r,n){function o(t){try{l(s.next(t))}catch(t){n(t)}}function a(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((s=s.apply(t,e||[])).next())}))};class cs extends as{constructor(t){super(t.document),this.canMeasureNodes=!0,this.window=t,this.parser=new t.DOMParser}parse(t,e="text/html"){return this.parser.parseFromString(t,e)}create(t,e){return e?this.document.createElementNS(e,t):this.document.createElement(t)}text(t){return this.document.createTextNode(t)}head(t=this.document){return t.head||t}body(t=this.document){return t.body||t}root(t=this.document){return t.documentElement||t}doctype(t=this.document){return t.doctype?`<!DOCTYPE ${t.doctype.name}>`:""}tags(t,e,i=null){const s=i?t.getElementsByTagNameNS(i,e):t.getElementsByTagName(e);return Array.from(s)}getElements(t,e){let i=[];for(const e of t)"string"==typeof e?i=i.concat(Array.from(this.document.querySelectorAll(e))):Array.isArray(e)||e instanceof this.window.NodeList||e instanceof this.window.HTMLCollection?i=i.concat(Array.from(e)):i.push(e);return i}getElement(t,e=this.document){return e.querySelector(t)}contains(t,e){return t.contains(e)}parent(t){return t.parentNode}append(t,e){return t.appendChild(e)}insert(t,e){return this.parent(e).insertBefore(t,e)}remove(t){return this.parent(t).removeChild(t)}replace(t,e){return this.parent(e).replaceChild(t,e)}clone(t,e=!0){return t.cloneNode(e)}split(t,e){return t.splitText(e)}next(t){return t.nextSibling}previous(t){return t.previousSibling}firstChild(t){return t.firstChild}lastChild(t){return t.lastChild}childNodes(t){return Array.from(t.childNodes)}childNode(t,e){return t.childNodes[e]}kind(t){const e=t.nodeType;return 1===e||3===e||8===e?t.nodeName.toLowerCase():""}value(t){return t.nodeValue||""}textContent(t){return t.textContent}innerHTML(t){return t.innerHTML}outerHTML(t){return t.outerHTML}serializeXML(t){return(new this.window.XMLSerializer).serializeToString(t)}setAttribute(t,e,i,s=null){return s?(e=s.replace(/.*\//,"")+":"+e.replace(/^.*:/,""),t.setAttributeNS(s,e,i)):("style"===e&&(i=i.replace(/\n/g," ")),t.setAttribute(e,i))}getAttribute(t,e){return t.getAttribute(e)}removeAttribute(t,e){return t.removeAttribute(e)}hasAttribute(t,e){return t.hasAttribute(e)}allAttributes(t){return Array.from(t.attributes).map((t=>({name:t.name,value:t.value})))}addClass(t,e){t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim()}removeClass(t,e){t.classList?t.classList.remove(e):t.className=t.className.split(/ /).filter((t=>t!==e)).join(" ")}hasClass(t,e){return t.classList?t.classList.contains(e):t.className.split(/ /).includes(e)}setStyle(t,e,i){t.style[e]=String(i).replace(/\n/g," ")}getStyle(t,e){return t.style[e]}allStyles(t){return t.style.cssText}insertRules(t,e){for(const i of e)try{t.sheet.insertRule(i,t.sheet.cssRules.length)}catch(t){console.warn(`MathJax: can't insert css rule '${i}': ${t.message}`)}}cssText(t){return"style"!==this.kind(t)?"":Array.from(t.sheet.cssRules).map((t=>t.cssText)).join("\n")}fontSize(t){const e=this.window.getComputedStyle(t);return parseFloat(e.fontSize||String(this.constructor.DEFAULT_FONT_SIZE))}fontFamily(t){return this.window.getComputedStyle(t).fontFamily||""}nodeSize(t,e=1,i=!1){if(i&&t.getBBox){const{width:i,height:s}=t.getBBox();return[i/e,s/e]}return[t.offsetWidth/e,t.offsetHeight/e]}nodeBBox(t){const{left:e,right:i,top:s,bottom:r}=t.getBoundingClientRect();return{left:e,right:i,top:s,bottom:r}}createWorker(t,e){return ls(this,void 0,void 0,(function*(){const{path:i,maps:s,worker:r}=e,n=`${i}/${r}`,o=`\n self.maps = '${hs(s)}';\n importScripts('${hs(n)}');\n `,a=URL.createObjectURL(new Blob([o],{type:"text/javascript"})),l=new Worker(a);return l.onmessage=t,URL.revokeObjectURL(a),l}))}}function hs(t){return[...t].map((t=>("\\"===t||"'"===t?t="\\"+t:(t<" "||t>"~")&&(t=`\\u{${t.codePointAt(0).toString(16)}}`),t))).join("")}function ds(){return new cs(window)}cs.DEFAULT_FONT_SIZE=16;class us{constructor(t){const e=this.constructor;this.options=Yi($i({},e.OPTIONS),t)}}us.OPTIONS={};class ps{constructor(t={}){this.adaptor=null,this.mmlFactory=null;const e=this.constructor;this.options=Yi($i({},e.OPTIONS),t),this.preFilters=new Ai(this.options.preFilters),this.postFilters=new Ai(this.options.postFilters)}get name(){return this.constructor.NAME}setAdaptor(t){this.adaptor=t}setMmlFactory(t){this.mmlFactory=t}initialize(){}reset(...t){}get processStrings(){return!0}findMath(t,e){return[]}executeFilters(t,e,i,s){const r={math:e,document:i,data:s};return t.execute(r),r.data}}ps.NAME="generic",ps.OPTIONS={preFilters:[],postFilters:[]};class ms{constructor(t={}){this.adaptor=null;const e=this.constructor;this.options=Yi($i({},e.OPTIONS),t),this.preFilters=new Ai(this.options.preFilters),this.postFilters=new Ai(this.options.postFilters)}get name(){return this.constructor.NAME}setAdaptor(t){this.adaptor=t}initialize(){}reset(...t){}getMetrics(t){}styleSheet(t){return null}pageElements(t){return null}executeFilters(t,e,i,s){const r={math:e,document:i,data:s};return t.execute(r),r.data}}ms.NAME="generic",ms.OPTIONS={preFilters:[],postFilters:[]};const fs=Symbol();class gs{constructor(t=null){this.next=null,this.prev=null,this.data=t}}class bs{constructor(...t){this.list=new gs(fs),this.list.next=this.list.prev=this.list,this.push(...t)}isBefore(t,e){return t<e}push(...t){for(const e of t){const t=new gs(e);t.next=this.list,t.prev=this.list.prev,this.list.prev=t,t.prev.next=t}return this}pop(){const t=this.list.prev;return t.data===fs?null:(this.list.prev=t.prev,t.prev.next=this.list,t.next=t.prev=null,t.data)}unshift(...t){for(const e of t.slice(0).reverse()){const t=new gs(e);t.next=this.list.next,t.prev=this.list,this.list.next=t,t.next.prev=t}return this}shift(){const t=this.list.next;return t.data===fs?null:(this.list.next=t.next,t.next.prev=this.list,t.next=t.prev=null,t.data)}remove(...t){const e=new Map;for(const i of t)e.set(i,!0);let i=this.list.next;for(;i.data!==fs;){const t=i.next;e.has(i.data)&&(i.prev.next=i.next,i.next.prev=i.prev,i.next=i.prev=null),i=t}return this}clear(){return this.list.next.prev=this.list.prev.next=null,this.list.next=this.list.prev=this.list,this}*[Symbol.iterator](){let t=this.list.next;for(;t.data!==fs;)yield t.data,t=t.next}*reversed(){let t=this.list.prev;for(;t.data!==fs;)yield t.data,t=t.prev}insert(t,e=null){null===e&&(e=this.isBefore.bind(this));const i=new gs(t);let s=this.list.next;for(;s.data!==fs&&e(s.data,i.data);)s=s.next;return i.prev=s.prev,i.next=s,s.prev.next=s.prev=i,this}sort(t=null){null===t&&(t=this.isBefore.bind(this));const e=[];for(const t of this)e.push(new bs(t));for(this.list.next=this.list.prev=this.list;e.length>1;){const i=e.shift(),s=e.shift();i.merge(s,t),e.push(i)}return e.length&&(this.list=e[0].list),this}merge(t,e=null){null===e&&(e=this.isBefore.bind(this));let i=this.list.next,s=t.list.next;for(;i.data!==fs&&s.data!==fs;)e(s.data,i.data)?([s.prev.next,i.prev.next]=[i,s],[s.prev,i.prev]=[i.prev,s.prev],[this.list.prev.next,t.list.prev.next]=[t.list,this.list],[this.list.prev,t.list.prev]=[t.list.prev,this.list.prev],[i,s]=[s.next,i]):i=i.next;return s.data!==fs&&(this.list.prev.next=t.list.next,t.list.next.prev=this.list.prev,t.list.prev.next=this.list,this.list.prev=t.list.prev,t.list.next=t.list.prev=t.list),this}}class Es extends bs{isBefore(t,e){return t.start.i<e.start.i||t.start.i===e.start.i&&t.start.n<e.start.n}}function xs(t,e,i,s,r,n,o=null){return{open:t,math:e,close:i,n:s,start:{n:r},end:{n},display:o}}class ys{get isEscaped(){return null===this.display}constructor(t,e,i=!0,s={i:0,n:0,delim:""},r={i:0,n:0,delim:""}){this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={},this._state=Ns.UNPROCESSED,this.math=t,this.inputJax=e,this.display=i,this.start=s,this.end=r,this.root=null,this.typesetRoot=null,this.metrics={},this.inputData={},this.outputData={}}render(t){t.renderActions.renderMath(this,t)}rerender(t,e=Ns.RERENDER){this.state()>=e&&this.state(e-1),t.renderActions.renderMath(this,t,e)}convert(t,e=Ns.LAST){t.renderActions.renderConvert(this,t,e)}compile(t){this.state()<Ns.COMPILED&&(this.root=this.inputJax.compile(this,t),this.state(Ns.COMPILED))}typeset(t){this.state()<Ns.TYPESET&&(this.typesetRoot=t.outputJax[this.isEscaped?"escaped":"typeset"](this,t),this.state(Ns.TYPESET))}updateDocument(t){}removeFromDocument(t=!1){this.clear()}setMetrics(t,e,i,s){this.metrics={em:t,ex:e,containerWidth:i,scale:s}}state(t=null,e=!1){return null!=t&&(t<Ns.INSERTED&&this._state>=Ns.INSERTED&&this.removeFromDocument(e),t<Ns.TYPESET&&this._state>=Ns.TYPESET&&(this.outputData={}),t<Ns.COMPILED&&this._state>=Ns.COMPILED&&(this.inputData={}),this._state=t),this._state}reset(t=!1){this.state(Ns.UNPROCESSED,t)}clear(){}}const Ns={UNPROCESSED:0,FINDMATH:10,COMPILED:20,CONVERT:100,METRICS:110,RERENDER:125,TYPESET:150,INSERTED:200,LAST:1e4};function vs(t,e){if(t in Ns)throw Error("State "+t+" already exists");Ns[t]=e}class Ts{constructor(t=null){this.defaultKind="unknown",this.nodeMap=new Map,this.node={},null===t&&(t=this.constructor.defaultNodes);for(const e of Object.keys(t))this.setNodeClass(e,t[e])}create(t,...e){return(this.node[t]||this.node[this.defaultKind])(...e)}setNodeClass(t,e){this.nodeMap.set(t,e);const i=this.nodeMap.get(t);this.node[t]=(...t)=>new i(this,...t)}getNodeClass(t){return this.nodeMap.get(t)}deleteNodeClass(t){this.nodeMap.delete(t),delete this.node[t]}nodeIsKind(t,e){return t instanceof this.getNodeClass(e)}getKinds(){return Array.from(this.nodeMap.keys())}}Ts.defaultNodes={};class _s extends Ts{create(t,e={},i=[]){return this.node[t](e,i)}}const Ls="_inherit_";class Cs{constructor(t,e){this.global=e,this.defaults=Object.create(e),this.inherited=Object.create(this.defaults),this.attributes=Object.create(this.inherited),Object.assign(this.defaults,t)}set(t,e){this.attributes[t]=e}setList(t){Object.assign(this.attributes,t)}unset(t){delete this.attributes[t]}get(t){let e=this.attributes[t];return e===Ls&&(e=this.global[t]),e}getExplicit(t){return this.hasExplicit(t)?this.attributes[t]:void 0}hasExplicit(t){return Object.hasOwn(this.attributes,t)}hasOneOf(t){for(const e of t)if(this.hasExplicit(e))return!0;return!1}getList(...t){const e={};for(const i of t)e[i]=this.get(i);return e}setInherited(t,e){this.inherited[t]=e}getInherited(t){return this.inherited[t]}getDefault(t){return this.defaults[t]}isSet(t){return Object.hasOwn(this.attributes,t)||Object.hasOwn(this.inherited,t)}hasDefault(t){return t in this.defaults}getExplicitNames(){return Object.keys(this.attributes)}getInheritedNames(){return Object.keys(this.inherited)}getDefaultNames(){return Object.keys(this.defaults)}getGlobalNames(){return Object.keys(this.global)}getAllAttributes(){return this.attributes}getAllInherited(){return this.inherited}getAllDefaults(){return this.defaults}getAllGlobals(){return this.global}}class Rs{constructor(t,e={},i=[]){this.factory=t,this.parent=null,this.properties={},this.childNodes=[];for(const t of Object.keys(e))this.setProperty(t,e[t]);i.length&&this.setChildren(i)}get kind(){return"unknown"}setProperty(t,e){this.properties[t]=e}getProperty(t){return this.properties[t]}getPropertyNames(){return Object.keys(this.properties)}getAllProperties(){return this.properties}removeProperty(...t){for(const e of t)delete this.properties[e]}isKind(t){return this.factory.nodeIsKind(this,t)}setChildren(t){this.childNodes=[];for(const e of t)this.appendChild(e)}appendChild(t){return this.childNodes.push(t),t.parent=this,t}replaceChild(t,e){const i=this.childIndex(e);return null!==i&&(this.childNodes[i]=t,t.parent=this,e.parent===this&&(e.parent=null)),t}removeChild(t){const e=this.childIndex(t);return null!==e&&(this.childNodes.splice(e,1),t.parent=null),t}childIndex(t){const e=this.childNodes.indexOf(t);return-1===e?null:e}copy(){const t=this.factory.create(this.kind);t.properties=Object.assign({},this.properties);for(const e of this.childNodes||[])e&&t.appendChild(e.copy());return t}findNodes(t){const e=[];return this.walkTree((i=>{i.isKind(t)&&e.push(i)})),e}walkTree(t,e){t(this,e);for(const i of this.childNodes)i&&i.walkTree(t,e);return e}toString(){return this.kind+"("+this.childNodes.join(",")+")"}}class ws extends Rs{setChildren(t){}appendChild(t){return t}replaceChild(t,e){return e}childIndex(t){return null}walkTree(t,e){return t(this,e),e}toString(){return this.kind}}const Is={ORD:0,OP:1,BIN:2,REL:3,OPEN:4,CLOSE:5,PUNCT:6,INNER:7,NONE:-1},Ss=["ORD","OP","BIN","REL","OPEN","CLOSE","PUNCT","INNER"],As=["","thinmathspace","mediummathspace","thickmathspace"],Os=[[0,-1,2,3,0,0,0,1],[-1,-1,0,3,0,0,0,1],[2,2,0,0,2,0,0,2],[3,3,0,0,3,0,0,3],[0,0,0,0,0,0,0,0],[0,-1,2,3,0,0,0,1],[1,1,0,1,1,1,1,1],[1,-1,2,3,1,0,1,1]],Ms=new Set(["normal","bold","italic","bold-italic","double-struck","fraktur","bold-fraktur","script","bold-script","sans-serif","bold-sans-serif","sans-serif-italic","sans-serif-bold-italic","monospace","inital","tailed","looped","stretched"]),ks=["indentalign","indentalignfirst","indentshift","indentshiftfirst"];class Ds extends Rs{constructor(t,e={},i=[]){super(t),this.prevClass=null,this.prevLevel=null,this.texclass=null,this.arity<0&&(this.childNodes=[t.create("inferredMrow")],this.childNodes[0].parent=this),this.setChildren(i),this.attributes=new Cs(t.getNodeClass(this.kind).defaults,t.getNodeClass("math").defaults),this.attributes.setList(e)}copy(t=!1){const e=this.factory.create(this.kind);if(e.properties=Object.assign({},this.properties),this.attributes){const i=this.attributes.getAllAttributes();for(const s of Object.keys(i))("id"!==s||t)&&e.attributes.set(s,i[s])}if(this.childNodes&&this.childNodes.length){let t=this.childNodes;1===t.length&&t[0].isInferred&&(t=t[0].childNodes);for(const i of t)i?e.appendChild(i.copy()):e.childNodes.push(null)}return e}get texClass(){return this.texclass}set texClass(t){this.texclass=t}get isToken(){return!1}get isEmbellished(){return!1}get isSpacelike(){return!1}get linebreakContainer(){return!1}get linebreakAlign(){return"data-align"}get arity(){return 1/0}get isInferred(){return!1}get Parent(){let t=this.parent;for(;t&&t.notParent;)t=t.Parent;return t}get notParent(){return!1}setChildren(t){return this.arity<0?this.childNodes[0].setChildren(t):super.setChildren(t)}appendChild(t){if(this.arity<0)return this.childNodes[0].appendChild(t),t;if(t.isInferred){if(this.arity===1/0)return t.childNodes.forEach((t=>super.appendChild(t))),t;const e=t;(t=this.factory.create("mrow")).setChildren(e.childNodes),t.attributes=e.attributes;for(const i of e.getPropertyNames())t.setProperty(i,e.getProperty(i))}return super.appendChild(t)}replaceChild(t,e){return this.arity<0?(this.childNodes[0].replaceChild(t,e),t):super.replaceChild(t,e)}core(){return this}coreMO(){return this}coreIndex(){return 0}childPosition(){let t=null,e=this.parent;for(;e&&e.notParent;)t=e,e=e.parent;if(t=t||this,e){let i=0;for(const s of e.childNodes){if(s===t)return i;i++}}return null}setTeXclass(t){return this.getPrevClass(t),null!=this.texClass?this:t}updateTeXclass(t){t&&(this.prevClass=t.prevClass,this.prevLevel=t.prevLevel,t.prevClass=t.prevLevel=null,this.texClass=t.texClass)}getPrevClass(t){t&&(this.prevClass=t.texClass,this.prevLevel=t.attributes.get("scriptlevel"))}texSpacing(){const t=null!=this.prevClass?this.prevClass:Is.NONE,e=this.texClass||Is.ORD;if(t===Is.NONE||e===Is.NONE)return"";const i=Os[t][e];return(this.prevLevel>0||this.attributes.get("scriptlevel")>0)&&i>=0?"":As[Math.abs(i)]}hasSpacingAttributes(){return this.isEmbellished&&this.coreMO().hasSpacingAttributes()}setInheritedAttributes(t={},e=!1,i=0,s=!1){var r,n,o;const a=this.attributes.getAllDefaults();for(const e of Object.keys(t)){if(Object.hasOwn(a,e)||Object.hasOwn(Ds.alwaysInherit,e)){const[i,s]=t[e];(null===(n=null===(r=Ds.noInherit[i])||void 0===r?void 0:r[this.kind])||void 0===n?void 0:n[e])||this.attributes.setInherited(e,s)}(null===(o=Ds.stopInherit[this.kind])||void 0===o?void 0:o[e])&&delete(t=Object.assign({},t))[e]}void 0===this.attributes.getExplicit("displaystyle")&&this.attributes.setInherited("displaystyle",e);void 0===this.attributes.getExplicit("scriptlevel")&&this.attributes.setInherited("scriptlevel",i),s&&this.setProperty("texprimestyle",s);const l=this.arity;if(l>=0&&l!==1/0&&(1===l&&0===this.childNodes.length||1!==l&&this.childNodes.length!==l))if(l<this.childNodes.length)this.childNodes=this.childNodes.slice(0,l);else for(;this.childNodes.length<l;)this.appendChild(this.factory.create("mrow"));if(this.linebreakContainer&&!this.isEmbellished){const e=this.linebreakAlign;if(e){const i=this.attributes.get(e)||"left";t=this.addInheritedAttributes(t,{indentalign:i,indentshift:"0",indentalignfirst:i,indentshiftfirst:"0",indentalignlast:"indentalign",indentshiftlast:"indentshift"})}}this.setChildInheritedAttributes(t,e,i,s)}setChildInheritedAttributes(t,e,i,s){for(const r of this.childNodes)r.setInheritedAttributes(t,e,i,s)}addInheritedAttributes(t,e){const i=Object.assign({},t);for(const t of Object.keys(e))"displaystyle"!==t&&"scriptlevel"!==t&&"style"!==t&&(i[t]=[this.kind,e[t]]);return i}inheritAttributesFrom(t){const e=t.attributes,i=e.get("displaystyle"),s=e.get("scriptlevel"),r=e.isSet("mathsize")?{mathsize:["math",e.get("mathsize")]}:{},n=t.getProperty("texprimestyle")||!1;this.setInheritedAttributes(r,i,s,n)}verifyTree(t=null){if(null===t)return;this.verifyAttributes(t);const e=this.arity;t.checkArity&&e>=0&&e!==1/0&&(1===e&&0===this.childNodes.length||1!==e&&this.childNodes.length!==e)&&this.mError('Wrong number of children for "'+this.kind+'" node',t,!0),this.verifyChildren(t)}verifyAttributes(t){if(t.checkAttributes){const e=this.attributes,i=[];for(const t of e.getExplicitNames())"data-"===t.substring(0,5)||void 0!==e.getDefault(t)||t.match(/^(?:class|style|id|(?:xlink:)?href)$/)||i.push(t);i.length&&this.mError("Unknown attributes for "+this.kind+" node: "+i.join(", "),t)}if(t.checkMathvariants){const e=this.attributes.getExplicit("mathvariant");!e||Ms.has(e)||this.getProperty("ignore-variant")||this.mError(`Invalid mathvariant: ${e}`,t,!0)}}verifyChildren(t){for(const e of this.childNodes)e.verifyTree(t)}mError(t,e,i=!1){if(this.parent&&this.parent.isKind("merror"))return null;const s=this.factory.create("merror");if(s.attributes.set("data-mjx-message",t),e.fullErrors||i){const i=this.factory.create("mtext"),r=this.factory.create("text");r.setText(e.fullErrors?t:this.kind),i.appendChild(r),s.appendChild(i),this.parent.replaceChild(s,this),e.fullErrors||s.attributes.set("title",t)}else this.parent.replaceChild(s,this),s.appendChild(this);return s}}Ds.defaults={mathbackground:Ls,mathcolor:Ls,mathsize:Ls,dir:Ls},Ds.noInherit={mstyle:{mpadded:{width:!0,height:!0,depth:!0,lspace:!0,voffset:!0},mtable:{width:!0,height:!0,depth:!0,align:!0}},maligngroup:{mrow:{groupalign:!0},mtable:{groupalign:!0}},mtr:{msqrt:{"data-vertical-align":!0},mroot:{"data-vertical-align":!0}},mlabeledtr:{msqrt:{"data-vertical-align":!0},mroot:{"data-vertical-align":!0}}},Ds.stopInherit={mtd:{columnalign:!0,rowalign:!0,groupalign:!0}},Ds.alwaysInherit={scriptminsize:!0,scriptsizemultiplier:!0,infixlinebreakstyle:!0},Ds.verifyDefaults={checkArity:!0,checkAttributes:!1,checkMathvariants:!0,fullErrors:!1,fixMmultiscripts:!0,fixMtables:!0};class Ps extends Ds{get isToken(){return!0}getText(){let t="";for(const e of this.childNodes)e instanceof Us?t+=e.getText():"textContent"in e&&(t+=e.textContent());return t}setChildInheritedAttributes(t,e,i,s){for(const r of this.childNodes)r instanceof Ds&&r.setInheritedAttributes(t,e,i,s)}walkTree(t,e){t(this,e);for(const i of this.childNodes)i instanceof Ds&&i.walkTree(t,e);return e}}Ps.defaults=Object.assign(Object.assign({},Ds.defaults),{mathvariant:"normal",mathsize:Ls});class Bs extends Ds{get isSpacelike(){return this.childNodes[0].isSpacelike}get isEmbellished(){return this.childNodes[0].isEmbellished}get arity(){return-1}core(){return this.childNodes[0]}coreMO(){return this.childNodes[0].coreMO()}setTeXclass(t){return t=this.childNodes[0].setTeXclass(t),this.updateTeXclass(this.childNodes[0]),t}}Bs.defaults=Ds.defaults;class js extends Ds{get isEmbellished(){return this.childNodes[0].isEmbellished}core(){return this.childNodes[0]}coreMO(){return this.childNodes[0].coreMO()}setTeXclass(t){this.getPrevClass(t),this.texClass=Is.ORD;const e=this.childNodes[0];let i=null;e&&(this.isEmbellished||e.isKind("mi")?(i=e.setTeXclass(t),this.updateTeXclass(this.core())):e.isKind("TeXAtom")?this.texClass=e.texClass:e.setTeXclass(null));for(const t of this.childNodes.slice(1))t&&t.setTeXclass(null);return i||this}}js.defaults=Ds.defaults;class Fs extends ws{get isToken(){return!1}get isEmbellished(){return!1}get isSpacelike(){return!1}get linebreakContainer(){return!1}get linebreakAlign(){return""}get arity(){return 0}get isInferred(){return!1}get notParent(){return!1}get Parent(){return this.parent}get texClass(){return Is.NONE}get prevClass(){return Is.NONE}get prevLevel(){return 0}hasSpacingAttributes(){return!1}get attributes(){return null}core(){return this}coreMO(){return this}coreIndex(){return 0}childPosition(){return 0}setTeXclass(t){return t}texSpacing(){return""}setInheritedAttributes(t,e,i,s){}inheritAttributesFrom(t){}verifyTree(t){}mError(t,e,i=!1){return null}}class Us extends Fs{constructor(){super(...arguments),this.text=""}get kind(){return"text"}getText(){return this.text}setText(t){return this.text=t,this}copy(){return this.factory.create(this.kind).setText(this.getText())}toString(){return this.text}}class Hs extends Fs{constructor(){super(...arguments),this.xml=null,this.adaptor=null}get kind(){return"XML"}getXML(){return this.xml}setXML(t,e=null){return this.xml=t,this.adaptor=e,this}getSerializedXML(){return this.adaptor.serializeXML(this.xml)}copy(){return this.factory.create(this.kind).setXML(this.adaptor.clone(this.xml))}toString(){return"XML data"}}class qs extends Bs{get kind(){return"math"}get linebreakContainer(){return!0}get linebreakAlign(){return""}setChildInheritedAttributes(t,e,i,s){"display"===this.attributes.get("mode")&&this.attributes.setInherited("display","block"),t=this.addInheritedAttributes(t,this.attributes.getAllAttributes()),e=!!this.attributes.get("displaystyle")||!this.attributes.get("displaystyle")&&"block"===this.attributes.get("display"),this.attributes.setInherited("displaystyle",e),i=this.attributes.get("scriptlevel")||this.constructor.defaults.scriptlevel,super.setChildInheritedAttributes(t,e,i,s)}verifyTree(t=null){super.verifyTree(t),this.parent&&this.mError("Improper nesting of math tags",t,!0)}}qs.defaults=Object.assign(Object.assign({},Bs.defaults),{mathvariant:"normal",mathsize:"normal",mathcolor:"",mathbackground:"transparent",dir:"ltr",scriptlevel:0,displaystyle:!1,display:"inline",maxwidth:"",overflow:"linebreak",altimg:"","altimg-width":"","altimg-height":"","altimg-valign":"",alttext:"",cdgroup:"",scriptsizemultiplier:1/Math.sqrt(2),scriptminsize:".4em",infixlinebreakstyle:"before",lineleading:"100%",linebreakmultchar:"\u2062",indentshift:"auto",indentalign:"auto",indenttarget:"",indentalignfirst:"indentalign",indentshiftfirst:"indentshift",indentalignlast:"indentalign",indentshiftlast:"indentshift"});class Ws extends Ps{constructor(){super(...arguments),this.texclass=Is.ORD}get kind(){return"mi"}setInheritedAttributes(t={},e=!1,i=0,s=!1){super.setInheritedAttributes(t,e,i,s);this.getText().match(Ws.singleCharacter)&&!t.mathvariant&&this.attributes.setInherited("mathvariant","italic")}setTeXclass(t){this.getPrevClass(t);const e=this.getText();return e.length>1&&e.match(Ws.operatorName)&&"normal"===this.attributes.get("mathvariant")&&void 0===this.getProperty("autoOP")&&void 0===this.getProperty("texClass")&&(this.texClass=Is.OP,this.setProperty("autoOP",!0)),this}}Ws.defaults=Object.assign({},Ps.defaults),Ws.operatorName=/^[a-z][a-z0-9]*$/i,Ws.singleCharacter=/^[\uD800-\uDBFF]?.[\u0300-\u036F\u1AB0-\u1ABE\u1DC0-\u1DFF\u20D0-\u20EF]*$/;class Vs extends Ps{constructor(){super(...arguments),this.texclass=Is.ORD}get kind(){return"mn"}}function Xs(t,e,i=Is.BIN,s=null){return[t,e,i,s]}Vs.defaults=Object.assign({},Ps.defaults);const zs={REL:Xs(5,5,Is.REL),WIDEREL:Xs(5,5,Is.REL,{accent:!0,stretchy:!0}),BIN4:Xs(4,4,Is.BIN),RELSTRETCH:Xs(5,5,Is.REL,{stretchy:!0}),ORD:Xs(0,0,Is.ORD),BIN3:Xs(3,3,Is.BIN),OPEN:Xs(0,0,Is.OPEN,{fence:!0,stretchy:!0,symmetric:!0}),CLOSE:Xs(0,0,Is.CLOSE,{fence:!0,stretchy:!0,symmetric:!0}),INTEGRAL:Xs(3,3,Is.OP,{largeop:!0,symmetric:!0}),ACCENT:Xs(0,0,Is.ORD,{accent:!0}),WIDEACCENT:Xs(0,0,Is.ORD,{accent:!0,stretchy:!0}),OP:Xs(3,3,Is.OP,{largeop:!0,movablelimits:!0,symmetric:!0}),RELACCENT:Xs(5,5,Is.REL,{accent:!0}),BIN0:Xs(0,0,Is.BIN),BIN5:Xs(5,5,Is.BIN),FENCE:Xs(0,0,Is.ORD,{fence:!0,stretchy:!0,symmetric:!0}),INNER:Xs(1,1,Is.INNER),ORD30:Xs(3,0,Is.ORD),NONE:Xs(0,0,Is.NONE),ORDSTRETCH0:Xs(0,0,Is.ORD,{stretchy:!0}),BINSTRETCH0:Xs(0,0,Is.BIN,{stretchy:!0}),RELSTRETCH0:Xs(0,0,Is.REL,{stretchy:!0}),CLOSE0:Xs(0,0,Is.CLOSE,{fence:!0}),ORD3:Xs(3,3,Is.ORD),PUNCT03:Xs(0,3,Is.PUNCT,{linebreakstyle:"after"}),OPEN0:Xs(0,0,Is.OPEN,{fence:!0}),STRETCH4:Xs(4,4,Is.BIN,{stretchy:!0})},Gs=[[32,127,Is.REL,"mo"],[160,191,Is.ORD,"mo"],[192,591,Is.ORD,"mi"],[688,879,Is.ORD,"mo"],[880,6688,Is.ORD,"mi"],[6832,6911,Is.ORD,"mo"],[6912,7615,Is.ORD,"mi"],[7616,7679,Is.ORD,"mo"],[7680,8191,Is.ORD,"mi"],[8192,8303,Is.ORD,"mo"],[8304,8351,Is.ORD,"mo"],[8448,8527,Is.ORD,"mi"],[8528,8591,Is.ORD,"mn"],[8592,8703,Is.REL,"mo"],[8704,8959,Is.BIN,"mo"],[8960,9215,Is.ORD,"mo"],[9312,9471,Is.ORD,"mn"],[9472,10223,Is.ORD,"mo"],[10224,10239,Is.REL,"mo"],[10240,10495,Is.ORD,"mtext"],[10496,10623,Is.REL,"mo"],[10624,10751,Is.ORD,"mo"],[10752,11007,Is.BIN,"mo"],[11008,11055,Is.ORD,"mo"],[11056,11087,Is.REL,"mo"],[11088,11263,Is.ORD,"mo"],[11264,11744,Is.ORD,"mi"],[11776,11903,Is.ORD,"mo"],[11904,12255,Is.ORD,"mi","normal"],[12272,12351,Is.ORD,"mo"],[12352,42143,Is.ORD,"mi","normal"],[42192,43055,Is.ORD,"mi"],[43056,43071,Is.ORD,"mn"],[43072,55295,Is.ORD,"mi"],[63744,64255,Is.ORD,"mi","normal"],[64256,65023,Is.ORD,"mi"],[65024,65135,Is.ORD,"mo"],[65136,65791,Is.ORD,"mi"],[65792,65935,Is.ORD,"mn"],[65936,74751,Is.ORD,"mi","normal"],[74752,74879,Is.ORD,"mn"],[74880,113823,Is.ORD,"mi","normal"],[113824,119391,Is.ORD,"mo"],[119648,119679,Is.ORD,"mn"],[119808,120781,Is.ORD,"mi"],[120782,120831,Is.ORD,"mn"],[122624,129023,Is.ORD,"mo"],[129024,129279,Is.REL,"mo"],[129280,129535,Is.ORD,"mo"],[131072,195103,Is.ORD,"mi","normal"]];function Js(t){const e=$s.infix[t]||$s.prefix[t]||$s.postfix[t];if(e)return[0,0,e[2],"mo"];const i=t.codePointAt(0);for(const t of Gs)if(i<=t[1]){if(i>=t[0])return t;break}return[0,0,Is.REL,"mo"]}const Ks=[[0,0],[1,2],[3,3],[4,4],[0,0],[0,0],[0,3],[1,1]],$s={prefix:{"!":zs.ORD,"(":zs.OPEN,"+":zs.BIN0,"-":zs.BIN0,"[":zs.OPEN,"{":zs.OPEN,"|":zs.OPEN,"||":zs.BIN0,"\xac":zs.ORD,"\xb1":zs.BIN0,"\u2016":zs.FENCE,"\u2018":zs.OPEN0,"\u201c":zs.OPEN0,\u2145:zs.ORD30,\u2146:zs.ORD30,"\u2200":zs.ORD,"\u2201":zs.ORD,"\u2202":zs.ORD30,"\u2203":zs.ORD,"\u2204":zs.ORD,"\u2207":zs.ORD,"\u220f":zs.OP,"\u2210":zs.OP,"\u2211":zs.OP,"\u2212":zs.BIN0,"\u2213":zs.BIN0,"\u221a":[3,0,Is.ORD,{stretchy:!0}],"\u221b":zs.ORD30,"\u221c":zs.ORD30,"\u221f":zs.ORD,"\u2220":zs.ORD,"\u2221":zs.ORD,"\u2222":zs.ORD,"\u222b":zs.INTEGRAL,"\u222c":zs.INTEGRAL,"\u222d":zs.INTEGRAL,"\u222e":zs.INTEGRAL,"\u222f":zs.INTEGRAL,"\u2230":zs.INTEGRAL,"\u2231":zs.INTEGRAL,"\u2232":zs.INTEGRAL,"\u2233":zs.INTEGRAL,"\u2234":zs.REL,"\u2235":zs.REL,"\u223c":[0,0,Is.REL,{}],"\u22be":zs.ORD,"\u22bf":zs.ORD,"\u22c0":zs.OP,"\u22c1":zs.OP,"\u22c2":zs.OP,"\u22c3":zs.OP,"\u2308":zs.OPEN,"\u230a":zs.OPEN,"\u2310":zs.ORD,"\u2319":zs.ORD,"\u2772":zs.OPEN,"\u2795":zs.ORD,"\u2796":zs.ORD,"\u27c0":zs.ORD,"\u27e6":zs.OPEN,"\u27e8":zs.OPEN,"\u27ea":zs.OPEN,"\u27ec":zs.OPEN,"\u27ee":zs.OPEN,"\u2980":zs.FENCE,"\u2983":zs.OPEN,"\u2985":zs.OPEN,"\u2987":zs.OPEN,"\u2989":zs.OPEN,"\u298b":zs.OPEN,"\u298d":zs.OPEN,"\u298f":zs.OPEN,"\u2991":zs.OPEN,"\u2993":zs.OPEN,"\u2995":zs.OPEN,"\u2997":zs.OPEN,"\u2999":zs.FENCE,"\u299b":zs.ORD,"\u299c":zs.ORD,"\u299d":zs.ORD,"\u299e":zs.ORD,"\u299f":zs.ORD,"\u29a0":zs.ORD,"\u29a1":zs.ORD,"\u29a2":zs.ORD,"\u29a3":zs.ORD,"\u29a4":zs.ORD,"\u29a5":zs.ORD,"\u29a6":zs.ORD,"\u29a7":zs.ORD,"\u29a8":zs.ORD,"\u29a9":zs.ORD,"\u29aa":zs.ORD,"\u29ab":zs.ORD,"\u29ac":zs.ORD,"\u29ad":zs.ORD,"\u29ae":zs.ORD,"\u29af":zs.ORD,"\u29d8":zs.OPEN,"\u29da":zs.OPEN,"\u29fc":zs.OPEN,"\u2a00":zs.OP,"\u2a01":zs.OP,"\u2a02":zs.OP,"\u2a03":zs.OP,"\u2a04":zs.OP,"\u2a05":zs.OP,"\u2a06":zs.OP,"\u2a07":zs.OP,"\u2a08":zs.OP,"\u2a09":zs.OP,"\u2a0a":zs.OP,"\u2a0b":zs.INTEGRAL,"\u2a0c":zs.INTEGRAL,"\u2a0d":zs.INTEGRAL,"\u2a0e":zs.INTEGRAL,"\u2a0f":zs.INTEGRAL,"\u2a10":zs.INTEGRAL,"\u2a11":zs.INTEGRAL,"\u2a12":zs.INTEGRAL,"\u2a13":zs.INTEGRAL,"\u2a14":zs.INTEGRAL,"\u2a15":zs.INTEGRAL,"\u2a16":zs.INTEGRAL,"\u2a17":zs.INTEGRAL,"\u2a18":zs.INTEGRAL,"\u2a19":zs.INTEGRAL,"\u2a1a":zs.INTEGRAL,"\u2a1b":zs.INTEGRAL,"\u2a1c":zs.INTEGRAL,"\u2a1d":zs.OP,"\u2a1e":zs.OP,"\u2aec":zs.ORD,"\u2aed":zs.ORD,"\u2afc":zs.OP,"\u2aff":zs.OP,"\u3008":zs.OPEN},postfix:{"!!":zs.BIN0,"!":zs.CLOSE0,'"':zs.ORD,"%":zs.ORD,"&":zs.ORD,"'":zs.ACCENT,")":zs.CLOSE,"++":zs.BIN0,"--":zs.BIN0,"]":zs.CLOSE,"^":zs.WIDEACCENT,_:zs.WIDEACCENT,"`":zs.ACCENT,"|":zs.CLOSE,"||":zs.BIN0,"}":zs.CLOSE,"~":zs.WIDEACCENT,"\xa8":zs.ACCENT,"\xaf":zs.WIDEACCENT,"\xb0":zs.ACCENT,"\xb2":zs.ORD,"\xb3":zs.ORD,"\xb4":zs.ACCENT,"\xb8":zs.ACCENT,"\xb9":zs.ORD,\u02c6:zs.WIDEACCENT,\u02c7:zs.WIDEACCENT,\u02c9:zs.WIDEACCENT,\u02ca:zs.ACCENT,\u02cb:zs.ACCENT,\u02cd:zs.WIDEACCENT,"\u02d8":zs.ACCENT,"\u02d9":zs.ACCENT,"\u02da":zs.ACCENT,"\u02dc":zs.WIDEACCENT,"\u02dd":zs.ACCENT,"\u02f7":zs.WIDEACCENT,"\u0302":zs.WIDEACCENT,"\u0311":zs.ACCENT,"\u2016":zs.FENCE,"\u2019":zs.CLOSE0,"\u201a":zs.ORD,"\u201b":zs.ORD,"\u201d":zs.CLOSE0,"\u201e":zs.ORD,"\u201f":zs.ORD,"\u2032":zs.ORD,"\u2033":zs.ORD,"\u2034":zs.ORD,"\u2035":zs.ORD,"\u2036":zs.ORD,"\u2037":zs.ORD,"\u203e":zs.WIDEACCENT,"\u2057":zs.ORD,"\u20db":zs.ACCENT,"\u20dc":zs.ACCENT,"\u2309":zs.CLOSE,"\u230b":zs.CLOSE,"\u2322":zs.RELSTRETCH0,"\u2323":zs.RELSTRETCH0,"\u23b4":zs.WIDEACCENT,"\u23b5":zs.WIDEACCENT,"\u23cd":zs.ORD,"\u23dc":zs.WIDEACCENT,"\u23dd":zs.WIDEACCENT,"\u23de":zs.WIDEACCENT,"\u23df":zs.WIDEACCENT,"\u23e0":zs.WIDEACCENT,"\u23e1":zs.WIDEACCENT,"\u2773":zs.CLOSE,"\u27e7":zs.CLOSE,"\u27e9":zs.CLOSE,"\u27eb":zs.CLOSE,"\u27ed":zs.CLOSE,"\u27ef":zs.CLOSE,"\u2980":zs.FENCE,"\u2984":zs.CLOSE,"\u2986":zs.CLOSE,"\u2988":zs.CLOSE,"\u298a":zs.CLOSE,"\u298c":zs.CLOSE,"\u298e":zs.CLOSE,"\u2990":zs.CLOSE,"\u2992":zs.CLOSE,"\u2994":zs.CLOSE,"\u2996":zs.CLOSE,"\u2998":zs.CLOSE,"\u2999":zs.FENCE,"\u29d9":zs.CLOSE,"\u29db":zs.CLOSE,"\u29fd":zs.CLOSE,"\u3009":zs.CLOSE,"\u{1eef0}":zs.BINSTRETCH0,"\u{1eef1}":zs.BINSTRETCH0},infix:{"!":zs.ORD,"!=":zs.BIN5,"#":zs.ORD,$:zs.ORD,"%":zs.ORD3,"&&":zs.BIN4,"**":zs.BIN3,"*":zs.BIN3,"*=":zs.BIN5,"+":zs.BIN4,"+=":zs.BIN5,",":zs.PUNCT03,"":zs.ORD,"-":zs.BIN4,"-=":zs.BIN5,"->":zs.BIN5,".":zs.ORD3,"..":zs.BIN3,"...":zs.INNER,"/":[4,4,Is.ORD,{}],"//":zs.BIN5,"/=":zs.BIN5,":":[0,3,Is.REL,{}],":=":zs.BIN5,";":zs.PUNCT03,"<":zs.REL,"<=":zs.REL,"<>":[3,3,Is.REL,{}],"=":zs.REL,"==":zs.REL,">":zs.REL,">=":zs.REL,"?":[3,3,Is.CLOSE,{fence:!0}],"@":zs.ORD3,"\\":zs.ORD,"^":[3,3,Is.ORD,{accent:!0,stretchy:!0}],_:zs.WIDEACCENT,"|":[5,5,Is.ORD,{}],"||":zs.BIN5,"\xb1":zs.BIN4,"\xb7":zs.BIN3,"\xd7":zs.BIN3,"\xf7":zs.BIN4,\u02b9:zs.ORD,"\u0300":zs.ACCENT,"\u0301":zs.ACCENT,"\u0303":zs.WIDEACCENT,"\u0304":zs.ACCENT,"\u0306":zs.ACCENT,"\u0307":zs.ACCENT,"\u0308":zs.ACCENT,"\u030c":zs.ACCENT,"\u0332":zs.WIDEACCENT,"\u0338":zs.REL,"\u03f6":zs.REL,"\u2015":zs.ORDSTRETCH0,"\u2017":zs.ORDSTRETCH0,"\u2020":zs.BIN3,"\u2021":zs.BIN3,"\u2022":zs.BIN3,"\u2026":zs.INNER,"\u2043":zs.BIN3,"\u2044":zs.STRETCH4,"\u2061":zs.NONE,"\u2062":zs.NONE,"\u2063":[0,0,Is.NONE,{linebreakstyle:"after"}],"\u2064":zs.NONE,"\u20d7":zs.ACCENT,\u2111:zs.ORD,\u2113:zs.ORD,\u2118:zs.ORD,\u211c:zs.ORD,"\u2190":zs.WIDEREL,"\u2191":zs.RELSTRETCH,"\u2192":zs.WIDEREL,"\u2193":zs.RELSTRETCH,"\u2194":zs.WIDEREL,"\u2195":zs.RELSTRETCH,"\u2196":zs.REL,"\u2197":zs.REL,"\u2198":zs.REL,"\u2199":zs.REL,"\u219a":zs.WIDEREL,"\u219b":zs.WIDEREL,"\u219c":zs.WIDEREL,"\u219d":zs.WIDEREL,"\u219e":zs.WIDEREL,"\u219f":zs.RELSTRETCH,"\u21a0":zs.WIDEREL,"\u21a1":zs.RELSTRETCH,"\u21a2":zs.WIDEREL,"\u21a3":zs.WIDEREL,"\u21a4":zs.WIDEREL,"\u21a5":zs.RELSTRETCH,"\u21a6":zs.WIDEREL,"\u21a7":zs.RELSTRETCH,"\u21a8":zs.RELSTRETCH,"\u21a9":zs.WIDEREL,"\u21aa":zs.WIDEREL,"\u21ab":zs.WIDEREL,"\u21ac":zs.WIDEREL,"\u21ad":zs.WIDEREL,"\u21ae":zs.WIDEREL,"\u21af":zs.REL,"\u21b0":zs.RELSTRETCH,"\u21b1":zs.RELSTRETCH,"\u21b2":zs.RELSTRETCH,"\u21b3":zs.RELSTRETCH,"\u21b4":zs.RELSTRETCH,"\u21b5":zs.RELSTRETCH,"\u21b6":zs.REL,"\u21b7":zs.REL,"\u21b8":zs.REL,"\u21b9":zs.WIDEREL,"\u21ba":zs.REL,"\u21bb":zs.REL,"\u21bc":zs.WIDEREL,"\u21bd":zs.WIDEREL,"\u21be":zs.RELSTRETCH,"\u21bf":zs.RELSTRETCH,"\u21c0":zs.WIDEREL,"\u21c1":zs.WIDEREL,"\u21c2":zs.RELSTRETCH,"\u21c3":zs.RELSTRETCH,"\u21c4":zs.WIDEREL,"\u21c5":zs.RELSTRETCH,"\u21c6":zs.WIDEREL,"\u21c7":zs.WIDEREL,"\u21c8":zs.RELSTRETCH,"\u21c9":zs.WIDEREL,"\u21ca":zs.RELSTRETCH,"\u21cb":zs.WIDEREL,"\u21cc":zs.WIDEREL,"\u21cd":zs.WIDEREL,"\u21ce":zs.WIDEREL,"\u21cf":zs.WIDEREL,"\u21d0":zs.WIDEREL,"\u21d1":zs.RELSTRETCH,"\u21d2":zs.WIDEREL,"\u21d3":zs.RELSTRETCH,"\u21d4":zs.WIDEREL,"\u21d5":zs.RELSTRETCH,"\u21d6":zs.REL,"\u21d7":zs.REL,"\u21d8":zs.REL,"\u21d9":zs.REL,"\u21da":zs.WIDEREL,"\u21db":zs.WIDEREL,"\u21dc":zs.WIDEREL,"\u21dd":zs.WIDEREL,"\u21de":zs.RELSTRETCH,"\u21df":zs.RELSTRETCH,"\u21e0":zs.WIDEREL,"\u21e1":zs.RELSTRETCH,"\u21e2":zs.WIDEREL,"\u21e3":zs.RELSTRETCH,"\u21e4":zs.WIDEREL,"\u21e5":zs.WIDEREL,"\u21e6":zs.WIDEREL,"\u21e7":zs.RELSTRETCH,"\u21e8":zs.WIDEREL,"\u21e9":zs.RELSTRETCH,"\u21ea":zs.RELSTRETCH,"\u21eb":zs.RELSTRETCH,"\u21ec":zs.RELSTRETCH,"\u21ed":zs.RELSTRETCH,"\u21ee":zs.RELSTRETCH,"\u21ef":zs.RELSTRETCH,"\u21f0":zs.WIDEREL,"\u21f1":zs.REL,"\u21f2":zs.REL,"\u21f3":zs.RELSTRETCH,"\u21f4":zs.WIDEREL,"\u21f5":zs.RELSTRETCH,"\u21f6":zs.WIDEREL,"\u21f7":zs.WIDEREL,"\u21f8":zs.WIDEREL,"\u21f9":zs.WIDEREL,"\u21fa":zs.WIDEREL,"\u21fb":zs.WIDEREL,"\u21fc":zs.WIDEREL,"\u21fd":zs.WIDEREL,"\u21fe":zs.WIDEREL,"\u21ff":zs.WIDEREL,"\u2205":zs.ORD,"\u2206":zs.ORD,"\u2208":zs.REL,"\u2209":zs.REL,"\u220a":zs.REL,"\u220b":zs.REL,"\u220c":zs.REL,"\u220d":zs.REL,"\u2212":zs.BIN4,"\u2213":zs.BIN4,"\u2214":zs.BIN4,"\u2215":zs.STRETCH4,"\u2216":zs.BIN4,"\u2217":zs.BIN3,"\u2218":zs.BIN3,"\u2219":zs.BIN3,"\u221d":zs.REL,"\u221e":zs.ORD,"\u2223":zs.REL,"\u2224":zs.REL,"\u2225":zs.REL,"\u2226":zs.REL,"\u2227":zs.BIN4,"\u2228":zs.BIN4,"\u2229":zs.BIN4,"\u222a":zs.BIN4,"\u2236":zs.BIN4,"\u2237":zs.REL,"\u2238":zs.BIN4,"\u2239":zs.REL,"\u223a":zs.REL,"\u223b":zs.REL,"\u223c":zs.REL,"\u223d":zs.REL,"\u223e":zs.REL,"\u2240":zs.BIN3,"\u2241":zs.REL,"\u2242":zs.REL,"\u2242\u0338":zs.REL,"\u2243":zs.REL,"\u2244":zs.REL,"\u2245":zs.REL,"\u2246":zs.REL,"\u2247":zs.REL,"\u2248":zs.REL,"\u2249":zs.REL,"\u224a":zs.REL,"\u224b":zs.REL,"\u224c":zs.REL,"\u224d":zs.REL,"\u224e":zs.REL,"\u224f":zs.REL,"\u2250":zs.REL,"\u2251":zs.REL,"\u2252":zs.REL,"\u2253":zs.REL,"\u2254":zs.REL,"\u2255":zs.REL,"\u2256":zs.REL,"\u2257":zs.REL,"\u2258":zs.REL,"\u2259":zs.REL,"\u225a":zs.REL,"\u225b":zs.REL,"\u225c":zs.REL,"\u225d":zs.REL,"\u225e":zs.REL,"\u225f":zs.REL,"\u2260":zs.REL,"\u2261":zs.REL,"\u2262":zs.REL,"\u2263":zs.REL,"\u2264":zs.REL,"\u2265":zs.REL,"\u2266":zs.REL,"\u2266\u0338":zs.REL,"\u2267":zs.REL,"\u2267\u0338":zs.REL,"\u2268":zs.REL,"\u2269":zs.REL,"\u226a":zs.REL,"\u226a\u0338":zs.REL,"\u226b":zs.REL,"\u226b\u0338":zs.REL,"\u226c":zs.REL,"\u226d":zs.REL,"\u226e":zs.REL,"\u226f":zs.REL,"\u2270":zs.REL,"\u2271":zs.REL,"\u2272":zs.REL,"\u2273":zs.REL,"\u2274":zs.REL,"\u2275":zs.REL,"\u2276":zs.REL,"\u2277":zs.REL,"\u2278":zs.REL,"\u2279":zs.REL,"\u227a":zs.REL,"\u227b":zs.REL,"\u227c":zs.REL,"\u227d":zs.REL,"\u227e":zs.REL,"\u227e\u0338":zs.REL,"\u227f":zs.REL,"\u227f\u0338":zs.REL,"\u2280":zs.REL,"\u2281":zs.REL,"\u2282":zs.REL,"\u2283":zs.REL,"\u2284":zs.REL,"\u2285":zs.REL,"\u2286":zs.REL,"\u2287":zs.REL,"\u2288":zs.REL,"\u2289":zs.REL,"\u228a":zs.REL,"\u228b":zs.REL,"\u228c":zs.BIN4,"\u228d":zs.BIN4,"\u228e":zs.BIN4,"\u228f":zs.REL,"\u228f\u0338":zs.REL,"\u2290":zs.REL,"\u2290\u0338":zs.REL,"\u2291":zs.REL,"\u2292":zs.REL,"\u2293":zs.BIN4,"\u2294":zs.BIN4,"\u2295":zs.BIN4,"\u2296":zs.BIN4,"\u2297":zs.BIN3,"\u2298":zs.BIN4,"\u2299":zs.BIN3,"\u229a":zs.BIN3,"\u229b":zs.BIN3,"\u229c":zs.REL,"\u229d":zs.BIN4,"\u229e":zs.BIN4,"\u229f":zs.BIN4,"\u22a0":zs.BIN3,"\u22a1":zs.BIN3,"\u22a2":zs.REL,"\u22a3":zs.REL,"\u22a4":zs.ORD,"\u22a5":zs.ORD,"\u22a6":zs.REL,"\u22a7":zs.REL,"\u22a8":zs.REL,"\u22a9":zs.REL,"\u22aa":zs.REL,"\u22ab":zs.REL,"\u22ac":zs.REL,"\u22ad":zs.REL,"\u22ae":zs.REL,"\u22af":zs.REL,"\u22b0":zs.REL,"\u22b1":zs.REL,"\u22b2":zs.REL,"\u22b3":zs.REL,"\u22b4":zs.REL,"\u22b5":zs.REL,"\u22b6":zs.REL,"\u22b7":zs.REL,"\u22b8":zs.REL,"\u22ba":zs.BIN3,"\u22bb":zs.BIN4,"\u22bc":zs.BIN4,"\u22bd":zs.BIN4,"\u22c4":zs.BIN3,"\u22c5":zs.BIN3,"\u22c6":zs.BIN3,"\u22c7":zs.BIN3,"\u22c8":zs.REL,"\u22c9":zs.BIN3,"\u22ca":zs.BIN3,"\u22cb":zs.BIN3,"\u22cc":zs.BIN3,"\u22cd":zs.REL,"\u22ce":zs.BIN4,"\u22cf":zs.BIN4,"\u22d0":zs.REL,"\u22d1":zs.REL,"\u22d2":zs.BIN4,"\u22d3":zs.BIN4,"\u22d4":zs.REL,"\u22d5":zs.REL,"\u22d6":zs.REL,"\u22d7":zs.REL,"\u22d8":zs.REL,"\u22d9":zs.REL,"\u22da":zs.REL,"\u22db":zs.REL,"\u22dc":zs.REL,"\u22dd":zs.REL,"\u22de":zs.REL,"\u22df":zs.REL,"\u22e0":zs.REL,"\u22e1":zs.REL,"\u22e2":zs.REL,"\u22e3":zs.REL,"\u22e4":zs.REL,"\u22e5":zs.REL,"\u22e6":zs.REL,"\u22e7":zs.REL,"\u22e8":zs.REL,"\u22e9":zs.REL,"\u22ea":zs.REL,"\u22eb":zs.REL,"\u22ec":zs.REL,"\u22ed":zs.REL,"\u22ee":zs.ORD,"\u22ef":zs.INNER,"\u22f0":zs.INNER,"\u22f1":zs.INNER,"\u22f2":zs.REL,"\u22f3":zs.REL,"\u22f4":zs.REL,"\u22f5":zs.REL,"\u22f6":zs.REL,"\u22f7":zs.REL,"\u22f8":zs.REL,"\u22f9":zs.REL,"\u22fa":zs.REL,"\u22fb":zs.REL,"\u22fc":zs.REL,"\u22fd":zs.REL,"\u22fe":zs.REL,"\u22ff":zs.REL,"\u2301":zs.REL,"\u2305":zs.BIN3,"\u2306":zs.BIN3,"\u2329":zs.OPEN,"\u232a":zs.CLOSE,"\u237c":zs.REL,"\u238b":zs.REL,"\u23aa":zs.ORD,"\u23af":zs.ORDSTRETCH0,"\u23b0":zs.OPEN,"\u23b1":zs.CLOSE,"\u2500":zs.ORD,"\u25b3":zs.BIN3,"\u25b5":zs.BIN3,"\u25b9":zs.BIN3,"\u25bd":zs.BIN3,"\u25bf":zs.BIN3,"\u25c3":zs.BIN3,"\u25ef":zs.BIN3,"\u2660":zs.ORD,"\u2661":zs.ORD,"\u2662":zs.ORD,"\u2663":zs.ORD,"\u266d":zs.ORD,"\u266e":zs.ORD,"\u266f":zs.ORD,"\u2758":[5,5,Is.REL,{stretchy:!0,symmetric:!0}],"\u2794":zs.WIDEREL,"\u2795":zs.BIN4,"\u2796":zs.BIN4,"\u2797":zs.BIN4,"\u2798":zs.REL,"\u2799":zs.WIDEREL,"\u279a":zs.REL,"\u279b":zs.WIDEREL,"\u279c":zs.WIDEREL,"\u279d":zs.WIDEREL,"\u279e":zs.WIDEREL,"\u279f":zs.WIDEREL,"\u27a0":zs.WIDEREL,"\u27a1":zs.WIDEREL,"\u27a5":zs.WIDEREL,"\u27a6":zs.WIDEREL,"\u27a7":zs.RELACCENT,"\u27a8":zs.WIDEREL,"\u27a9":zs.WIDEREL,"\u27aa":zs.WIDEREL,"\u27ab":zs.WIDEREL,"\u27ac":zs.WIDEREL,"\u27ad":zs.WIDEREL,"\u27ae":zs.WIDEREL,"\u27af":zs.WIDEREL,"\u27b1":zs.WIDEREL,"\u27b2":zs.RELACCENT,"\u27b3":zs.WIDEREL,"\u27b4":zs.REL,"\u27b5":zs.WIDEREL,"\u27b6":zs.REL,"\u27b7":zs.REL,"\u27b8":zs.WIDEREL,"\u27b9":zs.REL,"\u27ba":zs.WIDEREL,"\u27bb":zs.WIDEREL,"\u27bc":zs.WIDEREL,"\u27bd":zs.WIDEREL,"\u27be":zs.WIDEREL,"\u27c2":zs.REL,"\u27c2\u0338":zs.REL,"\u27cb":zs.BIN3,"\u27cd":zs.BIN3,"\u27f0":zs.RELSTRETCH,"\u27f1":zs.RELSTRETCH,"\u27f2":zs.REL,"\u27f3":zs.REL,"\u27f4":zs.RELSTRETCH,"\u27f5":zs.WIDEREL,"\u27f6":zs.WIDEREL,"\u27f7":zs.WIDEREL,"\u27f8":zs.WIDEREL,"\u27f9":zs.WIDEREL,"\u27fa":zs.WIDEREL,"\u27fb":zs.WIDEREL,"\u27fc":zs.WIDEREL,"\u27fd":zs.WIDEREL,"\u27fe":zs.WIDEREL,"\u27ff":zs.WIDEREL,"\u2900":zs.WIDEREL,"\u2901":zs.WIDEREL,"\u2902":zs.WIDEREL,"\u2903":zs.WIDEREL,"\u2904":zs.WIDEREL,"\u2905":zs.WIDEREL,"\u2906":zs.WIDEREL,"\u2907":zs.WIDEREL,"\u2908":zs.RELSTRETCH,"\u2909":zs.RELSTRETCH,"\u290a":zs.RELSTRETCH,"\u290b":zs.RELSTRETCH,"\u290c":zs.WIDEREL,"\u290d":zs.WIDEREL,"\u290e":zs.WIDEREL,"\u290f":zs.WIDEREL,"\u2910":zs.WIDEREL,"\u2911":zs.WIDEREL,"\u2912":zs.RELSTRETCH,"\u2913":zs.RELSTRETCH,"\u2914":zs.WIDEREL,"\u2915":zs.WIDEREL,"\u2916":zs.WIDEREL,"\u2917":zs.WIDEREL,"\u2918":zs.WIDEREL,"\u2919":zs.WIDEREL,"\u291a":zs.WIDEREL,"\u291b":zs.WIDEREL,"\u291c":zs.WIDEREL,"\u291d":zs.WIDEREL,"\u291e":zs.WIDEREL,"\u291f":zs.WIDEREL,"\u2920":zs.WIDEREL,"\u2921":zs.REL,"\u2922":zs.REL,"\u2923":zs.REL,"\u2924":zs.REL,"\u2925":zs.REL,"\u2926":zs.REL,"\u2927":zs.REL,"\u2928":zs.REL,"\u2929":zs.REL,"\u292a":zs.REL,"\u292b":zs.REL,"\u292c":zs.REL,"\u292d":zs.REL,"\u292e":zs.REL,"\u292f":zs.REL,"\u2930":zs.REL,"\u2931":zs.REL,"\u2932":zs.REL,"\u2933":zs.RELACCENT,"\u2934":zs.RELSTRETCH,"\u2935":zs.RELSTRETCH,"\u2936":zs.RELSTRETCH,"\u2937":zs.RELSTRETCH,"\u2938":zs.REL,"\u2939":zs.REL,"\u293a":zs.RELACCENT,"\u293b":zs.RELACCENT,"\u293c":zs.RELACCENT,"\u293d":zs.RELACCENT,"\u293e":zs.REL,"\u293f":zs.REL,"\u2940":zs.REL,"\u2941":zs.REL,"\u2942":zs.WIDEREL,"\u2943":zs.WIDEREL,"\u2944":zs.WIDEREL,"\u2945":zs.RELSTRETCH,"\u2946":zs.RELSTRETCH,"\u2947":zs.WIDEREL,"\u2948":zs.WIDEREL,"\u2949":zs.RELSTRETCH,"\u294a":zs.WIDEREL,"\u294b":zs.WIDEREL,"\u294c":zs.RELSTRETCH,"\u294d":zs.RELSTRETCH,"\u294e":zs.WIDEREL,"\u294f":zs.RELSTRETCH,"\u2950":zs.WIDEREL,"\u2951":zs.RELSTRETCH,"\u2952":zs.WIDEREL,"\u2953":zs.WIDEREL,"\u2954":zs.RELSTRETCH,"\u2955":zs.RELSTRETCH,"\u2956":zs.WIDEREL,"\u2957":zs.WIDEREL,"\u2958":zs.RELSTRETCH,"\u2959":zs.RELSTRETCH,"\u295a":zs.WIDEREL,"\u295b":zs.WIDEREL,"\u295c":zs.RELSTRETCH,"\u295d":zs.RELSTRETCH,"\u295e":zs.WIDEREL,"\u295f":zs.WIDEREL,"\u2960":zs.RELSTRETCH,"\u2961":zs.RELSTRETCH,"\u2962":zs.WIDEREL,"\u2963":zs.RELSTRETCH,"\u2964":zs.WIDEREL,"\u2965":zs.RELSTRETCH,"\u2966":zs.WIDEREL,"\u2967":zs.WIDEREL,"\u2968":zs.WIDEREL,"\u2969":zs.WIDEREL,"\u296a":zs.WIDEREL,"\u296b":zs.WIDEREL,"\u296c":zs.WIDEREL,"\u296d":zs.WIDEREL,"\u296e":zs.RELSTRETCH,"\u296f":zs.RELSTRETCH,"\u2970":zs.WIDEREL,"\u2971":zs.WIDEREL,"\u2972":zs.WIDEREL,"\u2973":zs.WIDEREL,"\u2974":zs.WIDEREL,"\u2975":zs.WIDEREL,"\u2976":zs.RELACCENT,"\u2977":zs.RELACCENT,"\u2978":zs.RELACCENT,"\u2979":zs.RELACCENT,"\u297a":zs.RELACCENT,"\u297b":zs.RELACCENT,"\u297c":zs.WIDEREL,"\u297d":zs.WIDEREL,"\u297e":zs.RELSTRETCH,"\u297f":zs.RELSTRETCH,"\u2981":zs.REL,"\u2982":zs.REL,"\u29b6":zs.REL,"\u29b7":zs.REL,"\u29b8":zs.BIN4,"\u29b9":zs.REL,"\u29bc":zs.BIN4,"\u29c0":zs.REL,"\u29c1":zs.REL,"\u29c4":zs.BIN4,"\u29c5":zs.BIN4,"\u29c6":zs.BIN3,"\u29c7":zs.BIN3,"\u29c8":zs.BIN3,"\u29ce":zs.REL,"\u29cf":zs.REL,"\u29d0":zs.REL,"\u29d1":zs.REL,"\u29d2":zs.REL,"\u29d3":zs.REL,"\u29d4":zs.BIN3,"\u29d5":zs.BIN3,"\u29d6":zs.BIN3,"\u29d7":zs.BIN3,"\u29df":zs.REL,"\u29e1":zs.REL,"\u29e2":zs.BIN3,"\u29e3":zs.REL,"\u29e4":zs.REL,"\u29e5":zs.REL,"\u29e6":zs.REL,"\u29f4":zs.REL,"\u29f5":zs.BIN4,"\u29f6":zs.BIN4,"\u29f7":zs.BIN4,"\u29f8":zs.BIN4,"\u29f9":zs.BIN4,"\u29fa":zs.BIN4,"\u29fb":zs.BIN4,"\u2a1d":zs.BIN3,"\u2a1e":zs.BIN3,"\u2a1f":zs.BIN4,"\u2a20":zs.BIN4,"\u2a21":zs.BIN4,"\u2a22":zs.BIN4,"\u2a23":zs.BIN4,"\u2a24":zs.BIN4,"\u2a25":zs.BIN4,"\u2a26":zs.BIN4,"\u2a27":zs.BIN4,"\u2a28":zs.BIN4,"\u2a29":zs.BIN4,"\u2a2a":zs.BIN4,"\u2a2b":zs.BIN4,"\u2a2c":zs.BIN4,"\u2a2d":zs.BIN4,"\u2a2e":zs.BIN4,"\u2a2f":zs.BIN3,"\u2a30":zs.BIN3,"\u2a31":zs.BIN3,"\u2a32":zs.BIN3,"\u2a33":zs.BIN3,"\u2a34":zs.BIN3,"\u2a35":zs.BIN3,"\u2a36":zs.BIN3,"\u2a37":zs.BIN3,"\u2a38":zs.BIN4,"\u2a39":zs.BIN4,"\u2a3a":zs.BIN4,"\u2a3b":zs.BIN3,"\u2a3c":zs.BIN3,"\u2a3d":zs.BIN3,"\u2a3e":zs.BIN4,"\u2a3f":zs.BIN3,"\u2a40":zs.BIN4,"\u2a41":zs.BIN4,"\u2a42":zs.BIN4,"\u2a43":zs.BIN4,"\u2a44":zs.BIN4,"\u2a45":zs.BIN4,"\u2a46":zs.BIN4,"\u2a47":zs.BIN4,"\u2a48":zs.BIN4,"\u2a49":zs.BIN4,"\u2a4a":zs.BIN4,"\u2a4b":zs.BIN4,"\u2a4c":zs.BIN4,"\u2a4d":zs.BIN4,"\u2a4e":zs.BIN4,"\u2a4f":zs.BIN4,"\u2a50":zs.BIN3,"\u2a51":zs.BIN4,"\u2a52":zs.BIN4,"\u2a53":zs.BIN4,"\u2a54":zs.BIN4,"\u2a55":zs.BIN4,"\u2a56":zs.BIN4,"\u2a57":zs.BIN4,"\u2a58":zs.BIN4,"\u2a59":zs.BIN4,"\u2a5a":zs.BIN4,"\u2a5b":zs.BIN4,"\u2a5c":zs.BIN4,"\u2a5d":zs.BIN4,"\u2a5e":zs.BIN4,"\u2a5f":zs.BIN4,"\u2a60":zs.BIN4,"\u2a61":zs.BIN4,"\u2a62":zs.BIN4,"\u2a63":zs.BIN4,"\u2a64":zs.BIN3,"\u2a65":zs.BIN3,"\u2a66":zs.REL,"\u2a67":zs.REL,"\u2a68":zs.REL,"\u2a69":zs.REL,"\u2a6a":zs.REL,"\u2a6b":zs.REL,"\u2a6c":zs.REL,"\u2a6d":zs.REL,"\u2a6e":zs.REL,"\u2a6f":zs.REL,"\u2a70":zs.REL,"\u2a71":zs.REL,"\u2a72":zs.REL,"\u2a73":zs.REL,"\u2a74":zs.REL,"\u2a75":zs.REL,"\u2a76":zs.REL,"\u2a77":zs.REL,"\u2a78":zs.REL,"\u2a79":zs.REL,"\u2a7a":zs.REL,"\u2a7b":zs.REL,"\u2a7c":zs.REL,"\u2a7d":zs.REL,"\u2a7d\u0338":zs.REL,"\u2a7e":zs.REL,"\u2a7e\u0338":zs.REL,"\u2a7f":zs.REL,"\u2a80":zs.REL,"\u2a81":zs.REL,"\u2a82":zs.REL,"\u2a83":zs.REL,"\u2a84":zs.REL,"\u2a85":zs.REL,"\u2a86":zs.REL,"\u2a87":zs.REL,"\u2a88":zs.REL,"\u2a89":zs.REL,"\u2a8a":zs.REL,"\u2a8b":zs.REL,"\u2a8c":zs.REL,"\u2a8d":zs.REL,"\u2a8e":zs.REL,"\u2a8f":zs.REL,"\u2a90":zs.REL,"\u2a91":zs.REL,"\u2a92":zs.REL,"\u2a93":zs.REL,"\u2a94":zs.REL,"\u2a95":zs.REL,"\u2a96":zs.REL,"\u2a97":zs.REL,"\u2a98":zs.REL,"\u2a99":zs.REL,"\u2a9a":zs.REL,"\u2a9b":zs.REL,"\u2a9c":zs.REL,"\u2a9d":zs.REL,"\u2a9e":zs.REL,"\u2a9f":zs.REL,"\u2aa0":zs.REL,"\u2aa1":zs.REL,"\u2aa2":zs.REL,"\u2aa3":zs.REL,"\u2aa4":zs.REL,"\u2aa5":zs.REL,"\u2aa6":zs.REL,"\u2aa7":zs.REL,"\u2aa8":zs.REL,"\u2aa9":zs.REL,"\u2aaa":zs.REL,"\u2aab":zs.REL,"\u2aac":zs.REL,"\u2aad":zs.REL,"\u2aae":zs.REL,"\u2aaf":zs.REL,"\u2aaf\u0338":zs.REL,"\u2ab0":zs.REL,"\u2ab0\u0338":zs.REL,"\u2ab1":zs.REL,"\u2ab2":zs.REL,"\u2ab3":zs.REL,"\u2ab4":zs.REL,"\u2ab5":zs.REL,"\u2ab6":zs.REL,"\u2ab7":zs.REL,"\u2ab8":zs.REL,"\u2ab9":zs.REL,"\u2aba":zs.REL,"\u2abb":zs.REL,"\u2abc":zs.REL,"\u2abd":zs.REL,"\u2abe":zs.REL,"\u2abf":zs.REL,"\u2ac0":zs.REL,"\u2ac1":zs.REL,"\u2ac2":zs.REL,"\u2ac3":zs.REL,"\u2ac4":zs.REL,"\u2ac5":zs.REL,"\u2ac6":zs.REL,"\u2ac7":zs.REL,"\u2ac8":zs.REL,"\u2ac9":zs.REL,"\u2aca":zs.REL,"\u2acb":zs.REL,"\u2acc":zs.REL,"\u2acd":zs.REL,"\u2ace":zs.REL,"\u2acf":zs.REL,"\u2ad0":zs.REL,"\u2ad1":zs.REL,"\u2ad2":zs.REL,"\u2ad3":zs.REL,"\u2ad4":zs.REL,"\u2ad5":zs.REL,"\u2ad6":zs.REL,"\u2ad7":zs.REL,"\u2ad8":zs.REL,"\u2ad9":zs.REL,"\u2ada":zs.REL,"\u2adb":zs.BIN4,"\u2add":zs.BIN3,"\u2add\u0338":zs.REL,"\u2ade":zs.REL,"\u2adf":zs.REL,"\u2ae0":zs.REL,"\u2ae1":zs.REL,"\u2ae2":zs.REL,"\u2ae3":zs.REL,"\u2ae4":zs.REL,"\u2ae5":zs.REL,"\u2ae6":zs.REL,"\u2ae7":zs.REL,"\u2ae8":zs.REL,"\u2ae9":zs.REL,"\u2aea":zs.REL,"\u2aeb":zs.REL,"\u2aee":zs.REL,"\u2af2":zs.REL,"\u2af3":zs.REL,"\u2af4":zs.REL,"\u2af5":zs.REL,"\u2af6":zs.BIN4,"\u2af7":zs.REL,"\u2af8":zs.REL,"\u2af9":zs.REL,"\u2afa":zs.REL,"\u2afb":zs.BIN4,"\u2afd":zs.BIN4,"\u2afe":zs.BIN3,"\u2b00":zs.REL,"\u2b01":zs.REL,"\u2b02":zs.REL,"\u2b03":zs.REL,"\u2b04":zs.WIDEREL,"\u2b05":zs.WIDEREL,"\u2b06":zs.RELSTRETCH,"\u2b07":zs.RELSTRETCH,"\u2b08":zs.REL,"\u2b09":zs.REL,"\u2b0a":zs.REL,"\u2b0b":zs.REL,"\u2b0c":zs.WIDEREL,"\u2b0d":zs.RELSTRETCH,"\u2b0e":zs.RELSTRETCH,"\u2b0f":zs.RELSTRETCH,"\u2b10":zs.RELSTRETCH,"\u2b11":zs.RELSTRETCH,"\u2b30":zs.WIDEREL,"\u2b31":zs.WIDEREL,"\u2b32":zs.RELSTRETCH,"\u2b33":zs.WIDEREL,"\u2b34":zs.WIDEREL,"\u2b35":zs.WIDEREL,"\u2b36":zs.WIDEREL,"\u2b37":zs.WIDEREL,"\u2b38":zs.WIDEREL,"\u2b39":zs.WIDEREL,"\u2b3a":zs.WIDEREL,"\u2b3b":zs.WIDEREL,"\u2b3c":zs.WIDEREL,"\u2b3d":zs.WIDEREL,"\u2b3e":zs.WIDEREL,"\u2b3f":zs.RELACCENT,"\u2b40":zs.WIDEREL,"\u2b41":zs.WIDEREL,"\u2b42":zs.WIDEREL,"\u2b43":zs.WIDEREL,"\u2b44":zs.WIDEREL,"\u2b45":zs.WIDEREL,"\u2b46":zs.WIDEREL,"\u2b47":zs.WIDEREL,"\u2b48":zs.WIDEREL,"\u2b49":zs.WIDEREL,"\u2b4a":zs.WIDEREL,"\u2b4b":zs.WIDEREL,"\u2b4c":zs.WIDEREL,"\u2b4d":zs.REL,"\u2b4e":zs.REL,"\u2b4f":zs.REL,"\u2b5a":zs.REL,"\u2b5b":zs.REL,"\u2b5c":zs.REL,"\u2b5d":zs.REL,"\u2b5e":zs.REL,"\u2b5f":zs.REL,"\u2b60":zs.WIDEREL,"\u2b61":zs.RELSTRETCH,"\u2b62":zs.WIDEREL,"\u2b63":zs.RELSTRETCH,"\u2b64":zs.WIDEREL,"\u2b65":zs.RELSTRETCH,"\u2b66":zs.REL,"\u2b67":zs.REL,"\u2b68":zs.REL,"\u2b69":zs.REL,"\u2b6a":zs.WIDEREL,"\u2b6b":zs.RELSTRETCH,"\u2b6c":zs.WIDEREL,"\u2b6d":zs.RELSTRETCH,"\u2b6e":zs.REL,"\u2b6f":zs.REL,"\u2b70":zs.WIDEREL,"\u2b71":zs.RELSTRETCH,"\u2b72":zs.WIDEREL,"\u2b73":zs.RELSTRETCH,"\u2b76":zs.REL,"\u2b77":zs.REL,"\u2b78":zs.REL,"\u2b79":zs.REL,"\u2b7a":zs.WIDEREL,"\u2b7b":zs.RELSTRETCH,"\u2b7c":zs.WIDEREL,"\u2b7d":zs.RELSTRETCH,"\u2b80":zs.WIDEREL,"\u2b81":zs.RELSTRETCH,"\u2b82":zs.WIDEREL,"\u2b83":zs.RELSTRETCH,"\u2b84":zs.WIDEREL,"\u2b85":zs.RELSTRETCH,"\u2b86":zs.WIDEREL,"\u2b87":zs.RELSTRETCH,"\u2b88":zs.RELACCENT,"\u2b89":zs.REL,"\u2b8a":zs.RELACCENT,"\u2b8b":zs.REL,"\u2b8c":zs.REL,"\u2b8d":zs.REL,"\u2b8e":zs.REL,"\u2b8f":zs.REL,"\u2b94":zs.REL,"\u2b95":zs.WIDEREL,"\u2ba0":zs.RELSTRETCH,"\u2ba1":zs.RELSTRETCH,"\u2ba2":zs.RELSTRETCH,"\u2ba3":zs.RELSTRETCH,"\u2ba4":zs.RELSTRETCH,"\u2ba5":zs.RELSTRETCH,"\u2ba6":zs.RELSTRETCH,"\u2ba7":zs.RELSTRETCH,"\u2ba8":zs.WIDEREL,"\u2ba9":zs.WIDEREL,"\u2baa":zs.WIDEREL,"\u2bab":zs.WIDEREL,"\u2bac":zs.RELSTRETCH,"\u2bad":zs.RELSTRETCH,"\u2bae":zs.RELSTRETCH,"\u2baf":zs.RELSTRETCH,"\u2bb0":zs.REL,"\u2bb1":zs.REL,"\u2bb2":zs.REL,"\u2bb3":zs.REL,"\u2bb4":zs.REL,"\u2bb5":zs.REL,"\u2bb6":zs.REL,"\u2bb7":zs.REL,"\u2bb8":zs.RELSTRETCH,"\u2bd1":zs.REL,\u3adc:zs.BIN3,"\ufe37":zs.WIDEACCENT,"\ufe38":zs.WIDEACCENT}};function Ys(t,e){return t.length!==e.length?e.length-t.length:t===e?0:t<e?-1:1}function Qs(t){return t.replace(/([\^$(){}.+*?\-|[\]:\\])/g,"\\$1")}function Zs(t){return Array.from(t).map((t=>t.codePointAt(0)))}function tr(t){return String.fromCodePoint(...t)}function er(t){return!!t.match(/%\s*$/)}function ir(t){return t.trim().split(/\s+/)}function sr(t){return t.replace(/\\U(?:([0-9A-Fa-f]{4})|\{\s*([0-9A-Fa-f]{1,6})\s*\})|\\./g,((t,e,i)=>"\\\\"===t?"\\":String.fromCodePoint(parseInt(e||i,16))))}function rr(t){return`&#x${t.codePointAt(0).toString(16).toUpperCase()};`}class nr extends Ps{constructor(){super(...arguments),this._texClass=null,this.lspace=5/18,this.rspace=5/18}get texClass(){return null===this._texClass?this.getOperatorDef(this.getText())[2]:this._texClass}set texClass(t){this._texClass=t}get kind(){return"mo"}get isEmbellished(){return!0}coreParent(){let t=null,e=this;const i=this.factory.getNodeClass("math");for(;e&&e.isEmbellished&&e.coreMO()===this&&!(e instanceof i);)t=e,e=e.parent;return t||this}coreText(t){if(!t)return"";if(t.isEmbellished)return t.coreMO().getText();for(;((t.isKind("mrow")||t.isKind("TeXAtom")||t.isKind("mstyle")||t.isKind("mphantom"))&&1===t.childNodes.length||t.isKind("munderover"))&&t.childNodes[0];)t=t.childNodes[0];return t.isToken?t.getText():""}hasSpacingAttributes(){return this.attributes.isSet("lspace")||this.attributes.isSet("rspace")}get isAccent(){let t=!1;const e=this.coreParent().parent;if(e){const i=e.isKind("mover")?e.childNodes[e.over].coreMO()?"accent":"":e.isKind("munder")?e.childNodes[e.under].coreMO()?"accentunder":"":e.isKind("munderover")?this===e.childNodes[e.over].coreMO()?"accent":this===e.childNodes[e.under].coreMO()?"accentunder":"":"";if(i){t=void 0!==e.attributes.getExplicit(i)?t:this.attributes.get("accent")}}return t}setTeXclass(t){const{form:e,fence:i}=this.attributes.getList("form","fence");return void 0===this.getProperty("texClass")&&this.hasSpacingAttributes()?null:(i&&this.texClass===Is.REL&&("prefix"===e&&(this.texClass=Is.OPEN),"postfix"===e&&(this.texClass=Is.CLOSE)),this.adjustTeXclass(t))}adjustTeXclass(t){const e=this.texClass;let i=this.prevClass;if(e===Is.NONE)return t;if(t?(!t.getProperty("autoOP")||e!==Is.BIN&&e!==Is.REL||(i=t.texClass=Is.ORD),i=this.prevClass=t.texClass||Is.ORD,this.prevLevel=this.attributes.getInherited("scriptlevel")):i=this.prevClass=Is.NONE,e!==Is.BIN||i!==Is.NONE&&i!==Is.BIN&&i!==Is.OP&&i!==Is.REL&&i!==Is.OPEN&&i!==Is.PUNCT)if(i!==Is.BIN||e!==Is.REL&&e!==Is.CLOSE&&e!==Is.PUNCT){if(e===Is.BIN){let t=null,e=this.parent;for(;e&&e.parent&&e.isEmbellished&&(1===e.childNodes.length||!e.isKind("mrow")&&e.core()===t);)t=e,e=e.parent;t=t||this,e.childNodes[e.childNodes.length-1]===t&&(this.texClass=Is.ORD)}}else t.texClass=this.prevClass=Is.ORD;else this.texClass=Is.ORD;return this}setInheritedAttributes(t={},e=!1,i=0,s=!1){super.setInheritedAttributes(t,e,i,s);const r=this.getText();this.checkOperatorTable(r),this.checkPseudoScripts(r),this.checkPrimes(r),this.checkMathAccent(r)}getOperatorDef(t){const[e,i,s]=this.handleExplicitForm(this.getForms());this.attributes.setInherited("form",e);const r=this.constructor,n=r.OPTABLE,o=n[e][t]||n[i][t]||n[s][t];if(o)return o;this.setProperty("noDictDef",!0);const a=this.attributes.get("movablelimits");if((!!t.match(r.opPattern)||a)&&void 0===this.getProperty("texClass"))return Xs(1,2,Is.OP);const l=Js(t),[c,h]=r.MMLSPACING[l[2]];return Xs(c,h,l[2])}checkOperatorTable(t){const e=this.getOperatorDef(t);void 0===this.getProperty("texClass")&&(this.texClass=e[2]);for(const t of Object.keys(e[3]||{}))this.attributes.setInherited(t,e[3][t]);this.lspace=e[0]/18,this.rspace=e[1]/18}getForms(){let t=null,e=this.parent,i=this.Parent;for(;i&&i.isEmbellished;)t=e,e=i.parent,i=i.Parent;if(t=t||this,e&&e.isKind("mrow")&&1!==e.nonSpaceLength()){if(e.firstNonSpace()===t)return["prefix","infix","postfix"];if(e.lastNonSpace()===t)return["postfix","infix","prefix"]}return["infix","prefix","postfix"]}handleExplicitForm(t){if(this.attributes.isSet("form")){const e=this.attributes.get("form");t=[e].concat(t.filter((t=>t!==e)))}return t}checkPseudoScripts(t){const e=this.constructor.pseudoScripts;if(!t.match(e))return;const i=this.coreParent().Parent,s=!i||!(i.isKind("msubsup")&&!i.isKind("msub"));this.setProperty("pseudoscript",s),s&&(this.attributes.setInherited("lspace",0),this.attributes.setInherited("rspace",0))}checkPrimes(t){const e=this.constructor.primes;if(!t.match(e))return;const i=this.constructor.remapPrimes,s=tr(Zs(t).map((t=>i[t])));this.setProperty("primes",s)}checkMathAccent(t){const e=this.Parent;if(void 0!==this.getProperty("mathaccent")||!e||!e.isKind("munderover"))return;const[i,s,r]=e.childNodes;if(i.isEmbellished&&i.coreMO()===this)return;const n=!(!s||!s.isEmbellished||s.coreMO()!==this),o=!(!r||!r.isEmbellished||s.coreMO()!==this);(n||o)&&(this.isMathAccent(t)?this.setProperty("mathaccent",!0):this.isMathAccentWithWidth(t)&&this.setProperty("mathaccent",!1))}isMathAccent(t=this.getText()){const e=this.constructor.mathaccents;return!!t.match(e)}isMathAccentWithWidth(t=this.getText()){const e=this.constructor.mathaccentsWithWidth;return!!t.match(e)}}nr.defaults=Object.assign(Object.assign({},Ps.defaults),{form:"infix",fence:!1,separator:!1,lspace:"thickmathspace",rspace:"thickmathspace",stretchy:!1,symmetric:!1,maxsize:"infinity",minsize:"0em",largeop:!1,movablelimits:!1,accent:!1,linebreak:"auto",lineleading:"100%",linebreakstyle:"before",indentalign:"auto",indentshift:"0",indenttarget:"",indentalignfirst:"indentalign",indentshiftfirst:"indentshift",indentalignlast:"indentalign",indentshiftlast:"indentshift"}),nr.MMLSPACING=Ks,nr.OPTABLE=$s,nr.pseudoScripts=new RegExp(["^[\"'*`","\xaa","\xb0","\xb2-\xb4","\xb9","\xba","\u2018-\u201f","\u2032-\u2037\u2057","\u2070\u2071","\u2074-\u207f","\u2080-\u208e","]+$"].join("")),nr.primes=new RegExp(["^[\"'","\u2018-\u201f","]+$"].join("")),nr.opPattern=/^[a-zA-Z]{2,}$/,nr.remapPrimes={34:8243,39:8242,8216:8245,8217:8242,8218:8242,8219:8245,8220:8246,8221:8243,8222:8243,8223:8246},nr.mathaccents=new RegExp(["^[","\xb4\u0301\u02ca","`\u0300\u02cb","\xa8\u0308","~\u0303\u02dc","\xaf\u0304\u02c9","\u02d8\u0306","\u02c7\u030c","^\u0302\u02c6","\u20d0\u20d1","\u20d6\u20d7\u20e1","\u02d9\u0307","\u02da\u030a","\u20db","\u20dc","]$"].join("")),nr.mathaccentsWithWidth=new RegExp(["^[","\u2190\u2192\u2194","\u23dc\u23dd","\u23de\u23df","]$"].join(""));class or extends Ps{constructor(){super(...arguments),this.texclass=Is.ORD}get kind(){return"mtext"}get isSpacelike(){return!!this.getText().match(/^\s*$/)&&!this.attributes.hasOneOf(or.NONSPACELIKE)}}or.NONSPACELIKE=["style","mathbackground","background"],or.defaults=Object.assign({},Ps.defaults);class ar extends Ps{constructor(){super(...arguments),this.texclass=Is.NONE}setTeXclass(t){return t}get kind(){return"mspace"}get arity(){return 0}get isSpacelike(){return!this.attributes.hasExplicit("linebreak")&&this.canBreak}get hasNewline(){const t=this.attributes.get("linebreak");return this.canBreak&&("newline"===t||"indentingnewline"===t)}get canBreak(){return!this.attributes.hasOneOf(ar.NONSPACELIKE)&&"-"!==String(this.attributes.get("width")).trim().charAt(0)}}ar.NONSPACELIKE=["height","depth","style","mathbackground","background"],ar.defaults=Object.assign(Object.assign({},Ps.defaults),{width:"0em",height:"0ex",depth:"0ex",linebreak:"auto",indentshift:"auto",indentalign:"auto",indenttarget:"",indentalignfirst:"indentalign",indentshiftfirst:"indentshift",indentalignlast:"indentalign",indentshiftlast:"indentshift"});class lr extends Ps{constructor(){super(...arguments),this.texclass=Is.ORD}get kind(){return"ms"}}lr.defaults=Object.assign(Object.assign({},Ps.defaults),{lquote:'"',rquote:'"'});class cr extends Ds{constructor(){super(...arguments),this._core=null}get kind(){return"mrow"}get isSpacelike(){for(const t of this.childNodes)if(!t.isSpacelike)return!1;return!0}get isEmbellished(){let t=!1,e=0;for(const i of this.childNodes){if(i)if(i.isEmbellished){if(t)return!1;t=!0,this._core=e}else if(!i.isSpacelike)return!1;e++}return t}core(){return this.isEmbellished&&null!=this._core?this.childNodes[this._core]:this}coreMO(){return this.isEmbellished&&null!=this._core?this.childNodes[this._core].coreMO():this}nonSpaceLength(){let t=0;for(const e of this.childNodes)e&&!e.isSpacelike&&t++;return t}firstNonSpace(){for(const t of this.childNodes)if(t&&!t.isSpacelike)return t;return null}lastNonSpace(){let t=this.childNodes.length;for(;--t>=0;){const e=this.childNodes[t];if(e&&!e.isSpacelike)return e}return null}setTeXclass(t){if(null!=this.getProperty("open")||null!=this.getProperty("close")){this.getPrevClass(t),t=null;for(const e of this.childNodes)t=e.setTeXclass(t);return null==this.texClass&&(this.texClass=Is.INNER),this}for(const e of this.childNodes)t=e.setTeXclass(t);return this.childNodes[0]&&this.updateTeXclass(this.childNodes[0]),t}}cr.defaults=Object.assign({},Ds.defaults);class hr extends cr{get kind(){return"inferredMrow"}get isInferred(){return!0}get notParent(){return!0}toString(){return"["+this.childNodes.join(",")+"]"}}hr.defaults=cr.defaults;class dr extends js{get kind(){return"mfrac"}get arity(){return 2}get linebreakContainer(){return!0}get linebreakAlign(){return""}setTeXclass(t){this.getPrevClass(t);for(const t of this.childNodes)t.setTeXclass(null);return this}setChildInheritedAttributes(t,e,i,s){(!e||i>0)&&i++;const r=this.attributes.get("numalign"),n=this.attributes.get("denomalign"),o=this.addInheritedAttributes(Object.assign({},t),{numalign:r,indentshift:"0",indentalignfirst:r,indentshiftfirst:"0",indentalignlast:"indentalign",indentshiftlast:"indentshift"}),a=this.addInheritedAttributes(Object.assign({},t),{denalign:n,indentshift:"0",indentalignfirst:n,indentshiftfirst:"0",indentalignlast:"indentalign",indentshiftlast:"indentshift"});this.childNodes[0].setInheritedAttributes(o,!1,i,s),this.childNodes[1].setInheritedAttributes(a,!1,i,!0)}}dr.defaults=Object.assign(Object.assign({},js.defaults),{linethickness:"medium",numalign:"center",denomalign:"center",bevelled:!1});class ur extends Ds{constructor(){super(...arguments),this.texclass=Is.ORD}get kind(){return"msqrt"}get arity(){return-1}get linebreakContainer(){return!0}setTeXclass(t){return this.getPrevClass(t),this.childNodes[0].setTeXclass(null),this}setChildInheritedAttributes(t,e,i,s){this.childNodes[0].setInheritedAttributes(t,e,i,!0)}}ur.defaults=Object.assign(Object.assign({},Ds.defaults),{"data-vertical-align":"bottom"});class pr extends Ds{constructor(){super(...arguments),this.texclass=Is.ORD}get kind(){return"mroot"}get arity(){return 2}get linebreakContainer(){return!0}setTeXclass(t){return this.getPrevClass(t),this.childNodes[0].setTeXclass(null),this.childNodes[1].setTeXclass(null),this}setChildInheritedAttributes(t,e,i,s){this.childNodes[0].setInheritedAttributes(t,e,i,!0),this.childNodes[1].setInheritedAttributes(t,!1,i+2,s)}}pr.defaults=Object.assign(Object.assign({},Ds.defaults),{"data-vertical-align":"bottom"});class mr extends Bs{get kind(){return"mstyle"}get notParent(){return this.childNodes[0]&&1===this.childNodes[0].childNodes.length}setInheritedAttributes(t={},e=!1,i=0,s=!1){this.attributes.setInherited("displaystyle",e),this.attributes.setInherited("scriptlevel",i),super.setInheritedAttributes(t,e,i,s)}setChildInheritedAttributes(t,e,i,s){let r=this.attributes.getExplicit("scriptlevel");null!=r&&(r=r.toString(),r.match(/^\s*[-+]/)?i+=parseInt(r):i=parseInt(r),s=!1);const n=this.attributes.getExplicit("displaystyle");null!=n&&(e=!0===n,s=!1);const o=this.attributes.getExplicit("data-cramped");null!=o&&(s=o),t=this.addInheritedAttributes(t,this.attributes.getAllAttributes()),this.childNodes[0].setInheritedAttributes(t,e,i,s)}}mr.defaults=Object.assign(Object.assign({},Bs.defaults),{scriptlevel:Ls,displaystyle:Ls,scriptsizemultiplier:1/Math.sqrt(2),scriptminsize:".4em",mathbackground:Ls,mathcolor:Ls,dir:Ls,infixlinebreakstyle:"before"});class fr extends Ds{constructor(){super(...arguments),this.texclass=Is.ORD}get kind(){return"merror"}get arity(){return-1}get linebreakContainer(){return!0}}fr.defaults=Object.assign({},Ds.defaults);class gr extends Bs{get kind(){return"mpadded"}get linebreakContainer(){return!0}setTeXclass(t){return this.getProperty("vbox")?(this.getPrevClass(t),this.texClass=Is.ORD,this.childNodes[0].setTeXclass(null),this):super.setTeXclass(t)}}gr.defaults=Object.assign(Object.assign({},Bs.defaults),{width:"",height:"",depth:"",lspace:0,voffset:0});class br extends Bs{constructor(){super(...arguments),this.texclass=Is.ORD}get kind(){return"mphantom"}}br.defaults=Object.assign({},Bs.defaults);class Er extends Ds{constructor(){super(...arguments),this.texclass=Is.INNER,this.separators=[],this.open=null,this.close=null}get kind(){return"mfenced"}setTeXclass(t){this.getPrevClass(t),this.open&&(t=this.open.setTeXclass(t)),this.childNodes[0]&&(t=this.childNodes[0].setTeXclass(t));for(let e=1,i=this.childNodes.length;e<i;e++)this.separators[e-1]&&(t=this.separators[e-1].setTeXclass(t)),this.childNodes[e]&&(t=this.childNodes[e].setTeXclass(t));return this.close&&(t=this.close.setTeXclass(t)),this.updateTeXclass(this.open),t}setChildInheritedAttributes(t,e,i,s){this.addFakeNodes();for(const r of[this.open,this.close].concat(this.separators))r&&r.setInheritedAttributes(t,e,i,s);super.setChildInheritedAttributes(t,e,i,s)}addFakeNodes(){let{open:t,close:e,separators:i}=this.attributes.getList("open","close","separators");if(t=t.replace(/[ \t\n\r]/g,""),e=e.replace(/[ \t\n\r]/g,""),i=i.replace(/[ \t\n\r]/g,""),t&&(this.open=this.fakeNode(t,{fence:!0,form:"prefix"},Is.OPEN)),i){for(;i.length<this.childNodes.length-1;)i+=i.charAt(i.length-1);let t=0;for(const e of this.childNodes.slice(1))e&&this.separators.push(this.fakeNode(i.charAt(t++)))}e&&(this.close=this.fakeNode(e,{fence:!0,form:"postfix"},Is.CLOSE))}fakeNode(t,e={},i=null){const s=this.factory.create("text").setText(t),r=this.factory.create("mo",e,[s]);return r.texClass=i,r.parent=this,r}}Er.defaults=Object.assign(Object.assign({},Ds.defaults),{open:"(",close:")",separators:","});class xr extends Ds{constructor(){super(...arguments),this.texclass=Is.ORD}get kind(){return"menclose"}get arity(){return-1}get linebreakContainer(){return!0}setTeXclass(t){return t=this.childNodes[0].setTeXclass(t),this.updateTeXclass(this.childNodes[0]),t}}xr.defaults=Object.assign(Object.assign({},Ds.defaults),{notation:"longdiv"});class yr extends Ds{get kind(){return"maction"}get arity(){return 1}get selected(){const t=this.attributes.get("selection"),e=Math.max(1,Math.min(this.childNodes.length,t))-1;return this.childNodes[e]||this.factory.create("mrow")}get isEmbellished(){return this.selected.isEmbellished}get isSpacelike(){return this.selected.isSpacelike}core(){return this.selected.core()}coreMO(){return this.selected.coreMO()}verifyAttributes(t){super.verifyAttributes(t),"toggle"!==this.attributes.get("actiontype")&&this.attributes.hasExplicit("selection")&&this.attributes.unset("selection")}setTeXclass(t){"tooltip"===this.attributes.get("actiontype")&&this.childNodes[1]&&this.childNodes[1].setTeXclass(null);const e=this.selected;return t=e.setTeXclass(t),this.updateTeXclass(e),t}nextToggleSelection(){let t=Math.max(1,parseInt(this.attributes.get("selection"))+1);t>this.childNodes.length&&(t=1),this.attributes.set("selection",t)}setChildInheritedAttributes(t,e,i,s){var r,n;"tooltip"===this.attributes.get("actiontype").toLowerCase()?(null===(r=this.childNodes[0])||void 0===r||r.setInheritedAttributes(t,e,i,s),null===(n=this.childNodes[1])||void 0===n||n.setInheritedAttributes(t,!1,1,!1)):super.setChildInheritedAttributes(t,e,i,s)}}yr.defaults=Object.assign(Object.assign({},Ds.defaults),{actiontype:"toggle",selection:1});class Nr extends js{get kind(){return"msubsup"}get arity(){return 3}get base(){return 0}get sub(){return 1}get sup(){return 2}setChildInheritedAttributes(t,e,i,s){const r=this.childNodes;r[0].setInheritedAttributes(t,e,i,s),r[1].setInheritedAttributes(t,!1,i+1,s||1===this.sub),r[2]&&r[2].setInheritedAttributes(t,!1,i+1,s||2===this.sub)}}Nr.defaults=Object.assign(Object.assign({},js.defaults),{subscriptshift:"",superscriptshift:""});class vr extends Nr{get kind(){return"msub"}get arity(){return 2}}vr.defaults=Object.assign({},Nr.defaults);class Tr extends Nr{get kind(){return"msup"}get arity(){return 2}get sup(){return 1}get sub(){return 2}}Tr.defaults=Object.assign({},Nr.defaults);class _r extends js{get kind(){return"munderover"}get arity(){return 3}get base(){return 0}get under(){return 1}get over(){return 2}get linebreakContainer(){return!0}setChildInheritedAttributes(t,e,i,s){const r=this.childNodes;r[0].setInheritedAttributes(t,e,i,s||!!r[this.over]);const n=!(e||!r[0].coreMO().attributes.get("movablelimits")),o=this.constructor.ACCENTS;r[1].setInheritedAttributes(t,!1,this.getScriptlevel(o[1],n,i),s||1===this.under),this.setInheritedAccent(1,o[1],e,i,s,n),r[2]&&(r[2].setInheritedAttributes(t,!1,this.getScriptlevel(o[2],n,i),s||2===this.under),this.setInheritedAccent(2,o[2],e,i,s,n))}getScriptlevel(t,e,i){return!e&&this.attributes.get(t)||i++,i}setInheritedAccent(t,e,i,s,r,n){const o=this.childNodes[t];if(!this.attributes.hasExplicit(e)&&o.isEmbellished){const t=o.coreMO().attributes.get("accent");this.attributes.setInherited(e,t),t!==this.attributes.getDefault(e)&&o.setInheritedAttributes({},i,this.getScriptlevel(e,n,s),r)}}}_r.defaults=Object.assign(Object.assign({},js.defaults),{accent:!1,accentunder:!1,align:"center"}),_r.ACCENTS=["","accentunder","accent"];class Lr extends _r{get kind(){return"munder"}get arity(){return 2}}Lr.defaults=Object.assign({},_r.defaults);class Cr extends _r{get kind(){return"mover"}get arity(){return 2}get over(){return 1}get under(){return 2}}Cr.defaults=Object.assign({},_r.defaults),Cr.ACCENTS=["","accent","accentunder"];class Rr extends Nr{get kind(){return"mmultiscripts"}get arity(){return 1}setChildInheritedAttributes(t,e,i,s){this.childNodes[0].setInheritedAttributes(t,e,i,s);let r=!1;for(let e=1,n=0;e<this.childNodes.length;e++){const o=this.childNodes[e];if(o.isKind("mprescripts")){if(!r&&(r=!0,e%2==0)){const t=this.factory.create("none");this.childNodes.splice(e,0,t),t.parent=this,e++}}else{const e=s||n%2==0;o.setInheritedAttributes(t,!1,i+1,e),n++}}this.childNodes.length%2==(r?1:0)&&(this.appendChild(this.factory.create("none")),this.childNodes[this.childNodes.length-1].setInheritedAttributes(t,!1,i+1,s))}verifyChildren(t){let e=!1;const i=t.fixMmultiscripts;for(let s=0;s<this.childNodes.length;s++){const r=this.childNodes[s];r.isKind("mprescripts")&&(e?r.mError(r.kind+" can only appear once in "+this.kind,t,!0):(e=!0,s%2!=0||i||this.mError("There must be an equal number of prescripts of each type",t)))}this.childNodes.length%2!=(e?1:0)||i||this.mError("There must be an equal number of scripts of each type",t),super.verifyChildren(t)}}Rr.defaults=Object.assign({},Nr.defaults);class wr extends Ds{get kind(){return"mprescripts"}get arity(){return 0}verifyTree(t){super.verifyTree(t),this.parent&&!this.parent.isKind("mmultiscripts")&&this.mError(this.kind+" must be a child of mmultiscripts",t,!0)}}wr.defaults=Object.assign({},Ds.defaults);class Ir extends Ds{get kind(){return"none"}get arity(){return 0}verifyTree(t){super.verifyTree(t),this.parent&&!this.parent.isKind("mmultiscripts")&&this.mError(this.kind+" must be a child of mmultiscripts",t,!0)}}Ir.defaults=Object.assign({},Ds.defaults);class Sr extends Ds{constructor(){super(...arguments),this.properties={useHeight:!0},this.texclass=Is.ORD}get kind(){return"mtable"}get linebreakContainer(){return!0}get linebreakAlign(){return""}setInheritedAttributes(t,e,i,s){for(const e of ks)t[e]&&this.attributes.setInherited(e,t[e][1]),this.attributes.hasExplicit(e)&&this.attributes.unset(e);super.setInheritedAttributes(t,e,i,s)}setChildInheritedAttributes(t,e,i,s){for(const t of this.childNodes)t.isKind("mtr")||this.replaceChild(this.factory.create("mtr"),t).appendChild(t);e=!(!this.attributes.getExplicit("displaystyle")&&!this.attributes.getDefault("displaystyle")),t=this.addInheritedAttributes(t,{columnalign:this.attributes.get("columnalign"),rowalign:"center","data-break-align":this.attributes.get("data-break-align")});const r=this.attributes.getExplicit("data-cramped"),n=ir(this.attributes.get("rowalign"));for(const s of this.childNodes)t.rowalign[1]=n.shift()||t.rowalign[1],s.setInheritedAttributes(t,e,i,!!r)}verifyChildren(t){let e=null;const i=this.factory;for(let s=0;s<this.childNodes.length;s++){const r=this.childNodes[s];if(r.isKind("mtr"))e=null;else{const n=r.isKind("mtd");if(e?(this.removeChild(r),s--):e=this.replaceChild(i.create("mtr"),r),e.appendChild(n?r:i.create("mtd",{},[r])),!t.fixMtables){r.parent.removeChild(r),r.parent=this,n&&e.appendChild(i.create("mtd"));const s=r.mError("Children of "+this.kind+" must be mtr or mlabeledtr",t,n);e.childNodes[e.childNodes.length-1].appendChild(s)}}}super.verifyChildren(t)}setTeXclass(t){this.getPrevClass(t);for(const t of this.childNodes)t.setTeXclass(null);return this}}Sr.defaults=Object.assign(Object.assign({},Ds.defaults),{align:"axis",rowalign:"baseline",columnalign:"center",groupalign:"{left}",alignmentscope:!0,columnwidth:"auto",width:"auto",rowspacing:"1ex",columnspacing:".8em",rowlines:"none",columnlines:"none",frame:"none",framespacing:"0.4em 0.5ex",equalrows:!1,equalcolumns:!1,displaystyle:!1,side:"right",minlabelspacing:"0.8em","data-break-align":"top"});class Ar extends Ds{get kind(){return"mtr"}get linebreakContainer(){return!0}get linebreakAlign(){return""}setChildInheritedAttributes(t,e,i,s){for(const t of this.childNodes)t.isKind("mtd")||this.replaceChild(this.factory.create("mtd"),t).appendChild(t);const r=ir(this.attributes.get("columnalign")),n=ir(this.attributes.get("data-break-align"));1===this.arity&&(r.unshift(this.parent.attributes.get("side")),n.unshift("top")),t=this.addInheritedAttributes(t,{rowalign:this.attributes.get("rowalign"),columnalign:"center","data-break-align":"top"});for(const o of this.childNodes)t.columnalign[1]=r.shift()||t.columnalign[1],t["data-vertical-align"]=[this.kind,n.shift()||t["data-break-align"][1]],o.setInheritedAttributes(t,e,i,s)}verifyChildren(t){if(!this.parent||this.parent.isKind("mtable")){for(const e of this.childNodes)if(!e.isKind("mtd")){this.replaceChild(this.factory.create("mtd"),e).appendChild(e),t.fixMtables||e.mError("Children of "+this.kind+" must be mtd",t)}super.verifyChildren(t)}else this.mError(this.kind+" can only be a child of an mtable",t,!0)}setTeXclass(t){this.getPrevClass(t);for(const t of this.childNodes)t.setTeXclass(null);return this}}Ar.defaults=Object.assign(Object.assign({},Ds.defaults),{rowalign:Ls,columnalign:Ls,groupalign:Ls,"data-break-align":"top"});class Or extends Ar{get kind(){return"mlabeledtr"}get arity(){return 1}}class Mr extends js{get kind(){return"mtd"}get arity(){return-1}get linebreakContainer(){return!0}get linebreakAlign(){return"columnalign"}verifyChildren(t){!this.parent||this.parent.isKind("mtr")?super.verifyChildren(t):this.mError(this.kind+" can only be a child of an mtr or mlabeledtr",t,!0)}setTeXclass(t){return this.getPrevClass(t),this.childNodes[0].setTeXclass(null),this}}Mr.defaults=Object.assign(Object.assign({},js.defaults),{rowspan:1,columnspan:1,rowalign:Ls,columnalign:Ls,groupalign:Ls,"data-vertical-align":"top"});class kr extends Bs{get kind(){return"maligngroup"}get isSpacelike(){return!0}setChildInheritedAttributes(t,e,i,s){t=this.addInheritedAttributes(t,this.attributes.getAllAttributes()),super.setChildInheritedAttributes(t,e,i,s)}}kr.defaults=Object.assign(Object.assign({},Bs.defaults),{groupalign:Ls});class Dr extends Ds{get kind(){return"malignmark"}get arity(){return 0}get isSpacelike(){return!0}}Dr.defaults=Object.assign(Object.assign({},Ds.defaults),{edge:"left"});class Pr extends Ps{constructor(){super(...arguments),this.texclass=Is.ORD}get kind(){return"mglyph"}verifyAttributes(t){const{src:e,fontfamily:i,index:s}=this.attributes.getList("src","fontfamily","index");""!==e||""!==i&&""!==s?super.verifyAttributes(t):this.mError("mglyph must have either src or fontfamily and index attributes",t,!0)}}Pr.defaults=Object.assign(Object.assign({},Ps.defaults),{alt:"",src:"",index:"",width:"auto",height:"auto",valign:"0em"});class Br extends js{get kind(){return"semantics"}get arity(){return 1}get notParent(){return!0}}Br.defaults=Object.assign(Object.assign({},js.defaults),{definitionUrl:null,encoding:null});class jr extends Ds{get kind(){return"annotation-xml"}setChildInheritedAttributes(){}}jr.defaults=Object.assign(Object.assign({},Ds.defaults),{definitionUrl:null,encoding:null,cd:"mathmlkeys",name:"",src:null});class Fr extends jr{constructor(){super(...arguments),this.properties={isChars:!0}}get kind(){return"annotation"}}Fr.defaults=Object.assign({},jr.defaults);class Ur extends js{get kind(){return"TeXAtom"}get arity(){return-1}get notParent(){return!0}constructor(t,e,i){super(t,e,i),this.texclass=Is.ORD,this.setProperty("texClass",this.texClass)}setTeXclass(t){return this.childNodes[0].setTeXclass(null),this.adjustTeXclass(t)}adjustTeXclass(t){return t}}Ur.defaults=Object.assign({},js.defaults),Ur.prototype.adjustTeXclass=nr.prototype.adjustTeXclass;class Hr extends js{get kind(){return"MathChoice"}get arity(){return 4}get notParent(){return!0}setInheritedAttributes(t,e,i,s){const r=e?0:Math.max(0,Math.min(i,2))+1,n=this.childNodes[r]||this.factory.create("mrow");this.parent.replaceChild(n,this),n.setInheritedAttributes(t,e,i,s)}}Hr.defaults=Object.assign({},js.defaults);class qr extends Hs{get kind(){return"html"}getHTML(){return this.getXML()}setHTML(t,e=null){try{e.getAttribute(t,"data-mjx-hdw")}catch(i){t=e.node("span",{},[t])}return this.setXML(t,e)}getSerializedHTML(){return this.adaptor.outerHTML(this.xml)}textContent(){return this.adaptor.textContent(this.xml)}toString(){const t=this.adaptor.kind(this.xml);return`HTML=<${t}>...</${t}>`}verifyTree(t){!this.parent||this.parent.isToken||this.mError("HTML can only be a child of a token element",t,!0)}}const Wr={[qs.prototype.kind]:qs,[Ws.prototype.kind]:Ws,[Vs.prototype.kind]:Vs,[nr.prototype.kind]:nr,[or.prototype.kind]:or,[ar.prototype.kind]:ar,[lr.prototype.kind]:lr,[cr.prototype.kind]:cr,[hr.prototype.kind]:hr,[dr.prototype.kind]:dr,[ur.prototype.kind]:ur,[pr.prototype.kind]:pr,[mr.prototype.kind]:mr,[fr.prototype.kind]:fr,[gr.prototype.kind]:gr,[br.prototype.kind]:br,[Er.prototype.kind]:Er,[xr.prototype.kind]:xr,[yr.prototype.kind]:yr,[vr.prototype.kind]:vr,[Tr.prototype.kind]:Tr,[Nr.prototype.kind]:Nr,[Lr.prototype.kind]:Lr,[Cr.prototype.kind]:Cr,[_r.prototype.kind]:_r,[Rr.prototype.kind]:Rr,[wr.prototype.kind]:wr,[Ir.prototype.kind]:Ir,[Sr.prototype.kind]:Sr,[Or.prototype.kind]:Or,[Ar.prototype.kind]:Ar,[Mr.prototype.kind]:Mr,[kr.prototype.kind]:kr,[Dr.prototype.kind]:Dr,[Pr.prototype.kind]:Pr,[Br.prototype.kind]:Br,[Fr.prototype.kind]:Fr,[jr.prototype.kind]:jr,[Ur.prototype.kind]:Ur,[Hr.prototype.kind]:Hr,[Us.prototype.kind]:Us,[Hs.prototype.kind]:Hs,[qr.prototype.kind]:qr};class Vr extends _s{get MML(){return this.node}}Vr.defaultNodes=Wr;class Xr{constructor(){this.bits=0}static allocate(...t){for(const e of t){if(this.has(e))throw new Error("Bit already allocated for "+e);if(this.next===Xr.MAXBIT)throw new Error("Maximum number of bits already allocated");this.names.set(e,this.next),this.next<<=1}}static has(t){return this.names.has(t)}set(t){this.bits|=this.getBit(t)}clear(t){this.bits&=~this.getBit(t)}isSet(t){return!!(this.bits&this.getBit(t))}reset(){this.bits=0}getBit(t){const e=this.constructor.names.get(t);if(!e)throw new Error("Unknown bit-field name: "+t);return e}}function zr(...t){const e=class extends Xr{};return e.allocate(...t),e}function Gr(t){return new Promise((function e(i,s){const r=t=>{var r;t.retry instanceof Promise?t.retry.then((()=>e(i,s))).catch((t=>s(t))):(null===(r=t.restart)||void 0===r?void 0:r.isCallback)?MathJax.Callback.After((()=>e(i,s)),t.restart):s(t)};try{const e=t();e instanceof Promise?e.then((t=>i(t))).catch((t=>r(t))):i(e)}catch(t){r(t)}}))}function Jr(t){const e=new Error("MathJax retry -- an asynchronous action is required; try using one of the promise-based functions and await its resolution.");throw e.retry=t,e}Xr.MAXBIT=1<<31,Xr.next=1,Xr.names=new Map;var Kr=function(t,e,i,s){return new(i||(i=Promise))((function(r,n){function o(t){try{l(s.next(t))}catch(t){n(t)}}function a(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((s=s.apply(t,e||[])).next())}))};class $r extends Si{static create(t){const e=new this;for(const i of Object.keys(t)){const[s,r]=this.action(i,t[i]);r&&e.add(s,r)}return e}static action(t,e){let i,s,r=!0;const n=e[0];if(1===e.length||"boolean"==typeof e[1])2===e.length&&(r=e[1]),[i,s]=this.methodActions(t);else if("string"==typeof e[1])if("string"==typeof e[2]){4===e.length&&(r=e[3]);const[t,n]=e.slice(1);[i,s]=this.methodActions(t,n)}else 3===e.length&&(r=e[2]),[i,s]=this.methodActions(e[1]);else 4===e.length&&(r=e[3]),[i,s]=e.slice(1);return[{id:t,renderDoc:i,renderMath:s,convert:r},n]}static methodActions(t,e=t){return[e=>(t&&e[t](),!1),(t,i)=>(e&&t[e](i),!1)]}renderDoc(t,e=Ns.UNPROCESSED){for(const i of this.items)if(i.priority>=e&&i.item.renderDoc(t))return}renderMath(t,e,i=Ns.UNPROCESSED){for(const s of this.items)if(s.priority>=i&&s.item.renderMath(t,e))return}renderConvert(t,e,i=Ns.LAST){for(const s of this.items){if(s.priority>i)return;if(s.item.convert&&s.item.renderMath(t,e))return}}findID(t){for(const e of this.items)if(e.item.id===t)return e.item;return null}}const Yr={all:!1,processed:!1,inputJax:null,outputJax:null},Qr={all:!0,processed:!0,inputJax:[],outputJax:[]};class Zr extends ps{compile(t){return null}}class tn extends ms{typeset(t,e=null){return null}escaped(t,e){return null}}class en extends Es{}class sn{constructor(t,e,i){const s=this.constructor;this.document=t,this.options=Yi($i({},s.OPTIONS),i),this.math=new(this.options.MathList||en),this.renderActions=$r.create(this.options.renderActions),this._actionPromises=[],this._readyPromise=Promise.resolve(),this.processed=new sn.ProcessBits,this.outputJax=this.options.OutputJax||new tn;let r=this.options.InputJax||[new Zr];Array.isArray(r)||(r=[r]),this.inputJax=r,this.adaptor=e,this.outputJax.setAdaptor(e),this.inputJax.map((t=>t.setAdaptor(e))),this.mmlFactory=this.options.MmlFactory||new Vr,this.inputJax.map((t=>t.setMmlFactory(this.mmlFactory))),this.outputJax.initialize(),this.inputJax.map((t=>t.initialize()))}get kind(){return this.constructor.KIND}addRenderAction(t,...e){const[i,s]=$r.action(t,e);this.renderActions.add(i,s)}removeRenderAction(t){const e=this.renderActions.findID(t);e&&this.renderActions.remove(e)}render(){return this.clearPromises(),this.renderActions.renderDoc(this),this}renderPromise(){return this.whenReady((()=>Gr((()=>Kr(this,void 0,void 0,(function*(){return this.render(),yield this.actionPromises(),this.clearPromises(),this}))))))}rerender(t=Ns.RERENDER){return this.state(t-1),this.render(),this}rerenderPromise(t=Ns.RERENDER){return this.whenReady((()=>Gr((()=>Kr(this,void 0,void 0,(function*(){return this.rerender(t),yield this.actionPromises(),this.clearPromises(),this}))))))}convert(t,e={}){let{format:i,display:s,end:r,ex:n,em:o,containerWidth:a,scale:l,family:c}=Yi({format:this.inputJax[0].name,display:!0,end:Ns.LAST,em:16,ex:8,containerWidth:null,scale:1,family:""},e);null===a&&(a=80*n);const h=this.inputJax.reduce(((t,e)=>e.name===i?e:t),null),d=new this.options.MathItem(t,h,s);return d.start.node=this.adaptor.body(this.document),d.setMetrics(o,n,a,l),c&&this.outputJax.options.mtextInheritFont&&(d.outputData.mtextFamily=c),c&&this.outputJax.options.merrorInheritFont&&(d.outputData.merrorFamily=c),this.clearPromises(),d.convert(this,r),d.typesetRoot||d.root}convertPromise(t,e={}){return this.whenReady((()=>Gr((()=>Kr(this,void 0,void 0,(function*(){const i=this.convert(t,e);return yield this.actionPromises(),this.clearPromises(),i}))))))}whenReady(t){return this._readyPromise=this._readyPromise.catch((t=>{})).then((()=>{const e=this._readyPromise;this._readyPromise=Promise.resolve();const i=t(),s=this._readyPromise.then((()=>i));return this._readyPromise=e,s}))}actionPromises(){return Promise.all(this._actionPromises)}clearPromises(){this._actionPromises=[]}savePromise(t){this._actionPromises.push(t)}findMath(t=null){return this.processed.set("findMath"),this}compile(){if(!this.processed.isSet("compile")){const t=[];for(const e of this.math)this.compileMath(e),void 0!==e.inputData.recompile&&t.push(e);for(const e of t){const t=e.inputData.recompile;e.state(t.state),e.inputData.recompile=t,this.compileMath(e)}this.processed.set("compile")}return this}compileMath(t){try{t.compile(this)}catch(e){if(e.retry||e.restart)throw e;this.options.compileError(this,t,e),t.inputData.error=e}}compileError(t,e){t.root=this.mmlFactory.create("math",null,[this.mmlFactory.create("merror",{"data-mjx-error":e.message,title:e.message},[this.mmlFactory.create("mtext",null,[this.mmlFactory.create("text").setText("Math input error")])])]),t.display&&t.root.attributes.set("display","block"),t.inputData.error=e.message}typeset(){if(!this.processed.isSet("typeset")){for(const t of this.math)try{t.typeset(this)}catch(e){if(e.retry||e.restart)throw e;this.options.typesetError(this,t,e),t.outputData.error=e}this.processed.set("typeset")}return this}typesetError(t,e){t.typesetRoot=this.adaptor.node("mjx-container",{class:"MathJax mjx-output-error",jax:this.outputJax.name},[this.adaptor.node("span",{"data-mjx-error":e.message,title:e.message,style:{color:"red","background-color":"yellow","line-height":"normal"}},[this.adaptor.text("Math output error")])]),t.display&&this.adaptor.setAttributes(t.typesetRoot,{style:{display:"block",margin:"1em 0","text-align":"center"}}),t.outputData.error=e.message}getMetrics(){return this.processed.isSet("getMetrics")||(this.outputJax.getMetrics(this),this.processed.set("getMetrics")),this}updateDocument(){if(!this.processed.isSet("updateDocument")){for(const t of this.math.reversed())t.updateDocument(this);this.processed.set("updateDocument")}return this}removeFromDocument(t=!1){return this}state(t,e=!1){for(const i of this.math)i.state(t,e);return t<Ns.INSERTED&&this.processed.clear("updateDocument"),t<Ns.TYPESET&&(this.processed.clear("typeset"),this.processed.clear("getMetrics")),t<Ns.COMPILED&&this.processed.clear("compile"),t<Ns.FINDMATH&&this.processed.clear("findMath"),this}reset(t={processed:!0}){return(t=Yi(Object.assign({},Yr),t)).all&&Object.assign(t,Qr),t.processed&&this.processed.reset(),t.inputJax&&this.inputJax.forEach((e=>e.reset(...t.inputJax))),t.outputJax&&this.outputJax.reset(...t.outputJax),this}clear(){return this.reset(),this.math.clear(),this}done(){return Promise.resolve()}concat(t){return this.math.merge(t),this}clearMathItemsWithin(t){const e=this.getMathItemsWithin(t);for(const t of e.slice(0).reverse())t.clear();return this.math.remove(...e),e}getMathItemsWithin(t){Array.isArray(t)||(t=[t]);const e=this.adaptor,i=[],s=e.getElements(t,this.document);t:for(const t of this.math)for(const r of s)if(t.start.node&&e.contains(r,t.start.node)){i.push(t);continue t}return i}}sn.KIND="MathDocument",sn.OPTIONS={OutputJax:null,InputJax:null,MmlFactory:null,MathList:en,MathItem:class extends ys{},compileError:(t,e,i)=>{t.compileError(e,i)},typesetError:(t,e,i)=>{t.typesetError(e,i)},renderActions:Xi({find:[Ns.FINDMATH,"findMath","",!1],compile:[Ns.COMPILED],metrics:[Ns.METRICS,"getMetrics","",!1],typeset:[Ns.TYPESET],update:[Ns.INSERTED,"updateDocument",!1]})},sn.ProcessBits=zr("findMath","compile","getMetrics","typeset","updateDocument");class rn extends sn{}class nn{constructor(t,e=5){this.documentClass=rn,this.adaptor=t,this.priority=e}get name(){return this.constructor.NAME}handlesDocument(t){return!1}create(t,e){return new this.documentClass(t,this.adaptor,e)}}nn.NAME="generic";class on extends Si{register(t){return this.add(t,t.priority)}unregister(t){this.remove(t)}handlesDocument(t){for(const e of this){const i=e.item;if(i.handlesDocument(t))return i}throw new Error("Can't find handler for document")}document(t,e=null){return this.handlesDocument(t).create(t,e)}}class an{static methodName(t){return"visit"+(t.charAt(0).toUpperCase()+t.substring(1)).replace(/[^a-z0-9_]/gi,"_")+"Node"}constructor(t){this.nodeHandlers=new Map;for(const e of t.getKinds()){const t=this[an.methodName(e)];t&&this.nodeHandlers.set(e,t)}}visitTree(t,...e){return this.visitNode(t,...e)}visitNode(t,...e){return(this.nodeHandlers.get(t.kind)||this.visitDefault).call(this,t,...e)}visitDefault(t,...e){if("childNodes"in t)for(const i of t.childNodes)this.visitNode(i,...e)}setNodeHandler(t,e){this.nodeHandlers.set(t,e)}removeNodeHandler(t){this.nodeHandlers.delete(t)}}const ln="data-mjx-";class cn extends an{constructor(t=null){t||(t=new Vr),super(t)}visitTextNode(t,...e){}visitXMLNode(t,...e){}visitHtmlNode(t,...e){}getKind(t){const e=t.kind;return es(e,this.constructor.rename,e)}getAttributeList(t){const e=this.constructor,i=es(t.kind,e.defaultAttributes,{}),s=Object.assign({},i,this.getDataAttributes(t),t.attributes.getAllAttributes()),r=e.variants;return Object.hasOwn(s,"mathvariant")&&(Object.hasOwn(r,s.mathvariant)?s.mathvariant=r[s.mathvariant]:t.getProperty("ignore-variant")&&delete s.mathvariant),s}getDataAttributes(t){const e={},i=t.attributes.getExplicit("mathvariant"),s=this.constructor.variants;i&&(t.getProperty("ignore-variant")||Object.hasOwn(s,i))&&this.setDataAttribute(e,"variant",i),t.getProperty("variantForm")&&this.setDataAttribute(e,"alternate","1"),t.getProperty("pseudoscript")&&this.setDataAttribute(e,"pseudoscript","true"),!1===t.getProperty("autoOP")&&this.setDataAttribute(e,"auto-op","false");const r=t.getProperty("vbox");r&&this.setDataAttribute(e,"vbox",r);const n=t.getProperty("scriptalign");n&&this.setDataAttribute(e,"script-align",n);const o=t.getProperty("mathaccent");void 0!==o&&(o&&!t.isMathAccent()||!o&&!t.isMathAccentWithWidth())&&this.setDataAttribute(e,"mathaccent",o.toString());const a=t.getProperty("texClass");if(void 0!==a){let i=!0;if(a===Is.OP&&t.isKind("mi")){const e=t.getText();i=!(e.length>1&&e.match(Ws.operatorName))}i&&this.setDataAttribute(e,"texclass",a<0?"NONE":Ss[a])}return t.getProperty("smallmatrix")&&this.setDataAttribute(e,"smallmatrix","true"),e}setDataAttribute(t,e,i){t[ln+e]=i}}cn.rename={TeXAtom:"mrow"},cn.variants={"-tex-calligraphic":"script","-tex-bold-calligraphic":"bold-script","-tex-oldstyle":"normal","-tex-bold-oldstyle":"bold","-tex-mathit":"italic"},cn.defaultAttributes={math:{xmlns:"http://www.w3.org/1998/Math/MathML"}};class hn extends cn{constructor(){super(...arguments),this.document=null}visitTree(t,e){this.document=e;const i=e.createElement("top");return this.visitNode(t,i),this.document=null,i.firstChild}visitTextNode(t,e){e.appendChild(this.document.createTextNode(t.getText()))}visitXMLNode(t,e){e.appendChild(t.getXML().cloneNode(!0))}visitHtmlNode(t,e){e.appendChild(t.getHTML().cloneNode(!0))}visitInferredMrowNode(t,e){for(const i of t.childNodes)this.visitNode(i,e)}visitDefault(t,e){const i=this.document.createElement(this.getKind(t));this.addAttributes(t,i);for(const e of t.childNodes)this.visitNode(e,i);e.appendChild(i)}addAttributes(t,e){const i=this.getAttributeList(t);for(const t of Object.keys(i))e.setAttribute(t,i[t].toString())}}class dn extends cn{visitTree(t){return this.visitNode(t,"")}visitTextNode(t,e){return this.quoteHTML(t.getText())}visitXMLNode(t,e){return e+t.getSerializedXML()}visitHtmlNode(t,e){return t.getSerializedHTML()}visitInferredMrowNode(t,e){const i=[];for(const s of t.childNodes)i.push(this.visitNode(s,e));return i.join("\n")}visitAnnotationNode(t,e){const i=this.childNodeMml(t,"","");return`${e}<annotation${this.getAttributes(t)}>${i}</annotation>`}visitDefault(t,e){const i=this.getKind(t),[s,r]=t.isToken||0===t.childNodes.length?["",""]:["\n",e],n=this.childNodeMml(t,e+" ",s),o=n.match(/\S/)?s+n+r:"";return`${e}<${i}${this.getAttributes(t)}>${o}</${i}>`}childNodeMml(t,e,i){let s="";for(const r of t.childNodes)s+=this.visitNode(r,e)+i;return s}getAttributes(t){const e=[],i=this.getAttributeList(t);for(const t of Object.keys(i)){const s=String(i[t]);void 0!==s&&e.push(t+'="'+this.quoteHTML(s)+'"')}return e.length?" "+e.join(" "):""}quoteHTML(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/[\uD800-\uDBFF]./g,this.toEntity).replace(/[\u0080-\uD7FF\uE000-\uFFFF]/g,this.toEntity)}toEntity(t){return rr(t)}}class un{get kind(){return this.node.kind}constructor(t,e){this.factory=t,this.node=e}wrap(t){return this.factory.wrap(t)}walkTree(t,e){if(t(this,e),"childNodes"in this)for(const i of this.childNodes)i&&i.walkTree(t,e);return e}}class pn extends Ts{wrap(t,...e){return this.create(t.kind,t,...e)}}const mn={version:Ei,context:Ri,handlers:new on,document:function(t,e){return mn.handlers.document(t,e)},handleRetriesFor:Gr,retryAfter:Jr,asyncLoad:null,asyncIsSynchronous:!1};class fn extends ys{get adaptor(){return this.inputJax.adaptor}constructor(t,e,i=!0,s={node:null,n:0,delim:""},r={node:null,n:0,delim:""}){super(t,e,i,s,r)}updateDocument(t){if(this.state()<Ns.INSERTED){if(this.inputJax.processStrings){let t=this.start.node;if(t===this.end.node)this.end.n&&this.end.n<this.adaptor.value(this.end.node).length&&this.adaptor.split(this.end.node,this.end.n),this.start.n&&(t=this.adaptor.split(this.start.node,this.start.n)),this.adaptor.parent(t)&&this.adaptor.replace(this.typesetRoot,t);else{for(this.start.n&&(t=this.adaptor.split(t,this.start.n));t!==this.end.node;){const e=this.adaptor.next(t);this.adaptor.remove(t),t=e}this.adaptor.insert(this.typesetRoot,t),this.end.n<this.adaptor.value(t).length&&this.adaptor.split(t,this.end.n),this.adaptor.remove(t)}}else this.adaptor.replace(this.typesetRoot,this.start.node);this.start.node=this.end.node=this.typesetRoot,this.start.n=this.end.n=0,this.state(Ns.INSERTED)}}updateStyleSheet(t){t.addStyleSheet()}removeFromDocument(t=!1){if(super.removeFromDocument(t),this.state()>=Ns.TYPESET){const e=this.adaptor,i=this.start.node;let s=e.text("");if(t){const t=this.start.delim+this.math+this.end.delim;if(this.inputJax.processStrings)s=e.text(t);else{const i=e.parse(t,"text/html");s=e.firstChild(e.body(i))}}e.parent(i)&&e.replace(s,i),this.start.node=this.end.node=s,this.start.n=this.end.n=0}}}class gn extends Es{}class bn{constructor(t=null){const e=this.constructor;this.options=Yi($i({},e.OPTIONS),t),this.init(),this.getPatterns()}init(){this.strings=[],this.string="",this.snodes=[],this.nodes=[],this.stack=[]}getPatterns(){const t=zi(this.options.skipHtmlTags),e=zi(this.options.ignoreHtmlClass),i=zi(this.options.processHtmlClass);this.skipHtmlTags=new RegExp("^(?:"+t.join("|")+")$","i"),this.ignoreHtmlClass=new RegExp("(?:^| )(?:"+e.join("|")+")(?: |$)"),this.processHtmlClass=new RegExp("(?:^| )(?:"+i+")(?: |$)")}pushString(){this.string.match(/\S/)&&(this.strings.push(this.string),this.nodes.push(this.snodes)),this.string="",this.snodes=[]}extendString(t,e){this.snodes.push([t,e.length]),this.string+=e}handleText(t,e){return e||this.extendString(t,this.adaptor.value(t)),this.adaptor.next(t)}handleTag(t,e){if(!e){const e=this.options.includeHtmlTags[this.adaptor.kind(t)];e instanceof Function?this.extendString(t,e(t,this.adaptor)):this.extendString(t,e)}return this.adaptor.next(t)}handleContainer(t,e){this.pushString();const i=this.adaptor.getAttribute(t,"class")||"",s=this.adaptor.kind(t)||"",r=this.processHtmlClass.exec(i);let n=t;return!this.adaptor.firstChild(t)||this.adaptor.getAttribute(t,"data-MJX")||!r&&this.skipHtmlTags.exec(s)?n=this.adaptor.next(t):(this.adaptor.next(t)&&this.stack.push([this.adaptor.next(t),e]),n=this.adaptor.firstChild(t),e=(e||this.ignoreHtmlClass.exec(i))&&!r),[n,e]}handleOther(t,e){return this.pushString(),this.adaptor.next(t)}find(t){this.init();const e=this.adaptor.next(t);let i=!1;const s=this.options.includeHtmlTags;for(;t&&t!==e;){const e=this.adaptor.kind(t);"#text"===e?t=this.handleText(t,i):Object.hasOwn(s,e)?t=this.handleTag(t,i):e?[t,i]=this.handleContainer(t,i):t=this.handleOther(t,i),!t&&this.stack.length&&(this.pushString(),[t,i]=this.stack.pop())}this.pushString();const r=[this.strings,this.nodes];return this.init(),r}}bn.OPTIONS={skipHtmlTags:["script","noscript","style","textarea","pre","code","math","select","option","mjx-container"],includeHtmlTags:Xi({br:"\n",wbr:"","#comment":""}),ignoreHtmlClass:"mathjax_ignore",processHtmlClass:"mathjax_process"},vs("STYLES",Ns.INSERTED+1);class En extends sn{constructor(t,e,i){const[s,r]=ts(i,bn.OPTIONS);super(t,e,s),this.domStrings=this.options.DomStrings||new bn(r),this.domStrings.adaptor=e,this.styles=[]}findPosition(t,e,i,s){const r=this.adaptor,n=1/(s[t].length||1);let o=t;for(const[a,l]of s[t]){if(e<=l&&"#text"===r.kind(a))return{i:o,node:a,n:Math.max(e,0),delim:i};e-=l,o+=n}return{node:null,n:0,delim:i}}mathItem(t,e,i){const s=t.math,r=this.findPosition(t.n,t.start.n,t.open,i),n=this.findPosition(t.n,t.end.n,t.close,i);return new this.options.MathItem(s,e,t.display,r,n)}findMath(t){if(!this.processed.isSet("findMath")){this.adaptor.document=this.document,t=Yi({elements:this.options.elements||[this.adaptor.body(this.document)]},t);const e=this.adaptor.getElements(t.elements,this.document);for(const t of this.inputJax){const i=t.processStrings?this.findMathFromStrings(t,e):this.findMathFromDOM(t,e);this.math.merge(i)}this.processed.set("findMath")}return this}findMathFromStrings(t,e){const i=[],s=[];for(const t of e){const[e,r]=this.domStrings.find(t);i.push(...e),s.push(...r)}const r=new this.options.MathList;for(const e of t.findMath(i))r.push(this.mathItem(e,t,s));return r}findMathFromDOM(t,e){const i=[];for(const s of e)for(const e of t.findMath(s))i.push(new this.options.MathItem(e.math,t,e.display,e.start,e.end));return new this.options.MathList(...i)}updateDocument(){return this.processed.isSet("updateDocument")||(this.addPageElements(),this.addStyleSheet(),super.updateDocument(),this.processed.set("updateDocument")),this}addPageElements(){const t=this.adaptor,e=t.body(this.document),i=this.documentPageElements();if(i){const s=t.firstChild(e);s?t.insert(i,s):t.append(e,i)}}addStyleSheet(){const t=this.documentStyleSheet(),e=this.adaptor;if(t&&!e.parent(t)){const i=e.head(this.document),s=this.findSheet(i,e.getAttribute(t,"id"));s?e.replace(t,s):e.append(i,t)}}findSheet(t,e){if(e)for(const i of this.adaptor.tags(t,"style"))if(this.adaptor.getAttribute(i,"id")===e)return i;return null}removeFromDocument(t=!1){if(this.processed.isSet("updateDocument"))for(const e of this.math)e.state()>=Ns.INSERTED&&e.state(Ns.TYPESET,t);return this.processed.clear("updateDocument"),this}documentStyleSheet(){return this.outputJax.styleSheet(this)}documentPageElements(){return this.outputJax.pageElements(this)}addStyles(t){this.styles.push(t),"insertStyles"in this.outputJax&&this.outputJax.insertStyles(t)}getStyles(){return this.styles}}En.KIND="HTML",En.OPTIONS=Object.assign(Object.assign({},sn.OPTIONS),{renderActions:Xi(Object.assign(Object.assign({},sn.OPTIONS.renderActions),{styles:[Ns.STYLES,"","updateStyleSheet",!1]})),MathList:gn,MathItem:fn,DomStrings:null});class xn extends nn{constructor(){super(...arguments),this.documentClass=En}handlesDocument(t){const e=this.adaptor;if("string"==typeof t)try{t=e.parse(t,"text/html")}catch(t){}return t instanceof e.window.Document||t instanceof e.window.HTMLElement||t instanceof e.window.DocumentFragment}create(t,e){const i=this.adaptor;if("string"==typeof t)t=i.parse(t,"text/html");else if(t instanceof i.window.HTMLElement||t instanceof i.window.DocumentFragment){const e=t;t=i.parse("","text/html"),i.append(i.body(t),e)}return super.create(t,e)}}function yn(t){const e=new xn(t);return mn.handlers.register(e),e}class Nn{get cssText(){return this.getStyleString()}constructor(t=null){this.styles={},this.addStyles(t)}addStyles(t){if(t)for(const e of Object.keys(t))this.styles[e]||(this.styles[e]={}),Object.assign(this.styles[e],t[e])}removeStyles(...t){for(const e of t)delete this.styles[e]}clear(){this.styles={}}getStyleString(){return this.getStyleRules().join("\n\n")}getStyleRules(t=this.styles,e=""){const i=Object.keys(t),s=new Array(i.length);let r=0;for(const n of i){const i=t[n];s[r++]=`${e}${n} {\n${this.getStyleDefString(i,e)}\n${e}}`}return s}getStyleDefString(t,e){const i=Object.keys(t),s=new Array(i.length);let r=0;for(const n of i)s[r++]=t[n]instanceof Object?e+this.getStyleRules({[n]:t[n]},e+" ").join("\n"+e):" "+e+n+": "+t[n]+";";return s.join("\n"+e)}}var vn;const Tn=!!(null===(vn=Ri.window)||void 0===vn?void 0:vn.HTMLDialogElement);class _n{constructor(t){this.minW=200,this.minH=80,this.tx=0,this.ty=0,this.dragging=!1,this.events=[["mousemove",this.MouseMove.bind(this)],["mouseup",this.MouseUp.bind(this)]],this.mode="",this.actions={down:{move:t=>{t.dialog.classList.add("mjx-moving")}},move:{move:(t,e)=>[e.x-t.x,e.y-t.y,0,0],top:(t,e)=>[0,(e.y-t.y)/2,0,t.y-e.y],bottom:(t,e)=>[0,(e.y-t.y)/2,0,e.y-t.y],left:(t,e)=>[(e.x-t.x)/2,0,t.x-e.x,0],right:(t,e)=>[(e.x-t.x)/2,0,e.x-t.x,0],topleft:(t,e)=>[(e.x-t.x)/2,(e.y-t.y)/2,t.x-e.x,t.y-e.y],topright:(t,e)=>[(e.x-t.x)/2,(e.y-t.y)/2,e.x-t.x,t.y-e.y],botleft:(t,e)=>[(e.x-t.x)/2,(e.y-t.y)/2,t.x-e.x,e.y-t.y],botright:(t,e)=>[(e.x-t.x)/2,(e.y-t.y)/2,e.x-t.x,e.y-t.y]},up:{move:t=>{t.dialog.classList.remove("mjx-moving")}},keymove:{left:()=>[-5,0,0,0],right:()=>[5,0,0,0],up:()=>[0,-5,0,0],down:()=>[0,5,0,0]},bigmove:{left:()=>[-20,0,0,0],right:()=>[20,0,0,0],up:()=>[0,-20,0,0],down:()=>[0,20,0,0]},keysize:{left:()=>[-3,0,-6,0],right:()=>[3,0,6,0],up:()=>[0,-3,0,-6],down:()=>[0,3,0,6]},bigsize:{left:()=>[-10,0,-20,0],right:()=>[10,0,20,0],up:()=>[0,-10,0,-20],down:()=>[0,10,0,20]}};const{adaptor:e,node:i=null}=t;this.init(e),this.node=i,this.background=Tn?null:e.node("mjx-dialog-background"),this.x=this.y=0,this.dragging=!1,this.action="",this.dialog=this.html(t),this.title=this.dialog.firstChild.firstChild.firstChild,this.content=this.dialog.firstChild.firstChild.nextSibling;const s=this.dialog.lastChild;s.addEventListener("click",this.closeDialog.bind(this)),s.addEventListener("keydown",this.actionKey.bind(this,this.closeDialog.bind(this)));const r=this.dialog.lastChild.previousSibling;r.addEventListener("click",this.helpDialog.bind(this,e)),r.addEventListener("keydown",this.actionKey.bind(this,this.helpDialog.bind(this,e))),this.noDrag=Array.from(this.dialog.querySelectorAll('[data-drag="none"]'))}init(t){const e=this.constructor;if(!t.document.head.querySelector("#"+e.styleId)){const i=t.node("style",{id:e.styleId});i.textContent=new Nn(e.styles).cssText,t.document.head.append(i)}}html(t){const{title:e,message:i,adaptor:s,styles:r=null,extraNodes:n=[],className:o=_n.className}=t;if(r){const t=s.node("style");t.textContent=new Nn(r).cssText,n.unshift(t)}const a="mjx-dialog-label-"+_n.id++,l=s.node("dialog",{closedby:"any",class:("mjx-dialog "+o).trim()},[s.node("mjx-dialog",{"aria-labeledby":a},[s.node("mjx-title",{},[s.node("h1",{id:a,tabIndex:0})]),s.node("div",{"data-drag":"none",tabIndex:0})]),...n,s.node("mjx-dialog-spacer",{"aria-hidden":!0}),s.node("mjx-dialog-drag",{"data-drag":"top","aria-hidden":!0}),s.node("mjx-dialog-drag",{"data-drag":"bottom","aria-hidden":!0}),s.node("mjx-dialog-drag",{"data-drag":"left","aria-hidden":!0}),s.node("mjx-dialog-drag",{"data-drag":"right","aria-hidden":!0}),s.node("mjx-dialog-drag",{"data-drag":"topleft","aria-hidden":!0}),s.node("mjx-dialog-drag",{"data-drag":"topright","aria-hidden":!0}),s.node("mjx-dialog-drag",{"data-drag":"botleft","aria-hidden":!0}),s.node("mjx-dialog-drag",{"data-drag":"botright","aria-hidden":!0}),s.node("mjx-dialog-help",{class:"mjx-dialog-button","data-drag":"none",tabIndex:0,role:"button","aria-label":"Dialog Help"},[s.node("mjx-dialog-icon",{"aria-hidden":!0},[s.text("?")])]),s.node("mjx-dialog-close",{class:"mjx-dialog-button","data-drag":"none",tabIndex:0,role:"button","aria-label":"Close Dialog Box"},[s.node("mjx-dialog-icon",{"aria-hidden":!0},[s.text("\xd7")])])]);return l.firstChild.firstChild.firstChild.innerHTML=e,l.firstChild.childNodes[1].innerHTML=i,l}attach(){Tn?(this.dialog.addEventListener("mousedown",this.MouseDown.bind(this)),this.dialog.addEventListener("keydown",this.KeyDown.bind(this),!0),document.body.append(this.dialog),this.dialog.showModal()):(this.background.addEventListener("mousedown",this.MouseDown.bind(this)),this.background.addEventListener("keydown",this.KeyDown.bind(this),!0),this.dialog.setAttribute("tabindex","0"),this.dialog.addEventListener("click",this.stop),this.background.append(this.dialog),document.body.append(this.background)),Ri.window.addEventListener("visibilitychange",this.Visibility.bind(this)),this.minW=Math.min(this.minW,this.dialog.clientWidth-8),this.minH=Math.min(this.minH,this.dialog.clientHeight-this.title.offsetHeight-8),this.title.focus()}dragAction(t,e=null){e&&this.stop(e);const i=this.actions[t][this.action],s=i?i(this,e):null;if(!s)return;let[r,n,o,a]=s;if(o){const t=this.w+o;t>=this.minW?(this.x=null==e?void 0:e.x,this.w=t,this.dialog.style.maxWidth=this.dialog.style.width=t+"px"):r=0}if(a){const t=this.h+a;t>=this.minH+this.title.offsetHeight?(this.y=null==e?void 0:e.y,this.h=t,this.dialog.style.maxHeight=this.dialog.style.height=t+"px"):n=0}(r||n)&&(r&&(this.x=null==e?void 0:e.x,this.tx+=r||0),n&&(this.y=null==e?void 0:e.y,this.ty+=n||0),this.dialog.style.transform=`translate(${this.tx}px, ${this.ty}px)`)}MouseDown(t){const e=t.target;if(!(1!==t.buttons||t.shiftKey||t.metaKey||t.altKey||t.ctrlKey))if(this.inDialog(t)){for(const t of this.noDrag)if(e===t||t.contains(e))return;this.action=e.getAttribute("data-drag")||"move",this.startDrag(t),this.dragAction("down",t)}else this.closeDialog(t)}MouseMove(t){1!==t.buttons&&this.endDrag(),this.dragging&&this.dragAction("move",t)}MouseUp(t){this.dragging&&(this.dragAction("up",t),this.endDrag())}Visibility(){Ri.document.hidden&&this.closeDialog()}KeyDown(t){const e=this.constructor.keyActions.get(t.key);e&&e(this,t)}escKey(t){this.closeDialog(t)}aKey(t){(t.ctrlKey||t.metaKey)&&(this.selectAll(),this.stop(t))}mKey(t){this.mode="move"===this.mode?"":"move",this.stop(t)}sKey(t){this.mode="size"===this.mode?"":"size",this.stop(t)}arrowKey(t,e){t.ctrlKey||this.dragging||(this.action=e,this.getWH(),t.altKey||"move"===this.mode?(this.dragAction(t.shiftKey?"bigmove":"keymove"),this.stop(t)):(t.metaKey||"size"===this.mode)&&(this.dragAction(t.shiftKey?"bigsize":"keysize"),this.stop(t)),this.action="")}actionKey(t,e){"Enter"!==e.code&&"Space"!==e.code||t(e)}selectAll(){document.getSelection().selectAllChildren(this.content)}copyToClipboard(){this.selectAll();try{document.execCommand("copy")}catch(t){alert(`Can't copy to clipboard: ${t.message}`)}document.getSelection().removeAllRanges()}startDrag(t){this.x=t.x,this.y=t.y,this.getWH(),this.dragging=!0;const e=this.background||this.dialog;for(const[t,i]of this.events)e.addEventListener(t,i)}getWH(){this.w=this.dialog.clientWidth-8,this.h=this.dialog.clientHeight-8}endDrag(){this.action="",this.dragging=!1;const t=this.background||this.dialog;for(const[e,i]of this.events)t.removeEventListener(e,i)}closeDialog(t){var e;Tn?(this.dialog.close(),this.dialog.remove()):this.background.remove(),null===(e=this.node)||void 0===e||e.focus(),t&&this.stop(t)}helpDialog(t,e){new _n({title:"MathJax Dialog Help",message:this.constructor.helpMessage,adaptor:t,className:"mjx-dialog-help",styles:{".mjx-dialog-help":{"max-width":"calc(min(50em, 80%))"}}}).attach(),this.stop(e)}inDialog(t){if(!this.dialog.contains(t.target))return!1;const{x:e,y:i}=t,{left:s,right:r,top:n,bottom:o}=this.dialog.getBoundingClientRect();return e>=s&&e<=r&&i>=n&&i<=o}stop(t){t.preventDefault&&t.preventDefault(),t.stopImmediatePropagation?t.stopImmediatePropagation():t.stopPropagation&&t.stopPropagation()}}_n.keyActions=new Map([["Escape",(t,e)=>t.escKey(e)],["a",(t,e)=>t.aKey(e)],["m",(t,e)=>t.mKey(e)],["s",(t,e)=>t.sKey(e)],["ArrowRight",(t,e)=>t.arrowKey(e,"right")],["ArrowLeft",(t,e)=>t.arrowKey(e,"left")],["ArrowUp",(t,e)=>t.arrowKey(e,"up")],["ArrowDown",(t,e)=>t.arrowKey(e,"down")]]),_n.styleId="MJX-DIALOG-styles",_n.className="",_n.id=0,_n.styles={"mjx-dialog-background":{display:"flex","flex-direction":"column","justify-content":"center",position:"fixed",top:0,left:0,right:0,bottom:0,"z-index":1001},".mjx-dialog":{"max-width":"calc(min(60em, 90%))","max-height":"calc(min(50em, 85%))",border:"3px outset","border-radius":"15px",color:"black","background-color":"#DDDDDD","box-shadow":"0px 10px 20px #808080",padding:"4px 4px",cursor:"grab",overflow:"visible",display:"flex","flex-direction":"column","align-items":"center",position:"relative",top:"-4%"},".mjx-dialog.mjx-moving":{cursor:"grabbing"},'.mjx-dialog > input[type="button"]':{width:"fit-content"},".mjx-dialog > mjx-dialog-spacer":{display:"block",height:".75em","flex-shrink":0},".mjx-dialog::backdrop":{opacity:0,cursor:"default"},"mjx-dialog":{all:"initial",cursor:"inherit",width:"100%",display:"flex","flex-direction":"column","flex-grow":1,"flex-shrink":1,overflow:"hidden"},"mjx-dialog > mjx-title":{display:"block","text-align":"center",margin:".25em 1.75em",overflow:"hidden","white-space":"nowrap","-webkit-user-select":"none","user-select":"none","flex-shrink":0},"mjx-dialog > mjx-title > h1":{"font-size":"125%",margin:0},"mjx-dialog > div":{margin:"0 1em .5em",padding:"8px 18px",overflow:"auto",border:"2px inset black","background-color":"white","text-align":"left",cursor:"default","flex-grow":1,"flex-shrink":1},"mjx-dialog > div > pre":{margin:0},".mjx-dialog-button":{position:"absolute",top:"6px",height:"17px",width:"17px",cursor:"default",display:"block",border:"2px solid #AAA","border-radius":"18px","font-family":'"Courier New", Courier',"text-align":"center",color:"#F0F0F0","-webkit-user-select":"none","user-select":"none"},".mjx-dialog-button:hover":{color:"white !important",border:"2px solid #CCC !important"},".mjx-dialog-button > mjx-dialog-icon":{display:"block","background-color":"#AAA",border:"1.5px solid","border-radius":"18px","line-height":0,padding:"8px 0 6px"},".mjx-dialog-button > mjx-dialog-icon:hover":{"background-color":"#CCC !important"},"mjx-dialog-close":{right:"6px","font-size":"20px;"},"mjx-dialog-help":{left:"6px","font-size":"14px;","font-weight":"bold"},".mjx-dialog-help mjx-dialog-help":{display:"none"},"mjx-dialog kbd":{display:"inline-block",padding:"3px 5px","font-size":"11px","line-height":"10px",color:"#444d56","vertical-align":"middle","background-color":"#fafbfc",border:"solid 1.5px #c6cbd1","border-bottom-color":"#959da5","border-radius":"3px","box-shadow":"inset -.5px -1px 0 #959da5"},'mjx-dialog-drag[data-drag="top"]':{height:"5px",position:"absolute",top:"-3px",left:"10px",right:"10px",cursor:"ns-resize"},'mjx-dialog-drag[data-drag="bottom"]':{height:"5px",position:"absolute",bottom:"-3px",left:"10px",right:"10px",cursor:"ns-resize"},'mjx-dialog-drag[data-drag="left"]':{width:"5px",position:"absolute",left:"-3px",top:"10px",bottom:"10px",cursor:"ew-resize"},'mjx-dialog-drag[data-drag="right"]':{width:"5px",position:"absolute",right:"-3px",top:"10px",bottom:"10px",cursor:"ew-resize"},'mjx-dialog-drag[data-drag="topleft"]':{width:"13px",height:"13px",position:"absolute",left:"-3px",top:"-3px",cursor:"nwse-resize"},'mjx-dialog-drag[data-drag="topright"]':{width:"13px",height:"13px",position:"absolute",right:"-3px",top:"-3px",cursor:"nesw-resize"},'mjx-dialog-drag[data-drag="botleft"]':{width:"13px",height:"13px",position:"absolute",left:"-3px",bottom:"-3px",cursor:"nesw-resize"},'mjx-dialog-drag[data-drag="botright"]':{width:"13px",height:"13px",position:"absolute",right:"-3px",bottom:"-3px",cursor:"nwse-resize"},"@media (prefers-color-scheme: dark)":{".mjx-dialog":{"background-color":"#303030","box-shadow":"0px 10px 20px #000",border:"3px outset #7C7C7C"},"mjx-dialog":{color:"#E0E0E0"},"mjx-dialog > div":{border:"2px inset #7C7C7C","background-color":"#222025"},"a[href]":{color:"#86A7F5"},"a[href]:visited":{color:"#DD98E2"},"mjx-dialog kbd":{color:"#F8F8F8","background-color":"#545454",border:"solid 1.5px #7A7C7E","border-bottom-color":"#707070","box-shadow":"inset -.5px -1px 0 #818589"},".mjx-dialog-button":{border:"2px solid #686868",color:"#A4A4A4"},".mjx-dialog-button:hover":{color:"#CBCBCB !important",border:"2px solid #888888 !important"},".mjx-dialog-button > mjx-dialog-icon":{"background-color":"#646464"},".mjx-dialog-button > mjx-dialog-icon:hover":{"background-color":"#888888 !important"}}},_n.helpMessage='\n <p>The dialog boxes in MathJax are movable and sizeable.</p>\n\n <p>For mouse users, dragging any of the edges will enlarge or shrink\n the dialog box by moving that side. Dragging any of the corners\n changes the two sides that meet at that corner. Dragging elsewhere on\n the dialog frame will move the dialog without changing its size.</p>\n\n <p>For keyboard users, there are two ways to adjust the position\n and size of the dialog box. The first is to hold the\n <kbd>Alt</kbd> or <kbd>Option</kbd> key and press any of the arrow\n keys to move the dialog box in the given direction. Hold the\n <kbd>Win</kbd> or <kbd>Command</kbd> key and press any of the\n arrow keys to enlarge or shrink the dialog box. Left and right\n move the right-hand edge of the dialog, while up and down move the\n bottom edge of the dialog.\n </p>\n\n <p>For some users, holding two keys down at once may be difficult,\n so the second way is to press the <kbd>m</kbd> to start "move"\n mode, then use the arrow keys to move the dialog box in the given\n direction. Press <kbd>m</kbd> again to stop moving the dialog.\n Similarly, press <kbd>s</kbd> to start and stop "sizing" mode,\n where the arrows will change the size of the dialog box.</p>\n\n <p>Holding a <kbd>shift</kbd> key along with the arrow key will\n make larger changes in the size or position, for either method\n described above.</p>\n\n <p>Use <kbd>Tab</kbd> to move among the text, buttons, and links\n within the dialog. The <kbd>Enter</kbd> or <kbd>Space</kbd> key\n activates the focused item. The <kbd>Escape</kbd> key closes the\n dialog, as does clicking outside the dialog box, or clicking the\n "\xd7" icon in the upper right-hand corner of the dialog.</p>\n ';class Ln extends _n{static post(t){const e=new this(t);return e.attach(),e}}function Cn(t){return mn.asyncLoad?new Promise(((e,i)=>{const s=mn.asyncLoad(t);s instanceof Promise?s.then((t=>e(t))).catch((t=>i(t))):e(s)})):Promise.reject(`Can't load '${t}': No mathjax.asyncLoad method specified`)}const Rn=1e6,wn={px:1,in:96,cm:96/2.54,mm:96/25.4},In={em:1,ex:.431,pt:.1,pc:1.2,mu:1/18},Sn={veryverythinmathspace:1/18,verythinmathspace:2/18,thinmathspace:3/18,mediummathspace:4/18,thickmathspace:5/18,verythickmathspace:6/18,veryverythickmathspace:7/18,negativeveryverythinmathspace:-1/18,negativeverythinmathspace:-2/18,negativethinmathspace:-3/18,negativemediummathspace:-4/18,negativethickmathspace:-5/18,negativeverythickmathspace:-6/18,negativeveryverythickmathspace:-7/18,thin:.04,medium:.06,thick:.1,normal:1,big:2,small:1/Math.sqrt(2),infinity:Rn};function An(t,e=0,i=1,s=16){if("string"!=typeof t&&(t=String(t)),""===t||null==t)return e;if(Sn[t])return Sn[t];const r=t.match(/^\s*([-+]?(?:\.\d+|\d+(?:\.\d*)?))?(pt|em|ex|mu|px|pc|in|mm|cm|%)?/);if(!r||""===r[0])return e;const n=parseFloat(r[1]||"1"),o=r[2];return Object.hasOwn(wn,o)?n*wn[o]/s/i:Object.hasOwn(In,o)?n*In[o]:"%"===o?n/100*e:n*e}function On(t){return(100*t).toFixed(1).replace(/\.?0+$/,"")+"%"}function Mn(t){return Math.abs(t)<.001?"0":t.toFixed(3).replace(/\.?0+$/,"")+"em"}function kn(t,e=-Rn,i=16){return t*=i,e&&t<e&&(t=e),Math.abs(t)<.1?"0":t.toFixed(1).replace(/\.0$/,"")+"px"}class Dn{static zero(){return new Dn({h:0,d:0,w:0})}static empty(){return new Dn}constructor(t={w:0,h:-Rn,d:-Rn}){this.w=t.w||0,this.h="h"in t?t.h:-Rn,this.d="d"in t?t.d:-Rn,this.L=this.R=this.ic=this.oc=this.sk=this.dx=0,this.scale=this.rscale=1,this.pwidth=""}empty(){return this.w=0,this.h=this.d=-Rn,this}clean(){this.w===-Rn&&(this.w=0),this.h===-Rn&&(this.h=0),this.d===-Rn&&(this.d=0)}rescale(t){this.w*=t,this.h*=t,this.d*=t}combine(t,e=0,i=0){const s=t.rscale,r=e+s*(t.w+t.L+t.R),n=i+s*t.h,o=s*t.d-i;r>this.w&&(this.w=r),n>this.h&&(this.h=n),o>this.d&&(this.d=o)}append(t){const e=t.rscale;this.w+=e*(t.w+t.L+t.R),e*t.h>this.h&&(this.h=e*t.h),e*t.d>this.d&&(this.d=e*t.d)}updateFrom(t){this.h=t.h,this.d=t.d,this.w=t.w,t.pwidth&&(this.pwidth=t.pwidth)}copy(){const t=new Dn;return Object.assign(t,this),t}}Dn.fullWidth="100%",Dn.boxSides=[["Top",0,"h"],["Right",1,"w"],["Bottom",2,"d"],["Left",3,"w"]];const Pn={loadMissingEntities:!0},Bn={ApplyFunction:"\u2061",Backslash:"\u2216",Because:"\u2235",Breve:"\u02d8",Cap:"\u22d2",CenterDot:"\xb7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",Congruent:"\u2261",ContourIntegral:"\u222e",Coproduct:"\u2210",Cross:"\u2a2f",Cup:"\u22d3",CupCap:"\u224d",Dagger:"\u2021",Del:"\u2207",Delta:"\u0394",Diamond:"\u22c4",DifferentialD:"\u2146",DotEqual:"\u2250",DoubleDot:"\xa8",DoubleRightTee:"\u22a8",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownLeftVector:"\u21bd",DownRightVector:"\u21c1",DownTee:"\u22a4",Downarrow:"\u21d3",Element:"\u2208",EqualTilde:"\u2242",Equilibrium:"\u21cc",Exists:"\u2203",ExponentialE:"\u2147",FilledVerySmallSquare:"\u25aa",ForAll:"\u2200",Gamma:"\u0393",Gg:"\u22d9",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Hacek:"\u02c7",Hat:"^",HumpDownHump:"\u224e",HumpEqual:"\u224f",Im:"\u2111",ImaginaryI:"\u2148",Integral:"\u222b",Intersection:"\u22c2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Lambda:"\u039b",Larr:"\u219e",LeftAngleBracket:"\u27e8",LeftArrow:"\u2190",LeftArrowRightArrow:"\u21c6",LeftCeiling:"\u2308",LeftDownVector:"\u21c3",LeftFloor:"\u230a",LeftRightArrow:"\u2194",LeftTee:"\u22a3",LeftTriangle:"\u22b2",LeftTriangleEqual:"\u22b4",LeftUpVector:"\u21bf",LeftVector:"\u21bc",Leftarrow:"\u21d0",Leftrightarrow:"\u21d4",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",Ll:"\u22d8",Lleftarrow:"\u21da",LongLeftArrow:"\u27f5",LongLeftRightArrow:"\u27f7",LongRightArrow:"\u27f6",Longleftarrow:"\u27f8",Longleftrightarrow:"\u27fa",Longrightarrow:"\u27f9",Lsh:"\u21b0",MinusPlus:"\u2213",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotLeftTriangle:"\u22ea",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotPrecedes:"\u2280",NotPrecedesSlantEqual:"\u22e0",NotRightTriangle:"\u22eb",NotRightTriangleEqual:"\u22ed",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsSlantEqual:"\u22e1",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotVerticalBar:"\u2224",Omega:"\u03a9",OverBar:"\u203e",OverBrace:"\u23de",PartialD:"\u2202",Phi:"\u03a6",Pi:"\u03a0",PlusMinus:"\xb1",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",Product:"\u220f",Proportional:"\u221d",Psi:"\u03a8",Rarr:"\u21a0",Re:"\u211c",ReverseEquilibrium:"\u21cb",RightAngleBracket:"\u27e9",RightArrow:"\u2192",RightArrowLeftArrow:"\u21c4",RightCeiling:"\u2309",RightDownVector:"\u21c2",RightFloor:"\u230b",RightTee:"\u22a2",RightTeeArrow:"\u21a6",RightTriangle:"\u22b3",RightTriangleEqual:"\u22b5",RightUpVector:"\u21be",RightVector:"\u21c0",Rightarrow:"\u21d2",Rrightarrow:"\u21db",Rsh:"\u21b1",Sigma:"\u03a3",SmallCircle:"\u2218",Sqrt:"\u221a",Square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Star:"\u22c6",Subset:"\u22d0",SubsetEqual:"\u2286",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",SuchThat:"\u220b",Sum:"\u2211",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22d1",Therefore:"\u2234",Theta:"\u0398",Tilde:"\u223c",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",UnderBar:"_",UnderBrace:"\u23df",Union:"\u22c3",UnionPlus:"\u228e",UpArrow:"\u2191",UpDownArrow:"\u2195",UpTee:"\u22a5",Uparrow:"\u21d1",Updownarrow:"\u21d5",Upsilon:"\u03a5",Vdash:"\u22a9",Vee:"\u22c1",VerticalBar:"\u2223",VerticalTilde:"\u2240",Vvdash:"\u22aa",Wedge:"\u22c0",Xi:"\u039e",amp:"&",acute:"\xb4",aleph:"\u2135",alpha:"\u03b1",amalg:"\u2a3f",and:"\u2227",ang:"\u2220",angmsd:"\u2221",angsph:"\u2222",ape:"\u224a",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",beta:"\u03b2",beth:"\u2136",between:"\u226c",bigcirc:"\u25ef",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",blacklozenge:"\u29eb",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",bowtie:"\u22c8",boxdl:"\u2510",boxdr:"\u250c",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxul:"\u2518",boxur:"\u2514",bsol:"\\",bull:"\u2022",cap:"\u2229",check:"\u2713",chi:"\u03c7",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledR:"\xae",circledS:"\u24c8",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",clubs:"\u2663",colon:":",comp:"\u2201",ctdot:"\u22ef",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cup:"\u222a",curarr:"\u21b7",curlyvee:"\u22ce",curlywedge:"\u22cf",dagger:"\u2020",daleth:"\u2138",ddarr:"\u21ca",deg:"\xb0",delta:"\u03b4",digamma:"\u03dd",div:"\xf7",divideontimes:"\u22c7",dot:"\u02d9",doteqdot:"\u2251",dotplus:"\u2214",dotsquare:"\u22a1",dtdot:"\u22f1",ecir:"\u2256",efDot:"\u2252",egs:"\u2a96",ell:"\u2113",els:"\u2a95",empty:"\u2205",epsi:"\u03b5",epsiv:"\u03f5",erDot:"\u2253",eta:"\u03b7",eth:"\xf0",flat:"\u266d",fork:"\u22d4",frown:"\u2322",gEl:"\u2a8c",gamma:"\u03b3",gap:"\u2a86",gimel:"\u2137",gnE:"\u2269",gnap:"\u2a8a",gne:"\u2a88",gnsim:"\u22e7",gt:">",gtdot:"\u22d7",harrw:"\u21ad",hbar:"\u210f",hellip:"\u2026",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",imath:"\u0131",infin:"\u221e",intcal:"\u22ba",iota:"\u03b9",jmath:"\u0237",kappa:"\u03ba",kappav:"\u03f0",lEg:"\u2a8b",lambda:"\u03bb",lap:"\u2a85",larrlp:"\u21ab",larrtl:"\u21a2",lbrace:"{",lbrack:"[",le:"\u2264",leftleftarrows:"\u21c7",leftthreetimes:"\u22cb",lessdot:"\u22d6",lmoust:"\u23b0",lnE:"\u2268",lnap:"\u2a89",lne:"\u2a87",lnsim:"\u22e6",longmapsto:"\u27fc",looparrowright:"\u21ac",lowast:"\u2217",loz:"\u25ca",lt:"<",ltimes:"\u22c9",ltri:"\u25c3",macr:"\xaf",malt:"\u2720",mho:"\u2127",mu:"\u03bc",multimap:"\u22b8",nLeftarrow:"\u21cd",nLeftrightarrow:"\u21ce",nRightarrow:"\u21cf",nVDash:"\u22af",nVdash:"\u22ae",natur:"\u266e",nearr:"\u2197",nharr:"\u21ae",nlarr:"\u219a",not:"\xac",nrarr:"\u219b",nu:"\u03bd",nvDash:"\u22ad",nvdash:"\u22ac",nwarr:"\u2196",omega:"\u03c9",omicron:"\u03bf",or:"\u2228",osol:"\u2298",period:".",phi:"\u03c6",phiv:"\u03d5",pi:"\u03c0",piv:"\u03d6",prap:"\u2ab7",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",prime:"\u2032",psi:"\u03c8",quot:'"',rarrtl:"\u21a3",rbrace:"}",rbrack:"]",rho:"\u03c1",rhov:"\u03f1",rightrightarrows:"\u21c9",rightthreetimes:"\u22cc",ring:"\u02da",rmoust:"\u23b1",rtimes:"\u22ca",rtri:"\u25b9",scap:"\u2ab8",scnE:"\u2ab6",scnap:"\u2aba",scnsim:"\u22e9",sdot:"\u22c5",searr:"\u2198",sect:"\xa7",sharp:"\u266f",sigma:"\u03c3",sigmav:"\u03c2",simne:"\u2246",smile:"\u2323",spades:"\u2660",sub:"\u2282",subE:"\u2ac5",subnE:"\u2acb",subne:"\u228a",supE:"\u2ac6",supnE:"\u2acc",supne:"\u228b",swarr:"\u2199",tau:"\u03c4",theta:"\u03b8",thetav:"\u03d1",tilde:"\u02dc",times:"\xd7",triangle:"\u25b5",triangleq:"\u225c",upsi:"\u03c5",upuparrows:"\u21c8",veebar:"\u22bb",vellip:"\u22ee",weierp:"\u2118",xi:"\u03be",yen:"\xa5",zeta:"\u03b6",zigrarr:"\u21dd",nbsp:"\xa0",rsquo:"\u2019",lsquo:"\u2018"},jn={};function Fn(t,e){Object.assign(Bn,t),jn[e]=!0}function Un(t){delete Bn[t]}function Hn(t){return t.replace(/&([a-z][a-z0-9]*|#(?:[0-9]+|x[0-9a-f]+));/gi,qn)}function qn(t,e){if("#"===e.charAt(0))return Wn(e.slice(1));if(Bn[e])return Bn[e];if(Pn.loadMissingEntities){const t=e.match(/^[a-zA-Z](fr|scr|opf)$/)?RegExp.$1:e.charAt(0).toLowerCase();jn[t]||(jn[t]=!0,Jr(Cn("./util/entities/"+t+".js")))}return t}function Wn(t){const e="x"===t.charAt(0)?parseInt(t.slice(1),16):parseInt(t);return String.fromCodePoint(e)}const Vn=["top","right","bottom","left"],Xn=["width","style","color"];function zn(t){const e=t.split(/((?:'[^'\n]*'|"[^"\n]*"|,[\s\n]|[^\s\n])*)/g),i=[];for(;e.length>1;)e.shift(),i.push(e.shift());return i}function Gn(t){const e=zn(this.styles[t]);0===e.length&&e.push(""),1===e.length&&e.push(e[0]),2===e.length&&e.push(e[0]),3===e.length&&e.push(e[1]);for(const i of eo.connect[t].children)this.setStyle(this.childName(t,i),e.shift())}function Jn(t){const e=eo.connect[t].children,i=[];for(const s of e){const e=this.styles[t+"-"+s];if(!e)return void delete this.styles[t];i.push(e)}i[3]===i[1]&&(i.pop(),i[2]===i[0]&&(i.pop(),i[1]===i[0]&&i.pop())),this.styles[t]=i.join(" ")}const Kn=/^(?:[\d.]+(?:[a-z]+)|thin|medium|thick|inherit|initial|unset)$/,$n=/^(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|inherit|initial|unset)$/;function Yn(t){const e={width:"",style:"",color:""};for(const i of zn(this.styles[t]))i.match(Kn)&&""===e.width?e.width=i:i.match($n)&&""===e.style?e.style=i:e.color=i;for(const i of eo.connect[t].children)this.setStyle(this.childName(t,i),e[i])}function Qn(t){const e=[];for(const i of eo.connect[t].children){const s=this.styles[this.childName(t,i)];s&&e.push(s)}e.length?this.styles[t]=e.join(" "):delete this.styles[t]}const Zn={style:/^(?:normal|italic|oblique|inherit|initial|unset)$/,variant:new RegExp("^(?:"+["normal|none","inherit|initial|unset","common-ligatures|no-common-ligatures","discretionary-ligatures|no-discretionary-ligatures","historical-ligatures|no-historical-ligatures","contextual|no-contextual","(?:stylistic|character-variant|swash|ornaments|annotation)\\([^)]*\\)","small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","lining-nums|oldstyle-nums|proportional-nums|tabular-nums","diagonal-fractions|stacked-fractions","ordinal|slashed-zero","jis78|jis83|jis90|jis04|simplified|traditional","full-width|proportional-width","ruby"].join("|")+")$"),weight:/^(?:normal|bold|bolder|lighter|[1-9]00|inherit|initial|unset)$/,stretch:new RegExp("^(?:"+["normal","(?:(?:ultra|extra|semi)-)?(?:condensed|expanded)","inherit|initial|unset"].join("|")+")$"),size:new RegExp("^(?:"+["xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller","[\\d.]+%|[\\d.]+[a-z]+","inherit|initial|unset"].join("|")+")(?:/(?:normal|[\\d.]+(?:%|[a-z]+)?))?$")};function to(t,e){for(const i of eo.connect[t].children){const s=this.childName(t,i);if(Array.isArray(e[i])){const t=e[i];t.length&&(this.styles[s]=t.join(" "))}else""!==e[i]&&(this.styles[s]=e[i])}}class eo{constructor(t=""){this.parse(t)}sanitizeValue(t){const e=this.constructor.pattern;if(!t.match(e.sanitize))return t;const i=(t=t.replace(e.value,"$1")).replace(/\\./g,"").replace(/(['"]).*?\1/g,"").replace(/[^'"]/g,"");return i.length&&(t+=i.charAt(0)),t}get cssText(){var t,e;const i=[];for(const s of Object.keys(this.styles)){const r=this.parentName(s),n=s.replace(/.*-/,"");this.styles[r]&&(null===(e=null===(t=eo.connect[r])||void 0===t?void 0:t.children)||void 0===e?void 0:e.includes(n))||i.push(`${s}: ${this.styles[s]};`)}return i.join(" ")}get styleList(){return Object.assign({},this.styles)}set(t,e){var i,s;for(t=this.normalizeName(t),this.setStyle(t,String(e)),eo.connect[t]&&!eo.connect[t].combine&&(this.combineChildren(t),delete this.styles[t]);t.match(/-/);){const e=t;if(t=this.parentName(t),!eo.connect[e]&&!(null===(s=null===(i=eo.connect[t])||void 0===i?void 0:i.children)||void 0===s?void 0:s.includes(e.substring(t.length+1))))break;eo.connect[t].combine.call(this,t)}}get(t){return t=this.normalizeName(t),Object.hasOwn(this.styles,t)?this.styles[t]:""}setStyle(t,e){this.styles[t]=this.sanitizeValue(e),eo.connect[t]&&eo.connect[t].children&&eo.connect[t].split.call(this,t),""===e&&delete this.styles[t]}combineChildren(t){const e=this.parentName(t);for(const i of eo.connect[t].children){const t=this.childName(e,i);eo.connect[t].combine.call(this,t)}}parentName(t){const e=t.replace(/-[^-]*$/,"");return t===e?"":e}childName(t,e){return e.match(/-/)?e:(eo.connect[t]&&!eo.connect[t].combine&&(e+=t.replace(/.*-/,"-"),t=this.parentName(t)),t+"-"+e)}normalizeName(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}parse(t=""){const e=this.constructor.pattern;this.styles={};const i=t.replace(/\n/g," ").replace(e.comment,"").split(e.style);for(;i.length>1;){const[t,e,s]=i.splice(0,3);if(t.match(/[^\s\n;]/))return;this.set(e,s)}}}function io(t){return t.reduce(((t,e)=>t+e),0)}function so(t){return t.reduce(((t,e)=>Math.max(t,e)),0)}if(eo.pattern={sanitize:/['";]/,value:/^((:?'(?:\\.|[^'])*(?:'|$)|"(?:\\.|[^"])*(?:"|$)|\n|\\.|[^'";])*?)[\s\n]*(?:;|$).*/,style:/([-a-z]+)[\s\n]*:[\s\n]*((?:'(?:\\.|[^'])*(?:'|$)|"(?:\\.|[^"])*(?:"|$)|\n|\\.|[^'";])*?)[\s\n]*(?:;|$)/g,comment:/\/\*[^]*?\*\//g},eo.connect={padding:{children:Vn,split:Gn,combine:Jn},margin:{children:Vn,split:Gn,combine:Jn},border:{children:Vn,split:function(t){for(const e of eo.connect[t].children)this.setStyle(this.childName(t,e),this.styles[t])},combine:function(t){const e=[...eo.connect[t].children],i=this.styles[this.childName(t,e.shift())];for(const s of e)if(this.styles[this.childName(t,s)]!==i)return void delete this.styles[t];this.styles[t]=i}},"border-top":{children:Xn,split:Yn,combine:Qn},"border-right":{children:Xn,split:Yn,combine:Qn},"border-bottom":{children:Xn,split:Yn,combine:Qn},"border-left":{children:Xn,split:Yn,combine:Qn},"border-width":{children:Vn,split:Gn,combine:null},"border-style":{children:Vn,split:Gn,combine:null},"border-color":{children:Vn,split:Gn,combine:null},font:{children:["style","variant","weight","stretch","line-height","size","family"],split:function(t){const e=zn(this.styles[t]),i={style:"",variant:[],weight:"",stretch:"",size:"",family:"","line-height":""};for(const t of e){i.family||(i.family=t);for(const e of Object.keys(Zn))if((Array.isArray(i[e])||""===i[e])&&t.match(Zn[e]))if(i.family===t&&(i.family=""),"size"===e){const[s,r]=t.split(/\//);i[e]=s,r&&(i["line-height"]=r)}else""===i.size&&(Array.isArray(i[e])?i[e].push(t):""===i[e]&&(i[e]=t))}to.call(this,t,i),delete this.styles[t]},combine:function(t){}}},MathJax.loader&&MathJax.loader.checkVersion("core",Ei,"core"),_i({_:{adaptors:{HTMLAdaptor:c,browserAdaptor:h},components:{global:t},core:{DOMAdaptor:l,FindMath:d,Handler:ot,HandlerList:at,InputJax:u,MathDocument:nt,MathItem:g,MathList:f,MmlTree:{Attributes:x,MML:et,MathMLVisitor:ht,MmlFactory:it,MmlNode:N,MmlNodes:{HtmlNode:tt,TeXAtom:Q,maction:H,maligngroup:J,malignmark:K,math:v,mathchoice:Z,menclose:U,merror:P,mfenced:F,mfrac:O,mglyph:$,mi:T,mmultiscripts:V,mn:_,mo:R,mpadded:B,mphantom:j,mroot:k,mrow:A,ms:S,mspace:I,msqrt:M,mstyle:D,msubsup:q,mtable:X,mtd:G,mtext:w,mtr:z,munderover:W,semantics:Y},MmlVisitor:ct,OperatorDictionary:L,SerializedMmlVisitor:dt},OutputJax:p,Tree:{Factory:b,Node:y,NodeFactory:E,Visitor:lt,Wrapper:ut,WrapperFactory:pt}},handlers:{html_ts:yt,html:{HTMLDocument:Et,HTMLDomStrings:bt,HTMLHandler:xt,HTMLMathItem:ft,HTMLMathList:gt}},mathjax:mt,ui:{dialog:{DraggableDialog:vt,InfoDialog:Tt}},util:{AsyncLoad:_t,BBox:Ct,BitField:st,Entities:Rt,FunctionList:r,LinkedList:m,Options:o,PrioritizedList:s,Retries:rt,StyleJson:Nt,Styles:wt,context:e,lengths:Lt,numeric:It,string:C}}}),MathJax.startup&&(MathJax.startup.registerConstructor("HTMLHandler",xn),MathJax.startup.registerConstructor("browserAdaptor",ds),MathJax.startup.useHandler("HTMLHandler"),MathJax.startup.useAdaptor("browserAdaptor")),MathJax.loader){const t=MathJax.config.loader;MathJax._.mathjax.mathjax.asyncLoad=e=>"node:"===e.substring(0,5)?t.require(e):MathJax.loader.load(e).then((t=>t[0]))}const ro="http://www.w3.org/1998/Math/MathML";class no extends us{findMath(t){const e=new Set;this.findMathNodes(t,e),this.findMathPrefixed(t,e);const i=this.adaptor.root(this.adaptor.document);return"html"===this.adaptor.kind(i)&&0===e.size&&this.findMathNS(t,e),this.processMath(e)}findMathNodes(t,e){for(const i of this.adaptor.tags(t,"math"))e.add(i)}findMathPrefixed(t,e){const i=this.adaptor.root(this.adaptor.document);for(const s of this.adaptor.allAttributes(i))if("xmlns:"===s.name.substring(0,6)&&s.value===ro){const i=s.name.substring(6);for(const s of this.adaptor.tags(t,i+":math"))e.add(s)}}findMathNS(t,e){for(const i of this.adaptor.tags(t,"math",ro))e.add(i)}processMath(t){const e=this.adaptor,i=[];for(const s of t.values()){if("mjx-assistive-mml"===e.kind(e.parent(s)))continue;const t="block"===e.getAttribute(s,"display")||"display"===e.getAttribute(s,"mode"),r={node:s,n:0,delim:""},n={node:s,n:0,delim:""};i.push({math:e.outerHTML(s),start:r,end:n,display:t})}return i}}no.OPTIONS={};class oo{constructor(t={}){const e=this.constructor;this.options=Yi($i({},e.OPTIONS),t)}setMmlFactory(t){this.factory=t}compile(t){const e=this.makeNode(t);return e.verifyTree(this.options.verify),e.setInheritedAttributes({},!1,0,!1),e.walkTree(this.markMrows),e}makeNode(t){const e=this.adaptor;let i=!1;const s=e.kind(t).replace(/^.*:/,"");let r=e.getAttribute(t,"data-mjx-texclass")||"";r&&(r=this.filterAttribute("data-mjx-texclass",r)||"");let n=r&&"mrow"===s?"TeXAtom":s;for(const o of this.filterClassList(e.allClasses(t)))o.match(/^MJX-TeXAtom-/)&&"mrow"===s?(r=o.substring(12),n="TeXAtom"):"MJX-fixedlimits"===o&&(i=!0);return this.factory.getNodeClass(n)?this.createMml(n,t,r,i):this.unknownNode(n,t)}createMml(t,e,i,s){const r=this.factory.create(t);return"TeXAtom"!==t||"OP"!==i||s||(r.setProperty("movesupsub",!0),r.attributes.setInherited("movablelimits",!0)),i&&(r.texClass=Is[i],r.setProperty("texClass",r.texClass)),this.addAttributes(r,e),this.checkClass(r,e),this.addChildren(r,e),r}unknownNode(t,e){return this.factory.getNodeClass("html")&&this.options.allowHtmlInTokenNodes?this.factory.create("html").setHTML(e,this.adaptor):(this.error('Unknown node type "'+t+'"'),null)}addAttributes(t,e){let i=!1;for(const s of this.adaptor.allAttributes(e)){const e=s.name,r=this.filterAttribute(e,s.value);if(null!==r&&"xmlns"!==e)if("data-mjx-"===e.substring(0,9))switch(e.substring(9)){case"alternate":t.setProperty("variantForm",!0);break;case"variant":t.attributes.set("mathvariant",r),t.setProperty("ignore-variant",!0),i=!0;break;case"smallmatrix":t.setProperty("smallmatrix",!0),t.setProperty("useHeight",!1);break;case"mathaccent":t.setProperty("mathaccent","true"===r);break;case"auto-op":t.setProperty("autoOP","true"===r);break;case"script-align":t.setProperty("scriptalign",r);break;case"vbox":t.setProperty("vbox",r);break;default:t.attributes.set(e,r)}else if("class"!==e){const s=r.toLowerCase();"true"===s||"false"===s?t.attributes.set(e,"true"===s):i&&"mathvariant"===e||t.attributes.set(e,r)}}}filterAttribute(t,e){return e}filterClassList(t){return t}addChildren(t,e){if(0===t.arity)return;const i=this.adaptor;for(const s of i.childNodes(e)){const e=i.kind(s);if("#comment"!==e)if("#text"===e)this.addText(t,s);else if(t.isKind("annotation-xml"))t.appendChild(this.factory.create("XML").setXML(s,i));else{const e=t.appendChild(this.makeNode(s));0===e.arity&&i.childNodes(s).length&&!e.isKind("html")&&(this.options.fixMisplacedChildren?this.addChildren(t,s):e.mError("There should not be children for "+e.kind+" nodes",this.options.verify,!0))}}t.isToken&&this.trimSpace(t)}addText(t,e){let i=this.adaptor.value(e);(t.isToken||t.getProperty("isChars"))&&t.arity?(t.isToken&&(i=Hn(i),i=this.normalizeSpace(i)),t.appendChild(this.factory.create("text").setText(i))):i.match(/\S/)&&this.error('Unexpected text node "'+i+'"')}checkClass(t,e){const i=[];for(const s of this.filterClassList(this.adaptor.allClasses(e)))"MJX-"===s.substring(0,4)?"MJX-variant"===s?t.setProperty("variantForm",!0):"MJX-TeXAtom"!==s.substring(0,11)&&t.attributes.set("mathvariant",this.fixCalligraphic(s.substring(3))):i.push(s);i.length&&t.attributes.set("class",i.join(" "))}fixCalligraphic(t){return t.replace(/caligraphic/,"calligraphic")}markMrows(t){if(t.isKind("mrow")&&!t.isInferred&&t.childNodes.length>=2){const e=t.childNodes[0],i=t.childNodes[t.childNodes.length-1];e.isKind("mo")&&e.attributes.get("fence")&&e.attributes.get("stretchy")&&i.isKind("mo")&&i.attributes.get("fence")&&i.attributes.get("stretchy")&&(e.childNodes.length&&t.setProperty("open",e.getText()),i.childNodes.length&&t.setProperty("close",i.getText()))}}normalizeSpace(t){return t.replace(/[\t\n\r]/g," ").replace(/ +/g," ")}trimSpace(t){let e=t.childNodes[0];e&&(e.isKind("text")&&e.setText(e.getText().replace(/^ +/,"")),e=t.childNodes[t.childNodes.length-1],e.isKind("text")&&e.setText(e.getText().replace(/ +$/,"")))}error(t){throw new Error(t)}}oo.OPTIONS={MmlFactory:null,allowHtmlInTokenNodes:!1,fixMisplacedChildren:!0,verify:Object.assign({},Ds.verifyDefaults),translateEntities:!0};class ao extends ps{constructor(t={}){const[e,i,s]=ts(t,no.OPTIONS,oo.OPTIONS);super(e),this.findMathML=this.options.FindMathML||new no(i),this.mathml=this.options.MathMLCompile||new oo(s),this.mmlFilters=new Ai(this.options.mmlFilters)}setAdaptor(t){super.setAdaptor(t),this.findMathML.adaptor=t,this.mathml.adaptor=t}setMmlFactory(t){super.setMmlFactory(t),this.mathml.setMmlFactory(t)}get processStrings(){return!1}compile(t,e){let i=t.start.node;if(!i||!t.end.node||this.options.forceReparse||"#text"===this.adaptor.kind(i)){let s=this.executeFilters(this.preFilters,t,e,(t.math||"<math></math>").trim());"html"===this.options.parseAs&&(s=`<html><head></head><body>${s}</body></html>`);const r=this.checkForErrors(this.adaptor.parse(s,"text/"+this.options.parseAs)),n=this.adaptor.body(r);1!==this.adaptor.childNodes(n).length&&this.error("MathML must consist of a single element"),i=this.adaptor.remove(this.adaptor.firstChild(n)),"math"!==this.adaptor.kind(i).replace(/^[a-z]+:/,"")&&this.error("MathML must be formed by a <math> element, not <"+this.adaptor.kind(i)+">")}i=this.executeFilters(this.mmlFilters,t,e,i);let s=this.mathml.compile(i);return s=this.executeFilters(this.postFilters,t,e,s),t.display="block"===s.attributes.get("display"),s}checkForErrors(t){const e=this.adaptor.tags(this.adaptor.body(t),"parsererror")[0];return e&&(""===this.adaptor.textContent(e)&&this.error("Error processing MathML"),this.options.parseError.call(this,e)),t}error(t){throw new Error(t)}findMath(t){return this.findMathML.findMath(t)}}ao.NAME="MathML",ao.OPTIONS=$i({parseAs:"html",forceReparse:!1,mmlFilters:[],FindMathML:null,MathMLCompile:null,parseError:function(t){this.error(this.adaptor.textContent(t).replace(/\n.*/g,""))}},ps.OPTIONS),MathJax.loader&&MathJax.loader.checkVersion("input/mml",Ei,"input"),_i({_:{input:{mathml_ts:Ot,mathml:{FindMathML:St,MathMLCompile:At}}}}),MathJax.loader&&MathJax.loader.pathFilters.add((t=>(t.name=t.name.replace(/\/util\/entities\/.*?\.js/,"/input/mml/entities.js"),!0))),MathJax.startup&&(MathJax.startup.registerConstructor("mml",ao),MathJax.startup.useInput("mml"));const lo={None:"",Vertical:"v",Horizontal:"h"},co=lo.Vertical,ho=lo.Horizontal;var uo=function(t,e,i,s){return new(i||(i=Promise))((function(r,n){function o(t){try{l(s.next(t))}catch(t){n(t)}}function a(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((s=s.apply(t,e||[])).next())}))};const po={dir:lo.None};function mo(t,e,i){return i?$i(t,{[e]:i})[e]:t[e]}class fo{get CLASS(){return this.constructor}static charOptions(t,e){const i=t[e];if(!Array.isArray(i))throw Error(`Character data hasn't been loaded for 0x${e.toString(16).toUpperCase()}`);return 3===i.length&&(i[3]={}),i[3]}static defineDynamicFiles(t,e=""){const i={};return(t||[]).forEach((([t,s,r])=>{i[t]={extension:e,file:t,variants:s,delimiters:r||[],promise:null,failed:!1,setup:e=>{i[t].failed=!0}}})),i}static dynamicSetup(t,e,i,s={},r=null){const n=t?this.dynamicExtensions.get(t):null;(t?n.files:this.dynamicFiles)[e].setup=e=>{Object.keys(i).forEach((t=>e.defineChars(t,i[t]))),e.defineDelimiters(s),t&&this.adjustDelimiters(e.delimiters,Object.keys(s),n.sizeN,n.stretchN),r&&e.addDynamicFontCss(r)}}static adjustDelimiters(t,e,i,s){e.forEach((e=>{const r=t[parseInt(e)];"dir"in r&&(r.variants&&(r.variants=this.adjustArrayIndices(r.variants,i)),r.stretchv&&(r.stretchv=this.adjustArrayIndices(r.stretchv,s)))}))}static adjustArrayIndices(t,e){return t.map((t=>t<0?e-1-t:t))}static addExtension(t,e=""){const i={name:t.name,prefix:e||`[${t.name}-extension]/${this.JAX.toLowerCase()}/dynamic`,files:this.defineDynamicFiles(t.ranges,t.name),sizeN:this.defaultSizeVariants.length,stretchN:this.defaultStretchVariants.length};this.dynamicExtensions.set(t.name,i);for(const[e,i]of[["options","OPTIONS"],["variants","defaultVariants"],["variantSmp","VariantSmp"],["cssFonts","defaultCssFonts"],["accentMap","defaultAccentMap"],["moMap","defaultMoMap"],["mnMap","defaultMnMap"],["parameters","defaultParams"],["chars","defaultChars"],["sizeVariants","defaultSizeVariants"],["stretchVariants","defaultStretchVariants"]])mo(this,i,t[e]);t.delimiters&&(Object.assign(this.defaultDelimiters,t.delimiters),this.adjustDelimiters(this.defaultDelimiters,Object.keys(t.delimiters),i.sizeN,i.stretchN))}constructor(t=null){this.variant={},this.delimiters={},this.cssFontMap={},this.cssFontPrefix="",this.remapChars={},this.skewIcFactor=.75;const e=this.CLASS;this.options=Yi($i({},e.OPTIONS),t),this.params=Object.assign({},e.defaultParams),this.sizeVariants=[...e.defaultSizeVariants],this.stretchVariants=[...e.defaultStretchVariants],this.defineCssFonts(e.defaultCssFonts),this.cssFamilyPrefix=e.defaultCssFamilyPrefix,this.createVariants(e.defaultVariants),this.defineDelimiters(e.defaultDelimiters),Object.keys(e.defaultChars).forEach((t=>this.defineChars(t,e.defaultChars[t]))),this.defineRemap("accent",e.defaultAccentMap),this.defineRemap("mo",e.defaultMoMap),this.defineRemap("mn",e.defaultMnMap),this.defineDynamicCharacters(e.dynamicFiles),e.dynamicExtensions.forEach((t=>this.defineDynamicCharacters(t.files)))}setOptions(t){$i(this.options,t)}addExtension(t,e=""){const i=this.constructor.JAX.toLowerCase(),s={name:t.name,prefix:e||`[${t.name}-extension]/${i}/dynamic`,files:this.CLASS.defineDynamicFiles(t.ranges,e),sizeN:this.sizeVariants.length,stretchN:this.stretchVariants.length};this.CLASS.dynamicExtensions.set(t.name,s),$i(this.options,t.options||{}),$i(this.params,t.parameters||{}),mo(this,"sizeVariants",t.sizeVariants),mo(this,"stretchVariants",t.stretchVariants),mo(this.constructor,"VariantSmp",t.variantSmp),this.defineCssFonts(mo({cssFonts:{}},"cssFonts",t.cssFonts)),this.createVariants(mo({variants:[]},"variants",t.variants)),t.delimiters&&(this.defineDelimiters(mo({delimiters:{}},"delimiters",t.delimiters)),this.CLASS.adjustDelimiters(this.delimiters,Object.keys(t.delimiters),s.sizeN,s.stretchN));for(const e of Object.keys(t.chars||{}))this.defineChars(e,t.chars[e]);return this.defineRemap("accent",t.accentMap),this.defineRemap("mo",t.moMap),this.defineRemap("mn",t.mnMap),t.ranges&&this.defineDynamicCharacters(s.files),[]}get styles(){return this._styles}set styles(t){this._styles=t}createVariant(t,e=null,i=null){const s={linked:[],chars:Object.create(e?this.variant[e].chars:{})};this.variant[i]&&(Object.assign(s.chars,this.variant[i].chars),this.variant[i].linked.push(s.chars),s.chars=Object.create(s.chars)),this.remapSmpChars(s.chars,t),this.variant[t]=s}remapSmpChars(t,e){const i=this.CLASS;let s=i.VariantSmp[e];if("string"==typeof s&&(s=i.VariantSmp[s]),!s)return;const r=i.SmpRemap,n=[null,null,i.SmpRemapGreekU,i.SmpRemapGreekL];for(const[e,o,a]of i.SmpRanges){const i=s[e];if(i){for(let e=o;e<=a;e++){if(930===e)continue;const s=i+e-o;t[e]=this.smpChar(r[s]||s)}if(n[e])for(const s of Object.keys(n[e]).map((t=>parseInt(t))))t[s]=this.smpChar(i+n[e][s])}}const o=s[5]||{};for(const e of Object.keys(o))t[e]=this.smpChar(s[5][e])}smpChar(t){return[,,,{smp:t}]}createVariants(t){for(const e of t)this.createVariant(e[0],e[1],e[2])}defineChars(t,e){const i=this.variant[t];Object.assign(i.chars,e);for(const t of i.linked)Object.assign(t,e)}defineCssFonts(t){Object.assign(this.cssFontMap,t);for(const e of Object.keys(t))"unknown"===this.cssFontMap[e][0]&&(this.cssFontMap[e][0]=this.options.unknownFamily)}defineDelimiters(t){Object.assign(this.delimiters,t)}defineRemap(t,e){e&&(Object.hasOwn(this.remapChars,t)||(this.remapChars[t]={}),Object.assign(this.remapChars[t],e))}defineDynamicCharacters(t){for(const e of Object.keys(t)){const i=t[e];for(const t of Object.keys(i.variants))this.defineChars(t,this.flattenRanges(i.variants[t],i));this.defineDelimiters(this.flattenRanges(i.delimiters,i))}}flattenRanges(t,e){const i={};for(const s of t)if(Array.isArray(s))for(let t=s[0];t<=s[1];t++)i[t]=e;else i[s]=e;return i}dynamicFileName(t){const e=t.extension?this.CLASS.dynamicExtensions.get(t.extension).prefix:this.options.dynamicPrefix;return t.file.match(/^(?:[/[]|[a-z]+:\/\/|[a-z]:)/i)?t.file:e+"/"+t.file.replace(/(\.js)?$/,".js")}loadDynamicFile(t){return uo(this,void 0,void 0,(function*(){return t.failed?Promise.reject(new Error(`dynamic file '${t.file}' failed to load`)):(t.promise||(t.promise=Cn(this.dynamicFileName(t)).catch((e=>{t.failed=!0,console.warn(e)}))),t.promise.then((()=>t.setup(this))))}))}loadDynamicFiles(){const t=this.CLASS.dynamicFiles,e=Object.keys(t).map((e=>this.loadDynamicFile(t[e])));for(const t of this.CLASS.dynamicExtensions.values())e.push(...Object.keys(t.files).map((e=>this.loadDynamicFile(t.files[e]))));return Promise.all(e)}loadDynamicFilesSync(){if(!mn.asyncIsSynchronous)throw Error("MathJax(loadDynamicFilesSync): mathjax.asyncLoad must be specified and synchronous\n Try importing #js/../components/require.mjs and #js/util/asyncLoad/node.js");const t=this.CLASS.dynamicFiles;Object.keys(t).forEach((e=>this.loadDynamicFileSync(t[e])));for(const t of this.CLASS.dynamicExtensions.values())Object.keys(t.files).forEach((e=>this.loadDynamicFileSync(t.files[e])))}loadDynamicFileSync(t){if(!t.promise){t.promise=Promise.resolve();try{mn.asyncLoad(this.dynamicFileName(t))}catch(e){t.failed=!0,console.warn(e)}t.setup(this)}}addDynamicFontCss(t,e){}getDelimiter(t){const e=this.delimiters[t];return e&&!("dir"in e)?(this.delimiters[t]=null,Jr(this.loadDynamicFile(e)),null):e}getSizeVariant(t,e){const i=this.getDelimiter(t);return i&&i.variants&&(e=i.variants[e]),this.sizeVariants[e]}getStretchVariant(t,e){const i=this.getDelimiter(t);return this.stretchVariants[i.stretchv?i.stretchv[e]:0]}getStretchVariants(t){return[0,1,2,3].map((e=>this.getStretchVariant(t,e)))}getChar(t,e){const i=this.variant[t].chars[e];if(i&&!Array.isArray(i)){const s=this.variant[t];return delete s.chars[e],s.linked.forEach((t=>delete t[e])),Jr(this.loadDynamicFile(i)),null}return i}getVariant(t){return this.variant[t]}getCssFont(t){return this.cssFontMap[t]||["serif",!1,!1]}getFamily(t){return this.cssFamilyPrefix?this.cssFamilyPrefix+", "+t:t}getRemappedChar(t,e){return(this.remapChars[t]||{})[e]}}fo.OPTIONS={unknownFamily:"serif",dynamicPrefix:"."},fo.JAX="common",fo.NAME="",fo.defaultVariants=[["normal"],["bold","normal"],["italic","normal"],["bold-italic","italic","bold"],["double-struck","bold"],["fraktur","normal"],["bold-fraktur","bold","fraktur"],["script","italic"],["bold-script","bold-italic","script"],["sans-serif","normal"],["bold-sans-serif","bold","sans-serif"],["sans-serif-italic","italic","sans-serif"],["sans-serif-bold-italic","bold-italic","bold-sans-serif"],["monospace","normal"],["-smallop","normal"],["-largeop","normal"],["-tex-calligraphic","italic"],["-tex-bold-calligraphic","bold-italic"],["-tex-oldstyle","normal"],["-tex-bold-oldstyle","bold"],["-tex-mathit","italic"],["-tex-variant","normal"]],fo.defaultCssFonts={normal:["unknown",!1,!1],bold:["unknown",!1,!0],italic:["unknown",!0,!1],"bold-italic":["unknown",!0,!0],"double-struck":["unknown",!1,!0],fraktur:["unknown",!1,!1],"bold-fraktur":["unknown",!1,!0],script:["cursive",!1,!1],"bold-script":["cursive",!1,!0],"sans-serif":["sans-serif",!1,!1],"bold-sans-serif":["sans-serif",!1,!0],"sans-serif-italic":["sans-serif",!0,!1],"sans-serif-bold-italic":["sans-serif",!0,!0],monospace:["monospace",!1,!1],"-smallop":["unknown",!1,!1],"-largeop":["unknown",!1,!1],"-tex-calligraphic":["cursive",!0,!1],"-tex-bold-calligraphic":["cursive",!0,!0],"-tex-oldstyle":["unknown",!1,!1],"-tex-bold-oldstyle":["unknown",!1,!0],"-tex-mathit":["unknown",!0,!1],"-tex-variant":["unknown",!1,!1]},fo.defaultCssFamilyPrefix="",fo.VariantSmp={bold:[119808,119834,120488,120514,120782,{988:120778,989:120779}],italic:[119860,119886,120546,120572],"bold-italic":[119912,119938,120604,120630],script:[119964,119990],"bold-script":[120016,120042],fraktur:[120068,120094],"double-struck":[120120,120146,,,120792],"bold-fraktur":[120172,120198],"sans-serif":[120224,120250,,,120802],"bold-sans-serif":[120276,120302,120662,120688,120812],"sans-serif-italic":[120328,120354],"sans-serif-bold-italic":[120380,120406,120720,120746],monospace:[120432,120458,,,120822]},fo.SmpRanges=[[0,65,90],[1,97,122],[2,913,937],[3,945,969],[4,48,57]],fo.SmpRemap={119893:8462,119965:8492,119968:8496,119969:8497,119971:8459,119972:8464,119975:8466,119976:8499,119981:8475,119994:8495,119996:8458,120004:8500,120070:8493,120075:8460,120076:8465,120085:8476,120093:8488,120122:8450,120127:8461,120133:8469,120135:8473,120136:8474,120137:8477,120145:8484},fo.SmpRemapGreekU={8711:25,1012:17},fo.SmpRemapGreekL={977:27,981:29,982:31,1008:28,1009:30,1013:26,8706:25},fo.defaultAccentMap={94:"\u02c6",126:"\u02dc",768:"\u02cb",769:"\u02ca",770:"\u02c6",771:"\u02dc",772:"\u02c9",774:"\u02d8",775:"\u02d9",776:"\xa8",778:"\u02da",780:"\u02c7",8594:"\u20d7"},fo.defaultMoMap={45:"\u2212"},fo.defaultMnMap={45:"\u2212"},fo.defaultParams={x_height:.442,quad:1,num1:.676,num2:.394,num3:.444,denom1:.686,denom2:.345,sup1:.413,sup2:.363,sup3:.289,sub1:.15,sub2:.247,sup_drop:.386,sub_drop:.05,delim1:2.39,delim2:1,axis_height:.25,rule_thickness:.06,big_op_spacing1:.111,big_op_spacing2:.167,big_op_spacing3:.2,big_op_spacing4:.6,big_op_spacing5:.1,surd_height:.06,scriptspace:.05,nulldelimiterspace:.12,delimiterfactor:901,delimitershortfall:.3,rule_factor:1.25,min_rule_thickness:1.25,separation_factor:1.75,extra_ic:.033,extender_factor:.333},fo.defaultDelimiters={},fo.defaultChars={},fo.defaultSizeVariants=[],fo.defaultStretchVariants=[],fo.dynamicFiles={},fo.dynamicExtensions=new Map;class go extends Dn{static from(t,e,i=null){const s=new this;return Object.assign(s,t),s.lineLeading=e,i&&(s.indentData=i),s}constructor(t,e=null){super(t),this.indentData=null,this.isFirst=!1,this.originalL=this.L,e&&(this.start=e)}append(t){this.isFirst&&(t.originalL+=t.L,t.L=0),t.indentData&&(this.indentData=t.indentData),this.lineLeading=t.lineLeading,super.append(t),this.isFirst=t.isFirst}copy(){const t=go.from(this,this.lineLeading);return t.indentData=this.indentData,t.lineLeading=this.lineLeading,t}getIndentData(t){let{indentalign:e,indentshift:i,indentalignfirst:s,indentshiftfirst:r,indentalignlast:n,indentshiftlast:o}=t.attributes.getAllAttributes();"indentalign"===s&&(s=t.attributes.getInherited("indentalign")),"indentshift"===r&&(r=t.attributes.getInherited("indentshift")),"indentalign"===n&&(n=e),"indentshift"===o&&(o=i),this.indentData=[[s,r],[e,i],[n,o]]}copyIndentData(t){return t.indentData.map((([t,e])=>[t,e]))}}const bo=1e6;class Eo extends an{breakToWidth(t,e){}}class xo extends Eo{constructor(){super(...arguments),this.PENALTY={newline:t=>0,nobreak:t=>bo,goodbreak:t=>t-200*this.state.depth,badbreak:t=>t+200*this.state.depth,auto:t=>t},this.FACTORS={depth:t=>t+800*this.state.depth,width:t=>t+Math.floor((this.state.width-this.state.w)/this.state.width*2500),tail:t=>t+Math.floor(this.state.width/Math.max(1e-4,this.state.mathLeft-this.state.w)*500),open:(t,e)=>{const i=e.node.prevClass;if(i===Is.BIN||i===Is.REL||i===Is.OP)return t+5e3;const s=this.getPrevious(e);if(s&&("postfix"!==s.attributes.get("form")||"nobreak"===s.attributes.get("linebreak")))return t+5e3;const r=e.node.Parent;if((null==r?void 0:r.isKind("mmultiscripts"))&&e.node===this.getFirstToken(r)){if(!!r.childNodes.filter((t=>t.isKind("mprescripts"))).length)return bo}return t-500},close:(t,e)=>{var i;const s=e.node.Parent;return!(null==s?void 0:s.isKind("msubsup"))||s.isKind("mmultiscripts")&&(null===(i=s.childNodes[1])||void 0===i?void 0:i.isKind("mprescripts"))||e.node!==this.getLastToken(s.childNodes[0])?t+500:bo},space:(t,e)=>{const i=e;if(!i.canBreak)return bo;const s=i.getBBox().w;return s<0?bo:s<1?t:t-100*(s+4)},separator:t=>t+500,fuzz:t=>.99*t},this.TEXCLASS={[Is.BIN]:t=>t-250,[Is.REL]:t=>t-500}}breakToWidth(t,e){const i=this.state;this.state=this.createState(t),this.state.width=e;const s=t.breakCount;for(let i=0;i<=s;i++){(t.lineBBox[i]||t.getLineBBox(i)).w>e&&this.breakLineToWidth(t,i)}for(const[t,e]of this.state.breaks){if(null===e){const e=t.coreMO();e.setBreakStyle(e.node.attributes.get("linebreakstyle")||"before")}else t.setBreakAt(e);t.invalidateBBox()}this.state=i}createState(t){const e=t.getBBox().w;return{breaks:new Set,potential:[],width:0,w:0,prevWidth:0,prevBreak:null,depth:0,mathWidth:e,mathLeft:e}}breakLineToWidth(t,e){const i=this.state;i.potential=[],i.w=0,i.prevWidth=0,i.prevBreak=null,i.depth=0,this.visitNode(t,e)}addWidth(t,e=null){null===e&&(e=t.L+t.w+t.R),e&&(e*=t.rscale,this.state.w+=e,this.state.potential.length&&(this.state.potential[0][4]+=e),this.processBreak())}processBreak(){const t=this.state;for(;t.potential.length&&t.w>this.state.width;){const e=t.potential.pop(),[i,,s,r,n]=e;t.breaks.add(i),t.w=t.potential.reduce(((t,e)=>t+e[4]),r+n),t.prevBreak&&t.prevWidth+s<=t.width?(t.breaks.delete(t.prevBreak[0]),t.prevWidth+=s):t.prevWidth=s+r,t.potential.forEach((t=>t[2]-=s)),t.prevBreak=e,t.mathLeft-=s}}pushBreak(t,e,i,s){var r;const n=this.state;if(!(e>=bo||0===n.w&&0===n.prevWidth)){for(;n.potential.length&&n.potential[0][1]>this.FACTORS.fuzz(e);){const t=n.potential.shift();n.potential.length&&(n.potential[0][4]+=t[4])}n.potential.unshift([[t,s],e,n.w-((null===(r=n.prevBreak)||void 0===r?void 0:r[3])||0),i,0])}}getBorderLR(t){var e;const i=t.styleData;if(!i)return[0,0];const s=(null===(e=null==i?void 0:i.border)||void 0===e?void 0:e.width)||[0,0,0,0],r=(null==i?void 0:i.padding)||[0,0,0,0];return[s[3]+r[3],s[1]+r[1]]}getFirstToken(t){return t.isToken?t:this.getFirstToken(t.childNodes[0])}getLastToken(t){return t.isToken?t:this.getLastToken(t.childNodes[t.childNodes.length-1])}visitNode(t,e){t&&(this.state.depth++,t.node.isEmbellished&&!t.node.isKind("mo")?this.visitEmbellishedOperator(t,e):super.visitNode(t,e),this.state.depth--)}visitDefault(t,e){var i;const s=t.getLineBBox(e);if(t.node.isToken||t.node.linebreakContainer||!(null===(i=t.childNodes)||void 0===i?void 0:i[0]))this.addWidth(s);else{const[i,r]=this.getBorderLR(t);0===e&&this.addWidth(s,s.L+i),this.visitNode(t.childNodes[0],e),e===t.breakCount&&this.addWidth(s,s.R+r)}}visitEmbellishedOperator(t,e){const i=t.coreMO(),s=go.from(t.getOuterBBox(),t.linebreakOptions.lineleading);s.getIndentData(i.node);const r=i.getBreakStyle(i.node.attributes.get("linebreakstyle")),n=i.processIndent("",s.indentData[1][1],"",s.indentData[0][1],this.state.width)[1],o=this.moPenalty(i);if("before"===r)this.pushBreak(t,o,n-s.L,null),this.addWidth(s);else{this.addWidth(s);const e=("after"===r?0:i.multChar?i.multChar.getBBox().w:s.w)+n;this.pushBreak(t,o,e,null)}}visitMoNode(t,e){const i=t,s=go.from(i.getOuterBBox(),i.linebreakOptions.lineleading);s.getIndentData(i.node);const r=i.getBreakStyle(i.node.attributes.get("linebreakstyle")),n=i.processIndent("",s.indentData[1][1],"",s.indentData[0][1],this.state.width)[1],o=this.moPenalty(i);if("before"===r)this.pushBreak(t,o,n-s.L,null),this.addWidth(s);else{this.addWidth(s);const e=("after"===r?0:i.multChar?i.multChar.getBBox().w:s.w)+n;this.pushBreak(t,o,e,null)}}moPenalty(t){const{linebreak:e,fence:i,form:s}=t.node.attributes.getList("linebreak","fence","form"),r=this.FACTORS;let n=r.tail(r.width(0));const o=i&&"prefix"===s||t.node.texClass===Is.OPEN,a=i&&"postfix"===s||t.node.texClass===Is.CLOSE;return o&&(n=r.open(n,t),this.state.depth++),a&&(n=r.close(n,t),this.state.depth--),n=(this.TEXCLASS[t.node.texClass]||(t=>t))(n),(this.PENALTY[e]||(t=>t))(r.depth(n))}getPrevious(t){let e=t.node,i=e.parent,s=i.childIndex(e);for(;i&&(i.notParent||i.isKind("mrow"))&&0===s;)e=i,i=e.parent,s=i.childIndex(e);if(!i||!s)return null;const r=i.childNodes[s-1];return r.isEmbellished?r.coreMO():null}visitMspaceNode(t,e){const i=t.getLineBBox(e),s=t;if(s.canBreak){const e=this.mspacePenalty(s);i.getIndentData(t.node);const r=t.processIndent("",i.indentData[1][1],"",i.indentData[0][1],this.state.width)[1];this.pushBreak(t,e,r-i.w,null)}this.addWidth(i)}mspacePenalty(t){const e=t.node.attributes.get("linebreak"),i=this.FACTORS,s=i.space(i.tail(i.width(0)),t);return(this.PENALTY[e]||(t=>t))(i.depth(s))}visitMtextNode(t,e){if(!t.getText().match(/ /))return void this.visitDefault(t,e);const i=t;i.clearBreakPoints();const s=i.textWidth(" "),r=t.getBBox(),[n,o]=this.getBorderLR(t);this.addWidth(r,r.L+n);const a=i.childNodes;for(const e of a.keys()){const n=a[e];if(n.node.isKind("text")){const o=n.node.getText().split(/ /),a=o.pop();for(const n of o.keys())this.addWidth(r,i.textWidth(o[n])),this.pushBreak(t,this.mtextPenalty(),-s,[e,n+1]),this.addWidth(r,s);this.addWidth(r,i.textWidth(a))}else this.addWidth(n.getBBox())}this.addWidth(r,r.R+o)}mtextPenalty(){const t=this.FACTORS;return t.depth(t.tail(t.width(0)))}visitMrowNode(t,e){const i=t.lineBBox[e]||t.getLineBBox(e),[s,r]=i.start||[0,0],[n,o]=i.end||[t.childNodes.length-1,0],[a,l]=this.getBorderLR(t);this.addWidth(i,i.L+a);for(let e=s;e<=n;e++)this.visitNode(t.childNodes[e],e===s?r:e===n?o:0);this.addWidth(i,i.R+l)}visitInferredMrowNode(t,e){this.state.depth--,this.visitMrowNode(t,e),this.state.depth++}visitMfracNode(t,e){const i=t;!i.node.attributes.get("bevelled")&&i.getOuterBBox().w>this.state.width&&(this.breakToWidth(i.childNodes[0],this.state.width),this.breakToWidth(i.childNodes[1],this.state.width)),this.visitDefault(t,e)}visitMsqrtNode(t,e){if(t.getOuterBBox().w>this.state.width){const e=t,i=e.childNodes[e.base];this.breakToWidth(i,this.state.width-e.rootWidth()),e.getStretchedSurd()}this.visitDefault(t,e)}visitMrootNode(t,e){this.visitMsqrtNode(t,e)}visitMsubNode(t,e){this.visitDefault(t,e);const i=t,s=i.getOffset()[0],r=i.scriptChild.getOuterBBox(),[n,o]=this.getBorderLR(t);this.addWidth(i.getLineBBox(e),s+n+r.rscale*r.w+i.font.params.scriptspace+o)}visitMsupNode(t,e){this.visitDefault(t,e);const i=t,s=i.getOffset()[0],r=i.scriptChild.getOuterBBox(),[n,o]=this.getBorderLR(t);this.addWidth(i.getLineBBox(e),s+n+r.rscale*r.w+i.font.params.scriptspace+o)}visitMsubsupNode(t,e){this.visitDefault(t,e);const i=t,s=i.subChild.getOuterBBox(),r=i.supChild.getOuterBBox(),n=i.getAdjustedIc(),o=Math.max(s.rscale*s.w,n+r.rscale*r.w)+i.font.params.scriptspace,[a,l]=this.getBorderLR(t);this.addWidth(t.getLineBBox(e),a+o+l)}visitMmultiscriptsNode(t,e){const i=t,s=i.scriptData;if(s.numPrescripts){const r=Math.max(s.psup.rscale*s.psup.w,s.psub.rscale*s.psub.w);this.addWidth(t.getLineBBox(e),r+i.font.params.scriptspace)}if(this.visitDefault(t,e),s.numScripts){const r=Math.max(s.sup.rscale*s.sup.w,s.sub.rscale*s.sub.w);this.addWidth(t.getLineBBox(e),r+i.font.params.scriptspace)}}visitMfencedNode(t,e){const i=t,s=t.getLineBBox(e),[r,n]=this.getBorderLR(t);0===e&&this.addWidth(s,s.L+r),this.visitNode(i.mrow,e),e===t.breakCount&&this.addWidth(s,s.R+n)}visitMactionNode(t,e){const i=t,s=t.getLineBBox(e),[r,n]=this.getBorderLR(t);0===e&&this.addWidth(s,s.L+r),this.visitNode(i.selected,e),e===t.breakCount&&this.addWidth(s,s.R+n)}}!function(){for(const t of Object.keys($s.postfix)){const e=$s.postfix[t][3];e&&e.fence&&(e.linebreakstyle="after")}$s.infix["\u2061"]=[...$s.infix["\u2061"]],$s.infix["\u2061"][3]={linebreak:"nobreak"}}();const yo="@mathjax/%%FONT%%-font";class No extends ms{get forceInlineBreaks(){return!1}constructor(t={},e=null,i=null){const[s,r]=t.fontData instanceof fo?[t.fontData.constructor,t.fontData]:[t.fontData||i,null],[n,o]=ts(t,s.OPTIONS);super(n),this.factory=this.options.wrapperFactory||new e,this.factory.jax=this,this.styleJson=this.options.styleJson||new Nn,this.font=r||new s(o),this.font.setOptions({mathmlSpacing:this.options.mathmlSpacing}),this.constructor.genericFont=s,this.unknownCache=new Map;const a=this.options.linebreaks.LinebreakVisitor||xo;this.linebreaks=new a(this.factory)}setAdaptor(t){super.setAdaptor(t),"auto"===this.options.htmlHDW&&(this.options.htmlHDW=t.canMeasureNodes?"ignore":"force")}addExtension(t,e=""){return this.font.addExtension(t,e)}typeset(t,e){const i=this.constructor,s=i.genericFont;i.genericFont=this.font.constructor,this.setDocument(e);const r=this.createNode();try{this.toDOM(t,r,e)}finally{i.genericFont=s}return r}createNode(){const t=this.constructor.NAME;return this.html("mjx-container",{class:"MathJax",jax:t})}setScale(t,e){let i=this.getInitialScale()*this.options.scale;if("scale"===e.node.attributes.get("overflow")&&this.math.display){const t=e.getOuterBBox().w,s=Math.max(0,this.math.metrics.containerWidth-4)/this.pxPerEm;t>s&&t&&(i*=s/t)}1!==i&&this.adaptor.setStyle(t,"fontSize",On(i))}getInitialScale(){return this.math.metrics.scale}toDOM(t,e,i=null){var s;this.setDocument(i),this.math=t,this.container=e,this.pxPerEm=t.metrics.ex/this.font.params.x_height,this.executeFilters(this.preFilters,t,i,e),this.nodeMap=new Map,t.root.attributes.getAllInherited().overflow=this.options.displayOverflow;const r=t.root.attributes.get("overflow");this.adaptor.setAttribute(e,"overflow",r);"linebreak"===r&&this.getLinebreakWidth();const n=this.options.linebreaks.inline&&!t.display;let o=!!t.root.getProperty("inlineMarked");!o||n&&this.forceInlineBreaks===t.root.getProperty("inlineForced")||(this.unmarkInlineBreaks(t.root),t.root.removeProperty("inlineMarked"),t.root.removeProperty("inlineForced"),o=!1),n&&!o&&(this.markInlineBreaks(null===(s=t.root.childNodes)||void 0===s?void 0:s[0]),t.root.setProperty("inlineMarked",!0),t.root.setProperty("inlineForced",this.forceInlineBreaks)),t.root.setTeXclass(null);const a=this.factory.wrap(t.root);this.setScale(e,a),this.processMath(a,e),this.nodeMap=null,this.executeFilters(this.postFilters,t,i,e)}getBBox(t,e){this.setDocument(e),this.math=t,t.root.setTeXclass(null),this.nodeMap=new Map;const i=this.factory.wrap(t.root).getOuterBBox();return this.nodeMap=null,i}getLinebreakWidth(){const t=this.math.metrics.containerWidth/this.pxPerEm,e=this.math.root.attributes.get("maxwidth")||this.options.linebreaks.width;this.containerWidth=An(e,t,1,this.pxPerEm)}markInlineBreaks(t){if(!t)return;const e=this.forceInlineBreaks;let i=!1,s=!1,r="";for(const n of t.childNodes)if(r)s=this.markInlineBreak(s,e,r,t,n),r="",i=!1;else if(n.isEmbellished){if(n===t.childNodes[0])continue;const o=n.coreMO(),a=o.texClass,l=o.attributes.get("linebreak"),c=o.attributes.get("linebreakstyle");(a===Is.BIN||a===Is.REL||a===Is.ORD&&o.hasSpacingAttributes()||"auto"!==l)&&"nobreak"!==l&&("before"===c?i&&"auto"===l||(s=this.markInlineBreak(s,e,l,t,n,o)):r=l),i="newline"===l&&"after"===c}else if(n.isKind("mspace")){const r=n.attributes.get("linebreak");"nobreak"!==r&&n.canBreak&&(s=this.markInlineBreak(s,e,r,t,n)),i="newline"===r}else i=!1,n.isKind("mstyle")&&!n.attributes.get("style")&&!n.attributes.hasExplicit("mathbackground")||n.isKind("semantics")?(this.markInlineBreaks(n.childNodes[0]),n.getProperty("process-breaks")&&(n.setProperty("inline-breaks",!0),n.childNodes[0].setProperty("inline-breaks",!0),t.parent.setProperty("process-breaks","true"))):n.isKind("mrow")&&n.attributes.get("data-semantic-added")&&(this.markInlineBreaks(n),n.getProperty("process-breaks")&&(n.setProperty("inline-breaks",!0),t.parent.setProperty("process-breaks","true")))}markInlineBreak(t,e,i,s,r,n=null){return r.setProperty("breakable",!0),e&&"newline"!==i?(r.setProperty("forcebreak",!0),null==n||n.setProperty("forcebreak",!0)):(r.removeProperty("forcebreak"),null==n||n.removeProperty("forcebreak"),"newline"===i&&r.setProperty("newline",!0)),t||(s.setProperty("process-breaks",!0),s.parent.setProperty("process-breaks",!0),t=!0),t}unmarkInlineBreaks(t){if(t&&(t.removeProperty("forcebreak"),t.removeProperty("breakable"),t.getProperty("process-breaks"))){t.removeProperty("process-breaks");for(const e of t.childNodes)this.unmarkInlineBreaks(e)}}getMetrics(t){this.setDocument(t);const e=this.adaptor,i=this.getMetricMaps(t);for(const s of t.math){const t=e.parent(s.start.node);if(s.state()<Ns.METRICS&&t){const e=i[s.display?1:0],{em:r,ex:n,containerWidth:o,scale:a,family:l}=e.get(t);s.setMetrics(r,n,o,a),this.options.mtextInheritFont&&(s.outputData.mtextFamily=l),this.options.merrorInheritFont&&(s.outputData.merrorFamily=l),s.state(Ns.METRICS)}}}getMetricsFor(t,e){const i=this.options.mtextInheritFont||this.options.merrorInheritFont,s=this.getTestElement(t,e),r=Object.assign(Object.assign({},this.measureMetrics(s,i)),{display:e});return this.adaptor.remove(s),r}getMetricMaps(t){const e=this.adaptor,i=[new Map,new Map];for(const s of t.math){const t=e.parent(s.start.node);if(t&&s.state()<Ns.METRICS){const e=i[s.display?1:0];e.has(t)||e.set(t,this.getTestElement(t,s.display))}}const s=this.options.mtextInheritFont||this.options.merrorInheritFont,r=[new Map,new Map];for(const t of r.keys())for(const e of i[t].keys())r[t].set(e,this.measureMetrics(i[t].get(e),s));for(const t of r.keys())for(const s of i[t].values())e.remove(s);return r}getTestElement(t,e){const i=this.adaptor;if(!this.testInline){this.testInline=this.html("mjx-test",{style:{display:"inline-block",width:"100%","font-style":"normal","font-weight":"normal","font-size":"100%","font-size-adjust":"none","text-indent":0,"text-transform":"none","letter-spacing":"normal","word-spacing":"normal",overflow:"hidden",height:"1px","margin-right":"-1px"}},[this.html("mjx-left-box",{style:{display:"inline-block",width:0,float:"left"}}),this.html("mjx-ex-box",{style:{position:"absolute",overflow:"hidden",width:"1px",height:"60ex"}}),this.html("mjx-right-box",{style:{display:"inline-block",width:0,float:"right"}})]),this.testDisplay=i.clone(this.testInline),i.setStyle(this.testDisplay,"display","table"),i.setStyle(this.testDisplay,"margin-right",""),i.setStyle(i.firstChild(this.testDisplay),"display","none");const t=i.lastChild(this.testDisplay);i.setStyle(t,"display","table-cell"),i.setStyle(t,"width","10000em"),i.setStyle(t,"float","")}return i.append(t,i.clone(e?this.testDisplay:this.testInline))}measureMetrics(t,e){const i=this.adaptor,s=e?i.fontFamily(t):"",r=i.fontSize(t),[n,o]=i.nodeSize(i.childNode(t,1)),a=n?o/60:r*this.options.exFactor;return{em:r,ex:a,containerWidth:n?"table"===i.getStyle(t,"display")?i.nodeSize(i.lastChild(t))[0]-1:i.nodeBBox(i.lastChild(t)).left-i.nodeBBox(i.firstChild(t)).left-2:1e6,scale:Math.max(this.options.minScale,this.options.matchFontHeight?a/this.font.params.x_height/r:1),family:s}}styleSheet(t){if(this.setDocument(t),this.styleJson.clear(),this.styleJson.addStyles(this.constructor.commonStyles),"getStyles"in t)for(const e of t.getStyles())this.styleJson.addStyles(e);this.addWrapperStyles(this.styleJson),this.addFontStyles(this.styleJson);return this.html("style",{id:"MJX-styles"},[this.text("\n"+this.styleJson.cssText+"\n")])}addFontStyles(t){t.addStyles(this.font.styles)}addWrapperStyles(t){for(const e of this.factory.getKinds())this.addClassStyles(this.factory.getNodeClass(e),t)}addClassStyles(t,e){t.addStyles(e,this)}insertStyles(t){}setDocument(t){t&&(this.document=t,this.adaptor.document=t.document)}html(t,e={},i=[],s){return this.adaptor.node(t,e,i,s)}text(t){return this.adaptor.text(t)}fixed(t,e=3){return Math.abs(t)<6e-4?"0":t.toFixed(e).replace(/\.?0+$/,"")}measureText(t,e,i=["",!1,!1]){const s=this.unknownText(t,e);if("-explicitFont"===e){const t=this.cssFontStyles(i);this.adaptor.setAttributes(s,{style:t})}return this.measureTextNodeWithCache(s,t,e,i)}measureTextNodeWithCache(t,e,i,s=["",!1,!1]){"-explicitFont"===i&&(i=[s[0],s[1]?"T":"F",s[2]?"T":"F",""].join("-")),this.unknownCache.has(i)||this.unknownCache.set(i,new Map);const r=this.unknownCache.get(i),n=r.get(e);if(n)return n;const o=this.measureTextNode(t);return r.set(e,o),o}cssFontStyles(t,e={}){const[i,s,r]=t;return e["font-family"]=this.font.getFamily(i),s&&(e["font-style"]="italic"),r&&(e["font-weight"]="bold"),e}getFontData(t){return t||(t=new eo),[this.font.getFamily(t.get("font-family")),"italic"===t.get("font-style"),"bold"===t.get("font-weight")]}}No.NAME="Common",No.OPTIONS=Object.assign(Object.assign({},ms.OPTIONS),{scale:1,minScale:.5,mtextInheritFont:!1,merrorInheritFont:!1,mtextFont:"",merrorFont:"serif",mathmlSpacing:!1,skipAttributes:{},exFactor:.5,displayAlign:"center",displayIndent:"0",displayOverflow:"overflow",linebreaks:{inline:!0,width:"100%",lineleading:.2,LinebreakVisitor:null},font:"",fontExtensions:[],htmlHDW:"auto",wrapperFactory:null,fontData:null,fontPath:yo,styleJson:null}),No.commonStyles={'mjx-container[overflow="scroll"][display]':{overflow:"auto clip","min-width":"initial !important"},'mjx-container[overflow="truncate"][display]':{overflow:"hidden clip","min-width":"initial !important"},"mjx-container[display]":{display:"block","text-align":"center","justify-content":"center",margin:".7em 0",padding:".3em 2px"},'mjx-container[display][width="full"]':{display:"flex"},'mjx-container[justify="left"]':{"text-align":"left","justify-content":"left"},'mjx-container[justify="right"]':{"text-align":"right","justify-content":"right"}};class vo extends pn{constructor(){super(...arguments),this.jax=null}get Wrappers(){return this.node}}vo.defaultNodes={};const To=2/18,_o=5/18;function Lo(t,e,i){return e?t?To:_o:t?i<To?0:To:i}const Co={[Mn(0)]:"0",[Mn(2/18)]:"1",[Mn(3/18)]:"2",[Mn(4/18)]:"3",[Mn(5/18)]:"4",[Mn(6/18)]:"5"};class Ro extends un{static addStyles(t,e){t.addStyles(this.styles)}get jax(){return this.factory.jax}get adaptor(){return this.factory.jax.adaptor}get metrics(){return this.factory.jax.math.metrics}get containerWidth(){return this.parent?this.parent.containerWidth:this.jax.containerWidth}get linebreaks(){return this.jax.linebreaks}get linebreakOptions(){return this.jax.options.linebreaks}get fixesPWidth(){return!this.node.notParent&&!this.node.isToken}get breakCount(){if(this._breakCount<0){const t=this.node;this._breakCount=t.isEmbellished?this.coreMO().embellishedBreakCount:t.arity<0&&!t.linebreakContainer&&this.childNodes[0].isStack?this.childNodes[0].breakCount:0}return this._breakCount}breakTop(t,e){return this.node.linebreakContainer||!this.parent?t:this.parent.breakTop(t,this)}constructor(t,e,i=null){super(t,e),this.parent=null,this.dom=null,this.removedStyles=null,this.styles=null,this.styleData=null,this.variant="",this.bboxComputed=!1,this._breakCount=-1,this.lineBBox=[],this.stretch=po,this.font=null,this.parent=i,this.font=t.jax.font,this.bbox=Dn.zero(),this.getStyles(),this.getStyleData(),this.getVariant(),this.getScale(),this.getSpace(),this.childNodes=e.childNodes.map((t=>{const i=this.wrap(t);return i.bbox.pwidth&&(e.notParent||e.isKind("math"))&&(this.bbox.pwidth=Dn.fullWidth),i}))}wrap(t,e=null){const i=this.factory.wrap(t,e||this);return e&&e.childNodes.push(i),this.jax.nodeMap.set(t,i),i}getBBox(t=!0){if(this.bboxComputed)return this.bbox;const e=t?this.bbox:Dn.zero();return this.computeBBox(e),this.bboxComputed=t,e}getOuterBBox(t=!0){var e;const i=this.getBBox(t);if(!this.styleData)return i;const s=this.styleData.padding,r=(null===(e=this.styleData.border)||void 0===e?void 0:e.width)||[0,0,0,0],n=i.copy();for(const[,t,e]of Dn.boxSides)n[e]+=s[t]+r[t];return n}getUnbrokenHD(){const t=this.breakCount+1;let e=0,i=0;for(let s=0;s<t;s++){const{h:t,d:r}=this.getLineBBox(s);t>e&&(e=t),r>i&&(i=r)}return[e,i]}computeBBox(t,e=!1){t.empty();for(const e of this.childNodes)t.append(e.getOuterBBox());t.clean(),this.fixesPWidth&&this.setChildPWidths(e)&&this.computeBBox(t,!0)}getLineBBox(t){if(!this.lineBBox[t]){const e=this.breakCount;if(e){const i=this.embellishedBBox(t)||this.computeLineBBox(t);this.lineBBox[t]=i,0===t&&(!this.node.isKind("mo")&&this.node.isEmbellished?i.originalL=this.getBBox().L:i.L=this.getBBox().L),t===e&&(i.R=this.getBBox().R)}else{const e=this.getOuterBBox();this.lineBBox[t]=go.from(e,this.linebreakOptions.lineleading)}}return this.lineBBox[t]}embellishedBBox(t){if(!this.node.isEmbellished||this.node.isKind("mo"))return null;const e=this.coreMO();return e.moLineBBox(t,e.embellishedBreakStyle,this.getOuterBBox())}computeLineBBox(t){return this.getChildLineBBox(this.childNodes[0],t)}getBreakNode(t){var e,i;if(!t.start)return[this,null];const[s,r]=t.start;if(this.node.isEmbellished)return[this,this.coreMO()];const n=(null===(i=null===(e=this.childNodes[0])||void 0===e?void 0:e.node)||void 0===i?void 0:i.isInferred)||this.node.isKind("semantics")?this.childNodes[0].childNodes:this.childNodes;return this.node.isToken||!n[s]?[this,null]:n[s].getBreakNode(n[s].getLineBBox(r))}getChildLineBBox(t,e){const i=this.breakCount;let s=t.getLineBBox(e);return(this.styleData||this.bbox.L||this.bbox.R)&&(s=s.copy()),this.addMiddleBorders(s),0===e?(s.L+=this.bbox.L,this.addLeftBorders(s)):e===i&&(s.R+=this.bbox.R,this.addRightBorders(s)),s}addLeftBorders(t){var e;if(!this.styleData)return;const i=this.styleData.border,s=this.styleData.padding;t.w+=((null===(e=null==i?void 0:i.width)||void 0===e?void 0:e[3])||0)+((null==s?void 0:s[3])||0)}addMiddleBorders(t){var e,i;if(!this.styleData)return;const s=this.styleData.border,r=this.styleData.padding;t.h+=((null===(e=null==s?void 0:s.width)||void 0===e?void 0:e[0])||0)+((null==r?void 0:r[0])||0),t.d+=((null===(i=null==s?void 0:s.width)||void 0===i?void 0:i[2])||0)+((null==r?void 0:r[2])||0)}addRightBorders(t){var e;if(!this.styleData)return;const i=this.styleData.border,s=this.styleData.padding;t.w+=((null===(e=null==i?void 0:i.width)||void 0===e?void 0:e[1])||0)+((null==s?void 0:s[1])||0)}setChildPWidths(t,e=null,i=!0){if(t)return!1;i&&(this.bbox.pwidth="");let s=!1;for(const r of this.childNodes){const n=r.getBBox();n.pwidth&&r.setChildPWidths(t,null===e?n.w:e,i)&&(s=!0)}return s}breakToWidth(t){}invalidateBBox(t=!0){(this.bboxComputed||this._breakCount>=0)&&(this.bboxComputed=!1,this.lineBBox=[],this._breakCount=-1,this.parent&&t&&this.parent.invalidateBBox())}copySkewIC(t){var e,i,s;const r=this.childNodes[0];(null===(e=null==r?void 0:r.bbox)||void 0===e?void 0:e.sk)&&(t.sk=r.bbox.sk),(null===(i=null==r?void 0:r.bbox)||void 0===i?void 0:i.dx)&&(t.dx=r.bbox.dx);const n=this.childNodes[this.childNodes.length-1];(null===(s=null==n?void 0:n.bbox)||void 0===s?void 0:s.ic)&&(t.ic=n.bbox.ic,t.w+=t.ic)}getStyles(){const t=this.node.attributes.getExplicit("style");if(!t)return;const e=this.styles=new eo(t);for(let t=0,i=Ro.removeStyles.length;t<i;t++){const i=Ro.removeStyles[t];e.get(i)&&(this.removedStyles||(this.removedStyles={}),this.removedStyles[i]=e.get(i),e.set(i,""))}}getStyleData(){if(!this.styles)return;const t=Array(4).fill(0),e=Array(4).fill(0),i=Array(4),s=Array(4);let r=!1,n=!1;for(const[o,a]of Dn.boxSides){const l="border"+o,c=this.styles.get(l+"Width");c&&(n=!0,e[a]=Math.max(0,this.length2em(c,1)),i[a]=this.styles.get(l+"Style")||"solid",s[a]=this.styles.get(l+"Color"));const h=this.styles.get("padding"+o);h&&(r=!0,t[a]=Math.max(0,this.length2em(h,1)))}this.styleData=r||n?{padding:t,border:n?{width:e,style:i,color:s}:null}:null}getVariant(){if(!this.node.isToken)return;const t=this.node.attributes;let e=t.get("mathvariant");if(t.hasExplicit("mathvariant"))this.font.getVariant(e)||(console.warn(`Invalid variant: ${e}`),e="normal");else{const i=t.getList("fontfamily","fontweight","fontstyle");if(this.removedStyles){const t=this.removedStyles;t.fontFamily&&(i.family=t.fontFamily),t.fontWeight&&(i.weight=t.fontWeight),t.fontStyle&&(i.style=t.fontStyle)}i.fontfamily&&(i.family=i.fontfamily),i.fontweight&&(i.weight=i.fontweight),i.fontstyle&&(i.style=i.fontstyle),i.weight&&i.weight.match(/^\d+$/)&&(i.weight=parseInt(i.weight)>600?"bold":"normal"),i.family?e=this.explicitVariant(i.family,i.weight,i.style):(this.node.getProperty("variantForm")&&(e="-tex-variant"),e=(Ro.BOLDVARIANTS[i.weight]||{})[e]||e,e=(Ro.ITALICVARIANTS[i.style]||{})[e]||e)}this.variant=e}explicitVariant(t,e,i){let s=this.styles;return s||(s=this.styles=new eo),s.set("fontFamily",t),e&&s.set("fontWeight",e),i&&s.set("fontStyle",i),"-explicitFont"}getScale(){let t=1;const e=this.parent,i=e?e.bbox.scale:1,s=this.node.attributes,r=Math.min(s.get("scriptlevel"),2);let n=s.get("fontsize"),o=this.node.isToken||this.node.isKind("mstyle")?s.get("mathsize"):s.getInherited("mathsize");if(0!==r&&(t=Math.pow(s.get("scriptsizemultiplier"),r)),this.removedStyles&&this.removedStyles.fontSize&&!n&&(n=this.removedStyles.fontSize),n&&!s.hasExplicit("mathsize")&&(o=n),"1"!==o&&(t*=this.length2em(o,1,1)),0!==r){const e=this.length2em(s.get("scriptminsize"),.4,1);t<e&&(t=e)}this.bbox.scale=t,this.bbox.rscale=t/i}getSpace(){const t=this.isTopEmbellished(),e=this.node.hasSpacingAttributes();this.jax.options.mathmlSpacing||e?t&&this.getMathMLSpacing():this.getTeXSpacing(t,e)}getMathMLSpacing(){const t=this.node.coreMO(),e=t.coreParent(),i=e.parent;if(!i||!i.isKind("mrow")||1===i.childNodes.length)return;const s=i.childIndex(e);if(null===s)return;const r=t.getProperty("noDictDef"),n=t.attributes,o=n.get("scriptlevel")>0;if(this.bbox.L=n.isSet("lspace")?Math.max(0,this.length2em(n.get("lspace"))):Lo(o,r,t.lspace),this.bbox.R=n.isSet("rspace")?Math.max(0,this.length2em(n.get("rspace"))):Lo(o,r,t.rspace),!s)return;const a=i.childNodes[s-1];if(!a.isEmbellished)return;const l=this.jax.nodeMap.get(a).getBBox();l.R&&(this.bbox.L=Math.max(0,this.bbox.L-l.R))}getTeXSpacing(t,e){if(!e){const t=this.node.texSpacing();t&&(this.bbox.L=this.length2em(t))}if(t||e){const t=this.node.coreMO().attributes;t.isSet("lspace")&&(this.bbox.L=Math.max(0,this.length2em(t.get("lspace")))),t.isSet("rspace")&&(this.bbox.R=Math.max(0,this.length2em(t.get("rspace"))))}}isTopEmbellished(){return this.node.isEmbellished&&!(this.node.parent&&this.node.parent.isEmbellished)}core(){return this.jax.nodeMap.get(this.node.core())}coreMO(){return this.jax.nodeMap.get(this.node.coreMO())}coreRScale(){let t=this.bbox.rscale,e=this.coreMO();for(;e!==this&&e;)t*=e.bbox.rscale,e=e.parent;return t}getRScale(){let t=1,e=this;for(;e;)t*=e.bbox.rscale,e=e.parent;return t}getText(){let t="";if(this.node.isToken)for(const e of this.node.childNodes)e instanceof Us&&(t+=e.getText());return t}canStretch(t){if(this.stretch=po,this.node.isEmbellished){const e=this.core();e&&e.node!==this.node&&e.canStretch(t)&&(this.stretch=e.stretch)}return this.stretch.dir!==lo.None}getAlignShift(){let{indentalign:t,indentshift:e,indentalignfirst:i,indentshiftfirst:s}=this.node.attributes.getAllAttributes();return"indentalign"!==i&&(t=i),"indentshift"!==s&&(e=s),this.processIndent(t,e)}processIndent(t,e,i="",s="",r=this.metrics.containerWidth){if(!this.jax.math.display)return["left",0];i&&"auto"!==i||(i=this.jax.math.root.getProperty("inlineMarked")?"left":this.jax.options.displayAlign),s&&"auto"!==s||(s=this.jax.math.root.getProperty("inlineMarked")?"0":this.jax.options.displayIndent),"auto"===t&&(t=i),"auto"===e&&(e=s,"right"!==t||e.match(/^\s*0[a-z]*\s*$/)||(e=("-"+e.trim()).replace(/^--/,"")));return[t,this.length2em(e,r)]}getAlignX(t,e,i){return"right"===i?t-(e.w+e.R)*e.rscale:"left"===i?e.L*e.rscale:(t-e.w*e.rscale)/2}getAlignY(t,e,i,s,r){return"top"===r?t-i:"bottom"===r?s-e:"center"===r?(t-i-(e-s))/2:0}getWrapWidth(t){return this.childNodes[t].getBBox().w}getChildAlign(t){return"left"}percent(t){return On(t)}em(t){return Mn(t)}px(t,e=-Rn){return kn(t,e,this.metrics.em)}length2em(t,e=1,i=null){null===i&&(i=this.bbox.scale);const s=this.font.params.rule_thickness,r=es(t,{medium:1,thin:2/3,thick:5/3},0);return r?r*s:An(t,e,i,this.jax.pxPerEm)}unicodeChars(t,e=this.variant){let i=Zs(t);const s=this.font.getVariant(e);if(s&&s.chars){const t=s.chars;i=i.map((e=>{var i,s;return(null===(s=null===(i=t[e])||void 0===i?void 0:i[3])||void 0===s?void 0:s.smp)||e}))}return i}remapChars(t){return t}mmlText(t){return this.node.factory.create("text").setText(t)}mmlNode(t,e={},i=[]){return this.node.factory.create(t,e,i)}createMo(t){const e=this.node.factory,i=e.create("text").setText(t),s=e.create("mo",{stretchy:!0},[i]);s.inheritAttributesFrom(this.node),s.parent=this.node.parent;const r=this.wrap(s);return r.parent=this,r}getVariantChar(t,e){const i=this.font.getChar(t,e)||[0,0,0,{unknown:!0}];return 3===i.length&&(i[3]={}),i}html(t,e={},i=[]){return this.jax.html(t,e,i)}}Ro.kind="unknown",Ro.styles={},Ro.removeStyles=["fontSize","fontFamily","fontWeight","fontStyle","fontVariant","font"],Ro.skipAttributes={fontfamily:!0,fontsize:!0,fontweight:!0,fontstyle:!0,color:!0,background:!0,class:!0,href:!0,style:!0,xmlns:!0},Ro.BOLDVARIANTS={bold:{normal:"bold",italic:"bold-italic",fraktur:"bold-fraktur",script:"bold-script","sans-serif":"bold-sans-serif","sans-serif-italic":"sans-serif-bold-italic"},normal:{bold:"normal","bold-italic":"italic","bold-fraktur":"fraktur","bold-script":"script","bold-sans-serif":"sans-serif","sans-serif-bold-italic":"sans-serif-italic"}},Ro.ITALICVARIANTS={italic:{normal:"italic",bold:"bold-italic","sans-serif":"sans-serif-italic","bold-sans-serif":"sans-serif-bold-italic"},normal:{italic:"normal","bold-italic":"bold","sans-serif-italic":"sans-serif","sans-serif-bold-italic":"bold-sans-serif"}};const wo={"70.7%":"s","70%":"s","50%":"ss","60%":"Tn","85%":"sm","120%":"lg","144%":"Lg","173%":"LG","207%":"hg","249%":"HG"};class Io extends Ro{toCHTML(t){this.toEmbellishedCHTML(t)||this.addChildren(this.standardChtmlNodes(t))}toEmbellishedCHTML(t){if(t.length<=1||!this.node.isEmbellished)return!1;const e=this.adaptor;t.forEach((t=>e.append(t,this.html("mjx-linestrut"))));const i=this.coreMO().embellishedBreakStyle,s=[];for(const[r,n]of[[t[0],"before"],[t[1],"after"]])i!==n?(this.toCHTML([r]),s.push(this.dom[0]),"after"===n&&e.removeAttribute(this.dom[0],"space")):s.push(this.createChtmlNodes([r])[0]);return this.dom=s,!0}addChildren(t){for(const e of this.childNodes)e.toCHTML(t)}standardChtmlNodes(t){this.markUsed();const e=this.createChtmlNodes(t);return this.handleStyles(),this.handleScale(),this.handleBorders(),this.handleColor(),this.handleSpace(),this.handleAttributes(),this.handlePWidth(),e}markUsed(){this.jax.wrapperUsage.add(this.kind)}createChtmlNodes(t){this.dom=t.map((t=>this.html("mjx-"+this.node.kind))),t=this.handleHref(t);for(const e of t.keys())this.adaptor.append(t[e],this.dom[e]);return this.dom}handleHref(t){const e=this.node.attributes.get("href");return e?t.map((t=>this.adaptor.append(t,this.html("a",{href:e})))):t}handleStyles(){if(!this.styles)return;const t=this.styles.cssText;if(t){const e=this.adaptor;this.dom.forEach((i=>e.setAttribute(i,"style",t)));const i=this.styles.get("font-family");i&&this.dom.forEach((t=>e.setStyle(t,"font-family",this.font.cssFamilyPrefix+", "+i)))}}handleScale(){this.dom.forEach((t=>this.setScale(t,this.bbox.rscale)))}setScale(t,e){const i=Math.abs(e-1)<.001?1:e;if(t&&1!==i){const e=this.percent(i);wo[e]?this.adaptor.setAttribute(t,"size",wo[e]):this.adaptor.setStyle(t,"fontSize",e)}return t}handleSpace(){const t=this.adaptor,e=!!this.node.getProperty("breakable")&&!this.node.getProperty("newline"),i=this.dom.length-1;for(const s of[[this.getLineBBox(0).L,"space","marginLeft",0],[this.getLineBBox(i).R,"rspace","marginRight",i]]){const[i,r,n,o]=s,a=this.em(i);if(e&&"space"===r){const e=t.node("mjx-break",Co[a]?{size:Co[a]}:{style:`letter-spacing: ${this.em(i-1)}`},[t.text(" ")]);t.insert(e,this.dom[o])}else i&&(Co[a]?t.setAttribute(this.dom[o],r,Co[a]):t.setStyle(this.dom[o],n,a))}}handleBorders(){var t,e;const i=null===(t=this.styleData)||void 0===t?void 0:t.border,s=null===(e=this.styleData)||void 0===e?void 0:e.padding,r=this.dom.length-1;if(!i||!r)return;const n=this.adaptor;for(const t of this.dom.keys()){const e=this.dom[t];t&&(i.width[3]&&n.setStyle(e,"border-left"," none"),s[3]&&n.setStyle(e,"padding-left","0")),t!==r&&(i.width[1]&&n.setStyle(e,"border-right","none"),s[1]&&n.setStyle(e,"padding-right","0"))}}handleColor(){var t;const e=this.adaptor,i=this.node.attributes,s=i.getExplicit("mathcolor")||i.getExplicit("color"),r=i.getExplicit("mathbackground")||i.getExplicit("background")||(null===(t=this.styles)||void 0===t?void 0:t.get("background-color"));s&&this.dom.forEach((t=>e.setStyle(t,"color",s))),r&&this.dom.forEach((t=>e.setStyle(t,"backgroundColor",r)))}handleAttributes(){const t=this.adaptor,e=this.node.attributes,i=e.getAllDefaults(),s=Io.skipAttributes;for(const r of e.getExplicitNames())if(!1===s[r]||!(r in i)&&!s[r]&&!t.hasAttribute(this.dom[0],r)){const i=e.getExplicit(r);this.dom.forEach((e=>t.setAttribute(e,r,i)))}if(e.get("class")){const i=e.get("class").trim().split(/ +/);for(const e of i)this.dom.forEach((i=>t.addClass(i,e)))}this.node.getProperty("inline-breaks")&&this.dom.forEach((e=>t.setAttribute(e,"inline-breaks","true")))}handlePWidth(){if(this.bbox.pwidth){const t=this.adaptor;this.bbox.pwidth===Dn.fullWidth?this.dom.forEach((e=>t.setAttribute(e,"width","full"))):this.dom.forEach((e=>t.setStyle(e,"width",this.bbox.pwidth)))}}setIndent(t,e,i){const s=this.adaptor;if("center"===e||"left"===e){const e=this.getBBox().L;i+e&&s.setStyle(t,"margin-left",this.em(i+e))}if("center"===e||"right"===e){const e=this.getBBox().R;i+e&&s.setStyle(t,"margin-right",this.em(-i+e))}}drawBBox(){const{w:t,h:e,d:i,R:s}=this.getOuterBBox(),r=this.html("mjx-box",{style:{opacity:.25,"margin-left":this.em(-t-s)}},[this.html("mjx-box",{style:{height:this.em(e),width:this.em(t),"background-color":"red"}}),this.html("mjx-box",{style:{height:this.em(i),width:this.em(t),"margin-left":this.em(-t),"vertical-align":this.em(-i),"background-color":"green"}})]),n=this.dom[0]||this.parent.dom[0],o=this.adaptor.getAttribute(n,"size");o&&this.adaptor.setAttribute(r,"size",o);const a=this.adaptor.getStyle(n,"fontSize");a&&this.adaptor.setStyle(r,"fontSize",a),this.adaptor.append(this.adaptor.parent(n),r),this.adaptor.setStyle(n,"backgroundColor","#FFEE00")}html(t,e={},i=[]){return this.jax.html(t,e,i)}text(t){return this.jax.text(t)}char(t){return this.font.charSelector(t).substring(1)}}function So(t){return class extends t{getWrapWidth(t){return this.parent?this.getBBox().w:this.metrics.containerWidth/this.jax.pxPerEm}computeBBox(t,e=!1){super.computeBBox(t,e);const i=this.node.attributes;if(!this.parent&&this.jax.math.display&&"linebreak"===i.get("overflow")){const e=this.containerWidth;t.w>e&&this.childNodes[0].breakToWidth(e),t.updateFrom(this.childNodes[0].getBBox())}}}}Io.kind="unknown",Io.autoStyle=!0;const Ao=function(){var t;const e=So(Io);return(t=class extends e{handleDisplay(t){const e=this.adaptor,[i,s]=this.getAlignShift();if("center"!==i&&e.setAttribute(t,"justify",i),this.bbox.pwidth===Dn.fullWidth){if(e.setAttribute(t,"width","full"),this.jax.table){let{L:r,w:n,R:o}=this.jax.table.getOuterBBox();"right"===i?o=Math.max(o||-s,-s):"left"===i?r=Math.max(r||s,s):"center"===i&&(n+=2*Math.abs(s));const a=this.em(Math.max(0,r+n+o));e.setStyle(t,"min-width",a),e.setStyle(this.jax.table.dom[0],"min-width",a)}}else this.setIndent(this.dom[0],i,s)}handleInline(t){const e=this.adaptor,i=e.getStyle(this.dom[0],"margin-right");i&&(e.setStyle(this.dom[0],"margin-right",""),e.setStyle(t,"margin-right",i),e.setStyle(t,"width","0"))}toCHTML(t){super.toCHTML(t);const e=this.adaptor;"block"===this.node.attributes.get("display")?(e.setAttribute(this.dom[0],"display","true"),e.setAttribute(t[0],"display","true"),this.handleDisplay(t[0])):this.handleInline(t[0]),e.addClass(this.dom[0],`${this.font.cssFontPrefix}-N`)}setChildPWidths(t,e=null,i=!0){return!!this.parent&&super.setChildPWidths(t,e,i)}handleAttributes(){super.handleAttributes();const t=this.adaptor;this.node.getProperty("process-breaks")&&this.dom.forEach((e=>t.setAttribute(e,"breakable","true")))}}).kind=qs.prototype.kind,t.styles={"mjx-math":{"line-height":0,"text-align":"left","text-indent":0,"font-style":"normal","font-weight":"normal","font-size":"100%","font-size-adjust":"none","letter-spacing":"normal","word-wrap":"normal","word-spacing":"normal",direction:"ltr",padding:"1px 0"},'mjx-container[jax="CHTML"][display="true"] mjx-math':{padding:0},"mjx-math[breakable]":{display:"inline"},'mjx-container[jax="CHTML"] mjx-break':{"white-space":"normal","line-height":"0","clip-path":"rect(0 0 0 0)","font-family":"MJX-BRK !important"},'mjx-break[size="0"]':{"letter-spacing":"-0.999em"},'mjx-break[size="1"]':{"letter-spacing":"-0.889em"},'mjx-break[size="2"]':{"letter-spacing":"-0.833em"},'mjx-break[size="3"]':{"letter-spacing":"-0.778em"},'mjx-break[size="4"]':{"letter-spacing":"-0.722em"},'mjx-break[size="5"]':{"letter-spacing":"-0.667em"}},t}();function Oo(t){return class extends t{computeBBox(t,e=!1){super.computeBBox(t),this.copySkewIC(t)}}}const Mo=function(){var t;const e=Oo(Io);return(t=class extends e{}).kind=Ws.prototype.kind,t}();function ko(t){return class extends t{get breakCount(){return this.breakStyle?1:0}get embellishedBreakCount(){return this.embellishedBreakStyle?1:0}get embellishedBreakStyle(){return this.breakStyle||this.getBreakStyle()}protoBBox(t){const e=this.stretch.dir!==lo.None;e&&null===this.size&&this.getStretchedVariant([0]),e&&this.size<0||(super.computeBBox(t),0!==t.w||!this.node.attributes.hasExplicit("fence")||""!==this.node.getText()||this.node.texClass!==Is.OPEN&&this.node.texClass!==Is.CLOSE||this.jax.options.mathmlSpacing||(t.R=this.font.params.nulldelimiterspace),this.copySkewIC(t))}getAccentOffset(){const t=Dn.empty();return this.protoBBox(t),-t.w/2}getCenterOffset(t=null){return t||(t=Dn.empty(),super.computeBBox(t)),(t.h+t.d)/2+this.font.params.axis_height-t.h}getStretchedVariant(t,e=!1){if(this.stretch.dir===lo.None)return;let i=this.getWH(t);const s=this.getSize("minsize",0),r=this.getSize("maxsize",1/0),n=this.node.getProperty("mathaccent");i=Math.max(s,Math.min(r,i));const o=this.font.params.delimiterfactor/1e3,a=this.font.params.delimitershortfall,l=s||e?i:n?Math.min(i/o,i+a):Math.max(i*o,i-a),c=this.getText().codePointAt(0);let h=this.stretch;this.size&&(this.stretch=h=this.font.getDelimiter(c),this.size=null);const d=h.c||c;let u=0;if(h.sizes)for(const t of h.sizes){if(t>=l)return n&&u&&u--,void this.setDelimSize(d,u);u++}h.stretch?(this.size=-1,this.invalidateBBox(),this.getStretchBBox(t,this.checkExtendedHeight(i,h),h)):this.setDelimSize(d,u-1)}setDelimSize(t,e){const i=this.stretch;this.variant=this.font.getSizeVariant(t,e),this.size=e;const s=i.schar&&i.schar[Math.min(e,i.schar.length-1)]||t;this.stretch=Object.assign(Object.assign({},i),{c:s}),this.childNodes[0].invalidateBBox()}getSize(t,e){const i=this.node.attributes;return i.isSet(t)&&(e=this.length2em(i.get(t),1,1)),e}getWH(t){if(0===t.length)return 0;if(1===t.length)return t[0];const[e,i]=t,s=this.font.params.axis_height;return this.node.attributes.get("symmetric")?2*Math.max(e-s,i+s):e+i}getStretchBBox(t,e,i){Object.hasOwn(i,"min")&&i.min>e&&(e=i.min);let[s,r,n]=i.HDW;if(this.stretch.dir===lo.Vertical)[s,r]=this.getBaseline(t,e,i);else if(n=e,this.stretch.hd&&!this.jax.options.mathmlSpacing){const t=this.font.params.extender_factor;s=s*(1-t)+this.stretch.hd[0]*t,r=r*(1-t)+this.stretch.hd[1]*t}this.bbox.h=s,this.bbox.d=r,this.bbox.w=n}getBaseline(t,e,i){const s=2===t.length&&t[0]+t[1]===e,r=this.node.attributes.get("symmetric"),[n,o]=s?t:[e,0];let[a,l]=[n+o,0];if(r){const t=this.font.params.axis_height;s&&(a=2*Math.max(n-t,o+t)),l=a/2-t}else if(s)l=o;else{const[t,e]=i.HDW||[.75,.25];l=e*(a/(t+e))}return[a-l,l]}checkExtendedHeight(t,e){if(e.fullExt){const[i,s]=e.fullExt;t=s+Math.ceil(Math.max(0,t-s)/i)*i}return t}setBreakStyle(t=""){var e;if(this.breakStyle=(null===(e=this.node.parent)||void 0===e?void 0:e.isEmbellished)&&!t?"":this.getBreakStyle(t),this.breakCount&&this.multChar){const t=this.parent.node.childIndex(this.node),e=this.parent.node.childNodes[t+1];e&&e.setTeXclass(this.multChar.node)}}getBreakStyle(t=""){const e=this.node.attributes;let i=t||("newline"===e.get("linebreak")||this.node.getProperty("forcebreak")?e.get("linebreakstyle"):"");return"infixlinebreakstyle"===i&&(i=e.get(i)),i}getMultChar(){const t=this.node.attributes.get("linebreakmultchar");t&&"\u2062"===this.getText()&&"\u2062"!==t&&(this.multChar=this.createMo(t))}constructor(t,e,i=null){super(t,e,i),this.size=null,this.isAccent=this.node.isAccent,this.getMultChar(),this.setBreakStyle()}computeBBox(t,e=!1){if(this.protoBBox(t),this.node.attributes.get("symmetric")&&this.stretch.dir!==lo.Horizontal){const e=this.getCenterOffset(t);t.h+=e,t.d-=e}this.node.getProperty("mathaccent")&&(this.stretch.dir===lo.None||this.size>=0)&&(t.w=0)}computeLineBBox(t){return this.moLineBBox(t,this.breakStyle)}moLineBBox(t,e,i=null){const s=this.node.attributes.get("lineleading"),r=this.length2em(s,this.linebreakOptions.lineleading);if(0===t&&"before"===e){const t=go.from(Dn.zero(),r);return t.originalL=this.bbox.L,this.bbox.L=0,t}let n=go.from(i||this.getOuterBBox(),r);return 1===t&&("after"===e?(n.w=n.h=n.d=0,n.isFirst=!0,this.bbox.R=0):"duplicate"===e?n.L=0:this.multChar&&(n=go.from(this.multChar.getOuterBBox(),r)),n.getIndentData(this.node)),n}canStretch(t){if(this.stretch.dir!==lo.None)return this.stretch.dir===t;if(!this.node.attributes.get("stretchy"))return!1;const e=this.getText();if(1!==Array.from(e).length)return!1;const i=this.font.getDelimiter(e.codePointAt(0));return this.stretch=i&&i.dir===t?i:po,this.stretch.dir!==lo.None}getVariant(){this.node.attributes.get("largeop")?this.variant=this.node.attributes.get("displaystyle")?"-largeop":"-smallop":this.node.attributes.hasExplicit("mathvariant")||!1!==this.node.getProperty("pseudoscript")?super.getVariant():this.variant="-tex-variant"}remapChars(t){const e=this.node.getProperty("primes");if(e)return Zs(e);if(1===t.length){const e=this.node.coreParent().parent,i=this.isAccent&&!e.isKind("mrow")?"accent":"mo",s=this.font.getRemappedChar(i,t[0]);s&&(t=this.unicodeChars(s,this.variant))}return t}}}class Do{constructor(){this.used=new Set,this.needsUpdate=[]}add(t){const e=JSON.stringify(t);this.used.has(e)||this.needsUpdate.push(t),this.used.add(e)}has(t){return this.used.has(JSON.stringify(t))}clear(){this.used.clear(),this.needsUpdate=[]}update(){const t=this.needsUpdate;return this.needsUpdate=[],t}}class Po extends fo{constructor(){super(...arguments),this.charUsage=new Do,this.delimUsage=new Do,this.fontUsage={},this.newFonts=0}static charOptions(t,e){return super.charOptions(t,e)}static addFontURLs(t,e,i){for(const s of Object.keys(e)){const r=Object.assign({},e[s]);r.src=r.src.replace(/%%URL%%/,i),t[s]=r}}static addDynamicFontCss(t,e,i){const s={};for(const i of e){const e=i.slice(4);s[`@font-face /* ${e} */`]={"font-family":i,src:`url("%%URL%%/${i.toLowerCase()}.woff2") format("woff2")`},t[`.${e}`]={"font-family":`${this.defaultCssFamilyPrefix}, ${i}`}}this.addFontURLs(t,s,i)}static addExtension(t,e=""){super.addExtension(t,e),t.fonts&&this.addDynamicFontCss(this.defaultStyles,t.fonts,t.fontURL)}addExtension(t,e=""){if(super.addExtension(t,e),!t.fonts||!this.options.adaptiveCSS)return[];const i={},s=new Nn;return this.constructor.addDynamicFontCss(i,t.fonts,t.fontURL),s.addStyles(i),s.getStyleRules()}adaptiveCSS(t){this.options.adaptiveCSS=t}clearCache(){this.options.adaptiveCSS&&(this.charUsage.clear(),this.delimUsage.clear())}createVariant(t,e=null,i=null){super.createVariant(t,e,i),this.variant[t].letter=this.constructor.defaultVariantLetters[t]}defineChars(t,e){super.defineChars(t,e);const i=this.variant[t].letter,s=this.constructor;for(const t of Object.keys(e)){const r=parseInt(t);if(!Array.isArray(e[r]))continue;const n=s.charOptions(e,r);void 0===n.f&&(n.f=i);for(const[t,e]of s.combiningChars)if(r>=t&&r<=e){n.cmb=!0;break}}}addDynamicFontCss(t,e=this.options.fontURL){this.constructor.addDynamicFontCss(this.fontUsage,t,e)}updateDynamicStyles(){const t=this.fontUsage;return this.fontUsage={},this.options.adaptiveCSS||this.updateStyles(t),t}get styles(){const t=this.constructor,e=Object.assign(Object.assign({},t.defaultStyles),this.fontUsage);return this.fontUsage={},t.addFontURLs(e,t.defaultFonts,this.options.fontURL),this.options.adaptiveCSS?this.updateStyles(e):this.allStyles(e),e}updateStyles(t){for(const e of this.delimUsage.update())this.addDelimiterStyles(t,e,this.getDelimiter(e));for(const[e,i]of this.charUsage.update()){const s=this.variant[e];this.addCharStyles(t,s.letter,i,s.chars[i])}return t}allStyles(t){var e;for(const e of Object.keys(this.delimiters)){const i=parseInt(e);this.addDelimiterStyles(t,i,this.delimiters[i])}for(const i of Object.keys(this.variant)){const s=this.variant[i],r=s.letter;for(const i of Object.keys(s.chars)){const n=parseInt(i),o=s.chars[n];!(null===(e=null==o?void 0:o[3])||void 0===e?void 0:e.smp)&&Array.isArray(o)&&(o.length<4&&(o[3]={}),this.addCharStyles(t,r,n,o))}}}addDelimiterStyles(t,e,i){if(!i.stretch)return;const s=i.c&&i.c!==e?this.charSelector(i.c):this.charSelector(e);i.dir===lo.Vertical?this.addDelimiterVStyles(t,e,s,i):this.addDelimiterHStyles(t,e,s,i)}addDelimiterVStyles(t,e,i,s){const r=s.HDW,[n,o,a,l]=s.stretch,[c,h,d,u]=this.getStretchVariants(e),p=this.addDelimiterVPart(t,i,"beg",n,c,r);this.addDelimiterVPart(t,i,"ext",o,h,r);const m=this.addDelimiterVPart(t,i,"end",a,d,r);if(l){const e=this.addDelimiterVPart(t,i,"mid",l,u,r),s=this.em(e/2-.03);t[`mjx-stretchy-v${i} > mjx-ext:first-of-type`]={height:"50%","border-width":`${this.em1(p-.03)} 0 ${s}`},t[`mjx-stretchy-v${i} > mjx-ext:last-of-type`]={height:"50%","border-width":`${s} 0 ${this.em1(m-.03)}`}}else(m||p)&&(t[`mjx-stretchy-v${i} > mjx-ext`]["border-width"]=`${this.em1(p-.03)} 0 ${this.em1(m-.03)}`)}addDelimiterVPart(t,e,i,s,r,n){if(!s)return 0;const[o,a,l]=this.getChar(r,s),c={width:this.em0(l)};if("ext"!==i){const t=l>n[2]?this.em((n[2]-l)/2):"auto",e="beg"===i?o:"end"===i?-a:(o-a)/2;c.margin=`${this.em(e)} ${t} ${this.em(-e)}`}else c["line-height"]=this.em0(o+a+.005),t[`mjx-stretchy-v${e} > mjx-${i} > mjx-spacer`]={"margin-top":this.em(-a)};return t[`mjx-stretchy-v${e} > mjx-${i}`]=c,o+a}addDelimiterHStyles(t,e,i,s){const r=[...s.HDW],[n,o,a,l]=s.stretch,[c,h,d,u]=this.getStretchVariants(e);if(s.hd&&!this.options.mathmlSpacing){const t=this.params.extender_factor;r[0]=r[0]*(1-t)+s.hd[0]*t,r[1]=r[1]*(1-t)+s.hd[1]*t}const p=this.addDelimiterHPart(t,i,"beg",n,c,r);this.addDelimiterHPart(t,i,"ext",o,h,r);const m=this.addDelimiterHPart(t,i,"end",a,d,r);if(l){const e=this.addDelimiterHPart(t,i,"mid",l,u,r),s=this.em0(e/2-.03);t[`mjx-stretchy-h${i} > mjx-ext:first-of-type`]={width:"50%","border-width":`0 ${s} 0 ${this.em0(p-.03)}`},t[`mjx-stretchy-h${i} > mjx-ext:last-of-type`]={width:"50%","border-width":`0 ${this.em0(m-.03)} 0 ${s}`}}else(p||m)&&(t[`mjx-stretchy-h${i} > mjx-ext`]["border-width"]=`0 ${this.em0(m-.06)} 0 ${this.em0(p-.06)}`);s.ext&&(t[`mjx-stretchy-h${i} > mjx-ext > mjx-spacer`]["letter-spacing"]=this.em(-s.ext))}addDelimiterHPart(t,e,i,s,r,n){if(!s)return 0;let[,,o,a]=this.getChar(r,s);const l={padding:this.padding(n,o-n[2])};if("ext"===i){const s=l.padding.split(/ /);s[1]=s[3]="0",l.padding=s.join(" "),!o&&a.dx&&(o=2*a.dx-.06),t[`mjx-stretchy-h${e} > mjx-${i} > mjx-spacer`]={"margin-left":this.em(-o/2)},a.cmb&&(t[`mjx-stretchy-h${e} > mjx-${i} > mjx-c`]={width:this.em(o),"text-align":"right"})}else"mid"===i?l.margin=`0 ${this.em(-o/2)}`:l["end"==i?"margin-left":"margin-right"]=this.em(-o),this.checkCombiningChar(a,l);return t[`mjx-stretchy-h${e} > mjx-${i}`]=l,o}addCharStyles(t,e,i,s){const r=s[3],n=void 0!==r.f?r.f:e,o=r.ff||(n?`${this.cssFontPrefix}-${n}`:""),a="mjx-c"+this.charSelector(i)+(o?"."+o:""),l=r.oc||r.ic||0;t[a]={padding:this.padding(s,l)},r.oc&&(t[a+"[noic]"]={"padding-right":this.em(s[2])}),this.checkCombiningChar(r,t[a])}checkCombiningChar(t,e){if(!t.cmb)return;const i=e.padding.split(/ /);e.width=i[1],i[1]="0",i[3]||i.pop(),e.padding=i.join(" "),"0"===e.width&&t.dx&&(e.width=this.em(2*t.dx),e["margin-left"]="-"+e.width)}em(t){return Mn(t)}em0(t){return Mn(Math.max(0,t))}em1(t){const e=Mn(Math.max(0,t));return"0"===e?".1px":e}padding([t,e,i],s=0){return[t,i+s,e,0].map(this.em0).join(" ")}charSelector(t){return".mjx-c"+t.toString(16).toUpperCase()}}function Bo(t,e){for(const i of Object.keys(e)){const s=parseInt(i),r=e[s];r.c&&(r.c=r.c.replace(/\\[0-9A-F]+/gi,(t=>String.fromCodePoint(parseInt(t.substring(1),16))))),Object.assign(fo.charOptions(t,s),r)}return t}Po.OPTIONS=Object.assign(Object.assign({},fo.OPTIONS),{dynamicPrefix:"./chtml/dynamic",fontURL:"./chtml/woff2"}),Po.JAX="CHTML",Po.defaultVariantLetters={},Po.defaultStyles={},Po.defaultFonts={},Po.combiningChars=[[768,879],[8400,8447]];const jo=function(){var t;const e=ko(Io);return t=class extends e{toCHTML(t){const e=this.adaptor,i=this.node.attributes,s=i.get("symmetric")&&this.stretch.dir!==lo.Horizontal,r=this.stretch.dir!==lo.None;r&&null===this.size&&this.getStretchedVariant([]),t.length>1&&t.forEach((t=>e.append(t,this.html("mjx-linestrut"))));const n=this.standardChtmlNodes(t);if(n.length>1&&"duplicate"!==this.breakStyle){const t="after"===this.breakStyle?1:0;e.remove(n[t]),n[t]=null}if(r&&this.size<0)this.stretchHTML(n);else{if(s||i.get("largeop")){const t=this.em(this.getCenterOffset());"0"!==t&&n.forEach((i=>i&&e.setStyle(i,"verticalAlign",t)))}this.node.getProperty("mathaccent")&&n.forEach((t=>{e.setStyle(t,"width","0"),e.setStyle(t,"margin-left",this.em(this.getAccentOffset()))})),n[0]&&this.addChildren([n[0]]),n[1]&&(this.multChar||this).addChildren([n[1]])}}stretchHTML(t){const e=this.getText().codePointAt(0);this.font.delimUsage.add(e),this.childNodes[0].markUsed();const i=this.stretch,s=i.stretch,r=this.font.getStretchVariants(e),n=[],o=[];for(let t=0;t<s.length;t++)s[t]&&(o[t]=this.font.getChar(r[t],s[t]));const{h:a,d:l,w:c}=this.bbox,h={};i.dir===lo.Vertical?(this.createAssembly(o,s,r,n,a+l,.05,"\n"),n.push(this.html("mjx-mark")),h.height=this.em(a+l),h.verticalAlign=this.em(-l)):(this.createAssembly(o,s,r,n,c,i.ext||0),h.width=this.em(c));const d={class:this.char(i.c||e),style:h},u=this.html("mjx-stretchy-"+i.dir,d,n),p=this.adaptor;t[0]&&p.append(t[0],u),t[1]&&p.append(t[1],t[0]?p.clone(u):u)}createAssembly(t,e,i,s,r,n,o=""){t=[...t,null,null,null].slice(0,4);let[a,l,c,h]=t.map((t=>t?o?t[0]+t[1]:t[2]:0));l=Math.max(0,l-n);const[d,u]=t[3]?[(r-h)/2-a,(r-h)/2-c]:[r-a-c,0];this.createPart("mjx-beg",t[0],e[0],i[0],s),this.createPart("mjx-ext",t[1],e[1],i[1],s,d,l,o),t[3]&&(this.createPart("mjx-mid",t[3],e[3],i[3],s),this.createPart("mjx-ext",t[1],e[1],i[1],s,u,l,o)),this.createPart("mjx-end",t[2],e[2],i[2],s)}createPart(t,e,i,s,r,n=0,o=0,a=""){if(i){const l=e[3],c=l.f||("normal"===s?"":this.font.getVariant(s).letter),h=l.ff||(c?`${this.font.cssFontPrefix}-${c}`:""),d=l.c||String.fromCodePoint(i);let u=[];if("mjx-ext"===t&&(o||l.dx)){o||(o=Math.max(.06,2*l.dx-.06));const t=Math.min(Math.ceil(n/o)+1,500);if(l.cmb){u.push(this.html("mjx-spacer"));for(let e=0;e<t;e++)u.push(this.html("mjx-c",{},[this.text(d)]))}else u=[this.html("mjx-spacer",{},[this.text(Array(t).fill(d).join(a))])]}else u=[this.text(d)];r.push(this.html(t,h?{class:h}:{},u))}}},t.kind=nr.prototype.kind,t.styles={"mjx-stretchy-h":{display:"inline-block"},[["beg","ext","end","mid"].map((t=>`mjx-stretchy-h > mjx-${t}`)).join(", ")]:{display:"inline-block",width:0,"text-align":"right"},"mjx-stretchy-h > mjx-ext":{"clip-path":"padding-box polygon(0 -1em, 100% -1em, 100% calc(100% + 1em), 0 calc(100% + 1em))",width:"100%",border:"0px solid transparent","box-sizing":"border-box","text-align":"left"},"mjx-stretchy-v":{display:"inline-block","text-align":"center"},[["beg","ext","end","mid"].map((t=>`mjx-stretchy-v > mjx-${t}`)).join(", ")]:{display:"block",height:0,margin:"0 auto"},"mjx-stretchy-v > mjx-ext > mjx-spacer":{display:"block"},"mjx-stretchy-v > mjx-ext":{"clip-path":"padding-box polygon(-1em 0, calc(100% + 1em) 0, calc(100% + 1em) 100%, -1em 100%)",height:"100%",border:"0.1px solid transparent","box-sizing":"border-box","white-space":"pre"},"mjx-mark":{display:"inline-block",height:0}},t}();function Fo(t){return class extends t{remapChars(t){if(t.length){const e=this.font.getRemappedChar("mn",t[0]);if(e){const i=this.unicodeChars(e,this.variant);1===i.length?t[0]=i[0]:t=i.concat(t.slice(1))}}return t}}}const Uo=function(){var t;const e=Fo(Io);return(t=class extends e{}).kind=Vs.prototype.kind,t}();function Ho(t){return class extends t{createText(t){const e=this.wrap(this.mmlText(t));return e.parent=this,e}constructor(t,e,i=null){super(t,e,i);const s=this.node.attributes,r=s.getList("lquote","rquote");"monospace"!==this.variant&&(s.isSet("lquote")||'"'!==r.lquote||(r.lquote="\u201c"),s.isSet("rquote")||'"'!==r.rquote||(r.rquote="\u201d")),this.childNodes.unshift(this.createText(r.lquote)),this.childNodes.push(this.createText(r.rquote))}}}const qo=function(){var t;const e=Ho(Io);return(t=class extends e{}).kind=lr.prototype.kind,t}();function Wo(t){var e;return e=class extends t{constructor(){super(...arguments),this.breakPoints=[]}textWidth(t){let e=this.textNode;if(!e){const t=this.node.factory.create("text");t.parent=this.node,e=this.textNode=this.factory.wrap(t),e.parent=this}return e.node.setText(t),e.invalidateBBox(!1),e.getBBox().w}get breakCount(){return this.breakPoints.length}getVariant(){const t=this.jax.options,e=this.jax.math.outputData,i=(!!e.merrorFamily||!!t.merrorFont)&&this.node.Parent.isKind("merror");if(e.mtextFamily||t.mtextFont||i){const s=this.node.attributes.get("mathvariant"),r=this.constructor.INHERITFONTS[s]||this.jax.font.getCssFont(s),n=r[0]||(i?e.merrorFamily||t.merrorFont:e.mtextFamily||t.mtextFont);this.variant=this.explicitVariant(n,r[2]?"bold":"",r[1]?"italic":"")}else super.getVariant()}setBreakAt(t){this.breakPoints.push(t)}clearBreakPoints(){this.breakPoints=[]}computeLineBBox(t){const e=go.from(this.getOuterBBox(),this.linebreakOptions.lineleading);return this.breakCount?(e.w=this.getBreakWidth(t),0===t?(e.R=0,this.addLeftBorders(e)):(e.L=0,e.indentData=[["left","0"],["left","0"],["left","0"]],t===this.breakCount&&this.addRightBorders(e)),e):e}getBreakWidth(t){const e=this.childNodes;let[i,s]=this.breakPoints[t-1]||[0,0];const[r,n]=this.breakPoints[t]||[e.length,0];let o=e[i].node.getText().split(/ /);if(i===r)return this.textWidth(o.slice(s,n).join(" "));let a=this.textWidth(o.slice(s).join(" "));for(;++i<r&&i<e.length;)a+=e[i].getBBox().w;return i<e.length&&(o=e[i].node.getText().split(/ /),a+=this.textWidth(o.slice(0,n).join(" "))),a}},e.INHERITFONTS={normal:["",!1,!1],bold:["",!1,!0],italic:["",!0,!1],"bold-italic":["",!0,!0]},e}const Vo=function(){var t;const e=Wo(Io);return(t=class extends e{toCHTML(t){if(!this.breakCount)return void super.toCHTML(t);const e=this.standardChtmlNodes(t),i=this.textNode.node,s=this.childNodes;for(const t of e.keys()){const r=[e[t]];this.adaptor.append(e[t],this.html("mjx-linestrut"));let[n,o]=this.breakPoints[t-1]||[0,0];const[a,l]=this.breakPoints[t]||[s.length,0];let c=s[n].node.getText().split(/ /);if(n!==a){for(i.setText(c.slice(o).join(" ")),this.textNode.toCHTML(r);++n<a&&n<s.length;)s[n].toCHTML(r);n<s.length&&(c=s[n].node.getText().split(/ /),i.setText(c.slice(0,l).join(" ")),this.textNode.toCHTML(r))}else i.setText(c.slice(o,l).join(" ")),this.textNode.toCHTML(r)}}}).kind=or.prototype.kind,t}();function Xo(t){return class extends t{get canBreak(){return this.node.canBreak}get breakCount(){return this.breakStyle?1:0}setBreakStyle(t=""){this.breakStyle=t||(this.node.hasNewline||this.node.getProperty("forcebreak")?"before":"")}constructor(t,e,i=null){super(t,e,i),this.setBreakStyle()}computeBBox(t,e=!1){const i=this.node.attributes;t.w=this.length2em(i.get("width"),0),t.h=this.length2em(i.get("height"),0),t.d=this.length2em(i.get("depth"),0)}computeLineBBox(t){const e=this.node.attributes.get("data-lineleading"),i=this.length2em(e,this.linebreakOptions.lineleading),s=go.from(Dn.zero(),i);return 1===t&&(s.getIndentData(this.node),s.w=this.getBBox().w,s.isFirst=0===s.w),s}}}const zo=function(){var t;const e=Xo(Io);return(t=class extends e{toCHTML(t){t.length>1&&t.forEach((t=>this.adaptor.append(t,this.html("mjx-linestrut"))));const e=this.standardChtmlNodes(t);let{w:i,h:s,d:r}=this.getBBox();i<0&&(this.adaptor.setStyle(e[0],"marginRight",this.em(i)),i=0),i&&!this.breakCount&&this.adaptor.setStyle(e[0],"width",this.em(i)),s=Math.max(0,s+r),s&&this.adaptor.setStyle(e[0],"height",this.em(Math.max(0,s))),r&&this.adaptor.setStyle(e[0],"verticalAlign",this.em(-r))}}).kind=ar.prototype.kind,t}();function Go(t){return class extends t{get containerWidth(){const t=this.node.attributes,e=t.get("width").toString();return e.match(/^[-+]|%$/)||"linebreak"!==t.get("data-overflow")?this.parent.containerWidth:this.length2em(e)}getDimens(){const t=this.node.attributes.getList("width","height","depth","lspace","voffset"),e=this.childNodes[0].getOuterBBox();let{w:i,h:s,d:r}=e;const n=i,o=s,a=r;let l=0,c=0,h=0;""!==t.width&&(i=this.dimen(t.width,e,"w",0)),""!==t.height&&(s=this.dimen(t.height,e,"h",0)),""!==t.depth&&(r=this.dimen(t.depth,e,"d",0)),""!==t.voffset&&(c=this.dimen(t.voffset,e)),""!==t.lspace&&(l=this.dimen(t.lspace,e));const d=this.node.attributes.get("data-align");return d&&(h=this.getAlignX(i,e,d)),[o,a,n,s-o,r-a,i-n,l,c,h]}dimen(t,e,i="",s=null){const r=(t=String(t)).match(/width|height|depth/),n=r?e[r[0].charAt(0)]:i?e[i]:0;let o=this.length2em(t,n)||0;return t.match(/^[-+]/)&&i&&(o+=n),null!=s&&(o=Math.max(s,o)),o}setBBoxDimens(t){const[e,i,s,r,n,o]=this.getDimens();t.w=s+o,t.h=e+r,t.d=i+n}computeBBox(t,e=!1){this.setBBoxDimens(t);if(this.childNodes[0].getOuterBBox().w>t.w){const e=this.node.attributes.get("data-overflow");("linebreak"===e||"auto"===e&&"linebreak"===this.jax.math.root.attributes.get("overflow"))&&(this.childNodes[0].breakToWidth(t.w),this.setBBoxDimens(t))}this.setChildPWidths(e,t.w)}getWrapWidth(t){return this.getBBox().w}getChildAlign(t){return this.node.attributes.get("data-align")||"left"}}}const Jo=function(){var t;const e=Go(Io);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;let e=this.standardChtmlNodes(t);const i=[],s={},[,,r,n,o,a,l,c,h]=this.getDimens();if((a||this.childNodes[0].getBBox().pwidth)&&(s.width=this.em(r+a)),(n||o)&&(s.margin=this.em(n)+" 0 "+this.em(o)),l+h||c){s.position="relative";const t=this.html("mjx-rbox",{style:{left:this.em(l+h),top:this.em(-c),"max-width":s.width}});l+h&&this.childNodes[0].getBBox().pwidth&&(this.adaptor.setAttribute(t,"width","full"),this.adaptor.setStyle(t,"left",this.em(l))),i.push(t)}e=[this.adaptor.append(e[0],this.html("mjx-block",{style:s},i))],this.childNodes[0].childNodes.length?this.childNodes[0].toCHTML([i[0]||e[0]]):(n||o)&&this.adaptor.append(i[0]||e[0],this.html("mjx-box"))}}).kind=gr.prototype.kind,t.styles={"mjx-mpadded":{display:"inline-block"},"mjx-rbox":{display:"inline-block",position:"relative"}},t}(),Ko=4,$o=1,Yo=2,Qo=.067,Zo=.2,ta=Qo+"em solid",ea={top:0,right:1,bottom:2,left:3},ia=Object.keys(ea),sa=t=>new Array(4).fill(t.thickness+t.padding),ra=t=>new Array(4).fill(t.padding),na=t=>new Array(4).fill(t.thickness),oa=t=>Math.max(t.padding,t.thickness*(t.arrowhead.x+t.arrowhead.dx+1)),aa=(t,e)=>{if(t.childNodes[0]){const{h:i,d:s}=t.childNodes[0].getBBox();e[0]=e[2]=Math.max(0,t.thickness*t.arrowhead.y-(i+s)/2)}return e},la=(t,e)=>{if(t.childNodes[0]){const{w:i}=t.childNodes[0].getBBox();e[1]=e[3]=Math.max(0,t.thickness*t.arrowhead.y-i/2)}return e},ca={up:[-Math.PI/2,!1,!0,"verticalstrike"],down:[Math.PI/2,!1,!0,"verticakstrike"],right:[0,!1,!1,"horizontalstrike"],left:[Math.PI,!1,!1,"horizontalstrike"],updown:[Math.PI/2,!0,!0,"verticalstrike uparrow downarrow"],leftright:[0,!0,!1,"horizontalstrike leftarrow rightarrow"]},ha={updiagonal:[-1,0,!1,"updiagonalstrike northeastarrow"],northeast:[-1,0,!1,"updiagonalstrike updiagonalarrow"],southeast:[1,0,!1,"downdiagonalstrike"],northwest:[1,Math.PI,!1,"downdiagonalstrike"],southwest:[-1,Math.PI,!1,"updiagonalstrike"],northeastsouthwest:[-1,0,!0,"updiagonalstrike northeastarrow updiagonalarrow southwestarrow"],northwestsoutheast:[1,0,!0,"downdiagonalstrike northwestarrow southeastarrow"]},da={up:t=>la(t,[oa(t),0,t.padding,0]),down:t=>la(t,[t.padding,0,oa(t),0]),right:t=>aa(t,[0,oa(t),0,t.padding]),left:t=>aa(t,[0,t.padding,0,oa(t)]),updown:t=>la(t,[oa(t),0,oa(t),0]),leftright:t=>aa(t,[0,oa(t),0,oa(t)])},ua=function(t){return e=>{const i=ea[e];return[e,{renderer:t,bbox:t=>{const e=[0,0,0,0];return e[i]=t.thickness+t.padding,e},border:t=>{const e=[0,0,0,0];return e[i]=t.thickness,e}}]}},pa=function(t){return(e,i,s)=>{const r=ea[i],n=ea[s];return[e,{renderer:t,bbox:t=>{const e=t.thickness+t.padding,i=[0,0,0,0];return i[r]=i[n]=e,i},border:t=>{const e=[0,0,0,0];return e[r]=e[n]=t.thickness,e},remove:i+" "+s}]}},ma=function(t){return e=>{const i="mjx-"+e.charAt(0)+"strike";return[e+"diagonalstrike",{renderer:t(i),bbox:sa}]}},fa=function(t){return e=>{const[i,s,r,n]=ha[e];return[e+"arrow",{renderer:(e,n)=>{const[o,a]=e.arrowAW(),l=e.arrow(a,i*(o-s),r);t(e,l)},bbox:t=>{const{a:e,x:i,y:s}=t.arrowData(),[r,n,o]=[t.arrowhead.x,t.arrowhead.y,t.arrowhead.dx],[a,l]=t.getArgMod(r+o,n),c=s+(a>e?t.thickness*l*Math.sin(a-e):0),h=i+(a>Math.PI/2-e?t.thickness*l*Math.sin(a+e-Math.PI/2):0);return[c,h,c,h]},remove:n}]}},ga=function(t){return e=>{const[i,s,r,n]=ca[e];return[e+"arrow",{renderer:(e,n)=>{const{w:o,h:a,d:l}=e.getBBox(),[c,h]=r?[a+l,"X"]:[o,"Y"],d=e.getOffset(h),u=e.arrow(c,i,s,h,d);t(e,u)},bbox:da[e],remove:n}]}};function ba(t){return class extends t{getParameters(){const t=this.node.attributes,e=t.get("data-padding");void 0!==e&&(this.padding=this.length2em(e,Zo));const i=t.get("data-thickness");void 0!==i&&(this.thickness=this.length2em(i,Qo));const s=t.get("data-arrowhead");if(void 0!==s){const[t,e,i]=ir(s);this.arrowhead={x:t?parseFloat(t):Ko,y:e?parseFloat(e):Yo,dx:i?parseFloat(i):$o}}}getNotations(){const t=this.constructor.notations;for(const e of ir(this.node.attributes.get("notation"))){const i=t.get(e);i&&(this.notations[e]=i,i.renderChild&&(this.renderChild=i.renderer))}}removeRedundantNotations(){for(const t of Object.keys(this.notations))if(this.notations[t]){const e=this.notations[t].remove||"";for(const t of e.split(/ /))delete this.notations[t]}}initializeNotations(){for(const t of Object.keys(this.notations)){const e=this.notations[t].init;e&&e(this)}}getBBoxExtenders(){const t=[0,0,0,0];for(const e of Object.keys(this.notations))this.maximizeEntries(t,this.notations[e].bbox(this));return t}getPadding(){const t=[0,0,0,0];for(const e of Object.keys(this.notations)){const i=this.notations[e].border;i&&this.maximizeEntries(t,i(this))}return[0,1,2,3].map((e=>this.TRBL[e]-t[e]))}maximizeEntries(t,e){for(let i=0;i<t.length;i++)t[i]<e[i]&&(t[i]=e[i])}getOffset(t){const[e,i,s,r]=this.TRBL,n=("X"===t?i-r:s-e)/2;return Math.abs(n)>.001?n:0}getArgMod(t,e){return[Math.atan2(e,t),Math.sqrt(t*t+e*e)]}arrow(t,e,i,s="",r=0){return null}arrowData(){const[t,e]=[this.padding,this.thickness],i=e*(this.arrowhead.x+Math.max(1,this.arrowhead.dx)),{h:s,d:r,w:n}=this.childNodes[0].getBBox(),o=s+r,a=Math.sqrt(o*o+n*n),l=Math.max(t,i*n/a),c=Math.max(t,i*o/a),[h,d]=this.getArgMod(n+2*l,o+2*c);return{a:h,W:d,x:l,y:c}}arrowAW(){const{h:t,d:e,w:i}=this.childNodes[0].getBBox(),[s,r,n,o]=this.TRBL;return this.getArgMod(o+i+r,s+t+e+n)}createMsqrt(t){const e=this.node.factory.create("msqrt");e.inheritAttributesFrom(this.node),e.childNodes[0]=t.node;const i=this.wrap(e);return i.parent=this,i}sqrtTRBL(){const t=this.msqrt.getBBox(),e=this.msqrt.childNodes[0].getBBox();return[t.h-e.h,0,t.d-e.d,t.w-e.w]}constructor(t,e,i=null){super(t,e,i),this.notations={},this.renderChild=null,this.msqrt=null,this.padding=Zo,this.thickness=Qo,this.arrowhead={x:Ko,y:Yo,dx:$o},this.TRBL=[0,0,0,0],this.getParameters(),this.getNotations(),this.removeRedundantNotations(),this.initializeNotations(),this.TRBL=this.getBBoxExtenders()}computeBBox(t,e=!1){const[i,s,r,n]=this.TRBL,o=this.childNodes[0].getBBox();t.combine(o,n,0),t.h+=i,t.d+=r,t.w+=s,this.setChildPWidths(e)}}}const Ea=function(t,e=""){return(i,s)=>{const r=i.adjustBorder(i.html("mjx-"+t));if(e){const t=i.getOffset(e);if(i.thickness!==Qo||t){const s=`translate${e}(${i.Em(i.thickness/2-t)})`;i.adaptor.setStyle(r,"transform",s)}}i.adaptor.append(i.dom[0],r)}},xa=function(t){return ua(((e,i)=>{e.adaptor.setStyle(i,"border-"+t,e.Em(e.thickness)+" solid")}))(t)},ya=function(t,e,i){return pa(((t,s)=>{const r=t.Em(t.thickness)+" solid";t.adaptor.setStyle(s,"border-"+e,r),t.adaptor.setStyle(s,"border-"+i,r)}))(t,e,i)},Na=function(t,e){return ma((t=>(i,s)=>{const{w:r,h:n,d:o}=i.getBBox(),[a,l]=i.getArgMod(r,n+o),c=e*i.thickness/2,h=i.adjustBorder(i.html(t,{style:{width:i.Em(l),transform:"rotate("+i.fixed(-e*a)+"rad) translateY("+c+"em)"}}));i.adaptor.append(i.dom[0],h)}))(t)},va=function(t){return fa(((t,e)=>{t.adaptor.append(t.dom[0],e)}))(t)},Ta=function(t){return ga(((t,e)=>{t.adaptor.append(t.dom[0],e)}))(t)};function _a(t,e){return Math.atan2(t,e).toFixed(3).replace(/\.?0+$/,"")}const La=_a($o,Yo),Ca=function(){var t;const e=ba(Io);return(t=class extends e{adjustArrow(t,e){const i=this.thickness,s=this.arrowhead;if(s.x===Ko&&s.y===Yo&&s.dx===$o&&i===Qo)return;const[r,n]=[i*s.x,i*s.y].map((t=>this.em(t))),o=_a(s.dx,s.y),[a,l,c,h,d]=this.adaptor.childNodes(t);this.adjustHead(l,[n,"0","1px",r],o),this.adjustHead(c,["1px","0",n,r],"-"+o),this.adjustHead(h,[n,r,"1px","0"],"-"+o),this.adjustHead(d,["1px",r,n,"0"],o),this.adjustLine(a,i,s.x,e)}adjustHead(t,e,i){t&&(this.adaptor.setStyle(t,"border-width",e.join(" ")),this.adaptor.setStyle(t,"transform","skewX("+i+"rad)"))}adjustLine(t,e,i,s){this.adaptor.setStyle(t,"borderTop",this.em(e)+" solid"),this.adaptor.setStyle(t,"top",this.em(-e/2)),this.adaptor.setStyle(t,"right",this.em(e*(i-1))),s&&this.adaptor.setStyle(t,"left",this.em(e*(i-1)))}moveArrow(t,e,i){if(!i)return;const s=this.adaptor.getStyle(t,"transform");this.adaptor.setStyle(t,"transform",`translate${e}(${this.em(-i)})${s?" "+s:""}`)}adjustBorder(t){return this.thickness!==Qo&&this.adaptor.setStyle(t,"borderWidth",this.em(this.thickness)),t}adjustThickness(t){return this.thickness!==Qo&&this.adaptor.setStyle(t,"strokeWidth",this.fixed(this.thickness)),t}fixed(t,e=3){return Math.abs(t)<6e-4?"0":t.toFixed(e).replace(/\.?0+$/,"")}Em(t){return super.em(t)}toCHTML(t){const e=this.adaptor,i=this.standardChtmlNodes(t),s=e.append(i[0],this.html("mjx-box"));this.renderChild?this.renderChild(this,s):this.childNodes[0].toCHTML([s]);for(const t of Object.keys(this.notations)){const e=this.notations[t];e.renderChild||e.renderer(this,s)}const r=this.getPadding();for(const t of ia){const i=ea[t];r[i]>0&&e.setStyle(s,"padding-"+t,this.em(r[i]))}}arrow(t,e,i,s="",r=0){const n=this.getBBox().w,o={width:this.em(t)};n!==t&&(o.left=this.em((n-t)/2)),e&&(o.transform="rotate("+this.fixed(e)+"rad)");const a=this.html("mjx-arrow",{style:o},[this.html("mjx-aline"),this.html("mjx-rthead"),this.html("mjx-rbhead")]);return i&&(this.adaptor.append(a,this.html("mjx-lthead")),this.adaptor.append(a,this.html("mjx-lbhead")),this.adaptor.setAttribute(a,"double","true")),this.adjustArrow(a,i),this.moveArrow(a,s,r),a}}).kind=xr.prototype.kind,t.styles={"mjx-menclose":{position:"relative"},"mjx-menclose > mjx-dstrike":{display:"inline-block",left:0,top:0,position:"absolute","border-top":ta,"transform-origin":"top left"},"mjx-menclose > mjx-ustrike":{display:"inline-block",left:0,bottom:0,position:"absolute","border-top":ta,"transform-origin":"bottom left"},"mjx-menclose > mjx-hstrike":{"border-top":ta,position:"absolute",left:0,right:0,bottom:"50%",transform:"translateY("+Mn(Qo/2)+")"},"mjx-menclose > mjx-vstrike":{"border-left":ta,position:"absolute",top:0,bottom:0,right:"50%",transform:"translateX("+Mn(Qo/2)+")"},"mjx-menclose > mjx-rbox":{position:"absolute",top:0,bottom:0,right:0,left:0,border:ta,"border-radius":Mn(Qo+Zo)},"mjx-menclose > mjx-cbox":{position:"absolute",top:0,bottom:0,right:0,left:0,border:ta,"border-radius":"50%"},"mjx-menclose > mjx-arrow":{position:"absolute",left:0,bottom:"50%",height:0,width:0},"mjx-menclose > mjx-arrow > mjx-aline":{display:"block",position:"absolute","box-sizing":"border-box","transform-origin":"bottom",left:0,top:Mn(-Qo/2),right:Mn(Qo*(Ko-1)),height:0,"border-top":Mn(Qo)+" solid","border-left":0,"border-right":0},"mjx-menclose > mjx-arrow[double] > mjx-aline":{display:"block",position:"absolute","box-sizing":"border-box","transform-origin":"bottom",left:Mn(Qo*(Ko-1)),height:0,"border-left":Mn(Qo*Ko)+" solid","border-right":0},"mjx-menclose > mjx-arrow > mjx-rthead":{display:"block",position:"absolute","box-sizing":"border-box","transform-origin":"bottom",transform:"skewX("+La+"rad)",right:0,bottom:"-1px","border-left":Mn(Qo*Ko)+" solid","border-right":0,"border-bottom":"1px solid transparent","border-top":Mn(Qo*Yo)+" solid transparent"},"mjx-menclose > mjx-arrow > mjx-rbhead":{display:"block",position:"absolute","box-sizing":"border-box",transform:"skewX(-"+La+"rad)","transform-origin":"top",right:0,top:"-1px","border-left":Mn(Qo*Ko)+" solid","border-right":0,"border-top":"1px solid transparent","border-bottom":Mn(Qo*Yo)+" solid transparent"},"mjx-menclose > mjx-arrow > mjx-lthead":{display:"block",position:"absolute","box-sizing":"border-box",transform:"skewX(-"+La+"rad)","transform-origin":"bottom",left:0,bottom:"-1px","border-left":0,"border-right":Mn(Qo*Ko)+" solid","border-bottom":"1px solid transparent","border-top":Mn(Qo*Yo)+" solid transparent"},"mjx-menclose > mjx-arrow > mjx-lbhead":{display:"block",position:"absolute","box-sizing":"border-box",transform:"skewX("+La+"rad)","transform-origin":"top",left:0,top:"-1px","border-left":0,"border-right":Mn(Qo*Ko)+" solid","border-top":"1px solid transparent","border-bottom":Mn(Qo*Yo)+" solid transparent"},"mjx-menclose > mjx-dbox-top":{position:"absolute",top:0,bottom:"50%",left:0,width:Mn(1.5*Zo),"border-width":Mn(Qo),"border-style":"solid solid none none","border-radius":"0 100% 0 0","box-sizing":"border-box"},"mjx-menclose > mjx-dbox-bot":{position:"absolute",top:"50%",bottom:0,left:0,width:Mn(1.5*Zo),"border-width":Mn(Qo),"border-style":"none solid solid none","border-radius":"0 0 100% 0","box-sizing":"border-box"}},t.notations=new Map([xa("top"),xa("right"),xa("bottom"),xa("left"),ya("actuarial","top","right"),ya("madruwb","bottom","right"),Na("up",1),Na("down",-1),["horizontalstrike",{renderer:Ea("hstrike","Y"),bbox:t=>[0,t.padding,0,t.padding]}],["verticalstrike",{renderer:Ea("vstrike","X"),bbox:t=>[t.padding,0,t.padding,0]}],["box",{renderer:(t,e)=>{t.adaptor.setStyle(e,"border",t.Em(t.thickness)+" solid")},bbox:sa,border:na,remove:"left right top bottom"}],["roundedbox",{renderer:Ea("rbox"),bbox:sa}],["circle",{renderer:Ea("cbox"),bbox:sa}],["phasorangle",{renderer:(t,e)=>{const{h:i,d:s}=t.getBBox(),[r,n]=t.getArgMod(1.75*t.padding,i+s),o=t.thickness*Math.sin(r)*.9;t.adaptor.setStyle(e,"border-bottom",t.Em(t.thickness)+" solid");const a=t.adjustBorder(t.html("mjx-ustrike",{style:{width:t.Em(n),transform:`translateX(${t.Em(o)}) rotate(${t.fixed(-r)}rad)`}}));t.adaptor.append(t.dom[0],a)},bbox:t=>{const e=t.padding/2,i=t.thickness;return[2*e,e,e+i,3*e+i]},border:t=>[0,0,t.thickness,0],remove:"bottom"}],Ta("up"),Ta("down"),Ta("left"),Ta("right"),Ta("updown"),Ta("leftright"),va("updiagonal"),va("northeast"),va("southeast"),va("northwest"),va("southwest"),va("northeastsouthwest"),va("northwestsoutheast"),["longdiv",{renderer:(t,e)=>{const i=t.adaptor;i.setStyle(e,"border-top",t.Em(t.thickness)+" solid");const s=i.append(t.dom[0],t.html("mjx-dbox-top")),r=i.append(t.dom[0],t.html("mjx-dbox-bot")),n=t.thickness,o=t.padding;n!==Qo&&(i.setStyle(s,"border-width",t.Em(n)),i.setStyle(r,"border-width",t.Em(n))),o!==Zo&&(i.setStyle(s,"width",t.Em(1.5*o)),i.setStyle(r,"width",t.Em(1.5*o)))},bbox:t=>{const e=t.padding,i=t.thickness;return[e+i,e,e,2*e+i/2]}}],["radical",{renderer:(t,e)=>{t.msqrt.toCHTML([e]);const i=t.sqrtTRBL();t.adaptor.setStyle(t.msqrt.dom[0],"margin",i.map((e=>t.Em(-e))).join(" "))},init:t=>{t.msqrt=t.createMsqrt(t.childNodes[0])},bbox:t=>t.sqrtTRBL(),renderChild:!0}]]),t}();function Ra(t){return class extends t{stretchChildren(){const t=[];for(const e of this.childNodes)e.canStretch(lo.Vertical)&&t.push(e);const e=t.length,i=this.childNodes.length;if(e&&i>1){let s=0,r=0;const n=e>1&&e===i;for(const t of this.childNodes){const e=t.stretch.dir===lo.None;if(n||e){const e=t.getBBox().rscale;let[i,n]=t.getUnbrokenHD();i*=e,n*=e,i>s&&(s=i),n>r&&(r=n)}}for(const e of t){const t=e.coreRScale();e.coreMO().getStretchedVariant([s/t,r/t])}}}get fixesPWidth(){return!1}get breakCount(){return this._breakCount<0&&(this._breakCount=this.childNodes.length?this.childNodes.reduce(((t,e)=>t+e.breakCount),0):0),this._breakCount}breakTop(t,e){const i=this;return this.isStack?this.parent.breakTop(i,i):i}constructor(t,e,i=null){super(t,e,i),this.dh=0;const s=this;this.isStack=!this.parent||this.parent.node.isInferred||this.parent.breakTop(s,s)!==s,this.stretchChildren();for(const t of this.childNodes)if(t.bbox.pwidth){this.bbox.pwidth=Dn.fullWidth;break}}computeBBox(t,e=!1){const i=this.breakCount;this.lineBBox=i?[new go({h:.75,d:.25,w:0},[0,0])]:[],t.empty();for(const e of this.childNodes.keys()){const s=this.childNodes[e];t.append(s.getOuterBBox()),i&&this.computeChildLineBBox(s,e)}t.clean(),i&&!this.coreMO().node.isEmbellished&&this.computeLinebreakBBox(t),this.fixesPWidth&&this.setChildPWidths(e)&&this.computeBBox(t,!0),this.vboxAdjust(t)}computeLinebreakBBox(t){var e;t.empty();const i=this.isStack,s=this.lineBBox,r=s.length-1;if(i)for(const t of s.keys()){const e=s[t];this.addMiddleBorders(e),0===t&&this.addLeftBorders(e),t===r&&this.addRightBorders(e)}let n=0;for(const i of s.keys()){const r=s[i];t.combine(r,0,n),n-=Math.max(.25,r.d)+r.lineLeading+Math.max(.75,(null===(e=s[i+1])||void 0===e?void 0:e.h)||0)}i?(s[0].L=this.bbox.L,s[r].R=this.bbox.R):(t.w=Math.max(...this.lineBBox.map((t=>t.w))),this.shiftLines(t),this.jax.math.display||this.linebreakOptions.inline||(t.pwidth=Dn.fullWidth,this.node.isInferred&&(this.parent.bbox.pwidth=Dn.fullWidth))),t.clean()}vboxAdjust(t){if(!this.parent)return;const e=this.breakCount,i=this.parent.node.attributes.get("data-vertical-align");if(e&&"bottom"===i)this.dh=e?t.d-this.lineBBox[e-1].d:0;else{if(!("center"===i||e&&"middle"===i))return void(this.dh=0);{const{h:e,d:i}=t,s=this.font.params.axis_height;this.dh=(e+i)/2+s-e}}t.h+=this.dh,t.d-=this.dh}computeChildLineBBox(t,e){const i=this.lineBBox[this.lineBBox.length-1];i.end=[e,0],i.append(t.getLineBBox(0));const s=t.breakCount+1;if(1!==s)for(let i=1;i<s;i++){const s=new go({h:.75,d:.25,w:0});s.start=s.end=[e,i],s.isFirst=!0,s.append(t.getLineBBox(i)),this.lineBBox.push(s)}}getLineBBox(t){return this.getBBox(),this.isStack?super.getLineBBox(t):go.from(this.getOuterBBox(),this.linebreakOptions.lineleading)}shiftLines(t){var e,i;const s=t.w,r=this.lineBBox,n=r.length-1,[o,a]=(null===(e=r[1].indentData)||void 0===e?void 0:e[0])||["left","0"];for(const e of r.keys()){const l=r[e],[c,h]=0===e?[o,a]:(null===(i=l.indentData)||void 0===i?void 0:i[e===n?2:1])||["left","0"],[d,u]=this.processIndent(c,h,o,a,s);l.L=0,l.L=this.getAlignX(s,l,d)+u;const p=l.L+l.w;p>t.w&&(t.w=p)}}setChildPWidths(t,e=null,i=!0){return this.breakCount?!t&&(null!==e&&this.bbox.w!==e&&(this.bbox.w=e,this.shiftLines(this.bbox)),!0):super.setChildPWidths(t,e,i)}breakToWidth(t){this.linebreaks.breakToWidth(this,t)}}}function wa(t){return class extends t{getScale(){this.bbox.scale=this.parent.bbox.scale,this.bbox.rscale=1}}}const Ia=function(){var t;const e=Ra(Io);return t=class extends e{constructor(){super(...arguments),this.linebreakCount=0}toCHTML(t){const e=this.linebreakCount=this.isStack?0:this.breakCount;e||!this.node.isInferred?t=this.standardChtmlNodes(t):this.dom=t,this.addChildren(t),e?this.placeLines(t,e):(this.handleVerticalAlign(t[0]),this.handleNegativeWidth(t[0]))}placeLines(t,e){var i,s;this.getBBox();const r=this.lineBBox,n=this.adaptor,[o,a]=(null===(i=r[1].indentData)||void 0===i?void 0:i[0])||["left","0"];for(const i of t.keys()){const l=r[i],[c,h]=0===i?[o,a]:(null===(s=l.indentData)||void 0===s?void 0:s[i===e?2:1])||["left","0"],[d,u]=this.processIndent(c,h,o,a);n.setAttribute(t[i],"align",d),u&&n.setStyle(t[i],"margin-left",this.em(u)),i<e&&this.jax.math.display&&n.setStyle(t[i],"margin-bottom",this.em(l.lineLeading))}}handleVerticalAlign(t){this.dh&&this.adaptor.setStyle(this.adaptor.parent(t),"vertical-align",this.em(this.dh))}handleNegativeWidth(t){const{w:e}=this.getBBox();e<0&&(this.adaptor.setStyle(t,"width",this.em(Math.max(0,e))),this.adaptor.setStyle(t,"marginRight",this.em(e)))}createChtmlNodes(t){const e=this.linebreakCount;if(!e)return super.createChtmlNodes(t);const i=this.adaptor,s=this.node.isInferred?"mjx-linestack":"mjx-"+this.node.kind;if(this.dom=[i.append(t[0],this.html(s))],"mjx-mrow"!==s||this.isStack||i.setAttribute(this.dom[0],"break-top","true"),this.node.getProperty("process-breaks")&&i.setAttribute(this.dom[0],"breakable","true"),this.node.isInferred||!this.isStack){const t=this.parent.node.attributes.get("data-vertical-align");"middle"!==t&&"center"!==t&&"bottom"!==t||i.setAttribute(this.dom[0],"break-align",t)}this.dom=[i.append(this.handleHref(t)[0],this.dom[0])];const r=Array(e);for(let t=0;t<=e;t++)r[t]=i.append(this.dom[0],this.html("mjx-linebox",{lineno:t}));return r}addChildren(t){let e=0;for(const i of this.childNodes){const s=i.breakCount;i.toCHTML(t.slice(e,e+s+1)),e+=s}}},t.kind=cr.prototype.kind,t.styles={"mjx-linestack, mjx-mrow[break-top]":{display:"inline-table",width:"100%"},'mjx-linestack[break-align="bottom"], mjx-mrow[break-top][break-align="bottom"]':{display:"inline-block"},'mjx-linestack[break-align="middle"], mjx-mrow[break-top][break-align="middle"]':{"vertical-align":"middle"},'mjx-linestack[break-align="center"], mjx-mrow[break-top][break-align="center"]':{"vertical-align":"middle"},"mjx-linestack[breakable]":{display:"inline"},"mjx-linestack[breakable] > mjx-linebox":{display:"inline"},"mjx-linestack[breakable] > mjx-linebox::before":{"white-space":"pre",content:'"\\A"'},"mjx-linestack[breakable] > mjx-linebox::after":{"white-space":"normal",content:'" "',"letter-spacing":"-.999em","font-family":"MJX-BRK"},"mjx-linestack[breakable] > mjx-linebox:first-of-type::before":{display:"none"},"mjx-linestack[breakable] > mjx-linebox:last-of-type::after":{display:"none"},"mjx-linebox":{display:"block"},'mjx-linebox[align="left"]':{"text-align":"left"},'mjx-linebox[align="center"]':{"text-align":"center"},'mjx-linebox[align="right"]':{"text-align":"right"},"mjx-linestrut":{display:"inline-block",height:"1em","vertical-align":"-.25em"}},t}(),Sa=function(){var t;const e=wa(Ia);return(t=class extends e{}).kind=hr.prototype.kind,t}();function Aa(t){return class extends t{createMrow(){const t=this.node.factory.create("inferredMrow");t.inheritAttributesFrom(this.node),this.mrow=this.wrap(t),this.mrow.parent=this}addMrowChildren(){const t=this.node,e=this.mrow;this.addMo(t.open),this.childNodes.length&&e.childNodes.push(this.childNodes[0]);let i=0;for(const s of this.childNodes.slice(1))this.addMo(t.separators[i++]),e.childNodes.push(s);this.addMo(t.close),e.stretchChildren()}addMo(t){if(!t)return;const e=this.wrap(t);this.mrow.childNodes.push(e),e.parent=this.mrow}constructor(t,e,i=null){super(t,e,i),this.mrow=null,this.createMrow(),this.addMrowChildren()}computeBBox(t,e=!1){t.updateFrom(this.mrow.getOuterBBox()),this.setChildPWidths(e)}get breakCount(){return this.mrow.breakCount}computeLineBBox(t){return this.mrow.getLineBBox(t)}}}const Oa=function(){var t;const e=Aa(Io);return(t=class extends e{toCHTML(t){const e=this.standardChtmlNodes(t);this.mrow.toCHTML(e)}}).kind=Er.prototype.kind,t}();function Ma(t){return class extends t{getFractionBBox(t,e,i){const s=this.childNodes[0].getOuterBBox(),r=this.childNodes[1].getOuterBBox(),n=this.font.params.axis_height,{T:o,u:a,v:l}=this.getTUV(e,i);t.combine(s,0,n+o+Math.max(s.d*s.rscale,a)),t.combine(r,0,n-o-Math.max(r.h*r.rscale,l)),t.w+=2*this.pad+.2}getTUV(t,e){const i=this.font.params,s=i.axis_height,r=(t?3.5:1.5)*e;return{T:(t?3.5:1.5)*e,u:(t?i.num1:i.num2)-s-r,v:(t?i.denom1:i.denom2)+s-r}}getAtopBBox(t,e){const{u:i,v:s,nbox:r,dbox:n}=this.getUVQ(e);t.combine(r,0,i),t.combine(n,0,-s),t.w+=2*this.pad}getUVQ(t){const e=this.childNodes[0].getOuterBBox(),i=this.childNodes[1].getOuterBBox(),s=this.font.params;let[r,n]=t?[s.num1,s.denom1]:[s.num3,s.denom2];const o=(t?7:3)*s.rule_thickness;let a=r-e.d*e.scale-(i.h*i.scale-n);return a<o&&(r+=(o-a)/2,n+=(o-a)/2,a=o),{u:r,v:n,q:a,nbox:e,dbox:i}}getBevelledBBox(t,e){const{u:i,v:s,delta:r,nbox:n,dbox:o}=this.getBevelData(e),a=this.bevel.getOuterBBox();t.combine(n,0,i),t.combine(a,t.w-r/2,0),t.combine(o,t.w-r/2,s)}getBevelData(t){const e=this.childNodes[0].getOuterBBox(),i=this.childNodes[1].getOuterBBox(),s=t?.4:.15,r=Math.max(e.scale*(e.h+e.d),i.scale*(i.h+i.d))+2*s,n=this.font.params.axis_height;return{H:r,delta:s,u:e.scale*(e.d-e.h)/2+n+s,v:i.scale*(i.d-i.h)/2+n-s,nbox:e,dbox:i}}isDisplay(){const{displaystyle:t,scriptlevel:e}=this.node.attributes.getList("displaystyle","scriptlevel");return t&&0===e}constructor(t,e,i=null){if(super(t,e,i),this.bevel=null,this.pad=this.node.getProperty("withDelims")?0:this.font.params.nulldelimiterspace,this.node.attributes.get("bevelled")){const{H:t}=this.getBevelData(this.isDisplay()),e=this.bevel=this.createMo("/");e.node.attributes.set("symmetric",!0),e.canStretch(lo.Vertical),e.getStretchedVariant([t],!0)}}computeBBox(t,e=!1){t.empty();const{linethickness:i,bevelled:s}=this.node.attributes.getList("linethickness","bevelled"),r=this.isDisplay();let n=null;if(s)this.getBevelledBBox(t,r);else{const e=this.length2em(String(i),.06);n=-2*this.pad,0===e?this.getAtopBBox(t,r):(this.getFractionBBox(t,r,e),n-=.2),n+=t.w}t.clean(),this.setChildPWidths(e,n)}canStretch(t){return!1}getChildAlign(t){const e=this.node.attributes;return e.get("bevelled")?"left":e.get(["numalign","denomalign"][t])}getWrapWidth(t){const e=this.node.attributes;if(e.get("bevelled"))return this.childNodes[t].getOuterBBox().w;return this.getBBox().w-(this.length2em(e.get("linethickness"))?.2:0)-2*this.pad}}}const ka=function(){var t;const e=Ma(Io);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;this.standardChtmlNodes(t);const{linethickness:e,bevelled:i}=this.node.attributes.getList("linethickness","bevelled"),s=this.isDisplay();if(i)this.makeBevelled(s);else{const t=this.length2em(String(e),.06);0===t?this.makeAtop(s):this.makeFraction(s,t)}}makeFraction(t,e){const{numalign:i,denomalign:s}=this.node.attributes.getList("numalign","denomalign"),r=t?{type:"d"}:{},n=this.node.getProperty("withDelims")?Object.assign(Object.assign({},r),{delims:"true"}):Object.assign({},r),o="center"!==i?{align:i}:{},a="center"!==s?{align:s}:{},l=Object.assign({},r),c=Object.assign({},r),h=this.font.params;if(.06!==e){const i=h.axis_height,s=this.font.params.rule_factor,o=this.em(e),{T:a,u:d,v:u}=this.getTUV(t,e),p=(t?this.em(3*e):o)+" -.1em";r.style={height:o,"border-top":this.em(e*s)+" solid",margin:p};const m=this.em(Math.max(0,d));c.style={height:m,"vertical-align":"-"+m},l.style={height:this.em(Math.max(0,u))},n.style={"vertical-align":this.em(i-a)}}let d,u;this.adaptor.append(this.dom[0],this.html("mjx-frac",n,[d=this.html("mjx-num",o,[this.html("mjx-nstrut",c)]),this.html("mjx-dbox",{},[this.html("mjx-dtable",{},[this.html("mjx-line",r),this.html("mjx-row",{},[u=this.html("mjx-den",a,[this.html("mjx-dstrut",l)])])])])])),this.childNodes[0].toCHTML([d]),this.childNodes[1].toCHTML([u])}makeAtop(t){const{numalign:e,denomalign:i}=this.node.attributes.getList("numalign","denomalign"),s=t?{type:"d",atop:!0}:{atop:!0},r=this.node.getProperty("withDelims")?Object.assign(Object.assign({},s),{delims:!0}):Object.assign({},s),n="center"!==e?{align:e}:{},o="center"!==i?{align:i}:{},{v:a,q:l}=this.getUVQ(t);let c,h;n.style={"padding-bottom":this.em(l)},r.style={"vertical-align":this.em(-a)},this.adaptor.append(this.dom[0],this.html("mjx-frac",r,[c=this.html("mjx-num",n),h=this.html("mjx-den",o)])),this.childNodes[0].toCHTML([c]),this.childNodes[1].toCHTML([h])}makeBevelled(t){const e=this.adaptor;e.setAttribute(this.dom[0],"bevelled","ture");const i=e.append(this.dom[0],this.html("mjx-num"));this.childNodes[0].toCHTML([i]),this.bevel.toCHTML(this.dom);const s=e.append(this.dom[0],this.html("mjx-den"));this.childNodes[1].toCHTML([s]);const{u:r,v:n,delta:o,nbox:a,dbox:l}=this.getBevelData(t);r&&e.setStyle(i,"verticalAlign",this.em(r/a.scale)),n&&e.setStyle(s,"verticalAlign",this.em(n/l.scale));const c=this.em(-o/2);e.setStyle(this.bevel.dom[0],"marginLeft",c),e.setStyle(this.bevel.dom[0],"marginRight",c)}}).kind=dr.prototype.kind,t.styles={"mjx-frac":{display:"inline-block","vertical-align":"0.17em",padding:"0 .22em"},'mjx-frac[type="d"]':{"vertical-align":".04em"},"mjx-frac[delims]":{padding:"0 .1em"},"mjx-frac[atop]":{padding:"0 .12em"},"mjx-frac[atop][delims]":{padding:"0"},"mjx-dtable":{display:"inline-table",width:"100%"},"mjx-dtable > mjx-line, mjx-dtable > mjx-row":{"font-size":"2000%"},"mjx-dbox":{display:"block","font-size":"5%"},"mjx-num":{display:"block","text-align":"center"},"mjx-den":{display:"block","text-align":"center"},"mjx-mfrac[bevelled] > mjx-num":{display:"inline-block"},"mjx-mfrac[bevelled] > mjx-den":{display:"inline-block"},'mjx-den[align="right"], mjx-num[align="right"]':{"text-align":"right"},'mjx-den[align="left"], mjx-num[align="left"]':{"text-align":"left"},"mjx-nstrut":{display:"inline-block",height:".054em",width:0,"vertical-align":"-.054em"},'mjx-nstrut[type="d"]':{height:".217em","vertical-align":"-.217em"},"mjx-dstrut":{display:"inline-block",height:".505em",width:0},'mjx-dstrut[type="d"]':{height:".726em"},"mjx-line":{display:"block","box-sizing":"border-box","min-height":"1px",height:".06em","border-top":".075em solid",margin:".06em -.1em",overflow:"hidden"},'mjx-line[type="d"]':{margin:".18em -.1em"}},t}();function Da(t){return class extends t{get base(){return 0}get root(){return null}combineRootBBox(t,e,i){}getPQ(t){const e=this.font.params.rule_thickness,i=this.font.params.surd_height,s=this.node.attributes.get("displaystyle")?this.font.params.x_height:e;return[s,t.h+t.d>this.surdH?(t.h+t.d-(this.surdH-e-i-s/2))/2:i+s/4]}getRootDimens(t,e){return[0,0,0,0]}rootWidth(){return 1.25}getStretchedSurd(){const t=this.font.params.rule_thickness,e=this.font.params.surd_height,i=this.node.attributes.get("displaystyle")?this.font.params.x_height:t,{h:s,d:r}=this.childNodes[this.base].getOuterBBox();this.surdH=s+r+t+e+i/4,this.surd.getStretchedVariant([this.surdH-r,r],!0)}constructor(t,e,i=null){super(t,e,i),this.surd=this.createMo("\u221a"),this.surd.canStretch(lo.Vertical),this.getStretchedSurd()}computeBBox(t,e=!1){t.empty();const i=this.surd.getBBox(),s=new Dn(this.childNodes[this.base].getOuterBBox()),r=this.getPQ(i)[1],n=this.font.params.rule_thickness,o=this.font.params.surd_height,a=s.h+r+n,[l]=this.getRootDimens(i,a);t.h=a+o,this.combineRootBBox(t,i,a),t.combine(i,l,a-i.h),t.combine(s,l+i.w,0),t.clean(),this.setChildPWidths(e)}invalidateBBox(){super.invalidateBBox(),this.surd.childNodes[0].invalidateBBox()}}}const Pa=function(){var t;const e=Da(Io);return t=class extends e{toCHTML(t){const e=this.surd,i=this.childNodes[this.base],s=e.getBBox(),r=i.getOuterBBox(),[,n]=this.getPQ(s),o=this.font.params.surd_height,a=r.h+n+o,l=this.adaptor,c=this.standardChtmlNodes(t);let h,d,u,p;null!=this.root&&(u=l.append(c[0],this.html("mjx-root")),p=this.childNodes[this.root]);const m=l.append(c[0],this.html("mjx-sqrt",{},[h=this.html("mjx-surd"),d=this.html("mjx-box",{style:{paddingTop:this.em(n)}})]));.06!==o&&l.setStyle(d,"border-top-width",this.em(o*this.font.params.rule_factor)),this.addRoot(u,p,s,a),e.toCHTML([h]),i.toCHTML([d]),e.size<0&&l.addClass(m,"mjx-tall")}addRoot(t,e,i,s){}},t.kind=ur.prototype.kind,t.styles={"mjx-root":{display:"inline-block","white-space":"nowrap"},"mjx-surd":{display:"inline-block","vertical-align":"top"},"mjx-sqrt":{display:"inline-block","padding-top":".075em"},"mjx-sqrt > mjx-box":{"border-top":".075em solid","padding-left":".03em","margin-left":"-.03em"},"mjx-sqrt.mjx-tall > mjx-box":{"padding-left":".3em","margin-left":"-.3em"}},t}();function Ba(t){return class extends t{get root(){return 1}combineRootBBox(t,e,i){const s=this.childNodes[this.root].getOuterBBox(),r=this.getRootDimens(e,i)[1];t.combine(s,0,r)}getRootDimens(t,e){const i=this.surd,s=this.childNodes[this.root].getOuterBBox(),r=(i.size<0?.5:.6)*t.w,{w:n,rscale:o}=s,a=Math.max(n,r/o),l=Math.max(0,a-n);return[a*o-r,this.rootHeight(s,t,i.size,e),l]}rootHeight(t,e,i,s){const r=e.h+e.d;return(i<0?1.9:.55*r)-(r-s)+Math.max(0,t.d*t.rscale)}rootWidth(){const t=this.childNodes[this.root].getOuterBBox();return.4+t.w*t.rscale}}}const ja=function(){var t;const e=Ba(Pa);return t=class extends e{addRoot(t,e,i,s){e.toCHTML([t]);const r=this.adaptor,[n,o,a]=this.getRootDimens(i,s);r.setStyle(t,"verticalAlign",this.em(o)),r.setStyle(t,"width",this.em(n)),a&&r.setStyle(r.firstChild(t),"paddingLeft",this.em(a))}},t.kind=pr.prototype.kind,t}();function Fa(t){var e;return(e=class extends t{get scriptChild(){return this.childNodes[this.node.sub]}getOffset(){return[this.baseIsChar?0:this.getAdjustedIc(),-this.getV()]}}).useIC=!1,e}function Ua(t){return class extends t{get scriptChild(){return this.childNodes[this.node.sup]}getOffset(){return[this.getAdjustedIc()-(this.baseRemoveIc?0:this.baseIc),this.getU()]}}}function Ha(t){var e;return e=class extends t{constructor(){super(...arguments),this.UVQ=null}get subChild(){return this.childNodes[this.node.sub]}get supChild(){return this.childNodes[this.node.sup]}get scriptChild(){return this.supChild}getUVQ(t=this.subChild.getOuterBBox(),e=this.supChild.getOuterBBox()){const i=this.baseCore,s=i.getLineBBox(i.breakCount);if(this.UVQ)return this.UVQ;const r=this.font.params,n=3*r.rule_thickness,o=this.length2em(this.node.attributes.get("subscriptshift"),r.sub2),a=this.baseCharZero(s.d*this.baseScale+r.sub_drop*t.rscale),l=e.d*e.rscale,c=t.h*t.rscale;let[h,d]=[this.getU(),Math.max(a,o)],u=h-l-(c-d);if(u<n){d+=n-u;const t=.8*r.x_height-(h-l);t>0&&(h+=t,d-=t)}return h=Math.max(this.length2em(this.node.attributes.get("superscriptshift"),h),h),d=Math.max(this.length2em(this.node.attributes.get("subscriptshift"),d),d),u=h-l-(c-d),this.UVQ=[h,-d,u],this.UVQ}appendScripts(t){const[e,i]=[this.subChild.getOuterBBox(),this.supChild.getOuterBBox()],s=this.getBaseWidth(),r=this.getAdjustedIc(),[n,o]=this.getUVQ(),a=t.d-this.baseChild.getLineBBox(this.baseChild.breakCount).d;return t.combine(e,s+(this.baseIsChar?0:r),o-a),t.combine(i,s+r,n-a),t.w+=this.font.params.scriptspace,t}},e.useIC=!1,e}function qa(t){var e;return e=class extends t{get baseChild(){return this.childNodes[this.node.base]}get scriptChild(){return this.childNodes[1]}getBaseCore(){let t=this.getSemanticBase()||this.childNodes[0],e=null==t?void 0:t.node;for(;t&&(1===t.childNodes.length&&(e.isKind("mrow")||e.isKind("TeXAtom")||e.isKind("mstyle")||e.isKind("mpadded")&&!e.getProperty("vbox")||e.isKind("mphantom")||e.isKind("semantics"))||e.isKind("munderover")&&t.isMathAccent);)this.setBaseAccentsFor(t),t=t.childNodes[0],e=null==t?void 0:t.node;return t||(this.baseHasAccentOver=this.baseHasAccentUnder=!1),t||this.childNodes[0]}setBaseAccentsFor(t){t.node.isKind("munderover")&&(null===this.baseHasAccentOver&&(this.baseHasAccentOver=!!t.node.attributes.get("accent")),null===this.baseHasAccentUnder&&(this.baseHasAccentUnder=!!t.node.attributes.get("accentunder")))}getSemanticBase(){const t=this.node.attributes.getExplicit("data-semantic-fencepointer");return this.getBaseFence(this.baseChild,t)}getBaseFence(t,e){if(!t||!t.node.attributes||!e)return null;if(t.node.attributes.getExplicit("data-semantic-id")===e)return t;for(const i of t.childNodes){const t=this.getBaseFence(i,e);if(t)return t}return null}getBaseScale(){let t=this.baseCore,e=1;for(;t&&t!==this;){e*=t.getOuterBBox().rscale,t=t.parent}return e}getBaseIc(){return this.baseCore.getOuterBBox().ic*this.baseScale}getAdjustedIc(){return this.baseIc?1.05*this.baseIc+.05:0}isCharBase(){const t=this.baseCore;return(t.node.isKind("mo")&&null===t.size||t.node.isKind("mi")||t.node.isKind("mn"))&&1===t.bbox.rscale&&1===Array.from(t.getText()).length}checkLineAccents(){if(this.node.isKind("munderover"))if(this.node.isKind("mover"))this.isLineAbove=this.isLineAccent(this.scriptChild);else if(this.node.isKind("munder"))this.isLineBelow=this.isLineAccent(this.scriptChild);else{const t=this;this.isLineAbove=this.isLineAccent(t.overChild),this.isLineBelow=this.isLineAccent(t.underChild)}}isLineAccent(t){const e=t.coreMO().node;return e.isToken&&"\u2015"===e.getText()}getBaseWidth(){const t=this.baseChild.getLineBBox(this.baseChild.breakCount);return t.w*t.rscale-(this.baseRemoveIc?this.baseIc:0)+this.font.params.extra_ic}getOffset(){return[0,0]}baseCharZero(t){const e=!!this.baseCore.node.attributes.get("largeop"),i=!(!this.baseCore.node.isKind("mo")||!this.baseCore.size),s=this.baseScale;return!this.baseIsChar||e||i||1!==s?t:0}getV(){const t=this.baseCore,e=t.getLineBBox(t.breakCount),i=this.scriptChild.getOuterBBox(),s=this.font.params,r=this.length2em(this.node.attributes.get("subscriptshift"),s.sub1);return Math.max(this.baseCharZero(e.d*this.baseScale+s.sub_drop*i.rscale),r,i.h*i.rscale-.8*s.x_height)}getU(){const t=this.baseCore,e=t.getLineBBox(t.breakCount),i=this.scriptChild.getOuterBBox(),s=this.font.params,r=this.node.attributes.getList("displaystyle","superscriptshift"),n=this.node.getProperty("texprimestyle")?s.sup3:r.displaystyle?s.sup1:s.sup2,o=this.length2em(r.superscriptshift,n);return Math.max(this.baseCharZero(e.h*this.baseScale-s.sup_drop*i.rscale),o,i.d*i.rscale+1/4*s.x_height)}hasMovableLimits(){const t=this.node.attributes.get("displaystyle"),e=this.baseChild.coreMO().node;return!t&&!!e.attributes.get("movablelimits")}getOverKU(t,e){const i=this.node.attributes.get("accent"),s=this.font.params,r=e.d*e.rscale,n=s.rule_thickness*s.separation_factor,o=this.baseHasAccentOver?n:0,a=this.isLineAbove?3*s.rule_thickness:n,l=(i?a:Math.max(s.big_op_spacing1,s.big_op_spacing3-Math.max(0,r)))-o;return[l,t.h*t.rscale+l+r]}getUnderKV(t,e){const i=this.node.attributes.get("accentunder"),s=this.font.params,r=e.h*e.rscale,n=s.rule_thickness*s.separation_factor,o=this.baseHasAccentUnder?n:0,a=this.isLineBelow?3*s.rule_thickness:n,l=(i?a:Math.max(s.big_op_spacing2,s.big_op_spacing4-r))-o;return[l,-(t.d*t.rscale+l+r)]}getDeltaW(t,e=[0,0,0]){const i=this.node.attributes.get("align"),s=t.map((t=>t.w*t.rscale));s[0]-=this.baseRemoveIc&&!this.baseCore.node.attributes.get("largeop")?this.baseIc:0;const r=Math.max(...s),n=[];let o=0;for(const t of s.keys())n[t]=("center"===i?(r-s[t])/2:"right"===i?r-s[t]:0)+e[t],n[t]<o&&(o=-n[t]);if(o)for(const t of n.keys())n[t]+=o;return[1,2].map((e=>n[e]+=t[e]?t[e].dx*t[0].rscale:0)),n}getDelta(t,e=!1){const i=this.node.attributes.get("accent");let{sk:s,ic:r}=this.baseCore.getOuterBBox();return i&&(s-=t.getOuterBBox().sk),((i&&!e?s:0)+this.font.skewIcFactor*r)*this.baseScale}stretchChildren(){const t=[];for(const e of this.childNodes)e.canStretch(lo.Horizontal)&&t.push(e);const e=t.length,i=this.childNodes.length;if(e&&i>1){let s=0;const r=e>1&&e===i;for(const t of this.childNodes){const e=t.stretch.dir===lo.None;if(r||e){const{w:i,rscale:r}=t.getOuterBBox(e);i*r>s&&(s=i*r)}}for(const e of t){const t=e.coreMO();null===t.size&&t.getStretchedVariant([s/e.coreRScale()])}}}constructor(t,e,i=null){super(t,e,i),this.baseScale=1,this.baseIc=0,this.baseRemoveIc=!1,this.baseIsChar=!1,this.baseHasAccentOver=null,this.baseHasAccentUnder=null,this.isLineAbove=!1,this.isLineBelow=!1,this.isMathAccent=!1;const s=this.baseCore=this.getBaseCore();s&&(this.setBaseAccentsFor(s),this.baseScale=this.getBaseScale(),this.baseIc=this.getBaseIc(),this.baseIsChar=this.isCharBase(),this.isMathAccent=this.baseIsChar&&this.scriptChild&&void 0!==this.scriptChild.coreMO().node.getProperty("mathaccent"),this.checkLineAccents(),this.baseRemoveIc=!this.isLineAbove&&!this.isLineBelow&&(!this.constructor.useIC||this.isMathAccent))}computeBBox(t,e=!1){t.empty(),t.append(this.baseChild.getOuterBBox()),this.appendScripts(t),t.clean(),this.setChildPWidths(e)}appendScripts(t){const e=this.getBaseWidth(),[i,s]=this.getOffset();return t.combine(this.scriptChild.getOuterBBox(),e+i,s),t.w+=this.font.params.scriptspace,t}get breakCount(){return this._breakCount<0&&(this._breakCount=this.node.isEmbellished?this.coreMO().embellishedBreakCount:this.node.linebreakContainer?0:this.childNodes[0].breakCount),this._breakCount}breakTop(t,e){return this.node.linebreakContainer||!this.parent||this.node.childIndex(e.node)?t:this.parent.breakTop(t,this)}computeLineBBox(t){const e=this.breakCount;if(!e)return go.from(this.getOuterBBox(),this.linebreakOptions.lineleading);const i=this.baseChild.getLineBBox(t).copy();return t<e?(0===t&&this.addLeftBorders(i),this.addMiddleBorders(i)):(this.appendScripts(i),this.addMiddleBorders(i),this.addRightBorders(i)),i}},e.useIC=!0,e}const Wa=function(){var t;const e=qa(Io);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;this.dom=this.standardChtmlNodes(t);const[e,i]=this.getOffset(),s=e-(this.baseRemoveIc?this.baseIc:0),r={"vertical-align":this.em(i)};s&&(r["margin-left"]=this.em(s)),this.baseChild.toCHTML(this.dom);const n=this.dom[this.dom.length-1];this.scriptChild.toCHTML([this.adaptor.append(n,this.html("mjx-script",{style:r}))])}markUsed(){super.markUsed(),this.jax.wrapperUsage.add(za.kind)}setDeltaW(t,e){for(let i=0;i<e.length;i++)e[i]&&this.adaptor.setStyle(t[i],"paddingLeft",this.em(e[i]))}adjustOverDepth(t,e){e.d>=0||this.adaptor.setStyle(t,"marginBottom",this.em(e.d*e.rscale))}adjustUnderDepth(t,e){if(e.d>=0)return;const i=this.adaptor,s=this.em(e.d),r=this.html("mjx-box",{style:{"margin-bottom":s,"vertical-align":s}});for(const e of i.childNodes(i.firstChild(t)))i.append(r,e);i.append(i.firstChild(t),r)}adjustBaseHeight(t,e){if(this.node.attributes.get("accent")){const i=this.font.params.x_height*this.baseScale;e.h<i&&(this.adaptor.setStyle(t,"paddingTop",this.em(i-e.h)),e.h=i)}}}).kind="scriptbase",t}(),Va=function(){var t;const e=Fa(Wa);return(t=class extends e{}).kind=vr.prototype.kind,t}(),Xa=function(){var t;const e=Ua(Wa);return(t=class extends e{}).kind=Tr.prototype.kind,t}(),za=function(){var t;const e=Ha(Wa);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;const e=this.adaptor,i=this.standardChtmlNodes(t),[s,r,n]=[this.baseChild,this.supChild,this.subChild],[,o,a]=this.getUVQ(),l={"vertical-align":this.em(o)};s.toCHTML(i);const c=e.append(i[i.length-1],this.html("mjx-script",{style:l}));r.toCHTML([c]),e.append(c,this.html("mjx-spacer",{style:{"margin-top":this.em(a)}})),n.toCHTML([c]);const h=this.getAdjustedIc();h&&(e.setStyle(r.dom[0],"marginLeft",this.em(h/r.bbox.rscale)),this.baseIsChar||e.setStyle(n.dom[0],"marginLeft",this.em(h/r.bbox.rscale))),this.baseRemoveIc&&e.setStyle(c,"marginLeft",this.em(-this.baseIc))}}).kind=Nr.prototype.kind,t.styles={"mjx-script":{display:"inline-block","padding-right":".05em","padding-left":".033em"},"mjx-script > mjx-spacer":{display:"block"}},t}();function Ga(t){return class extends t{get scriptChild(){return this.childNodes[this.node.under]}constructor(...t){super(...t),this.stretchChildren()}computeBBox(t,e=!1){if(this.hasMovableLimits())return void super.computeBBox(t,e);t.empty();const i=this.baseChild.getOuterBBox(),s=this.scriptChild.getOuterBBox(),r=this.getUnderKV(i,s)[1],n=this.isLineBelow?0:this.getDelta(this.scriptChild,!0),[o,a]=this.getDeltaW([i,s],[0,-n]);t.combine(i,o,0),t.combine(s,a,r),t.d+=this.font.params.big_op_spacing5,t.clean(),this.setChildPWidths(e)}}}function Ja(t){return class extends t{get scriptChild(){return this.childNodes[this.node.over]}constructor(...t){super(...t),this.stretchChildren()}computeBBox(t){if(this.hasMovableLimits())return void super.computeBBox(t);t.empty();const e=this.baseChild.getOuterBBox(),i=this.scriptChild.getOuterBBox();this.node.attributes.get("accent")&&(e.h=Math.max(e.h,this.font.params.x_height*this.baseScale));const s=this.getOverKU(e,i)[1],r=this.isLineAbove?0:this.getDelta(this.scriptChild),[n,o]=this.getDeltaW([e,i],[0,r]);t.combine(e,n,0),t.combine(i,o,s),t.h+=this.font.params.big_op_spacing5,t.clean()}}}function Ka(t){return class extends t{get underChild(){return this.childNodes[this.node.under]}get overChild(){return this.childNodes[this.node.over]}get subChild(){return this.underChild}get supChild(){return this.overChild}constructor(...t){super(...t),this.stretchChildren()}computeBBox(t){if(this.hasMovableLimits())return void super.computeBBox(t);t.empty();const e=this.overChild.getOuterBBox(),i=this.baseChild.getOuterBBox(),s=this.underChild.getOuterBBox();this.node.attributes.get("accent")&&(i.h=Math.max(i.h,this.font.params.x_height*this.baseScale));const r=this.getOverKU(i,e)[1],n=this.getUnderKV(i,s)[1],o=this.getDelta(this.overChild),a=this.getDelta(this.underChild,!0),[l,c,h]=this.getDeltaW([i,s,e],[0,this.isLineBelow?0:-a,this.isLineAbove?0:o]);t.combine(i,l,0),t.combine(e,h,r),t.combine(s,c,n);const d=this.font.params.big_op_spacing5;t.h+=d,t.d+=d,t.clean()}}}const $a=function(){var t;const e=Ga(Va);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;if(this.hasMovableLimits())return super.toCHTML(t),void this.adaptor.setAttribute(this.dom[0],"limits","false");this.dom=this.standardChtmlNodes(t);const e=this.adaptor.append(this.adaptor.append(this.dom[0],this.html("mjx-row")),this.html("mjx-base")),i=this.adaptor.append(this.adaptor.append(this.dom[0],this.html("mjx-row")),this.html("mjx-under"));this.baseChild.toCHTML([e]),this.scriptChild.toCHTML([i]);const s=this.baseChild.getOuterBBox(),r=this.scriptChild.getOuterBBox(),n=this.getUnderKV(s,r)[0],o=this.isLineBelow?0:this.getDelta(this.scriptChild,!0);this.adaptor.setStyle(i,"paddingTop",this.em(n)),this.setDeltaW([e,i],this.getDeltaW([s,r],[0,-o])),this.adjustUnderDepth(i,r)}}).kind=Lr.prototype.kind,t.styles={"mjx-over":{"text-align":"left"},'mjx-munder:not([limits="false"])':{display:"inline-table"},"mjx-munder > mjx-row":{"text-align":"left"},"mjx-under":{"padding-bottom":".1em"}},t}(),Ya=function(){var t;const e=Ja(Xa);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;if(this.hasMovableLimits())return super.toCHTML(t),void this.adaptor.setAttribute(this.dom[0],"limits","false");this.dom=this.standardChtmlNodes(t);const e=this.adaptor.append(this.dom[0],this.html("mjx-over")),i=this.adaptor.append(this.dom[0],this.html("mjx-base"));this.scriptChild.toCHTML([e]),this.baseChild.toCHTML([i]);const s=this.scriptChild.getOuterBBox(),r=this.baseChild.getOuterBBox();this.adjustBaseHeight(i,r);const n=this.getOverKU(r,s)[0],o=this.isLineAbove?0:this.getDelta(this.scriptChild);this.adaptor.setStyle(e,"paddingBottom",this.em(n)),this.setDeltaW([i,e],this.getDeltaW([r,s],[0,o])),this.adjustOverDepth(e,s)}}).kind=Cr.prototype.kind,t.styles={'mjx-mover:not([limits="false"])':{"padding-top":".1em"},[["base","over"].map((t=>`mjx-mover:not([limits="false"]) > mjx-${t}`)).join(", ")]:{display:"block","text-align":"left"}},t}(),Qa=function(){var t;const e=Ka(za);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;if(this.hasMovableLimits())return super.toCHTML(t),void this.adaptor.setAttribute(this.dom[0],"limits","false");this.dom=this.standardChtmlNodes(t);const e=this.adaptor.append(this.dom[0],this.html("mjx-over")),i=this.adaptor.append(this.adaptor.append(this.dom[0],this.html("mjx-box")),this.html("mjx-munder")),s=this.adaptor.append(this.adaptor.append(i,this.html("mjx-row")),this.html("mjx-base")),r=this.adaptor.append(this.adaptor.append(i,this.html("mjx-row")),this.html("mjx-under"));this.overChild.toCHTML([e]),this.baseChild.toCHTML([s]),this.underChild.toCHTML([r]);const n=this.overChild.getOuterBBox(),o=this.baseChild.getOuterBBox(),a=this.underChild.getOuterBBox();this.adjustBaseHeight(s,o);const l=this.getOverKU(o,n)[0],c=this.getUnderKV(o,a)[0],h=this.getDelta(this.overChild),d=this.getDelta(this.underChild,!0);this.adaptor.setStyle(e,"paddingBottom",this.em(l)),this.adaptor.setStyle(r,"paddingTop",this.em(c)),this.setDeltaW([s,r,e],this.getDeltaW([o,a,n],[0,this.isLineBelow?0:-d,this.isLineAbove?0:h])),this.adjustOverDepth(e,n),this.adjustUnderDepth(r,a)}}).kind=_r.prototype.kind,t.styles={'mjx-munderover:not([limits="false"])':{"padding-top":".1em"},[["over","box"].map((t=>`mjx-munderover:not([limits="false"]) > mjx-${t}`)).join(", ")]:{display:"block"}},t}(),Za={base:"subList",subList:"supList",supList:"subList",psubList:"psupList",psupList:"psubList"},tl=["sup","sup","psup","psub"];function el(t){return class extends t{combinePrePost(t,e){const i=new Dn(t);return i.combine(e,0,0),i}getScriptData(){const t=this.scriptData={base:null,sub:Dn.empty(),sup:Dn.empty(),psub:Dn.empty(),psup:Dn.empty(),numPrescripts:0,numScripts:0},e=this.getScriptBBoxLists();this.combineBBoxLists(t.sub,t.sup,e.subList,e.supList),this.combineBBoxLists(t.psub,t.psup,e.psubList,e.psupList),t.base=e.base[0],t.numPrescripts=e.psubList.length,t.numScripts=e.subList.length}getScriptBBoxLists(){const t={base:[],subList:[],supList:[],psubList:[],psupList:[]};let e="base";for(const i of this.childNodes)i.node.isKind("mprescripts")?e="psubList":(t[e].push(i.getOuterBBox()),e=Za[e]);return this.firstPrescript=t.subList.length+t.supList.length+2,this.padLists(t.subList,t.supList),this.padLists(t.psubList,t.psupList),t}padLists(t,e){t.length>e.length&&e.push(Dn.empty())}combineBBoxLists(t,e,i,s){for(let r=0;r<i.length;r++){const[n,o,a]=this.getScaledWHD(i[r]),[l,c,h]=this.getScaledWHD(s[r]),d=Math.max(n,l);t.w+=d,e.w+=d,o>t.h&&(t.h=o),a>t.d&&(t.d=a),c>e.h&&(e.h=c),h>e.d&&(e.d=h)}}getScaledWHD(t){const{w:e,h:i,d:s,rscale:r}=t;return[e*r,i*r,s*r]}getCombinedUV(){const t=this.scriptData,e=this.combinePrePost(t.sub,t.psub),i=this.combinePrePost(t.sup,t.psup);return this.getUVQ(e,i)}addPrescripts(t,e,i){const s=this.scriptData;if(s.numPrescripts){const r=this.font.params.scriptspace;t.combine(s.psup,r,e),t.combine(s.psub,r,i)}return t}addPostscripts(t,e,i){const s=this.scriptData;if(s.numScripts){const r=t.w;t.combine(s.sup,r,e),t.combine(s.sub,r,i),t.w+=this.font.params.scriptspace}return t}constructor(...t){super(...t),this.scriptData=null,this.firstPrescript=0,this.getScriptData()}appendScripts(t){t.empty();const[e,i]=this.getCombinedUV();return this.addPrescripts(t,e,i),t.append(this.scriptData.base),this.addPostscripts(t,e,i),t.clean(),t}computeLineBBox(t){const e=this.baseChild.breakCount,i=this.baseChild.getLineBBox(t).copy();let s=i;const[r,n]=this.getCombinedUV();return 0===t?(s=go.from(this.addPrescripts(Dn.zero(),r,n),this.linebreakOptions.lineleading),s.append(i),this.addLeftBorders(s),s.L=this.bbox.L):t===e&&(s=this.addPostscripts(s,r,n),this.addRightBorders(s),s.R=this.bbox.R),this.addMiddleBorders(s),s}getUVQ(t,e){if(!this.UVQ){let[i,s,r]=[0,0,0];0===t.w?i=this.getU():0===e.w?i=-this.getV():[i,s,r]=super.getUVQ(t,e),this.UVQ=[i,s,r]}return this.UVQ}}}const il=function(){var t;const e=el(za);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;const e=this.standardChtmlNodes(t),i=this.scriptData,s=this.node.getProperty("scriptalign")||"right left",[r,n]=ir(s+" "+s),[o,a]=this.getCombinedUV();if(i.numPrescripts){const t=this.addScripts(this.dom[0],o,-a,!0,i.psub,i.psup,this.firstPrescript,i.numPrescripts);"right"!==r&&this.adaptor.setAttribute(t,"script-align",r)}if(this.childNodes[0].toCHTML(e),i.numScripts){const t=this.addScripts(this.dom[this.dom.length-1],o,-a,!1,i.sub,i.sup,1,i.numScripts);"left"!==n&&this.adaptor.setAttribute(t,"script-align",n)}}addScripts(t,e,i,s,r,n,o,a){const l=this.adaptor,c=e-n.d+(i-r.h),h=e<0&&0===i?r.h+e:e,d=c>0?{style:{height:this.em(c)}}:{},u=h?{style:{"vertical-align":this.em(h)}}:{},p=this.html("mjx-row"),m=this.html("mjx-row",d),f=this.html("mjx-row"),g="mjx-"+(s?"pre":"")+"scripts",b=o+2*a;for(;o<b;)this.childNodes[o++].toCHTML([l.append(f,this.html("mjx-cell"))]),this.childNodes[o++].toCHTML([l.append(p,this.html("mjx-cell"))]);return l.append(t,this.html(g,u,[p,m,f]))}}).kind=Rr.prototype.kind,t.styles={"mjx-prescripts":{display:"inline-table","padding-left":".05em"},"mjx-scripts":{display:"inline-table","padding-right":".05em"},"mjx-prescripts > mjx-row > mjx-cell":{"text-align":"right"},'[script-align="left"] > mjx-row > mjx-cell':{"text-align":"left"},'[script-align="center"] > mjx-row > mjx-cell':{"text-align":"center"},'[script-align="right"] > mjx-row > mjx-cell':{"text-align":"right"},"mjx-none":{display:"inline-block",height:"1px"}},t}(),sl=.333;function rl(t){return class extends t{get tableRows(){return this.childNodes}findContainer(){let t=this,e=t.parent;for(;e&&(e.node.notParent||e.node.isKind("mrow"));)t=e,e=e.parent;this.container=e,this.containerI=t.node.childPosition()}getPercentageWidth(){if(this.hasLabels)this.bbox.pwidth=Dn.fullWidth;else{const t=this.node.attributes.get("width");er(t)&&(this.bbox.pwidth=t)}}stretchRows(){const t=this.node.attributes.get("equalrows"),e=t?this.getEqualRowHeight():0,{H:i,D:s}=t?this.getTableData():{H:[0],D:[0]},r=this.tableRows;for(let n=0;n<this.numRows;n++){const o=t?[(e+i[n]-s[n])/2,(e-i[n]+s[n])/2]:null;r[n].stretchChildren(o)}}stretchColumns(){const t=this.getColumnAttributes("columnwidth",0);for(let e=0;e<this.numCols;e++){const i="number"==typeof this.cWidths[e]?this.cWidths[e]:null;this.stretchColumn(e,i),null!==i&&this.breakColumn(e,i,t[e])}}stretchColumn(t,e){const i=[];for(const e of this.tableRows){const s=e.getChild(t);if(s){const t=s.childNodes[0];t.stretch.dir===lo.None&&t.canStretch(lo.Horizontal)&&i.push(t)}}const s=i.length;if(s&&null===e){e=0;const i=s===this.childNodes.length;for(const s of this.tableRows){const r=s.getChild(t);if(r){const t=r.childNodes[0],s=t.stretch.dir===lo.None;if(i||s){const{w:i}=t.getBBox(s);i>e&&(e=i)}}}}if(null!==e){const s=this.getTableData().W;for(const r of i){const i=r.getBBox().w;r.coreMO().getStretchedVariant([Math.max(e,i)/r.coreRScale()]),i>s[t]&&(s[t]=i)}}}breakColumn(t,e,i){if("linebreak"!==this.jax.math.root.attributes.get("overflow")||!this.jax.math.display)return;const{H:s,D:r}=this.getTableData();let n=0,o=0;for(const i of this.tableRows){const a=i.getChild(t);if(a){const l=i.getBBox().rscale,c=a.getBBox();if(a&&c.w*l>e){a.childNodes[0].breakToWidth(e);const o=i.node.attributes.get("rowalign");this.updateHDW(a,t,n,o,s,r)}c.w*l>o&&(o=c.w*l)}const l=i.getBBox();l.h=s[n],l.d=r[n],n++}("fit"===i||"auto"===i||er(i)||o>this.cWidths[t])&&(this.cWidths[t]=o)}getTableData(){if(this.data)return this.data;const t=new Array(this.numRows).fill(0),e=new Array(this.numRows).fill(0),i=new Array(this.numCols).fill(0),s=new Array(this.numRows),r=new Array(this.numRows),n=[0],o=this.tableRows;for(let a=0;a<o.length;a++){const l=o[a],c=l.node.attributes.get("rowalign");for(let s=0;s<l.numCells;s++){const r=l.getChild(s);this.updateHDW(r,s,a,c,t,e,i),this.recordPWidthCell(r,s)}s[a]=t[a],r[a]=e[a],l.labeled&&this.updateHDW(l.childNodes[0],0,a,c,t,e,n),l.bbox.h=t[a],l.bbox.d=e[a]}const a=n[0];return this.data={H:t,D:e,W:i,NH:s,ND:r,L:a},this.data}updateHDW(t,e,i,s,r,n,o=null){let{h:a,d:l,w:c}=t.getBBox();const h=t.parent.bbox.rscale;1!==t.parent.bbox.rscale&&(a*=h,l*=h,c*=h),this.node.getProperty("useHeight")&&(a<.75&&(a=.75),l<.25&&(l=.25)),s=t.node.attributes.get("rowalign")||s,Object.hasOwn(this.adjustHD,s)||(s="other"),this.adjustHD[s](a,l,r,n,i),o&&c>o[e]&&(o[e]=c)}recordPWidthCell(t,e){t.childNodes[0]&&t.childNodes[0].getBBox().pwidth&&this.pwidthCells.push([t,e])}setColumnPWidths(){const t=this.cWidths;for(const[e,i]of this.pwidthCells)e.setChildPWidths(!1,t[i])&&(e.invalidateBBox(),e.getBBox())}getBBoxHD(t){const[e,i]=this.getAlignmentRow();if(null===i){const i=this.font.params.axis_height,s=t/2;return{top:[0,t],center:[s,s],bottom:[t,0],baseline:[s,s],axis:[s+i,s-i]}[e]||[s,s]}{const s=this.getVerticalPosition(i,e);return[s,t-s]}}getBBoxLR(){var t;if(this.hasLabels){const t=this.node.attributes,e=t.get("side");let[i,s]=this.getPadAlignShift(e);const r=this.hasLabels&&!!t.get("data-width-includes-label");return r&&this.frame&&this.fSpace[0]&&(i-=this.fSpace[0]),"center"!==s||r?"left"===e?[i,0]:[0,i]:[i,i]}return[(null===(t=this.bbox)||void 0===t?void 0:t.L)||0,0]}getPadAlignShift(t){const{L:e}=this.getTableData();let i=e+this.length2em(this.node.attributes.get("minlabelspacing"));const[s,r]=null==this.styles?["",""]:[this.styles.get("padding-left"),this.styles.get("padding-right")];(s||r)&&(i=Math.max(i,this.length2em(s||"0"),this.length2em(r||"0")));let[n,o]=this.getAlignShift();return n===t&&(o="left"===t?Math.max(i,o)-i:Math.min(-i,o)+i),[i,n,o]}getWidth(){return this.pWidth||this.getBBox().w}adjustWideTable(){const t=this.node.attributes;if("auto"!==t.get("width"))return;const[e,i]=this.getPadAlignShift(t.get("side")),s=Math.max(this.containerWidth/10,this.containerWidth-e-("center"===i?e:0));this.naturalWidth()>s&&this.adjustColumnWidths(s)}naturalWidth(){return io(this.getComputedWidths().concat(this.cLines,this.cSpace))+2*this.fLine+this.fSpace[0]+this.fSpace[2]}getEqualRowHeight(){const{H:t,D:e}=this.getTableData(),i=Array.from(t.keys()).map((i=>t[i]+e[i]));return Math.max(...i)}getComputedWidths(){const t=this.getTableData().W;let e=Array.from(t.keys()).map((e=>"number"==typeof this.cWidths[e]?this.cWidths[e]:t[e]));return this.node.attributes.get("equalcolumns")&&(e=Array(e.length).fill(so(e))),e}getColumnWidths(){const t=this.node.attributes.get("width");if(this.node.attributes.get("equalcolumns"))return this.getEqualColumns(t);const e=this.getColumnAttributes("columnwidth",0);return"auto"===t?this.getColumnWidthsAuto(e):er(t)?this.getColumnWidthsPercent(e):this.getColumnWidthsFixed(e,this.length2em(t))}getEqualColumns(t){const e=Math.max(1,this.numCols);let i;if("auto"===t){const{W:t}=this.getTableData();i=so(t)}else if(er(t))i=this.percent(1/e);else{const s=io([].concat(this.cLines,this.cSpace))+this.fSpace[0]+this.fSpace[2];i=Math.max(0,this.length2em(t)-s)/e}return Array(this.numCols).fill(i)}getColumnWidthsAuto(t){return t.map((t=>"auto"===t||"fit"===t?null:er(t)?t:this.length2em(t)))}getColumnWidthsPercent(t){const e=t.includes("fit"),{W:i}=e?this.getTableData():{W:null};return Array.from(t.keys()).map((s=>{const r=t[s];return"fit"===r?null:"auto"===r?e?i[s]:null:er(r)?r:this.length2em(r)}))}getColumnWidthsFixed(t,e){const i=Array.from(t.keys()),s=i.filter((e=>"fit"===t[e])),r=i.filter((e=>"auto"===t[e])),n=s.length||r.length,{W:o}=n?this.getTableData():{W:null},a=e-io([].concat(this.cLines,this.cSpace))-this.fSpace[0]-this.fSpace[2];let l=a;i.forEach((e=>{const i=t[e];l-="fit"===i||"auto"===i?o[e]:this.length2em(i,a)}));const c=n&&l>0?l/n:0;return i.map((e=>{const i=t[e];return"fit"===i?o[e]+c:"auto"===i?o[e]+(0===s.length?c:0):this.length2em(i,a)}))}adjustColumnWidths(t){const{W:e}=this.getTableData(),i=this.getColumnAttributes("columnwidth",0),s=Array.from(i.keys()),r=[...s.filter((t=>"fit"===i[t])).sort(((t,i)=>e[i]-e[t])),...s.filter((t=>"auto"===i[t])).sort(((t,i)=>e[i]-e[t])),...s.filter((t=>er(i[t]))).sort(((t,i)=>e[i]-e[t])),...s.filter((t=>"fit"!==i[t]&&"auto"!==i[t]&&!er(i[t]))).sort(((t,i)=>e[i]-e[t]))];if(!r.length)return;this.cWidths=s.map((t=>"number"==typeof this.cWidths[t]?this.cWidths[t]:e[t]));const n=t-io([].concat(this.cLines,this.cSpace))-this.fSpace[0]-this.fSpace[2];let o=io(this.cWidths)-n,a=0,l=0;for(;l<r.length&&(a+=e[r[l++]],!(a&&o/a<sl)););o=1-o/a,r.slice(0,l).forEach((t=>this.cWidths[t]*=o))}getVerticalPosition(t,e){const i=this.node.attributes.get("equalrows"),{H:s,D:r}=this.getTableData(),n=i?this.getEqualRowHeight():0,o=this.getRowHalfSpacing();let a=this.fLine;for(let e=0;e<t;e++)a+=o[e]+(i?n:s[e]+r[e])+o[e+1]+this.rLines[e];const[l,c]=i?[(n+s[t]-r[t])/2,(n-s[t]+r[t])/2]:[s[t],r[t]];return a+={top:0,center:o[t]+(l+c)/2,bottom:o[t]+l+c+o[t+1],baseline:o[t]+l,axis:o[t]+l-.25}[e]||0,a}getFrameSpacing(){const t=this.fframe?this.convertLengths(this.getAttributeArray("framespacing")):[0,0];t[2]=t[0];const e=this.node.attributes.get("data-array-padding");if(e){const[i,s]=this.convertLengths(ir(e));t[0]=i,t[2]=s}return t}getEmHalfSpacing(t,e,i=1){const s=this.addEm(e,2/i);return s.unshift(this.em(t[0]*i)),s.push(this.em(t[1]*i)),s}getRowHalfSpacing(){const t=this.rSpace.map((t=>t/2));return t.unshift(this.fSpace[1]),t.push(this.fSpace[1]),t}getColumnHalfSpacing(){const t=this.cSpace.map((t=>t/2));return t.unshift(this.fSpace[0]),t.push(this.fSpace[2]),t}getAlignmentRow(){const[t,e]=ir(this.node.attributes.get("align"));if(null==e)return[t,null];let i=parseInt(e);return i<0&&(i+=this.numRows+1),[t,i<1||i>this.numRows?null:i-1]}getColumnAttributes(t,e=1){const i=this.numCols-e,s=this.getAttributeArray(t);if(0===s.length)return null;for(;s.length<i;)s.push(s[s.length-1]);return s.length>i&&s.splice(i),s}getRowAttributes(t,e=1){const i=this.numRows-e,s=this.getAttributeArray(t);if(0===s.length)return null;for(;s.length<i;)s.push(s[s.length-1]);return s.length>i&&s.splice(i),s}getAttributeArray(t){const e=this.node.attributes.get(t);return e?ir(e):[this.node.attributes.getDefault(t)]}addEm(t,e=1){return t?t.map((t=>this.em(t/e))):null}convertLengths(t){return t?t.map((t=>this.length2em(t))):null}constructor(t,e,i=null){super(t,e,i),this.numCols=0,this.numRows=0,this.data=null,this.pwidthCells=[],this.pWidth=0,this.adjustHD={top:(t,e,i,s,r)=>{t>i[r]&&(s[r]-=t-i[r],i[r]=t),t+e>i[r]+s[r]&&(s[r]=t+e-i[r])},bottom:(t,e,i,s,r)=>{e>s[r]&&(i[r]-=e-s[r],s[r]=e),t+e>i[r]+s[r]&&(i[r]=t+e-s[r])},center:(t,e,i,s,r)=>{t+e>i[r]+s[r]&&(i[r]=s[r]=(t+e)/2)},other:(t,e,i,s,r)=>{t>i[r]&&(i[r]=t),e>s[r]&&(s[r]=e)}},this.numCols=so(this.tableRows.map((t=>t.numCells))),this.numRows=this.childNodes.length,this.hasLabels=this.childNodes.reduce(((t,e)=>t||e.node.isKind("mlabeledtr")),!1),this.findContainer(),this.isTop=!this.container||this.container.node.isKind("math")&&!this.container.parent,this.isTop&&(this.jax.table=this),this.getPercentageWidth();const s=this.node.attributes,r=s.get("frame");this.frame="none"!==r,this.fframe=this.frame||void 0!==s.get("data-frame-styles"),this.fLine=this.frame?.07:0,this.fSpace=this.getFrameSpacing(),this.cSpace=this.convertLengths(this.getColumnAttributes("columnspacing")),this.rSpace=this.convertLengths(this.getRowAttributes("rowspacing")),this.cLines=this.getColumnAttributes("columnlines").map((t=>"none"===t?0:.07)),this.rLines=this.getRowAttributes("rowlines").map((t=>"none"===t?0:.07)),this.cWidths=this.getColumnWidths(),this.adjustWideTable(),this.stretchColumns(),this.stretchRows()}getStyles(){super.getStyles();const t=this.node.attributes.get("data-frame-styles");if(!t)return;this.styles||(this.styles=new eo(""));const e=t.split(/ /);for(const t of Vn.keys()){const i=e[t];"none"!==i&&this.styles.set(`border-${Vn[t]}`,`.07em ${i}`)}}computeBBox(t,e=!1){const{H:i,D:s}=this.getTableData();let r,n;if(this.node.attributes.get("equalrows")){const t=this.getEqualRowHeight();r=io([].concat(this.rLines,this.rSpace))+t*this.numRows}else r=io(i.concat(s,this.rLines,this.rSpace));r+=2*(this.fLine+this.fSpace[1]),n=this.naturalWidth();const o=this.node.attributes.get("width");"auto"!==o&&(n=Math.max(this.length2em(o,0)+2*this.fLine,n));const[a,l]=this.getBBoxHD(r);t.h=a,t.d=l,t.w=n;const[c,h]=this.getBBoxLR();t.L=c,t.R=h,er(o)||this.setColumnPWidths()}setChildPWidths(t,e,i){const s=this.node.attributes.get("width");if(!er(s))return!1;this.hasLabels||(this.bbox.pwidth="",this.container.bbox.pwidth="");const{w:r,L:n,R:o}=this.bbox,a=this.node.attributes.get("data-width-includes-label"),l=Math.max(r,this.length2em(s,Math.max(e,n+r+o)))-(a?n+o:0),c=this.node.attributes.get("equalcolumns")?Array(this.numCols).fill(this.percent(1/Math.max(1,this.numCols))):this.getColumnAttributes("columnwidth",0);return this.cWidths=this.getColumnWidthsFixed(c,l),this.pWidth=this.naturalWidth(),this.isTop&&(this.bbox.w=this.pWidth),this.setColumnPWidths(),this.pWidth!==r&&this.parent.invalidateBBox(),this.pWidth!==r}getAlignShift(){return this.isTop?super.getAlignShift():[this.container.getChildAlign(this.containerI),0]}}}const nl=function(){var t;const e=rl(Io);return t=class extends e{constructor(t,e,i=null){super(t,e,i),this.itable=this.html("mjx-itable"),this.labels=this.html("mjx-itable")}getAlignShift(){const t=super.getAlignShift();return this.isTop||(t[1]=0),t}toCHTML(t){const e=this.standardChtmlNodes(t);this.adaptor.append(e[0],this.html("mjx-table",{},[this.itable]));for(const t of this.childNodes)t.toCHTML([this.itable]);this.padRows(),this.handleColumnSpacing(),this.handleColumnLines(),this.handleColumnWidths(),this.handleRowSpacing(),this.handleRowLines(),this.handleRowHeights(),this.handleFrame(),this.handleWidth(),this.handleLabels(),this.handleAlign(),this.handleJustify(),this.shiftColor()}shiftColor(){const t=this.adaptor,e=t.getStyle(this.dom[0],"backgroundColor");e&&(t.setStyle(this.dom[0],"backgroundColor",""),t.setStyle(this.itable,"backgroundColor",e))}padRows(){const t=this.adaptor;for(const e of t.childNodes(this.itable))for(;t.childNodes(e).length<this.numCols;)t.append(e,this.html("mjx-mtd",{extra:!0}))}handleColumnSpacing(){const t=this.childNodes[0]?1/this.childNodes[0].getBBox().rscale:1,e=this.getEmHalfSpacing([this.fSpace[0],this.fSpace[2]],this.cSpace,t);for(const t of this.tableRows){let i=0;for(const s of t.tableCells){const r=e[i++],n=e[i],o=s?s.dom[0]:this.adaptor.childNodes(t.dom[0])[i];(i>1&&"0.4em"!==r||"0"!==r&&1===i)&&this.adaptor.setStyle(o,"paddingLeft",r),(i<this.numCols&&"0.4em"!==n||"0"!==n&&i===this.numCols)&&this.adaptor.setStyle(o,"paddingRight",n)}}}handleColumnLines(){if("none"===this.node.attributes.get("columnlines"))return;const t=this.getColumnAttributes("columnlines");for(const e of this.childNodes){let i=0;const s=this.adaptor.childNodes(e.dom[0]).slice(1);for(const e of s){const s=t[i++];"none"!==s&&this.adaptor.setStyle(e,"borderLeft",".07em "+s)}}}handleColumnWidths(){for(const t of this.childNodes){let e=0;for(const i of this.adaptor.childNodes(t.dom[0])){const t=this.cWidths[e++];if(null!==t){const e="number"==typeof t?this.em(t):t;this.adaptor.setStyle(i,"width",e),this.adaptor.setStyle(i,"maxWidth",e),this.adaptor.setStyle(i,"minWidth",e)}}}}handleRowSpacing(){const t=this.childNodes[0]?1/this.childNodes[0].getBBox().rscale:1,e=this.getEmHalfSpacing([this.fSpace[1],this.fSpace[1]],this.rSpace,t),i=this.fframe;let s=0;for(const t of this.childNodes){const r=e[s++],n=e[s];for(const e of t.childNodes)(s>1&&"0.215em"!==r||i&&1===s)&&this.adaptor.setStyle(e.dom[0],"paddingTop",r),(s<this.numRows&&"0.215em"!==n||i&&s===this.numRows)&&this.adaptor.setStyle(e.dom[0],"paddingBottom",n)}}handleRowLines(){if("none"===this.node.attributes.get("rowlines"))return;const t=this.getRowAttributes("rowlines");let e=0;for(const i of this.childNodes.slice(1)){const s=t[e++];if("none"!==s)for(const t of this.adaptor.childNodes(i.dom[0]))this.adaptor.setStyle(t,"borderTop",".07em "+s)}}handleRowHeights(){this.node.attributes.get("equalrows")&&this.handleEqualRows()}handleEqualRows(){const t=this.getRowHalfSpacing(),{H:e,D:i,NH:s,ND:r}=this.getTableData(),n=this.getEqualRowHeight();for(let o=0;o<this.numRows;o++){const a=this.childNodes[o];this.setRowHeight(a,n+t[o]+t[o+1]+this.rLines[o]),n!==s[o]+r[o]&&this.setRowBaseline(a,n,(n-e[o]+i[o])/2)}}setRowHeight(t,e){this.adaptor.setStyle(t.dom[0],"height",this.em(e))}setRowBaseline(t,e,i){const s=t.node.attributes.get("rowalign");for(const r of t.childNodes)if(this.setCellBaseline(r,s,e,i))break}setCellBaseline(t,e,i,s){const r=t.node.attributes.get("rowalign");if("baseline"===r||"axis"===r){const r=this.adaptor,n=r.lastChild(t.dom[0]);r.setStyle(n,"height",this.em(i)),r.setStyle(n,"verticalAlign",this.em(-s));const o=t.parent;if(!(o.node.isKind("mlabeledtr")&&t===o.childNodes[0]||"baseline"!==e&&"axis"!==e))return!0}return!1}handleFrame(){if(this.frame&&this.fLine){const t=this.node.attributes.get("frame");this.adaptor.setStyle(this.itable,"border",`${this.em(this.fLine)} ${t}`)}}handleWidth(){const t=this.adaptor,e=this.dom[0],{w:i,L:s,R:r}=this.getBBox();t.setStyle(e,"minWidth",this.em(s+i+r));let n=this.node.attributes.get("width");if(er(n))t.setStyle(e,"width",""),t.setAttribute(e,"width","full");else if(!this.hasLabels){if("auto"===n)return;n=this.em(this.length2em(n)+2*this.fLine)}const o=t.firstChild(e);if(t.setStyle(o,"width",n),t.setStyle(o,"minWidth",this.em(i)),s||r){t.setStyle(e,"margin","");const i=this.node.attributes.get("data-width-includes-label")?"padding":"margin";s===r?t.setStyle(o,i,"0 "+this.em(r)):t.setStyle(o,i,"0 "+this.em(r)+" 0 "+this.em(s))}t.setAttribute(this.itable,"width","full")}handleAlign(){const[t,e]=this.getAlignmentRow(),i=this.dom[0];if(null===e)"axis"!==t&&this.adaptor.setAttribute(i,"align",t);else{const s=this.getVerticalPosition(e,t);this.adaptor.setAttribute(i,"align","top"),this.adaptor.setStyle(i,"verticalAlign",this.em(s))}}handleJustify(){const t=this.getAlignShift()[0];"center"!==t&&this.adaptor.setAttribute(this.dom[0],"justify",t)}handleLabels(){if(!this.hasLabels)return;const t=this.labels,e=this.node.attributes,i=this.adaptor,s=e.get("side");i.setAttribute(this.dom[0],"side",s),i.setAttribute(t,"align",s),i.setStyle(t,s,"0");const[r,n]=this.addLabelPadding(s);if(n){const t=i.firstChild(this.dom[0]);this.setIndent(t,r,n)}this.updateRowHeights(),this.addLabelSpacing()}addLabelPadding(t){const[,e,i]=this.getPadAlignShift(t),s={};if("right"===t&&!this.node.attributes.get("data-width-includes-label")){const t=this.node.attributes.get("width"),{w:e,L:i,R:r}=this.getBBox();s.style={width:er(t)?"calc("+t+" + "+this.em(i+r)+")":this.em(i+e+r)}}return this.adaptor.append(this.dom[0],this.html("mjx-labels",s,[this.labels])),[e,i]}updateRowHeights(){const{H:t,D:e,NH:i,ND:s}=this.getTableData(),r=this.getRowHalfSpacing();for(let n=0;n<this.numRows;n++){const o=this.childNodes[n];this.setRowHeight(o,t[n]+e[n]+r[n]+r[n+1]+this.rLines[n]),t[n]!==i[n]||e[n]!==s[n]?this.setRowBaseline(o,t[n]+e[n],e[n]):o.node.isKind("mlabeledtr")&&this.setCellBaseline(o.childNodes[0],"",t[n]+e[n],e[n])}}addLabelSpacing(){const t=this.adaptor,e=this.node.attributes.get("equalrows"),{H:i,D:s}=this.getTableData(),r=e?this.getEqualRowHeight():0,n=this.getRowHalfSpacing();let o=this.fLine,a=t.firstChild(this.labels);for(let l=0;l<this.numRows;l++){this.childNodes[l].node.isKind("mlabeledtr")?(o&&t.insert(this.html("mjx-mtr",{style:{height:this.em(o)}}),a),t.setStyle(a,"height",this.em((e?r:i[l]+s[l])+n[l]+n[l+1])),a=t.next(a),o=this.rLines[l]):o+=n[l]+(e?r:i[l]+s[l])+n[l+1]+this.rLines[l]}}},t.kind=Sr.prototype.kind,t.styles={"mjx-mtable":{"vertical-align":".25em","text-align":"center",position:"relative","box-sizing":"border-box","border-spacing":0,"border-collapse":"collapse"},'mjx-mstyle[size="s"] mjx-mtable':{"vertical-align":".354em"},"mjx-labels":{position:"absolute",left:0,top:0},"mjx-table":{display:"inline-block","vertical-align":"-.5ex","box-sizing":"border-box"},"mjx-table > mjx-itable":{"vertical-align":"middle","text-align":"left","box-sizing":"border-box"},"mjx-labels > mjx-itable":{position:"absolute",top:0},'mjx-mtable[justify="left"]':{"text-align":"left"},'mjx-mtable[justify="right"]':{"text-align":"right"},'mjx-mtable[justify="left"][side="left"]':{"padding-right":"0 ! important"},'mjx-mtable[justify="left"][side="right"]':{"padding-left":"0 ! important"},'mjx-mtable[justify="right"][side="left"]':{"padding-right":"0 ! important"},'mjx-mtable[justify="right"][side="right"]':{"padding-left":"0 ! important"},"mjx-mtable[align]":{"vertical-align":"baseline"},'mjx-mtable[align="top"] > mjx-table':{"vertical-align":"top"},'mjx-mtable[align="bottom"] > mjx-table':{"vertical-align":"bottom"},'mjx-mtable[side="right"] mjx-labels':{"min-width":"100%"}},t}();function ol(t){return class extends t{get numCells(){return this.childNodes.length}get labeled(){return!1}get tableCells(){return this.childNodes}getChild(t){return this.childNodes[t]}getChildBBoxes(){return this.childNodes.map((t=>t.getBBox()))}stretchChildren(t=null){const e=[],i=this.labeled?this.childNodes.slice(1):this.childNodes;for(const t of i){const i=t.childNodes[0];i.canStretch(lo.Vertical)&&e.push(i)}const s=e.length,r=this.childNodes.length;if(s&&r>1&&!t){let e=0,n=0;const o=s>1&&s===r;for(const t of i){const i=t.childNodes[0],s=i.stretch.dir===lo.None;if(o||s){const{h:t,d:r}=i.getBBox(s);t>e&&(e=t),r>n&&(n=r)}}t=[e,n]}if(t)for(const i of e){const e=i.coreRScale();i.coreMO().getStretchedVariant(t.map((t=>t*e)))}}get fixesPWidth(){return!1}}}function al(t){return class extends t{get numCells(){return Math.max(0,this.childNodes.length-1)}get labeled(){return!0}get tableCells(){return this.childNodes.slice(1)}getChild(t){return this.childNodes[t+1]}getChildBBoxes(){return this.childNodes.slice(1).map((t=>t.getBBox()))}}}const ll=function(){var t;const e=ol(Io);return(t=class extends e{toCHTML(t){super.toCHTML(t);const e=this.node.attributes.get("rowalign");"baseline"!==e&&this.adaptor.setAttribute(this.dom[0],"rowalign",e);const{h:i,d:s}=this.getBBox();this.adaptor.setStyle(this.dom[0],"height",this.em(i+s))}}).kind=Ar.prototype.kind,t.styles={"mjx-mtr":{display:"table-row"},'mjx-mtr[rowalign="top"] > mjx-mtd':{"vertical-align":"top"},'mjx-mtr[rowalign="center"] > mjx-mtd':{"vertical-align":"middle"},'mjx-mtr[rowalign="bottom"] > mjx-mtd':{"vertical-align":"bottom"},'mjx-mtr[rowalign="baseline"] > mjx-mtd':{"vertical-align":"baseline"},'mjx-mtr[rowalign="axis"] > mjx-mtd':{"vertical-align":".25em"}},t}(),cl=function(){var t;const e=al(ll);return(t=class extends e{toCHTML(t){super.toCHTML(t);const e=this.adaptor.firstChild(this.dom[0]);if(e){this.adaptor.remove(e);const t=this.node.attributes.get("rowalign"),i="baseline"!==t&&"axis"!==t?{rowalign:t}:{},s=this.html("mjx-mtr",i,[e]);this.adaptor.append(this.parent.labels,s)}}markUsed(){super.markUsed(),this.jax.wrapperUsage.add(ll.kind)}}).kind=Or.prototype.kind,t.styles={"mjx-mlabeledtr":{display:"table-row"},'mjx-mlabeledtr[rowalign="top"] > mjx-mtd':{"vertical-align":"top"},'mjx-mlabeledtr[rowalign="center"] > mjx-mtd':{"vertical-align":"middle"},'mjx-mlabeledtr[rowalign="bottom"] > mjx-mtd':{"vertical-align":"bottom"},'mjx-mlabeledtr[rowalign="baseline"] > mjx-mtd':{"vertical-align":"baseline"},'mjx-mlabeledtr[rowalign="axis"] > mjx-mtd':{"vertical-align":".25em"}},t}();function hl(t){return class extends t{get fixesPWidth(){return!1}invalidateBBox(){this.bboxComputed=!1,this.lineBBox=[]}getWrapWidth(t){const e=this.parent.parent,i=this.parent,s=this.node.childPosition()-(i.labeled?1:0);return"number"==typeof e.cWidths[s]?e.cWidths[s]:e.getTableData().W[s]}getChildAlign(t){return this.node.attributes.get("columnalign")}}}const dl=function(){var t;const e=hl(Io);return(t=class extends e{toCHTML(t){super.toCHTML(t);const e=this.node.attributes.get("rowalign"),i=this.node.attributes.get("columnalign");e!==this.parent.node.attributes.get("rowalign")&&this.adaptor.setAttribute(this.dom[0],"rowalign",e),"center"===i||"mlabeledtr"===this.parent.kind&&this===this.parent.childNodes[0]&&i===this.parent.parent.node.attributes.get("side")||this.adaptor.setStyle(this.dom[0],"textAlign",i),this.parent.parent.node.getProperty("useHeight")&&this.adaptor.append(this.dom[0],this.html("mjx-tstrut"))}}).kind=Mr.prototype.kind,t.styles={"mjx-mtd":{display:"table-cell","text-align":"center",padding:".215em .4em"},"mjx-mtd:first-child":{"padding-left":0},"mjx-mtd:last-child":{"padding-right":0},"mjx-mtable > * > mjx-itable > *:first-child > mjx-mtd":{"padding-top":0},"mjx-mtable > * > mjx-itable > *:last-child > mjx-mtd":{"padding-bottom":0},"mjx-tstrut":{display:"inline-block",height:"1em","vertical-align":"-.25em"},'mjx-labels[align="left"] > mjx-mtr > mjx-mtd':{"text-align":"left"},'mjx-labels[align="right"] > mjx-mtr > mjx-mtd':{"text-align":"right"},"mjx-mtd[extra]":{padding:0},'mjx-mtd[rowalign="top"]':{"vertical-align":"top"},'mjx-mtd[rowalign="center"]':{"vertical-align":"middle"},'mjx-mtd[rowalign="bottom"]':{"vertical-align":"bottom"},'mjx-mtd[rowalign="baseline"]':{"vertical-align":"baseline"},'mjx-mtd[rowalign="axis"]':{"vertical-align":".25em"}},t}(),ul={dx:".2em",dy:".1em",postDelay:600,clearDelay:100,hoverTimer:new Map,clearTimer:new Map,stopTimers:(t,e)=>{e.clearTimer.has(t)&&(clearTimeout(e.clearTimer.get(t)),e.clearTimer.delete(t)),e.hoverTimer.has(t)&&(clearTimeout(e.hoverTimer.get(t)),e.hoverTimer.delete(t))}};function pl(t){return class extends t{get selected(){const t=this.node.attributes.get("selection"),e=Math.max(1,Math.min(this.childNodes.length,t))-1;return this.childNodes[e]||this.wrap(this.node.selected)}getParameters(){const t=this.node.attributes.get("data-offsets"),[e,i]=ir(t||"");this.tipDx=this.length2em(e||ul.dx),this.tipDy=this.length2em(i||ul.dy)}constructor(t,e,i=null){super(t,e,i);const s=this.constructor.actions,r=this.node.attributes.get("actiontype"),[n,o]=s.get(r)||[(t,e)=>{},{}];this.action=n,this.data=o,this.getParameters()}computeBBox(t,e=!1){t.updateFrom(this.selected.getOuterBBox()),this.selected.setChildPWidths(e)}get breakCount(){return this.node.isEmbellished?this.selected.coreMO().embellishedBreakCount:this.selected.breakCount}computeLineBBox(t){return this.getChildLineBBox(this.selected,t)}}}const ml=function(){var t;const e=pl(Io);return(t=class extends e{setEventHandler(t,e,i=null){(i?[i]:this.dom).forEach((i=>i.addEventListener(t,e)))}Em(t){return this.em(t)}toCHTML(t){if(this.toEmbellishedCHTML(t))return;const e=this.standardChtmlNodes(t);this.selected.toCHTML(e),this.action(this,this.data)}}).kind=yr.prototype.kind,t.styles={"mjx-maction":{position:"relative"},"mjx-maction > mjx-tool":{display:"none",position:"absolute",bottom:0,right:0,width:0,height:0,"z-index":500},"mjx-tool > mjx-tip":{display:"inline-block","line-height":0,padding:".2em",border:"1px solid #888","background-color":"#F8F8F8",color:"black","box-shadow":"2px 2px 5px #AAAAAA"},"mjx-maction[toggle]":{cursor:"pointer"},"mjx-status":{display:"block",position:"fixed",left:"1em",bottom:"1em","min-width":"25%",padding:".2em .4em",border:"1px solid #888","font-size":"90%","background-color":"#F8F8F8",color:"black"},"mjx-container [data-mjx-collapsed]":{color:"#55F"},"@media (prefers-color-scheme: dark) /* chtml maction */":{"mjx-tool > mjx-tip":{border:"1px solid #888","background-color":"#303030",color:"#E0E0E0","box-shadow":"2px 2px 5px #000"},"mjx-status":{"background-color":"#303030",color:"#E0E0E0"},"mjx-container [data-mjx-collapsed]":{color:"#88F"}}},t.actions=new Map([["toggle",[(t,e)=>{t.dom.forEach((e=>{t.adaptor.setAttribute(e,"toggle",t.node.attributes.get("selection"))}));const i=t.factory.jax.math,s=t.factory.jax.document,r=t.node;t.setEventHandler("click",(t=>{i.end.node||(i.start.node=i.end.node=i.typesetRoot,i.start.n=i.end.n=0),r.nextToggleSelection(),i.rerender(s,r.attributes.get("data-maction-id")?Ns.ENRICHED:Ns.RERENDER),t.stopPropagation()}))},{}]],["tooltip",[(t,e)=>{const i=t.childNodes[1];if(i)if(i.node.isKind("mtext")){const e=i.node.getText();t.dom.forEach((i=>t.adaptor.setAttribute(i,"title",e)))}else{const s=t.adaptor;for(const r of t.dom){const n=s.append(r,t.html("mjx-tool",{style:{bottom:t.Em(-t.tipDy),right:t.Em(-t.tipDx)}},[t.html("mjx-tip")]));i.toCHTML([s.firstChild(n)]),t.setEventHandler("mouseover",(t=>{e.stopTimers(r,e);const i=setTimeout((()=>s.setStyle(n,"display","block")),e.postDelay);e.hoverTimer.set(r,i),t.stopPropagation()}),r),t.setEventHandler("mouseout",(t=>{e.stopTimers(r,e);const i=setTimeout((()=>s.setStyle(n,"display","")),e.clearDelay);e.clearTimer.set(r,i),t.stopPropagation()}),r)}}},ul]],["statusline",[(t,e)=>{const i=t.childNodes[1];if(i&&i.node.isKind("mtext")){const s=t.adaptor,r=i.node.getText();t.dom.forEach((t=>s.setAttribute(t,"statusline",r))),t.setEventHandler("mouseover",(i=>{if(null===e.status){const i=s.body(s.document);e.status=s.append(i,t.html("mjx-status",{},[t.text(r)]))}i.stopPropagation()})),t.setEventHandler("mouseout",(t=>{e.status&&(s.remove(e.status),e.status=null),t.stopPropagation()}))}},{status:null}]]]),t}();function fl(t){return class extends t{constructor(t,e,i=null){super(t,e,i),this.getParameters()}getParameters(){const{width:t,height:e,valign:i,src:s,index:r}=this.node.attributes.getList("width","height","valign","src","index");if(s)this.width="auto"===t?1:this.length2em(t),this.height="auto"===e?1:this.length2em(e),this.valign=this.length2em(i||"0");else{const t=String.fromCodePoint(parseInt(r)),e=this.node.factory;this.charWrapper=this.wrap(e.create("text").setText(t)),this.charWrapper.parent=this}}computeBBox(t,e=!1){this.charWrapper?t.updateFrom(this.charWrapper.getBBox()):(t.w=this.width,t.h=this.height+this.valign,t.d=-this.valign)}}}const gl=function(){var t;const e=fl(Io);return(t=class extends e{toCHTML(t){const e=this.standardChtmlNodes(t);if(this.charWrapper)return void this.charWrapper.toCHTML(e);const{src:i,alt:s}=this.node.attributes.getList("src","alt"),r={width:this.em(this.width),height:this.em(this.height)};this.valign&&(r.verticalAlign=this.em(this.valign));const n=this.html("img",{src:i,style:r,alt:s,title:s});this.adaptor.append(e[0],n)}}).kind=Pr.prototype.kind,t.styles={"mjx-mglyph > img":{display:"inline-block",border:0,padding:0}},t}();function bl(t){return class extends t{computeBBox(t,e=!1){if(this.childNodes.length){const{w:e,h:i,d:s}=this.childNodes[0].getBBox();t.w=e,t.h=i,t.d=s}}get breakCount(){return this.node.isEmbellished?this.coreMO().embellishedBreakCount:this.childNodes[0].breakCount}}}function El(t){class e extends t{constructor(t,e,i=null){super(t,e,i),this.rscale=this.getRScale()}computeBBox(t,e=!1){const i=this.node.getXML(),s=this.getHDW(i,"use","force"),{h:r,d:n,w:o}=s?this.splitHDW(s):this.measureXmlNode(i);t.w=o,t.h=r,t.d=n}getHTML(){let t=this.adaptor.clone(this.node.getXML());const e=this.getFontStyles();return(this.getHDW(t,"force")||1!==this.jax.options.scale)&&(t=this.addHDW(t,e)),this.html("mjx-html",{variant:this.parent.variant,style:e},[t])}getHDW(t,e,i=e){const s=this.jax.options.htmlHDW,r=this.adaptor.getAttribute(t,"data-mjx-hdw");return!r||s!==e&&s!==i?null:r}splitHDW(t){const e=1/this.metrics.scale,[i,s,r]=ir(t).map((t=>this.length2em(t||"0")*e));return{h:i,d:s,w:r}}getFontStyles(){var t;const e=this.adaptor,i=this.metrics;return{"font-family":(null===(t=this.parent.styles)||void 0===t?void 0:t.get("font-family"))||i.family||e.fontFamily(e.parent(this.jax.math.start.node))||"initial","font-size":this.jax.fixed(i.em*this.rscale)+"px"}}measureXmlNode(t){const e=this.adaptor,i=this.html("mjx-xml-block",{style:{display:"inline-block"}},[e.clone(t)]),s=this.html("mjx-baseline",{style:{display:"inline-block",width:0,height:0}}),r=this.getFontStyles(),n=this.html("mjx-measure-xml",{style:r},[s,i]),o=this.jax.container;e.append(e.parent(this.jax.math.start.node),o),e.append(o,n);const a=this.metrics,l=a.em*a.scale*this.rscale,{left:c,right:h,bottom:d,top:u}=e.nodeBBox(i),p=(h-c)/l,m=(e.nodeBBox(s).top-u)/l,f=(d-u)/l-m;return e.remove(o),e.remove(n),{w:p,h:m,d:f}}getStyles(){}getScale(){}getVariant(){}}return e.autoStyle=!1,e.styles={"mjx-measure-xml":{position:"absolute",left:0,top:0,display:"inline-block","line-height":"normal","white-space":"normal"},"mjx-html":{display:"inline-block","line-height":"normal","text-align":"initial","white-space":"initial"},"mjx-html-holder":{display:"block",position:"absolute",top:0,left:0,bottom:0,right:0}},e}const xl=function(){var t;const e=bl(Io);return(t=class extends e{toCHTML(t){if(this.toEmbellishedCHTML(t))return;const e=this.standardChtmlNodes(t);this.childNodes.length&&this.childNodes[0].toCHTML(e)}}).kind=Br.prototype.kind,t}(),yl=function(){var t;return(t=class extends Io{toCHTML(t){super.toCHTML(t)}computeBBox(){return this.bbox}}).kind=Fr.prototype.kind,t}(),Nl=function(){var t;return(t=class extends Io{}).kind=jr.prototype.kind,t.styles={"mjx-annotation-xml":{"font-family":"initial","line-height":"normal"}},t}(),vl=function(){var t;const e=El(Io);return(t=class extends e{toCHTML(t){this.markUsed(),this.dom=[this.adaptor.append(t[0],this.getHTML())]}addHDW(t,e){const i=this.jax.options.scale,{h:s,d:r,w:n}=this.bbox,o=i*this.metrics.scale;return e.width=this.em(n*o),e.height=this.em((s+r)*o),e["vertical-align"]=this.em(-r*o),e.position="relative",this.html("mjx-html-holder",{style:{transform:`scale(${this.jax.fixed(i)})`,"transform-origin":"top left"}},[t])}}).kind=Hs.prototype.kind,t}();function Tl(t){return class extends t{computeBBox(t,e=!1){super.computeBBox(t,e),this.childNodes[0]&&this.childNodes[0].bbox.ic&&(t.ic=this.childNodes[0].bbox.ic)}}}const _l=function(){var t;const e=Tl(Io);return(t=class extends e{toCHTML(t){super.toCHTML(t),this.dom.forEach((t=>this.adaptor.setAttribute(t,"texclass",Ss[this.node.texClass])))}}).kind=Ur.prototype.kind,t}();function Ll(t){return class extends t{remappedText(t,e){const i=this.parent.stretch.c;return i?[i]:this.parent.remapChars(this.unicodeChars(t,e))}computeBBox(t,e=!1){const i=this.parent.variant,s=this.node.getText();if("-explicitFont"===i){const e=this.jax.getFontData(this.parent.styles),{w:r,h:n,d:o}=this.jax.measureText(s,i,e);t.h=n,t.d=o,t.w=r}else{const e=this.remappedText(s,i);let r="";t.empty();for(let s=0;s<e.length;s++){const[n,o,a,l]=this.getVariantChar(i,e[s]);if(l.unknown)r+=String.fromCodePoint(e[s]);else{if(r=this.addUtextBBox(t,r,i),this.updateBBox(t,n,o,a),t.ic=l.ic||0,t.sk=l.sk||0,t.dx=l.dx||0,!l.oc||s<e.length-1)continue;const c=this.parent.childNodes;if(this.node!==c[c.length-1].node)continue;const h=this.parent.parent.node;let d=h.isKind("mrow")||h.isInferred?h.childNodes[h.childIndex(this.parent.node)+1]:null;(null==d?void 0:d.isKind("mo"))&&"\u2062"===d.getText()&&(d=h.childNodes[h.childIndex(d)+1]),d&&d.attributes.get("mathvariant")===i?t.oc=l.oc:t.ic=l.oc}}this.addUtextBBox(t,r,i),e.length>1&&(t.sk=0),t.clean()}}addUtextBBox(t,e,i){if(e){const{h:s,d:r,w:n}=this.jax.measureText(e,i);this.updateBBox(t,s,r,n)}return""}updateBBox(t,e,i,s){t.w+=s,e>t.h&&(t.h=e),i>t.d&&(t.d=i)}getStyles(){}getVariant(){}getScale(){}getSpace(){}}}const Cl=function(){var t;const e=Ll(Io);return t=class extends e{toCHTML(t){this.markUsed();const e=t[0],i=this.adaptor,s=this.parent.variant,r=this.node.getText();if(0===r.length)return;const n=this.getBBox();if("-explicitFont"===s)i.append(e,this.jax.unknownText(r,s,n.w));else{let t="";const o=this.remappedText(r,s),a=o.length>1?this.em(this.parent.getBBox().h):"",l=o.length;for(let r=0;r<l;r++){const c=o[r],h=this.getVariantChar(s,c)[3];if(h.unknown)t+=String.fromCodePoint(c);else{t=this.addUtext(t,s,e);const o=h.ff||(h.f?`${this.font.cssFontPrefix}-${h.f}`:""),d=i.append(e,this.html("mjx-c",{class:this.char(c)+(o?" "+o:"")},[this.text(h.c||String.fromCodePoint(c))]));(r<l-1||n.oc)&&i.setAttribute(d,"noic","true"),a&&i.setStyle(d,"padding-top",a),this.font.charUsage.add([s,c])}}this.addUtext(t,s,e)}}addUtext(t,e,i){return t&&this.adaptor.append(i,this.jax.unknownText(t,e)),""}},t.kind=Us.prototype.kind,t.autoStyle=!1,t.styles={"mjx-c":{display:"inline-block",width:0,"text-align":"right"},"mjx-utext":{display:"inline-block",padding:".75em 0 .2em 0"}},t}(),Rl=function(){var t;return(t=class extends vl{}).kind=qr.prototype.kind,t}(),wl={[Ao.kind]:Ao,[Ia.kind]:Ia,[Sa.kind]:Sa,[Mo.kind]:Mo,[jo.kind]:jo,[Uo.kind]:Uo,[qo.kind]:qo,[Vo.kind]:Vo,[zo.kind]:zo,[Jo.kind]:Jo,[Ca.kind]:Ca,[ka.kind]:ka,[Pa.kind]:Pa,[ja.kind]:ja,[Va.kind]:Va,[Xa.kind]:Xa,[za.kind]:za,[$a.kind]:$a,[Ya.kind]:Ya,[Qa.kind]:Qa,[il.kind]:il,[Oa.kind]:Oa,[nl.kind]:nl,[ll.kind]:ll,[cl.kind]:cl,[dl.kind]:dl,[ml.kind]:ml,[gl.kind]:gl,[xl.kind]:xl,[yl.kind]:yl,[Nl.kind]:Nl,[vl.kind]:vl,[_l.kind]:_l,[Cl.kind]:Cl,[Rl.kind]:Rl,[Io.kind]:Io};class Il extends vo{}Il.defaultNodes=wl;const Sl="mathjax-newcm",Al=null;class Ol extends No{constructor(t={}){super(t,Il,Al),this.chtmlStyles=null,this.font.adaptiveCSS(this.options.adaptiveCSS),this.wrapperUsage=new Do}addExtension(t,e=""){const i=super.addExtension(t,e);return i.length&&this.options.adaptiveCSS&&this.chtmlStyles&&this.adaptor.insertRules(this.chtmlStyles,i),[]}escaped(t,e){return this.setDocument(e),this.html("span",{},[this.text(t.math)])}styleSheet(t){if(this.chtmlStyles){const t=new Nn;return this.options.adaptiveCSS&&(this.addWrapperStyles(t),this.updateFontStyles(t)),t.addStyles(this.font.updateDynamicStyles()),this.adaptor.insertRules(this.chtmlStyles,t.getStyleRules()),this.chtmlStyles}const e=this.chtmlStyles=super.styleSheet(t);return this.adaptor.setAttribute(e,"id",Ol.STYLESHEETID),this.wrapperUsage.update(),e}updateFontStyles(t){t.addStyles(this.font.updateStyles({}))}addWrapperStyles(t){if(this.options.adaptiveCSS)for(const e of this.wrapperUsage.update()){const i=this.factory.getNodeClass(e);i&&this.addClassStyles(i,t)}else super.addWrapperStyles(t)}addClassStyles(t,e){const i=t;i.autoStyle&&"unknown"!==i.kind&&e.addStyles({["mjx-"+i.kind]:{display:"inline-block","text-align":"left"}}),this.wrapperUsage.add(i.kind),super.addClassStyles(t,e)}insertStyles(t){this.chtmlStyles&&this.adaptor.insertRules(this.chtmlStyles,new Nn(t).getStyleRules())}processMath(t,e){t.toCHTML([e])}clearCache(){this.styleJson.clear(),this.font.clearCache(),this.wrapperUsage.clear(),this.chtmlStyles=null}reset(){this.clearCache()}unknownText(t,e,i=null){const s={},r=100/this.math.metrics.scale;if(100!==r&&(s["font-size"]=this.fixed(r,1)+"%",s.padding=Mn(75/r)+" 0 "+Mn(20/r)+" 0"),"-explicitFont"!==e){const i=Zs(t);(1!==i.length||i[0]<119808||i[0]>120831)&&this.cssFontStyles(this.font.getCssFont(e),s)}return null!==i&&(s.width=this.fixed(i*this.math.metrics.scale)+"em"),this.html("mjx-utext",{variant:e,style:s},[this.text(t)])}measureTextNode(t){const e=this.adaptor,i=e.clone(t);e.setStyle(i,"font-family",e.getStyle(i,"font-family").replace(/MJXZERO, /g,""));const s=this.math.metrics.em,r={position:"absolute",top:0,left:0,"white-space":"nowrap","font-size":this.fixed(s,3)+"px"},n=this.html("mjx-measure-text",{style:r},[i]);e.append(e.parent(this.math.start.node),this.container),e.append(this.container,n);const o=e.nodeSize(i,s)[0];return e.remove(this.container),e.remove(n),{w:o,h:.75,d:.2}}}function Ml(t,e){const i={};for(const s of Object.keys(t)){const r=t[s];for(const t of Object.keys(r)){i[t]||(i[t]={});const n=r[t];if(s)for(const t of Object.keys(n)){const i=n[parseInt(t)];i[3]||(i[3]={}),e?i[3].ff=e+"-"+s:i[3].f=s}Object.assign(i[t],n)}}return i}function kl(t,e,i,s=""){const r=i.fontPath||`[fonts]/%%FONT%%-font${s}`,n=t.match(/^[a-z]+:/)?(t.match(/[^/:\\]*$/)||[e])[0]:t;return Ti(MathJax.config.loader,"paths",{[n+s]:n===t?r.replace(/%%FONT%%/g,t):t}),`[${n}${s}]`}Ol.NAME="CHTML",Ol.OPTIONS=Object.assign(Object.assign({},No.OPTIONS),{adaptiveCSS:!0,matchFontHeight:!0}),Ol.commonStyles=Object.assign(Object.assign({},No.commonStyles),{'mjx-container[jax="CHTML"]':{"white-space":"nowrap"},[["mjx-mo > mjx-c","mjx-mi > mjx-c","mjx-mn > mjx-c","mjx-ms > mjx-c","mjx-mtext > mjx-c"].join(", ")]:{"clip-path":"padding-box polygon("+["-1em -2px","calc(100% + 1em) -2px","calc(100% + 1em) calc(100% + 2px)","-1em calc(100% + 2px)"].join(", ")+")"},"mjx-stretchy-h":{"clip-path":"padding-box polygon(0 -2px, 100% -2px, 100% calc(100% + 2px), 0 calc(100% + 2px))"},"mjx-stretchy-v":{"clip-path":"padding-box polygon(-2px 0, calc(100% + 2px) 0, calc(100% + 2px) 100%, -2px 100%)"},'mjx-container [space="1"]':{"margin-left":".111em"},'mjx-container [space="2"]':{"margin-left":".167em"},'mjx-container [space="3"]':{"margin-left":".222em"},'mjx-container [space="4"]':{"margin-left":".278em"},'mjx-container [space="5"]':{"margin-left":".333em"},'mjx-container [rspace="1"]':{"margin-right":".111em"},'mjx-container [rspace="2"]':{"margin-right":".167em"},'mjx-container [rspace="3"]':{"margin-right":".222em"},'mjx-container [rspace="4"]':{"margin-right":".278em"},'mjx-container [rspace="5"]':{"margin-right":".333em"},'mjx-container [size="s"]':{"font-size":"70.7%"},'mjx-container [size="ss"]':{"font-size":"50%"},'mjx-container [size="Tn"]':{"font-size":"60%"},'mjx-container [size="sm"]':{"font-size":"85%"},'mjx-container [size="lg"]':{"font-size":"120%"},'mjx-container [size="Lg"]':{"font-size":"144%"},'mjx-container [size="LG"]':{"font-size":"173%"},'mjx-container [size="hg"]':{"font-size":"207%"},'mjx-container [size="HG"]':{"font-size":"249%"},'mjx-container [width="full"]':{width:"100%"},"mjx-box":{display:"inline-block"},"mjx-block":{display:"block"},"mjx-itable":{display:"inline-table"},"mjx-row":{display:"table-row"},[["cell","base","under","over","den"].map((t=>`mjx-row > mjx-${t}`)).join(", ")]:{display:"table-cell"},"mjx-container [inline-breaks]":{display:"inline"},"mjx-container .mjx-selected":{outline:"2px solid black"},"@media (prefers-color-scheme: dark)":{"mjx-container .mjx-selected":{outline:"2px solid #C8C8C8"}},"mjx-mtext":{display:"inline-block"},"mjx-mstyle":{display:"inline-block"},"mjx-merror":{display:"inline-block",color:"red","background-color":"yellow"},"mjx-mphantom":{visibility:"hidden"}}),Ol.STYLESHEETID="MJX-CHTML-styles",MathJax.loader&&MathJax.loader.checkVersion("output/chtml",Ei,"output"),_i({_:{output:{chtml_ts:Je,chtml:{DefaultFont:Ge,DynamicFonts:Ke,FontData:Gt,Notation:ae,Usage:zt,Wrapper:Ut,WrapperFactory:ze,Wrappers_ts:Xe,Wrappers:{HtmlNode:Ve,TeXAtom:He,TextNode:We,maction:ke,math:qt,menclose:le,mfenced:ue,mfrac:me,mglyph:Pe,mi:Vt,mmultiscripts:Ce,mn:$t,mo:Jt,mpadded:re,mroot:Ee,mrow:he,ms:Qt,mspace:ie,msqrt:ge,msubsup:ve,mtable:we,mtd:Oe,mtext:te,mtr:Se,munderover:_e,scriptbase:Ne,semantics:Fe}},common_ts:Bt,common:{Direction:Mt,FontData:kt,LineBBox:Dt,LinebreakVisitor:Pt,Notation:ne,Wrapper:Ft,WrapperFactory:jt,Wrappers:{TeXAtom:Ue,TextNode:qe,XmlNode:je,maction:Me,math:Ht,menclose:oe,mfenced:de,mfrac:pe,mglyph:De,mi:Wt,mmultiscripts:Le,mn:Kt,mo:Xt,mpadded:se,mroot:be,mrow:ce,ms:Yt,mspace:ee,msqrt:fe,msubsup:xe,mtable:Re,mtd:Ae,mtext:Zt,mtr:Ie,munderover:Te,scriptbase:ye,semantics:Be}}}}});const Dl={config(t,e,i,s){if(MathJax.loader){Ti(MathJax.config,t,MathJax.config.output||{});let e=MathJax.config[t],r=e.font||e.fontData||i;"string"!=typeof r&&(e.fontData=r,e.font=r=r.NAME),"["!==r.charAt(0)&&(r=kl(r,t,e));const n=r.substring(1,r.length-1),o=function(t,e){const i=[];for(const s of e.fontExtensions||[]){const r=`${kl(s,t,e,"-extension")}/${t}`;i.push(r)}return i}(t,e);if(o.length&&MathJax.loader.addPackageData(`${r}/${t}`,{extraLoads:o}),n===i&&s){const e=MathJax.config.loader[`${r}/${t}`]?.extraLoads;e&&MathJax.loader.addPackageData(`output/${t}`,{extraLoads:e}),_i({_:{output:{fonts:{[n]:{[t+"_ts"]:{[s.NAME+"Font"]:s}}}}}}),Ti(MathJax,"config",{output:{font:r},[t]:{fontData:s,dynamicPrefix:`${r}/${t}/dynamic`}}),"chtml"===t&&Ti(MathJax.config,t,{fontURL:Ii.resolvePath(`${r}/${t}/woff2`,!1)})}else MathJax.loader.addPackageData(`output/${t}`,{extraLoads:[`${r}/${t}`]})}MathJax.startup&&(MathJax.startup.registerConstructor(t,e),MathJax.startup.useOutput(t))},loadFont:(t,e,i,s)=>MathJax.loader?(s&&MathJax.loader.preLoaded(`[${i}]/${e}`),Ii.loadPromise(`output/${e}`).then(t)):t};var Pl;Dl.config("chtml",Ol,Sl,Al),function(t){t[t.RETURN=13]="RETURN",t[t.ESCAPE=27]="ESCAPE",t[t.SPACE=32]="SPACE",t[t.LEFT=37]="LEFT",t[t.UP=38]="UP",t[t.RIGHT=39]="RIGHT",t[t.DOWN=40]="DOWN"}(Pl||(Pl={}));const Bl="click",jl="dblclick",Fl="mousedown",Ul="mouseup",Hl="mouseover",ql="mouseout",Wl="selectstart";class Vl{constructor(){this.bubble=!1}bubbleKey(){this.bubble=!0}keydown(t){switch(t.keyCode){case Pl.ESCAPE:this.escape(t);break;case Pl.RIGHT:this.right(t);break;case Pl.LEFT:this.left(t);break;case Pl.UP:this.up(t);break;case Pl.DOWN:this.down(t);break;case Pl.RETURN:case Pl.SPACE:this.space(t);break;default:return}this.bubble?this.bubble=!1:this.stop(t)}escape(t){}space(t){}left(t){}right(t){}up(t){}down(t){}stop(t){t&&(t.stopPropagation(),t.preventDefault(),t.cancelBubble=!0)}mousedown(t){return this.stop(t)}mouseup(t){return this.stop(t)}mouseover(t){return this.stop(t)}mouseout(t){return this.stop(t)}click(t){return this.stop(t)}addEvents(t){t.addEventListener(Fl,this.mousedown.bind(this)),t.addEventListener(Ul,this.mouseup.bind(this)),t.addEventListener(Hl,this.mouseover.bind(this)),t.addEventListener(ql,this.mouseout.bind(this)),t.addEventListener(Bl,this.click.bind(this)),t.addEventListener("keydown",this.keydown.bind(this)),t.addEventListener("dragstart",this.stop.bind(this)),t.addEventListener(Wl,this.stop.bind(this)),t.addEventListener("contextmenu",this.stop.bind(this)),t.addEventListener(jl,this.stop.bind(this))}}class Xl extends Vl{addAttributes(t){for(const e in t)this.html.setAttribute(e,t[e])}get html(){return this._html||this.generateHtml(),this._html}set html(t){this._html=t,this.addEvents(t)}generateHtml(){const t=document.createElement("div");t.classList.add(this.className),t.setAttribute("role",this.role),this.html=t}focus(){const t=this.html;t.setAttribute("tabindex","0"),setTimeout((()=>t.focus()),50)}unfocus(){const t=this.html;t.hasAttribute("tabindex")&&t.setAttribute("tabindex","-1");try{t.blur()}catch(t){}t.blur()}}class zl extends Xl{constructor(){super(...arguments),this.posted=!1}isPosted(){return this.posted}post(t,e){this.posted||(void 0!==t&&void 0!==e&&this.html.setAttribute("style","left: "+t+"px; top: "+e+"px;"),this.display(),this.posted=!0)}unpost(){if(!this.posted)return;const t=this.html;t.parentNode&&t.parentNode.removeChild(t),this.posted=!1}}function Gl(t){return"CtxtMenu_"+t}function Jl(t){return Gl(t)}function Kl(t){return Gl(t)}const $l={ATTACHED:Jl("Attached"),CONTEXTMENU:Jl("ContextMenu"),MENU:Jl("Menu"),MENUARROW:Jl("MenuArrow"),MENUACTIVE:Jl("MenuActive"),MENUCHECK:Jl("MenuCheck"),MENUCLOSE:Jl("MenuClose"),MENUCOMBOBOX:Jl("MenuComboBox"),MENUDISABLED:Jl("MenuDisabled"),MENUFRAME:Jl("MenuFrame"),MENUITEM:Jl("MenuItem"),MENULABEL:Jl("MenuLabel"),MENURADIOCHECK:Jl("MenuRadioCheck"),MENUINPUTBOX:Jl("MenuInputBox"),MENURULE:Jl("MenuRule"),MENUSLIDER:Jl("MenuSlider"),MOUSEPOST:Jl("MousePost"),RTL:Jl("RTL"),INFO:Jl("Info"),INFOCLOSE:Jl("InfoClose"),INFOCONTENT:Jl("InfoContent"),INFOSIGNATURE:Jl("InfoSignature"),INFOTITLE:Jl("InfoTitle"),SLIDERVALUE:Jl("SliderValue"),SLIDERBAR:Jl("SliderBar"),SELECTION:Jl("Selection"),SELECTIONBOX:Jl("SelectionBox"),SELECTIONMENU:Jl("SelectionMenu"),SELECTIONDIVIDER:Jl("SelectionDivider"),SELECTIONITEM:Jl("SelectionItem")},Yl={COUNTER:Kl("Counter"),KEYDOWNFUNC:Kl("keydownFunc"),CONTEXTMENUFUNC:Kl("contextmenuFunc"),OLDTAB:Kl("Oldtabindex"),TOUCHFUNC:Kl("TouchFunc")};class Ql extends Xl{constructor(t,e){super(),this._menu=t,this._type=e,this.className=$l.MENUITEM,this.role="menuitem",this.hidden=!1}get menu(){return this._menu}set menu(t){this._menu=t}get type(){return this._type}hide(){this.hidden=!0,this.menu.generateMenu()}show(){this.hidden=!1,this.menu.generateMenu()}isHidden(){return this.hidden}}function Zl(t){const e=t.menu;e.baseMenu?e.baseMenu.unpost():e.unpost()}function tc(t){const e=t.menu;return(e.baseMenu?e.baseMenu:e).store.active}function ec(t,e){console.error("ContextMenu Error: "+e)}function ic(){return sc++}let sc=0;class rc extends Ql{constructor(t,e,i,s){super(t,e),this._content=i,this.disabled=!1,this.callbacks=[],this._id=s||i}get content(){return this._content}set content(t){this._content=t,this.generateHtml(),this.menu&&this.menu.generateHtml()}get id(){return this._id}press(){this.disabled||(this.executeAction(),this.executeCallbacks_())}executeAction(){}registerCallback(t){-1===this.callbacks.indexOf(t)&&this.callbacks.push(t)}unregisterCallback(t){const e=this.callbacks.indexOf(t);-1!==e&&this.callbacks.splice(e,1)}mousedown(t){this.press(),this.stop(t)}mouseover(t){this.focus(),this.stop(t)}mouseout(t){this.deactivate(),this.stop(t)}generateHtml(){super.generateHtml();const t=this.html;t.setAttribute("aria-disabled","false"),t.textContent=this.content}activate(){this.disabled||this.html.classList.add($l.MENUACTIVE)}deactivate(){this.html.classList.remove($l.MENUACTIVE)}focus(){this.menu.focused=this,super.focus(),this.activate()}unfocus(){this.deactivate(),super.unfocus()}escape(t){Zl(this)}up(t){this.menu.up(t)}down(t){this.menu.down(t)}left(t){this.menu.left(t)}right(t){this.menu.right(t)}space(t){this.press()}disable(){this.disabled=!0;const t=this.html;t.classList.add($l.MENUDISABLED),t.setAttribute("aria-disabled","true")}enable(){this.disabled=!1;const t=this.html;t.classList.remove($l.MENUDISABLED),t.removeAttribute("aria-disabled")}executeCallbacks_(){for(const t of this.callbacks)try{t(this)}catch(t){ec(0,"Callback for menu entry "+this.id+" failed.")}}}class nc extends rc{static fromJson(t,{content:e,menu:i,id:s},r){const n=new this(r,e,s),o=t.get("subMenu")(t,i,n);return n.submenu=o,n}constructor(t,e,i){super(t,"submenu",e,i),this._submenu=null}set submenu(t){this._submenu=t}get submenu(){return this._submenu}mouseover(t){this.focus(),this.stop(t)}mouseout(t){this.stop(t)}unfocus(){if(this.submenu.isPosted()){if(this.menu.focused!==this)return super.unfocus(),void this.menu.unpostSubmenus();this.html.setAttribute("tabindex","-1"),this.html.blur()}else super.unfocus()}focus(){super.focus(),this.submenu.isPosted()||this.disabled||this.submenu.post()}executeAction(){this.submenu.isPosted()?this.submenu.unpost():this.submenu.post()}generateHtml(){super.generateHtml();const t=this.html;this.span=document.createElement("span"),this.span.textContent="\u25ba",this.span.classList.add($l.MENUARROW),this.span.setAttribute("aria-hidden","true"),t.appendChild(this.span),t.setAttribute("aria-haspopup","true")}left(t){this.submenu.isPosted()?this.submenu.unpost():super.left(t)}right(t){this.submenu.isPosted()?this.submenu.down(t):this.submenu.post()}toJson(){return{type:""}}}class oc extends zl{constructor(){super(...arguments),this.className=$l.CONTEXTMENU,this.role="menu",this._items=[],this._baseMenu=null}set baseMenu(t){this._baseMenu=t}get baseMenu(){return this._baseMenu}get items(){return this._items}set items(t){this._items=t}get pool(){return this.variablePool}get focused(){return this._focused}set focused(t){if(this._focused===t)return;this._focused||this.unfocus();const e=this._focused;this._focused=t,e&&e.unfocus()}up(t){const e=this.items.filter((t=>t instanceof rc&&!t.isHidden()));if(0===e.length)return;if(!this.focused)return void e[e.length-1].focus();let i=e.indexOf(this.focused);-1!==i&&(i=i?--i:e.length-1,e[i].focus())}down(t){const e=this.items.filter((t=>t instanceof rc&&!t.isHidden()));if(0===e.length)return;if(!this.focused)return void e[0].focus();let i=e.indexOf(this.focused);-1!==i&&(i++,i=i===e.length?0:i,e[i].focus())}generateHtml(){super.generateHtml(),this.generateMenu()}generateMenu(){const t=this.html;t.classList.add($l.MENU);for(const e of this.items){if(!e.isHidden()){t.appendChild(e.html);continue}const i=e.html;i.parentNode&&i.parentNode.removeChild(i)}}post(t,e){this.variablePool.update(),super.post(t,e)}unpostSubmenus(){const t=this.items.filter((t=>t instanceof nc));for(const e of t)e.submenu.unpost(),e!==this.focused&&e.unfocus()}unpost(){super.unpost(),this.unpostSubmenus(),this.focused=null}find(t){for(const e of this.items)if("rule"!==e.type){if(e.id===t)return e;if("submenu"===e.type){const i=e.submenu.find(t);if(i)return i}}return null}}class ac{constructor(t){this.menu=t,this.store=[],this._active=null,this.counter=0,this.attachedClass=$l.ATTACHED+"_"+ic(),this.taborder=!0,this.attrMap={}}set active(t){do{if(-1!==this.store.indexOf(t)){this._active=t;break}t=t.parentNode}while(t)}get active(){return this._active}next(){const t=this.store.length;if(0===t)return this.active=null,null;let e=this.store.indexOf(this.active);return e=-1===e?0:e<t-1?e+1:0,this.active=this.store[e],this.active}previous(){const t=this.store.length;if(0===t)return this.active=null,null;const e=t-1;let i=this.store.indexOf(this.active);return i=-1===i||0===i?e:i-1,this.active=this.store[i],this.active}clear(){this.remove(this.store)}insert(t){const e=t instanceof HTMLElement?[t]:t;for(const t of e)this.insertElement(t);this.sort()}remove(t){const e=t instanceof HTMLElement?[t]:t;for(const t of e)this.removeElement(t);this.sort()}inTaborder(t){this.taborder&&!t&&this.removeTaborder(),!this.taborder&&t&&this.insertTaborder(),this.taborder=t}insertTaborder(){this.taborder&&this.insertTaborder_()}removeTaborder(){this.taborder&&this.removeTaborder_()}insertElement(t){t.classList.contains(this.attachedClass)||(t.classList.add(this.attachedClass),this.taborder&&this.addTabindex(t),this.addEvents(t))}removeElement(t){t.classList.contains(this.attachedClass)&&(t.classList.remove(this.attachedClass),this.taborder&&this.removeTabindex(t),this.removeEvents(t))}sort(){const t=document.getElementsByClassName(this.attachedClass);this.store=[].slice.call(t)}insertTaborder_(){this.store.forEach((t=>t.setAttribute("tabindex","0")))}removeTaborder_(){this.store.forEach((t=>t.setAttribute("tabindex","-1")))}addTabindex(t){t.hasAttribute("tabindex")&&t.setAttribute(Yl.OLDTAB,t.getAttribute("tabindex")),t.setAttribute("tabindex","0")}removeTabindex(t){t.hasAttribute(Yl.OLDTAB)?(t.setAttribute("tabindex",t.getAttribute(Yl.OLDTAB)),t.removeAttribute(Yl.OLDTAB)):t.removeAttribute("tabindex")}addEvents(t){t.hasAttribute(Yl.COUNTER)||(this.addEvent(t,"contextmenu",this.menu.post.bind(this.menu)),this.addEvent(t,"keydown",this.keydown.bind(this)),t.setAttribute(Yl.COUNTER,this.counter.toString()),this.counter++)}addEvent(t,e,i){const s=Yl[e.toUpperCase()+"FUNC"];this.attrMap[s+this.counter]=i,t.addEventListener(e,i)}removeEvents(t){if(!t.hasAttribute(Yl.COUNTER))return;const e=t.getAttribute(Yl.COUNTER);this.removeEvent(t,"contextmenu",e),this.removeEvent(t,"keydown",e),t.removeAttribute(Yl.COUNTER)}removeEvent(t,e,i){const s=Yl[e.toUpperCase()+"FUNC"],r=this.attrMap[s+i];t.removeEventListener(e,r)}keydown(t){t.keyCode===Pl.SPACE&&(this.menu.post(t),t.preventDefault(),t.stopImmediatePropagation())}}class lc{constructor(){this.pool={}}insert(t){this.pool[t.name]=t}lookup(t){return this.pool[t]}remove(t){delete this.pool[t]}update(){for(const t in this.pool)this.pool[t].update()}}class cc extends oc{static fromJson(t,{pool:e,items:i,id:s=""}){const r=new this(t);r.id=s;const n=t.get("variable");e.forEach((e=>n(t,e,r.pool)));const o=t.get("items")(t,i,r);return r.items=o,r}constructor(t){super(),this.factory=t,this.id="",this.moving=!1,this._store=new ac(this),this.widgets=[],this.variablePool=new lc}generateHtml(){this.isPosted()&&this.unpost(),super.generateHtml(),this._frame=document.createElement("div"),this._frame.classList.add($l.MENUFRAME);const t="left: 0px; top: 0px; z-index: 200; width: 100%; height: 100%; border: 0px; padding: 0px; margin: 0px;";this._frame.setAttribute("style","position: absolute; "+t);const e=document.createElement("div");e.setAttribute("style","position: fixed; "+t),this._frame.appendChild(e),e.addEventListener("mousedown",function(t){this.unpost(),this.unpostWidgets(),this.stop(t)}.bind(this))}display(){document.body.appendChild(this.frame),this.frame.appendChild(this.html),this.focus()}escape(t){this.unpost(),this.unpostWidgets()}unpost(){if(super.unpost(),this.widgets.length>0)return;this.frame.parentNode.removeChild(this.frame);const t=this.store;this.moving||t.insertTaborder(),t.active.focus()}left(t){this.move_(this.store.previous())}right(t){this.move_(this.store.next())}get frame(){return this._frame}get store(){return this._store}post(t,e){if(void 0!==e)return this.moving||this.store.removeTaborder(),void super.post(t,e);const i=t;let s,r,n;if(i instanceof Event?(s=i.target,this.stop(i)):s=i,i instanceof MouseEvent&&(r=i.pageX,n=i.pageY,r||n||!i.clientX||(r=i.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,n=i.clientY+document.body.scrollTop+document.documentElement.scrollTop)),!r&&!n&&s){const t=window.pageXOffset||document.documentElement.scrollLeft,e=window.pageYOffset||document.documentElement.scrollTop,i=s.getBoundingClientRect();r=(i.right+i.left)/2+t,n=(i.bottom+i.top)/2+e}this.store.active=s,this.anchor=this.store.active;const o=this.html;r+o.offsetWidth>document.body.offsetWidth-5&&(r=document.body.offsetWidth-o.offsetWidth-5),this.post(r,n)}registerWidget(t){this.widgets.push(t)}unregisterWidget(t){const e=this.widgets.indexOf(t);e>-1&&this.widgets.splice(e,1),0===this.widgets.length&&this.unpost()}unpostWidgets(){this.widgets.forEach((t=>t.unpost()))}toJson(){return{type:""}}move_(t){this.anchor&&t!==this.anchor&&(this.moving=!0,this.unpost(),this.post(t),this.moving=!1)}}class hc extends oc{static fromJson(t,{items:e},i){const s=new this(i),r=t.get("items")(t,e,s);return s.items=r,s}constructor(t){super(),this._anchor=t,this.variablePool=this.anchor.menu.pool,this.setBaseMenu()}get anchor(){return this._anchor}post(){if(!this.anchor.menu.isPosted())return;let t=this.anchor.html;const e=this.html,i=this.baseMenu.frame,s=t.offsetWidth;let r=s-2,n=0;for(;t&&t!==i;)r+=t.offsetLeft,n+=t.offsetTop,t=t.parentNode;r+e.offsetWidth>document.body.offsetWidth-5&&(r=Math.max(5,r-s-e.offsetWidth+6)),super.post(r,n)}display(){this.baseMenu.frame.appendChild(this.html)}setBaseMenu(){let t=this;do{t=t.anchor.menu}while(t instanceof hc);this.baseMenu=t}left(t){this.focused=null,this.anchor.focus()}toJson(){return{type:""}}}class dc extends rc{generateHtml(){super.generateHtml();const t=this.html;this.span||this.generateSpan(),t.appendChild(this.span),this.update()}register(){this.variable.register(this)}unregister(){this.variable.unregister(this)}update(){this.updateAria(),this.span&&this.updateSpan()}}class uc extends dc{static fromJson(t,{content:e,variable:i,id:s},r){return new this(r,e,i,s)}constructor(t,e,i,s){super(t,"radio",e,s),this.role="menuitemradio",this.variable=t.pool.lookup(i),this.register()}executeAction(){this.variable.setValue(this.id),Zl(this)}generateSpan(){this.span=document.createElement("span"),this.span.textContent="\u2713",this.span.classList.add($l.MENURADIOCHECK),this.span.setAttribute("aria-hidden","true")}updateAria(){this.html.setAttribute("aria-checked",this.variable.getValue()===this.id?"true":"false")}updateSpan(){this.span.style.display=this.variable.getValue()===this.id?"":"none"}toJson(){return{type:""}}}class pc extends Ql{static fromJson(t,e,i){return new this(i)}constructor(t){super(t,"rule"),this.className=$l.MENUITEM,this.role="separator"}generateHtml(){super.generateHtml();const t=this.html;t.classList.add($l.MENURULE),t.setAttribute("aria-orientation","vertical")}addEvents(t){}toJson(){return{type:"rule"}}}class mc extends rc{static fromJson(t,{content:e,action:i,id:s},r){return new this(r,e,i,s)}constructor(t,e,i,s){super(t,"command",e,s),this.command=i}mousedown(t){this.stop(t)}mouseup(t){this.press(),this.stop(t)}executeAction(){try{this.command(tc(this))}catch(t){ec(0,"Illegal command callback.")}Zl(this)}toJson(){return{type:""}}}class fc{static fromJson(t,{name:e,getter:i,setter:s},r){const n=new this(e,i,s);r.insert(n)}constructor(t,e,i){this._name=t,this.getter=e,this.setter=i,this.items=[]}get name(){return this._name}getValue(t){try{return this.getter(t)}catch(t){return ec(0,"Command of variable "+this.name+" failed."),null}}setValue(t,e){try{this.setter(t,e)}catch(t){ec(0,"Command of variable "+this.name+" failed.")}this.update()}register(t){-1===this.items.indexOf(t)&&this.items.push(t)}unregister(t){const e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1)}update(){this.items.forEach((t=>t.update()))}registerCallback(t){this.items.forEach((e=>e.registerCallback(t)))}unregisterCallback(t){this.items.forEach((e=>e.unregisterCallback(t)))}toJson(){return{type:"variable",name:this.name,getter:this.getter.toString(),setter:this.setter.toString()}}}class gc extends dc{static fromJson(t,{content:e,variable:i,id:s},r){return new this(r,e,i,s)}constructor(t,e,i,s){super(t,"checkbox",e,s),this.role="menuitemcheckbox",this.variable=t.pool.lookup(i),this.register()}executeAction(){this.variable.setValue(!this.variable.getValue()),Zl(this)}generateSpan(){this.span=document.createElement("span"),this.span.textContent="\u2713",this.span.classList.add($l.MENUCHECK),this.span.setAttribute("aria-hidden","true")}updateAria(){this.html.setAttribute("aria-checked",this.variable.getValue()?"true":"false")}updateSpan(){this.span.style.display=this.variable.getValue()?"":"none"}toJson(){return{type:""}}}class bc extends dc{static fromJson(t,{content:e,variable:i,id:s},r){return new this(r,e,i,s)}constructor(t,e,i,s){super(t,"combobox",e,s),this.role="combobox",this.inputEvent=!1,this.variable=t.pool.lookup(i),this.register()}executeAction(){this.variable.setValue(this.input.value,tc(this))}space(t){super.space(t),Zl(this)}focus(){super.focus(),this.input.focus()}unfocus(){super.unfocus(),this.updateSpan()}generateHtml(){super.generateHtml();this.html.classList.add($l.MENUCOMBOBOX)}generateSpan(){this.span=document.createElement("span"),this.span.classList.add($l.MENUINPUTBOX),this.input=document.createElement("input"),this.input.addEventListener("keydown",this.inputKey.bind(this)),this.input.setAttribute("size","10em"),this.input.setAttribute("type","text"),this.input.setAttribute("tabindex","-1"),this.span.appendChild(this.input)}inputKey(t){this.bubbleKey(),this.inputEvent=!0}keydown(t){if(this.inputEvent&&t.keyCode!==Pl.ESCAPE&&t.keyCode!==Pl.RETURN)return this.inputEvent=!1,void t.stopPropagation();super.keydown(t),t.stopPropagation()}updateAria(){}updateSpan(){let t;try{t=this.variable.getValue(tc(this))}catch(e){t=""}this.input.value=t}toJson(){return{type:""}}}class Ec extends rc{static fromJson(t,{content:e,id:i},s){return new this(s,e,i)}constructor(t,e,i){super(t,"label",e,i)}generateHtml(){super.generateHtml();this.html.classList.add($l.MENULABEL)}toJson(){return{type:""}}}class xc extends dc{static fromJson(t,{content:e,variable:i,id:s},r){return new this(r,e,i,s)}constructor(t,e,i,s){super(t,"slider",e,s),this.role="slider",this.labelId="ctx_slideLabel"+ic(),this.valueId="ctx_slideValue"+ic(),this.inputEvent=!1,this.variable=t.pool.lookup(i),this.register()}executeAction(){this.variable.setValue(this.input.value,tc(this)),this.update()}space(t){super.space(t),Zl(this)}focus(){super.focus(),this.input.focus()}unfocus(){super.unfocus(),this.updateSpan()}generateHtml(){super.generateHtml();this.html.classList.add($l.MENUSLIDER),this.valueSpan=document.createElement("span"),this.valueSpan.setAttribute("id",this.valueId),this.valueSpan.classList.add($l.SLIDERVALUE),this.html.appendChild(this.valueSpan)}generateSpan(){this.span=document.createElement("span"),this.labelSpan=document.createElement("span"),this.labelSpan.setAttribute("id",this.labelId),this.labelSpan.appendChild(this.html.childNodes[0]),this.html.appendChild(this.labelSpan),this.input=document.createElement("input"),this.input.setAttribute("type","range"),this.input.setAttribute("min","0"),this.input.setAttribute("max","100"),this.input.setAttribute("aria-valuemin","0"),this.input.setAttribute("aria-valuemax","100"),this.input.setAttribute("aria-labelledby",this.labelId),this.input.addEventListener("keydown",this.inputKey.bind(this)),this.input.addEventListener("input",this.executeAction.bind(this)),this.input.classList.add($l.SLIDERBAR),this.span.appendChild(this.input)}inputKey(t){this.inputEvent=!0}mousedown(t){t.stopPropagation()}mouseup(t){Zl(this),t.stopPropagation()}keydown(t){const e=t.keyCode;return e===Pl.UP||e===Pl.DOWN?(t.preventDefault(),void super.keydown(t)):this.inputEvent&&e!==Pl.ESCAPE&&e!==Pl.RETURN?(this.inputEvent=!1,void t.stopPropagation()):(super.keydown(t),void t.stopPropagation())}updateAria(){const t=this.variable.getValue();t&&this.input&&(this.input.setAttribute("aria-valuenow",t),this.input.setAttribute("aria-valuetext",t+"%"))}updateSpan(){let t;try{t=this.variable.getValue(tc(this)),this.valueSpan.innerHTML=t+"%"}catch(e){t=""}this.input.value=t}toJson(){return{type:""}}}class yc extends zl{constructor(t){super(),this.element=t,this.className=$l.MENUCLOSE,this.role="button"}generateHtml(){const t=document.createElement("span");t.classList.add(this.className),t.setAttribute("role",this.role),t.setAttribute("tabindex","0");const e=document.createElement("span");e.textContent="\xd7",t.appendChild(e),this.html=t}display(){}unpost(){super.unpost(),this.element.unpost()}keydown(t){this.bubbleKey(),super.keydown(t)}space(t){this.unpost(),this.stop(t)}mousedown(t){this.unpost(),this.stop(t)}}class Nc extends zl{constructor(t,e,i){super(),this.title=t,this.signature=i,this.className=$l.INFO,this.role="dialog",this.contentDiv=this.generateContent(),this.close=this.generateClose(),this.content=e||function(){return""}}attachMenu(t){this.menu=t}generateHtml(){super.generateHtml();const t=this.html;t.appendChild(this.generateTitle()),t.appendChild(this.contentDiv),t.appendChild(this.generateSignature()),t.appendChild(this.close.html),t.setAttribute("tabindex","0")}post(){super.post();const t=document.documentElement,e=this.html,i=window.innerHeight||t.clientHeight||t.scrollHeight||0,s=Math.floor(-e.offsetWidth/2),r=Math.floor((i-e.offsetHeight)/3);e.setAttribute("style","margin-left: "+s+"px; top: "+r+"px;"),window.event instanceof MouseEvent&&e.classList.add($l.MOUSEPOST),e.focus()}display(){this.menu.registerWidget(this),this.contentDiv.innerHTML=this.content();const t=this.menu.html;t.parentNode&&t.parentNode.removeChild(t),this.menu.frame.appendChild(this.html)}click(t){}keydown(t){this.bubbleKey(),super.keydown(t)}escape(t){this.unpost()}unpost(){super.unpost(),this.html.classList.remove($l.MOUSEPOST),this.menu.unregisterWidget(this)}generateClose(){const t=new yc(this),e=t.html;return e.classList.add($l.INFOCLOSE),e.setAttribute("aria-label","Close Dialog Box"),t}generateTitle(){const t=document.createElement("span");return t.innerHTML=this.title,t.classList.add($l.INFOTITLE),t}generateContent(){const t=document.createElement("div");return t.classList.add($l.INFOCONTENT),t.setAttribute("tabindex","0"),t}generateSignature(){const t=document.createElement("span");return t.innerHTML=this.signature,t.classList.add($l.INFOSIGNATURE),t}toJson(){return{type:""}}}class vc extends oc{static fromJson(t,{title:e,values:i,variable:s},r){const n=new this(r),o=t.get("label")(t,{content:e||"",id:e||"id"},n),a=t.get("rule")(t,{},n),l=i.map((e=>t.get("radio")(t,{content:e,variable:s,id:e},n))),c=[o,a].concat(l);return n.items=c,n}constructor(t){super(),this.anchor=t,this.className=$l.SELECTIONMENU,this.variablePool=this.anchor.menu.pool,this.baseMenu=this.anchor.menu}generateHtml(){super.generateHtml(),this.items.forEach((t=>t.html.classList.add($l.SELECTIONITEM)))}display(){}right(t){this.anchor.right(t)}left(t){this.anchor.left(t)}}class Tc extends Nc{static fromJson(t,{title:e,signature:i,selections:s,order:r,grid:n},o){const a=new this(e,i,r,n);a.attachMenu(o);const l=s.map((e=>t.get("selectionMenu")(t,e,a)));return a.selections=l,a}constructor(t,e,i="none",s="vertical"){super(t,null,e),this.style=i,this.grid=s,this._selections=[],this.prefix="ctxt-selection",this._balanced=!0}attachMenu(t){this.menu=t}get selections(){return this._selections}set selections(t){this._selections=[],t.forEach((t=>this.addSelection(t)))}addSelection(t){t.anchor=this,this._selections.push(t)}rowDiv(t){const e=document.createElement("div");this.contentDiv.appendChild(e);const i=t.map((t=>(e.appendChild(t.html),t.html.id||(t.html.id=this.prefix+ic()),t.html.getBoundingClientRect()))),s=i.map((t=>t.width)),r=s.reduce(((t,e)=>t+e),0),n=i.reduce(((t,e)=>Math.max(t,e.height)),0);return e.classList.add($l.SELECTIONDIVIDER),e.setAttribute("style","height: "+n+"px;"),[e,r,n,s]}display(){if(super.display(),this.order(),!this.selections.length)return;const t=[];let e=0,i=[];const s=this.getChunkSize(this.selections.length);for(let r=0;r<this.selections.length;r+=s){const n=this.selections.slice(r,r+s),[o,a,l,c]=this.rowDiv(n);t.push(o),e=Math.max(e,a),n.forEach((t=>t.html.style.height=l+"px")),i=this.combineColumn(i,c)}this._balanced&&(this.balanceColumn(t,i),e=i.reduce(((t,e)=>t+e),20)),t.forEach((t=>t.style.width=e+"px"))}getChunkSize(t){switch(this.grid){case"square":return Math.floor(Math.sqrt(t));case"horizontal":return Math.floor(t/Tc.chunkSize);default:return Tc.chunkSize}}balanceColumn(t,e){t.forEach((t=>{const i=Array.from(t.children);for(let t,s=0;t=i[s];s++)t.style.width=e[s]+"px"}))}combineColumn(t,e){let i=[],s=0;for(;t[s]||e[s];){if(!t[s]){i=i.concat(e.slice(s));break}if(!e[s]){i=i.concat(t.slice(s));break}i.push(Math.max(t[s],e[s])),s++}return i}left(t){this.move(t,(t=>(0===t?this.selections.length:t)-1))}right(t){this.move(t,(t=>t===this.selections.length-1?0:t+1))}generateHtml(){super.generateHtml(),this.html.classList.add($l.SELECTION)}generateContent(){const t=super.generateContent();return t.classList.add($l.SELECTIONBOX),t.removeAttribute("tabindex"),t}findSelection(t){const e=t.target;let i=null;if(e.id&&(i=this.selections.find((t=>t.html.id===e.id))),!i){const t=e.parentElement.id;i=this.selections.find((e=>e.html.id===t))}return i}move(t,e){const i=this.findSelection(t);i.focused&&i.focused.unfocus();const s=e(this.selections.indexOf(i));this.selections[s].focus()}order(){this.selections.sort(Tc.orderMethod.get(this.style))}toJson(){return{type:""}}}Tc.chunkSize=4,Tc.orderMethod=new Map([["alphabetical",(t,e)=>t.items[0].content.localeCompare(e.items[0].content)],["none",(t,e)=>1],["decreasing",(t,e)=>{const i=t.items.length,s=e.items.length;return i<s?1:s<i?-1:0}],["increasing",(t,e)=>{const i=t.items.length,s=e.items.length;return i<s?-1:s<i?1:0}]]);class _c{constructor(t){this._parser=new Map(t)}get(t){return this._parser.get(t)}add(t,e){this._parser.set(t,e)}}var Lc=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};class Cc{constructor(t=[]){this._initList=[["command",mc.fromJson.bind(mc)],["checkbox",gc.fromJson.bind(gc)],["combo",bc.fromJson.bind(bc)],["slider",xc.fromJson.bind(xc)],["label",Ec.fromJson.bind(Ec)],["radio",uc.fromJson.bind(uc)],["rule",pc.fromJson.bind(pc)],["submenu",nc.fromJson.bind(nc)],["contextMenu",cc.fromJson.bind(cc)],["subMenu",hc.fromJson.bind(hc)],["variable",fc.fromJson.bind(fc)],["items",this.items.bind(this)],["selectionMenu",vc.fromJson.bind(vc)],["selectionBox",Tc.fromJson.bind(Tc)]],this._factory=new _c(this._initList),t.forEach((([t,e])=>this.factory.add(t,e)))}get factory(){return this._factory}items(t,e,i){const s=[];for(const t of e){const e=this.parse(t,i);e&&(i.items.push(e),t.disabled&&e.disable(),t.hidden&&s.push(e))}return s.forEach((t=>t.hide())),i.items}parse(t,...e){var{type:i}=t,s=Lc(t,["type"]);const r=this.factory.get(i);return r?r(this.factory,s,...e):null}}function Rc(t){return"."+($l[t]||t)}function wc(t,e=";"){return"{\n "+t.join(e+"\n ")+";\n}"}const Ic={};Ic[Rc("MENU")]=wc(["position: absolute","background-color: white","color: black","width: auto","padding: 5px 0px","border: 1px solid #CCCCCC","margin: 0","cursor: default","font: menu","text-align: left","text-indent: 0","text-transform: none","line-height: normal","letter-spacing: normal","word-spacing: normal","word-wrap: normal","white-space: nowrap","float: none","z-index: 1001","border-radius: 5px","box-shadow: 0px 10px 20px #808080"]),Ic[Rc("MENUITEM")]=wc(["padding: 1px 2em","background: transparent"]),Ic[Rc("MENUARROW")]=wc(["position: absolute","right: 0.5em","padding-top: 0.25em","color: #666666","font-family: null","font-size: 0.75em"]),Ic[Rc("MENUACTIVE")+" "+Rc("MENUARROW")]=wc(["color: white"]),Ic[Rc("MENUARROW")+Rc("RTL")]=wc(["left: 0.5em","right: auto"]),Ic[Rc("MENUCHECK")]=wc(["position: absolute","left: 0.7em","font-family: null"]),Ic[Rc("MENUCHECK")+Rc("RTL")]=wc(["right: 0.7em","left: auto"]),Ic[Rc("MENURADIOCHECK")]=wc(["position: absolute","left: 0.7em"]),Ic[Rc("MENURADIOCHECK")+Rc("RTL")]=wc(["right: 0.7em","left: auto"]),Ic[Rc("MENUINPUTBOX")]=wc(["padding-left: 1em","right: 0.5em","color: #666666","font-family: null"]),Ic[Rc("MENUINPUTBOX")+Rc("RTL")]=wc(["left: 0.1em"]),Ic[Rc("MENUCOMBOBOX")]=wc(["left: 0.1em","padding-bottom: 0.5em"]),Ic[Rc("MENUSLIDER")]=wc(["left: 0.1em"]),Ic[Rc("SLIDERVALUE")]=wc(["position: absolute","right: 0.1em","padding-top: 0.25em","color: #333333","font-size: 0.75em"]),Ic[Rc("MENUACTIVE")+" "+Rc("SLIDERVALUE")]=wc(["color: #DDDDDD"]),Ic[Rc("SLIDERBAR")]=wc(["outline: none","background: #D3D3D3"]),Ic[Rc("MENULABEL")]=wc(["padding: 1px 2em 3px 1.33em","font-style: italic"]),Ic[Rc("MENURULE")]=wc(["border-top: 1px solid #DDDDDD","margin: 4px 3px"]),Ic[Rc("MENUDISABLED")]=wc(["color: #999"]),Ic[Rc("MENUACTIVE")]=wc(["background-color: #606872","color: white"]),Ic[Rc("MENUDISABLED")+":focus"]=wc(["background-color: #E8E8E8"]),Ic[Rc("MENULABEL")+":focus"]=wc(["background-color: #E8E8E8"]),Ic[Rc("CONTEXTMENU")+":focus"]=wc(["outline: none"]),Ic[Rc("CONTEXTMENU")+" "+Rc("MENUITEM")+":focus"]=wc(["outline: none"]),Ic[Rc("SELECTIONMENU")]=wc(["position: relative","float: left","border-bottom: none","box-shadow: none ! important","border-radius: 0px !important"]),Ic[Rc("SELECTIONITEM")]=wc(["padding-right: 1em"]),Ic[Rc("SELECTION")]=wc(["right: 40%","width: 50%"]),Ic[Rc("SELECTIONBOX")]=wc(["padding: 0em","max-height: 20em","max-width: none","background-color: #FFFFFF"]),Ic[Rc("SELECTIONDIVIDER")]=wc(["clear: both","border-top: 2px solid #000000"]),Ic[Rc("MENU")+" "+Rc("MENUCLOSE")]=wc(["top: -10px","left: -10px"]),Ic["@media (prefers-color-scheme: dark) /* menu */"]=wc([Rc("MENU")+" "+wc(["color: #E0E0E0","background-color: #242436","box-shadow: 0px 10px 20px #000","border: 1px solid #808080"]),Rc("SLIDERVALUE")+" "+wc(["color: #D0D0D0"]),Rc("MENUDISABLED")+":focus "+wc(["background-color: #383838"]),Rc("MENULABEL")+":focus "+wc(["background-color: #585858"]),Rc("MENURULE")+" "+wc(["border-top: 1px solid #808080"]),Rc("SELECTIONDIVIDER")+" "+wc(["border-top: 2px solid #808080"])],"");const Sc={};Sc[Rc("MENUCLOSE")]=wc(["position: absolute","cursor: pointer","display: inline-block","border: 2px solid #AAA","border-radius: 18px",'font-family: "Courier New", Courier',"font-size: 24px","color: #F0F0F0"]),Sc[Rc("MENUCLOSE")+" span"]=wc(["display: block","background-color: #AAA","border: 1.5px solid","border-radius: 18px","line-height: 0","padding: 8px 0 6px"]),Sc[Rc("MENUCLOSE")+":hover"]=wc(["color: white !important","border: 2px solid #CCC !important"]),Sc[Rc("MENUCLOSE")+":hover span"]=wc(["background-color: #CCC !important"]),Sc[Rc("MENUCLOSE")+":hover:focus"]=wc(["outline: none"]);function Ac(t,e=document,i="MJX-Menu-styles"){if(e.head.querySelector("#"+i))return;const s=e.createElement("style");s.id=i;const r=[];for(const e in t)r.push(`${e} ${t[e]}`);s.textContent=r.join("\n"),e.head.appendChild(s)}class Oc extends cc{constructor(){super(...arguments),this.mathItem=null,this.nofocus=!1,this.errorMsg=""}post(t,e){var i,s;if(this.mathItem){const r=null===(s=null===(i=this.mathItem)||void 0===i?void 0:i.explorers)||void 0===s?void 0:s.speech;(null==r?void 0:r.active)&&(r.restarted=r.semanticFocus()),void 0!==e&&(this.getOriginalMenu(),this.getSemanticsMenu(),this.getSpeechMenu(),this.getBrailleMenu(),this.getSvgMenu(),this.getErrorMessage(),this.dynamicSubmenus()),super.post(t,e)}}unpost(){this.posted&&super.unpost(),this.mathItem&&(this.mathItem.outputData.nofocus=this.nofocus),this.mathItem=null,this.nofocus=!1}findID(...t){let e=this,i=null;for(const s of t){if(!e)return null;for(i of e.items){if(i.id===s){e=i instanceof nc?i.submenu:null;break}e=i=null}}return i}setJax(t){this.jax=t}getOriginalMenu(){const t=this.mathItem.inputJax.name,e=this.findID("Show","Original");e.content="MathML"===t?"Original MathML":t+" Commands";this.findID("Copy","Original").content=e.content}getSemanticsMenu(){const t=this.findID("Settings","MathmlIncludes","semantics");"MathML"===this.mathItem.inputJax.name?t.disable():t.enable()}getSpeechMenu(){const t=this.mathItem.outputData.speech;this.findID("Show","Speech")[t?"enable":"disable"](),this.findID("Copy","Speech")[t?"enable":"disable"]()}getBrailleMenu(){const t=this.mathItem.outputData.braille;this.findID("Show","Braille")[t?"enable":"disable"](),this.findID("Copy","Braille")[t?"enable":"disable"]()}getSvgMenu(){const t=this.jax.SVG;this.findID("Show","SVG")[t?"enable":"disable"](),this.findID("Copy","SVG")[t?"enable":"disable"]()}getErrorMessage(){const t=this.mathItem.root.childNodes[0].childNodes;let e=!0;if(this.errorMsg="",1===t.length&&t[0].isKind("merror")){const i=t[0].attributes;this.errorMsg=i.get("data-mjx-error")||i.get("data-mjx-message")||"",e=!this.errorMsg}this.findID("Show","Error")[e?"disable":"enable"](),this.findID("Copy","Error")[e?"disable":"enable"]()}dynamicSubmenus(){for(const[t,[e,i]]of Oc.DynamicSubmenus){const s=this.find(t);s&&e(this,s,(t=>{var e;s.submenu=t,!(null===(e=null==t?void 0:t.items)||void 0===e?void 0:e.length)||i&&!this.settings[i]?s.disable():s.enable()}))}}}Oc.DynamicSubmenus=new Map;class Mc extends Tc{constructor(t,e,i,s,r,n){super(t,e,s,r),this.attachMenu(n);const o=n.factory;this.selections=i.map((t=>o.get("selectionMenu")(o,t,this)))}post(){const t=Array.from(Object.values(this.menu.jax)).filter((t=>!!t))[0],e=new Ln({title:this.title,message:"",adaptor:t.adaptor,styles:{"mjx-dialog > div":{padding:0}}});e.attach(),this.contentDiv=e.content,this.display()}display(){const t=this;if(t.order(),!this.selections.length)return;const e=[];let i=0,s=[];const r=t.getChunkSize(this.selections.length);for(let n=0;n<this.selections.length;n+=r){const o=this.selections.slice(n,n+r),[a,l,c,h]=t.rowDiv(o);e.push(a),i=Math.max(i,l),o.forEach((t=>t.html.style.height=c+"px")),s=t.combineColumn(s,h)}t._balanced&&(t.balanceColumn(e,s),i=s.reduce(((t,e)=>t+e-2),20)),e.forEach((t=>t.style.width=i+"px"))}}var kc,Dc,Pc;!function(t){t.DOMAIN="domain",t.STYLE="style",t.LOCALE="locale",t.TOPIC="topic",t.MODALITY="modality"}(kc||(kc={}));class Bc{static createProp(...t){const e=jc.DEFAULT_ORDER,i={};for(let s=0,r=t.length,n=e.length;s<r&&s<n;s++)i[e[s]]=t[s];return new Bc(i)}constructor(t,e=Object.keys(t)){this.properties=t,this.order=e}getProperties(){return this.properties}getOrder(){return this.order}getAxes(){return this.order}getProperty(t){return this.properties[t]}updateProperties(t){this.properties=t}allProperties(){const t=[];return this.order.forEach((e=>t.push(this.getProperty(e).slice()))),t}toString(){const t=[];return this.order.forEach((e=>t.push(e+": "+this.getProperty(e).toString()))),t.join("\n")}}class jc extends Bc{static createCstr(...t){const e=jc.DEFAULT_ORDER,i={};for(let s=0,r=t.length,n=e.length;s<r&&s<n;s++)i[e[s]]=t[s];return new jc(i)}static defaultCstr(){return jc.createCstr.apply(null,jc.DEFAULT_ORDER.map((function(t){return jc.DEFAULT_VALUES[t]})))}static validOrder(t){const e=jc.DEFAULT_ORDER.slice();return t.every((t=>{const i=e.indexOf(t);return-1!==i&&e.splice(i,1)}))}constructor(t,e){const i={};for(const[e,s]of Object.entries(t))i[e]=[s];super(i,e),this.components=t}getComponents(){return this.components}getValue(t){return this.components[t]}getValues(){return this.order.map((t=>this.getValue(t)))}allProperties(){const t=super.allProperties();for(let e,i,s=0;e=t[s],i=this.order[s];s++){const t=this.getValue(i);-1===e.indexOf(t)&&e.unshift(t)}return t}toString(){return this.getValues().join(".")}equal(t){const e=t.getAxes();if(this.order.length!==e.length)return!1;for(let i,s=0;i=e[s];s++){const e=this.getValue(i);if(!e||t.getValue(i)!==e)return!1}return!0}}jc.DEFAULT_ORDER=[kc.LOCALE,kc.MODALITY,kc.DOMAIN,kc.STYLE,kc.TOPIC],jc.BASE_LOCALE="base",jc.DEFAULT_VALUE="default",jc.DEFAULT_VALUES={[kc.LOCALE]:"en",[kc.DOMAIN]:jc.DEFAULT_VALUE,[kc.STYLE]:jc.DEFAULT_VALUE,[kc.TOPIC]:jc.DEFAULT_VALUE,[kc.MODALITY]:"speech"};class Fc{constructor(t){this.order=t}parse(t){const e=t.split("."),i={};if(e.length>this.order.length)throw new Error("Invalid dynamic constraint: "+i);let s=0;for(let t,r=0;t=this.order[r],e.length;r++,s++){const s=e.shift();i[t]=s}return new jc(i,this.order.slice(0,s))}}class Uc{constructor(t,e=new Bc(t.getProperties(),t.getOrder())){this.reference=t,this.fallback=e,this.order=this.reference.getOrder()}getReference(){return this.reference}setReference(t,e){this.reference=t,this.fallback=e||new Bc(t.getProperties(),t.getOrder()),this.order=this.reference.getOrder()}match(t){const e=t.getAxes();return e.length===this.reference.getAxes().length&&e.every((e=>{const i=t.getValue(e);return i===this.reference.getValue(e)||-1!==this.fallback.getProperty(e).indexOf(i)}))}compare(t,e){let i=!1;for(let s,r=0;s=this.order[r];r++){const r=t.getValue(s),n=e.getValue(s);if(!i){const t=this.reference.getValue(s);if(t===r&&t!==n)return-1;if(t===n&&t!==r)return 1;if(t===r&&t===n)continue;t!==r&&t!==n&&(i=!0)}const o=this.fallback.getProperty(s),a=o.indexOf(r),l=o.indexOf(n);if(a<l)return-1;if(l<a)return 1}return 0}toString(){return this.reference.toString()+"\n"+this.fallback.toString()}}!function(t){t.SYNC="sync",t.ASYNC="async",t.HTTP="http"}(Dc||(Dc={})),function(t){t.PITCH="pitch",t.RATE="rate",t.VOLUME="volume",t.PAUSE="pause",t.JOIN="join",t.LAYOUT="layout"}(Pc||(Pc={}));Pc.PITCH,Pc.RATE,Pc.VOLUME,Pc.PAUSE,Pc.JOIN;var Hc,qc;!function(t){t.NONE="none",t.SHALLOW="shallow",t.DEEP="deep"}(Hc||(Hc={})),function(t){t.NONE="none",t.LAYOUT="layout",t.COUNTING="counting",t.PUNCTUATION="punctuation",t.SSML="ssml",t.ACSS="acss",t.SABLE="sable",t.VOICEXML="voicexml"}(qc||(qc={}));var Wc=__webpack_require__(556);function Vc(t){return t.match("/$")?t:t+"/"}class Xc{static getInstance(){return Xc.instance=Xc.instance||new Xc,Xc.instance}init(t){return t&&this.startDebugFile_(t),this.isActive_=!0,this.fileHandle}output(...t){this.isActive_&&this.output_(t)}generate(t){this.isActive_&&this.output_(t.apply(t,[]))}exit(t=()=>{}){this.fileHandle.then((()=>{this.isActive_&&this.stream_&&this.stream_.end("","",t)}))}constructor(){this.isActive_=!1,this.fileHandle=Promise.resolve(),this.stream_=null}startDebugFile_(t){this.fileHandle=Wc.f.fs.promises.open(t,"w"),this.fileHandle=this.fileHandle.then((e=>{this.stream_=e.createWriteStream(t),this.outputFunction=function(...t){this.stream_.write(t.join(" ")),this.stream_.write("\n")}.bind(this),this.stream_.on("error",function(t){console.info("Invalid log file. Debug information sent to console."),this.outputFunction=console.info}.bind(this)),this.stream_.on("finish",(function(){console.info("Finalizing debug file.")}))}))}output_(t){this.stream_?this.fileHandle.then((()=>this.outputFunction.apply(this.outputFunction,["Speech Rule Engine Debugger:"].concat(t)))):console.info(...["Speech Rule Engine Debugger:"].concat(t))}}var zc=__webpack_require__(904);class Gc{constructor(t={}){this.delay=!1,this.domain="clearspeak",this.style=jc.DEFAULT_VALUES[kc.STYLE],this.locale=jc.DEFAULT_VALUES[kc.LOCALE],this.subiso="",this.modality=jc.DEFAULT_VALUES[kc.MODALITY],this.speech=Hc.NONE,this.markup=qc.NONE,this.mark=!0,this.automark=!1,this.character=!0,this.cleanpause=!0,this.cayleyshort=!0,this.linebreaks=!1,this.rate="100",this.walker="Table",this.structure=!1,this.aria=!1,this.tree=!1,this.strict=!1,this.pprint=!1,this.rules="",this.prune="",this.set(t)}set(t){this.ensureDomain(t);for(const[e,i]of Object.entries(t))(Gc.BINARY_FEATURES.includes(e)||Gc.STRING_FEATURES.includes(e))&&(this[e]=i)}json(){const t={};return[].concat(Gc.STRING_FEATURES,Gc.BINARY_FEATURES).forEach((e=>t[e]=this[e])),t}ensureDomain(t){if(t.modality&&"speech"!==t.modality||!t.modality&&"speech"!==this.modality)return;if(!t.domain&&!t.locale)return;if("default"===t.domain)return void(t.domain="mathspeak");const e=t.locale||this.locale,i=t.domain||this.domain;-1===Jc.indexOf(e)||"mathspeak"===i?"en"!==e?"mathspeak"!==i&&"clearspeak"!==i&&(t.domain="mathspeak"):-1===Kc.indexOf(i)&&(t.domain="mathspeak"):t.domain="mathspeak"}}Gc.BINARY_FEATURES=["automark","mark","character","cleanpause","strict","structure","aria","pprint","cayleyshort","linebreaks","tree"],Gc.STRING_FEATURES=["markup","style","domain","speech","walker","locale","delay","modality","rate","rules","subiso","prune"];const Jc=["ca","da","es"],Kc=["chromevox","clearspeak","mathspeak","emacspeak","html"];class $c extends Error{constructor(t=""){super(),this.message=t,this.name="SRE Error"}}class Yc{set defaultLocale(t){this._defaultLocale=zc.u.ensureLocale(t,this._defaultLocale)}get defaultLocale(){return this._defaultLocale}static getInstance(){return Yc.instance=Yc.instance||new Yc,Yc.instance}static defaultEvaluator(t,e){return t}static evaluateNode(t){return Yc.nodeEvaluator(t)}getRate(){const t=parseInt(this.options.rate,10);return isNaN(t)?100:t}setDynamicCstr(t){if(this.defaultLocale&&(jc.DEFAULT_VALUES[kc.LOCALE]=this.defaultLocale),t){const e=Object.keys(t);for(let i=0;i<e.length;i++){const s=e[i];if(-1!==jc.DEFAULT_ORDER.indexOf(s)){const e=t[s];this.options[s]=e}}}const e=[this.options.locale,this.options.modality,this.options.domain,this.options.style].join("."),i=Bc.createProp([jc.DEFAULT_VALUES[kc.LOCALE]],[jc.DEFAULT_VALUES[kc.MODALITY]],[jc.DEFAULT_VALUES[kc.DOMAIN]],[jc.DEFAULT_VALUES[kc.STYLE]]),s=this.comparators[this.options.domain],r=this.parsers[this.options.domain];this.parser=r||this.defaultParser,this.dynamicCstr=this.parser.parse(e),this.dynamicCstr.updateProperties(i.getProperties()),this.comparator=s?s():new Uc(this.dynamicCstr)}constructor(){this.options=new Gc,this.config=!1,this.customLoader=null,this.parsers={},this.comparator=null,this.mode=Dc.SYNC,this.init=!0,this.comparators={},this._defaultLocale=jc.DEFAULT_VALUES[kc.LOCALE],this.options.locale=this.defaultLocale,this.evaluator=Yc.defaultEvaluator,this.defaultParser=new Fc(jc.DEFAULT_ORDER),this.parser=this.defaultParser,this.dynamicCstr=jc.defaultCstr()}configurate(t){this.mode!==Dc.HTTP||Wc.f.webworker||this.config||(!function(t){const e=document.documentElement.querySelectorAll('script[type="text/x-sre-config"]');for(let i=0,s=e.length;i<s;i++){let s;try{s=e[i].innerHTML;const r=JSON.parse(s);for(const[e,i]of Object.entries(r))t[e]=i}catch(t){Xc.getInstance().output("Illegal configuration ",s)}}}(t),this.config=!0),function(t){if("undefined"!=typeof SREfeature)for(const[e,i]of Object.entries(SREfeature))t[e]=i}(t)}setCustomLoader(t){t&&(this.customLoader=t)}setup(t){void 0!==t.mode&&(this.mode=t.mode),this.configurate(t),this.options.set(t),t.json&&(Wc.f.jsonPath=Vc(t.json)),this.setCustomLoader(t.custom)}json(){return Object.assign({mode:this.mode},this.options.json())}reset(){this.options=new Gc}}Yc.nodeEvaluator=function(t){return[]};class Qc{static get(t=Yc.getInstance().options.locale){return Qc.promises[t]||Promise.resolve("")}static getall(){return Promise.all(Object.values(Qc.promises))}}Qc.loaded={},Qc.promises={};const Zc=Wc.f.xpath,th={xhtml:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",mml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function eh(t){return th[t]||null}class ih{constructor(){this.lookupNamespaceURI=eh}}function sh(t,e,i){return Zc.evaluate(t,e,new ih,i,null)}function rh(t){const e=[];for(let i=0,s=t.length;i<s;i++)e.push(t[i]);return e}function nh(t){const e=new Wc.f.xmldom.DOMParser,i=function(t){return(t=t.replace(/ /g,"\xa0")).replace(/>[ \f\n\r\t\v\u200b]+</g,"><").trim()}(t),s=!!i.match(/&(?!lt|gt|amp|quot|apos)\w+;/g);if(!i)throw new $c("Empty input!");try{const t=e.parseFromString(i,s?"text/html":"text/xml");return Yc.getInstance().mode===Dc.HTTP?(Zc.currentDocument=t,s?t.body.childNodes[0]:t.documentElement):t.documentElement}catch(t){throw new $c("Illegal input: "+t.message)}}var oh;function ah(t,e){t.parentNode&&(t.parentNode.insertBefore(e,t),t.parentNode.removeChild(t))}function lh(t){return Wc.f.document.createElement(t)}function ch(t){let e="",i=/(>)(<)(\/*)/g,s=0,r=(t=t.replace(i,"$1\r\n$2$3")).split("\r\n");for(i=/(\.)*(<)(\/*)/g,r=r.map((t=>t.replace(i,"$1\r\n$2$3").split("\r\n"))).reduce(((t,e)=>t.concat(e)),[]);r.length;){let t=r.shift();if(!t)continue;let i=0;if(t.match(/^<\w[^>/]*>[^>]+$/)){const e=hh(t,r[0]);e[0]?e[1]?(t+=r.shift().slice(0,-e[1].length),e[1].trim()&&r.unshift(e[1])):t+=r.shift():i=1}else if(t.match(/^<\/\w/))0!==s&&(s-=1);else if(t.match(/^<\w[^>]*[^/]>.*$/))i=1;else if(t.match(/^<\w[^>]*\/>.+$/)){const e=t.indexOf(">")+1,i=t.slice(e);i.trim()&&r.unshift(),t=t.slice(0,e)+i}else i=0;e+=new Array(s+1).join(" ")+t+"\r\n",s+=i}return e}function hh(t,e){if(!e)return[!1,""];const i=t.match(/^<([^> ]+).*>/),s=e.match(/^<\/([^>]+)>(.*)/);return i&&s&&i[1]===s[1]?[!0,s[2]]:[!1,""]}function dh(t){return t.tagName.toUpperCase()}function uh(t){return(new Wc.f.xmldom.XMLSerializer).serializeToString(t)}!function(t){t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",t[t.NOTATION_NODE=12]="NOTATION_NODE"}(oh||(oh={}));class ph{constructor(t,e,i){this.domain=t,this.name=e,this.func=i,this.active=!1}annotate(t){t.childNodes.forEach(this.annotate.bind(this)),t.contentNodes.forEach(this.annotate.bind(this)),t.addAnnotation(this.domain,this.func(t))}}class mh{constructor(t,e,i,s={}){this.domain=t,this.name=e,this.func=i,this.def=s,this.active=!1}visit(t,e){let i=this.func(t,e);t.addAnnotation(this.domain,i[0]);for(let e,s=0;e=t.childNodes[s];s++)i=this.visit(e,i[1]);for(let e,s=0;e=t.contentNodes[s];s++)i=this.visit(e,i[1]);return i}}const fh=new Map,gh=new Map;function bh(t){const e=t.domain+":"+t.name;t instanceof ph?fh.set(e,t):gh.set(e,t)}function Eh(t,e){const i=t+":"+e,s=fh.get(i)||gh.get(i);s&&(s.active=!0)}var xh,yh,Nh;function vh(t){const e=t.toString(16).toUpperCase();return e.length>3?e:("000"+e).slice(-4)}function Th([t,e],i){const s=parseInt(t,16),r=parseInt(e,16),n=[];for(let t=s;t<=r;t++){let e=vh(t);!1!==i[e]&&(e=i[e]||e,n.push(e))}return n}function _h(t,e={}){return Th(t,e).map((t=>String.fromCodePoint(parseInt(t,16))))}!function(t){t.BOLD="bold",t.BOLDFRAKTUR="bold-fraktur",t.BOLDITALIC="bold-italic",t.BOLDSCRIPT="bold-script",t.DOUBLESTRUCK="double-struck",t.DOUBLESTRUCKITALIC="double-struck-italic",t.FULLWIDTH="fullwidth",t.FRAKTUR="fraktur",t.ITALIC="italic",t.MONOSPACE="monospace",t.NORMAL="normal",t.SCRIPT="script",t.SANSSERIF="sans-serif",t.SANSSERIFITALIC="sans-serif-italic",t.SANSSERIFBOLD="sans-serif-bold",t.SANSSERIFBOLDITALIC="sans-serif-bold-italic"}(xh||(xh={})),function(t){t.SUPER="super",t.SUB="sub",t.CIRCLED="circled",t.PARENTHESIZED="parenthesized",t.PERIOD="period",t.NEGATIVECIRCLED="negative-circled",t.DOUBLECIRCLED="double-circled",t.CIRCLEDSANSSERIF="circled-sans-serif",t.NEGATIVECIRCLEDSANSSERIF="negative-circled-sans-serif",t.COMMA="comma",t.SQUARED="squared",t.NEGATIVESQUARED="negative-squared"}(yh||(yh={})),function(t){t.LATINCAP="latinCap",t.LATINSMALL="latinSmall",t.GREEKCAP="greekCap",t.GREEKSMALL="greekSmall",t.DIGIT="digit"}(Nh||(Nh={}));const Lh=[{interval:["1D400","1D419"],base:Nh.LATINCAP,subst:{},capital:!0,category:"Lu",font:xh.BOLD},{interval:["1D41A","1D433"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.BOLD},{interval:["1D56C","1D585"],base:Nh.LATINCAP,subst:{},capital:!0,category:"Lu",font:xh.BOLDFRAKTUR},{interval:["1D586","1D59F"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.BOLDFRAKTUR},{interval:["1D468","1D481"],base:Nh.LATINCAP,subst:{},capital:!0,category:"Lu",font:xh.BOLDITALIC},{interval:["1D482","1D49B"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.BOLDITALIC},{interval:["1D4D0","1D4E9"],base:Nh.LATINCAP,subst:{},capital:!0,category:"Lu",font:xh.BOLDSCRIPT},{interval:["1D4EA","1D503"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.BOLDSCRIPT},{interval:["1D538","1D551"],base:Nh.LATINCAP,subst:{"1D53A":"2102","1D53F":"210D","1D545":"2115","1D547":"2119","1D548":"211A","1D549":"211D","1D551":"2124"},capital:!0,category:"Lu",font:xh.DOUBLESTRUCK},{interval:["1D552","1D56B"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.DOUBLESTRUCK},{interval:["1D504","1D51D"],base:Nh.LATINCAP,subst:{"1D506":"212D","1D50B":"210C","1D50C":"2111","1D515":"211C","1D51D":"2128"},capital:!0,category:"Lu",font:xh.FRAKTUR},{interval:["1D51E","1D537"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.FRAKTUR},{interval:["FF21","FF3A"],base:Nh.LATINCAP,subst:{},capital:!0,category:"Lu",font:xh.FULLWIDTH},{interval:["FF41","FF5A"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.FULLWIDTH},{interval:["1D434","1D44D"],base:Nh.LATINCAP,subst:{},capital:!0,category:"Lu",font:xh.ITALIC},{interval:["1D44E","1D467"],base:Nh.LATINSMALL,subst:{"1D455":"210E"},capital:!1,category:"Ll",font:xh.ITALIC},{interval:["1D670","1D689"],base:Nh.LATINCAP,subst:{},capital:!0,category:"Lu",font:xh.MONOSPACE},{interval:["1D68A","1D6A3"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.MONOSPACE},{interval:["0041","005A"],base:Nh.LATINCAP,subst:{},capital:!0,category:"Lu",font:xh.NORMAL},{interval:["0061","007A"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.NORMAL},{interval:["1D49C","1D4B5"],base:Nh.LATINCAP,subst:{"1D49D":"212C","1D4A0":"2130","1D4A1":"2131","1D4A3":"210B","1D4A4":"2110","1D4A7":"2112","1D4A8":"2133","1D4AD":"211B"},capital:!0,category:"Lu",font:xh.SCRIPT},{interval:["1D4B6","1D4CF"],base:Nh.LATINSMALL,subst:{"1D4BA":"212F","1D4BC":"210A","1D4C4":"2134"},capital:!1,category:"Ll",font:xh.SCRIPT},{interval:["1D5A0","1D5B9"],base:Nh.LATINCAP,subst:{},capital:!0,category:"Lu",font:xh.SANSSERIF},{interval:["1D5BA","1D5D3"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.SANSSERIF},{interval:["1D608","1D621"],base:Nh.LATINCAP,subst:{},capital:!0,category:"Lu",font:xh.SANSSERIFITALIC},{interval:["1D622","1D63B"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.SANSSERIFITALIC},{interval:["1D5D4","1D5ED"],base:Nh.LATINCAP,subst:{},capital:!0,category:"Lu",font:xh.SANSSERIFBOLD},{interval:["1D5EE","1D607"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.SANSSERIFBOLD},{interval:["1D63C","1D655"],base:Nh.LATINCAP,subst:{},capital:!0,category:"Lu",font:xh.SANSSERIFBOLDITALIC},{interval:["1D656","1D66F"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"Ll",font:xh.SANSSERIFBOLDITALIC},{interval:["0391","03A9"],base:Nh.GREEKCAP,subst:{"03A2":"03F4"},capital:!0,category:"Lu",font:xh.NORMAL},{interval:["03B0","03D0"],base:Nh.GREEKSMALL,subst:{"03B0":"2207","03CA":"2202","03CB":"03F5","03CC":"03D1","03CD":"03F0","03CE":"03D5","03CF":"03F1","03D0":"03D6"},capital:!1,category:"Ll",font:xh.NORMAL},{interval:["1D6A8","1D6C0"],base:Nh.GREEKCAP,subst:{},capital:!0,category:"Lu",font:xh.BOLD},{interval:["1D6C1","1D6E1"],base:Nh.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:xh.BOLD},{interval:["1D6E2","1D6FA"],base:Nh.GREEKCAP,subst:{},capital:!0,category:"Lu",font:xh.ITALIC},{interval:["1D6FB","1D71B"],base:Nh.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:xh.ITALIC},{interval:["1D71C","1D734"],base:Nh.GREEKCAP,subst:{},capital:!0,category:"Lu",font:xh.BOLDITALIC},{interval:["1D735","1D755"],base:Nh.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:xh.BOLDITALIC},{interval:["1D756","1D76E"],base:Nh.GREEKCAP,subst:{},capital:!0,category:"Lu",font:xh.SANSSERIFBOLD},{interval:["1D76F","1D78F"],base:Nh.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:xh.SANSSERIFBOLD},{interval:["1D790","1D7A8"],base:Nh.GREEKCAP,subst:{},capital:!0,category:"Lu",font:xh.SANSSERIFBOLDITALIC},{interval:["1D7A9","1D7C9"],base:Nh.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:xh.SANSSERIFBOLDITALIC},{interval:["0030","0039"],base:Nh.DIGIT,subst:{},offset:0,category:"Nd",font:xh.NORMAL},{interval:["2070","2079"],base:Nh.DIGIT,subst:{2071:"00B9",2072:"00B2",2073:"00B3"},offset:0,category:"No",font:yh.SUPER},{interval:["2080","2089"],base:Nh.DIGIT,subst:{},offset:0,category:"No",font:yh.SUB},{interval:["245F","2473"],base:Nh.DIGIT,subst:{"245F":"24EA"},offset:0,category:"No",font:yh.CIRCLED},{interval:["3251","325F"],base:Nh.DIGIT,subst:{},offset:21,category:"No",font:yh.CIRCLED},{interval:["32B1","32BF"],base:Nh.DIGIT,subst:{},offset:36,category:"No",font:yh.CIRCLED},{interval:["2474","2487"],base:Nh.DIGIT,subst:{},offset:1,category:"No",font:yh.PARENTHESIZED},{interval:["2487","249B"],base:Nh.DIGIT,subst:{2487:"1F100"},offset:0,category:"No",font:yh.PERIOD},{interval:["2775","277F"],base:Nh.DIGIT,subst:{2775:"24FF"},offset:0,category:"No",font:yh.NEGATIVECIRCLED},{interval:["24EB","24F4"],base:Nh.DIGIT,subst:{},offset:11,category:"No",font:yh.NEGATIVECIRCLED},{interval:["24F5","24FE"],base:Nh.DIGIT,subst:{},offset:1,category:"No",font:yh.DOUBLECIRCLED},{interval:["277F","2789"],base:Nh.DIGIT,subst:{"277F":"1F10B"},offset:0,category:"No",font:yh.CIRCLEDSANSSERIF},{interval:["2789","2793"],base:Nh.DIGIT,subst:{2789:"1F10C"},offset:0,category:"No",font:yh.NEGATIVECIRCLEDSANSSERIF},{interval:["FF10","FF19"],base:Nh.DIGIT,subst:{},offset:0,category:"Nd",font:xh.FULLWIDTH},{interval:["1D7CE","1D7D7"],base:Nh.DIGIT,subst:{},offset:0,category:"Nd",font:xh.BOLD},{interval:["1D7D8","1D7E1"],base:Nh.DIGIT,subst:{},offset:0,category:"Nd",font:xh.DOUBLESTRUCK},{interval:["1D7E2","1D7EB"],base:Nh.DIGIT,subst:{},offset:0,category:"Nd",font:xh.SANSSERIF},{interval:["1D7EC","1D7F5"],base:Nh.DIGIT,subst:{},offset:0,category:"Nd",font:xh.SANSSERIFBOLD},{interval:["1D7F6","1D7FF"],base:Nh.DIGIT,subst:{},offset:0,category:"Nd",font:xh.MONOSPACE},{interval:["1F101","1F10A"],base:Nh.DIGIT,subst:{},offset:0,category:"No",font:yh.COMMA},{interval:["24B6","24CF"],base:Nh.LATINCAP,subst:{},capital:!0,category:"So",font:yh.CIRCLED},{interval:["24D0","24E9"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"So",font:yh.CIRCLED},{interval:["1F110","1F129"],base:Nh.LATINCAP,subst:{},capital:!0,category:"So",font:yh.PARENTHESIZED},{interval:["249C","24B5"],base:Nh.LATINSMALL,subst:{},capital:!1,category:"So",font:yh.PARENTHESIZED},{interval:["1F130","1F149"],base:Nh.LATINCAP,subst:{},capital:!0,category:"So",font:yh.SQUARED},{interval:["1F170","1F189"],base:Nh.LATINCAP,subst:{},capital:!0,category:"So",font:yh.NEGATIVESQUARED},{interval:["1F150","1F169"],base:Nh.LATINCAP,subst:{},capital:!0,category:"So",font:yh.NEGATIVECIRCLED}],Ch=new Map;function Rh(t,e){return t+e.split("-").map((t=>t[0].toUpperCase()+t.slice(1))).join("")}for(const t of Lh){const e=Rh(t.base,t.font),i=_h(t.interval,t.subst);let s=Ch.get(e);s?s.unicode=s.unicode.concat(i):(s=t,s.unicode=i,Ch.set(e,s))}var wh;!function(t){t.PUNCTUATION="punctuation",t.FENCE="fence",t.NUMBER="number",t.IDENTIFIER="identifier",t.TEXT="text",t.OPERATOR="operator",t.RELATION="relation",t.LARGEOP="largeop",t.FUNCTION="function",t.ACCENT="accent",t.FENCED="fenced",t.FRACTION="fraction",t.PUNCTUATED="punctuated",t.RELSEQ="relseq",t.MULTIREL="multirel",t.INFIXOP="infixop",t.PREFIXOP="prefixop",t.POSTFIXOP="postfixop",t.APPL="appl",t.INTEGRAL="integral",t.BIGOP="bigop",t.SQRT="sqrt",t.ROOT="root",t.LIMUPPER="limupper",t.LIMLOWER="limlower",t.LIMBOTH="limboth",t.SUBSCRIPT="subscript",t.SUPERSCRIPT="superscript",t.UNDERSCORE="underscore",t.OVERSCORE="overscore",t.TENSOR="tensor",t.TABLE="table",t.MULTILINE="multiline",t.MATRIX="matrix",t.VECTOR="vector",t.CASES="cases",t.ROW="row",t.LINE="line",t.CELL="cell",t.ENCLOSE="enclose",t.INFERENCE="inference",t.RULELABEL="rulelabel",t.CONCLUSION="conclusion",t.PREMISES="premises",t.UNKNOWN="unknown",t.EMPTY="empty"}(wh||(wh={}));const Ih=Object.assign({},wh);var Sh;!function(t){t.COMMA="comma",t.SEMICOLON="semicolon",t.ELLIPSIS="ellipsis",t.FULLSTOP="fullstop",t.QUESTION="question",t.EXCLAMATION="exclamation",t.QUOTES="quotes",t.DASH="dash",t.TILDE="tilde",t.PRIME="prime",t.DEGREE="degree",t.VBAR="vbar",t.COLON="colon",t.OPENFENCE="openfence",t.CLOSEFENCE="closefence",t.APPLICATION="application",t.DUMMY="dummy",t.UNIT="unit",t.LABEL="label",t.OPEN="open",t.CLOSE="close",t.TOP="top",t.BOTTOM="bottom",t.NEUTRAL="neutral",t.METRIC="metric",t.LATINLETTER="latinletter",t.GREEKLETTER="greekletter",t.OTHERLETTER="otherletter",t.NUMBERSET="numbersetletter",t.INTEGER="integer",t.FLOAT="float",t.OTHERNUMBER="othernumber",t.INFTY="infty",t.MIXED="mixed",t.MULTIACCENT="multiaccent",t.OVERACCENT="overaccent",t.UNDERACCENT="underaccent",t.UNDEROVER="underover",t.SUBSUP="subsup",t.LEFTSUB="leftsub",t.LEFTSUPER="leftsuper",t.RIGHTSUB="rightsub",t.RIGHTSUPER="rightsuper",t.LEFTRIGHT="leftright",t.ABOVEBELOW="abovebelow",t.INTERVAL="interval",t.SETEMPTY="set empty",t.SETEXT="set extended",t.SETSINGLE="set singleton",t.SETCOLLECT="set collection",t.STRING="string",t.SPACE="space",t.ANNOTATION="annotation",t.TEXT="text",t.SEQUENCE="sequence",t.ENDPUNCT="endpunct",t.STARTPUNCT="startpunct",t.NEGATIVE="negative",t.POSITIVE="positive",t.NEGATION="negation",t.MULTIOP="multiop",t.PREFIXOP="prefix operator",t.POSTFIXOP="postfix operator",t.LIMFUNC="limit function",t.INFIXFUNC="infix function",t.PREFIXFUNC="prefix function",t.POSTFIXFUNC="postfix function",t.SIMPLEFUNC="simple function",t.COMPFUNC="composed function",t.SUM="sum",t.INTEGRAL="integral",t.GEOMETRY="geometry",t.BOX="box",t.BLOCK="block",t.ADDITION="addition",t.MULTIPLICATION="multiplication",t.SUBTRACTION="subtraction",t.IMPLICIT="implicit",t.DIVISION="division",t.VULGAR="vulgar",t.EQUALITY="equality",t.INEQUALITY="inequality",t.ARROW="arrow",t.ELEMENT="element",t.NONELEMENT="nonelement",t.REELEMENT="reelement",t.RENONELEMENT="renonelement",t.SET="set",t.DETERMINANT="determinant",t.ROWVECTOR="rowvector",t.BINOMIAL="binomial",t.SQUAREMATRIX="squarematrix",t.CYCLE="cycle",t.MULTILINE="multiline",t.MATRIX="matrix",t.VECTOR="vector",t.CASES="cases",t.TABLE="table",t.CAYLEY="cayley",t.PROOF="proof",t.LEFT="left",t.RIGHT="right",t.UP="up",t.DOWN="down",t.FINAL="final",t.SINGLE="single",t.HYP="hyp",t.AXIOM="axiom",t.LOGIC="logic",t.UNKNOWN="unknown",t.MGLYPH="mglyph"}(Sh||(Sh={}));const Ah=Object.assign({},Sh);var Oh;!function(t){t.CALIGRAPHIC="caligraphic",t.CALIGRAPHICBOLD="caligraphic-bold",t.OLDSTYLE="oldstyle",t.OLDSTYLEBOLD="oldstyle-bold",t.UNKNOWN="unknown"}(Oh||(Oh={}));const Mh=Object.assign(Object.assign(Object.assign({},xh),Oh),yh);var kh;!function(t){t.ALLLETTERS="allLetters",t.D="d",t.BAR="bar",t.TILDE="tilde"}(kh||(kh={}));const Dh=Object.assign(Object.assign({},Nh),kh);var Ph=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]])}return i};const Bh={functionApplication:String.fromCodePoint(8289),invisibleTimes:String.fromCodePoint(8290),invisibleComma:String.fromCodePoint(8291),invisiblePlus:String.fromCodePoint(8292)};class jh extends Map{get(t){return super.get(t)||{role:Ah.UNKNOWN,type:Ih.UNKNOWN,font:Mh.UNKNOWN}}}class Fh extends Map{set(t,e,i=""){return super.set(this.secKey(e,t),i||e),this}has(t,e){return super.has(this.secKey(e,t))}get(t,e){return super.get(this.secKey(e,t))}secKey(t,e){return e?`${t} ${e}`:`${t}`}}const Uh={Meaning:new jh,Secondary:new Fh,FencesHoriz:new Map,FencesVert:new Map,LatexCommands:new Map};function Hh(t,e){for(const i of t)Uh.Meaning.set(i,{role:e.role||Ah.UNKNOWN,type:e.type||Ih.UNKNOWN,font:e.font||Mh.UNKNOWN}),e.secondary&&Uh.Secondary.set(i,e.secondary)}function qh(t,e,i=1){const s={},r=function(t){let e=[];for(const i of t)Array.isArray(i)?e=e.concat(Th(i,{}).map((t=>parseInt(t,16)))):e.push(parseInt(i,16));return e}(e);for(const e of r)s[e]||(t.set(String.fromCodePoint(e),String.fromCodePoint(e+i)),s[e]=!0,s[e+i]=!0)}const Wh=["cos","cot","csc","sec","sin","tan","arccos","arccot","arccsc","arcsec","arcsin","arctan"].concat(["cosh","coth","csch","sech","sinh","tanh","arcosh","arcoth","arcsch","arsech","arsinh","artanh"],["deg","det","dim","hom","ker","Tr"],["log","ln","lg","exp","gcd","lcm","arg","im","re","Pr"]);function Vh(t,e,i,s,r,n=[],o={},a={}){const l=Ch.get(Rh(t,s));l&&(l.unicode.forEach((t=>{Uh.Meaning.set(t,{type:e,role:i,font:r}),n.forEach((e=>Uh.Secondary.set(t,e)))})),function(t,e){for(const[i,s]of Object.entries(e)){const e=t[i];void 0!==e&&Uh.Meaning.set(e,s)}}(l.unicode,o),function(t,e){for(const[i,s]of Object.entries(e)){const e=t[i];void 0!==e&&Uh.Secondary.set(e,s)}}(l.unicode,a))}[{set:["23","26","40","5c","a1","a7","b6","bf","2017",["2022","2025"],"2027","203b","203c",["2041","2043"],["2047","2049"],["204b","204d"],"2050","2055","2056",["2058","205e"],"2234","2235","fe45","fe46","fe5f","fe60","fe68","fe6b","ff03","ff06","ff0f","ff20","ff3c"],type:Ih.PUNCTUATION,role:Ah.UNKNOWN},{set:["22","ab","bb","2dd",["2018","201f"],"2039","203a",["301d","301f"],"fe10","ff02","ff07"],type:Ih.PUNCTUATION,role:Ah.QUOTES},{set:["3b","204f","2a1f","2a3e","fe14","fe54","ff1b"],type:Ih.PUNCTUATION,role:Ah.SEMICOLON},{set:["3f","203d","fe16","fe56","ff1f"],type:Ih.PUNCTUATION,role:Ah.QUESTION},{set:["21","fe15","fe57","ff01"],type:Ih.PUNCTUATION,role:Ah.EXCLAMATION},{set:["5e","60","a8","aa","b4","ba","2c7",["2d8","2da"],"2040","207a","207d","207e","ff3e","ff40"],type:Ih.PUNCTUATION,role:Ah.OVERACCENT},{set:["b8","2db","2038","203f","2054","208a","208d","208e"],type:Ih.PUNCTUATION,role:Ah.UNDERACCENT},{set:["3a","2982","fe13","fe30","fe55","ff1a"],type:Ih.PUNCTUATION,role:Ah.COLON},{set:["2c","2063","fe50","ff0c"],type:Ih.PUNCTUATION,role:Ah.COMMA},{set:["2026",["22ee","22f1"],"fe19"],type:Ih.PUNCTUATION,role:Ah.ELLIPSIS},{set:["2e","fe52","ff0e"],type:Ih.PUNCTUATION,role:Ah.FULLSTOP},{set:["2d","207b","208b","2212","2796","fe63","ff0d"],type:Ih.OPERATOR,role:Ah.DASH,secondary:Dh.BAR},{set:["5f","af",["2010","2015"],"203e","208b",["fe49","fe4f"],"fe58","ff3f","ffe3"],type:Ih.PUNCTUATION,role:Ah.DASH,secondary:Dh.BAR},{set:["7e","2dc","2f7","303","330","334","2053","223c","223d","301c","ff5e"],type:Ih.OPERATOR,role:Ah.TILDE,secondary:Dh.TILDE},{set:["27","2b9","2ba",["2032","2037"],"2057"],type:Ih.PUNCTUATION,role:Ah.PRIME},{set:["b0"],type:Ih.PUNCTUATION,role:Ah.DEGREE},{set:["2b","b1","2064","2213","2214","2228","222a",["228c","228e"],"2294","2295","229d","229e","22bb","22bd","22c4","22ce","22d3","2304","271b","271c","2795","27cf","29fa","29fb","29fe",["2a22","2a28"],"2a2d","2a2e","2a39","2a42","2a45","2a46","2a48","2a4a","2a4c","2a4f","2a50","2a52","2a54","2a56","2a57","2a59","2a5b","2a5d",["2a61","2a63"],"2adc","2add","fe62","ff0b"],type:Ih.OPERATOR,role:Ah.ADDITION},{set:["2a","b7","d7","2020","2021","204e","2051","2062",["2217","2219"],"2227","2229","2240","2293","2297",["2299","229b"],"22a0","22a1","22b9","22bc",["22c5","22cc"],"22cf","22d2","22d4","2303","2305","2306","25cb","2715","2716","27ce","27d1",["29d1","29d7"],"29e2","2a1d",["2a2f","2a37"],["2a3b","2a3d"],"2a40","2a43","2a44","2a47","2a49","2a4b","2a4d","2a4e","2a51","2a53","2a55","2a58","2a5a","2a5c",["2a5e","2a60"],"2ada","2adb","fe61","ff0a"],type:Ih.OPERATOR,role:Ah.MULTIPLICATION},{set:["2d","af","2010","2011","2052","207b","208b","2212","2216","2238","2242","2296","229f","2796","29ff",["2a29","2a2c"],"2a3a","2a41","fe63","ff0d"],type:Ih.OPERATOR,role:Ah.SUBTRACTION},{set:["2f","f7","2044","2215","2298","2797","27cc","29bc",["29f5","29f9"],"2a38"],type:Ih.OPERATOR,role:Ah.DIVISION},{set:["25","2030","2031","ff05","fe6a"],type:Ih.OPERATOR,role:Ah.POSTFIXOP},{set:["ac","2200","2201","2203","2204","2206",["221a","221c"],"2310","ffe2"],type:Ih.OPERATOR,role:Ah.PREFIXOP},{set:["2320","2321","23aa","23ae","23af","23b2","23b3","23b6","23b7"],type:Ih.OPERATOR,role:Ah.PREFIXOP},{set:["1d7ca","1d7cb"],type:Ih.OPERATOR,role:Ah.PREFIXOP,font:Mh.BOLD},{set:["3d","7e","207c","208c","221d","2237",["223a","223f"],"2243","2245","2248",["224a","224e"],["2251","225f"],"2261","2263","229c","22cd","22d5","29e4","29e6","2a66","2a67",["2a6a","2a6c"],["2a6c","2a78"],"fe66","ff1d"],type:Ih.RELATION,role:Ah.EQUALITY},{set:["3c","3e","2241","2242","2244","2246","2247","2249","224f","2250","2260","2262",["2264","2281"],"22b0","22b1",["22d6","22e1"],["22e6","22e9"],["2976","2978"],"29c0","29c1","29e1","29e3","29e5",["2a79","2abc"],["2af7","2afa"],"fe64","fe65","ff1c","ff1e"],type:Ih.RELATION,role:Ah.INEQUALITY},{set:[["2282","228b"],["228f","2292"],["22b2","22b8"],"22d0","22d1",["22e2","22e5"],["22ea","22ed"],"27c3","27c4",["27c7","27c9"],["27d5","27d7"],"27dc",["2979","297b"],"29df",["2abd","2ad8"]],type:Ih.RELATION,role:Ah.SET},{set:["2236",["27e0","27e5"],"292b","292c",["29b5","29bb"],"29be","29bf",["29c2","29d0"]],type:Ih.RELATION,role:Ah.UNKNOWN},{set:["2205",["29b0","29b4"]],type:Ih.IDENTIFIER,role:Ah.SETEMPTY},{set:["1ab2","221e",["29dc","29de"]],type:Ih.IDENTIFIER,role:Ah.INFTY},{set:["22a2","22a3",["22a6","22af"],"27da","27db","27dd","27de","2ade",["2ae2","2ae6"],"2aec","2aed"],type:Ih.RELATION,role:Ah.LOGIC},{set:["22a4","22a5","22ba","27d8","27d9","27df","2adf","2ae0",["2ae7","2aeb"],"2af1"],type:Ih.IDENTIFIER,role:Ah.LOGIC},{set:[["2190","21ff"],"2301","2324","238b","2794",["2798","27af"],["27b1","27be"],["27f0","27ff"],["2900","292a"],["292d","2975"],["297c","297f"],["2b00","2b11"],["2b30","2b4c"],["ffe9","ffec"]],type:Ih.RELATION,role:Ah.ARROW},{set:["2208","220a",["22f2","22f9"],"22ff","27d2","2ad9"],type:Ih.OPERATOR,role:Ah.ELEMENT},{set:["2209"],type:Ih.OPERATOR,role:Ah.NONELEMENT},{set:["220b","220d",["22fa","22fe"]],type:Ih.OPERATOR,role:Ah.REELEMENT},{set:["220c"],type:Ih.OPERATOR,role:Ah.RENONELEMENT},{set:[["220f","2211"],["22c0","22c3"],["2a00","2a0b"],"2a3f","2afc","2aff"],type:Ih.LARGEOP,role:Ah.SUM},{set:["2140"],type:Ih.LARGEOP,role:Ah.SUM,font:Mh.DOUBLESTRUCK},{set:[["222b","2233"],["2a0c","2a17"],["2a17","2a1c"]],type:Ih.LARGEOP,role:Ah.INTEGRAL},{set:[["2500","257F"]],type:Ih.RELATION,role:Ah.BOX},{set:[["2580","259F"]],type:Ih.IDENTIFIER,role:Ah.BLOCK},{set:[["25A0","25FF"],["2B12","2B2F"],["2B50","2B59"]],type:Ih.RELATION,role:Ah.GEOMETRY},{set:["220e","2300","2302","2311","29bd","29e0",["29e8","29f3"],"2a1e","2afe","ffed","ffee"],type:Ih.OPERATOR,role:Ah.GEOMETRY},{set:[["221f","2222"],"22be","22bf",["2312","2314"],"237c","27c0",["299b","29af"]],type:Ih.OPERATOR,role:Ah.GEOMETRY},{set:["24",["a2","a5"],"b5","2123",["2125","2127"],"212a","212b","fe69","ff04","ffe0","ffe1","ffe5","ffe6"],type:Ih.IDENTIFIER,role:Ah.UNKNOWN},{set:["a9","ae","210f","2114","2116","2117",["211e","2122"],"212e","2132",["2139","213b"],["2141","2144"],"214d","214e",["1f12a","1f12c"],"1f18a"],type:Ih.IDENTIFIER,role:Ah.OTHERLETTER},{set:["2224","2226","2239","2307","27b0","27bf","27c1","27c2","27ca","27cb","27cd","27d0","27d3","27d4","2981","2999","299a","29e7","29f4","2a20","2a21","2a64","2a65","2a68","2a69","2ae1",["2aee","2af0"],"2af2","2af3","2af5","2af6","2afb","2afd"],type:Ih.OPERATOR,role:Ah.UNKNOWN},{set:["2605","2606","26aa","26ab",["2720","274d"]],type:Ih.OPERATOR,role:Ah.UNKNOWN},{set:[["2145","2149"]],type:Ih.IDENTIFIER,role:Ah.LATINLETTER,font:Mh.DOUBLESTRUCKITALIC,secondary:Dh.ALLLETTERS},{set:[["213c","213f"]],type:Ih.IDENTIFIER,role:Ah.GREEKLETTER,font:Mh.DOUBLESTRUCK,secondary:Dh.ALLLETTERS},{set:["3d0","3d7","3f6",["1d26","1d2a"],"1d5e","1d60",["1d66","1d6a"]],type:Ih.IDENTIFIER,role:Ah.GREEKLETTER,font:Mh.NORMAL,secondary:Dh.ALLLETTERS},{set:[["2135","2138"]],type:Ih.IDENTIFIER,role:Ah.OTHERLETTER,font:Mh.NORMAL,secondary:Dh.ALLLETTERS},{set:["131","237"],type:Ih.IDENTIFIER,role:Ah.LATINLETTER,font:Mh.NORMAL},{set:["1d6a4","1d6a5"],type:Ih.IDENTIFIER,role:Ah.LATINLETTER,font:Mh.ITALIC},{set:["2113","2118"],type:Ih.IDENTIFIER,role:Ah.LATINLETTER,font:Mh.SCRIPT},{set:[["c0","d6"],["d8","f6"],["f8","1bf"],["1c4","2af"],["1d00","1d25"],["1d6b","1d9a"],["1e00","1ef9"],["363","36f"],["1dd3","1de6"],["1d62","1d65"],"1dca","2071","207f",["2090","209c"],"2c7c"],type:Ih.IDENTIFIER,role:Ah.LATINLETTER,font:Mh.NORMAL},{set:[["00bc","00be"],["2150","215f"],"2189"],type:Ih.NUMBER,role:Ah.FLOAT},{set:["23E8",["3248","324f"]],type:Ih.NUMBER,role:Ah.INTEGER},{set:[["214A","214C"],"2705","2713","2714","2717","2718"],type:Ih.IDENTIFIER,role:Ah.UNKNOWN},{set:["20","a0","ad",["2000","200f"],["2028","202f"],["205f","2060"],"206a","206b","206e","206f","feff",["fff9","fffb"]],type:Ih.TEXT,role:Ah.SPACE},{set:["7c","a6","2223","23b8","23b9","23d0","2758",["fe31","fe34"],"ff5c","ffe4","ffe8"],type:Ih.FENCE,role:Ah.NEUTRAL},{set:["2016","2225","2980","2af4"],type:Ih.FENCE,role:Ah.METRIC}].forEach((t=>{var{set:e}=t,i=Ph(t,["set"]);return Hh(function(t){let e=[];for(const i of t)Array.isArray(i)?e=e.concat(_h(i)):e.push(String.fromCodePoint(parseInt(i,16)));return e}(e),i)})),qh(Uh.FencesVert,["23b4",["23dc","23e1"],["fe35","fe44"],"fe47"]),qh(Uh.FencesHoriz,["28","2045","207D","208D",["2308","230f"],["231c","231f"],"2329","23b0",["2768","2775"],"27c5",["27e6","27ef"],["2983","2998"],["29d8","29db"],"29fc",["2e22","2e29"],["3008","3011"],["3014","301b"],"fd3e","fe17",["fe59","fe5e"],"ff08","ff5f","ff62"]),qh(Uh.FencesHoriz,["5b","7b","ff3b","ff5b"],2),qh(Uh.FencesHoriz,[["239b","23a6"]],3),qh(Uh.FencesHoriz,[["23a7","23a9"]],4),Hh([...Uh.FencesHoriz.keys()],{type:Ih.FENCE,role:Ah.OPEN}),Hh([...Uh.FencesHoriz.values()],{type:Ih.FENCE,role:Ah.CLOSE}),Hh([...Uh.FencesVert.keys()],{type:Ih.FENCE,role:Ah.TOP}),Hh([...Uh.FencesVert.values()],{type:Ih.FENCE,role:Ah.BOTTOM}),function(){for(const[t,e]of Object.entries(Mh)){const i=!!yh[t]?Mh.UNKNOWN:e===Mh.FULLWIDTH?Mh.NORMAL:e;Vh(Nh.LATINCAP,Ih.IDENTIFIER,Ah.LATINLETTER,e,i,[Dh.ALLLETTERS]),Vh(Nh.LATINSMALL,Ih.IDENTIFIER,Ah.LATINLETTER,e,i,[Dh.ALLLETTERS],{},{3:Dh.D}),Vh(Nh.GREEKCAP,Ih.IDENTIFIER,Ah.GREEKLETTER,e,i,[Dh.ALLLETTERS]),Vh(Nh.GREEKSMALL,Ih.IDENTIFIER,Ah.GREEKLETTER,e,i,[Dh.ALLLETTERS],{0:{type:Ih.OPERATOR,role:Ah.PREFIXOP,font:i},26:{type:Ih.OPERATOR,role:Ah.PREFIXOP,font:i}}),Vh(Nh.DIGIT,Ih.NUMBER,Ah.INTEGER,e,i)}}(),Hh(["inf","lim","liminf","limsup","max","min","sup","injlim","projlim"],{type:Ih.FUNCTION,role:Ah.LIMFUNC}),Hh(Wh,{type:Ih.FUNCTION,role:Ah.PREFIXFUNC}),Hh(["mod","rem"],{type:Ih.OPERATOR,role:Ah.PREFIXFUNC});const Xh=[];function zh(t,e){for(let i,s=0;i=Xh[s];s++){const s=i.compare(t,e);if(0!==s)return s}return 0}function Gh(t){if(t.length<=1)return t;const e=t.slice();!function(t){t.sort(zh)}(e);const i=[];let s;do{s=e.pop(),i.push(s)}while(s&&e.length&&0===zh(e[e.length-1],s));return i}function Jh(t,e){return t.match(/^.+:.+$/)||!e?t:t+":"+e}new class{constructor(t,e=null){this.comparator=t,this.type=e,function(t){Xh.push(t)}(this)}compare(t,e){return this.type&&this.type===t.type&&this.type===e.type?this.comparator(t,e):0}}((function(t,e){return t.role===Ah.SIMPLEFUNC?1:e.role===Ah.SIMPLEFUNC?-1:0}),Ih.IDENTIFIER);class Kh extends Map{set(t,e){return super.set(Jh(t,e.font),e),this}setNode(t){this.set(t.textContent,t.meaning())}get(t,e=null){return super.get(Jh(t,e))}getNode(t){return this.get(t.textContent,t.font)}}class $h extends Map{add(t,e){const i=this.get(t);i?i.push(e):super.set(t,[e])}get(t,e=null){return super.get(Jh(t,e))}getNode(t){return this.get(t.textContent,t.font)}minimize(){for(const[t,e]of this)1===e.length&&this.delete(t)}isMultiValued(){for(const t of this.values())if(t.length>1)return!0;return!1}}class Yh extends $h{add(t,e){super.add(Jh(t,e.font),e)}addNode(t){this.add(t.textContent,t)}toString(){const t=[];for(const[e,i]of this){const s=Array(e.length+3).join(" "),r=i.map((t=>t.toString())).join("\n"+s);t.push(e+": "+r)}return t.join("\n")}collateMeaning(){const t=new Qh;for(const[e,i]of this)t.set(e,i.map((t=>t.meaning())));return t}}class Qh extends $h{add(t,e){const i=this.get(t,e.font);i&&i.find((function(t){return s=e,(i=t).type===s.type&&i.role===s.role&&i.font===s.font;var i,s}))||super.add(Jh(t,e.font),e)}addNode(t){this.add(t.textContent,t.meaning())}toString(){const t=[];for(const[e,i]of this){const s=Array(e.length+3).join(" "),r=i.map((t=>`{type: ${t.type}, role: ${t.role}, font: ${t.font}}`)).join("\n"+s);t.push(e+": "+r)}return t.join("\n")}reduce(){for(const[t,e]of this)1!==e.length&&this.set(t,Gh(e))}default(){const t=new Kh;for(const[e,i]of this)1===i.length&&t.set(e,i[0]);return t}newDefault(){const t=this.default();this.reduce();const e=this.default();return t.size!==e.size?e:null}}var Zh;!function(t){t.ANNOTATION="ANNOTATION",t.ANNOTATIONXML="ANNOTATION-XML",t.MACTION="MACTION",t.MALIGNGROUP="MALIGNGROUP",t.MALIGNMARK="MALIGNMARK",t.MATH="MATH",t.MENCLOSE="MENCLOSE",t.MERROR="MERROR",t.MFENCED="MFENCED",t.MFRAC="MFRAC",t.MGLYPH="MGLYPH",t.MI="MI",t.MLABELEDTR="MLABELEDTR",t.MMULTISCRIPTS="MMULTISCRIPTS",t.MN="MN",t.MO="MO",t.MOVER="MOVER",t.MPADDED="MPADDED",t.MPHANTOM="MPHANTOM",t.MPRESCRIPTS="MPRESCRIPTS",t.MROOT="MROOT",t.MROW="MROW",t.MS="MS",t.MSPACE="MSPACE",t.MSQRT="MSQRT",t.MSTYLE="MSTYLE",t.MSUB="MSUB",t.MSUBSUP="MSUBSUP",t.MSUP="MSUP",t.MTABLE="MTABLE",t.MTD="MTD",t.MTEXT="MTEXT",t.MTR="MTR",t.MUNDER="MUNDER",t.MUNDEROVER="MUNDEROVER",t.NONE="NONE",t.SEMANTICS="SEMANTICS"}(Zh||(Zh={}));const td=Object.values(Zh),ed=[Zh.MO,Zh.MI,Zh.MN,Zh.MTEXT,Zh.MS,Zh.MSPACE],id=[Zh.MERROR,Zh.MPHANTOM,Zh.MALIGNGROUP,Zh.MALIGNMARK,Zh.MPRESCRIPTS,Zh.ANNOTATION,Zh.ANNOTATIONXML],sd=[Zh.MATH,Zh.MROW,Zh.MPADDED,Zh.MACTION,Zh.NONE,Zh.MSTYLE,Zh.SEMANTICS],rd=[Zh.MROOT,Zh.MSQRT],nd=["aria-label","exact-speech","alt"];function od(t){return!!t&&dh(t)===Zh.MATH}function ad(t){return!!t&&(id.includes(dh(t))||!td.includes(dh(t)))}function ld(t){return!!t&&sd.includes(dh(t))}function cd(t){return!!t&&dh(t)===Zh.MGLYPH&&!function(t){return!!t&&ed.includes(dh(t))}(t.parentNode)}function hd(t){const e=[];for(let i,s=0;i=t[s];s++){if(i.nodeType!==oh.ELEMENT_NODE)continue;const t=dh(i);id.includes(t)||(sd.includes(t)&&0===i.childNodes.length||e.push(i))}return e}function dd(t,e){var i;if(null===(i=e.attributes)||void 0===i?void 0:i.length){const i=e.attributes;for(let e=i.length-1;e>=0;e--){const s=i[e].name;s.match(/^ext/)&&(t.attributes[s]=i[e].value,t.nobreaking=!0),nd.includes(s)&&(t.attributes["ext-speech"]=i[e].value,t.nobreaking=!0),"href"===s&&(t.attributes.href=i[e].value,t.nobreaking=!0),"data-latex"!==s.toLowerCase()&&"latex"!==s.toLowerCase()||(t.attributes.latex=i[e].value),s.match(/texclass$/)&&(t.attributes.texclass=i[e].value),"color"!==s&&"mathcolor"!==s||(t.attributes.color=i[e].value)}}}function ud(t){return t&&t.embellished&&t.childNodes.length>0?ud(t.childNodes[0]):t}function pd(t,e,i){i&&t.reverse();const s=[];for(let r,n=0;r=t[n];n++){if(e(r))return i?{head:t.slice(n+1).reverse(),div:r,tail:s.reverse()}:{head:s,div:r,tail:t.slice(n+1)};s.push(r)}return i?{head:[],div:null,tail:s.reverse()}:{head:s,div:null,tail:[]}}function md(t,e){let i=t;const s=[],r=[];let n=null;do{n=pd(i,e),r.push(n.head),s.push(n.div),i=n.tail}while(n.div);return s.pop(),{rel:s,comp:r}}var fd;!function(t){t.EMBELLISHED="embellished",t.FENCEPOINTER="fencepointer",t.FONT="font",t.ID="id",t.ANNOTATION="annotation",t.ROLE="role",t.TYPE="type",t.CHILDREN="children",t.CONTENT="content",t.TEXT="$t"}(fd||(fd={}));class gd{static fromXml(t){const e=parseInt(t.getAttribute("id"),10),i=new gd(e);return i.type=t.tagName,gd.setAttribute(i,t,"role"),gd.setAttribute(i,t,"font"),gd.setAttribute(i,t,"embellished"),gd.setAttribute(i,t,"fencepointer","fencePointer"),t.getAttribute("annotation")&&i.parseAnnotation(t.getAttribute("annotation")),dd(i,t),gd.processChildren(i,t),i}static setAttribute(t,e,i,s){s=s||i;const r=e.getAttribute(i);r&&(t[s]=r)}static processChildren(t,e){for(const i of rh(e.childNodes)){if(i.nodeType===oh.TEXT_NODE){t.textContent=i.textContent;continue}const e=rh(i.childNodes).map(gd.fromXml);e.forEach((e=>e.parent=t)),"CONTENT"===dh(i)?t.contentNodes=e:t.childNodes=e}}constructor(t){this.id=t,this.mathml=[],this.parent=null,this.type=Ih.UNKNOWN,this.role=Ah.UNKNOWN,this.font=Mh.UNKNOWN,this.embellished=null,this.fencePointer="",this.childNodes=[],this.textContent="",this.mathmlTree=null,this.contentNodes=[],this.annotation={},this.attributes={},this.nobreaking=!1}querySelectorAll(t){let e=[];for(let i,s=0;i=this.childNodes[s];s++)e=e.concat(i.querySelectorAll(t));for(let i,s=0;i=this.contentNodes[s];s++)e=e.concat(i.querySelectorAll(t));return t(this)&&e.unshift(this),e}xml(t,e){const i=function(i,s){const r=s.map((function(i){return i.xml(t,e)})),n=t.createElementNS("",i);for(let t,e=0;t=r[e];e++)n.appendChild(t);return n},s=t.createElementNS("",this.type);return e||this.xmlAttributes(s),s.textContent=this.textContent,this.contentNodes.length>0&&s.appendChild(i(fd.CONTENT,this.contentNodes)),this.childNodes.length>0&&s.appendChild(i(fd.CHILDREN,this.childNodes)),s}toString(t=!1){const e=nh("<snode/>");return uh(this.xml(e.ownerDocument,t))}allAttributes(){const t=[];return t.push([fd.ROLE,this.role]),this.font!==Mh.UNKNOWN&&t.push([fd.FONT,this.font]),Object.keys(this.annotation).length&&t.push([fd.ANNOTATION,this.annotationXml()]),this.embellished&&t.push([fd.EMBELLISHED,this.embellished]),this.fencePointer&&t.push([fd.FENCEPOINTER,this.fencePointer]),t.push([fd.ID,this.id.toString()]),t}annotationXml(){const t=[];for(const[e,i]of Object.entries(this.annotation))i.forEach((i=>t.push(e+":"+i)));return t.join(";")}attributesXml(){const t=[];for(const[e,i]of Object.entries(this.attributes))t.push(e+":"+gd.escapeValue(i));return t.join(";")}toJson(){const t={};t[fd.TYPE]=this.type;const e=this.allAttributes();for(let i,s=0;i=e[s];s++)t[i[0]]=i[1].toString();return this.textContent&&(t[fd.TEXT]=this.textContent),this.childNodes.length&&(t[fd.CHILDREN]=this.childNodes.map((function(t){return t.toJson()}))),this.contentNodes.length&&(t[fd.CONTENT]=this.contentNodes.map((function(t){return t.toJson()}))),t}updateContent(t,e){const i=e?t.replace(/^[ \f\n\r\t\v\u200b]*/,"").replace(/[ \f\n\r\t\v\u200b]*$/,""):t.trim();if(t=t&&!i?t:i,this.textContent===t)return;const s=Uh.Meaning.get(t.replace(/\s/g," "));this.textContent=t,this.role=s.role,this.type=s.type,this.font=s.font}addMathmlNodes(t){for(let e,i=0;e=t[i];i++)-1===this.mathml.indexOf(e)&&this.mathml.push(e)}appendChild(t){this.childNodes.push(t),this.addMathmlNodes(t.mathml),t.parent=this}replaceChild(t,e){const i=this.childNodes.indexOf(t);if(-1===i)return;t.parent=null,e.parent=this,this.childNodes[i]=e;const s=t.mathml.filter((function(t){return-1===e.mathml.indexOf(t)})),r=e.mathml.filter((function(e){return-1===t.mathml.indexOf(e)}));this.removeMathmlNodes(s),this.addMathmlNodes(r)}appendContentNode(t){t&&(this.contentNodes.push(t),this.addMathmlNodes(t.mathml),t.parent=this)}removeContentNode(t){if(t){const e=this.contentNodes.indexOf(t);-1!==e&&this.contentNodes.slice(e,1)}}equals(t){if(!t)return!1;if(this.type!==t.type||this.role!==t.role||this.textContent!==t.textContent||this.childNodes.length!==t.childNodes.length||this.contentNodes.length!==t.contentNodes.length)return!1;for(let e,i,s=0;e=this.childNodes[s],i=t.childNodes[s];s++)if(!e.equals(i))return!1;for(let e,i,s=0;e=this.contentNodes[s],i=t.contentNodes[s];s++)if(!e.equals(i))return!1;return!0}displayTree(){console.info(this.displayTree_(0))}addAnnotation(t,e){e&&this.addAnnotation_(t,e)}getAnnotation(t){const e=this.annotation[t];return e||[]}hasAnnotation(t,e){const i=this.annotation[t];return!!i&&-1!==i.indexOf(e)}parseAnnotation(t){const e=t.split(";");for(let t=0,i=e.length;t<i;t++){const i=e[t].split(":");this.addAnnotation(i[0],i[1])}}meaning(){return{type:this.type,role:this.role,font:this.font}}xmlAttributes(t){const e=this.allAttributes();for(let i,s=0;i=e[s];s++)t.setAttribute(i[0],i[1]);this.addExternalAttributes(t)}addExternalAttributes(t){for(const[e,i]of Object.entries(this.attributes))t.setAttribute(e,i)}static escapeValue(t){return t.replace(/;/g,"\\0003B")}parseAttributes(t){if(!t)return;const e=t.split(";");for(let t=0,i=e.length;t<i;t++){const[i,...s]=e[t].split(":");i&&(this.attributes[i]=s.join("").replace(/\\0003B/g,";"))}}removeMathmlNodes(t){const e=this.mathml;for(let i,s=0;i=t[s];s++){const t=e.indexOf(i);-1!==t&&e.splice(t,1)}this.mathml=e}displayTree_(t){t++;const e=Array(t).join(" ");let i="";i+="\n"+e+this.toString(),i+="\n"+e+"MathmlTree:",i+="\n"+e+this.mathmlTreeString(),i+="\n"+e+"MathML:";for(let t,s=0;t=this.mathml[s];s++)i+="\n"+e+t.toString();return i+="\n"+e+"Begin Content",this.contentNodes.forEach((function(e){i+=e.displayTree_(t)})),i+="\n"+e+"End Content",i+="\n"+e+"Begin Children",this.childNodes.forEach((function(e){i+=e.displayTree_(t)})),i+="\n"+e+"End Children",i}mathmlTreeString(){return this.mathmlTree?this.mathmlTree.toString():"EMPTY"}addAnnotation_(t,e){const i=this.annotation[t];i&&!i.includes(e)?i.push(e):this.annotation[t]=[e]}}class bd{constructor(){this.leafMap=new Yh,this.defaultMap=new Kh,this.idCounter_=-1}makeNode(t){return this.createNode_(t)}makeUnprocessed(t){const e=this.createNode_();return e.mathml=[t],e.mathmlTree=t,e}makeEmptyNode(){const t=this.createNode_();return t.type=Ih.EMPTY,t}makeContentNode(t){const e=this.createNode_();return e.updateContent(t),e}makeMultipleContentNodes(t,e){const i=[];for(let s=0;s<t;s++)i.push(this.makeContentNode(e));return i}makeLeafNode(t,e){if(!t)return this.makeEmptyNode();const i=this.makeContentNode(t);i.font=e||i.font;const s=this.defaultMap.getNode(i);return s&&(i.type=s.type,i.role=s.role,i.font=s.font),this.leafMap.addNode(i),i}makeBranchNode(t,e,i,s){const r=this.createNode_();return s&&r.updateContent(s),r.type=t,r.childNodes=e,r.contentNodes=i,e.concat(i).forEach((function(t){t.parent=r,r.addMathmlNodes(t.mathml)})),r}createNode_(t){return void 0!==t?this.idCounter_=Math.max(this.idCounter_,t):t=++this.idCounter_,new gd(t)}}class Ed{constructor(t){this.type=t,this.factory_=new bd}getFactory(){return this.factory_}setFactory(t){this.factory_=t}getType(){return this.type}parseList(t){const e=[];for(let i,s=0;i=t[s];s++)e.push(this.parse(i));return e}}function xd(t,e){return t.type===e}function yd(t,e){return t.embellished===e}function Nd(t,e){return t.role===e}function vd(t){return xd(t,Ih.FENCE)||xd(t,Ih.PUNCTUATION)||xd(t,Ih.OPERATOR)||xd(t,Ih.RELATION)}function Td(t){return Id(t)&&!Nd(t,Ah.DIVISION)||xd(t,Ih.APPL)||Rd(t)}function _d(t){return Id(t)||Rd(t)}function Ld(t,e){return!!e&&xd(e,Ih.IDENTIFIER)&&Uh.Secondary.has(t.textContent,Dh.D)}function Cd(t){if(xd(t,Ih.IDENTIFIER)){const e=t.textContent[0];return e&&t.textContent[1]&&Uh.Secondary.has(e,Dh.D)}return!1}function Rd(t){return Sd(t)||Ad(t)}function wd(t){return t.embellished?t.embellished:(e=t.type)===Ih.OPERATOR||e===Ih.RELATION||e===Ih.FENCE||e===Ih.PUNCTUATION?t.type:null;var e}function Id(t){return xd(t,Ih.OPERATOR)||yd(t,Ih.OPERATOR)}function Sd(t){return xd(t,Ih.RELATION)||yd(t,Ih.RELATION)}function Ad(t){return xd(t,Ih.PUNCTUATION)||yd(t,Ih.PUNCTUATION)}function Od(t){return xd(t,Ih.FENCE)||yd(t,Ih.FENCE)}function Md(t){return!(!t||!Od(t))&&(!t.embellished||kd(t))}function kd(t){return!t.embellished||!function(t){return xd(t,Ih.TENSOR)&&(!xd(t.childNodes[1],Ih.EMPTY)||!xd(t.childNodes[2],Ih.EMPTY))&&(!xd(t.childNodes[3],Ih.EMPTY)||!xd(t.childNodes[4],Ih.EMPTY))}(t)&&((!Nd(t,Ah.CLOSE)||!xd(t,Ih.TENSOR))&&((!Nd(t,Ah.OPEN)||!xd(t,Ih.SUBSCRIPT)&&!xd(t,Ih.SUPERSCRIPT))&&kd(t.childNodes[0])))}function Dd(t){return!!t&&(xd(t,Ih.TABLE)||xd(t,Ih.MULTILINE))}function Pd(t){return!!t&&Bd(t)&&Dd(t.childNodes[0])}function Bd(t){return!!t&&xd(t,Ih.FENCED)&&(Nd(t,Ah.LEFTRIGHT)||Yd(t))&&1===t.childNodes.length}function jd(t,e){return e.length>0&&Nd(e[e.length-1],Ah.OPENFENCE)}function Fd(t){return t.childNodes.every((function(t){return t.childNodes.length<=1}))}function Ud(t){return xd(t,Ih.LARGEOP)||xd(t,Ih.LIMBOTH)||xd(t,Ih.LIMLOWER)||xd(t,Ih.LIMUPPER)||xd(t,Ih.FUNCTION)&&Nd(t,Ah.LIMFUNC)||(xd(t,Ih.OVERSCORE)||xd(t,Ih.UNDERSCORE))&&Ud(t.childNodes[0])}function Hd(t,e,i){return 1===e.length&&(t[i].type===Ih.PUNCTUATION||t[i].embellished===Ih.PUNCTUATION)&&t[i]===e[0]}function qd(t){return xd(t,Ih.IDENTIFIER)&&Nd(t,Ah.SIMPLEFUNC)}const Wd=[Ih.PUNCTUATION,Ih.PUNCTUATED,Ih.RELSEQ,Ih.MULTIREL,Ih.TABLE,Ih.MULTILINE,Ih.CASES,Ih.INFERENCE],Vd=[Ih.LIMUPPER,Ih.LIMLOWER,Ih.LIMBOTH,Ih.SUBSCRIPT,Ih.SUPERSCRIPT,Ih.UNDERSCORE,Ih.OVERSCORE,Ih.TENSOR];function Xd(t){const e=t.type;return-1===Wd.indexOf(e)&&(e!==Ih.INFIXOP||t.role===Ah.IMPLICIT)&&(e===Ih.FENCED?t.role!==Ah.LEFTRIGHT||Xd(t.childNodes[0]):-1===Vd.indexOf(e)||Xd(t.childNodes[0]))}function zd(t){return function(t){return t.type===Ih.NUMBER&&(t.role===Ah.INTEGER||t.role===Ah.FLOAT)}(t)||t.role===Ah.VULGAR||t.role===Ah.MIXED}function Gd(t){const e=t.childNodes;return t.role===Ah.UNIT&&(!e.length||e[0].role===Ah.UNIT)}function Jd(t){const e=t.childNodes;return t.type===Ih.INFIXOP&&(t.role===Ah.MULTIPLICATION||t.role===Ah.IMPLICIT)&&e.length&&(Gd(e[0])||zd(e[0]))&&t.childNodes.slice(1).every(Gd)}function Kd(t){return t.type===Ih.INFIXOP&&(t.role===Ah.IMPLICIT||t.role===Ah.UNIT&&!!t.contentNodes.length&&t.contentNodes[0].textContent===Bh.invisibleTimes)}function $d(t){return t.type===Ih.INFIXOP&&t.role===Ah.IMPLICIT}function Yd(t){return t.role===Ah.NEUTRAL||t.role===Ah.METRIC}function Qd(t,e){return Yd(t)&&Yd(e)&&ud(t).textContent===ud(e).textContent}function Zd(t){return!!Yd(t)&&(!t.embellished||t.type!==Ih.SUPERSCRIPT&&t.type!==Ih.SUBSCRIPT&&(t.type!==Ih.TENSOR||t.childNodes[3].type===Ih.EMPTY&&t.childNodes[4].type===Ih.EMPTY))}function tu(t){return!!Yd(t)&&(!t.embellished||(t.type!==Ih.TENSOR||t.childNodes[1].type===Ih.EMPTY&&t.childNodes[2].type===Ih.EMPTY))}function eu(t){return[Ah.ELEMENT,Ah.NONELEMENT,Ah.REELEMENT,Ah.RENONELEMENT].includes(t.role)}const iu={factory:null,options:new Gc,updateFactory:function(t){iu.factory=t},heuristics:new Map,flags:{combine_juxtaposition:!0,convert_juxtaposition:!0,multioperator:!0},blacklist:{},add:function(t){const e=t.name;iu.heuristics.set(e,t),iu.flags[e]||(iu.flags[e]=!1)},run:function(t,e,i){const s=iu.heuristics.get(t);return s&&!iu.blacklist[t]&&(iu.flags[t]||s.applicable(e))?s.apply(e):i?i(e):e}};class su{static getInstance(){return su.instance=su.instance||new su,su.instance}static tableToMultiline(t){if(!Fd(t))return iu.run("rewrite_subcases",t,su.classifyTable);t.type=Ih.MULTILINE;for(let e,i=0;e=t.childNodes[i];i++)su.rowToLine_(e,Ah.MULTILINE);var e;return 1!==t.childNodes.length||xd(e=t.childNodes[0],Ih.LINE)&&e.contentNodes.length&&Nd(e.contentNodes[0],Ah.LABEL)||!Bd(t.childNodes[0].childNodes[0])||su.tableToMatrixOrVector_(su.rewriteFencedLine_(t)),su.binomialForm_(t),su.classifyMultiline(t),t}static number(t){t.type!==Ih.UNKNOWN&&t.type!==Ih.IDENTIFIER||(t.type=Ih.NUMBER),su.meaningFromContent(t,su.numberRole_),su.exprFont_(t)}static classifyMultiline(t){let e=0;const i=t.childNodes.length;let s;for(;e<i&&(!(s=t.childNodes[e])||!s.childNodes.length);)e++;if(e>=i)return;const r=s.childNodes[0].role;r!==Ah.UNKNOWN&&t.childNodes.every((function(t){const e=t.childNodes[0];return!e||e.role===r&&(xd(e,Ih.RELATION)||xd(e,Ih.RELSEQ))}))&&(t.role=r)}static classifyTable(t){const e=su.computeColumns_(t);return su.classifyByColumns_(t,e,Ah.EQUALITY)||su.classifyByColumns_(t,e,Ah.INEQUALITY,[Ah.EQUALITY])||su.classifyByColumns_(t,e,Ah.ARROW)||su.detectCaleyTable(t),t}static detectCaleyTable(t){if(!t.mathmlTree)return!1;const e=t.mathmlTree,i=e.getAttribute("columnlines"),s=e.getAttribute("rowlines");return!(!i||!s)&&(!(!su.cayleySpacing(i)||!su.cayleySpacing(s))&&(t.role=Ah.CAYLEY,!0))}static cayleySpacing(t){const e=t.split(" ");return("solid"===e[0]||"dashed"===e[0])&&e.slice(1).every((t=>"none"===t))}static proof(t,e,i){const s=su.separateSemantics(e);return su.getInstance().proof(t,s,i)}static findSemantics(t,e,i){const s=null==i?null:i,r=su.getSemantics(t);return!!r&&(!!r[e]&&(null==s||r[e]===s))}static getSemantics(t){const e=t.getAttribute("semantics");return e?su.separateSemantics(e):null}static removePrefix(t){const[,...e]=t.split("_");return e.join("_")}static separateSemantics(t){const e={};return t.split(";").forEach((function(t){const[i,s]=t.split(":");e[su.removePrefix(i)]=s})),e}static matchSpaces_(t,e){for(let i,s=0;i=e[s];s++){const e=t[s].mathmlTree,r=t[s+1].mathmlTree;if(!e||!r)continue;const n=e.nextSibling;if(!n||n===r)continue;const o=su.getSpacer_(n);o&&o!==r&&(i.mathml.push(o),i.mathmlTree=o,i.role=Ah.SPACE)}}static getSpacer_(t){if(dh(t)===Zh.MSPACE)return t;for(;ld(t)&&1===t.childNodes.length;)if(dh(t=t.childNodes[0])===Zh.MSPACE)return t;return null}static fenceToPunct_(t){const e=su.FENCE_TO_PUNCT_[t.role];if(e){for(;t.embellished;)t.embellished=Ih.PUNCTUATION,Nd(t,Ah.SUBSUP)||Nd(t,Ah.UNDEROVER)||(t.role=e),t=t.childNodes[0];t.type=Ih.PUNCTUATION,t.role=e}}static classifyFunction_(t,e){if(t.type===Ih.APPL||t.type===Ih.BIGOP||t.type===Ih.INTEGRAL)return"";if(e[0]&&e[0].textContent===Bh.functionApplication){su.getInstance().funcAppls[t.id]=e.shift();let i=Ah.SIMPLEFUNC;return iu.run("simple2prefix",t),t.role!==Ah.PREFIXFUNC&&t.role!==Ah.LIMFUNC||(i=t.role),su.propagateFunctionRole_(t,i),"prefix"}const i=su.CLASSIFY_FUNCTION_[t.role];return i||((s=t).type===Ih.IDENTIFIER||s.role===Ah.LATINLETTER||s.role===Ah.GREEKLETTER||s.role===Ah.OTHERLETTER?"simple":"");var s}static propagateFunctionRole_(t,e){if(t){if(t.type===Ih.INFIXOP)return;Nd(t,Ah.SUBSUP)||Nd(t,Ah.UNDEROVER)||(t.role=e),su.propagateFunctionRole_(t.childNodes[0],e)}}static getFunctionOp_(t,e){if(e(t))return t;for(let i,s=0;i=t.childNodes[s];s++){const t=su.getFunctionOp_(i,e);if(t)return t}return null}static tableToMatrixOrVector_(t){const e=t.childNodes[0];xd(e,Ih.MULTILINE)?su.tableToVector_(t):su.tableToMatrix_(t),t.contentNodes.forEach(e.appendContentNode.bind(e));for(let t,i=0;t=e.childNodes[i];i++)su.assignRoleToRow_(t,su.getComponentRoles_(e));return e.parent=null,e}static tableToVector_(t){const e=t.childNodes[0];e.type=Ih.VECTOR,1!==e.childNodes.length?su.binomialForm_(e):su.tableToSquare_(t)}static binomialForm_(t){Nd(t,Ah.UNKNOWN)&&(2===t.childNodes.length&&(t.role=Ah.BINOMIAL,t.childNodes[0].role=Ah.BINOMIAL,t.childNodes[1].role=Ah.BINOMIAL))}static tableToMatrix_(t){const e=t.childNodes[0];e.type=Ih.MATRIX,e.childNodes&&e.childNodes.length>0&&e.childNodes[0].childNodes&&e.childNodes.length===e.childNodes[0].childNodes.length?su.tableToSquare_(t):e.childNodes&&1===e.childNodes.length&&(e.role=Ah.ROWVECTOR)}static tableToSquare_(t){const e=t.childNodes[0];Nd(e,Ah.UNKNOWN)&&(Yd(t)?e.role=Ah.DETERMINANT:e.role=Ah.SQUAREMATRIX)}static getComponentRoles_(t){const e=t.role;return e&&e!==Ah.UNKNOWN?e:t.type.toLowerCase()||Ah.UNKNOWN}static tableToCases_(t,e){for(let e,i=0;e=t.childNodes[i];i++)su.assignRoleToRow_(e,Ah.CASES);return t.type=Ih.CASES,t.appendContentNode(e),Fd(t)&&su.binomialForm_(t),t}static rewriteFencedLine_(t){const e=t.childNodes[0],i=t.childNodes[0].childNodes[0],s=t.childNodes[0].childNodes[0].childNodes[0];return i.parent=t.parent,t.parent=i,s.parent=e,i.childNodes=[t],e.childNodes=[s],i}static rowToLine_(t,e){const i=e||Ah.UNKNOWN;xd(t,Ih.ROW)&&(t.type=Ih.LINE,t.role=i,1===t.childNodes.length&&xd(t.childNodes[0],Ih.CELL)&&(t.childNodes=t.childNodes[0].childNodes,t.childNodes.forEach((function(e){e.parent=t}))))}static assignRoleToRow_(t,e){xd(t,Ih.LINE)?t.role=e:xd(t,Ih.ROW)&&(t.role=e,t.childNodes.forEach((function(t){xd(t,Ih.CELL)&&(t.role=e)})))}static nextSeparatorFunction_(t){let e;if(t){if(t.match(/^\s+$/))return null;e=t.replace(/\s/g,"").split("").filter((function(t){return t}))}else e=[","];return function(){return e.length>1?e.shift():e[0]}}static meaningFromContent(t,e){const i=[...t.textContent].filter((t=>t.match(/[^\s]/))),s=i.map((t=>Uh.Meaning.get(t)));e(t,i,s)}static numberRole_(t,e,i){if(t.role===Ah.UNKNOWN)return i.every((function(t){return t.type===Ih.NUMBER&&t.role===Ah.INTEGER||t.type===Ih.PUNCTUATION&&t.role===Ah.COMMA}))?(t.role=Ah.INTEGER,void("0"===e[0]&&t.addAnnotation("general","basenumber"))):void(i.every((function(t){return t.type===Ih.NUMBER&&t.role===Ah.INTEGER||t.type===Ih.PUNCTUATION}))?t.role=Ah.FLOAT:t.role=Ah.OTHERNUMBER)}static exprFont_(t){t.font===Mh.UNKNOWN&&su.compSemantics(t,"font",Mh)}static compSemantics(t,e,i){const s=[...t.textContent].map((t=>Uh.Meaning.get(t))).reduce((function(t,s){return t&&s[e]&&s[e]!==i.UNKNOWN&&s[e]!==t?t===i.UNKNOWN?s[e]:null:t}),i.UNKNOWN);s&&(t[e]=s)}static purgeFences_(t){const e=t.rel,i=t.comp,s=[],r=[];for(;e.length>0;){const t=e.shift();let n=i.shift();Md(t)?(s.push(t),r.push(n)):(su.fenceToPunct_(t),n.push(t),n=n.concat(i.shift()),i.unshift(n))}return r.push(i.shift()),{rel:s,comp:r}}static rewriteFencedNode_(t){const e=t.contentNodes[0],i=t.contentNodes[1];let s=su.rewriteFence_(t,e);return t.contentNodes[0]=s.fence,s=su.rewriteFence_(s.node,i),t.contentNodes[1]=s.fence,t.contentNodes[0].parent=t,t.contentNodes[1].parent=t,s.node.parent=null,s.node}static rewriteFence_(t,e){if(!e.embellished)return{node:t,fence:e};const i=e.childNodes[0],s=su.rewriteFence_(t,i);return xd(e,Ih.SUPERSCRIPT)||xd(e,Ih.SUBSCRIPT)||xd(e,Ih.TENSOR)?(Nd(e,Ah.SUBSUP)||(e.role=t.role),i!==s.node&&(e.replaceChild(i,s.node),i.parent=t),su.propagateFencePointer_(e,i),{node:e,fence:s.fence}):(e.replaceChild(i,s.fence),e.mathmlTree&&-1===e.mathml.indexOf(e.mathmlTree)&&e.mathml.push(e.mathmlTree),{node:s.node,fence:e})}static propagateFencePointer_(t,e){t.fencePointer=e.fencePointer||e.id.toString(),t.embellished=null}static classifyByColumns_(t,e,i,s=[]){const r=[i].concat(s);return!!(3===e.length&&su.testColumns_(e,1,(t=>su.isPureRelation_(t,r)))||2===e.length&&(su.testColumns_(e,1,(t=>su.isEndRelation_(t,r)||su.isPureRelation_(t,r)))||su.testColumns_(e,0,(t=>su.isEndRelation_(t,r,!0)||su.isPureRelation_(t,r)))))&&(t.role=i,!0)}static isEndRelation_(t,e,i){const s=i?t.childNodes.length-1:0;return xd(t,Ih.RELSEQ)&&e.some((e=>Nd(t,e)))&&xd(t.childNodes[s],Ih.EMPTY)}static isPureRelation_(t,e){return xd(t,Ih.RELATION)&&e.some((e=>Nd(t,e)))}static computeColumns_(t){const e=[];for(let i,s=0;i=t.childNodes[s];s++)for(let t,s=0;t=i.childNodes[s];s++){e[s]?e[s].push(t):e[s]=[t]}return e}static testColumns_(t,e,i){const s=t[e];return!!s&&(s.some((function(t){return t.childNodes.length&&i(t.childNodes[0])}))&&s.every((function(t){return!t.childNodes.length||i(t.childNodes[0])})))}setNodeFactory(t){su.getInstance().factory_=t,iu.updateFactory(su.getInstance().factory_)}getNodeFactory(){return su.getInstance().factory_}identifierNode(t,e,i){if("MathML-Unit"===i)t.type=Ih.IDENTIFIER,t.role=Ah.UNIT;else if(!e&&1===t.textContent.length&&(t.role===Ah.INTEGER||t.role===Ah.LATINLETTER||t.role===Ah.GREEKLETTER)&&t.font===Mh.NORMAL)return t.font=Mh.ITALIC,iu.run("simpleNamedFunction",t);return t.type===Ih.UNKNOWN&&(t.type=Ih.IDENTIFIER),su.exprFont_(t),iu.run("simpleNamedFunction",t)}implicitNode(t){if(t=su.getInstance().getMixedNumbers_(t),1===(t=su.getInstance().combineUnits_(t)).length)return t[0];const e=su.getInstance().implicitNode_(t);return iu.run("combine_juxtaposition",e)}text(t,e){if(su.exprFont_(t),t.type=Ih.TEXT,e===Zh.ANNOTATIONXML)return t.role=Ah.ANNOTATION,t;if(e===Zh.MS)return t.role=Ah.STRING,t;if(e===Zh.MSPACE||t.textContent.match(/^\s*$/))return t.role=Ah.SPACE,t;if(/\s/.exec(t.textContent))return t.role=Ah.TEXT,t;const i=[...t.textContent];if(1!==i.length)return t.role=Ah.UNKNOWN,t;const s=Uh.Meaning.get(i[0]);return s.type===Ih.UNKNOWN||s.type===Ih.IDENTIFIER||(t.type=s.type,t.role=s.role,t.font=s.font,t.addAnnotation("general","text")),t}row(t){return 0===(t=t.filter((function(t){return!xd(t,Ih.EMPTY)}))).length?su.getInstance().factory_.makeEmptyNode():(t=su.getInstance().getFencesInRow_(t),t=su.getInstance().tablesInRow(t),t=su.getInstance().getPunctuationInRow_(t),t=su.getInstance().getTextInRow_(t),t=su.getInstance().getFunctionsInRow_(t),su.getInstance().relationsInRow_(t))}limitNode(t,e){if(!e.length)return su.getInstance().factory_.makeEmptyNode();let i,s=e[0],r=Ih.UNKNOWN;if(!e[1])return s;if(iu.run("op_with_limits",e),Ud(s)){i=su.MML_TO_LIMIT_[t];const n=i.length;if(r=i.type,e=e.slice(0,i.length+1),1===n&&vd(e[1])||2===n&&vd(e[1])&&vd(e[2]))return i=su.MML_TO_BOUNDS_[t],su.getInstance().accentNode_(s,e,i.type,i.length,i.accent);if(2===n){if(vd(e[1]))return s=su.getInstance().accentNode_(s,[s,e[1]],{MSUBSUP:Ih.SUBSCRIPT,MUNDEROVER:Ih.UNDERSCORE}[t],1,!0),e[2]?su.getInstance().makeLimitNode_(s,[s,e[2]],null,Ih.LIMUPPER):s;if(e[2]&&vd(e[2]))return s=su.getInstance().accentNode_(s,[s,e[2]],{MSUBSUP:Ih.SUPERSCRIPT,MUNDEROVER:Ih.OVERSCORE}[t],1,!0),su.getInstance().makeLimitNode_(s,[s,e[1]],null,Ih.LIMLOWER);e[n]||(r=Ih.LIMLOWER)}return su.getInstance().makeLimitNode_(s,e,null,r)}return i=su.MML_TO_BOUNDS_[t],su.getInstance().accentNode_(s,e,i.type,i.length,i.accent)}tablesInRow(t){let e=md(t,Pd),i=[];for(let t,s=0;t=e.rel[s];s++)i=i.concat(e.comp.shift()),i.push(su.tableToMatrixOrVector_(t));i=i.concat(e.comp.shift()),e=md(i,Dd),i=[];for(let t,s=0;t=e.rel[s];s++){const s=e.comp.shift();jd(0,s)&&su.tableToCases_(t,s.pop()),i=i.concat(s),i.push(t)}return i.concat(e.comp.shift())}mfenced(t,e,i,s){if(i&&s.length>0){const t=su.nextSeparatorFunction_(i),e=[s.shift()];s.forEach((i=>{e.push(su.getInstance().factory_.makeContentNode(t())),e.push(i)})),s=e}return t&&e?su.getInstance().horizontalFencedNode_(su.getInstance().factory_.makeContentNode(t),su.getInstance().factory_.makeContentNode(e),s):(t&&s.unshift(su.getInstance().factory_.makeContentNode(t)),e&&s.push(su.getInstance().factory_.makeContentNode(e)),su.getInstance().row(s))}fractionLikeNode(t,e,i,s){let r;if(!s&&function(t){if(!t)return!1;if(["negativeveryverythinmathspace","negativeverythinmathspace","negativethinmathspace","negativemediummathspace","negativethickmathspace","negativeverythickmathspace","negativeveryverythickmathspace"].includes(t))return!0;const e=t.match(/[0-9.]+/);return!!e&&0===parseFloat(e[0])}(i)){const i=su.getInstance().factory_.makeBranchNode(Ih.LINE,[t],[]),s=su.getInstance().factory_.makeBranchNode(Ih.LINE,[e],[]);return r=su.getInstance().factory_.makeBranchNode(Ih.MULTILINE,[i,s],[]),su.binomialForm_(r),su.classifyMultiline(r),r}return r=su.getInstance().fractionNode_(t,e),s&&r.addAnnotation("general","bevelled"),r}tensor(t,e,i,s,r){const n=su.getInstance().factory_.makeBranchNode(Ih.TENSOR,[t,su.getInstance().scriptNode_(e,Ah.LEFTSUB),su.getInstance().scriptNode_(i,Ah.LEFTSUPER),su.getInstance().scriptNode_(s,Ah.RIGHTSUB),su.getInstance().scriptNode_(r,Ah.RIGHTSUPER)],[]);return n.role=t.role,n.embellished=wd(t),n}pseudoTensor(t,e,i){const s=t=>!xd(t,Ih.EMPTY),r=e.filter(s).length,n=i.filter(s).length;if(!r&&!n)return t;const o=r?n?Zh.MSUBSUP:Zh.MSUB:Zh.MSUP,a=[t];return r&&a.push(su.getInstance().scriptNode_(e,Ah.RIGHTSUB,!0)),n&&a.push(su.getInstance().scriptNode_(i,Ah.RIGHTSUPER,!0)),su.getInstance().limitNode(o,a)}font(t){const e=su.MATHJAX_FONTS[t];return e||t}proof(t,e,i){if(e.inference||e.axiom||console.log("Noise"),e.axiom){const e=su.getInstance().cleanInference(t.childNodes),s=e.length?su.getInstance().factory_.makeBranchNode(Ih.INFERENCE,i(e),[]):su.getInstance().factory_.makeEmptyNode();return s.role=Ah.AXIOM,s.mathmlTree=t,s}const s=su.getInstance().inference(t,e,i);return e.proof&&(s.role=Ah.PROOF,s.childNodes[0].role=Ah.FINAL),s}inference(t,e,i){if(e.inferenceRule){const e=su.getInstance().getFormulas(t,[],i);return su.getInstance().factory_.makeBranchNode(Ih.INFERENCE,[e.conclusion,e.premises],[])}const s=e.labelledRule,r=rh(t.childNodes),n=[];"left"!==s&&"both"!==s||n.push(su.getInstance().getLabel(t,r,i,Ah.LEFT)),"right"!==s&&"both"!==s||n.push(su.getInstance().getLabel(t,r,i,Ah.RIGHT));const o=su.getInstance().getFormulas(t,r,i),a=su.getInstance().factory_.makeBranchNode(Ih.INFERENCE,[o.conclusion,o.premises],n);return a.mathmlTree=t,a}getLabel(t,e,i,s){const r=su.getInstance().findNestedRow(e,"prooflabel",s),n=su.getInstance().factory_.makeBranchNode(Ih.RULELABEL,i(rh(r.childNodes)),[]);return n.role=s,n.mathmlTree=r,n}getFormulas(t,e,i){const s=e.length?su.getInstance().findNestedRow(e,"inferenceRule"):t,r="up"===su.getSemantics(s).inferenceRule,n=r?s.childNodes[1]:s.childNodes[0],o=r?s.childNodes[0]:s.childNodes[1],a=n.childNodes[0].childNodes[0],l=rh(a.childNodes[0].childNodes),c=[];let h=1;for(const t of l)h%2&&c.push(t.childNodes[0]),h++;const d=i(c),u=i(rh(o.childNodes[0].childNodes))[0],p=su.getInstance().factory_.makeBranchNode(Ih.PREMISES,d,[]);p.mathmlTree=a;const m=su.getInstance().factory_.makeBranchNode(Ih.CONCLUSION,[u],[]);return m.mathmlTree=o.childNodes[0].childNodes[0],{conclusion:m,premises:p}}findNestedRow(t,e,i){return su.getInstance().findNestedRow_(t,e,0,i)}cleanInference(t){return rh(t).filter((function(t){return"MSPACE"!==dh(t)}))}operatorNode(t){return t.type===Ih.UNKNOWN&&(t.type=Ih.OPERATOR),iu.run("multioperator",t)}constructor(){this.funcAppls={},this.splitRoles=new Map([[Ah.SUBTRACTION,Ah.NEGATIVE],[Ah.ADDITION,Ah.POSITIVE]]),this.splitOps=["\u2212","-","\u2010","\u2011","+"],this.factory_=new bd,iu.updateFactory(this.factory_)}implicitNode_(t){const e=su.getInstance().factory_.makeMultipleContentNodes(t.length-1,Bh.invisibleTimes);su.matchSpaces_(t,e);const i=su.getInstance().infixNode_(t,e[0]);return i.role=Ah.IMPLICIT,e.forEach((function(t){t.parent=i})),i.contentNodes=e,i}infixNode_(t,e){let i=su.getInstance().factory_.makeBranchNode(Ih.INFIXOP,t,[e],ud(e).textContent);return i.role=e.role,i=iu.run("propagateInterval",i),iu.run("propagateSimpleFunction",i)}explicitMixed_(t){const e=md(t,(function(t){return t.textContent===Bh.invisiblePlus}));if(!e.rel.length)return t;let i=[];for(let t,s=0;t=e.rel[s];s++){const r=e.comp[s],n=e.comp[s+1],o=r.length-1;if(r[o]&&n[0]&&xd(r[o],Ih.NUMBER)&&!Nd(r[o],Ah.MIXED)&&xd(n[0],Ih.FRACTION)){const t=su.getInstance().factory_.makeBranchNode(Ih.NUMBER,[r[o],n[0]],[]);t.role=Ah.MIXED,i=i.concat(r.slice(0,o)),i.push(t),n.shift()}else i=i.concat(r),i.push(t)}return i.concat(e.comp[e.comp.length-1])}concatNode_(t,e,i){if(0===e.length)return t;const s=e.map((function(t){return ud(t).textContent})).join(" "),r=su.getInstance().factory_.makeBranchNode(i,[t],e,s);return e.length>1&&(r.role=Ah.MULTIOP),r}prefixNode_(t,e){const i=this.splitSingles(e);let s=t;for(;i.length>0;){const t=i.pop();s=su.getInstance().concatNode_(s,t,Ih.PREFIXOP),1===t.length&&-1!==this.splitOps.indexOf(t[0].textContent)&&(s.role=this.splitRoles.get(t[0].role))}return s}splitSingles(t){let e=0;const i=[];let s=0;for(;s<t.length;){const r=t[s];!this.splitRoles.has(r.role)||t[s-1]&&t[s-1].role===r.role||t[s+1]&&t[s+1].role===r.role||-1===this.splitOps.indexOf(r.textContent)||(i.push(t.slice(e,s)),i.push(t.slice(s,s+1)),e=s+1),s++}return e<s&&i.push(t.slice(e,s)),i}postfixNode_(t,e){return e.length?su.getInstance().concatNode_(t,e,Ih.POSTFIXOP):t}combineUnits_(t){const e=md(t,(function(t){return!Nd(t,Ah.UNIT)}));if(t.length===e.rel.length)return e.rel;const i=[];let s,r;do{const t=e.comp.shift();s=e.rel.shift();let n=null;r=i.pop(),r&&(t.length&&zd(r)?t.unshift(r):i.push(r)),1===t.length&&(n=t.pop()),t.length>1&&(n=su.getInstance().implicitNode_(t),n.role=Ah.UNIT),n&&i.push(n),s&&i.push(s)}while(s);return i}getMixedNumbers_(t){const e=md(t,(function(t){return xd(t,Ih.FRACTION)&&Nd(t,Ah.VULGAR)}));if(!e.rel.length)return t;let i=[];for(let t,s=0;t=e.rel[s];s++){const r=e.comp[s],n=r.length-1;if(r[n]&&xd(r[n],Ih.NUMBER)&&(Nd(r[n],Ah.INTEGER)||Nd(r[n],Ah.FLOAT))){const e=su.getInstance().factory_.makeBranchNode(Ih.NUMBER,[r[n],t],[]);e.role=Ah.MIXED,i=i.concat(r.slice(0,n)),i.push(e)}else i=i.concat(r),i.push(t)}return i.concat(e.comp[e.comp.length-1])}getTextInRow_(t){if(0===t.length)return t;if(1===t.length)return t[0].type===Ih.TEXT&&t[0].role===Ah.UNKNOWN&&(t[0].role=Ah.ANNOTATION),t;const{rel:e,comp:i}=md(t,(t=>xd(t,Ih.TEXT)&&!t.annotation.factor));if(0===e.length)return t;const s=[];let r=i.shift();for(;e.length>0;){let t=e.shift(),n=i.shift();const o=[];for(;!n.length&&e.length&&t.role!==Ah.SPACE&&e[0].role!==Ah.SPACE;)o.push(t),t=e.shift(),n=i.shift();if(o.length&&(o.push(t),t=su.getInstance().dummyNode_(o)),t.role!==Ah.UNKNOWN){const e=ru(r,t,n);if(e){r=e;continue}r.length&&s.push(su.getInstance().row(r)),s.push(t),r=n;continue}const a=Uh.Meaning.get(t.textContent);if(a.type!==Ih.UNKNOWN){t.type=a.type,t.role=a.role,t.font=a.font,t.addAnnotation("general","text"),r.push(t),r=r.concat(n);continue}if(su.meaningFromContent(t,((t,e,i)=>{if(t.role===Ah.UNKNOWN){if(su.numberRole_(t,e,i),t.role===Ah.OTHERNUMBER)return i.some((t=>t.type!==Ih.NUMBER&&t.type!==Ih.IDENTIFIER))?(t.type=Ih.TEXT,void(t.role=Ah.ANNOTATION)):void(t.role=Ah.UNKNOWN);t.type=Ih.NUMBER}})),t.role===Ah.UNKNOWN&&(e.length||n.length?n.length&&n[0].type===Ih.FENCED?(t.type=Ih.FUNCTION,t.role=Ah.PREFIXFUNC):t.role=Ah.TEXT:(t.type=Ih.IDENTIFIER,t.role=Ah.UNIT)),t.type!==Ih.TEXT){r.push(t),r=r.concat(n);continue}const l=ru(r,t,n);l?r=l:(r.length&&s.push(su.getInstance().row(r)),s.push(t),r=n)}return r.length>0&&s.push(su.getInstance().row(r)),s.length>1?[su.getInstance().dummyNode_(s)]:s}relationsInRow_(t){const e=md(t,Sd),i=e.rel[0];if(!i)return su.getInstance().operationsInRow_(t);if(1===t.length)return t[0];const s=e.comp.map(su.getInstance().operationsInRow_);let r;return e.rel.some((function(t){return!t.equals(i)}))?(r=su.getInstance().factory_.makeBranchNode(Ih.MULTIREL,s,e.rel),e.rel.every((function(t){return t.role===i.role}))&&(r.role=i.role),r):(r=su.getInstance().factory_.makeBranchNode(Ih.RELSEQ,s,e.rel,ud(i).textContent),r.role=i.role,r)}operationsInRow_(t){if(0===t.length)return su.getInstance().factory_.makeEmptyNode();if(1===(t=su.getInstance().explicitMixed_(t)).length)return t[0];const e=[];for(;t.length>0&&Id(t[0]);)e.push(t.shift());if(0===t.length)return su.getInstance().prefixNode_(e.pop(),e);if(1===t.length)return su.getInstance().prefixNode_(t[0],e);const i=pd(t=iu.run("convert_juxtaposition",t),Id),s=su.getInstance().wrapFactor(e,i);return su.getInstance().addFactor(s,i)}wrapPostfix(t){var e;(null===(e=t.div)||void 0===e?void 0:e.role)===Ah.POSTFIXOP&&(t.tail.length&&t.tail[0].type!==Ih.OPERATOR?t.div.role=Ah.DIVISION:(t.head=[su.getInstance().postfixNode_(su.getInstance().implicitNode(t.head),[t.div])],t.div=t.tail.shift(),su.getInstance().wrapPostfix(t)))}wrapFactor(t,e){return su.getInstance().wrapPostfix(e),su.getInstance().prefixNode_(su.getInstance().implicitNode(e.head),t)}addFactor(t,e){return e.div?su.getInstance().operationsTree_(e.tail,t,e.div):(Jd(t)&&(t.role=Ah.UNIT),t)}operationsTree_(t,e,i,s=[]){if(0===t.length){if(s.unshift(i),e.type===Ih.INFIXOP){const t=su.getInstance().postfixNode_(e.childNodes.pop(),s);return e.appendChild(t),e}return su.getInstance().postfixNode_(e,s)}const r=pd(t,Id);if(0===r.head.length)return s.push(r.div),su.getInstance().operationsTree_(r.tail,e,i,s);const n=su.getInstance().wrapFactor(s,r),o=su.getInstance().appendOperand_(e,i,n);return su.getInstance().addFactor(o,r)}appendOperand_(t,e,i){if(t.type!==Ih.INFIXOP)return su.getInstance().infixNode_([t,i],e);const s=su.getInstance().appendDivisionOp_(t,e,i);return s||(su.getInstance().appendExistingOperator_(t,e,i)?t:e.role===Ah.MULTIPLICATION?su.getInstance().appendMultiplicativeOp_(t,e,i):su.getInstance().appendAdditiveOp_(t,e,i))}appendDivisionOp_(t,e,i){return e.role===Ah.DIVISION?Kd(t)?su.getInstance().infixNode_([t,i],e):su.getInstance().appendLastOperand_(t,e,i):t.role===Ah.DIVISION?su.getInstance().infixNode_([t,i],e):null}appendLastOperand_(t,e,i){let s=t,r=t.childNodes[t.childNodes.length-1];for(;r&&r.type===Ih.INFIXOP&&!Kd(r);)s=r,r=s.childNodes[t.childNodes.length-1];const n=su.getInstance().infixNode_([s.childNodes.pop(),i],e);return s.appendChild(n),t}appendMultiplicativeOp_(t,e,i){if(Kd(t))return su.getInstance().infixNode_([t,i],e);let s=t,r=t.childNodes[t.childNodes.length-1];for(;r&&r.type===Ih.INFIXOP&&!Kd(r);)s=r,r=s.childNodes[t.childNodes.length-1];const n=su.getInstance().infixNode_([s.childNodes.pop(),i],e);return s.appendChild(n),t}appendAdditiveOp_(t,e,i){return su.getInstance().infixNode_([t,i],e)}appendExistingOperator_(t,e,i){return!(!t||t.type!==Ih.INFIXOP||Kd(t))&&(t.contentNodes[0].equals(e)?(t.appendContentNode(e),t.appendChild(i),!0):su.getInstance().appendExistingOperator_(t.childNodes[t.childNodes.length-1],e,i))}getFencesInRow_(t){let e=md(t,Od);e=su.purgeFences_(e);const i=e.comp.shift();return su.getInstance().fences_(e.rel,e.comp,[],[i])}fences_(t,e,i,s){if(0===t.length&&0===i.length)return s[0];const r=iu.run("bracketed_interval",[t[0],t[1],...e[0]||[]],(()=>null));if(r){t.shift(),t.shift(),e.shift();const n=s.pop()||[];return s.push([...n,r,...e.shift()]),su.getInstance().fences_(t,e,i,s)}const n=t=>Nd(t,Ah.OPEN);if(0===t.length){const t=s.shift();for(;i.length>0;){if(n(i[0])){const e=i.shift();su.fenceToPunct_(e),t.push(e)}else{const e=pd(i,n),r=e.head.length-1,o=su.getInstance().neutralFences_(e.head,s.slice(0,r));s=s.slice(r),t.push(...o),e.div&&e.tail.unshift(e.div),i=e.tail}t.push(...s.shift())}return t}const o=i[i.length-1],a=t[0].role;if(a===Ah.OPEN||Yd(t[0])&&(!o||!Qd(t[0],o))){i.push(t.shift());const r=e.shift();return r&&s.push(r),su.getInstance().fences_(t,e,i,s)}if(o&&a===Ah.CLOSE&&o.role===Ah.OPEN){const r=su.getInstance().horizontalFencedNode_(i.pop(),t.shift(),s.pop());return s.push(s.pop().concat([r],e.shift())),su.getInstance().fences_(t,e,i,s)}if(o&&Qd(t[0],o)){if(!Zd(o)||!tu(t[0])){i.push(t.shift());const r=e.shift();return r&&s.push(r),su.getInstance().fences_(t,e,i,s)}const r=su.getInstance().horizontalFencedNode_(i.pop(),t.shift(),s.pop());return s.push(s.pop().concat([r],e.shift())),su.getInstance().fences_(t,e,i,s)}if(o&&a===Ah.CLOSE&&Yd(o)&&i.some(n)){const r=pd(i,n,!0),o=s.pop(),a=s.length-r.tail.length+1,l=su.getInstance().neutralFences_(r.tail,s.slice(a));s=s.slice(0,a);const c=su.getInstance().horizontalFencedNode_(r.div,t.shift(),s.pop().concat(l,o));return s.push(s.pop().concat([c],e.shift())),su.getInstance().fences_(t,e,r.head,s)}const l=t.shift();return su.fenceToPunct_(l),s.push(s.pop().concat([l],e.shift())),su.getInstance().fences_(t,e,i,s)}neutralFences_(t,e){if(0===t.length)return t;if(1===t.length)return su.fenceToPunct_(t[0]),t;const i=t.shift();if(!Zd(i)){su.fenceToPunct_(i);const s=e.shift();return s.unshift(i),s.concat(su.getInstance().neutralFences_(t,e))}const s=pd(t,(function(t){return Qd(t,i)}));if(!s.div){su.fenceToPunct_(i);const s=e.shift();return s.unshift(i),s.concat(su.getInstance().neutralFences_(t,e))}if(!tu(s.div))return su.fenceToPunct_(s.div),t.unshift(i),su.getInstance().neutralFences_(t,e);const r=su.getInstance().combineFencedContent_(i,s.div,s.head,e);if(s.tail.length>0){const t=r.shift(),e=su.getInstance().neutralFences_(s.tail,r);return t.concat(e)}return r[0]}combineFencedContent_(t,e,i,s){if(0===i.length){const i=su.getInstance().horizontalFencedNode_(t,e,s.shift());return s.length>0?s[0].unshift(i):s=[[i]],s}const r=s.shift(),n=i.length-1,o=s.slice(0,n),a=(s=s.slice(n)).shift(),l=su.getInstance().neutralFences_(i,o);r.push(...l),r.push(...a);const c=su.getInstance().horizontalFencedNode_(t,e,r);return s.length>0?s[0].unshift(c):s=[[c]],s}horizontalFencedNode_(t,e,i){const s=su.getInstance().row(i);let r=su.getInstance().factory_.makeBranchNode(Ih.FENCED,[s],[t,e]);return t.role===Ah.OPEN?(su.getInstance().classifyHorizontalFence_(r),r=iu.run("propagateComposedFunction",r)):r.role=t.role,r=iu.run("detect_cycle",r),su.rewriteFencedNode_(r)}classifyHorizontalFence_(t){if(iu.run("interval_heuristic",t),t.role===Ah.INTERVAL)return;t.role=Ah.LEFTRIGHT;const e=t.childNodes;if(!function(t){return function(t){return!!t&&-1!==["{","\ufe5b","\uff5b"].indexOf(t.textContent)}(t.contentNodes[0])&&function(t){return!!t&&-1!==["}","\ufe5c","\uff5d"].indexOf(t.textContent)}(t.contentNodes[1])}(t)||e.length>1)return;if(0===e.length||e[0].type===Ih.EMPTY)return void(t.role=Ah.SETEMPTY);const i=e[0].type;if(1===e.length&&Xd(e[0]))return void(t.role=Ah.SETSINGLE);const s=e[0].role;if(i===Ih.PUNCTUATED&&s===Ah.SEQUENCE){if(e[0].contentNodes[0].role!==Ah.COMMA)return 1!==e[0].contentNodes.length||e[0].contentNodes[0].role!==Ah.VBAR&&e[0].contentNodes[0].role!==Ah.COLON?void 0:(t.role=Ah.SETEXT,void su.getInstance().setExtension_(t));t.role=Ah.SETCOLLECT}}setExtension_(t){const e=t.childNodes[0].childNodes[0];e&&e.type===Ih.INFIXOP&&1===e.contentNodes.length&&eu(e.contentNodes[0])&&(e.addAnnotation("set","intensional"),e.contentNodes[0].addAnnotation("set","intensional"))}getPunctuationInRow_(t){if(t.length<=1)return t;const e=t=>{const e=t.type;return"punctuation"===e||"text"===e||"operator"===e||"relation"===e},i=md(t,(function(i){if(!Ad(i))return!1;if(Ad(i)&&!Nd(i,Ah.ELLIPSIS))return!0;const s=t.indexOf(i);if(0===s)return!t[1]||!e(t[1]);const r=t[s-1];if(s===t.length-1)return!e(r);const n=t[s+1];return!e(r)||!e(n)}));if(0===i.rel.length)return t;let s=[],r=i.comp.shift();r.length>0&&s.push(su.getInstance().row(r));let n=0;for(;i.comp.length>0;){let t=[];const e=n;do{t.push(i.rel[n++]),r=i.comp.shift()}while(i.rel[n]&&r&&0===r.length);t=iu.run("ellipses",t),i.rel.splice(e,n-e,...t),n=e+t.length,s=s.concat(t),r&&r.length>0&&s.push(su.getInstance().row(r))}return 1===s.length&&1===i.rel.length?s:[su.getInstance().punctuatedNode_(s,i.rel)]}punctuatedNode_(t,e){const i=su.getInstance().factory_.makeBranchNode(Ih.PUNCTUATED,t,e);if(e.length===t.length){const t=e[0].role;if(t!==Ah.UNKNOWN&&e.every((function(e){return e.role===t})))return i.role=t,i}const s=e[0];return Hd(t,e,0)?i.role=s.childNodes.length&&!s.embellished?s.role:Ah.STARTPUNCT:Hd(t,e,t.length-1)?i.role=s.childNodes.length&&!s.embellished?s.role:Ah.ENDPUNCT:e.every((t=>Nd(t,Ah.DUMMY)))?i.role=Ah.TEXT:e.every((t=>Nd(t,Ah.SPACE)))?i.role=Ah.SPACE:i.role=Ah.SEQUENCE,i}dummyNode_(t){const e=su.getInstance().factory_.makeMultipleContentNodes(t.length-1,Bh.invisibleComma);return e.forEach((function(t){t.role=Ah.DUMMY})),su.getInstance().punctuatedNode_(t,e)}accentRole_(t,e){if(!vd(t))return!1;const i=t.textContent,s=Uh.Secondary.get(i,Dh.BAR)||Uh.Secondary.get(i,Dh.TILDE)||t.role;return t.role=e===Ih.UNDERSCORE?Ah.UNDERACCENT:Ah.OVERACCENT,t.addAnnotation("accent",s),!0}accentNode_(t,e,i,s,r){const n=(e=e.slice(0,s+1))[1],o=e[2];let a;if(!r&&o&&(a=su.getInstance().factory_.makeBranchNode(Ih.SUBSCRIPT,[t,n],[]),a.role=Ah.SUBSUP,e=[a,o],i=Ih.SUPERSCRIPT),r){const s=su.getInstance().accentRole_(n,i);if(o){su.getInstance().accentRole_(o,Ih.OVERSCORE)&&!s?(a=su.getInstance().factory_.makeBranchNode(Ih.OVERSCORE,[t,o],[]),e=[a,n],i=Ih.UNDERSCORE):(a=su.getInstance().factory_.makeBranchNode(Ih.UNDERSCORE,[t,n],[]),e=[a,o],i=Ih.OVERSCORE),a.role=Ah.UNDEROVER}}return su.getInstance().makeLimitNode_(t,e,a,i)}makeLimitNode_(t,e,i,s){if(s===Ih.LIMUPPER&&t.type===Ih.LIMLOWER)return t.childNodes.push(e[1]),e[1].parent=t,t.type=Ih.LIMBOTH,t;if(s===Ih.LIMLOWER&&t.type===Ih.LIMUPPER)return t.childNodes.splice(1,-1,e[1]),e[1].parent=t,t.type=Ih.LIMBOTH,t;const r=su.getInstance().factory_.makeBranchNode(s,e,[]),n=wd(t);return i&&(i.embellished=n),r.embellished=n,r.role=t.role,r}getFunctionsInRow_(t,e){const i=e||[];if(0===t.length)return i;const s=t.shift(),r=su.classifyFunction_(s,t);if(!r)return i.push(s),su.getInstance().getFunctionsInRow_(t,i);const n=su.getInstance().getFunctionsInRow_(t,[]),o=su.getInstance().getFunctionArgs_(s,n,r);return i.concat(o)}getFunctionArgs_(t,e,i){let s,r,n;switch(i){case"integral":{const i=su.getInstance().getIntegralArgs_(e);if(!i.intvar&&!i.integrand.length)return i.rest.unshift(t),i.rest;const s=su.getInstance().row(i.integrand);return n=su.getInstance().integralNode_(t,s,i.intvar),iu.run("intvar_from_fraction",n),i.rest.unshift(n),i.rest}case"prefix":if(e[0]&&e[0].type===Ih.FENCED){const i=e.shift();return Yd(i)||(i.role=Ah.LEFTRIGHT),n=su.getInstance().functionNode_(t,i),e.unshift(n),e}if(s=pd(e,Td),s.head.length)r=su.getInstance().row(s.head),s.div&&s.tail.unshift(s.div);else{if(!s.div||!xd(s.div,Ih.APPL))return e.unshift(t),e;r=s.div}return n=su.getInstance().functionNode_(t,r),s.tail.unshift(n),s.tail;case"bigop":return s=pd(e,_d),s.head.length?(r=su.getInstance().row(s.head),n=su.getInstance().bigOpNode_(t,r),s.div&&s.tail.unshift(s.div),s.tail.unshift(n),s.tail):(e.unshift(t),e);default:{if(0===e.length)return[t];const i=e[0];return i.type===Ih.FENCED&&!Yd(i)&&function(t){const e=t.childNodes;if(0===e.length)return!0;if(e.length>1)return!1;const i=e[0];if(i.type===Ih.INFIXOP){if(i.role!==Ah.IMPLICIT)return!1;if(i.childNodes.some((t=>xd(t,Ih.INFIXOP))))return!1}return!0}(i)?(i.role=Ah.LEFTRIGHT,su.propagateFunctionRole_(t,Ah.SIMPLEFUNC),n=su.getInstance().functionNode_(t,e.shift()),e.unshift(n),e):(e.unshift(t),e)}}}getIntegralArgs_(t,e=[]){if(0===t.length){const t=pd(e,_d);return t.div&&t.tail.unshift(t.div),{integrand:t.head,intvar:null,rest:t.tail}}iu.run("intvar_from_implicit",t);const i=t[0];if(Rd(i)){const{integrand:i,rest:s}=su.getInstance().getIntegralArgs_(e);return{integrand:i,intvar:null,rest:s.concat(t)}}if(Cd(i))return i.role=Ah.INTEGRAL,{integrand:e,intvar:i,rest:t.slice(1)};if(t[1]&&Ld(i,t[1])){const s=su.getInstance().prefixNode_(t[1],[i]);return s.role=Ah.INTEGRAL,{integrand:e,intvar:s,rest:t.slice(2)}}return e.push(t.shift()),su.getInstance().getIntegralArgs_(t,e)}functionNode_(t,e){const i=su.getInstance().factory_.makeContentNode(Bh.functionApplication),s=su.getInstance().funcAppls[t.id];s&&(i.mathmlTree=s.mathmlTree,i.mathml=s.mathml,i.annotation=s.annotation,i.attributes=s.attributes,delete su.getInstance().funcAppls[t.id]),i.type=Ih.PUNCTUATION,i.role=Ah.APPLICATION;const r=su.getFunctionOp_(t,(function(t){return xd(t,Ih.FUNCTION)||xd(t,Ih.IDENTIFIER)&&Nd(t,Ah.SIMPLEFUNC)}));return su.getInstance().functionalNode_(Ih.APPL,[t,e],r,[i])}bigOpNode_(t,e){const i=su.getFunctionOp_(t,(t=>xd(t,Ih.LARGEOP)));return su.getInstance().functionalNode_(Ih.BIGOP,[t,e],i,[])}integralNode_(t,e,i){e=e||su.getInstance().factory_.makeEmptyNode(),i=i||su.getInstance().factory_.makeEmptyNode();const s=su.getFunctionOp_(t,(t=>xd(t,Ih.LARGEOP)));return su.getInstance().functionalNode_(Ih.INTEGRAL,[t,e,i],s,[])}functionalNode_(t,e,i,s){const r=e[0];let n;i&&(n=i.parent,s.push(i));const o=su.getInstance().factory_.makeBranchNode(t,e,s);return o.role=r.role,n&&(i.parent=n),o}fractionNode_(t,e){const i=su.getInstance().factory_.makeBranchNode(Ih.FRACTION,[t,e],[]);return i.role=i.childNodes.every((function(t){return xd(t,Ih.NUMBER)&&Nd(t,Ah.INTEGER)}))?Ah.VULGAR:i.childNodes.every(Gd)?Ah.UNIT:Ah.DIVISION,iu.run("propagateSimpleFunction",i)}scriptNode_(t,e,i){let s;switch(t.length){case 0:s=su.getInstance().factory_.makeEmptyNode();break;case 1:if(s=t[0],i)return s;break;default:s=su.getInstance().dummyNode_(t),s.addAnnotation("general","script")}return s.role=e,s}findNestedRow_(t,e,i,s){if(i>3)return null;for(let r,n=0;r=t[n];n++){const t=dh(r);if(t!==Zh.MSPACE){if(t===Zh.MROW)return su.getInstance().findNestedRow_(rh(r.childNodes),e,i+1,s);if(su.findSemantics(r,e,s))return r}}return null}}function ru(t,e,i){const s=t[t.length-1];if(s&&(s.type===Ih.RELATION||s.type===Ih.OPERATOR))return e.addAnnotation("factor",s.type),[...t,e,...i];const r=i[0];return!r||r.type!==Ih.RELATION&&r.type!==Ih.OPERATOR?null:(e.addAnnotation("factor",r.type),[...t,e,...i])}su.FENCE_TO_PUNCT_={[Ah.METRIC]:Ah.METRIC,[Ah.NEUTRAL]:Ah.VBAR,[Ah.OPEN]:Ah.OPENFENCE,[Ah.CLOSE]:Ah.CLOSEFENCE},su.MML_TO_LIMIT_={[Zh.MSUB]:{type:Ih.LIMLOWER,length:1},[Zh.MUNDER]:{type:Ih.LIMLOWER,length:1},[Zh.MSUP]:{type:Ih.LIMUPPER,length:1},[Zh.MOVER]:{type:Ih.LIMUPPER,length:1},[Zh.MSUBSUP]:{type:Ih.LIMBOTH,length:2},[Zh.MUNDEROVER]:{type:Ih.LIMBOTH,length:2}},su.MML_TO_BOUNDS_={[Zh.MSUB]:{type:Ih.SUBSCRIPT,length:1,accent:!1},[Zh.MSUP]:{type:Ih.SUPERSCRIPT,length:1,accent:!1},[Zh.MSUBSUP]:{type:Ih.SUBSCRIPT,length:2,accent:!1},[Zh.MUNDER]:{type:Ih.UNDERSCORE,length:1,accent:!0},[Zh.MOVER]:{type:Ih.OVERSCORE,length:1,accent:!0},[Zh.MUNDEROVER]:{type:Ih.UNDERSCORE,length:2,accent:!0}},su.CLASSIFY_FUNCTION_={[Ah.INTEGRAL]:"integral",[Ah.SUM]:"bigop",[Ah.PREFIXFUNC]:"prefix",[Ah.LIMFUNC]:"prefix",[Ah.SIMPLEFUNC]:"prefix",[Ah.COMPFUNC]:"prefix"},su.MATHJAX_FONTS={"-tex-caligraphic":Mh.CALIGRAPHIC,"-tex-caligraphic-bold":Mh.CALIGRAPHICBOLD,"-tex-calligraphic":Mh.CALIGRAPHIC,"-tex-calligraphic-bold":Mh.CALIGRAPHICBOLD,"-tex-oldstyle":Mh.OLDSTYLE,"-tex-oldstyle-bold":Mh.OLDSTYLEBOLD,"-tex-mathit":Mh.ITALIC};class nu extends Ed{static getAttribute_(t,e,i){if(!t.hasAttribute(e))return i;const s=t.getAttribute(e);return s.match(/^\s*$/)?null:s}constructor(t){super("MathML"),this.options=t,iu.options=t,this.parseMap_=new Map([[Zh.SEMANTICS,this.semantics_.bind(this)],[Zh.MATH,this.rows_.bind(this)],[Zh.MROW,this.rows_.bind(this)],[Zh.MPADDED,this.rows_.bind(this)],[Zh.MSTYLE,this.rows_.bind(this)],[Zh.MFRAC,this.fraction_.bind(this)],[Zh.MSUB,this.limits_.bind(this)],[Zh.MSUP,this.limits_.bind(this)],[Zh.MSUBSUP,this.limits_.bind(this)],[Zh.MOVER,this.limits_.bind(this)],[Zh.MUNDER,this.limits_.bind(this)],[Zh.MUNDEROVER,this.limits_.bind(this)],[Zh.MROOT,this.root_.bind(this)],[Zh.MSQRT,this.sqrt_.bind(this)],[Zh.MTABLE,this.table_.bind(this)],[Zh.MLABELEDTR,this.tableLabeledRow_.bind(this)],[Zh.MTR,this.tableRow_.bind(this)],[Zh.MTD,this.tableCell_.bind(this)],[Zh.MS,this.text_.bind(this)],[Zh.MTEXT,this.text_.bind(this)],[Zh.MSPACE,this.space_.bind(this)],[Zh.ANNOTATIONXML,this.text_.bind(this)],[Zh.MI,this.identifier_.bind(this)],[Zh.MN,this.number_.bind(this)],[Zh.MO,this.operator_.bind(this)],[Zh.MFENCED,this.fenced_.bind(this)],[Zh.MENCLOSE,this.enclosed_.bind(this)],[Zh.MMULTISCRIPTS,this.multiscripts_.bind(this)],[Zh.ANNOTATION,this.empty_.bind(this)],[Zh.NONE,this.empty_.bind(this)],[Zh.MACTION,this.action_.bind(this)]]);const e={type:Ih.IDENTIFIER,role:Ah.NUMBERSET,font:Mh.DOUBLESTRUCK};["C","H","N","P","Q","R","Z","\u2102","\u210d","\u2115","\u2119","\u211a","\u211d","\u2124"].forEach((t=>this.getFactory().defaultMap.set(t,e)).bind(this))}parse(t){su.getInstance().setNodeFactory(this.getFactory());const e=rh(t.childNodes),i=dh(t),s=this.parseMap_.get(i),r=(s||this.dummy_.bind(this))(t,e);return dd(r,t),-1!==[Zh.MATH,Zh.MROW,Zh.MPADDED,Zh.MSTYLE,Zh.SEMANTICS,Zh.MACTION].indexOf(i)||(r.mathml.unshift(t),r.mathmlTree=t),r}semantics_(t,e){return e.length?this.parse(e[0]):this.getFactory().makeEmptyNode()}rows_(t,e){const i=t.getAttribute("semantics");if(i&&i.match("bspr_"))return su.proof(t,i,this.parseList.bind(this));let s;if(1===(e=hd(e)).length)s=this.parse(e[0]),s.type!==Ih.EMPTY||s.mathmlTree||(s.mathmlTree=t);else{const i=iu.run("function_from_identifiers",t);s=i&&i!==t?i:su.getInstance().row(this.parseList(e))}return s.mathml.unshift(t),s}fraction_(t,e){if(!e.length)return this.getFactory().makeEmptyNode();const i=this.parse(e[0]),s=e[1]?this.parse(e[1]):this.getFactory().makeEmptyNode();return su.getInstance().fractionLikeNode(i,s,t.getAttribute("linethickness"),"true"===t.getAttribute("bevelled"))}limits_(t,e){return su.getInstance().limitNode(dh(t),this.parseList(e))}root_(t,e){return e[1]?this.getFactory().makeBranchNode(Ih.ROOT,[this.parse(e[1]),this.parse(e[0])],[]):this.sqrt_(t,e)}sqrt_(t,e){const i=this.parseList(hd(e));return this.getFactory().makeBranchNode(Ih.SQRT,[su.getInstance().row(i)],[])}table_(t,e){const i=t.getAttribute("semantics");if(i&&i.match("bspr_"))return su.proof(t,i,this.parseList.bind(this));const s=this.getFactory().makeBranchNode(Ih.TABLE,this.parseList(e),[]);return s.mathmlTree=t,su.tableToMultiline(s)}tableRow_(t,e){const i=this.getFactory().makeBranchNode(Ih.ROW,this.parseList(e),[]);return i.role=Ah.TABLE,i}tableLabeledRow_(t,e){var i;if(!e.length)return this.tableRow_(t,e);const s=this.parse(e[0]);s.role=Ah.LABEL,(null===(i=s.childNodes[0])||void 0===i?void 0:i.type)===Ih.TEXT&&(s.childNodes[0].role=Ah.LABEL);const r=this.getFactory().makeBranchNode(Ih.ROW,this.parseList(e.slice(1)),[s]);return r.role=Ah.TABLE,r}tableCell_(t,e){const i=this.parseList(hd(e));let s;s=i.length?1===i.length&&xd(i[0],Ih.EMPTY)?i:[su.getInstance().row(i)]:[];const r=this.getFactory().makeBranchNode(Ih.CELL,s,[]);return r.role=Ah.TABLE,r}space_(t,e){const i=t.getAttribute("width"),s=i&&i.match(/[a-z]*$/);if(!s)return this.empty_(t,e);const r=s[0],n=parseFloat(i.slice(0,s.index)),o={cm:.4,pc:.5,em:.5,ex:1,in:.15,pt:5,mm:5}[r];if(!o||isNaN(n)||n<o)return this.empty_(t,e);const a=this.getFactory().makeUnprocessed(t);return su.getInstance().text(a,dh(t))}text_(t,e){const i=this.leaf_(t,e);return t.textContent?(i.updateContent(t.textContent,!0),su.getInstance().text(i,dh(t))):i}identifier_(t,e){const i=this.leaf_(t,e);return su.getInstance().identifierNode(i,su.getInstance().font(t.getAttribute("mathvariant")),t.getAttribute("class"))}number_(t,e){const i=this.leaf_(t,e);return su.number(i),i}operator_(t,e){const i=this.leaf_(t,e);return su.getInstance().operatorNode(i),i}fenced_(t,e){const i=this.parseList(hd(e)),s=nu.getAttribute_(t,"separators",","),r=nu.getAttribute_(t,"open","("),n=nu.getAttribute_(t,"close",")"),o=su.getInstance().mfenced(r,n,s,i);return su.getInstance().tablesInRow([o])[0]}enclosed_(t,e){const i=this.parseList(hd(e)),s=this.getFactory().makeBranchNode(Ih.ENCLOSE,[su.getInstance().row(i)],[]);return s.role=t.getAttribute("notation")||Ah.UNKNOWN,s}multiscripts_(t,e){if(!e.length)return this.getFactory().makeEmptyNode();const i=this.parse(e.shift());if(!e.length)return i;const s=[],r=[],n=[],o=[];let a=!1,l=0;for(let t,i=0;t=e[i];i++)dh(t)!==Zh.MPRESCRIPTS?(a?1&l?s.push(t):r.push(t):1&l?n.push(t):o.push(t),l++):(a=!0,l=0);return hd(s).length||hd(r).length?su.getInstance().tensor(i,this.parseList(r),this.parseList(s),this.parseList(o),this.parseList(n)):su.getInstance().pseudoTensor(i,this.parseList(o),this.parseList(n))}empty_(t,e){return this.getFactory().makeEmptyNode()}action_(t,e){const i=e[t.hasAttribute("selection")?parseInt(t.getAttribute("selection"),10)-1:0],s=this.parse(i);return s.mathmlTree=i,s}dummy_(t,e){const i=this.getFactory().makeUnprocessed(t);return i.role=t.tagName,i.textContent=t.textContent,i}leaf_(t,e){if(1===e.length&&e[0].nodeType!==oh.TEXT_NODE){const i=this.getFactory().makeUnprocessed(t);return i.role=e[0].tagName,dd(i,e[0]),i}const i=this.getFactory().makeLeafNode(t.textContent,su.getInstance().font(t.getAttribute("mathvariant")));return t.hasAttribute("data-latex")&&Uh.LatexCommands.set(t.getAttribute("data-latex"),t.textContent),i}}class ou{constructor(t,e,i=t=>!1){this.name=t,this.apply=e,this.applicable=i}}class au extends ou{}class lu extends ou{}function cu(t,e){const i=[];for(;t.length||e.length;)t.length&&i.push(t.shift()),e.length&&i.push(e.shift());return i}const hu="data-semantic-";var du;!function(t){t.ADDED="data-semantic-added",t.ALTERNATIVE="data-semantic-alternative",t.CHILDREN="data-semantic-children",t.COLLAPSED="data-semantic-collapsed",t.CONTENT="data-semantic-content",t.EMBELLISHED="data-semantic-embellished",t.FENCEPOINTER="data-semantic-fencepointer",t.FONT="data-semantic-font",t.ID="data-semantic-id",t.ANNOTATION="data-semantic-annotation",t.ATTRIBUTES="data-semantic-attributes",t.OPERATOR="data-semantic-operator",t.OWNS="data-semantic-owns",t.PARENT="data-semantic-parent",t.POSTFIX="data-semantic-postfix",t.PREFIX="data-semantic-prefix",t.ROLE="data-semantic-role",t.SPEECH="data-semantic-speech",t.STRUCTURE="data-semantic-structure",t.SUMMARY="data-semantic-summary",t.TYPE="data-semantic-type"}(du||(du={}));const uu=[du.ADDED,du.ALTERNATIVE,du.CHILDREN,du.COLLAPSED,du.CONTENT,du.EMBELLISHED,du.FENCEPOINTER,du.FONT,du.ID,du.ANNOTATION,du.ATTRIBUTES,du.OPERATOR,du.OWNS,du.PARENT,du.POSTFIX,du.PREFIX,du.ROLE,du.SPEECH,du.STRUCTURE,du.SUMMARY,du.TYPE];function pu(t){return t.map((function(t){return t.id})).join(",")}function mu(t,e){t.setAttribute(du.TYPE,e.type);const i=e.allAttributes();for(let e,s=0;e=i[s];s++)t.setAttribute(hu+e[0].toLowerCase(),e[1]);e.childNodes.length&&t.setAttribute(du.CHILDREN,pu(e.childNodes)),e.contentNodes.length&&t.setAttribute(du.CONTENT,pu(e.contentNodes)),e.parent&&t.setAttribute(du.PARENT,e.parent.id.toString());const s=e.attributesXml();s&&t.setAttribute(du.ATTRIBUTES,s),function(t,e){const i=[];e.role===Ah.MGLYPH&&i.push("image");e.attributes.href&&i.push("link");i.length&&t.setAttribute(du.POSTFIX,i.join(" "))}(t,e)}function fu(){const t=lh("mrow");return t.setAttribute(du.ADDED,"true"),t}class gu{static fromTree(t){return gu.fromNode(t.root)}static fromNode(t){return new gu(gu.fromNode_(t))}static fromString(t){return new gu(gu.fromString_(t))}static simpleCollapseStructure(t){return"number"==typeof t}static contentCollapseStructure(t){return!!t&&!gu.simpleCollapseStructure(t)&&"c"===t[0]}static interleaveIds(t,e){return cu(gu.collapsedLeafs(t),gu.collapsedLeafs(e))}static collapsedLeafs(...t){return t.reduce(((t,e)=>{return t.concat((i=e,gu.simpleCollapseStructure(i)?[i]:gu.contentCollapseStructure(i[1])?i.slice(2):i.slice(1)));var i}),[])}static fromStructure(t,e,i){return new gu(gu.tree_(t,e.root,i))}static combineContentChildren(t,e,i,s){switch(t){case Ih.RELSEQ:case Ih.INFIXOP:case Ih.MULTIREL:return cu(s,i);case Ih.PREFIXOP:return i.concat(s);case Ih.POSTFIXOP:return s.concat(i);case Ih.MATRIX:case Ih.VECTOR:case Ih.FENCED:return s.unshift(i[0]),s.push(i[1]),s;case Ih.CASES:return s.unshift(i[0]),s;case Ih.APPL:return[s[0],i[0],s[1]];case Ih.ROOT:return[s[0],s[1]];case Ih.ROW:case Ih.LINE:return i.length&&s.push(i[0]),s;default:return s}}static makeSexp_(t){return gu.simpleCollapseStructure(t)?t.toString():gu.contentCollapseStructure(t)?"(c "+t.slice(1).map(gu.makeSexp_).join(" ")+")":"("+t.map(gu.makeSexp_).join(" ")+")"}static fromString_(t){let e=t.replace(/\(/g,"[");return e=e.replace(/\)/g,"]"),e=e.replace(/ /g,","),e=e.replace(/c/g,'"c"'),JSON.parse(e)}static fromNode_(t){if(!t)return[];const e=t.contentNodes;let i;e.length&&(i=e.map(gu.fromNode_),i.unshift("c"));const s=t.childNodes;if(!s.length)return e.length?[t.id,i]:t.id;const r=s.map(gu.fromNode_);return e.length&&r.unshift(i),r.unshift(t.id),r}static tree_(t,e,i,s=0,r=1,n=1){if(!e)return[];const o=e.id,a=[o];!function(t){if(Yc.getInstance().mode!==Dc.HTTP)return;let e=t;for(;e&&!e.evaluate;)e=e.parentNode;e&&e.evaluate?Zc.currentDocument=e:t.ownerDocument&&(Zc.currentDocument=t.ownerDocument)}(t);const l=function(t,e){let i;try{i=sh(t,e,Zc.result.ORDERED_NODE_ITERATOR_TYPE)}catch(t){return[]}const s=[];for(let t=i.iterateNext();t;t=i.iterateNext())s.push(t);return s}(`.//self::*[@${du.ID}=${o}]`,t)[0];if(!e.childNodes.length)return gu.addAria(l,s,r,n,i),e.id;const c=gu.combineContentChildren(e.type,e.role,e.contentNodes.map((function(t){return t})),e.childNodes.map((function(t){return t})));l&&gu.addOwns_(l,c);for(let e,r=0,n=c.length;e=c[r];r++)a.push(gu.tree_(t,e,i,s+1,r+1,n));return gu.addAria(l,s,r,n,i),a}static addAria(t,e,i,s,r){const n=r.tree?e?"treeitem":"tree":"treeitem";r.aria&&t&&(t.setAttribute("aria-level",e.toString()),t.setAttribute("aria-posinset",i.toString()),t.setAttribute("aria-setsize",s.toString()),t.setAttribute("role",n),t.hasAttribute(du.OWNS)&&t.setAttribute("aria-owns",t.getAttribute(du.OWNS)))}static addOwns_(t,e){const i=t.getAttribute(du.COLLAPSED),s=i?gu.realLeafs_(gu.fromString(i).array):e.map((t=>t.id));t.setAttribute(du.OWNS,s.join(" "))}static realLeafs_(t){if(gu.simpleCollapseStructure(t))return[t];if(gu.contentCollapseStructure(t))return[];let e=[];for(let i=1;i<t.length;i++)e=e.concat(gu.realLeafs_(t[i]));return e}constructor(t){this.parents=null,this.levelsMap=null,t=0===t?t:t||[],this.array=t}populate(){this.parents&&this.levelsMap||(this.parents={},this.levelsMap={},this.populate_(this.array,this.array,[]))}toString(){return gu.makeSexp_(this.array)}populate_(t,e,i){if(gu.simpleCollapseStructure(t))return this.levelsMap[t]=e,void(this.parents[t]=t===i[0]?i.slice(1):i);const s=gu.contentCollapseStructure(t)?t.slice(1):t,r=[s[0]].concat(i);for(let e=0,i=s.length;e<i;e++){const i=s[e];this.populate_(i,t,r)}}isRoot(t){return t===this.levelsMap[t][0]}directChildren(t){if(!this.isRoot(t))return[];return this.levelsMap[t].slice(1).map((t=>gu.simpleCollapseStructure(t)?t:gu.contentCollapseStructure(t)?t[1]:t[0]))}subtreeNodes(t){if(!this.isRoot(t))return[];const e=(t,i)=>{gu.simpleCollapseStructure(t)?i.push(t):(gu.contentCollapseStructure(t)&&(t=t.slice(1)),t.forEach((t=>e(t,i))))},i=this.levelsMap[t],s=[];return e(i.slice(1),s),s}}function bu(t,e,i){let s=null;if(!t.length)return s;const r=i[i.length-1],n=r&&r.length,o=e&&e.length,a=su.getInstance();if(n&&o){if(e[0].type===Ih.INFIXOP&&e[0].role===Ah.IMPLICIT)return s=t.pop(),r.push(a.postfixNode_(r.pop(),t)),s;s=t.shift();const i=a.prefixNode_(e.shift(),t);return e.unshift(i),s}return n?(r.push(a.postfixNode_(r.pop(),t)),s):(o&&e.unshift(a.prefixNode_(e.shift(),t)),s)}function Eu(t,e,i){if(!e.length)return t;const s=t.pop(),r=e.shift(),n=i.shift();if(r.type===Ih.INFIXOP&&(r.role===Ah.IMPLICIT||r.role===Ah.UNIT)){Xc.getInstance().output("Juxta Heuristic Case 2");const o=(s?[s,r]:[r]).concat(n);return Eu(t.concat(o),e,i)}if(!s)return Xc.getInstance().output("Juxta Heuristic Case 3"),Eu([r].concat(n),e,i);const o=n.shift();if(!o){Xc.getInstance().output("Juxta Heuristic Case 9");const n=iu.factory.makeBranchNode(Ih.INFIXOP,[s,e.shift()],[r],r.textContent);return n.role=Ah.IMPLICIT,iu.run("combine_juxtaposition",n),e.unshift(n),Eu(t,e,i)}if(Id(s)||Id(o))return Xc.getInstance().output("Juxta Heuristic Case 4"),Eu(t.concat([s,r,o]).concat(n),e,i);let a=null;return $d(s)&&$d(o)?(Xc.getInstance().output("Juxta Heuristic Case 5"),s.contentNodes.push(r),s.contentNodes=s.contentNodes.concat(o.contentNodes),s.childNodes.push(o),s.childNodes=s.childNodes.concat(o.childNodes),o.childNodes.forEach((t=>t.parent=s)),r.parent=s,s.addMathmlNodes(r.mathml),s.addMathmlNodes(o.mathml),a=s):$d(s)?(Xc.getInstance().output("Juxta Heuristic Case 6"),s.contentNodes.push(r),s.childNodes.push(o),o.parent=s,r.parent=s,s.addMathmlNodes(r.mathml),s.addMathmlNodes(o.mathml),a=s):$d(o)?(Xc.getInstance().output("Juxta Heuristic Case 7"),o.contentNodes.unshift(r),o.childNodes.unshift(s),s.parent=o,r.parent=o,o.addMathmlNodes(r.mathml),o.addMathmlNodes(s.mathml),a=o):(Xc.getInstance().output("Juxta Heuristic Case 8"),a=iu.factory.makeBranchNode(Ih.INFIXOP,[s,o],[r],r.textContent),a.role=Ah.IMPLICIT),t.push(a),Eu(t.concat(n),e,i)}function xu(t){return t.childNodes[0]&&t.childNodes[0].childNodes[0]&&dh(t.childNodes[0])===Zh.MPADDED&&dh(t.childNodes[0].childNodes[0])===Zh.MPADDED&&dh(t.childNodes[0].childNodes[t.childNodes[0].childNodes.length-1])===Zh.MPHANTOM}iu.add(new au("combine_juxtaposition",(function(t){for(let e,i=t.childNodes.length-1;e=t.childNodes[i];i--)$d(e)&&!e.nobreaking&&(t.childNodes.splice(i,1,...e.childNodes),t.contentNodes.splice(i,0,...e.contentNodes),e.childNodes.concat(e.contentNodes).forEach((function(e){e.parent=t})),t.addMathmlNodes(e.mathml));return t}))),iu.add(new au("propagateSimpleFunction",(t=>(t.type!==Ih.INFIXOP&&t.type!==Ih.FRACTION||!t.childNodes.every(qd)||(t.role=Ah.COMPFUNC),t)),(t=>"clearspeak"===iu.options.domain))),iu.add(new au("simpleNamedFunction",(t=>(t.role!==Ah.UNIT&&-1!==["f","g","h","F","G","H"].indexOf(t.textContent)&&(t.role=Ah.SIMPLEFUNC),t)),(t=>"clearspeak"===iu.options.domain))),iu.add(new au("propagateComposedFunction",(t=>(t.type===Ih.FENCED&&t.childNodes[0].role===Ah.COMPFUNC&&(t.role=Ah.COMPFUNC),t)),(t=>"clearspeak"===iu.options.domain))),iu.add(new au("multioperator",(t=>{t.role!==Ah.UNKNOWN||t.textContent.length<=1||(su.compSemantics(t,"role",Ah),su.compSemantics(t,"type",Ih))}))),iu.add(new lu("convert_juxtaposition",(t=>{let e=md(t,(function(t){return t.textContent===Bh.invisibleTimes&&t.type===Ih.OPERATOR}));e=e.rel.length?function(t){const e=[],i=[];let s=t.comp.shift(),r=null,n=[];for(;t.comp.length;)if(n=[],s.length)r&&e.push(r),i.push(s),r=t.rel.shift(),s=t.comp.shift();else{for(r&&n.push(r);!s.length&&t.comp.length;)s=t.comp.shift(),n.push(t.rel.shift());r=bu(n,s,i)}n.length||s.length?(e.push(r),i.push(s)):(n.push(r),bu(n,s,i));return{rel:e,comp:i}}(e):e,t=e.comp[0];for(let i,s,r=1;i=e.comp[r],s=e.rel[r-1];r++)t.push(s),t=t.concat(i);return e=md(t,(function(t){return t.textContent===Bh.invisibleTimes&&(t.type===Ih.OPERATOR||t.type===Ih.INFIXOP)})),e.rel.length?Eu(e.comp.shift(),e.rel,e.comp):t}))),iu.add(new au("simple2prefix",(t=>(t.textContent.length>1&&!t.textContent[0].match(/[A-Z]/)&&(t.role=Ah.PREFIXFUNC),t)),(t=>"braille"===iu.options.modality&&t.type===Ih.IDENTIFIER))),iu.add(new au("detect_cycle",(t=>{t.type=Ih.MATRIX,t.role=Ah.CYCLE;const e=t.childNodes[0];return e.type=Ih.ROW,e.role=Ah.CYCLE,e.textContent="",e.contentNodes=[],t}),(t=>t.type===Ih.FENCED&&t.childNodes[0].type===Ih.INFIXOP&&t.childNodes[0].role===Ah.IMPLICIT&&t.childNodes[0].childNodes.every((function(t){return t.type===Ih.NUMBER}))&&t.childNodes[0].contentNodes.every((function(t){return t.role===Ah.SPACE}))))),iu.add(new lu("intvar_from_implicit",(function(t){const e=t[0].childNodes;t.splice(0,1,...e),t.forEach((t=>t.parent=null))}),(t=>t[0]&&Kd(t[0])))),iu.add(new au("intvar_from_fraction",(function(t){const e=t.childNodes[1],i=e.childNodes[0];if(Cd(i))return void(i.role=Ah.INTEGRAL);if(!Kd(i))return;const s=i.childNodes.length,r=i.childNodes[s-2],n=i.childNodes[s-1];if(Cd(n))return void(n.role=Ah.INTEGRAL);if(Ld(r,n)){const t=su.getInstance().prefixNode_(n,[r]);t.role=Ah.INTEGRAL,2===s?e.childNodes[0]=t:(i.childNodes.pop(),i.contentNodes.pop(),i.childNodes[s-2]=t,t.parent=i)}}),(t=>{if(t.type!==Ih.INTEGRAL)return!1;const[,e,i]=t.childNodes;return i.type===Ih.EMPTY&&e.type===Ih.FRACTION}))),iu.add(new au("rewrite_subcases",(function(t){t.addAnnotation("Emph","top");let e=[];if(t.hasAnnotation("Emph","left")){const i=Nu(t.childNodes[0].childNodes[0].childNodes[0],!0);i.forEach((t=>t.addAnnotation("Emph","left"))),e=e.concat(i);for(let e,i=0;e=t.childNodes[i];i++)e.childNodes.shift()}if(e.push(t),t.hasAnnotation("Emph","right")){const i=Nu(t.childNodes[0].childNodes[t.childNodes[0].childNodes.length-1].childNodes[0]);i.forEach((t=>t.addAnnotation("Emph","left"))),e=e.concat(i),t.childNodes[0].childNodes.pop()}su.tableToMultiline(t);const i=su.getInstance().row(e),s=t.annotation.Emph;return t.annotation.Emph=["table"],s.forEach((t=>i.addAnnotation("Emph",t))),i}),(t=>{let e=!0,i=!0;const s=t.childNodes[0].childNodes[0];if(!s)return!1;if(xu(s.mathmlTree)){for(let i,s=1;i=t.childNodes[s];s++)if(i.childNodes[0].childNodes.length){e=!1;break}}else e=!1;e&&t.addAnnotation("Emph","left");if(xu(t.childNodes[0].childNodes[t.childNodes[0].childNodes.length-1].mathmlTree)){const e=t.childNodes[0].childNodes.length;for(let s,r=1;s=t.childNodes[r];r++)if(s.childNodes.length>=e){i=!1;break}}else i=!1;return i&&t.addAnnotation("Emph","right"),e||i})));const yu=[Ih.PUNCTUATED,Ih.RELSEQ,Ih.MULTIREL,Ih.INFIXOP,Ih.PREFIXOP,Ih.POSTFIXOP];function Nu(t,e){if(!t.childNodes.length)return Tu(t),[t];let i=null;if(t.type===Ih.PUNCTUATED&&(e?t.role===Ah.ENDPUNCT:t.role===Ah.STARTPUNCT)){const s=t.childNodes;Tu(s[e?s.length-1:0])&&(t=s[e?0:s.length-1],i=s[e?s.length-1:0])}if(-1!==yu.indexOf(t.type)){const s=t.childNodes;Tu(s[e?s.length-1:0]);const r=gu.combineContentChildren(t.type,t.role,t.contentNodes,t.childNodes);return i&&(e?r.push(i):r.unshift(i)),r}return i?e?[t,i]:[i,t]:[t]}const vu={[Ah.METRIC]:Ah.METRIC,[Ah.VBAR]:Ah.NEUTRAL,[Ah.OPENFENCE]:Ah.OPEN,[Ah.CLOSEFENCE]:Ah.CLOSE};function Tu(t){if(t.type!==Ih.PUNCTUATION)return!1;const e=vu[t.role];return!!e&&(t.role=e,t.type=Ih.FENCE,t.addAnnotation("Emph","fence"),!0)}function _u(t,e,i,s=i){const r=[];for(;t&&t.role===i;)r.push(t),t=e.shift();return r.length?(t&&e.unshift(t),[1===r.length?r[0]:Lu(r,s),e]):[t,e]}function Lu(t,e){const i=iu.factory.makeBranchNode(Ih.PUNCTUATION,t,[]);return i.role=e,i}function Cu(t){return["[","\uff3b"].includes(t)}function Ru(t){return["]","\uff3d"].includes(t)}function wu(t){return["(","\u207d","\u208d"].includes(t)}function Iu(t){return[")","\u207e","\u208e"].includes(t)}function Su(t){return t.role===Ah.INFTY||t.type===Ih.PREFIXOP&&t.childNodes[0].role===Ah.INFTY}function Au(t){const e=t.childNodes[0];if(t.type!==Ih.FENCED||(null==e?void 0:e.type)!==Ih.PUNCTUATED||3!==(null==e?void 0:e.childNodes.length)||1!==(null==e?void 0:e.contentNodes.length)||(null==e?void 0:e.childNodes[1].role)!==Ah.COMMA)return!1;const i=t.childNodes[0].childNodes[0],s=t.childNodes[0].childNodes[2],r=t.contentNodes[0].textContent,n=t.contentNodes[1].textContent;return!!(Cu(r)&&Iu(n)||wu(r)&&Ru(n))||!(!wu(r)||!Iu(n)||!Su(i)&&!Su(s))}function Ou(t){return Pu(t)||function(t){return ku(t)||t.type===Ih.INFIXOP&&t.role===Ah.IMPLICIT&&(2===t.childNodes.length&&(ku(t.childNodes[0])||Pu(t.childNodes[0]))&&ku(t.childNodes[1])||3===t.childNodes.length&&Pu(t.childNodes[0])&&ku(t.childNodes[1])&&ku(t.childNodes[2]))}(t)||function(t){return t.type===Ih.PUNCTUATED&&t.role===Ah.ENDPUNCT&&2===t.childNodes.length&&t.childNodes[1].role===Ah.DEGREE&&(ku(t.childNodes[0])||Du(t.childNodes[0])||t.childNodes[0].type===Ih.PREFIXOP&&t.childNodes[0].role===Ah.NEGATIVE&&(ku(t.childNodes[0].childNodes[0])||Du(t.childNodes[0].childNodes[0])))}(t)||function(t){return t.type===Ih.PREFIXOP&&t.role===Ah.NEGATIVE&&Mu(t.childNodes[0])&&t.childNodes[0].type!==Ih.PREFIXOP&&t.childNodes[0].type!==Ih.APPL&&t.childNodes[0].type!==Ih.PUNCTUATED}(t)||function(t){return t.type===Ih.APPL&&(t.childNodes[0].role===Ah.PREFIXFUNC||t.childNodes[0].role===Ah.SIMPLEFUNC)&&(Mu(t.childNodes[1])||t.childNodes[1].type===Ih.FENCED&&Mu(t.childNodes[1].childNodes[0]))}(t)}function Mu(t){return t.hasAnnotation("clearspeak","simple")}function ku(t){return t.type===Ih.IDENTIFIER&&(t.role===Ah.LATINLETTER||t.role===Ah.GREEKLETTER||t.role===Ah.OTHERLETTER||t.role===Ah.SIMPLEFUNC)}function Du(t){return t.type===Ih.NUMBER&&(t.role===Ah.INTEGER||t.role===Ah.FLOAT)}function Pu(t){return Du(t)||function(t){if(Bu("Fraction_Over")||Bu("Fraction_FracOver"))return!1;if(t.type!==Ih.FRACTION||t.role!==Ah.VULGAR)return!1;if(Bu("Fraction_Ordinal"))return!0;const e=parseInt(t.childNodes[0].textContent,10),i=parseInt(t.childNodes[1].textContent,10);return e>0&&e<20&&i>0&&i<11}(t)}function Bu(t){return Yc.getInstance().options.style===t}function ju(t){return t.type===Ih.TEXT&&t.role!==Ah.LABEL||t.type===Ih.PUNCTUATED&&t.role===Ah.TEXT&&Du(t.childNodes[0])&&function(t){for(let e=0;e<t.length-1;e++)if(t[e].type!==Ih.TEXT||""!==t[e].textContent)return!1;return t[t.length-1].type===Ih.TEXT}(t.childNodes.slice(1))||t.type===Ih.IDENTIFIER&&t.role===Ah.UNIT||t.type===Ih.INFIXOP&&(t.role===Ah.IMPLICIT||t.role===Ah.UNIT)}iu.add(new lu("ellipses",(t=>{const e=[];let i=t.shift();for(;i;)[i,t]=_u(i,t,Ah.FULLSTOP,Ah.ELLIPSIS),[i,t]=_u(i,t,Ah.DASH),e.push(i),i=t.shift();return e}),(t=>t.length>1))),iu.add(new lu("op_with_limits",(t=>{const e=t[0];return e.type=Ih.LARGEOP,e.role=Ah.SUM,t}),(t=>t[0].type===Ih.OPERATOR&&t.slice(1).some((t=>t.type===Ih.RELSEQ||t.type===Ih.MULTIREL||t.type===Ih.INFIXOP&&t.role===Ah.ELEMENT||t.type===Ih.PUNCTUATED&&t.role===Ah.SEQUENCE))))),iu.add(new class extends ou{}("function_from_identifiers",(t=>{const e=rh(t.childNodes).map((t=>t.textContent.trim())).join("");if(Uh.Meaning.get(e).type===Ih.UNKNOWN)return t;const i=iu.factory.makeLeafNode(e,su.getInstance().font(t.getAttribute("mathvariant")));return i.mathmlTree=t,i}),(t=>{const e=rh(t.childNodes);return!(e.length<2)&&e.every((t=>dh(t)===Zh.MI&&Uh.Meaning.get(t.textContent.trim()).role===Ah.LATINLETTER))}))),iu.add(new lu("bracketed_interval",(t=>{const e=t[0],i=t[1],s=t.slice(2),r=su.getInstance().row(s),n=iu.factory.makeBranchNode(Ih.FENCED,[r],[e,i]);return n.role=Ah.INTERVAL,n}),(t=>{const e=t[0],i=t[1],s=t.slice(2);if(!(e&&i&&(Ru(e.textContent)&&(Cu(i.textContent)||Ru(i.textContent))||Cu(i.textContent)&&(Cu(e.textContent)||Ru(e.textContent)))))return!1;if(1===s.length&&s[0].type===Ih.PUNCTUATED&&1===s[0].contentNodes.length)return!0;const r=md(s,Ad);return!(1!==r.rel.length||!r.comp[0].length||!r.comp[1].length)}))),iu.add(new au("interval_heuristic",(t=>(t.role=Ah.INTERVAL,t)),(t=>Au(t)))),iu.add(new au("propagateInterval",(t=>(t.childNodes.forEach((t=>{Au(t)&&(t.role=Ah.INTERVAL)})),t)),(t=>eu(t)))),bh(new ph("clearspeak","simple",(function(t){return Ou(t)?"simple":""}))),Eh("clearspeak","simple"),bh(new ph("clearspeak","unit",(function(t){return ju(t)?"unit":""}))),Eh("clearspeak","unit");const Fu=[Ih.MULTIREL,Ih.RELSEQ,Ih.APPL,Ih.ROW,Ih.LINE],Uu=[Ih.SUBSCRIPT,Ih.SUPERSCRIPT,Ih.OVERSCORE,Ih.UNDERSCORE];function Hu(t,e){const i=t.parent;if(!i)return!1;const s=i.type;return-1!==Fu.indexOf(s)||s===Ih.PREFIXOP&&i.role===Ah.NEGATIVE&&!e.script&&!e.enclosed||s===Ih.PREFIXOP&&i.role===Ah.GEOMETRY||!(s!==Ih.PUNCTUATED||e.enclosed&&i.role!==Ah.TEXT)}bh(new mh("nemeth","number",(function(t,e){return t.childNodes.length?(-1!==Uu.indexOf(t.type)&&(e.script=!0),t.type===Ih.FENCED?(e.number=!1,e.enclosed=!0,["",e]):t.type===Ih.PREFIXOP&&t.role!==Ah.GEOMETRY&&t.role!==Ah.NEGATIVE?(e.number=!1,["",e]):(Hu(t,e)&&(e.number=!0,e.enclosed=!1),["",e])):(Hu(t,e)&&(e.number=!0,e.script=!1,e.enclosed=!1),[e.number?"number":"",{number:!1,enclosed:e.enclosed,script:e.script}])}),{number:!0})),Eh("nemeth","number"),bh(new mh("depth","depth",(function(t){return t.parent?[parseInt(t.parent.annotation.depth[0])+1]:[1]}))),Eh("depth","depth");class qu{static empty(){const t=nh("<math/>"),e=new qu(t,new Gc);return e.mathml=t,e}static fromNode(t,e){const i=qu.empty();return i.root=t,e&&(i.mathml=e),i}static fromRoot(t,e){let i=t;for(;i.parent;)i=i.parent;const s=qu.fromNode(i);return e&&(s.mathml=e),s}static fromXml(t){const e=qu.empty();return t.childNodes[0]&&(e.root=gd.fromXml(t.childNodes[0])),e}constructor(t,e){this.mathml=t,this.options=e,this.parser=new nu(e),this.root=this.parser.parse(t),this.collator=this.parser.getFactory().leafMap.collateMeaning();const i=this.collator.newDefault();i&&(this.parser=new nu(e),this.parser.getFactory().defaultMap=i,this.root=this.parser.parse(t)),Wu.visit(this.root,{}),function(t){for(const e of fh.values())e.active&&e.annotate(t);for(const e of gh.values())e.active&&e.visit(t,Object.assign({},e.def))}(this.root)}xml(t){const e=nh("<stree></stree>"),i=this.root.xml(e.ownerDocument,t);return e.appendChild(i),e}toString(t){return uh(this.xml(t))}formatXml(t){return ch(this.toString(t))}displayTree(){this.root.displayTree()}replaceNode(t,e){const i=t.parent;i?i.replaceChild(t,e):this.root=e}toJson(){const t={};return t.stree=this.root.toJson(),t}}const Wu=new mh("general","unit",((t,e)=>(Jd(t)&&(t.role=Ah.UNIT),!1)));function Vu(t,e){return new qu(t,e)}const Xu=[],zu=!0,Gu=new Map;function Ju(t){Xc.getInstance().generate((()=>["WALKING START: ",t.toString()]));const e=function(t){for(let e,i=0;e=Xu[i];i++)if(e.test(t))return e.constr(t);return null}(t);let i;if(e)return i=e.getMathml(),Xc.getInstance().generate((()=>["WALKING END: ",t.toString()])),ap(i);if(1===t.mathml.length){if(Xc.getInstance().output("Walktree Case 0"),!t.childNodes.length)return Xc.getInstance().output("Walktree Case 0.1"),i=t.mathml[0],mu(i,t),Xc.getInstance().generate((()=>["WALKING END: ",t.toString()])),ap(i);const e=t.childNodes[0];if(1===t.childNodes.length&&e.type===Ih.EMPTY)return Xc.getInstance().output("Walktree Case 0.2"),i=t.mathml[0],mu(i,t),i.appendChild(Ju(e)),Xc.getInstance().generate((()=>["WALKING END: ",t.toString()])),ap(i);t.childNodes.forEach((t=>{t.mathml.length||(t.mathml=[fp(t)])}))}const s=t.contentNodes.map(pp);gp(t,s);const r=t.childNodes.map(Ju),n=gu.combineContentChildren(t.type,t.role,s,r);if(i=t.mathmlTree,null===i)Xc.getInstance().output("Walktree Case 1"),i=Ku(n,t);else{const t=rp(n);Xc.getInstance().output("Walktree Case 2"),t?(Xc.getInstance().output("Walktree Case 2.1"),i=dp(t)):(Xc.getInstance().output("Walktree Case 2.2"),i=bp(i))}return i=mp(i),function(t,e,i){if(!e.length)return;if(1===e.length&&t===e[0])return;const s=i.role===Ah.IMPLICIT&&iu.flags.combine_juxtaposition?function(t,e,i){const s=[];let r=rh(t.childNodes),n=!1;for(;r.length;){const t=r.shift();if(t.hasAttribute(du.TYPE)){s.push(t);continue}const i=Yu(t,e);0!==i.length&&(1!==i.length?(n?t.setAttribute("AuxiliaryImplicit",!0):n=!0,r=i.concat(r)):s.push(t))}const o=[],a=i.childNodes.map((function(t){return t.mathmlTree}));for(;a.length;){const t=a.pop();if(t){if(-1!==s.indexOf(t))break;-1!==e.indexOf(t)&&o.unshift(t)}}return s.concat(o)}(t,e,i):rh(t.childNodes);if(!s.length)return void e.forEach((function(e){t.appendChild(e)}));let r=0;for(;e.length;){const i=e[0];if(s[r]===i||ip(s[r],i)){e.shift(),r++;continue}if(s[r]&&-1===e.indexOf(s[r])){r++;continue}if(ep(i,t)){e.shift();continue}const n=s[r];if(n)Qu(t,n,i),e.shift();else{if(i.parentNode){t=dp(i),e.shift();continue}const s=e[1];if(s&&s.parentNode){Zu(t=dp(s),i,s),e.shift(),e.shift();continue}Zu(t,i,null),e.shift()}}}(i,n,t),Gu.has(t.id)||(Gu.set(t.id,!0),mu(i,t)),Xc.getInstance().generate((()=>["WALKING END: ",t.toString()])),ap(i)}function Ku(t,e){const i=function(t){const e=rp(t);if(!e)return{type:sp.INVALID,node:null};const i=rp(t.slice().reverse());if(e===i)return{type:sp.VALID,node:e};const s=np(e),r=function(t,e){let i=0;for(;t[i]&&-1===e.indexOf(t[i]);)i++;return t.slice(0,i+1)}(s,t),n=np(i,(function(t){return-1!==r.indexOf(t)})),o=n[0],a=r.indexOf(o);if(-1===a)return{type:sp.INVALID,node:null};return{type:r.length!==s.length?sp.PRUNED:op(r[a+1],n[1])?sp.VALID:sp.INVALID,node:o}}(t);let s=i.node;const r=i.type;if(r!==sp.VALID||!ld(s)||!s.parentNode&&e.parent)if(Xc.getInstance().output("Walktree Case 1.1"),s=fu(),r===sp.PRUNED)Xc.getInstance().output("Walktree Case 1.1.0"),s=function(t,e,i){let s=lp(e);if(od(s)){Xc.getInstance().output("Walktree Case 1.1.0.0"),$u(s,t),rh(s.childNodes).forEach((function(e){t.appendChild(e)}));const e=t;t=s,s=e}const r=i.indexOf(e);return i[r]=s,ah(s,t),t.appendChild(s),i.forEach((function(e){t.appendChild(e)})),t}(s,i.node,t);else if(t[0]){Xc.getInstance().output("Walktree Case 1.1.1");const e=rp(t);if(e){const i=function(t,e){const i=rh(t.childNodes);let s=1/0,r=-1/0;return e.forEach((function(t){const e=i.indexOf(t);-1!==e&&(s=Math.min(s,e),r=Math.max(r,e))})),i.slice(s,r+1)}(dp(e),t);ah(e,s),i.forEach((function(t){s.appendChild(t)}))}else $u(s,t[0]),s=t[0]}return e.mathmlTree||(e.mathmlTree=s),s}function $u(t,e){for(const i of uu)t.hasAttribute(i)&&(e.setAttribute(i,t.getAttribute(i)),t.removeAttribute(i))}function Yu(t,e){const i=[];let s=rh(t.childNodes);for(;s.length;){const t=s.shift();t.nodeType===oh.ELEMENT_NODE&&(t.hasAttribute(du.TYPE)||-1!==e.indexOf(t)?i.push(t):s=rh(t.childNodes).concat(s))}return i}function Qu(t,e,i){let s=e,r=dp(s);for(;r&&tp(r,s)&&!s.hasAttribute("AuxiliaryImplicit")&&r!==t;)s=r,r=dp(s);r&&(Zu(r,i,s),s.removeAttribute("AuxiliaryImplicit"))}function Zu(t,e,i){dh(t)===Zh.MACTION?Zu(dp(t),e,t):t.insertBefore(e,i)}function tp(t,e){if(dh(t)!==Zh.MACTION)return t.firstChild===e;const i=parseInt(t.getAttribute("selection"))||1;return t.childNodes[i-1]===e}function ep(t,e){if(!t)return!1;do{if((t=dp(t))===e)return!0}while(t);return!1}function ip(t,e){const i=Bh.functionApplication;if(t&&e&&t.textContent&&e.textContent&&t.textContent===i&&e.textContent===i&&"true"===e.getAttribute(du.ADDED)){for(let i,s=0;i=t.attributes[s];s++)e.hasAttribute(i.nodeName)||e.setAttribute(i.nodeName,i.nodeValue);return ah(t,e),!0}return!1}var sp;function rp(t){let e=0,i=null;for(;!i&&e<t.length;)t[e].parentNode&&(i=t[e]),e++;return i}function np(t,e){const i=e||(t=>!1),s=[t];for(;!i(t)&&!od(t)&&t.parentNode;)t=dp(t),s.unshift(t);return s}function op(t,e){return!(!t||!e||t.previousSibling||e.nextSibling)}function ap(t){for(;!od(t)&&cp(t);)t=dp(t);return t}function lp(t){const e=rh(t.childNodes);if(!e)return t;const i=e.filter((function(t){return t.nodeType===oh.ELEMENT_NODE&&!ad(t)}));return 1===i.length&&ld(i[0])&&!i[0].hasAttribute(du.TYPE)?lp(i[0]):t}function cp(t){const e=dp(t);return!(!e||!ld(e))&&rh(e.childNodes).every((function(e){return e===t||hp(e)}))}function hp(t){if(t.nodeType!==oh.ELEMENT_NODE)return!0;if(!t||ad(t))return!0;const e=rh(t.childNodes);return!(!ld(t)&&e.length||function(t){return!!t&&rd.includes(dh(t))}(t)||t.hasAttribute(du.TYPE)||cd(t))&&rh(t.childNodes).every(hp)}function dp(t){return t.parentNode}function up(t,e){const i=new gu(e);t.setAttribute(du.COLLAPSED,i.toString())}function pp(t){if(t.mathml.length)return Ju(t);const e=zu?fp(t):fu();return t.mathml=[e],e}function mp(t){if(dh(t)!==Zh.MFENCED)return t;const e=fu();for(let i,s=0;i=t.attributes[s];s++)-1===["open","close","separators"].indexOf(i.name)&&e.setAttribute(i.name,i.value);return rh(t.childNodes).forEach((function(t){e.appendChild(t)})),ah(t,e),e}function fp(t){const e=lh("mo"),i=(s=t.textContent,Wc.f.document.createTextNode(s));var s;return e.appendChild(i),mu(e,t),e.setAttribute(du.ADDED,"true"),e}function gp(t,e){const i=t.type+(t.textContent?","+t.textContent:"");e.forEach((function(t){bp(t).setAttribute(du.OPERATOR,i)}))}function bp(t){const e=rh(t.childNodes);if(!e)return t;const i=e.filter((function(t){return!hp(t)})),s=[];for(let t,e=0;t=i[e];e++)if(ld(t)&&t.getAttribute(du.TYPE)!==Ih.PUNCTUATION){const e=bp(t);e&&e!==t&&s.push(e)}else s.push(t);return 1===s.length?s[0]:t}function Ep(t){return ch(t.toString()).toString().replace(new RegExp(hu,"g"),"")}function xp(t,e){const i=!!e,s=e||[],r=t.parent,n=t.contentNodes.map((function(t){return t.id}));n.unshift("c");const o=[t.id,n];for(let e,n=0;e=t.childNodes[n];n++){const t=Ju(e);s.push(t);const n=bp(t);r&&!i&&n.setAttribute(du.PARENT,r.id.toString()),o.push(e.id)}return o}!function(t){t.VALID="valid",t.INVALID="invalid",t.PRUNED="pruned"}(sp||(sp={}));class yp{constructor(t){this.semantic=t}}class Np extends yp{static test(t){return!t.mathmlTree&&t.type===Ih.LINE&&t.role===Ah.BINOMIAL}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){if(!this.semantic.childNodes.length)return this.mml;const t=this.semantic.childNodes[0];if(this.mml=Ju(t),this.mml.hasAttribute(du.TYPE)){const t=fu();ah(this.mml,t),t.appendChild(this.mml),this.mml=t}return mu(this.mml,this.semantic),this.mml}}class vp extends yp{static test(t){if(!t.mathmlTree||!t.childNodes.length)return!1;const e=dh(t.mathmlTree),i=t.childNodes[0].role;return e===Zh.MSUBSUP&&i===Ah.SUBSUP||e===Zh.MUNDEROVER&&i===Ah.UNDEROVER}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){const t=this.semantic.childNodes[0],e=t.childNodes[0],i=this.semantic.childNodes[1],s=t.childNodes[1],r=Ju(i),n=Ju(e),o=Ju(s);return mu(this.mml,this.semantic),this.mml.setAttribute(du.CHILDREN,pu([e,s,i])),[n,o,r].forEach((t=>bp(t).setAttribute(du.PARENT,this.mml.getAttribute(du.ID)))),this.mml.setAttribute(du.TYPE,t.role),up(this.mml,[this.semantic.id,[t.id,e.id,s.id],i.id]),this.mml}}class Tp extends yp{static multiscriptIndex(t){return t.type===Ih.PUNCTUATED&&t.contentNodes[0].role===Ah.DUMMY&&t.hasAnnotation("general","script")?xp(t):(Ju(t),t.id)}static createNone_(t){const e=lh("none");return t&&mu(e,t),e.setAttribute(du.ADDED,"true"),e}constructor(t){super(t),this.mml=t.mathmlTree}completeMultiscript(t,e){const i=rh(this.mml.childNodes).slice(1);let s=0;const r=t=>{for(const e of t){const t=i[s];if(t&&e===parseInt(t.getAttribute(du.ID)))t.setAttribute(du.PARENT,this.semantic.id.toString()),s++;else if(t&&e===parseInt(bp(t).getAttribute(du.ID)))bp(t).setAttribute(du.PARENT,this.semantic.id.toString()),s++;else{const i=this.semantic.querySelectorAll((t=>t.id===e));this.mml.insertBefore(Tp.createNone_(i[0]),t||null)}}};r(t),i[s]&&dh(i[s])!==Zh.MPRESCRIPTS?this.mml.insertBefore(i[s],lh("mprescripts")):s++,r(e)}}class _p extends Tp{static test(t){if(!t.mathmlTree)return!1;return dh(t.mathmlTree)===Zh.MMULTISCRIPTS&&(t.type===Ih.SUPERSCRIPT||t.type===Ih.SUBSCRIPT)}constructor(t){super(t)}getMathml(){let t,e,i;if(mu(this.mml,this.semantic),this.semantic.childNodes[0]&&this.semantic.childNodes[0].role===Ah.SUBSUP){const s=this.semantic.childNodes[0];t=s.childNodes[0],e=Tp.multiscriptIndex(this.semantic.childNodes[1]),i=Tp.multiscriptIndex(s.childNodes[1]);const r=[this.semantic.id,[s.id,t.id,i],e];up(this.mml,r),this.mml.setAttribute(du.TYPE,s.role),this.completeMultiscript(gu.interleaveIds(i,e),[])}else{t=this.semantic.childNodes[0],e=Tp.multiscriptIndex(this.semantic.childNodes[1]);const i=[this.semantic.id,t.id,e];up(this.mml,i)}const s=gu.collapsedLeafs(i||[],e);return bp(Ju(t)).setAttribute(du.PARENT,this.semantic.id.toString()),s.unshift(t.id),this.mml.setAttribute(du.CHILDREN,s.join(",")),this.mml}}class Lp extends Tp{static test(t){return!!t.mathmlTree&&t.type===Ih.TENSOR}constructor(t){super(t)}getMathml(){Ju(this.semantic.childNodes[0]);const t=Tp.multiscriptIndex(this.semantic.childNodes[1]),e=Tp.multiscriptIndex(this.semantic.childNodes[2]),i=Tp.multiscriptIndex(this.semantic.childNodes[3]),s=Tp.multiscriptIndex(this.semantic.childNodes[4]);mu(this.mml,this.semantic);const r=[this.semantic.id,this.semantic.childNodes[0].id,t,e,i,s];up(this.mml,r);const n=gu.collapsedLeafs(t,e,i,s);return n.unshift(this.semantic.childNodes[0].id),this.mml.setAttribute(du.CHILDREN,n.join(",")),this.completeMultiscript(gu.interleaveIds(i,s),gu.interleaveIds(t,e)),this.mml}}class Cp extends yp{static test(t){return!(!t.mathmlTree||!t.fencePointer||t.mathmlTree.getAttribute("data-semantic-type"))}static makeEmptyNode_(t){const e=fu(),i=new gd(t);return i.type=Ih.EMPTY,i.mathmlTree=e,i}static fencedMap_(t,e){e[t.id]=t.mathmlTree,t.embellished&&Cp.fencedMap_(t.childNodes[0],e)}constructor(t){super(t),this.fenced=null,this.fencedMml=null,this.fencedMmlNodes=[],this.ofence=null,this.ofenceMml=null,this.ofenceMap={},this.cfence=null,this.cfenceMml=null,this.cfenceMap={},this.parentCleanup=[]}getMathml(){this.getFenced_(),this.fencedMml=Ju(this.fenced),this.getFencesMml_(),this.fenced.type!==Ih.EMPTY||this.fencedMml.parentNode||(this.fencedMml.setAttribute(du.ADDED,"true"),this.cfenceMml.parentNode.insertBefore(this.fencedMml,this.cfenceMml)),this.getFencedMml_();return this.rewrite_()}fencedElement(t){return t.type===Ih.FENCED||t.type===Ih.MATRIX||t.type===Ih.VECTOR}getFenced_(){let t=this.semantic;for(;!this.fencedElement(t);)t=t.childNodes[0];this.fenced=t.childNodes[0],this.ofence=t.contentNodes[0],this.cfence=t.contentNodes[1],Cp.fencedMap_(this.ofence,this.ofenceMap),Cp.fencedMap_(this.cfence,this.cfenceMap)}getFencedMml_(){let t=this.ofenceMml.nextSibling;for(t=t===this.fencedMml?t:this.fencedMml;t&&t!==this.cfenceMml;)this.fencedMmlNodes.push(t),t=t.nextSibling}getFencesMml_(){let t=this.semantic;const e=Object.keys(this.ofenceMap),i=Object.keys(this.cfenceMap);for(;!(this.ofenceMml&&this.cfenceMml||t===this.fenced);)-1===e.indexOf(t.fencePointer)||this.ofenceMml||(this.ofenceMml=t.mathmlTree),-1===i.indexOf(t.fencePointer)||this.cfenceMml||(this.cfenceMml=t.mathmlTree),t=t.childNodes[0];this.ofenceMml||(this.ofenceMml=this.ofence.mathmlTree),this.cfenceMml||(this.cfenceMml=this.cfence.mathmlTree),this.ofenceMml&&(this.ofenceMml=ap(this.ofenceMml)),this.cfenceMml&&(this.cfenceMml=ap(this.cfenceMml))}rewrite_(){let t=this.semantic,e=null;const i=this.introduceNewLayer_();for(mu(i,this.fenced.parent);!this.fencedElement(t);){const s=t.mathmlTree,r=this.specialCase_(t,s);if(r)t=r;else{mu(s,t);const e=[];for(let i,s=1;i=t.childNodes[s];s++)e.push(Ju(i));t=t.childNodes[0]}const n=lh("dummy"),o=s.childNodes[0];ah(s,n),ah(i,s),ah(s.childNodes[0],i),ah(n,o),e||(e=s)}return Ju(this.ofence),Ju(this.cfence),this.cleanupParents_(),e||i}specialCase_(t,e){const i=dh(e);let s,r=null;if(i===Zh.MSUBSUP?(r=t.childNodes[0],s=vp):i===Zh.MMULTISCRIPTS&&(t.type===Ih.SUPERSCRIPT||t.type===Ih.SUBSCRIPT?s=_p:t.type===Ih.TENSOR&&(s=Lp),r=s&&t.childNodes[0]&&t.childNodes[0].role===Ah.SUBSUP?t.childNodes[0]:t),!r)return null;const n=r.childNodes[0],o=Cp.makeEmptyNode_(n.id);return r.childNodes[0]=o,e=new s(t).getMathml(),r.childNodes[0]=n,this.parentCleanup.push(e),r.childNodes[0]}introduceNewLayer_(){const t=this.fullFence(this.ofenceMml),e=this.fullFence(this.cfenceMml);let i=fu();if(ah(this.fencedMml,i),this.fencedMmlNodes.forEach((t=>i.appendChild(t))),i.insertBefore(t,this.fencedMml),i.appendChild(e),!i.parentNode){const t=fu();for(;i.childNodes.length>0;)t.appendChild(i.childNodes[0]);i.appendChild(t),i=t}return i}fullFence(t){const e=this.fencedMml.parentNode;let i=t;for(;i.parentNode&&i.parentNode!==e;)i=i.parentNode;return i}cleanupParents_(){this.parentCleanup.forEach((function(t){const e=t.childNodes[1].getAttribute(du.PARENT);t.childNodes[0].setAttribute(du.PARENT,e)}))}}class Rp extends yp{static test(t){return!!t.mathmlTree&&t.hasAnnotation("Emph","top")}constructor(t){super(t),this.mrows=[],this.mml=t.mathmlTree}getMathml(){if(this.recurseToTable(this.semantic),this.mrows.length){const t=fu();this.mml.parentNode.insertBefore(t,this.mml);for(const e of this.mrows)t.appendChild(e);t.appendChild(this.mml)}return this.mml}recurseToTable(t){var e,i;if(t.hasAnnotation("Emph","top")||t.hasAnnotation("Emph","fence")||!t.hasAnnotation("Emph","left")&&!t.hasAnnotation("Emph","right")){if(!t.mathmlTree||dh(t.mathmlTree)===Zh.MTABLE&&(null===(e=t.annotation.Emph)||void 0===e?void 0:e.length)&&"table"!==t.annotation.Emph[0]){const e=fu();mu(e,t),this.mrows.unshift(e)}else{if(dh(t.mathmlTree)===Zh.MTABLE&&(null===(i=t.annotation.Emph)||void 0===i?void 0:i.length)&&"table"===t.annotation.Emph[0])return void this.finalizeTable(t);mu(t.mathmlTree,t)}if(t.childNodes.forEach(this.recurseToTable.bind(this)),t.textContent||"punctuated"===t.type){const e=t.contentNodes.map((t=>{const e=pp(t);return e.hasAttribute("data-semantic-added")?this.mrows.unshift(e):this.recurseToTable(t),e}));gp(t,e)}else t.contentNodes.forEach(this.recurseToTable.bind(this))}else Ju(t)}finalizeTable(t){mu(t.mathmlTree,t),t.contentNodes.forEach((t=>{Ju(t)})),t.childNodes.forEach((t=>{Ju(t)}))}}class wp extends yp{static test(t){if(!t.mathmlTree||!t.childNodes.length)return!1;const e=dh(t.mathmlTree),i=t.type;return(i===Ih.LIMUPPER||i===Ih.LIMLOWER)&&(e===Zh.MSUBSUP||e===Zh.MUNDEROVER)||i===Ih.LIMBOTH&&(e===Zh.MSUB||e===Zh.MUNDER||e===Zh.MSUP||e===Zh.MOVER)}static walkTree_(t){t&&Ju(t)}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){const t=this.semantic.childNodes;return this.semantic.type!==Ih.LIMBOTH&&this.mml.childNodes.length>=3&&(this.mml=Ku([this.mml],this.semantic)),mu(this.mml,this.semantic),t[0].mathmlTree||(t[0].mathmlTree=this.semantic.mathmlTree),t.forEach(wp.walkTree_),this.mml}}class Ip extends yp{static test(t){return!!t.mathmlTree&&t.type===Ih.LINE}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){return this.semantic.contentNodes.length&&Ju(this.semantic.contentNodes[0]),this.semantic.childNodes.length&&Ju(this.semantic.childNodes[0]),mu(this.mml,this.semantic),this.mml}}class Sp extends yp{static test(t){return!!t.mathmlTree&&(t.type===Ih.INFERENCE||t.type===Ih.PREMISES)}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){return this.semantic.childNodes.length?(this.semantic.contentNodes.forEach((function(t){Ju(t),mu(t.mathmlTree,t)})),this.semantic.childNodes.forEach((function(t){Ju(t)})),mu(this.mml,this.semantic),this.mml.getAttribute("data-semantic-id")===this.mml.getAttribute("data-semantic-parent")&&this.mml.removeAttribute("data-semantic-parent"),this.mml):this.mml}}class Ap extends yp{static test(t){return t.type===Ih.MATRIX||t.type===Ih.VECTOR||t.type===Ih.CASES}constructor(t){super(t),this.inner=[],this.mml=t.mathmlTree}getMathml(){const t=pp(this.semantic.contentNodes[0]),e=this.semantic.contentNodes[1]?pp(this.semantic.contentNodes[1]):null;if(this.inner=this.semantic.childNodes.map(Ju),this.mml)if(dh(this.mml)===Zh.MFENCED){const i=this.mml.childNodes;this.mml.insertBefore(t,i[0]||null),e&&this.mml.appendChild(e),this.mml=mp(this.mml)}else{const i=[t,this.mml];e&&i.push(e),this.mml=Ku(i,this.semantic)}else this.mml=Ku([t].concat(this.inner,[e]),this.semantic);return mu(this.mml,this.semantic),this.mml}}class Op extends yp{static test(t){return t.type===Ih.PUNCTUATED&&(t.role===Ah.TEXT||t.contentNodes.every((t=>t.role===Ah.DUMMY)))}constructor(t){super(t),this.mml=t.mathmlTree}getMathml(){const t=[],e=xp(this.semantic,t);return this.mml=Ku(t,this.semantic),mu(this.mml,this.semantic),this.mml.removeAttribute(du.CONTENT),up(this.mml,e),this.mml}}function Mp(t,e){const i=t.cloneNode(!0);return function(t,e,i){return Xc.getInstance().generate((()=>["Original MathML",Ep(t)])),Gu.clear(),Ju(e.root),i.structure&&t.setAttribute(du.STRUCTURE,gu.fromStructure(t,e,i).toString()),Xc.getInstance().generate((()=>["Semantic Tree\n",Ep(e),"Semantically enriched MathML\n",Ep(t)])),t}(i,Vu(i,e),e)}Xu.push({test:wp.test,constr:t=>new wp(t)},{test:Cp.test,constr:t=>new Cp(t)},{test:vp.test,constr:t=>new vp(t)},{test:Lp.test,constr:t=>new Lp(t)},{test:_p.test,constr:t=>new _p(t)},{test:Ip.test,constr:t=>new Ip(t)},{test:Np.test,constr:t=>new Np(t)},{test:Sp.test,constr:t=>new Sp(t)},{test:Rp.test,constr:t=>new Rp(t)},{test:Ap.test,constr:t=>new Ap(t)},{test:Op.test,constr:t=>new Op(t)});const kp=new Bc({AbsoluteValue:["Auto","AbsEnd","Cardinality","Determinant"],Bar:["Auto","Conjugate"],Caps:["Auto","SayCaps"],CombinationPermutation:["Auto","ChoosePermute"],Currency:["Auto","Position","Prefix"],Ellipses:["Auto","AndSoOn"],Enclosed:["Auto","EndEnclose"],Exponent:["Auto","AfterPower","Ordinal","OrdinalPower","Exponent"],Fraction:["Auto","EndFrac","FracOver","General","GeneralEndFrac","Ordinal","Over","OverEndFrac","Per"],Functions:["Auto","None","Reciprocal"],Inference:["Auto","Long"],ImpliedTimes:["Auto","MoreImpliedTimes","None"],Log:["Auto","LnAsNaturalLog"],Matrix:["Auto","Combinatoric","EndMatrix","EndVector","SilentColNum","SpeakColNum","Vector"],MultiLineLabel:["Auto","Case","Constraint","Equation","Line","None","Row","Step"],MultiLineOverview:["Auto","None"],MultiLinePausesBetweenColumns:["Auto","Long","Short"],MultsymbolDot:["Auto","Dot"],MultsymbolX:["Auto","By","Cross"],Paren:["Auto","CoordPoint","Interval","Silent","Speak","SpeakNestingLevel"],Prime:["Auto","Angle","Length"],Roots:["Auto","PosNegSqRoot","PosNegSqRootEnd","RootEnd"],SetMemberSymbol:["Auto","Belongs","Element","Member","In"],Sets:["Auto","SilentBracket","woAll"],TriangleSymbol:["Auto","Delta"],Trig:["Auto","ArcTrig","TrigInverse","Reciprocal"],VerticalLine:["Auto","Divides","Given","SuchThat"]}),Dp="Auto";function Pp(t){const e=t.split(":"),i={},s=kp.getProperties(),r=Object.keys(s);for(let t,n=0;t=e[n];n++){const e=t.split("_");if(-1===r.indexOf(e[0]))continue;const n=e[1];n&&n!==Dp&&-1!==s[e[0]].indexOf(n)&&(i[e[0]]=e[1])}return i}function Bp(t){const e=Object.keys(t),i=[];for(let s=0;s<e.length;s++)i.push(e[s]+"_"+t[e[s]]);return i.length?i.join(":"):jc.DEFAULT_VALUE}const jp=zc.u.LOCALES,Fp=t=>Yc.getInstance().setup(t),Up=()=>Yc.getInstance().json(),Hp=t=>function(t,e){const i=nh(t);try{return Mp(i,e)}catch(t){return console.error(t),i}}(t,Yc.getInstance().options),qp=nh,Wp=function(t,e,i){if("default"===t)return e+"_"+i;const s=Pp(t);return s[e]=i,Bp(s)},Vp=Pp,Xp=Bp;var zp=function(t,e,i,s){return new(i||(i=Promise))((function(r,n){function o(t){try{l(s.next(t))}catch(t){n(t)}}function a(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((s=s.apply(t,e||[])).next())}))};let Gp={},Jp=null;function Kp(t){var e,i;const s=null==t?void 0:t.match(/^clearspeak-(.*)/);return Jp=null!==(i=null!==(e=s&&s[1])&&void 0!==e?e:Jp)&&void 0!==i?i:"default",Jp}const $p=new Map;const Yp=new Map;let Qp=0;function Zp(t,e){const i=$p.get(e);!function(t,e){const i=t.pool.lookup("speechRules"),s=Kp(t.settings.speechRules);Gp=Vp(s);for(const s of e)t.factory.get("variable")(t.factory,{name:"csprf_"+s,setter:t=>{Gp[s]=t,i.setValue("clearspeak-"+Xp(Gp))},getter:()=>Gp[s]||"Auto"},t.pool)}(t,Object.keys(i));const s=[];for(const t of Object.getOwnPropertyNames(i))s.push({title:t,values:i[t].map((e=>e.replace(RegExp("^"+t+"_"),""))),variable:"csprf_"+t});const r=new Mc("Clearspeak Preferences","",s,"alphabetical","square",t);return{type:"command",id:"ClearspeakPreferences",content:"Select Preferences",action:()=>r.post()}}function tm(t,e,i){return zp(this,void 0,void 0,(function*(){var s,r;const n=s=>{i(t.factory.get("subMenu")(t.factory,{items:s,id:"Clearspeak"},e))};if(!t.settings.speech||!t.settings.enrich)return void n([]);const o=t.pool.lookup("locale").getValue();if(yield function(t,e){return zp(this,void 0,void 0,(function*(){$p.has(e)||(yield t.mathItem.generatorPool.getLocalePreferences($p))}))}(t,o),!$p.get(o))return void n([]);const a=Zp(t,o);let l=[];if(t.settings.speech){const e=t.mathItem,i=null===(s=null==e?void 0:e.explorers)||void 0===s?void 0:s.speech,n=Kp(t.settings.speechRules);l=l.concat(function(t){return[{type:"radio",content:"No Preferences",id:"clearspeak-default",variable:"speechRules"},{type:"radio",content:"Current Preferences",id:"clearspeak-"+t,variable:"speechRules"},{type:"rule"}]}(n));const a=null==i?void 0:i.refocus,c=null!==(r=null==a?void 0:a.getAttribute("data-semantic-id"))&&void 0!==r?r:null,h=Qp++;yield e.generatorPool.getRelevantPreferences(e,c,Yp,h);const d=Yp.get(h);if(Yp.delete(h),d){const t=function(t,e,i){const s=$p.get(i);return[{type:"label",content:"Preferences for "+e},{type:"rule"}].concat(s[e].map((function(e){const[i,s]=e.split("_");return{type:"radioCompare",content:s,id:"clearspeak-"+Wp(t,i,s),variable:"speechRules",comparator:(t,e)=>{if(t===e)return!0;if("Auto"!==s)return!1;const[r,n]=t.split("-"),[o]=e.split("-");return r===o&&!Vp(n)[i]}}})))}(n,d,o);l=l.concat(t)}}l.splice(2,0,a),n(l)}))}Oc.DynamicSubmenus.set("Clearspeak",[tm,"speech"]);let em=null;function im(t,e,i){if(em)return void i(em);const s=[];for(const t of jp.keys())"nemeth"!==t&&"euro"!==t&&s.push({type:"radio",id:t,content:jp.get(t)||t,variable:"locale"});s.sort(((t,e)=>t.content.localeCompare(e.content,"en"))),em=t.factory.get("subMenu")(t.factory,{items:s,id:"Language"},e),i(em)}Oc.DynamicSubmenus.set("A11yLanguage",[im,"speech"]);const sm="MacOS"===Ri.os;function rm(t){const e=Ri.document,i=e.createElement("textarea");i.value=t,i.setAttribute("readonly",""),i.style.cssText="height: 1px; width: 1px; padding: 1px; position: absolute; left: -10px",e.body.appendChild(i),i.select();try{e.execCommand("copy")}catch(t){alert(`Can't copy to clipboard: ${t.message}`)}e.body.removeChild(i)}function nm(t,e,i){return(s,r,n)=>{!function(t,e,i){if(!t)return;for(const s of t.childNodes)if(s.isKind("annotation")){const t=am(s,e);if(t){const e=s.childNodes.reduce(((t,e)=>t+e.toString()),"");i.push([t,e])}}}(function(t){var e;let i=null===(e=t.mathItem)||void 0===e?void 0:e.root;for(;i&&!i.isKind("semantics");){if(i.isToken||1!==i.childNodes.length)return null;i=i.childNodes[0]}return i}(s),e,i),n(cm(s,r,i,t))}}function om(t){return(e,i,s)=>{const r=t.slice();t.length=0,s(cm(e,i,r,(()=>rm(lm.trim()))))}}function am(t,e){const i=t.attributes.get("encoding");for(const t of Object.keys(e))if(e[t].includes(i))return t;return null}let lm="";function cm(t,e,i,s){return t.factory.get("subMenu")(t.factory,{items:i.map((([t,e])=>({type:"command",id:t,content:t,action:()=>{lm=e,s()}}))),id:"annotations"},e)}class hm extends Ln{static post(t){return super.post(t)}html(t){var e;null!==(e=t.extraNodes)&&void 0!==e||(t.extraNodes=[]);const i=t.adaptor.node("input",{type:"button",value:"Copy to Clipboard","data-drag":"none"});return i.addEventListener("click",this.copyToClipboard.bind(this)),t.extraNodes.push(i),t.code&&(t.message="<pre>"+this.formatSource(t.message)+"</pre>"),super.html(t)}formatSource(t){return t.trim().replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}}class dm extends uc{static fromJson(t,{content:e,variable:i,id:s,comparator:r},n){return new this(n,e,i,s,r)}constructor(t,e,i,s,r){super(t,e,i,s),this.comparator=r,this.role="menuitemradiocompare"}updateAria(){this.html.setAttribute("aria-checked",this.comparator(this.variable.getValue(),this.id)?"true":"false")}updateSpan(){this.span.style.display=this.comparator(this.variable.getValue(),this.id)?"":"none"}}class um extends dn{constructor(){super(...arguments),this.options={filterSRE:!0,filterTex:!0,texHints:!0,semantics:!1},this.mathItem=null}visitTree(t,e=null,i={}){return this.mathItem=e,Yi(this.options,i),this.visitNode(t,"")}visitTeXAtomNode(t,e){return this.options.texHints?super.visitDefault(t,e):t.childNodes[0]&&1===t.childNodes[0].childNodes.length?this.visitNode(t.childNodes[0],e):`${e}<mrow${this.getAttributes(t)}>\n`+this.childNodeMml(t,e+" ","\n")+`${e}</mrow>`}visitMathNode(t,e){if(!this.options.semantics||"TeX"!==this.mathItem.inputJax.name)return super.visitDefault(t,e);const i=t.childNodes.length&&t.childNodes[0].childNodes.length>1;return`${e}<math${this.getAttributes(t)}>\n${e} <semantics>\n`+(i?e+" <mrow>\n":"")+this.childNodeMml(t,e+(i?" ":" "),"\n")+(i?e+" </mrow>\n":"")+`${e} <annotation encoding="application/x-tex">`+this.mathItem.math+`</annotation>\n${e} </semantics>\n${e}</math>`}getAttributeList(t){const e=super.getAttributeList(t);if(this.options.filterTex&&(delete e["data-latex"],delete e["data-latex-item"]),this.options.filterSRE){const t=Object.keys(e).filter((t=>t.match(/^(?:data-semantic-.*?|data-speech-node|role|aria-(?:level|posinset|setsize|owns))$/)));for(const i of t)delete e[i]}return e}}var pm=function(t,e,i,s){return new(i||(i=Promise))((function(r,n){function o(t){try{l(s.next(t))}catch(t){n(t)}}function a(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((s=s.apply(t,e||[])).next())}))};const mm=Li;class fm{get isLoading(){return fm.loading>0}get loadingPromise(){return this.isLoading?(fm._loadingPromise||(fm._loadingPromise=new Promise(((t,e)=>{fm._loadingOK=t,fm._loadingFailed=e}))),fm._loadingPromise):Promise.resolve()}about(){const t=[];if(t.push("Input Jax: "+this.document.inputJax.map((t=>t.name)).join(", ")),t.push("Output Jax: "+this.document.outputJax.name),t.push("Document Type: "+this.document.kind),mm&&mm.loader){t.push("<hr/>Modules Loaded:");const e=mm._.components.package.Package,i=mm.loader.versions;for(const s of Array.from(e.packages.keys()).sort(this.sortPackages)){const r=i.get(e.resolvePath(s));r&&t.push(`    ${s} <mjx-v>(${r})</mjx-v>`)}}Ln.post({title:"MathJax <mjx-v>v"+mn.version+"</mjx-v>",message:t.join("<br/>"),adaptor:this.document.adaptor,styles:{".mjx-dialog":{"max-height":"calc(min(20em, 85%))"},"mjx-dialog > div":{"white-space":"nowrap"},"dialog.mjx-dialog-help > mjx-dialog > div":{"white-space":"normal"},"mjx-v":{"font-size":"80%"}},extraNodes:[this.document.adaptor.node("a",{href:"https://www.mathjax.org","data-drag":"false"},[this.document.adaptor.text("https://www.mathjax.org")])]})}sortPackages(t,e){const[i,s]=t.includes("/")?t.split(/\//):["",t],[r,n]=e.includes("/")?e.split(/\//):["",e];return i===r?s<n?-1:1:"["===i.charAt(0)?"["===r.charAt(0)&&i<r?-1:1:"["===r.charAt(0)||i<r?-1:1}help(){Ln.post({title:"MathJax Help",message:["<p><b>MathJax</b> is a JavaScript library that allows page"," authors to include mathematics within their web pages."," As a reader, you don't need to do anything to make that happen.</p>","<p><b>Browsers</b>: MathJax works with all modern browsers including"," Edge, Firefox, Chrome, Safari, Opera, and most mobile browsers.</p>","<p><b>Math Menu</b>: MathJax adds a contextual menu to equations."," Right-click or CTRL-click on any mathematics to access the menu.</p>",'<div style="margin-left: 1em;">',"<p><b>Show Math As:</b> These options allow you to view the formula's"," source markup (as MathML or in its original format).</p>","<p><b>Copy to Clipboard:</b> These options copy the formula's source markup,"," as MathML or in its original format, to the clipboard"," (in browsers that support that).</p>","<p><b>Math Settings:</b> These give you control over features of MathJax,"," such the size of the mathematics, the mechanism used to display equations,"," how to handle equations that are too wide, and the language to use for"," MathJax's menus and error messages (not yet implemented in v4).","</p>","<p><b>Accessibility</b>: MathJax can work with screen"," readers to make mathematics accessible to the visually impaired."," Turn on speech or braille generation to enable creation of speech strings"," and the ability to investigate expressions interactively. You can control"," the style of the explorer in its menu.</p>","</div>","<p><b>Math Zoom</b>: If you are having difficulty reading an"," equation, MathJax can enlarge it to help you see it better, or"," you can scale all the math on the page to make it larger."," Turn these features on in the <b>Math Settings</b> menu.</p>","<p><b>Preferences</b>: MathJax uses your browser's localStorage database"," to save the preferences set via this menu locally in your browser. These"," are not used to track you, and are not transferred or used remotely by"," MathJax in any way.</p>"].join("\n"),adaptor:this.document.adaptor,extraNodes:[this.document.adaptor.node("a",{href:"https://www.mathjax.org","data-drag":"none"},[this.document.adaptor.text("https://www.mathjax.org")])]})}mathMLCode(){hm.post({title:"MathJax MathML Expression",message:this.menu.mathItem?this.toMML(this.menu.mathItem):"",adaptor:this.document.adaptor,code:!0})}originalText(){var t,e;hm.post({title:"MathJax Original Source",message:null!==(e=null===(t=this.menu.mathItem)||void 0===t?void 0:t.math)&&void 0!==e?e:"",adaptor:this.document.adaptor,code:!0})}annotationBox(){hm.post({title:"MathJax Annotation Text",message:lm,adaptor:this.document.adaptor,code:!0})}svgImage(){return pm(this,void 0,void 0,(function*(){hm.post({title:"MathJax SVG Image",message:yield this.toSVG(this.menu.mathItem),adaptor:this.document.adaptor,code:!0})}))}speechText(){var t,e,i;hm.post({title:"MathJax Speech Text",message:null!==(i=null===(e=null===(t=this.menu.mathItem)||void 0===t?void 0:t.outputData)||void 0===e?void 0:e.speech)&&void 0!==i?i:"",adaptor:this.document.adaptor,code:!0})}brailleText(){var t,e,i;hm.post({title:"MathJax Braille Text",message:null!==(i=null===(e=null===(t=this.menu.mathItem)||void 0===t?void 0:t.outputData)||void 0===e?void 0:e.braille)&&void 0!==i?i:"",adaptor:this.document.adaptor,code:!0})}errorMessage(){hm.post({title:"MathJax Error Message",message:this.menu.mathItem?this.menu.errorMsg:"",adaptor:this.document.adaptor,code:!0})}zoomBox(){let t="";if(this.menu.mathItem){const e=this.menu.mathItem.typesetRoot,i=this.document.adaptor.fontSize(e),s=e.cloneNode(!0);s.style.margin="0";t=`<div style="font-size: ${i*parseFloat(this.settings.zscale)/100}px">${s.outerHTML}</div>`}Ln.post({title:"MathJax Zoomed Expression",message:t,adaptor:this.document.adaptor,styles:{"mjx-dialog > div":{padding:"1.8em"}}})}constructor(t,e={}){this.settings=null,this.defaultSettings=null,this.menu=null,this.current=null,this.MmlVisitor=new um,this.jax={CHTML:null,SVG:null},this.rerenderStart=Ns.LAST,this.requiredExtensions=[],this.document=t,this.options=Yi($i({},this.constructor.OPTIONS),e),this.initSettings(),this.mergeUserSettings(),this.initMenu(),this.applySettings()}initSettings(){var t;this.settings=this.options.settings,this.jax=this.options.jax;const e=this.document.outputJax;this.jax[e.name]=e,this.settings.renderer=e.name,this.settings.scale=e.options.scale,e.options.displayOverflow&&(this.settings.overflow=e.options.displayOverflow.substring(0,1).toUpperCase()+e.options.displayOverflow.substring(1).toLowerCase()),this.settings.breakInline=null===(t=e.options.linebreaks)||void 0===t?void 0:t.inline,this.defaultSettings=Object.assign({},this.document.options.a11y,this.settings),this.setA11y({roleDescription:this.settings.roleDescription})}initMenu(){const t=new Cc([["contextMenu",Oc.fromJson.bind(Oc)],["radioCompare",dm.fromJson.bind(dm)]]);this.menu=t.parse({type:"contextMenu",id:"MathJax_Menu",pool:[this.variable("showSRE"),this.variable("showTex"),this.variable("texHints"),this.variable("semantics"),this.variable("zoom"),this.variable("zscale"),this.variable("renderer",(t=>this.setRenderer(t))),this.variable("overflow",(t=>this.setOverflow(t))),this.variable("breakInline",(t=>this.setInlineBreaks(t))),this.variable("alt"),this.variable("cmd"),this.variable("ctrl"),this.variable("shift"),this.variable("scale",(t=>this.setScale(t))),this.a11yVar("speech",(t=>this.setSpeech(t))),this.a11yVar("braille",(t=>this.setBraille(t))),this.variable("brailleCode",(t=>this.setBrailleCode(t))),this.a11yVar("brailleSpeech",(t=>this.setBrailleSpeech(t))),this.a11yVar("brailleCombine",(t=>this.setBrailleCombine(t))),this.a11yVar("highlight",(t=>this.setHighlight(t))),this.a11yVar("backgroundColor",(t=>this.setColor("bg",t))),this.a11yVar("backgroundOpacity",(t=>this.setColor("bg",null,t))),this.a11yVar("foregroundColor",(t=>this.setColor("fg",t))),this.a11yVar("foregroundOpacity",(t=>this.setColor("fg",null,t))),this.a11yVar("subtitles"),this.a11yVar("viewBraille"),this.a11yVar("voicing"),this.a11yVar("roleDescription",(()=>this.setRoleDescription())),this.a11yVar("help"),this.a11yVar("locale",(t=>this.setLocale(t))),this.variable("speechRules",(t=>{const[e,i]=t.split("-");this.document.options.sre.domain=e,this.document.options.sre.style=i,this.rerender(Ns.COMPILED)})),this.a11yVar("magnification"),this.a11yVar("magnify"),this.a11yVar("treeColoring"),this.a11yVar("infoType"),this.a11yVar("infoRole"),this.a11yVar("infoPrefix"),this.variable("autocollapse"),this.variable("collapsible",(t=>this.setCollapsible(t))),this.variable("enrich",(t=>this.setEnrichment(t))),this.variable("inTabOrder",(t=>this.setTabOrder(t))),this.a11yVar("tabSelects"),this.variable("assistiveMml",(t=>this.setAssistiveMml(t)))],items:[this.submenu("Show","Show Math As",[this.command("MathMLcode","MathML Code",(()=>this.mathMLCode())),this.command("Original","Original Form",(()=>this.originalText())),this.rule(),this.command("Speech","Speech Text",(()=>this.speechText()),{disabled:!0}),this.command("Braille","Braille Code",(()=>this.brailleText()),{disabled:!0}),this.command("SVG","SVG Image",(()=>this.svgImage()),{disabled:!0}),this.submenu("ShowAnnotation","Annotation"),this.rule(),this.command("Error","Error Message",(()=>this.errorMessage()),{disabled:!0})]),this.submenu("Copy","Copy to Clipboard",[this.command("MathMLcode","MathML Code",(()=>this.copyMathML())),this.command("Original","Original Form",(()=>this.copyOriginal())),this.rule(),this.command("Speech","Speech Text",(()=>this.copySpeechText()),{disabled:!0}),this.command("Braille","Braille Code",(()=>this.copyBrailleText()),{disabled:!0}),this.command("SVG","SVG Image",(()=>this.copySvgImage()),{disabled:!0}),this.submenu("CopyAnnotation","Annotation"),this.rule(),this.command("Error","Error Message",(()=>this.copyErrorMessage()),{disabled:!0})]),this.rule(),this.submenu("Settings","Math Settings",[this.submenu("Renderer","Math Renderer",this.radioGroup("renderer",[["CHTML"],["SVG"]])),this.submenu("Overflow","Wide Expressions",[this.radioGroup("overflow",[["Overflow"],["Scroll"],["Linebreak"],["Scale"],["Truncate"],["Elide"]]),this.rule(),this.checkbox("BreakInline","Allow In-line Breaks","breakInline")]),this.rule(),this.submenu("MathmlIncludes","MathML/SVG has",[this.checkbox("showSRE","Semantic attributes","showSRE"),this.checkbox("showTex","LaTeX attributes","showTex"),this.checkbox("texHints","TeX hints","texHints"),this.checkbox("semantics","Original as annotation","semantics")]),this.submenu("Language","Language"),this.rule(),this.submenu("ZoomTrigger","Zoom Trigger",[this.command("ZoomNow","Zoom Once Now",(()=>this.zoom(null,""))),this.rule(),this.radioGroup("zoom",[["Click"],["DoubleClick","Double-Click"],["NoZoom","No Zoom"]]),this.rule(),this.label("TriggerRequires","Trigger Requires:"),this.checkbox(sm?"Option":"Alt",sm?"Option":"Alt","alt"),this.checkbox("Command","Command","cmd",{hidden:!sm}),this.checkbox("Control","Control","ctrl",{hidden:sm}),this.checkbox("Shift","Shift","shift")]),this.submenu("ZoomFactor","Zoom Factor",this.radioGroup("zscale",[["150%"],["175%"],["200%"],["250%"],["300%"],["400%"]])),this.rule(),this.command("Scale","Scale All Math...",(()=>this.scaleAllMath())),this.rule(),this.command("Reset","Reset to defaults",(()=>this.resetDefaults()))]),this.rule(),this.label("Accessibility","\xa0\xa0 Accessibility:"),this.submenu("Speech","\xa0 \xa0 Speech",[this.checkbox("Generate","Generate","speech"),this.checkbox("Subtitles","Show Subtitles","subtitles"),this.checkbox("Auto Voicing","Auto Voicing","voicing"),this.rule(),this.label("Rules","Rules:"),this.submenu("Mathspeak","Mathspeak",this.radioGroup("speechRules",[["mathspeak-default","Verbose"],["mathspeak-brief","Brief"],["mathspeak-sbrief","Superbrief"]])),this.submenu("Clearspeak","Clearspeak",this.radioGroup("speechRules",[["clearspeak-default","Auto"]])),this.rule(),this.submenu("A11yLanguage","Language")]),this.submenu("Braille","\xa0 \xa0 Braille",[this.checkbox("Generate","Generate","braille"),this.checkbox("Subtitles","Show Subtitles","viewBraille"),this.checkbox("BrailleSpeech","Replace Speech","brailleSpeech",{hidden:!0}),this.checkbox("BrailleCombine","Combine with Speech","brailleCombine"),this.rule(),this.label("Code","Code Format:"),this.radioGroup("brailleCode",[["nemeth","Nemeth"],["ueb","UEB"],["euro","Euro"]])]),this.submenu("Explorer","\xa0 \xa0 Explorer",[this.submenu("Highlight","Highlight",[this.submenu("Background","Background",this.radioGroup("backgroundColor",[["Blue"],["Red"],["Green"],["Yellow"],["Cyan"],["Magenta"],["White"],["Black"]])),{type:"slider",variable:"backgroundOpacity",content:" "},this.submenu("Foreground","Foreground",this.radioGroup("foregroundColor",[["Black"],["White"],["Magenta"],["Cyan"],["Yellow"],["Green"],["Red"],["Blue"]])),{type:"slider",variable:"foregroundOpacity",content:" "},this.rule(),this.radioGroup("highlight",[["None"],["Hover"],["Flame"]]),this.rule(),this.checkbox("TreeColoring","Tree Coloring","treeColoring")]),this.submenu("Magnification","Magnification",[this.radioGroup("magnification",[["None"],["Keyboard"],["Mouse"]]),this.rule(),this.radioGroup("magnify",[["200%"],["300%"],["400%"],["500%"]])]),this.submenu("Semantic Info","Semantic Info",[this.checkbox("Type","Type","infoType"),this.checkbox("Role","Role","infoRole"),this.checkbox("Prefix","Prefix","infoPrefix")]),this.rule(),this.submenu("Role Description","Describe math as",[this.radioGroup("roleDescription",[["MathJax expression"],["MathJax"],["math"],["clickable math"],["explorable math"],["none"]])]),this.checkbox("Math Help","Help message on focus","help")]),this.submenu("Options","\xa0 \xa0 Options",[this.checkbox("Enrich","Semantic Enrichment","enrich"),this.checkbox("Collapsible","Collapsible Math","collapsible"),this.checkbox("AutoCollapse","Auto Collapse","autocollapse",{disabled:!0}),this.rule(),this.checkbox("InTabOrder","Include in Tab Order","inTabOrder"),this.submenu("TabSelects","Tabbing Focuses on",[this.radioGroup("tabSelects",[["all","Whole Expression"],["last","Last Explored Node"]])]),this.rule(),this.checkbox("AssistiveMml","Include Hidden MathML","assistiveMml")]),this.rule(),this.command("About","About MathJax",(()=>this.about())),this.command("Help","MathJax Help",(()=>this.help()))]});const e=this.menu;e.settings=this.settings,e.findID("Settings","Overflow","Elide").disable(),e.findID("Braille","ueb").hide(),e.setJax(this.jax),this.checkLoadableItems();const i=[];Oc.DynamicSubmenus.set("ShowAnnotation",[nm((()=>this.annotationBox()),this.options.annotationTypes,i),""]),Oc.DynamicSubmenus.set("CopyAnnotation",[om(i),""]),function(t){Ac(Object.assign(Object.assign({},Ic),Sc),t)}(this.document.document)}checkLoadableItems(){var t,e,i,s,r,n;if(mm&&mm._&&mm.loader&&mm.startup){const o=this.settings,a=this.document.options;(o.enrich||o.speech&&a.enableSpeech||o.braille&&a.enableBraille)&&!(null===(e=null===(t=mm._)||void 0===t?void 0:t.a11y)||void 0===e?void 0:e.explorer)&&this.loadA11y("explorer"),o.collapsible&&!(null===(s=null===(i=mm._)||void 0===i?void 0:i.a11y)||void 0===s?void 0:s.complexity)&&this.loadA11y("complexity"),o.assistiveMml&&!(null===(n=null===(r=mm._)||void 0===r?void 0:r.a11y)||void 0===n?void 0:n["assistive-mml"])&&this.loadA11y("assistive-mml")}else{const t=this.menu;for(const e of Object.keys(this.jax))this.jax[e]||t.findID("Settings","Renderer",e).disable();t.findID("Speech").disable(),t.findID("Braille").disable(),t.findID("Explorer").disable(),t.findID("Options","AutoCollapse").disable(),t.findID("Options","Collapsible").disable(),t.findID("Options","Enrich").disable(),t.findID("Options","AssistiveMml").disable()}}enableAccessibilityItems(t,e){const i=this.menu.findID(t).submenu;for(const t of i.items.slice(1))t instanceof pc||(!e||t instanceof nc&&!t.submenu.items.length?t.disable():t.enable())}mergeUserSettings(){try{const t=localStorage.getItem(fm.MENU_STORAGE);if(!t)return;Object.assign(this.settings,JSON.parse(t)),this.setA11y(this.settings)}catch(t){console.log("MathJax localStorage error: "+t.message)}}saveUserSettings(){const t={};for(const e of Object.keys(this.settings))this.settings[e]!==this.defaultSettings[e]&&(t[e]=this.settings[e]);try{Object.keys(t).length?localStorage.setItem(fm.MENU_STORAGE,JSON.stringify(t)):localStorage.removeItem(fm.MENU_STORAGE)}catch(t){console.log("MathJax localStorage error: "+t.message)}}setA11y(t){var e,i;(null===(i=null===(e=mm._)||void 0===e?void 0:e.a11y)||void 0===i?void 0:i.explorer)&&mm._.a11y.explorer_ts.setA11yOptions(this.document,t)}getA11y(t){var e,i;if(null===(i=null===(e=mm._)||void 0===e?void 0:e.a11y)||void 0===i?void 0:i.explorer)return void 0!==this.document.options.a11y[t]?this.document.options.a11y[t]:this.document.options.sre[t]}applySettings(){this.setTabOrder(this.settings.inTabOrder);this.document.options.enableAssistiveMml=this.settings.assistiveMml,this.enableAccessibilityItems("Speech",this.settings.speech),this.enableAccessibilityItems("Braille",this.settings.braille),this.setAccessibilityMenus();const t=this.settings.renderer.replace(/[^a-zA-Z0-9]/g,"")||"CHTML";(fm._loadingPromise||Promise.resolve()).then((()=>{const e=this.settings,i=this.document.outputJax.options;if(i.scale=parseFloat(e.scale),i.displayOverflow=e.overflow.toLowerCase(),i.linebreaks&&(i.linebreaks.inline=e.breakInline),!e.speechRules){const t=this.document.options.sre;e.speechRules=`${t.domain||"clearspeak"}-${t.style||"default"}`}t!==this.defaultSettings.renderer&&this.document.whenReady((()=>this.setRenderer(t,!1)))}))}setOverflow(t){this.document.outputJax.options.displayOverflow=t.toLowerCase(),fm.loading||this.document.rerenderPromise()}setInlineBreaks(t){this.document.outputJax.options.linebreaks.inline=t,fm.loading||this.document.rerenderPromise()}setScale(t){this.document.outputJax.options.scale=parseFloat(t),fm.loading||this.document.rerenderPromise()}setRenderer(t,e=!0){if(Object.hasOwn(this.jax,t)&&this.jax[t])return this.setOutputJax(t,e);const i=t.toLowerCase();return new Promise(((s,r)=>{this.loadComponent("output/"+i,(()=>{const n=mm.startup;if(!(i in n.constructors))return r(new Error(`Component ${i} not loaded`));n.useOutput(i,!0),n.output=n.getOutputJax(),n.output.setAdaptor(this.document.adaptor),n.output.initialize(),this.jax[t]=n.output,this.setOutputJax(t,e).then((()=>s())).catch((t=>r(t)))}))}))}setOutputJax(t,e=!0){this.jax[t].setAdaptor(this.document.adaptor),this.document.outputJax=this.jax[t];const i=this.loadRequiredExtensions();return e?i.then((()=>mn.handleRetriesFor((()=>this.rerender())))):i.then((()=>{}))}loadRequiredExtensions(){const t=this.document.outputJax.name.toLowerCase(),e=[];for(const i of this.requiredExtensions)e.push(mm.loader.load(`[${i}]/${t}`));return this.requiredExtensions=[],Promise.all(e)}addRequiredExtensions(t){if(t){const e=new Set([...this.requiredExtensions,...t]);this.requiredExtensions=[...e]}}setTabOrder(t){const e=this.menu.findID("Options","TabSelects");t?e.enable():e.disable(),this.menu.store.inTaborder(t)}setAssistiveMml(t){var e,i;this.document.options.enableAssistiveMml=t,t&&this.noRerender((()=>{this.settings.speech&&this.menu.pool.lookup("speech").setValue(!1),this.settings.braille&&this.menu.pool.lookup("braille").setValue(!1)})),!t||(null===(i=null===(e=mm._)||void 0===e?void 0:e.a11y)||void 0===i?void 0:i["assistive-mml"])?this.rerender():this.loadA11y("assistive-mml")}setAccessibilityMenus(){const t=this.settings.enrich,e=t?"enable":"disable";["Speech","Braille","Explorer"].forEach((t=>this.menu.findID(t)[e]()));const i=this.document.options;i.enableSpeech=i.enableBraille=i.enableExplorer=t,t||(this.settings.collapsible=!1,this.document.options.enableCollapsible=!1)}setSpeech(t){var e,i;this.enableAccessibilityItems("Speech",t),this.document.options.enableSpeech=t,t&&(this.settings.assistiveMml&&this.noRerender((()=>this.menu.pool.lookup("assistiveMml").setValue(!1))),this.settings.brailleSpeech&&this.noRerender((()=>this.menu.pool.lookup("brailleSpeech").setValue(!1)))),!t||(null===(i=null===(e=mm._)||void 0===e?void 0:e.a11y)||void 0===i?void 0:i.explorer)?this.rerender(Ns.COMPILED):this.loadA11y("explorer")}setBraille(t){var e,i;this.enableAccessibilityItems("Braille",t),this.document.options.enableBraille=t,t&&this.settings.assistiveMml&&this.noRerender((()=>this.menu.pool.lookup("assistiveMml").setValue(!1))),!t||(null===(i=null===(e=mm._)||void 0===e?void 0:e.a11y)||void 0===i?void 0:i.explorer)?this.rerender(Ns.COMPILED):this.loadA11y("explorer")}setBrailleCode(t){this.document.options.sre.braille=t,this.rerender(Ns.COMPILED)}setBrailleSpeech(t){t&&this.settings.speech?this.noRerender((()=>this.menu.pool.lookup("speech").setValue(!1))):this.enableAccessibilityItems("Speech",!0),this.settings.brailleCombine=this.document.options.a11y.brailleCombine=!1,this.rerender(Ns.COMPILED)}setBrailleCombine(t){this.settings.brailleSpeech&&this.menu.pool.lookup("brailleSpeech").setValue(!1),this.settings.brailleSpeech=this.document.options.a11y.brailleSpeech=!1,this.rerender(Ns.COMPILED)}setLocale(t){this.document.options.sre.locale=t,this.rerender(Ns.COMPILED)}setRoleDescription(){this.rerender(Ns.COMPILED)}setEnrichment(t){var e,i;this.document.options.enableEnrichment=t,this.setAccessibilityMenus(),!t||(null===(i=null===(e=mm._)||void 0===e?void 0:e.a11y)||void 0===i?void 0:i.explorer)?this.rerender(Ns.COMPILED):this.loadA11y("explorer")}setCollapsible(t){var e,i;this.document.options.enableComplexity=t,t&&!this.settings.enrich&&(this.settings.enrich=this.document.options.enableEnrichment=!0,this.setAccessibilityMenus()),t||this.menu.pool.lookup("highlight").setValue("None"),!t||(null===(i=null===(e=mm._)||void 0===e?void 0:e.a11y)||void 0===i?void 0:i.complexity)?this.rerender(Ns.COMPILED):this.loadA11y("complexity")}setHighlight(t){var e,i;if("None"!==t){if(!this.settings.collapsible){const t=this.menu.pool.lookup("collapsible");t.setValue(!0),null===(i=null===(e=t.items[0])||void 0===e?void 0:e.executeCallbacks_)||void 0===i||i.call(e)}fm.loadingPromises.has("a11y/complexity")||this.rerender(Ns.COMPILED)}}setColor(t,e,i){const s=this.document.options.a11y;e||(e=s["fg"===t?"foregroundColor":"backgroundColor"]),i||(i=s["fg"===t?"foregroundOpacity":"backgroundOpacity"]),mm._.a11y.explorer.Region.LiveRegion.setColor(t,1,e.toLowerCase(),parseInt(i)/100)}scaleAllMath(){const t=(100*parseFloat(this.settings.scale)).toFixed(1).replace(/.0$/,""),e=prompt("Scale all mathematics (compared to surrounding text) by",t+"%");if(this.current){const t=this.menu.mathItem.explorers.speech;t.refocus=this.current,t.focus()}if(e)if(e.match(/^\s*\d+(\.\d*)?\s*%?\s*$/)){const t=parseFloat(e)/100;t?this.menu.pool.lookup("scale").setValue(String(t)):alert("The scale should not be zero")}else alert("The scale should be a percentage (e.g., 120%)")}resetDefaults(){this.noRerender((()=>{const t=this.menu.pool,e=this.defaultSettings;for(const i of Object.keys(e)){const s=t.lookup(i);if(s){if(s.getValue()!==e[i]){s.setValue(e[i]);const t=s.items[0];t&&t.executeCallbacks_()}}else Object.hasOwn(this.settings,i)&&(this.settings[i]=e[i])}})),this.rerender(Ns.COMPILED)}checkComponent(t){const e=fm.loadingPromises.get(t);e&&mn.retryAfter(e)}loadComponent(t,e){if(fm.loadingPromises.has(t))return;const i=mm.loader;if(!i)return;fm.loading++;const s=i.load(t).then((()=>{fm.loading--,fm.loadingPromises.delete(t),0===fm.loading&&fm._loadingPromise&&(fm._loadingPromise=null,fm._loadingOK()),e()})).catch((t=>{fm._loadingPromise?(fm._loadingPromise=null,fm._loadingFailed(t)):console.log(t)}));fm.loadingPromises.set(t,s)}loadA11y(t){const e=!Ns.ENRICHED;this.loadComponent("a11y/"+t,(()=>{var i,s;const r=mm.startup;mn.handlers.unregister(r.handler),r.handler=r.getHandler(),mn.handlers.register(r.handler);const n=this.document;this.document=r.document=r.getDocument(),this.document.processed=n.processed,this.document.menu=this,n.webworker&&(this.document.webworker=n.webworker),this.setA11y(this.settings),this.defaultSettings=Object.assign({},this.document.options.a11y,(null===(s=null===(i=mm.config)||void 0===i?void 0:i.options)||void 0===s?void 0:s.a11y)||{},this.defaultSettings),this.document.outputJax.reset(),this.transferMathList(n),this.document.processed=n.processed,fm._loadingPromise||(this.document.outputJax.reset(),mn.handleRetriesFor((()=>{this.rerender("complexity"===t||e?Ns.COMPILED:Ns.TYPESET)})))}))}transferMathList(t){const e=this.document.options.MathItem;for(const i of t.math){const t=new e;Object.assign(t,i),this.document.math.push(t)}}toMML(t){return this.MmlVisitor.visitTree(t.root,t,{filterSRE:!this.settings.showSRE,filterTex:!this.settings.showTex,texHints:this.settings.texHints,semantics:this.settings.semantics&&"MathML"!==t.inputJax.name})}toSVG(t){return pm(this,void 0,void 0,(function*(){const e=this.jax.SVG;if(!e)return"SVG can't be produced.<br>Try switching to SVG output first.";const i=e.adaptor,s=e.options.fontCache,r=!!t.root.getProperty("process-breaks");if("global"!==s&&(t.display||!r)&&"SVG"===i.getAttribute(t.typesetRoot,"jax"))for(const e of i.childNodes(t.typesetRoot))if("svg"===i.kind(e))return this.formatSvg(i.serializeXML(e));return this.typesetSVG(t,s,r)}))}typesetSVG(t,e,i){return pm(this,void 0,void 0,(function*(){const s=this.jax.SVG,r=s.html("div");"global"===e&&(s.options.fontCache="local");const n=t.root;return t.root=n.copy(!0),t.root.setInheritedAttributes({},t.display,0,!1),i&&(s.unmarkInlineBreaks(t.root),t.root.setProperty("inlineMarked",!1)),yield mn.handleRetriesFor((()=>{s.toDOM(t,r,s.document)})),t.root=n,s.options.fontCache=e,this.formatSvg(s.adaptor.serializeXML(r))}))}formatSvg(t){const e=this.constructor.SvgCss,i=(t=(t=t.match(/^<svg.*?><defs>/)?t.replace(/<defs>/,`<defs><style>${e}</style>`):t.replace(/^(<svg.*?>)/,`$1<defs><style>${e}</style></defs>`)).replace(/ (?:role|focusable)=".*?"/g,"").replace(/"currentColor"/g,'"black"')).split(/(<\/?[a-zA-Z].*?>)/);for(let t=2,e="";t<i.length;t+=2){const s=i[t-1],r=i[t+1];"/"!==s.charAt(1)&&"/"!==s.charAt(s.length-2)&&(e+=" "),r&&("/"===r.charAt(1)&&(e=e.slice(2)),i[t+1]=r.replace(' xmlns:xlink="http://www.w3.org/1999/xlink"',"")),i[t]&&(i[t]="\n "+e+i[t].replace(/\n/g,"\n "+e)),i[t]+="\n"+e}return t=i.join(""),this.settings.showSRE||(t=t.replace(/ (?:data-semantic-.*?|data-speech-node)=".*?"/g,"")),this.settings.showTex||(t=t.replace(/ data-latex(?:-item)?=".*?"/g,"")),this.settings.texHints||(t=t.replace(/ data-mjx-(?:texclass|alternate|variant|pseudoscript|smallmatrix|mathaccent|auto-op|script-align|vbox)=".*?"/g,"").replace(/ data-mml-node="TeXAtom"/g,"")),`<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n${t}`}zoom(t,e){t&&!this.isZoomEvent(t,e)||this.zoomBox()}isZoomEvent(t,e){return this.settings.zoom===e&&(!this.settings.alt||t.altKey)&&(!this.settings.ctrl||t.ctrlKey)&&(!this.settings.cmd||t.metaKey)&&(!this.settings.shift||t.shiftKey)}rerender(t=Ns.TYPESET){this.rerenderStart=Math.min(t,this.rerenderStart),!fm.loading&&mm.startup.hasTypeset&&this.document.whenReady((()=>pm(this,void 0,void 0,(function*(){this.rerenderStart<=Ns.COMPILED&&this.document.reset({inputJax:[]}),yield this.document.rerenderPromise(this.rerenderStart),this.rerenderStart=Ns.LAST}))))}noRerender(t){fm.loading++;try{t(),fm.loading--}catch(t){throw fm.loading--,t}}copyMathML(){rm(this.toMML(this.menu.mathItem))}copyOriginal(){rm(this.menu.mathItem.math.trim())}copySvgImage(){this.toSVG(this.menu.mathItem).then((t=>{rm(t)}))}copySpeechText(){rm(this.menu.mathItem.outputData.speech)}copyBrailleText(){rm(this.menu.mathItem.outputData.braille)}copyErrorMessage(){rm(this.menu.errorMsg.trim())}addMenu(t){this.addEvents(t),this.menu.store.insert(t.typesetRoot),t.typesetRoot.tabIndex=this.settings.inTabOrder?0:-1}addEvents(t){const e=t.typesetRoot;e.addEventListener("mousedown",(()=>{var e,i;this.menu.mathItem=t,this.current=null===(i=null===(e=t.explorers)||void 0===e?void 0:e.speech)||void 0===i?void 0:i.current}),!0),e.addEventListener("contextmenu",(()=>{var e;this.menu.mathItem=t;const i=null===(e=t.explorers)||void 0===e?void 0:e.speech;i&&(t.outputData.nofocus=!this.current,i.refocus=this.current)}),!0),e.addEventListener("keydown",(()=>this.menu.mathItem=t),!0),e.addEventListener("click",(t=>this.zoom(t,"Click")),!0),e.addEventListener("dblclick",(t=>this.zoom(t,"DoubleClick")),!0)}clear(){this.menu.store.clear()}variable(t,e){return{name:t,getter:()=>this.settings[t],setter:i=>{this.settings[t]=i,e&&e(i),this.saveUserSettings()}}}a11yVar(t,e){return{name:t,getter:()=>this.getA11y(t),setter:i=>{this.settings[t]=i,this.setA11y({[t]:i}),e&&e(i),this.saveUserSettings()}}}submenu(t,e,i=[],s=!1){let r=[];for(const t of i)Array.isArray(t)?r=r.concat(t):r.push(t);return{type:"submenu",id:t,content:e,menu:{items:r},disabled:0===r.length||s}}command(t,e,i,s={}){return Object.assign({type:"command",id:t,content:e,action:i},s)}checkbox(t,e,i,s={}){return Object.assign({type:"checkbox",id:t,content:e,variable:i},s)}radioGroup(t,e){return e.map((e=>this.radio(e[0],e[1]||e[0],t)))}radio(t,e,i,s={}){return Object.assign({type:"radio",id:t,content:e,variable:i},s)}label(t,e){return{type:"label",id:t,content:e}}rule(){return{type:"rule"}}}function gm(t){return class extends t{addMenu(t,e=!1){this.state()>=Ns.CONTEXT_MENU||(this.isEscaped||!t.options.enableMenu&&!e||t.menu.addMenu(this),this.state(Ns.CONTEXT_MENU))}getMenus(t){t.menu.menu.store.sort()}checkLoading(t){t.checkLoading()}}}function bm(t){var e;return e=class extends t{constructor(...t){super(...t),this.menu=new this.options.MenuClass(this,this.options.menuOptions);const e=this.constructor.ProcessBits;e.has("context-menu")||e.allocate("context-menu"),this.options.MathItem=gm(this.options.MathItem);const i=this.menu.settings,s=this.options,r=s.enableEnrichment=i.enrich;s.enableSpeech=i.speech&&r,s.enableBraille=i.braille&&r,s.enableComplexity=i.collapsible&&r,s.enableExplorer=r}addMenu(){if(!this.processed.isSet("context-menu")){for(const t of this.math)t.addMenu(this);this.processed.set("context-menu")}return this}getMenus(){this.menu.menu.store.sort()}checkLoading(){let t=!0;try{this._checkLoading(),t=!1}catch(t){if(!t.retry)throw t}return t}_checkLoading(){return this.menu.isLoading&&mn.retryAfter(this.menu.loadingPromise.catch((t=>console.log(t)))),this.options.enableComplexity&&this.menu.checkComponent("a11y/complexity"),this.options.enableExplorer&&this.menu.checkComponent("a11y/explorer"),this}state(t,e=!1){return super.state(t,e),t<Ns.CONTEXT_MENU&&this.processed.clear("context-menu"),this}},e.OPTIONS=Object.assign(Object.assign({enableEnrichment:!0,enableComplexity:!0,enableSpeech:!0,enableBraille:!0,enableExplorer:!0,enableExplorerHelp:!0,enrichSpeech:"none",enrichError:(t,e,i)=>console.warn("Enrichment Error:",i)},t.OPTIONS),{MenuClass:fm,menuOptions:fm.OPTIONS,enableMenu:!0,sre:t.OPTIONS.sre||Xi({}),a11y:t.OPTIONS.a11y||Xi({}),renderActions:Xi(Object.assign(Object.assign({},t.OPTIONS.renderActions),{addMenu:[Ns.CONTEXT_MENU],getMenus:[Ns.INSERTED+5,!1],checkLoading:[Ns.UNPROCESSED+1,t=>t.checkLoading(),"",!1]}))}),e}function Em(t){return t.documentClass=bm(t.documentClass),t}fm.MENU_STORAGE="MathJax-Menu-Settings",fm.OPTIONS={settings:{showSRE:!1,showTex:!1,texHints:!0,semantics:!1,zoom:"NoZoom",zscale:"200%",renderer:"CHTML",alt:!0,cmd:!1,ctrl:!1,shift:!1,scale:1,overflow:"Scroll",breakInline:!0,autocollapse:!1,collapsible:!1,enrich:!0,inTabOrder:!0,assistiveMml:!1,speech:!0,braille:!0,brailleCode:"nemeth",brailleSpeech:!1,brailleCombine:!1,speechRules:"clearspeak-default",roleDescription:"math",tabSelects:"all",help:!0},jax:{CHTML:null,SVG:null},annotationTypes:Xi({TeX:["TeX","LaTeX","application/x-tex"],StarMath:["StarMath 5.0"],Maple:["Maple"],ContentMathML:["MathML-Content","application/mathml-content+xml"],OpenMath:["OpenMath"]})},fm.SvgCss=["svg a{fill:blue;stroke:blue}",'[data-mml-node="merror"]>g{fill:red;stroke:red}','[data-mml-node="merror"]>rect[data-background]{fill:yellow;stroke:none}',"[data-frame],[data-line]{stroke-width:70px;fill:none}",".mjx-dashed{stroke-dasharray:140}",".mjx-dotted{stroke-linecap:round;stroke-dasharray:0,140}","use[data-c]{stroke-width:3px}"].join("\n"),fm.loading=0,fm.loadingPromises=new Map,fm._loadingPromise=null,fm._loadingOK=null,fm._loadingFailed=null,vs("CONTEXT_MENU",170),MathJax.loader&&MathJax.loader.checkVersion("ui/menu",Ei,"ui"),_i({_:{a11y:{speech:{SpeechMenu:Qe}},ui:{menu:{AnnotationMenu:ti,MJContextMenu:$e,Menu:si,MenuHandler:ri,MenuUtil:Ze,MmlVisitor:ii,RadioCompare:ei}}}}),MathJax.startup&&Ci&&MathJax.startup.extendHandler((t=>Em(t)),20),MathJax.loader&&MathJax.loader.checkVersion("a11y/sre",Ei,"a11y"),_i({_:{a11y:{sre_ts:Ye}}}),vs("ENRICHED",Ns.COMPILED+10);class xm extends dn{visitTree(t,e){this.mactionId=0;const i=super.visitTree(t);return this.mactionId&&(e.inputData.hasMaction=!0),i}visitHtmlNode(t,e){return t.getSerializedXML()}visitMactionNode(t,e){const[i,s]=0===t.childNodes.length?["",""]:["\n",e],r=this.childNodeMml(t,e+" ",i);let n=this.getAttributes(t);if("toggle"===t.attributes.get("actiontype")){const e=++this.mactionId;t.setProperty("mactionId",e),n=` data-maction-id="${e}" selection="${t.attributes.get("selection")}"`+n.replace(/ selection="\d+"/,"").replace(/ data-maction-id="\d+"/,"")}return`${e}<maction${n}>`+(r.match(/\S/)?i+r+s:"")+"</maction>"}}function ym(t,e,i){return class extends t{constructor(){super(...arguments),this.toMathML=i}serializeMml(t){if("outerHTML"in t)return t.outerHTML;if("undefined"!=typeof Element&&"undefined"!=typeof window&&t instanceof Element){const e=window.document.createElement("div");return e.appendChild(t),e.innerHTML}return t.toString()}enrich(t,i=!1){if(!(this.state()>=Ns.ENRICHED)){if(!this.isEscaped&&(t.options.enableEnrichment||i)){const i=new t.options.MathItem("",e);try{let e;e=this.inputData.originalMml?this.adjustSelections():this.inputData.originalMml=this.toMathML(this.root,this);const s=Hp(e);this.inputData.enrichedMml=i.math=this.serializeMml(s),i.math=i.math.replace(/ role="treeitem"/g,' data-speech-node="true"').replace(/ aria-level/g," data-semantic-level-number").replace(/ aria-(?:posinset|owns|setsize)=".*?"/g,""),i.display=this.display,i.compile(t),this.root=i.root}catch(e){t.options.enrichError(t,this,e)}}this.state(Ns.ENRICHED)}}toEnriched(t){return this.serializeMml(Hp(t))}unEnrich(t){const i=this.inputData.originalMml;if(!i)return;const s=new t.options.MathItem("",e);s.math=i,s.display=this.display,s.compile(t),this.root=s.root}adjustSelections(){const t=this.inputData.originalMml;if(!this.inputData.hasMaction)return t;const e=[];return this.root.walkTree((t=>{t.isKind("maction")&&(e[t.attributes.get("data-maction-id")]=t)})),t.replace(/(data-maction-id="(\d+)" selection=)"\d+"/g,((t,i,s)=>`${i}"${e[s].attributes.get("selection")}"`))}}}function Nm(t,e){var i;return(i=class extends t{constructor(...t){super(...t),e.setMmlFactory(this.mmlFactory);const i=this.constructor.ProcessBits;i.has("enriched")||i.allocate("enriched");const s=new xm(this.mmlFactory);this.options.MathItem=ym(this.options.MathItem,e,((t,e)=>s.visitTree(t,e)))}enrich(){if(!this.processed.isSet("enriched")){if(this.options.enableEnrichment){Fp(this.options.sre);for(const t of this.math)t.enrich(this)}this.processed.set("enriched")}return this}enrichError(t,e,i){console.warn("Enrichment error:",i)}state(t,e=!1){if(super.state(t,e),t<Ns.ENRICHED&&(this.processed.clear("enriched"),t>=Ns.COMPILED))for(const t of this.math)t.unEnrich(this);return this}}).OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableEnrichment:!0,enrichError:(t,e,i)=>t.enrichError(t,e,i),renderActions:Xi(Object.assign(Object.assign({},t.OPTIONS.renderActions),{enrich:[Ns.ENRICHED]})),sre:Xi({speech:"none",locale:"en",domain:"clearspeak",style:"default",braille:"nemeth",structure:!0,aria:!0})}),i}function vm(t,e){return e.setAdaptor(t.adaptor),t.documentClass=Nm(t.documentClass,e),t}MathJax.loader&&MathJax.loader.checkVersion("a11y/semantic-enrich",Ei,"a11y"),_i({_:{a11y:{"semantic-enrich":ni}}}),MathJax.startup&&MathJax.startup.extendHandler((t=>vm(t,new ao({allowHtmlInTokenNodes:!0}))));const Tm=["pitch","rate","volume"];function _m(t){const e=qp(t),i=[],s=[];return Lm(Array.from(e.childNodes),i,s),[s.join(" "),i]}function Lm(t,e,i,s={}){for(const r of t)if(3!==r.nodeType){if(1===r.nodeType){const t=r,n=t.tagName;if("speak"===n)continue;if("prosody"===n){Lm(Array.from(r.childNodes),e,i,Rm(t,s));continue}switch(n){case"break":e.push({pause:t.getAttribute("time")});break;case"mark":e.push({mark:t.getAttribute("name")});break;case"say-as":{const r=t.textContent;e.push(Object.assign({text:r,character:!0},s)),i.push(r);break}}}}else{const t=r.textContent.trim();t&&(i.push(t),e.push(Object.assign({text:t},s)))}}const Cm={pitch:(t,e)=>t/100*1,volume:(t,e)=>t/100*.5,rate:(t,e)=>t/100*1};function Rm(t,e){const i={};for(const s of Tm)if(t.hasAttribute(s)){const[r,n]=Im(t.getAttribute(s));if(!r){i[s]="volume"===s?.5:1;continue}let o=e[s];o=o||("volume"===s?.5:1);const a=Cm[s](parseInt(n,10),r);i[s]="-"===r?o-a:o+a}return i}const wm=/([+-]?)([0-9]+)%/;function Im(t){const e=t.match(wm);return e?[e[1],e[2]]:(console.warn("Something went wrong with the prosody matching."),["","100"])}function Sm(t,e,i,s=" "){if(!t)return"";const r=[t];return e&&r.unshift(e),i&&r.push(i),r.join(s)}function Am(t,e="en",i="100"){return _m(`<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="${e}"><prosody rate="${i}%">${t}</prosody></speak>`)}function Om(){const t=new AudioContext,e=t.createOscillator();e.frequency.value=300,e.connect(t.destination),e.start(t.currentTime),e.stop(t.currentTime+.05)}var Mm,km;!function(t){t[t.NONE=0]="NONE",t[t.DEPTH=1]="DEPTH",t[t.SUMMARY=2]="SUMMARY"}(Mm||(Mm={})),function(t){t.SPEECH="data-semantic-speech-none",t.SPEECH_SSML="data-semantic-speech",t.SUMMARY="data-semantic-summary-none",t.SUMMARY_SSML="data-semantic-summary",t.PREFIX="data-semantic-prefix-none",t.PREFIX_SSML="data-semantic-prefix",t.POSTFIX="data-semantic-postfix-none",t.POSTFIX_SSML="data-semantic-postfix",t.BRAILLE="data-semantic-braille"}(km||(km={}));class Dm{constructor(){this.promise=Promise.resolve(),this.adaptor=null,this._options={},this._init=!1}set element(t){this._element=t}get element(){return this._element}set options(t){this._options=Object.assign({},(null==t?void 0:t.sre)||{},{enableSpeech:t.enableSpeech,enableBraille:t.enableBraille}),delete this._options.custom}get options(){return this._options}init(t,e,i){this.options=t,this._init||(this.adaptor=e,this.webworker=i,this._init=!0)}update(t){Object.assign(this.options,t)}Speech(t){const e=t.outputData.mml,i=Object.assign({},this.options,{modality:"speech"});return this.promise=this.webworker.Speech(e,i,t)}SpeechFor(t,e){const i=Object.assign({},this.options,{modality:"speech"});return this.webworker.speechFor(e,i,t)}cancel(t){var e;null===(e=this.webworker)||void 0===e||e.Cancel(t)}updateRegions(t,e,i){e.Update(this.getLabel(t)),i.Update(this.getBraille(t))}getOptions(t){var e,i,s,r;return{locale:null!==(e=this.adaptor.getAttribute(t,"data-semantic-locale"))&&void 0!==e?e:"",domain:null!==(i=this.adaptor.getAttribute(t,"data-semantic-domain"))&&void 0!==i?i:"",style:null!==(s=this.adaptor.getAttribute(t,"data-semantic-style"))&&void 0!==s?s:"",domain2style:null!==(r=this.adaptor.getAttribute(t,"data-semantic-domain2style"))&&void 0!==r?r:""}}nextRules(t){const e=this.getOptions(t.typesetRoot);return this.update(e),this.promise=this.webworker.nextRules(t.outputData.mml,Object.assign({},this.options,{modality:"speech"}),t)}nextStyle(t,e){const i=this.getOptions(e.typesetRoot);return this.update(i),this.promise=this.webworker.nextStyle(e.outputData.mml,Object.assign({},this.options,{modality:"speech"}),this.adaptor.getAttribute(t,"data-semantic-id"),e)}getLabel(t,e="",i=" "){const s=this.adaptor;return Sm(s.getAttribute(t,km.SPEECH_SSML),s.getAttribute(t,km.PREFIX_SSML),s.getAttribute(t,km.POSTFIX_SSML),i)||s.getAttribute(t,"aria-label")}getBraille(t){const e=this.adaptor;return e.getAttribute(t,"aria-braillelabel")||e.getAttribute(t,km.BRAILLE)}getLocalePreferences(t){return this.promise=this.webworker.clearspeakLocalePreferences(this.options,t)}getRelevantPreferences(t,e,i,s){const r=t.outputData.mml;return this.promise=this.webworker.clearspeakRelevantPreferences(r,e,i,s)}}var Pm=function(t,e,i,s){return new(i||(i=Promise))((function(r,n){function o(t){try{l(s.next(t))}catch(t){n(t)}}function a(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((s=s.apply(t,e||[])).next())}))};class Bm{constructor(t,e,i,s){this.cmd=t,this.item=e,this.resolve=i,this.reject=s}}class jm{constructor(t,e){this.adaptor=t,this.options=e,this.ready=!1,this.tasks=[],this.Commands={Ready(t,e){t.ready=!0,t.postNext()},Finished(t,e){const i=t.tasks.shift();e.success?i.resolve(e.result):i.reject(e.error),t.postNext()},Log(t,e){t.options.debug&&console.log("Log:",e)}}}Start(){return Pm(this,void 0,void 0,(function*(){if(this.ready)throw Error("Worker already started");this.worker=yield this.adaptor.createWorker(this.Listener.bind(this),this.options)}))}debug(t,...e){this.options.debug&&console.info(t,...e)}Listener(t){this.debug("Worker >>> Client:",t.data),Object.hasOwn(this.Commands,t.data.cmd)?this.Commands[t.data.cmd](this,t.data.data):this.debug("Invalid command from worker: "+t.data.cmd)}Post(t,e){const i=new Promise(((i,s)=>{this.tasks.push(new Bm(t,e,i,s))}));return this.ready&&1===this.tasks.length&&this.postNext(),i}postNext(){if(this.tasks.length){const t=Object.assign({},this.tasks[0].cmd,{debug:this.options.debug});this.worker.postMessage(t)}}Cancel(t){const e=this.tasks.findIndex((e=>e.item===t));e>0&&(this.tasks[e].reject(`Task ${this.tasks[e].cmd.cmd} cancelled`),this.tasks.splice(e,1))}Setup(t){return this.Post({cmd:"setup",data:{domain:t.domain,style:t.style,locale:t.locale,modality:t.modality}})}Speech(t,e,i){return Pm(this,void 0,void 0,(function*(){this.Attach(i,e.enableSpeech,e.enableBraille,yield this.Post({cmd:"speech",data:{mml:t,options:e}},i))}))}nextRules(t,e,i){return Pm(this,void 0,void 0,(function*(){this.Attach(i,e.enableSpeech,e.enableBraille,yield this.Post({cmd:"nextRules",data:{mml:t,options:e}},i))}))}nextStyle(t,e,i,s){return Pm(this,void 0,void 0,(function*(){this.Attach(s,e.enableSpeech,e.enableBraille,yield this.Post({cmd:"nextStyle",data:{mml:t,options:e,nodeId:i}},s))}))}speechFor(t,e,i){return Pm(this,void 0,void 0,(function*(){const s=yield this.Post({cmd:"speech",data:{mml:t,options:e}},i);return JSON.parse(s)}))}Attach(t,e,i,s){const r=JSON.parse(s),n=t.typesetRoot;if(!n)return;this.setSpecialAttributes(n,r.options,"data-semantic-",["locale","domain","style","domain2style"]);const o=this.adaptor;this.setSpecialAttributes(n,r.translations,"data-semantic-");for(const[t,e]of Object.entries(r.mactions)){let i=o.getElement("#"+t,n);i&&o.childNodes(i)[0]&&(i=o.childNodes(i)[0],"rect"===o.kind(i)&&(i=o.next(i)),o.setAttribute(i,"data-semantic-type","dummy"),this.setSpecialAttributes(i,e,""))}this.setSpeechAttributes(o.childNodes(n)[0],"",r,e,i),e&&(r.label&&(o.setAttribute(n,km.SPEECH,r.label),o.setAttribute(n,km.SPEECH_SSML,r.ssml),t.outputData.speech=r.label),o.setAttribute(n,"data-speech-attached","true")),i&&(r.braillelabel&&(o.setAttribute(n,km.BRAILLE,r.braillelabel),t.outputData.braille=r.braillelabel),r.braille&&o.setAttribute(n,"data-braille-attached","true"))}setSpeechAttribute(t,e,i,s){var r,n;const o=this.adaptor,a=o.getAttribute(t,"data-semantic-id");if(o.removeAttribute(t,"data-speech-node"),i&&e.speech[a]["speech-none"]){o.setAttribute(t,"data-speech-node","true");for(let[i,s]of Object.entries(e.speech[a]))i=i.replace(/-ssml$/,""),s&&o.setAttribute(t,`data-semantic-${i}`,s)}if(s&&(null===(n=null===(r=e.braille)||void 0===r?void 0:r[a])||void 0===n?void 0:n["braille-none"])){o.setAttribute(t,"data-speech-node","true");const i=e.braille[a]["braille-none"];o.setAttribute(t,km.BRAILLE,i)}}setSpeechAttributes(t,e,i,s,r){const n=this.adaptor;if(!t||"#text"===n.kind(t)||"#comment"===n.kind(t))return e;n.hasAttribute(t,"data-semantic-id")&&(this.setSpeechAttribute(t,i,s,r),e||n.hasAttribute(t,"data-semantic-parent")||(e=n.getAttribute(t,"data-semantic-id")));for(const o of Array.from(n.childNodes(t)))e=this.setSpeechAttributes(o,e,i,s,r);return e}setSpecialAttributes(t,e,i,s){if(e){s=s||Object.keys(e);for(const r of s){const s=e[r];s&&this.adaptor.setAttribute(t,`${i}${r.toLowerCase()}`,s)}}}Detach(t){const e=t.typesetRoot;this.adaptor.removeAttribute(e,"data-speech-attached"),this.adaptor.removeAttribute(e,"data-braille-attached"),this.detachSpeech(e)}detachSpeech(t){const e=this.adaptor,i=e.childNodes(t);if(i){if("#text"!==e.kind(t))for(const i of["none","summary-none","speech","speech-none","summary","braille"])e.removeAttribute(t,`data-semantic-${i}`);for(const t of i)this.detachSpeech(t)}}Terminate(){this.debug("Terminating pending tasks");for(const t of this.tasks)t.reject(`${t.cmd.data.cmd} cancelled by WorkerHandler termination`);return this.tasks=[],this.debug("Terminating worker"),this.worker.terminate()}Stop(){return Pm(this,void 0,void 0,(function*(){if(!this.worker)throw Error("Worker has not been started");yield this.Terminate(),this.worker=null,this.ready=!1}))}clearspeakLocalePreferences(t,e){return Pm(this,void 0,void 0,(function*(){yield this.Post({cmd:"localePreferences",data:{options:t}}).then((i=>{e.set(t.locale,JSON.parse(i))}))}))}clearspeakRelevantPreferences(t,e,i,s){return Pm(this,void 0,void 0,(function*(){yield this.Post({cmd:"relevantPreferences",data:{mml:t,id:e}}).then((t=>{i.set(s,t)}))}))}}const Fm=Li.config||{},Um=()=>(Fm?.loader?.paths?.mathjax||Fm?.__dirname||"/")+"/sre";var Hm=function(t,e,i,s){return new(i||(i=Promise))((function(r,n){function o(t){try{l(s.next(t))}catch(t){n(t)}}function a(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((s=s.apply(t,e||[])).next())}))};function qm(t){return class extends t{constructor(){super(...arguments),this.generatorPool=new Dm}attachSpeech(t){if(this.outputData.speechPromise=null,this.state()>=Ns.ATTACHSPEECH)return;if(this.state(Ns.ATTACHSPEECH),this.isEscaped||!t.options.enableSpeech&&!t.options.enableBraille||!t.options.enableEnrichment)return;t.getWebworker(),this.generatorPool.init(t.options,t.adaptor,t.webworker),this.outputData.mml=this.toMathML(this.root,this);const e=this.generatorPool.Speech(this).catch((e=>t.options.speechError(t,this,e)));t.savePromise(e),this.outputData.speechPromise=e}detachSpeech(t){t.webworker.Detach(this)}speechFor(t){return Hm(this,void 0,void 0,(function*(){t=this.toEnriched(t);const e=yield this.generatorPool.SpeechFor(this,t);return[e.label,e.braillelabel]}))}clear(){this.generatorPool.cancel(this)}}}function Wm(t){var e;return e=class extends t{constructor(...t){super(...t),this.webworker=null;const e=this.constructor.ProcessBits;e.has("attach-speech")||e.allocate("attach-speech"),this.options.MathItem=qm(this.options.MathItem)}getWebworker(){this.webworker||(this.webworker=new jm(this.adaptor,this.options.worker),this.webworker.Start())}attachSpeech(){if(!this.processed.isSet("attach-speech")){const t=this.options;if(t.enableEnrichment&&(t.enableSpeech||t.enableBraille)){this.getWebworker();for(const t of this.math)t.attachSpeech(this)}this.processed.set("attach-speech")}return this}speechError(t,e,i){console.warn("Speech generation error:",i)}state(t,e=!1){if(super.state(t,e),t<Ns.ATTACHSPEECH&&(this.processed.clear("attach-speech"),t>=Ns.TYPESET))for(const t of this.math)t.detachSpeech(this);return this}done(){const t=Object.create(null,{done:{get:()=>super.done}});return Hm(this,void 0,void 0,(function*(){var e;return yield null===(e=this.webworker)||void 0===e?void 0:e.Stop(),t.done.call(this)}))}},e.OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableSpeech:!0,enableBraille:!0,speechError:(t,e,i)=>t.speechError(t,e,i),renderActions:Xi(Object.assign(Object.assign({},t.OPTIONS.renderActions),{attachSpeech:[Ns.ATTACHSPEECH]})),worker:{path:Um(),maps:Um().replace(/[cm]js\/a11y\/sre$/,"bundle/sre/mathmaps"),worker:"speech-worker.js",debug:!1},a11y:Xi({speech:!0,braille:!0})}),e}function Vm(t,e){return!t.documentClass.prototype.enrich&&e&&(t=vm(t,e)),t.documentClass=Wm(t.documentClass),t}if(vs("ATTACHSPEECH",Ns.INSERTED+10),MathJax.loader&&MathJax.loader.checkVersion("a11y/speech",Ei,"a11y"),_i({_:{a11y:{speech_ts:ci,speech:{GeneratorPool:ai,SpeechUtil:oi,WebWorker:li}}}}),MathJax.loader){let t=Ii.resolvePath("[sre]",!1),e=Ii.resolvePath("[mathmaps]",!1);if(Ri.window)t=new URL(t,location).href,e=new URL(e,location).href;else{const i="undefined"!=typeof require?require:MathJax.config.loader.require;i?.resolve?(t=Ri.path(i.resolve(`${t}/require.mjs`)).replace(/\/[^\/]*$/,""),e=Ri.path(i.resolve(`${e}/base.json`)).replace(/\/[^\/]*$/,"")):t=e=""}t&&Ti(MathJax.config,"options",{worker:{path:t,maps:e}})}MathJax.startup&&MathJax.startup.extendHandler((t=>Vm(t)));class Xm{constructor(t){this.document=t,this.CLASS=this.constructor,this.AddStyles()}static get sheetId(){return"MJX-"+this.name+"-styles"}static get styleSheet(){return document.head.querySelector("#"+this.sheetId)}AddStyles(){const t=this.CLASS.sheetId;if(!this.CLASS.style||this.document.adaptor.head().querySelector("#"+t))return;const e=this.document.adaptor.node("style",{id:t});e.innerHTML=this.CLASS.style.cssText,this.document.adaptor.head().appendChild(e)}AddElement(){if(this.div)return;const t=this.document.adaptor.node("div");t.classList.add(this.CLASS.className),this.div=t,this.inner=this.document.adaptor.node("div"),this.div.appendChild(this.inner),this.document.adaptor.body(this.document.adaptor.document).appendChild(this.div)}Show(t){this.AddElement(),this.position(t),this.div.classList.add(this.CLASS.className+"_Show")}Hide(){this.div&&(this.div.remove(),this.div=null,this.inner=null)}stackRegions(t){const e=t.getBoundingClientRect();let i=0,s=Number.POSITIVE_INFINITY;const r=this.document.adaptor.document.getElementsByClassName(this.CLASS.className+"_Show");for(let t,e=0;t=r[e];e++)t!==this.div&&(i=Math.max(t.getBoundingClientRect().bottom,i),s=Math.min(t.getBoundingClientRect().left,s));const n=(i||e.bottom+10)+window.scrollY,o=(s<Number.POSITIVE_INFINITY?s:e.left)+window.scrollX;this.div.style.top=n+"px",this.div.style.left=o+"px"}}class zm extends Xm{Clear(){}Update(){}Hide(){}Show(){}AddElement(){}AddStyles(){}position(){}}class Gm extends Xm{Clear(){this.div&&(this.Update(""),this.inner.style.top="",this.inner.style.backgroundColor="")}Update(t){t&&this.AddElement(),this.inner&&(this.inner.textContent="",this.inner.textContent=t||"\xa0")}position(t){this.stackRegions(t)}}class Jm extends Gm{}Jm.className="MJX_ToolTip",Jm.style=new Nn({[`.${Jm.className}`]:{width:"auto",height:"auto",opacity:1,"text-align":"center","border-radius":"4px",padding:0,"border-bottom":"1px dotted black",position:"absolute",display:"inline-block","background-color":"white","z-index":202},[`.${Jm.className} > div`]:{"border-radius":"inherit",padding:"0 2px"},"@media (prefers-color-scheme: dark)":{["."+Jm.className]:{"background-color":"#222025","box-shadow":"0px 5px 20px #000",border:"1px solid #7C7C7C"}}});class Km extends Gm{static setColor(t,e,i,s){const r=this.styleSheet;if(r){const n=r.sheet.cssRules[0].style,o=`--mjx-${t}${e}-color`,a=`rgba(var(--mjx-${t}-${i}), ${1===s?1:`var(--mjx-${t}${e}-alpha)`})`;n.getPropertyValue(o)!==a&&n.setProperty(o,a);const l=`--mjx-${t}${e}-alpha`;n.getPropertyValue(l)!==String(s)&&(n.setProperty(l,s),r.sheet.cssRules[1].cssRules[0].style.setProperty(l,Math.pow(s,.7071)))}}}Km.className="MJX_LiveRegion",Km.priority={primary:1,secondary:2},Km.style=new Nn({":root":{"--mjx-fg-red":"255, 0, 0","--mjx-fg-green":"0, 255, 0","--mjx-fg-blue":"0, 0, 255","--mjx-fg-yellow":"255, 255, 0","--mjx-fg-cyan":"0, 255, 255","--mjx-fg-magenta":"255, 0, 255","--mjx-fg-white":"255, 255, 255","--mjx-fg-black":"0, 0, 0","--mjx-bg-red":"255, 0, 0","--mjx-bg-green":"0, 255, 0","--mjx-bg-blue":"0, 0, 255","--mjx-bg-yellow":"255, 255, 0","--mjx-bg-cyan":"0, 255, 255","--mjx-bg-magenta":"255, 0, 255","--mjx-bg-white":"255, 255, 255","--mjx-bg-black":"0, 0, 0","--mjx-live-bg-color":"white","--mjx-live-shadow-color":"#888","--mjx-live-border-color":"#CCCCCC","--mjx-bg1-color":"rgba(var(--mjx-bg-blue), var(--mjx-bg-alpha))","--mjx-fg1-color":"rgba(var(--mjx-fg-black), 1)","--mjx-bg2-color":"rgba(var(--mjx-bg-red), 1)","--mjx-fg2-color":"rgba(var(--mjx-fg-black), 1)","--mjx-bg1-alpha":.2,"--mjx-fg1-alpha":1,"--mjx-bg2-alpha":1,"--mjx-fg2-alpha":1},"@media (prefers-color-scheme: dark)":{":root":{"--mjx-bg-blue":"132, 132, 255","--mjx-bg-white":"0, 0, 0","--mjx-bg-black":"255, 255, 255","--mjx-fg-white":"0, 0, 0","--mjx-fg-black":"255, 255, 255","--mjx-live-bg-color":"#222025","--mjx-live-shadow-color":"black","--mjx-live-border-color":"#7C7C7C","--mjx-bg1-alpha":.3,"--mjx-fg1-alpha":1,"--mjx-bg2-alpha":1,"--mjx-fg2-alpha":1}},[`.${Km.className}`]:{position:"absolute",top:0,display:"none",width:"auto",height:"auto",padding:0,opacity:1,"z-index":"202",left:0,right:0,margin:"0 auto","background-color":"var(--mjx-live-bg-color)","box-shadow":"0px 5px 20px var(--mjx-live-shadow-color)",border:"2px solid var(--mjx-live-border-color)"},[`.${Km.className}_Show`]:{display:"block"},[`.${Km.className} > div`]:{color:"var(--mjx-fg1-color)","background-color":"var(--mjx-bg1-color)"},"mjx-container [data-sre-highlight-1]:not([data-mjx-collapsed], rect)":{color:"var(--mjx-fg1-color) ! important",fill:"var(--mjx-fg1-color) ! important"},[["mjx-container:not([data-mjx-clone-container])","[data-sre-highlight-1]:not([data-sre-enclosed], rect)"].join(" ")]:{"background-color":"var(--mjx-bg1-color) ! important"},"mjx-container rect[data-sre-highlight-1]:not([data-sre-enclosed])":{fill:"var(--mjx-bg1-color) ! important"},"mjx-container [data-sre-highlight-2]":{color:"var(--mjx-fg2-color) ! important","background-color":"var(--mjx-bg2-color) ! important",fill:"var(--mjx-fg2-color) ! important"},"mjx-container rect[data-sre-highlight-2]":{fill:"var(--mjx-bg2-color) ! important"}});class $m extends Km{constructor(){super(...arguments),this.active=!1,this.node=null,this.clear=!1,this.voiceRequest=!1,this.voiceCancelled=!1}Show(t){super.Update("\xa0"),this.node=t,super.Show(t)}Update(t){if(this.voiceRequest)return void this.makeVoice(t);speechSynthesis.onvoiceschanged=(()=>this.voiceRequest=!0).bind(this);new Promise((t=>{setTimeout((()=>{this.voiceRequest?t(!0):setTimeout((()=>{this.voiceRequest=!0,t(!0)}),100)}),100)})).then((()=>this.makeVoice(t)))}makeVoice(t){this.active=this.document.options.a11y.voicing&&!!speechSynthesis.getVoices().length,speechSynthesis.cancel(),this.clear=!0;const[e,i]=Am(t,this.document.options.sre.locale,this.document.options.sre.rate);super.Update(e),this.active&&e&&this.makeUtterances(i,this.document.options.sre.locale)}makeUtterances(t,e){this.voiceCancelled=!1;let i=null;for(const s of t)if(s.mark){if(!i){this.highlightNode(s.mark,!0);continue}i.addEventListener("end",(t=>{this.voiceCancelled||this.highlightNode(s.mark)}))}else if(s.pause){const t=parseInt(s.pause.match(/^[0-9]+/)[0]);if(isNaN(t)||!i)continue;i.addEventListener("end",(e=>{speechSynthesis.pause(),setTimeout((()=>{speechSynthesis.resume()}),t)}))}else i=new SpeechSynthesisUtterance(s.text),s.rate&&(i.rate=s.rate),s.pitch&&(i.pitch=s.pitch),i.lang=e,speechSynthesis.speak(i);i&&i.addEventListener("end",(t=>{this.highlighter.unhighlight()}))}Hide(){this.cancelVoice(),super.Hide()}cancelVoice(){this.voiceCancelled=!0,speechSynthesis.cancel(),this.highlighter.unhighlight()}highlightNode(t,e=!1){this.highlighter.unhighlight();const i=Array.from(this.node.querySelectorAll(`[data-semantic-id="${t}"]`));this.clear&&!e||this.highlighter.highlight(i),this.clear=!1}}$m.style=null;class Ym extends Xm{position(t){const e=t.getBoundingClientRect(),i=this.div.getBoundingClientRect();let s,r=e.left+e.width/2-i.width/2;switch(r=r<0?0:r,r+=window.scrollX,this.document.options.a11y.align){case"top":s=e.top-i.height-10;break;case"bottom":s=e.bottom+10;break;default:s=e.top+e.height/2-i.height/2}s+=window.scrollY,s=s<0?0:s,this.div.style.top=s+"px",this.div.style.left=r+"px"}Show(t){this.AddElement(),this.div.style.fontSize=this.document.options.a11y.magnify,this.Update(t),super.Show(t)}Clear(){this.div&&(this.inner.textContent="",this.inner.style.top="",this.inner.style.backgroundColor="")}Update(t){if(!this.div)return;this.Clear();const e=this.cloneNode(t),i=e.querySelector("[data-mjx-clone]");this.inner.style.backgroundColor=t.style.backgroundColor,i.style.backgroundColor="",i.classList.remove("mjx-selected"),this.inner.appendChild(e),this.position(t)}cloneNode(t){let e=t.cloneNode(!0);if(e.setAttribute("data-mjx-clone","true"),"MJX-CONTAINER"!==e.nodeName){"g"!==e.nodeName&&(e.style.marginLeft=e.style.marginRight="0");const i=t.closest("mjx-container");if("MJX-MATH"!==e.nodeName&&"svg"!==e.nodeName){let s=i.firstChild;"MJX-BBOX"===s.nodeName&&(s=s.nextSibling),e=s.cloneNode(!1).appendChild(e).parentElement;const r=Array.from(i.querySelectorAll("[data-sre-enclosed]"));"svg"===s.nodeName?this.svgClone(t,r,e,i):this.chtmlClone(t,r,e)}e=i.cloneNode(!1).appendChild(e).parentElement,e.style.margin="0",e.style.minWidth=""}return e.setAttribute("data-mjx-clone-container","true"),e}chtmlClone(t,e,i){for(const s of e)if(s!==t){const t=s.getAttribute("data-semantic-id");t&&i.querySelector(`[data-semantic-id="${t}"]`)||i.appendChild(s.cloneNode(!0))}}svgClone(t,e,i,s){var r;let{x:n,y:o,width:a,height:l}=t.getBBox();if(e.length){i.firstChild.remove();const r=s.querySelector("g").cloneNode(!1);for(const i of e){const e=r.appendChild(i.cloneNode(!0));i===t&&e.setAttribute("data-mjx-clone","true");const[s,n]=this.xy(i);e.setAttribute("transform",`translate(${s}, ${n})`)}i.appendChild(r);const c=t.previousSibling,h=c.getBBox();a=h.width,l=h.height;const[d,u]=this.xy(c);n=d,o=u+h.y}const c=s.querySelector("g");if("full"===s.getAttribute("width")&&c.firstChild.lastChild===t)return i.innerHTML="",i.appendChild(s.cloneNode(!0).firstChild),i.querySelector(".mjx-selected").setAttribute("data-mjx-clone","true"),void(null===(r=i.querySelector("[data-sre-highlighter-added]"))||void 0===r||r.remove());i.firstChild.setAttribute("transform","scale(1, -1)");const h=parseFloat((i.getAttribute("viewBox")||i.getAttribute("data-mjx-viewBox")).split(/ /)[2]),d=parseFloat(i.style.minWidth||i.getAttribute("width"));i.setAttribute("viewBox",[n,-(o+l),a,l].join(" ")),i.removeAttribute("style"),i.setAttribute("width",d/h*a+"ex"),i.setAttribute("height",d/h*l+"ex")}xy(t){const e=DOMPoint.fromPoint({x:0,y:0}).matrixTransform(t.getCTM().inverse());return[-e.x,-e.y]}}Ym.className="MJX_HoverRegion",Ym.style=new Nn({[`.${Ym.className}`]:{display:"block",position:"absolute",width:"max-content",height:"auto",padding:0,opacity:1,"z-index":"202",margin:"0 auto","background-color":"white","line-height":0,"box-shadow":"0px 10px 20px #888",border:"2px solid #CCCCCC"},[`.${Ym.className} > div`]:{overflow:"hidden",color:"var(--mjx-fg1-color)","background-color":"var(--mjx-bg1-color)"},"@media (prefers-color-scheme: dark)":{["."+Ym.className]:{"background-color":"#222025","box-shadow":"0px 5px 20px #000",border:"1px solid #7C7C7C"}},"mjx-container[data-mjx-clone-container]":{padding:"2px ! important"},"mjx-math > mjx-mlabeledtr":{display:"inline-block","margin-right":".5em ! important"},"mjx-math > mjx-mtd":{float:"right"}});class Qm{get highlighter(){return this.pool.highlighter}static stopEvent(t){t.preventDefault?t.preventDefault():t.returnValue=!1,t.stopImmediatePropagation?t.stopImmediatePropagation():t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0}static create(t,e,i,s,...r){return new this(t,e,i,s,...r)}constructor(t,e,i,s,...r){this.document=t,this.pool=e,this.region=i,this.node=s,this.stoppable=!0,this.events=[],this._active=!1}Events(){return this.events}get active(){return this._active}set active(t){this._active=t}Attach(){this.AddEvents()}Detach(){this.RemoveEvents()}Start(){this.active=!0}Stop(){this.active&&(this.region.Clear(),this.region.Hide(),this.active=!1)}AddEvents(){for(const[t,e]of this.events)this.node.addEventListener(t,e)}RemoveEvents(){for(const[t,e]of this.events)this.node.removeEventListener(t,e)}Update(t=!1){}stopEvent(t){this.stoppable&&Qm.stopEvent(t)}}var Zm=function(t,e,i,s){return new(i||(i=Promise))((function(r,n){function o(t){try{l(s.next(t))}catch(t){n(t)}}function a(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}l((s=s.apply(t,e||[])).next())}))};const tf="Windows"===Ri.os,ef=Array(40).fill("\u2800").join(""),sf="[data-speech-node]";function rf(t){return t.matches("mjx-container")}function nf(t,e=!0){return t.shiftKey&&e||t.metaKey||t.altKey||t.ctrlKey}class of extends Qm{static helpMessage(t,e,i){return`\n <h2 role="heading" aria-level="2">Exploring expressions ${t}</h2>\n\n <p>The mathematics on this page is being rendered by <a\n href="https://www.mathjax.org/" target="_blank">MathJax</a>, which\n generates both the text spoken by screen readers, as well as the\n visual layout for sighted users.</p>\n\n <p>Expressions typeset by MathJax can be explored interactively, and\n are focusable. You can use the <kbd>Tab</kbd> key to move to a typeset\n expression${e}. Initially, the expression will be read in full,\n but you can use the following keys to explore the expression\n further:</p>\n\n <ul>\n\n <li><kbd>Down Arrow</kbd> moves one level deeper into the\n expression to allow you to explore the current subexpression term by\n term.</li>\n\n <li><kbd>Up Arrow</kbd> moves back up a level within the\n expression.</li>\n\n <li><kbd>Right Arrow</kbd> moves to the next term in the\n current subexpression.</li>\n\n <li><kbd>Left Arrow</kbd> moves to the next term in the\n current subexpression.</li>\n\n <li><kbd>Shift</kbd>+<kbd>Arrow</kbd> moves to a\n neighboring cell within a table.</li>\n\n <li><kbd>0-9</kbd>+<kbd>0-9</kbd> jumps to a cell\n by its index in the table, where 0 = 10.</li>\n\n <li><kbd>Home</kbd> takes you to the top of the\n expression.</li>\n\n <li><kbd>Enter</kbd> or <kbd>Return</kbd> clicks a\n link or activates an active subexpression.</li>\n\n <li><kbd>Space</kbd> opens the MathJax contextual menu\n where you can view or copy the source format of the expression, or\n modify MathJax's settings.</li>\n\n <li><kbd>Escape</kbd> exits the expression\n explorer.</li>\n\n <li><kbd>x</kbd> gives a summary of the current\n subexpression.</li>\n\n <li><kbd>z</kbd> gives the full text of a collapsed\n expression.</li>\n\n <li><kbd>d</kbd> gives the current depth within the\n expression.</li>\n\n <li><kbd>s</kbd> starts or stops auto-voicing with\n synchronized highlighting.</li>\n\n <li><kbd>v</kbd> marks the current position in the\n expression.</li>\n\n <li><kbd>p</kbd> cycles through the marked positions in\n the expression.</li>\n\n <li><kbd>u</kbd> clears all marked positions and returns\n to the starting position.</li>\n\n <li><kbd>></kbd> cycles through the available speech\n rule sets (MathSpeak, ClearSpeak).</li>\n\n <li><kbd><</kbd> cycles through the verbosity levels\n for the current rule set.</li>\n\n <li><kbd>b</kbd> toggles whether Braille notation is combined\n with speech text for tactile Braille devices, as discussed\n below.\n\n <li><kbd>h</kbd> produces this help listing.</li>\n </ul>\n\n <p>The MathJax contextual menu allows you to enable or disable speech\n or Braille generation for mathematical expressions, the language to\n use for the spoken mathematics, and other features of MathJax. In\n particular, the Explorer submenu allows you to specify how the\n mathematics should be identified in the page (e.g., by saying "math"\n when the expression is spoken), and whether or not to include a\n message about the letter "h" bringing up this dialog box. Turning off\n speech and Braille will disable the expression explorer, its\n highlighting, and its help icon.</p>\n\n <p>Support for tactile Braille devices varies across screen readers,\n browsers, and operative systems. If you are using a Braille output\n device, you may need to select the "Combine with Speech" option in the\n contextual menu's Braille submenu in order to obtain Nemeth or Euro\n Braille output rather than the speech text on your Braille\n device. ${i}</p>\n\n <p>The contextual menu also provides options for viewing or copying a\n MathML version of the expression or its original source format,\n creating an SVG version of the expression, and viewing various other\n information.</p>\n\n <p>Finally, selecting the "Insert Hidden MathML" item from the options\n submenu will turn of MathJax's speech and Braille generation and\n instead use visually hidden MathML that some screen readers can voice,\n though support for this is not universal across all screen readers and\n operating systems. Selecting speech or Braille generation in their\n submenus will remove the hidden MathML again.</p>\n\n <p>For more help, see the <a\n href="https://docs.mathjax.org/en/latest/basic/accessibility.html"\n target="_blank">MathJax accessibility documentation.</a></p>\n `}get generators(){var t;return null===(t=this.item)||void 0===t?void 0:t.generatorPool}get role(){return this.item.ariaRole}get description(){return this.item.roleDescription}get none(){return this.document.options.a11y.brailleSpeech?this.item.brailleNone:this.item.none}get brailleNone(){return this.item.brailleNone}FocusIn(t){this.item.outputData.nofocus?this.item.outputData.nofocus=!1:(this.clicked||(this.Start(),this.backTab=t.target===this.img),this.clicked=null)}FocusOut(t){this.current&&!this.focusSpeech&&(this.document.options.keepRegions||(this.setCurrent(null),this.Stop()),document.hasFocus()||this.focusTop())}KeyDown(t){if(this.pendingIndex.shift(),this.region.cancelVoice(),nf(t,!1))return;const e=this.constructor,i=1===t.key.length?t.key.toLowerCase():t.key,[s,r]=e.keyMap.get(i)||[],n=s?void 0===r||this.active?s(this,t):r:this.undefinedKey(t);n||(this.stopEvent(t),!1===n&&this.sound&&this.NoMove())}MouseDown(t){var e;if(this.pendingIndex=[],this.region.cancelVoice(),nf(t)||2===t.buttons)return void(this.item.outputData.nofocus=!0);const i=this.findClicked(t.target,t.x,t.y);i!==this.document.infoIcon?(null===(e=document.getSelection())||void 0===e||e.removeAllRanges(),t.target.getAttribute("sre-highlighter-added")?this.refocus=i:this.clicked=i):this.stopEvent(t)}Click(t){if(nf(t)||2===t.buttons||"Range"===document.getSelection().type)return void this.FocusOut(null);const e=this.findClicked(t.target,t.x,t.y);if(e===this.document.infoIcon)return this.stopEvent(t),void this.help();e&&!this.node.contains(e)||(this.stopEvent(t),this.refocus=e,this.triggerLinkMouse()||this.Start())}DblClick(t){var e;const i=null!==(e=document.getSelection().direction)&&void 0!==e?e:"none";nf(t)||2===t.buttons||"none"!==i?this.FocusOut(null):(this.stopEvent(t),this.refocus=this.rootNode(),this.Start())}spaceKey(){return this.refocus=this.current,!0}hKey(){if(!this.document.options.enableExplorerHelp)return!0;this.refocus=this.current,this.help()}escapeKey(){return this.Stop(),this.focusTop(),this.setCurrent(null),!0}tabKey(t){if(0===this.anchors.length||!this.current)return!0;if(this.backTab){if(!t.shiftKey)return!0;const e=this.linkFor(this.anchors[this.anchors.length-1]);return 1===this.anchors.length&&e===this.current||void this.setCurrent(e)}const[e,i,s]=t.shiftKey?[this.anchors.slice(0).reverse(),Node.DOCUMENT_POSITION_PRECEDING,this.isLink()?this.getAnchor():this.current]:[this.anchors,Node.DOCUMENT_POSITION_FOLLOWING,this.current];for(const t of e)if(s.compareDocumentPosition(t)&i)return void this.setCurrent(this.linkFor(t));return!0}enterKey(t){if(this.active)if(this.triggerLinkKeyboard(t))this.Stop();else{const t=this.actionable(this.current);if(!t)return!1;this.refocus=t,t.dispatchEvent(new Event("click"))}else this.Start()}homeKey(){this.setCurrent(this.rootNode())}moveDown(t){return t?this.moveToNeighborCell(1,0):this.moveTo(this.firstNode(this.current))}moveUp(t){return t?this.moveToNeighborCell(-1,0):this.moveTo(this.getParent(this.current))}moveRight(t){return t?this.moveToNeighborCell(0,1):this.moveTo(this.nextSibling(this.current))}moveLeft(t){return t?this.moveToNeighborCell(0,-1):this.moveTo(this.prevSibling(this.current))}moveTo(t){if(!t)return!1;this.setCurrent(t)}moveToNeighborCell(t,e){const i=this.tableCell(this.current);if(!i)return!1;const[s,r]=this.cellPosition(i);if(null==s)return!1;const n=this.cellAt(this.cellTable(i),s+t,r+e);if(!n)return!1;this.setCurrent(n)}undefinedKey(t){return!this.active||nf(t)}addMark(){this.current===this.marks[this.marks.length-1]?this.setCurrent(this.current):(this.currentMark=this.marks.length-1,this.marks.push(this.current),this.speak("Position marked"))}prevMark(){if(this.currentMark<0){if(0===this.marks.length)return void this.setCurrent(this.lastMark||this.rootNode());this.currentMark=this.marks.length-1}const t=this.currentMark;this.setCurrent(this.marks[t]),this.currentMark=t-1}clearMarks(){this.marks=[],this.currentMark=-1,this.prevMark()}autoVoice(){const t=!this.document.options.a11y.voicing;this.document.menu?this.document.menu.menu.pool.lookup("voicing").setValue(t):this.document.options.a11y.voicing=t,this.Update()}toggleBraille(){const t=!this.document.options.a11y.brailleCombine;this.document.menu?this.document.menu.menu.pool.lookup("brailleCombine").setValue(t):this.document.options.a11y.brailleCombine=t}numberKey(t){if(!this.tableCell(this.current))return!1;if(0===t&&(t=10),this.pendingIndex.length){const e=this.cellTable(this.tableCell(this.current)),i=this.cellAt(e,this.pendingIndex[0]-1,t-1);if(this.pendingIndex=[],this.speak(String(t)),!i)return!1;setTimeout((()=>this.setCurrent(i)),500)}else this.pendingIndex=[null,t],this.speak(`Jump to row ${t} and column`)}depth(){var t,e,i;if("d"===this.speechType)return void this.setCurrent(this.current);this.speechType="d";const s=[[null!==(t=this.node.getAttribute("data-semantic-level"))&&void 0!==t?t:"Level",null!==(e=this.current.getAttribute("data-semantic-level-number"))&&void 0!==e?e:"0"].join(" ").trim()],r=this.actionable(this.current);r&&s.unshift(null!==(i=this.node.getAttribute("1"===r.getAttribute("toggle")?"data-semantic-expandable":"data-semantic-collapsible"))&&void 0!==i?i:""),this.speak(s.join(" "),this.current.getAttribute(km.BRAILLE))}summary(){if("x"===this.speechType)return void this.setCurrent(this.current);this.speechType="x";const t=this.current.getAttribute(km.SUMMARY);this.speak(t,this.current.getAttribute(km.BRAILLE),this.SsmlAttributes(this.current,km.SUMMARY_SSML))}nextRules(){this.node.removeAttribute("data-speech-attached"),this.restartAfter(this.generators.nextRules(this.item))}nextStyle(){this.node.removeAttribute("data-speech-attached"),this.restartAfter(this.generators.nextStyle(this.current,this.item))}details(){const t=this.actionable(this.current);if(!t||!t.getAttribute("data-collapsible")||"1"!==t.getAttribute("toggle")||"z"===this.speechType)return void this.setCurrent(this.current);this.speechType="z";const e=this.nodeId(this.current);let i;this.item.root.walkTree((t=>{t.attributes.get("data-semantic-id")===e&&(i=t)}));let s=this.item.toMathML(i,this.item);i.isKind("math")||(s=`<math>${s}</math>`),s=s.replace(/ (?:data-semantic-|aria-|data-speech-|data-latex).*?=".*?"/g,""),this.item.speechFor(s).then((([t,e])=>this.speak(t,e)))}help(){if(!this.document.options.enableExplorerHelp)return;const t=this.constructor,[e,i,s]=t.helpData.get(Ri.os);Ln.post({title:"MathJax Expression Explorer Help",message:t.helpMessage(e,i,s),node:this.node,adaptor:this.document.adaptor,styles:{".mjx-dialog":{"max-height":"calc(min(35em, 90%))"},"mjx-dialog mjx-title":{"font-size":"133%",margin:".5em 1.75em"},"mjx-dialog h2":{"font-size":"20px",margin:".5em 0"},"mjx-dialog ul":{"list-style-type":"none"},"mjx-dialog li":{"margin-bottom":".5em"}}})}setCurrent(t,e=!1){if(this.backTab=!1,this.speechType="",document.hasFocus()||(this.refocus=this.current),this.node.setAttribute("aria-busy","true"),this.current){this.pool.unhighlight();for(const t of Array.from(this.node.querySelectorAll(".mjx-selected")))t.classList.remove("mjx-selected");"last"===this.document.options.a11y.tabSelects&&(this.refocus=this.current),t||(this.lastMark=this.current,this.removeSpeech()),this.current=null}if(this.current=t,this.currentMark=-1,this.current){const i=[...this.getSplitNodes(this.current)];this.highlighter.encloseNodes(i,this.node);for(const t of i)t.getAttribute("data-sre-enclosed")||t.classList.add("mjx-selected");this.pool.highlight(i),this.addSpeech(t,e),this.node.setAttribute("tabindex","-1"),this.Update()}this.node.removeAttribute("aria-busy")}getSplitNodes(t){const e=this.nodeId(t);if(!e)return[t];if(this.cacheParts.has(e))return this.cacheParts.get(e);const i=Array.from(this.node.querySelectorAll(`[data-semantic-id="${e}"]`)),s=this.subtree(e,i);return this.cacheParts.set(e,[...i,...s]),this.cacheParts.get(e)}subtree(t,e){const i=this.subtrees.get(t),s=new Set;for(const t of e)Array.from(t.querySelectorAll("[data-semantic-id]")).forEach((t=>s.add(this.nodeId(t))));return[...function(t,e){if(!t)return new Set;if(!e)return t;return new Set([...t].filter((t=>!e.has(t))))}(i,s)].map((t=>this.getNode(t))).filter((t=>null!==t))}addSpeech(t,e){var i;if(!this.document.options.enableSpeech&&!this.document.options.enableBraille)return;this.anchors.length?setTimeout((()=>{var t;return null===(t=this.img)||void 0===t?void 0:t.remove()}),10):null===(i=this.img)||void 0===i||i.remove();let s=this.addComma([t.getAttribute(km.PREFIX),t.getAttribute(km.SPEECH),t.getAttribute(km.POSTFIX)]).join(" ").trim();if(e){let t=this.description===this.none?"":", "+this.description;this.document.options.a11y.help&&this.document.options.enableExplorerHelp&&(t+=", press h for help"),s+=t}this.speak(s,t.getAttribute(km.BRAILLE),this.SsmlAttributes(t,km.SPEECH_SSML))}addComma(t){return t[2]&&(t[1]||t[0])&&(t[1]+=","),t}removeSpeech(){this.speech&&(this.unspeak(this.speech),this.speech=null,this.img&&this.node.append(this.img),this.node.setAttribute("tabindex","0"))}speak(t,e="",i=null,s=this.none){const r=this.speech,n=this.speech=document.createElement("mjx-speech");if(n.setAttribute("role",this.role),n.setAttribute("aria-label",t||this.none),n.setAttribute("aria-roledescription",s||this.none),n.setAttribute(km.SPEECH,t),i&&(n.setAttribute(km.PREFIX_SSML,i[0]||""),n.setAttribute(km.SPEECH_SSML,i[1]||""),n.setAttribute(km.POSTFIX_SSML,i[2]||"")),e&&(this.document.options.a11y.brailleSpeech&&(n.setAttribute("aria-label",e),n.setAttribute("aria-roledescription",this.brailleNone)),n.setAttribute("aria-braillelabel",e),n.setAttribute("aria-brailleroledescription",this.brailleNone),this.document.options.a11y.brailleCombine&&n.setAttribute("aria-label",e+ef+t)),n.setAttribute("tabindex","0"),tf){const t=document.createElement("mjx-speech-container");t.setAttribute("role","application"),t.setAttribute("aria-roledescription",this.none),t.setAttribute("aria-brailleroledescription",this.brailleNone),t.append(n),this.node.append(t),n.setAttribute("role","img")}else this.node.append(n);this.focusSpeech=!0,n.focus(),this.focusSpeech=!1,this.Update(),r&&setTimeout((()=>this.unspeak(r)),100)}unspeak(t){tf&&(t=t.parentElement),t.remove()}attachSpeech(){var t;const e=this.item,i=this.node;if(!i.hasAttribute("has-speech")){for(const t of Array.from(i.childNodes))t.setAttribute("aria-hidden","true");i.setAttribute("has-speech","true")}const s=e.roleDescription,r=(i.getAttribute(km.SPEECH)||"")+(s?", "+s:"");null===(t=this.img)||void 0===t||t.remove(),this.img=this.document.adaptor.node("mjx-speech",{"aria-label":r,role:"img","aria-roledescription":e.none});const n=i.getAttribute(km.BRAILLE);n&&(this.document.options.a11y.brailleSpeech&&(this.img.setAttribute("aria-label",n),this.img.setAttribute("aria-roledescription",this.brailleNone)),this.img.setAttribute("aria-braillelabel",n),this.img.setAttribute("aria-brailleroledescription",this.brailleNone),this.document.options.a11y.brailleCombine&&this.img.setAttribute("aria-label",n+ef+r)),i.appendChild(this.img),this.adjustAnchors()}detachSpeech(){var t;const e=this.node;null===(t=this.img)||void 0===t||t.remove(),e.removeAttribute("has-speech");for(const t of Array.from(e.childNodes))t.removeAttribute("aria-hidden");this.restoreAnchors()}adjustAnchors(){this.anchors=Array.from(this.node.querySelectorAll("a[href]"));for(const t of this.anchors){const e=t.getAttribute("href");t.setAttribute("data-mjx-href",e),t.removeAttribute("href")}this.anchors.length&&this.img.setAttribute("tabindex","0")}restoreAnchors(){for(const t of this.anchors)t.setAttribute("href",t.getAttribute("data-mjx-href")),t.removeAttribute("data-mjx-href");this.anchors=[]}focus(){this.node.focus()}nodeId(t){return t.getAttribute("data-semantic-id")}parentId(t){return t.getAttribute("data-semantic-parent")}getNode(t){return t?this.node.querySelector(`[data-semantic-id="${t}"]`):null}getParent(t){return this.getNode(this.parentId(t))}childArray(t){return t?t.getAttribute("data-semantic-children").split(/,/):[]}isCell(t){return!!t&&this.cellTypes.includes(t.getAttribute("data-semantic-type"))}isRow(t){return!!t&&"row"===t.getAttribute("data-semantic-type")}tableCell(t){for(;t&&t!==this.node;){if(this.isCell(t))return t;t=t.parentNode}return null}cellTable(t){const e=this.getParent(t);return this.isRow(e)?this.getParent(e):e}cellPosition(t){const e=this.getParent(t),i=this.childArray(e).indexOf(this.nodeId(t));if(!this.isRow(e))return[i,1];const s=this.getParent(e);return[this.childArray(s).indexOf(this.nodeId(e)),i]}cellAt(t,e,i){const s=this.getNode(this.childArray(t)[e]);if(!this.isRow(s))return 1===i?s:null;return this.getNode(this.childArray(s)[i])}firstNode(t){const e=t.getAttribute("data-semantic-owns");if(!e)return t.querySelector(sf);const i=e.split(/ /);for(const t of i){const e=this.getNode(t);if(null==e?void 0:e.hasAttribute("data-speech-node"))return e}return t.querySelector(sf)}rootNode(){const t=this.node.querySelector("[data-semantic-structure]");if(!t)return this.node.querySelector(sf);const e=t.getAttribute("data-semantic-structure").split(/ /)[0].replace("(","");return this.getNode(e)}nextSibling(t){var e;const i=this.parentId(t);if(!i)return null;const s=null===(e=this.getNode(i).getAttribute("data-semantic-owns"))||void 0===e?void 0:e.split(/ /);if(!s)return null;let r,n=s.indexOf(this.nodeId(t));do{r=this.getNode(s[++n])}while(r&&!r.hasAttribute("data-speech-node"));return r}prevSibling(t){var e;const i=this.parentId(t);if(!i)return null;const s=null===(e=this.getNode(i).getAttribute("data-semantic-owns"))||void 0===e?void 0:e.split(/ /);if(!s)return null;let r,n=s.indexOf(this.nodeId(t));do{r=this.getNode(s[--n])}while(r&&!r.hasAttribute("data-speech-node"));return r}findClicked(t,e,i){const s=this.document.infoIcon;if(s===t||s.contains(t))return s;if("SVG"!==this.node.getAttribute("jax"))return t.closest(sf);let r=null,n=this.node;for(;n;){n.matches(sf)&&(r=n);const t=Array.from(n.childNodes);n=null;for(const s of t)if(s!==this.speech&&s!==this.img&&s.tagName&&"rect"!==s.tagName.toLowerCase()){const{left:t,right:r,top:o,bottom:a}=s.getBoundingClientRect();if(t<=e&&e<=r&&o<=i&&i<=a){n=s;break}}}return r}isLink(t=this.current){var e;return!!(null===(e=null==t?void 0:t.getAttribute("data-semantic-attributes"))||void 0===e?void 0:e.includes("href:"))}getAnchor(t=this.current){const e=t.closest("a");return e&&this.node.contains(e)?e:null}linkFor(t){return null==t?void 0:t.querySelector('[data-semantic-attributes*="href:"]')}parentLink(t){const e=null==t?void 0:t.closest('[data-semantic-attributes*="href:"]');return e&&this.node.contains(e)?e:null}focusTop(){this.focusSpeech=!0,this.node.focus(),this.focusSpeech=!1}SsmlAttributes(t,e){return[t.getAttribute(km.PREFIX_SSML),t.getAttribute(e),t.getAttribute(km.POSTFIX_SSML)]}restartAfter(t){return Zm(this,void 0,void 0,(function*(){yield t,this.attachSpeech();const e=this.current;this.current=null,this.pool.unhighlight(),this.setCurrent(e)}))}constructor(t,e,i,s,r,n,o,a){super(t,e,null,s),this.document=t,this.pool=e,this.region=i,this.node=s,this.brailleRegion=r,this.magnifyRegion=n,this.item=a,this.sound=!1,this.current=null,this.clicked=null,this.refocus=null,this.focusSpeech=!1,this.restarted=null,this.speech=null,this.speechType="",this.img=null,this.attached=!1,this.eventsAttached=!1,this.marks=[],this.currentMark=-1,this.lastMark=null,this.pendingIndex=[],this.cellTypes=["cell","line"],this.backTab=!1,this.events=super.Events().concat([["focusin",this.FocusIn.bind(this)],["focusout",this.FocusOut.bind(this)],["keydown",this.KeyDown.bind(this)],["mousedown",this.MouseDown.bind(this)],["click",this.Click.bind(this)],["dblclick",this.DblClick.bind(this)]]),this.subtrees=null,this.cacheParts=new Map}findStartNode(){let t=this.refocus||this.current;return!t&&this.restarted&&(t=this.node.querySelector(this.restarted)),this.refocus=this.restarted=null,t}Start(){const t=Object.create(null,{Start:{get:()=>super.Start}});return Zm(this,void 0,void 0,(function*(){if(this.subtrees||(this.subtrees=new Map,this.getSubtrees()),!this.attached||this.active)return;if(this.document.activeItem=this.item,this.item.state()<Ns.ATTACHSPEECH&&(this.item.attachSpeech(this.document),yield this.generators.promise),this.focusSpeech)return;this.node.classList.add("mjx-explorer-active"),this.document.options.enableExplorerHelp&&this.node.append(this.document.infoIcon);const e=this.findStartNode();this.setCurrent(e||this.rootNode(),!e),t.Start.call(this);const i=this.document.options,s=i.a11y;s.subtitles&&s.speech&&i.enableSpeech&&this.region.Show(this.node),s.viewBraille&&s.braille&&i.enableBraille&&this.brailleRegion.Show(this.node),s.keyMagnifier&&this.magnifyRegion.Show(this.current),this.Update()}))}Stop(){this.active&&(this.node.classList.remove("mjx-explorer-active"),this.document.options.enableExplorerHelp&&this.document.infoIcon.remove(),this.pool.unhighlight(),this.magnifyRegion.Hide(),this.region.Hide(),this.brailleRegion.Hide()),super.Stop()}Update(){this.active&&(this.region.node=this.node,(this.document.options.enableSpeech||this.document.options.enableBraille)&&this.generators.updateRegions(this.speech||this.node,this.region,this.brailleRegion),this.magnifyRegion.Update(this.current))}Attach(){this.attached||(super.Attach(),this.node.setAttribute("tabindex","0"),this.attached=!0)}Detach(){var t;super.RemoveEvents(),this.node.removeAttribute("role"),this.node.removeAttribute("aria-roledescription"),this.node.removeAttribute("aria-label"),null===(t=this.img)||void 0===t||t.remove(),this.active&&this.node.setAttribute("tabindex","0"),this.attached=!1}NoMove(){Om()}AddEvents(){this.eventsAttached||(super.AddEvents(),this.eventsAttached=!0)}actionable(t){const e=null==t?void 0:t.parentNode;return e&&this.highlighter.isMactionNode(e)?e:null}triggerLinkKeyboard(t){return this.current?this.triggerLink(this.current):t.target instanceof HTMLAnchorElement&&(t.target.dispatchEvent(new MouseEvent("click")),!0)}triggerLink(t){if(this.isLink(t)){const e=this.getAnchor(t);return e.classList.add("mjx-visited"),setTimeout((()=>this.FocusOut(null)),50),window.location.href=e.getAttribute("data-mjx-href"),!0}return!1}triggerLinkMouse(){const t=this.parentLink(this.refocus);return!!this.triggerLink(t)}semanticFocus(){const t=[];let e="data-semantic-id",i=this.current||this.refocus||this.node;const s=this.actionable(i);s&&(e=s.hasAttribute("data-maction-id")?"data-maction-id":"id",i=s,t.push(sf));const r=i.getAttribute(e);return r&&t.unshift(`[${e}="${r}"]`),t.join(" ")}getSubtrees(){const t=this.node.querySelector("[data-semantic-structure]");if(!t)return;const e=t.getAttribute("data-semantic-structure");const i=function(t){const e=[[]];for(const i of t)if("("===i){const t=[];e[e.length-1].push(t),e.push(t)}else")"===i?e.pop():e[e.length-1].push(i);return e[0][0]}(e.replace(/\(/g," ( ").replace(/\)/g," ) ").trim().split(/\s+/));af(i,this.subtrees)}}function af(t,e){if("string"==typeof t)return e.has(t)||e.set(t,new Set),new Set;const[i,...s]=t,r=i,n=new Set;for(const t of s){const i="string"==typeof t?t:t[0],s=af(t,e);n.add(i),s.forEach((t=>n.add(t)))}return e.set(r,n),n}of.helpData=new Map([["MacOS",["on MacOS and iOS using VoiceOver",", or the VoiceOver arrow keys to select an expression",""]],["Windows",["in Windows using NVDA or JAWS",". The screen reader should enter focus or forms mode automatically\n when the expression gets the browser focus, but if not, you can toggle\n focus mode using NVDA+space in NVDA; for JAWS, Enter should start\n forms mode while Numpad Plus leaves it. Also note that you can use\n the NVDA or JAWS key plus the arrow keys to explore the expression\n even in browse mode, and you can use NVDA+shift+arrow keys to\n navigate out of an expression that has the focus in NVDA","NVDA users need to select this option, while JAWS users should be able\n to get Braille output without changing this setting."]],["Unix",["in Unix using Orca",", and Orca should enter focus mode automatically. If not, use the\n Orca+a key to toggle focus mode on or off. Also note that you can use\n Orca+arrow keys to explore expressions even in browse mode",""]],["unknown",["with a Screen Reader.","",""]]]),of.keyMap=new Map([["Tab",[(t,e)=>t.tabKey(e)]],["Escape",[t=>t.escapeKey()]],["Enter",[(t,e)=>t.enterKey(e)]],["Home",[t=>t.homeKey()]],["ArrowDown",[(t,e)=>t.moveDown(e.shiftKey),!0]],["ArrowUp",[(t,e)=>t.moveUp(e.shiftKey),!0]],["ArrowLeft",[(t,e)=>t.moveLeft(e.shiftKey),!0]],["ArrowRight",[(t,e)=>t.moveRight(e.shiftKey),!0]],[" ",[t=>t.spaceKey()]],["h",[t=>t.hKey()]],[">",[t=>t.nextRules(),!1]],["<",[t=>t.nextStyle(),!1]],["x",[t=>t.summary(),!1]],["z",[t=>t.details(),!1]],["d",[t=>t.depth(),!1]],["v",[t=>t.addMark(),!1]],["p",[t=>t.prevMark(),!1]],["u",[t=>t.clearMarks(),!1]],["s",[t=>t.autoVoice(),!1]],["b",[t=>t.toggleBraille(),!1]],...[..."0123456789"].map((t=>[t,[e=>e.numberKey(parseInt(t)),!1]]))]);class lf extends Qm{constructor(){super(...arguments),this.events=super.Events().concat([["mouseover",this.MouseOver.bind(this)],["mouseout",this.MouseOut.bind(this)]])}MouseOver(t){this.Start()}MouseOut(t){this.Stop()}}class cf extends lf{constructor(t,e,i,s,r,n){super(t,e,i,s),this.document=t,this.pool=e,this.region=i,this.node=s,this.nodeQuery=r,this.nodeAccess=n}MouseOut(t){this.highlighter.unhighlight(),this.region.Hide(),super.MouseOut(t)}MouseOver(t){super.MouseOver(t);const e=t.target,[i,s]=this.getNode(e);i&&(this.highlighter.unhighlight(),this.highlighter.highlight([i]),this.region.Update(s),this.region.Show(i))}getNode(t){const e=t;for(;t&&t!==this.node;){if(this.nodeQuery(t))return[t,this.nodeAccess(t)];t=t.parentNode}for(t=e;t;){if(this.nodeQuery(t))return[t,this.nodeAccess(t)];const e=t.childNodes[0];t=e&&"defs"===e.tagName?t.childNodes[1]:e}return[null,null]}}class hf extends cf{}class df extends cf{}class uf extends cf{constructor(t,e,i,s){super(t,e,new zm(t),s,(t=>this.highlighter.isMactionNode(t)),(()=>{})),this.document=t,this.pool=e,this.node=s}}class pf extends Qm{constructor(t,e,i,s,r){super(t,e,null,s),this.document=t,this.pool=e,this.region=i,this.node=s,this.mml=r,this.stoppable=!1}Attach(){super.Attach(),this.Start()}Detach(){this.Stop(),super.Detach()}}class mf extends pf{Start(){this.active||(this.active=!0,this.highlighter.highlightAll(this.node))}Stop(){this.active&&this.highlighter.unhighlightAll(),this.active=!1}}class ff extends pf{constructor(){super(...arguments),this.contrast=new gf,this.leaves=[],this.modality="data-semantic-foreground"}Start(){this.active||(this.active=!0,this.node.hasAttribute("hasforegroundcolor")||(this.colorLeaves(),this.node.setAttribute("hasforegroundcolor","true")),this.leaves.forEach((t=>this.colorize(t))))}Stop(){this.active&&this.leaves.forEach((t=>this.uncolorize(t))),this.active=!1}colorLeaves(){this.leaves=Array.from(this.node.querySelectorAll("[data-semantic-id]:not([data-semantic-children])"));for(const t of this.leaves)t.setAttribute(this.modality,this.contrast.generate()),this.contrast.increment()}colorize(t){t.hasAttribute(this.modality)&&(t.setAttribute(this.modality+"-old",t.style.color),t.style.color=t.getAttribute(this.modality))}uncolorize(t){const e=this.modality+"-old";t.hasAttribute(e)&&(t.style.color=t.getAttribute(e))}}class gf{constructor(){this.hue=10,this.sat=100,this.light=50,this.incr=53}generate(){return gf.hsl2rgb(this.hue,this.sat,this.light)}increment(){this.hue=(this.hue+this.incr)%360}static hsl2rgb(t,e,i){e=e>1?e/100:e,i=i>1?i/100:i;const s=(1-Math.abs(2*i-1))*e,r=s*(1-Math.abs(t/60%2-1)),n=i-s/2;let o=0,a=0,l=0;return 0<=t&&t<60?[o,a,l]=[s,r,0]:60<=t&&t<120?[o,a,l]=[r,s,0]:120<=t&&t<180?[o,a,l]=[0,s,r]:180<=t&&t<240?[o,a,l]=[0,r,s]:240<=t&&t<300?[o,a,l]=[r,0,s]:300<=t&&t<360&&([o,a,l]=[s,0,r]),`rgb(${255*(o+n)}, ${255*(a+n)}, ${255*(l+n)})`}}const bf={color:"blue",alpha:.2},Ef={color:"black",alpha:1},xf={ENCLOSED:"data-sre-enclosed",BBOX:"data-sre-highlighter-bbox",ADDED:"data-sre-highlighter-added"};class yf{constructor(t){this.currentHighlights=[],this.priority=t,this.ATTR="data-sre-highlight-"+t}highlight(t){this.currentHighlights.push(t);for(const e of t)this.highlightNode(e),this.setHighlighted(e)}highlightAll(t){const e=this.getMactionNodes(t);for(const t of e)this.highlight([t])}unhighlight(){const t=this.currentHighlights.pop();t&&t.forEach((t=>{this.isHighlighted(t)&&(this.unhighlightNode(t),this.unsetHighlighted(t))}))}unhighlightAll(){for(;this.currentHighlights.length>0;)this.unhighlight()}encloseNodes(t,e){if(1===t.length)return t;const i=this.constructor,s=i.lineSelector,r=i.lineAttr,n=new Map;for(const e of t){const t=e.closest(s),i=t?t.getAttribute(r):"";n.has(i)||n.set(i,[]),n.get(i).push(e)}for(const i of n.values())if(i.length>1){let[s,r,n,o]=[1/0,1/0,-1/0,-1/0];for(const t of i){t.setAttribute(xf.ENCLOSED,"true");const{left:e,top:i,right:a,bottom:l}=t.getBoundingClientRect();i===l&&e===a||(e<s&&(s=e),i<r&&(r=i),l>o&&(o=l),a>n&&(n=a))}const a=this.createEnclosure(s,o,n-s,o-r,e,i[0]);t.push(a)}return t}setColorCSS(t,e,i){var s,r;const n=null!==(s=e.color)&&void 0!==s?s:i.color,o=null!==(r=e.alpha)&&void 0!==r?r:i.alpha;Km.setColor(t,this.priority,n,o)}setColor(t,e){this.setColorCSS("fg",e,Ef),this.setColorCSS("bg",t,bf)}isHighlighted(t){return t.hasAttribute(this.ATTR)}setHighlighted(t){t.setAttribute(this.ATTR,"true")}unsetHighlighted(t){t.removeAttribute(this.ATTR),t.removeAttribute(xf.ENCLOSED)}}class Nf extends yf{highlightNode(t){if(this.isHighlighted(t)||"svg"===t.tagName||"MJX-CONTAINER"===t.tagName||t.hasAttribute(xf.BBOX)||t.hasAttribute(xf.ENCLOSED))return;const{x:e,y:i,width:s,height:r}=t.getBBox(),n=this.createRect(e,i,s,r,t.getAttribute("transform"));this.setHighlighted(n),t.parentNode.insertBefore(n,t)}unhighlightNode(t){if(t.hasAttribute(xf.BBOX))return void t.remove();const e=t.previousSibling;(null==e?void 0:e.hasAttribute(xf.ADDED))&&e.remove()}createEnclosure(t,e,i,s,r,n){const[o,a]=this.screen2svg(t,e,n),[l,c]=this.screen2svg(t+i,e-s,n),h=this.createRect(o,a,l-o,c-a,n.getAttribute("transform"));return h.setAttribute(xf.BBOX,"true"),n.parentNode.insertBefore(h,n),h}screen2svg(t,e,i){const s=i,r=DOMPoint.fromPoint({x:t,y:e}).matrixTransform(s.getScreenCTM().inverse());return[r.x,r.y]}createRect(t,e,i,s,r){const n=document.createElementNS("http://www.w3.org/2000/svg","rect");return n.setAttribute(xf.ADDED,"true"),n.setAttribute("x",String(t-40)),n.setAttribute("y",String(e-40)),n.setAttribute("width",String(i+80)),n.setAttribute("height",String(s+80)),r&&n.setAttribute("transform",r),n}isMactionNode(t){return"maction"===t.getAttribute("data-mml-node")}getMactionNodes(t){return Array.from(t.querySelectorAll('[data-mml-node="maction"]'))}}Nf.lineSelector="[data-mjx-linebox]",Nf.lineAttr="data-mjx-lineno";class vf extends yf{highlightNode(t){}unhighlightNode(t){"mjx-bbox"===t.tagName.toLowerCase()&&t.remove()}createEnclosure(t,e,i,s,r){const n=r.getBoundingClientRect(),o=document.createElement("mjx-bbox");return o.style.width=i+"px",o.style.height=s+"px",o.style.left=t-n.left+"px",o.style.top=e-s-n.top+"px",o.style.position="absolute",r.prepend(o),o}isMactionNode(t){var e;return"mjx-maction"===(null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase())}getMactionNodes(t){return Array.from(t.querySelectorAll("mjx-maction"))}}function Tf(t,e,i,s){const r=new _f[s](t);return r.setColor(e,i),r}vf.lineSelector="mjx-linebox",vf.lineAttr="lineno";const _f={SVG:Nf,CHTML:vf,generic:vf};class Lf{constructor(t){this.document=t,this.speechRegion=new $m(this.document),this.brailleRegion=new Km(this.document),this.magnifier=new Ym(this.document),this.tooltip1=new Jm(this.document),this.tooltip2=new Jm(this.document),this.tooltip3=new Jm(this.document)}}const Cf={speech:(t,e,i,...s)=>{const r=of.create(t,e,t.explorerRegions.speechRegion,i,t.explorerRegions.brailleRegion,t.explorerRegions.magnifier,s[0],s[1]);return r.sound=!0,r},mouseMagnifier:(t,e,i,...s)=>df.create(t,e,t.explorerRegions.magnifier,i,(t=>t.hasAttribute("data-semantic-type")),(t=>t)),hover:(t,e,i,...s)=>uf.create(t,e,null,i),infoType:(t,e,i,...s)=>hf.create(t,e,t.explorerRegions.tooltip1,i,(t=>t.hasAttribute("data-semantic-type")),(t=>t.getAttribute("data-semantic-type"))),infoRole:(t,e,i,...s)=>hf.create(t,e,t.explorerRegions.tooltip2,i,(t=>t.hasAttribute("data-semantic-role")),(t=>t.getAttribute("data-semantic-role"))),infoPrefix:(t,e,i,...s)=>hf.create(t,e,t.explorerRegions.tooltip3,i,(t=>{var e;return null===(e=t.hasAttribute)||void 0===e?void 0:e.call(t,"data-semantic-prefix-none")}),(t=>{var e;return null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"data-semantic-prefix-none")})),flame:(t,e,i,...s)=>mf.create(t,e,null,i),treeColoring:(t,e,i,...s)=>ff.create(t,e,null,i,...s)};class Rf{constructor(){this.explorers={},this.attached=[],this._restart=[],this.speechExplorerKeys=["speech","braille","keyMagnifier"]}get highlighter(){if(this._renderer!==this.document.outputJax.name)return this._renderer=this.document.outputJax.name,this.setPrimaryHighlighter(),this._highlighter;const[t,e]=this.colorOptions();return this._highlighter.setColor(e,t),this._highlighter}init(t,e,i,s){this.document=t,this.mml=i,this.node=e,this.setPrimaryHighlighter();for(const t of Object.keys(Cf))this.explorers[t]=Cf[t](this.document,this,this.node,this.mml,s);this.setSecondaryHighlighter(),this.attach()}attach(){this.attached=[];const t=[],e=this.document.options.a11y;for(const[i,s]of Object.entries(this.explorers))s instanceof of?(s.stoppable=!1,t.unshift(s),this.speechExplorerKeys.some((t=>this.document.options.a11y[t]))?(s.Attach(),this.attached.push(i)):s.Detach()):e[i]||"speech"===i&&(e.braille||e.keyMagnifier)?(s.Attach(),this.attached.push(i)):s.Detach();for(const e of t)if(e.attached){e.stoppable=!0;break}}reattach(){for(const t of this.attached){const e=this.explorers[t];e.active&&(this._restart.push(t),e.Stop())}}restart(){this._restart.forEach((t=>{this.explorers[t].Start()})),this._restart=[]}setPrimaryHighlighter(){const[t,e]=this.colorOptions();this._highlighter=Tf(Km.priority.primary,e,t,this.document.outputJax.name)}setSecondaryHighlighter(){this.secondaryHighlighter=Tf(Km.priority.secondary,{color:"red"},{color:"black"},this.document.outputJax.name),this.speech.region.highlighter=this.secondaryHighlighter}highlight(t){this.highlighter.highlight(t)}unhighlight(){this.secondaryHighlighter.unhighlight(),this.highlighter.unhighlight()}get speech(){return this.explorers.speech}colorOptions(){const t=this.document.options.a11y;return[{color:t.foregroundColor.toLowerCase(),alpha:t.foregroundOpacity/100},{color:t.backgroundColor.toLowerCase(),alpha:t.backgroundOpacity/100}]}}const wf="Unix"===Ri.os;function If(t,e){var i;return i=class extends t{constructor(){super(...arguments),this.refocus=null}get ariaRole(){return this.constructor.ariaRole}get roleDescription(){const t=this.constructor;return"none"===t.roleDescription?t.none:t.roleDescription}get none(){return this.constructor.none}get brailleNone(){return this.constructor.brailleNone}attachSpeech(t){var e,i;super.attachSpeech(t),null===(i=null===(e=this.outputData.speechPromise)||void 0===e?void 0:e.then((()=>this.explorers.speech.attachSpeech())))||void 0===i||i.then((()=>{var t;(null===(t=this.explorers)||void 0===t?void 0:t.speech)&&(this.explorers.speech.restarted=this.refocus),this.refocus=null,this.explorers&&this.explorers.restart()}))}detachSpeech(t){super.detachSpeech(t),this.explorers.speech.detachSpeech()}explorable(t,i=!1){if(!(this.state()>=Ns.EXPLORER)){if(!this.isEscaped&&(t.options.enableExplorer||i)){const i=this.typesetRoot,s=e(this.root);this.explorers||(this.explorers=new Rf),this.explorers.init(t,i,s,this)}this.state(Ns.EXPLORER)}}state(t=null,e=!1){if(t<Ns.EXPLORER&&this.explorers)for(const t of Object.values(this.explorers.explorers))t.active&&t.Stop();return super.state(t,e)}rerender(t,e=Ns.RERENDER){const i=this.setTemporaryFocus(t);super.rerender(t,e),this.clearTemporaryFocus(i)}setTemporaryFocus(t){var e;let i=null;if(this.explorers){const s=this.explorers.speech;if(i=(null==s?void 0:s.attached)?t.tmpFocus:null,i){this.refocus=null!==(e=s.semanticFocus())&&void 0!==e?e:null;const r=t.adaptor;r.append(r.body(),i)}this.explorers.reattach(),null==i||i.focus()}return i}clearTemporaryFocus(t){var e;if(t){(null!==(e=this.outputData.speechPromise)&&void 0!==e?e:Promise.resolve()).then((()=>setTimeout((()=>t.remove()),100)))}}},i.ariaRole=wf?"tree":"application",i.roleDescription="math",i.none="\x91",i.brailleNone="\u2800",i}function Sf(t){var e;return e=class extends t{constructor(...t){super(...t),this.explorerRegions=null,this.activeItem=null;const e=this.constructor.ProcessBits;e.has("explorer")||e.allocate("explorer");const i=new dn(this.mmlFactory),s=this.options;s.a11y.speechRules||(s.a11y.speechRules=`${s.sre.domain}-${s.sre.style}`);const r=s.MathItem=If(s.MathItem,(t=>i.visitTree(t)));r.roleDescription=s.roleDescription,this.explorerRegions=new Lf(this),"addStyles"in this&&this.addStyles(this.constructor.speechStyles);const n=this.adaptor,o="http://www.w3.org/2000/svg";this.infoIcon=n.node("mjx-help",{},[n.node("svg",{viewBox:"0 0 18 18",xmlns:o,"aria-hidden":"true"},[n.node("circle",{stroke:"none"},[],o),n.node("circle",{},[],o),n.node("line",{x1:9,y1:9,x2:9,y2:13},[],o),n.node("line",{x1:9,y1:5.5,x2:9,y2:5.5},[],o)],o)]),this.tmpFocus=n.node("mjx-focus",{tabIndex:0,style:{outline:"none",display:"block",position:"absolute",top:0,left:"-10px",width:"1px",height:"1px",overflow:"hidden"},role:r.ariaRole,"aria-label":r.none,"aria-roledescription":r.none})}explorable(){if(!this.processed.isSet("explorer")){if(this.options.enableExplorer)for(const t of this.math)t.explorable(this);this.processed.set("explorer")}return this}rerender(t){const e=this.activeItem,i=null==e?void 0:e.setTemporaryFocus(this);return super.rerender(t),null==e||e.clearTemporaryFocus(i),this}state(t,e=!1){return super.state(t,e),t<Ns.EXPLORER&&this.processed.clear("explorer"),this}},e.OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableExplorer:Ci,enableExplorerHelp:!0,renderActions:Xi(Object.assign(Object.assign({},t.OPTIONS.renderActions),{explorable:[Ns.EXPLORER]})),sre:Xi(Object.assign(Object.assign({},t.OPTIONS.sre),{speech:"none"})),a11y:Object.assign(Object.assign({},t.OPTIONS.a11y),{align:"top",backgroundColor:"Blue",backgroundOpacity:20,flame:!1,foregroundColor:"Black",foregroundOpacity:100,highlight:"None",hover:!1,infoPrefix:!1,infoRole:!1,infoType:!1,keyMagnifier:!1,magnification:"None",magnify:"400%",mouseMagnifier:!1,subtitles:!1,treeColoring:!1,viewBraille:!1,voicing:!1,brailleSpeech:!1,brailleCombine:!1,help:!0,roleDescription:"math",tabSelects:"all"})}),e.speechStyles={'mjx-container[has-speech="true"]':{position:"relative",cursor:"default"},"mjx-speech":{position:"absolute","z-index":-1,left:0,top:0,bottom:0,right:0},"mjx-speech:focus":{outline:"none"},"mjx-container .mjx-selected":{outline:"2px solid black"},"mjx-container a[data-mjx-href]":{color:"LinkText",cursor:"pointer"},"mjx-container a[data-mjx-href].mjx-visited":{color:"VisitedText"},"mjx-container > mjx-help":{display:"none",position:"absolute",top:"-.3em",right:"-.5em",width:".6em",height:".6em",cursor:"pointer"},'mjx-container[display="true"] > mjx-help':{position:"sticky",inset:"-100% 0 100% 0",margin:"-.3em -.5em 0 -.1em",right:0,top:"initial"},"mjx-help > svg":{stroke:"black",width:"100%",height:"100%"},"mjx-help > svg > circle":{"stroke-width":"1.5px",cx:"9px",cy:"9px",r:"9px",fill:"white"},"mjx-help > svg > circle:nth-child(2)":{fill:"var(--mjx-bg1-color)",r:"7px"},"mjx-help > svg > line":{"stroke-width":"2.5px","stroke-linecap":"round"},"mjx-help:hover > svg > circle:nth-child(2)":{fill:"white"},"mjx-container.mjx-explorer-active > mjx-help":{display:"inline-flex","align-items":"center"},"@media (prefers-color-scheme: dark) /* explorer */":{"mjx-help > svg":{stroke:"#E0E0E0"},"mjx-help > svg > circle":{fill:"#404040"},"mjx-help > svg > circle:nth-child(2)":{fill:"rgba(132, 132, 255, .3)"},"mjx-help:hover > svg > circle:nth-child(2)":{stroke:"#AAAAAA",fill:"#404040"}}},e}function Af(t,e=null){return t.documentClass.prototype.attachSpeech||(t=Vm(t,e)),t.documentClass=Sf(t.documentClass),t}function Of(t,e){var i;const s=Up();for(const i in e)void 0!==t.options.a11y[i]?Mf(t,i,e[i]):void 0!==s[i]&&(t.options.sre[i]=e[i]);e.roleDescription&&(t.options.MathItem.roleDescription=e.roleDescription);for(const e of t.math)null===(i=null==e?void 0:e.explorers)||void 0===i||i.attach()}function Mf(t,e,i){switch(e){case"speechRules":{const[e,s]=i.split("-");t.options.sre.domain=e,t.options.sre.style=s;break}case"magnification":switch(i){case"None":t.options.a11y.magnification=i,t.options.a11y.keyMagnifier=!1,t.options.a11y.mouseMagnifier=!1;break;case"Keyboard":t.options.a11y.magnification=i,t.options.a11y.keyMagnifier=!0,t.options.a11y.mouseMagnifier=!1;break;case"Mouse":t.options.a11y.magnification=i,t.options.a11y.keyMagnifier=!1,t.options.a11y.mouseMagnifier=!0}break;case"highlight":switch(i){case"None":t.options.a11y.highlight=i,t.options.a11y.hover=!1,t.options.a11y.flame=!1;break;case"Hover":t.options.a11y.highlight=i,t.options.a11y.hover=!0,t.options.a11y.flame=!1;break;case"Flame":t.options.a11y.highlight=i,t.options.a11y.hover=!1,t.options.a11y.flame=!0}break;case"locale":t.options.sre.locale=i;break;default:t.options.a11y[e]=i}}vs("EXPLORER",Ns.INSERTED+30),MathJax.loader&&MathJax.loader.checkVersion("a11y/explorer",Ei,"a11y"),_i({_:{a11y:{explorer_ts:bi,explorer:{Explorer:di,ExplorerPool:gi,Highlighter:fi,KeyExplorer:ui,MouseExplorer:pi,Region:hi,TreeExplorer:mi}}}}),MathJax.startup&&Ci&&MathJax.startup.extendHandler((t=>Af(t))),Pi.preLoaded("a11y/sre","a11y/semantic-enrich","a11y/speech","a11y/explorer","input/mml"),Pi.preLoaded("loader","startup","core","input/mml","output/chtml","ui/menu"),Pi.saveVersion("mml-chtml-nofont"),function(t,e){Dl.loadFont(t,"chtml",Sl,e)}((function(t){return Pi.load(...ji.load).then((()=>(t||function(){})())).then((()=>ji.ready())).catch((t=>ji.failed(t)))}))})()})();
|