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.
Files changed (248) hide show
  1. checksums.yaml +7 -0
  2. data/lib/discourse_math_bundle/version.rb +7 -0
  3. data/lib/discourse_math_bundle.rb +55 -0
  4. data/vendor/assets/katex/contrib/copy-tex.min.js +1 -0
  5. data/vendor/assets/katex/contrib/mhchem.min.js +1 -0
  6. data/vendor/assets/katex/fonts/KaTeX_AMS-Regular.woff +0 -0
  7. data/vendor/assets/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  8. data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  9. data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  10. data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  11. data/vendor/assets/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  12. data/vendor/assets/katex/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  13. data/vendor/assets/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  14. data/vendor/assets/katex/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  15. data/vendor/assets/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  16. data/vendor/assets/katex/fonts/KaTeX_Main-Bold.woff +0 -0
  17. data/vendor/assets/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  18. data/vendor/assets/katex/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  19. data/vendor/assets/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  20. data/vendor/assets/katex/fonts/KaTeX_Main-Italic.woff +0 -0
  21. data/vendor/assets/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  22. data/vendor/assets/katex/fonts/KaTeX_Main-Regular.woff +0 -0
  23. data/vendor/assets/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  24. data/vendor/assets/katex/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  25. data/vendor/assets/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  26. data/vendor/assets/katex/fonts/KaTeX_Math-Italic.woff +0 -0
  27. data/vendor/assets/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  28. data/vendor/assets/katex/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  29. data/vendor/assets/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  30. data/vendor/assets/katex/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  31. data/vendor/assets/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  32. data/vendor/assets/katex/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  33. data/vendor/assets/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  34. data/vendor/assets/katex/fonts/KaTeX_Script-Regular.woff +0 -0
  35. data/vendor/assets/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  36. data/vendor/assets/katex/fonts/KaTeX_Size1-Regular.woff +0 -0
  37. data/vendor/assets/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  38. data/vendor/assets/katex/fonts/KaTeX_Size2-Regular.woff +0 -0
  39. data/vendor/assets/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  40. data/vendor/assets/katex/fonts/KaTeX_Size3-Regular.woff +0 -0
  41. data/vendor/assets/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  42. data/vendor/assets/katex/fonts/KaTeX_Size4-Regular.woff +0 -0
  43. data/vendor/assets/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  44. data/vendor/assets/katex/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  45. data/vendor/assets/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  46. data/vendor/assets/katex/katex.min.css +1 -0
  47. data/vendor/assets/katex/katex.min.js +1 -0
  48. data/vendor/assets/mathjax/a11y/assistive-mml.js +1 -0
  49. data/vendor/assets/mathjax/a11y/complexity.js +1 -0
  50. data/vendor/assets/mathjax/a11y/explorer.js +1 -0
  51. data/vendor/assets/mathjax/a11y/semantic-enrich.js +1 -0
  52. data/vendor/assets/mathjax/a11y/speech.js +1 -0
  53. data/vendor/assets/mathjax/a11y/sre.js +1 -0
  54. data/vendor/assets/mathjax/adaptors/jsdom.js +1 -0
  55. data/vendor/assets/mathjax/adaptors/linkedom.js +1 -0
  56. data/vendor/assets/mathjax/adaptors/liteDOM.js +1 -0
  57. data/vendor/assets/mathjax/core.js +1 -0
  58. data/vendor/assets/mathjax/input/asciimath.js +1 -0
  59. data/vendor/assets/mathjax/input/mml/entities.js +1 -0
  60. data/vendor/assets/mathjax/input/mml/extensions/mml3.js +1 -0
  61. data/vendor/assets/mathjax/input/mml/extensions/mml3.sef.json +1 -0
  62. data/vendor/assets/mathjax/input/mml.js +1 -0
  63. data/vendor/assets/mathjax/input/tex/extensions/action.js +1 -0
  64. data/vendor/assets/mathjax/input/tex/extensions/ams.js +1 -0
  65. data/vendor/assets/mathjax/input/tex/extensions/amscd.js +1 -0
  66. data/vendor/assets/mathjax/input/tex/extensions/autoload.js +1 -0
  67. data/vendor/assets/mathjax/input/tex/extensions/bbm.js +1 -0
  68. data/vendor/assets/mathjax/input/tex/extensions/bboldx.js +1 -0
  69. data/vendor/assets/mathjax/input/tex/extensions/bbox.js +1 -0
  70. data/vendor/assets/mathjax/input/tex/extensions/begingroup.js +1 -0
  71. data/vendor/assets/mathjax/input/tex/extensions/boldsymbol.js +1 -0
  72. data/vendor/assets/mathjax/input/tex/extensions/braket.js +1 -0
  73. data/vendor/assets/mathjax/input/tex/extensions/bussproofs.js +1 -0
  74. data/vendor/assets/mathjax/input/tex/extensions/cancel.js +1 -0
  75. data/vendor/assets/mathjax/input/tex/extensions/cases.js +1 -0
  76. data/vendor/assets/mathjax/input/tex/extensions/centernot.js +1 -0
  77. data/vendor/assets/mathjax/input/tex/extensions/color.js +1 -0
  78. data/vendor/assets/mathjax/input/tex/extensions/colortbl.js +1 -0
  79. data/vendor/assets/mathjax/input/tex/extensions/colorv2.js +1 -0
  80. data/vendor/assets/mathjax/input/tex/extensions/configmacros.js +1 -0
  81. data/vendor/assets/mathjax/input/tex/extensions/dsfont.js +1 -0
  82. data/vendor/assets/mathjax/input/tex/extensions/empheq.js +1 -0
  83. data/vendor/assets/mathjax/input/tex/extensions/enclose.js +1 -0
  84. data/vendor/assets/mathjax/input/tex/extensions/extpfeil.js +1 -0
  85. data/vendor/assets/mathjax/input/tex/extensions/gensymb.js +1 -0
  86. data/vendor/assets/mathjax/input/tex/extensions/html.js +1 -0
  87. data/vendor/assets/mathjax/input/tex/extensions/mathtools.js +1 -0
  88. data/vendor/assets/mathjax/input/tex/extensions/mhchem.js +34 -0
  89. data/vendor/assets/mathjax/input/tex/extensions/newcommand.js +1 -0
  90. data/vendor/assets/mathjax/input/tex/extensions/noerrors.js +1 -0
  91. data/vendor/assets/mathjax/input/tex/extensions/noundefined.js +1 -0
  92. data/vendor/assets/mathjax/input/tex/extensions/physics.js +1 -0
  93. data/vendor/assets/mathjax/input/tex/extensions/require.js +1 -0
  94. data/vendor/assets/mathjax/input/tex/extensions/setoptions.js +1 -0
  95. data/vendor/assets/mathjax/input/tex/extensions/tagformat.js +1 -0
  96. data/vendor/assets/mathjax/input/tex/extensions/texhtml.js +1 -0
  97. data/vendor/assets/mathjax/input/tex/extensions/textcomp.js +1 -0
  98. data/vendor/assets/mathjax/input/tex/extensions/textmacros.js +1 -0
  99. data/vendor/assets/mathjax/input/tex/extensions/unicode.js +1 -0
  100. data/vendor/assets/mathjax/input/tex/extensions/units.js +1 -0
  101. data/vendor/assets/mathjax/input/tex/extensions/upgreek.js +1 -0
  102. data/vendor/assets/mathjax/input/tex/extensions/verb.js +1 -0
  103. data/vendor/assets/mathjax/input/tex-base.js +1 -0
  104. data/vendor/assets/mathjax/input/tex.js +1 -0
  105. data/vendor/assets/mathjax/loader.js +1 -0
  106. data/vendor/assets/mathjax/mml-chtml-nofont.js +1 -0
  107. data/vendor/assets/mathjax/mml-chtml.js +1 -0
  108. data/vendor/assets/mathjax/mml-svg-nofont.js +1 -0
  109. data/vendor/assets/mathjax/mml-svg.js +1 -0
  110. data/vendor/assets/mathjax/output/chtml.js +1 -0
  111. data/vendor/assets/mathjax/output/svg.js +1 -0
  112. data/vendor/assets/mathjax/sre/mathmaps/af.json +146 -0
  113. data/vendor/assets/mathjax/sre/mathmaps/base.json +137 -0
  114. data/vendor/assets/mathjax/sre/mathmaps/ca.json +140 -0
  115. data/vendor/assets/mathjax/sre/mathmaps/da.json +140 -0
  116. data/vendor/assets/mathjax/sre/mathmaps/de.json +146 -0
  117. data/vendor/assets/mathjax/sre/mathmaps/en.json +158 -0
  118. data/vendor/assets/mathjax/sre/mathmaps/es.json +140 -0
  119. data/vendor/assets/mathjax/sre/mathmaps/euro.json +32 -0
  120. data/vendor/assets/mathjax/sre/mathmaps/fr.json +146 -0
  121. data/vendor/assets/mathjax/sre/mathmaps/hi.json +146 -0
  122. data/vendor/assets/mathjax/sre/mathmaps/it.json +146 -0
  123. data/vendor/assets/mathjax/sre/mathmaps/ko.json +146 -0
  124. data/vendor/assets/mathjax/sre/mathmaps/nb.json +146 -0
  125. data/vendor/assets/mathjax/sre/mathmaps/nemeth.json +125 -0
  126. data/vendor/assets/mathjax/sre/mathmaps/nn.json +146 -0
  127. data/vendor/assets/mathjax/sre/mathmaps/sv.json +146 -0
  128. data/vendor/assets/mathjax/sre/require.d.mts +1 -0
  129. data/vendor/assets/mathjax/sre/require.mjs +2 -0
  130. data/vendor/assets/mathjax/sre/speech-worker.js +1 -0
  131. data/vendor/assets/mathjax/startup.js +1 -0
  132. data/vendor/assets/mathjax/tex-chtml-nofont.js +1 -0
  133. data/vendor/assets/mathjax/tex-chtml.js +1 -0
  134. data/vendor/assets/mathjax/tex-mml-chtml-nofont.js +1 -0
  135. data/vendor/assets/mathjax/tex-mml-chtml.js +1 -0
  136. data/vendor/assets/mathjax/tex-mml-svg-nofont.js +1 -0
  137. data/vendor/assets/mathjax/tex-mml-svg.js +1 -0
  138. data/vendor/assets/mathjax/tex-svg-nofont.js +1 -0
  139. data/vendor/assets/mathjax/tex-svg.js +1 -0
  140. data/vendor/assets/mathjax/ui/lazy.js +1 -0
  141. data/vendor/assets/mathjax/ui/menu.js +1 -0
  142. data/vendor/assets/mathjax/ui/safe.js +1 -0
  143. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ab.woff2 +0 -0
  144. data/vendor/assets/mathjax/woff-v2/mjx-ncm-abi.woff2 +0 -0
  145. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ai.woff2 +0 -0
  146. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ar.woff2 +0 -0
  147. data/vendor/assets/mathjax/woff-v2/mjx-ncm-arl.woff2 +0 -0
  148. data/vendor/assets/mathjax/woff-v2/mjx-ncm-b-a.woff2 +0 -0
  149. data/vendor/assets/mathjax/woff-v2/mjx-ncm-b.woff2 +0 -0
  150. data/vendor/assets/mathjax/woff-v2/mjx-ncm-bi.woff2 +0 -0
  151. data/vendor/assets/mathjax/woff-v2/mjx-ncm-br.woff2 +0 -0
  152. data/vendor/assets/mathjax/woff-v2/mjx-ncm-brd.woff2 +0 -0
  153. data/vendor/assets/mathjax/woff-v2/mjx-ncm-brk.woff2 +0 -0
  154. data/vendor/assets/mathjax/woff-v2/mjx-ncm-c.woff2 +0 -0
  155. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cb.woff2 +0 -0
  156. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ch.woff2 +0 -0
  157. data/vendor/assets/mathjax/woff-v2/mjx-ncm-chb.woff2 +0 -0
  158. data/vendor/assets/mathjax/woff-v2/mjx-ncm-chbi.woff2 +0 -0
  159. data/vendor/assets/mathjax/woff-v2/mjx-ncm-chi.woff2 +0 -0
  160. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cy.woff2 +0 -0
  161. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyb.woff2 +0 -0
  162. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cybi.woff2 +0 -0
  163. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyi.woff2 +0 -0
  164. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyss.woff2 +0 -0
  165. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyssb.woff2 +0 -0
  166. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyssbi.woff2 +0 -0
  167. data/vendor/assets/mathjax/woff-v2/mjx-ncm-cyssi.woff2 +0 -0
  168. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ds.woff2 +0 -0
  169. data/vendor/assets/mathjax/woff-v2/mjx-ncm-dv.woff2 +0 -0
  170. data/vendor/assets/mathjax/woff-v2/mjx-ncm-em.woff2 +0 -0
  171. data/vendor/assets/mathjax/woff-v2/mjx-ncm-f.woff2 +0 -0
  172. data/vendor/assets/mathjax/woff-v2/mjx-ncm-fb.woff2 +0 -0
  173. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gk.woff2 +0 -0
  174. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkb.woff2 +0 -0
  175. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkbi.woff2 +0 -0
  176. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gki.woff2 +0 -0
  177. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkss.woff2 +0 -0
  178. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkssb.woff2 +0 -0
  179. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkssbi.woff2 +0 -0
  180. data/vendor/assets/mathjax/woff-v2/mjx-ncm-gkssi.woff2 +0 -0
  181. data/vendor/assets/mathjax/woff-v2/mjx-ncm-he.woff2 +0 -0
  182. data/vendor/assets/mathjax/woff-v2/mjx-ncm-heb.woff2 +0 -0
  183. data/vendor/assets/mathjax/woff-v2/mjx-ncm-hebi.woff2 +0 -0
  184. data/vendor/assets/mathjax/woff-v2/mjx-ncm-hei.woff2 +0 -0
  185. data/vendor/assets/mathjax/woff-v2/mjx-ncm-i.woff2 +0 -0
  186. data/vendor/assets/mathjax/woff-v2/mjx-ncm-lb.woff2 +0 -0
  187. data/vendor/assets/mathjax/woff-v2/mjx-ncm-li.woff2 +0 -0
  188. data/vendor/assets/mathjax/woff-v2/mjx-ncm-lib.woff2 +0 -0
  189. data/vendor/assets/mathjax/woff-v2/mjx-ncm-lo.woff2 +0 -0
  190. data/vendor/assets/mathjax/woff-v2/mjx-ncm-lr.woff2 +0 -0
  191. data/vendor/assets/mathjax/woff-v2/mjx-ncm-lt.woff2 +0 -0
  192. data/vendor/assets/mathjax/woff-v2/mjx-ncm-m.woff2 +0 -0
  193. data/vendor/assets/mathjax/woff-v2/mjx-ncm-mar.woff2 +0 -0
  194. data/vendor/assets/mathjax/woff-v2/mjx-ncm-mi.woff2 +0 -0
  195. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ml.woff2 +0 -0
  196. data/vendor/assets/mathjax/woff-v2/mjx-ncm-mm.woff2 +0 -0
  197. data/vendor/assets/mathjax/woff-v2/mjx-ncm-msh.woff2 +0 -0
  198. data/vendor/assets/mathjax/woff-v2/mjx-ncm-mx.woff2 +0 -0
  199. data/vendor/assets/mathjax/woff-v2/mjx-ncm-n.woff2 +0 -0
  200. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ob.woff2 +0 -0
  201. data/vendor/assets/mathjax/woff-v2/mjx-ncm-os.woff2 +0 -0
  202. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ph.woff2 +0 -0
  203. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phb.woff2 +0 -0
  204. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phbi.woff2 +0 -0
  205. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phi.woff2 +0 -0
  206. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phss.woff2 +0 -0
  207. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phssb.woff2 +0 -0
  208. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phssbi.woff2 +0 -0
  209. data/vendor/assets/mathjax/woff-v2/mjx-ncm-phssi.woff2 +0 -0
  210. data/vendor/assets/mathjax/woff-v2/mjx-ncm-pu.woff2 +0 -0
  211. data/vendor/assets/mathjax/woff-v2/mjx-ncm-pub.woff2 +0 -0
  212. data/vendor/assets/mathjax/woff-v2/mjx-ncm-pubi.woff2 +0 -0
  213. data/vendor/assets/mathjax/woff-v2/mjx-ncm-pui.woff2 +0 -0
  214. data/vendor/assets/mathjax/woff-v2/mjx-ncm-rb.woff2 +0 -0
  215. data/vendor/assets/mathjax/woff-v2/mjx-ncm-s.woff2 +0 -0
  216. data/vendor/assets/mathjax/woff-v2/mjx-ncm-s3.woff2 +0 -0
  217. data/vendor/assets/mathjax/woff-v2/mjx-ncm-s4.woff2 +0 -0
  218. data/vendor/assets/mathjax/woff-v2/mjx-ncm-s5.woff2 +0 -0
  219. data/vendor/assets/mathjax/woff-v2/mjx-ncm-s6.woff2 +0 -0
  220. data/vendor/assets/mathjax/woff-v2/mjx-ncm-s7.woff2 +0 -0
  221. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sb.woff2 +0 -0
  222. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sh.woff2 +0 -0
  223. data/vendor/assets/mathjax/woff-v2/mjx-ncm-shb.woff2 +0 -0
  224. data/vendor/assets/mathjax/woff-v2/mjx-ncm-shbi.woff2 +0 -0
  225. data/vendor/assets/mathjax/woff-v2/mjx-ncm-shi.woff2 +0 -0
  226. data/vendor/assets/mathjax/woff-v2/mjx-ncm-so.woff2 +0 -0
  227. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ss.woff2 +0 -0
  228. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssb.woff2 +0 -0
  229. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssbi.woff2 +0 -0
  230. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssbix.woff2 +0 -0
  231. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssbx.woff2 +0 -0
  232. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssi.woff2 +0 -0
  233. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssix.woff2 +0 -0
  234. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sslb.woff2 +0 -0
  235. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssli.woff2 +0 -0
  236. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sslib.woff2 +0 -0
  237. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sslr.woff2 +0 -0
  238. data/vendor/assets/mathjax/woff-v2/mjx-ncm-ssx.woff2 +0 -0
  239. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sy.woff2 +0 -0
  240. data/vendor/assets/mathjax/woff-v2/mjx-ncm-syb.woff2 +0 -0
  241. data/vendor/assets/mathjax/woff-v2/mjx-ncm-sybi.woff2 +0 -0
  242. data/vendor/assets/mathjax/woff-v2/mjx-ncm-syi.woff2 +0 -0
  243. data/vendor/assets/mathjax/woff-v2/mjx-ncm-u-a.woff2 +0 -0
  244. data/vendor/assets/mathjax/woff-v2/mjx-ncm-u.woff2 +0 -0
  245. data/vendor/assets/mathjax/woff-v2/mjx-ncm-v.woff2 +0 -0
  246. data/vendor/assets/mathjax/woff-v2/mjx-ncm-vx.woff2 +0 -0
  247. data/vendor/assets/mathjax/woff-v2/mjx-ncm-zero.woff2 +0 -0
  248. metadata +304 -0
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={d:(e,s)=>{for(var i in s)t.o(s,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:s[i]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{AssistiveMmlHandler:()=>u,AssistiveMmlMathDocumentMixin:()=>d,AssistiveMmlMathItemMixin:()=>h,LimitedMmlVisitor:()=>m});const s=("undefined"!=typeof window?window:t.g).MathJax._.components.global,i=(s.GLOBAL,s.isObject,s.combineConfig,s.combineDefaults),o=s.combineWithMathJax,a=(s.MathJax,MathJax._.core.MathItem),n=(a.protoItem,a.AbstractMathItem,a.STATE),r=a.newState,l=MathJax._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor,p=MathJax._.util.Options,c=(p.isObject,p.APPEND,p.REMOVE,p.OPTIONS,p.Expandable,p.expandable);p.makeArray,p.keys,p.copy,p.insert,p.defaultOptions,p.userOptions,p.selectOptions,p.selectOptionsFromKeys,p.separateOptions,p.lookup;class m extends l{getAttributes(t){return super.getAttributes(t).replace(/ ?id=".*?"/,"")}}function h(t){return class extends t{assistiveMml(t,e=!1){if(!(this.state()>=n.ASSISTIVEMML)){if(!this.isEscaped&&(t.options.enableAssistiveMml||e)){const e=t.adaptor,s=t.toMML(this.root).replace(/\n */g,"").replace(/<!--.*?-->/g,""),i=e.firstChild(e.body(e.parse(s,"text/html"))),o=e.node("mjx-assistive-mml",{unselectable:"on",display:this.display?"block":"inline"},[i]);e.setAttribute(e.firstChild(this.typesetRoot),"aria-hidden","true"),e.setStyle(this.typesetRoot,"position","relative"),e.append(this.typesetRoot,o)}this.state(n.ASSISTIVEMML)}}}}function d(t){var e;return(e=class extends t{constructor(...t){super(...t);const e=this.constructor,s=e.ProcessBits;s.has("assistive-mml")||s.allocate("assistive-mml"),this.visitor=new m(this.mmlFactory),this.options.MathItem=h(this.options.MathItem),"addStyles"in this&&this.addStyles(e.assistiveStyles)}toMML(t){return this.visitor.visitTree(t)}assistiveMml(){if(!this.processed.isSet("assistive-mml")){for(const t of this.math)t.assistiveMml(this);this.processed.set("assistive-mml")}return this}state(t,e=!1){return super.state(t,e),t<n.ASSISTIVEMML&&this.processed.clear("assistive-mml"),this}}).OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableAssistiveMml:!0,renderActions:c(Object.assign(Object.assign({},t.OPTIONS.renderActions),{assistiveMml:[n.ASSISTIVEMML]}))}),e.assistiveStyles={"mjx-assistive-mml":{position:"absolute !important",top:"0px",left:"0px",bottom:"0px",right:"0px",clip:"rect(1px, 1px, 1px, 1px)","clip-path":"polygon(0 0, 0 1px, 1px 1px, 1px 0)",padding:"1px 0px 0px 0px !important",border:"0px !important",display:"block !important",width:"auto !important",overflow:"hidden !important","text-indent":"0px ! important","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"},'mjx-assistive-mml[display="block"]':{width:"100% !important"}},e}function u(t){return t.documentClass=d(t.documentClass),t}r("ASSISTIVEMML",153),MathJax.loader&&MathJax.loader.checkVersion("a11y/assistive-mml","4.1.0","a11y"),o({_:{a11y:{"assistive-mml":e}}}),MathJax.startup&&(MathJax.config.options&&!1!==MathJax.config.options.enableAssistiveMml&&i(MathJax.config,"options",{menuOptions:{settings:{assistiveMml:!0}}}),MathJax.startup.extendHandler((t=>u(t))))})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{EnrichHandler:()=>x,EnrichedMathDocumentMixin:()=>m,EnrichedMathItemMixin:()=>u,enrichVisitor:()=>d});var i={};t.r(i),t.d(i,{Collapse:()=>C});var s={};t.r(s),t.d(s,{ComplexityVisitor:()=>O});var o={};t.r(o),t.d(o,{ComplexityHandler:()=>T,ComplexityMathDocumentMixin:()=>k,ComplexityMathItemMixin:()=>P});const r=("undefined"!=typeof window?window:t.g).MathJax._.components.global,l=(r.GLOBAL,r.isObject,r.combineConfig,r.combineDefaults),c=r.combineWithMathJax,n=(r.MathJax,MathJax._.core.MathItem),a=(n.protoItem,n.AbstractMathItem,n.STATE),p=n.newState,h=MathJax._.a11y["semantic-enrich"],d=h.enrichVisitor,u=h.EnrichedMathItemMixin,m=h.EnrichedMathDocumentMixin,x=h.EnrichHandler,y=MathJax._.core.MmlTree.MmlVisitor,f=(y.DATAMJX,y.MmlVisitor);class C{constructor(t){this.cutoff={identifier:3,number:3,text:10,infixop:15,relseq:15,multirel:15,fenced:18,bigop:20,integral:20,fraction:12,sqrt:9,root:12,vector:15,matrix:15,cases:15,superscript:9,subscript:9,subsup:9,punctuated:{endpunct:C.NOCOLLAPSE,startpunct:C.NOCOLLAPSE,value:12}},this.marker={identifier:"x",number:"#",text:"...",appl:{"limit function":"lim",value:"f()"},fraction:"/",sqrt:"\u221a",root:"\u221a",superscript:"\u25fd\u02d9",subscript:"\u25fd.",subsup:"\u25fd:",vector:{binomial:"(:)",determinant:"|:|",value:"\u27e8:\u27e9"},matrix:{squarematrix:"[::]",rowvector:"\u27e8\u22ef\u27e9",columnvector:"\u27e8\u22ee\u27e9",determinant:"|::|",value:"(::)"},cases:"{:",infixop:{addition:"+",subtraction:"\u2212",multiplication:"\u22c5",implicit:"\u22c5",value:"+"},punctuated:{text:"...",value:","}},this.collapse=new Map([["fenced",(t,e)=>((e=this.uncollapseChild(e,t,1))>this.cutoff.fenced&&"leftright"===t.attributes.get("data-semantic-role")&&(e=this.recordCollapse(t,e,this.getText(t.childNodes[0])+this.getText(t.childNodes[t.childNodes.length-1]))),e)],["appl",(t,e)=>{if(this.canUncollapse(t,2,2)){e=this.complexity.visitNode(t,!1);const i=this.marker.appl,s=i[t.attributes.get("data-semantic-role")]||i.value;e=this.recordCollapse(t,e,s)}return e}],["sqrt",(t,e)=>((e=this.uncollapseChild(e,t,0))>this.cutoff.sqrt&&(t.setProperty("collapse-variant",!0),e=this.recordCollapse(t,e,this.marker.sqrt)),e)],["root",(t,e)=>((e=this.uncollapseChild(e,t,0,2))>this.cutoff.sqrt&&(t.setProperty("collapse-variant",!0),e=this.recordCollapse(t,e,this.marker.sqrt)),e)],["enclose",(t,e)=>{if(1===this.splitAttribute(t,"children").length){const i=this.canUncollapse(t,1);if(i){const s=i.getProperty("collapse-marker");this.unrecordCollapse(i),e=this.recordCollapse(t,this.complexity.visitNode(t,!1),s)}}return e}],["bigop",(t,e)=>{if(e>this.cutoff.bigop||!t.isKind("mo")){const i=this.splitAttribute(t,"content").pop(),s=this.findChildText(t,i);e=this.recordCollapse(t,e,s)}return e}],["integral",(t,e)=>{if(e>this.cutoff.integral||!t.isKind("mo")){const i=this.splitAttribute(t,"content").pop(),s=this.findChildText(t,i);e=this.recordCollapse(t,e,s)}return e}],["relseq",(t,e)=>{if(e>this.cutoff.relseq){const i=this.splitAttribute(t,"content")[0],s=this.findChildText(t,i);e=this.recordCollapse(t,e,s)}return e}],["multirel",(t,e)=>{if(e>this.cutoff.relseq){const i=this.splitAttribute(t,"content")[0],s=this.findChildText(t,i)+"\u22ef";e=this.recordCollapse(t,e,s)}return e}],["superscript",(t,e)=>((e=this.uncollapseChild(e,t,0,2))>this.cutoff.superscript&&(e=this.recordCollapse(t,e,this.marker.superscript)),e)],["subscript",(t,e)=>((e=this.uncollapseChild(e,t,0,2))>this.cutoff.subscript&&(e=this.recordCollapse(t,e,this.marker.subscript)),e)],["subsup",(t,e)=>((e=this.uncollapseChild(e,t,0,3))>this.cutoff.subsup&&(e=this.recordCollapse(t,e,this.marker.subsup)),e)]]),this.idCount=0,this.complexity=t}check(t,e){const i=t.attributes.get("data-semantic-type");return this.collapse.has(i)?this.collapse.get(i).call(this,t,e):Object.hasOwn(this.cutoff,i)?this.defaultCheck(t,e,i):e}defaultCheck(t,e,i){const s=t.attributes.get("data-semantic-role"),o=this.cutoff[i];if(e>("number"==typeof o?o:o[s]||o.value)){const o=this.marker[i]||"??",r="string"==typeof o?o:o[s]||o.value;e=this.recordCollapse(t,e,r)}return e}recordCollapse(t,e,i){return i="\u25c2"+i+"\u25b8",t.setProperty("collapse-marker",i),t.setProperty("collapse-complexity",e),i.length*this.complexity.complexity.text}unrecordCollapse(t){const e=t.getProperty("collapse-complexity");null!=e&&(t.attributes.set("data-semantic-complexity",e),t.removeProperty("collapse-complexity"),t.removeProperty("collapse-marker"))}canUncollapse(t,e,i=1){if(this.splitAttribute(t,"children").length===i){const i=1===t.childNodes.length&&t.childNodes[0].isInferred?t.childNodes[0]:t;if(i&&i.childNodes[e]){const t=i.childNodes[e];if(t.getProperty("collapse-marker"))return t}}return null}uncollapseChild(t,e,i,s=1){const o=this.canUncollapse(e,i,s);return o&&(this.unrecordCollapse(o),o.parent!==e&&o.parent.attributes.set("data-semantic-complexity",void 0),t=this.complexity.visitNode(e,!1)),t}splitAttribute(t,e){return(t.attributes.get("data-semantic-"+e)||"").split(/,/)}getText(t){return t.isToken?t.getText():t.childNodes.map((t=>this.getText(t))).join("")}findChildText(t,e){const i=this.findChild(t,e);return this.getText(i.coreMO()||i)}findChild(t,e){if(!t||t.attributes.get("data-semantic-id")===e)return t;if(!t.isToken)for(const i of t.childNodes){const t=this.findChild(i,e);if(t)return t}return null}makeCollapse(t,e){let i=null;null===e?e=this.idCount:(i=this.idCount,this.idCount=e);const s=[];return t.walkTree((t=>{t.getProperty("collapse-marker")&&s.push(t)})),this.makeActions(s),null!==i&&(this.idCount=i),e}makeActions(t){for(const e of t)this.makeAction(e)}makeId(){return"mjx-collapse-"+this.idCount++}makeAction(t){t.isKind("math")&&(t=this.addMrow(t));const e=this.complexity.factory,i=t.getProperty("collapse-marker"),s=t.parent,o={"data-mjx-collapsed":!0};t.getProperty("collapse-variant")&&(o.mathvariant="-tex-variant");const r=e.create("maction",{actiontype:"toggle",selection:2,"data-collapsible":!0,id:this.makeId(),"data-semantic-complexity":t.attributes.get("data-semantic-complexity")},[e.create("mtext",o,[e.create("text").setText(i)])]);r.inheritAttributesFrom(t),t.attributes.set("data-semantic-complexity",t.getProperty("collapse-complexity")),t.removeProperty("collapse-marker"),t.removeProperty("collapse-complexity"),s.replaceChild(r,t),r.appendChild(t)}addMrow(t){const e=this.complexity.factory.create("mrow",null,t.childNodes[0].childNodes);t.childNodes[0].setChildren([e]);const i=t.attributes.getAllAttributes();for(const t of Object.keys(i))"data-semantic-"!==t.substring(0,14)&&"data-speech-"!==t.substring(0,12)&&"aria-"!==t.substring(0,5)&&"role"!==t||(e.attributes.set(t,i[t]),delete i[t]);return e.setProperty("collapse-marker",t.getProperty("collapse-marker")),e.setProperty("collapse-complexity",t.getProperty("collapse-complexity")),t.removeProperty("collapse-marker"),t.removeProperty("collapse-complexity"),e}}C.NOCOLLAPSE=1e7;const b=MathJax._.util.Options,g=(b.isObject,b.APPEND,b.REMOVE,b.OPTIONS,b.Expandable,b.expandable),v=(b.makeArray,b.keys,b.copy,b.insert,b.defaultOptions),M=b.userOptions,N=(b.selectOptions,b.selectOptionsFromKeys);b.separateOptions,b.lookup;class O extends f{constructor(t,e){super(t),this.complexity={text:.5,token:.5,child:1,script:.8,sqrt:2,subsup:2,underover:2,fraction:2,enclose:2,action:2,phantom:0,xml:2,glyph:2};const i=this.constructor;this.options=M(v({},i.OPTIONS),e),this.collapse=new this.options.Collapse(this),this.factory=t}visitTree(t,e){return super.visitTree(t,!0),this.options.makeCollapsible&&(e=this.collapse.makeCollapse(t,e)),e}visitNode(t,e){if(!t.attributes.get("data-semantic-complexity"))return super.visitNode(t,e)}visitDefault(t,e){let i;if(t.isToken){const e=t.getText();i=this.complexity.text*e.length+this.complexity.token}else i=this.childrenComplexity(t);return this.setComplexity(t,i,e)}visitMfracNode(t,e){const i=this.childrenComplexity(t)*this.complexity.script+this.complexity.fraction;return this.setComplexity(t,i,e)}visitMsqrtNode(t,e){const i=this.childrenComplexity(t)+this.complexity.sqrt;return this.setComplexity(t,i,e)}visitMrootNode(t,e){const i=this.childrenComplexity(t)+this.complexity.sqrt-(1-this.complexity.script)*this.getComplexity(t.childNodes[1]);return this.setComplexity(t,i,e)}visitMphantomNode(t,e){return this.setComplexity(t,this.complexity.phantom,e)}visitMsNode(t,e){const i=(t.attributes.get("lquote")+t.getText()+t.attributes.get("rquote")).length*this.complexity.text;return this.setComplexity(t,i,e)}visitMsubsupNode(t,e){super.visitDefault(t,!0);const i=t.childNodes[t.sub],s=t.childNodes[t.sup],o=t.childNodes[t.base];let r=Math.max(i?this.getComplexity(i):0,s?this.getComplexity(s):0)*this.complexity.script;return r+=this.complexity.child*((i?1:0)+(s?1:0)),r+=o?this.getComplexity(o)+this.complexity.child:0,r+=this.complexity.subsup,this.setComplexity(t,r,e)}visitMsubNode(t,e){return this.visitMsubsupNode(t,e)}visitMsupNode(t,e){return this.visitMsubsupNode(t,e)}visitMunderoverNode(t,e){super.visitDefault(t,!0);const i=t.childNodes[t.under],s=t.childNodes[t.over],o=t.childNodes[t.base];let r=Math.max(i?this.getComplexity(i):0,s?this.getComplexity(s):0)*this.complexity.script;return o&&(r=Math.max(this.getComplexity(o),r)),r+=this.complexity.child*((i?1:0)+(s?1:0)+(o?1:0)),r+=this.complexity.underover,this.setComplexity(t,r,e)}visitMunderNode(t,e){return this.visitMunderoverNode(t,e)}visitMoverNode(t,e){return this.visitMunderoverNode(t,e)}visitMencloseNode(t,e){const i=this.childrenComplexity(t)+this.complexity.enclose;return this.setComplexity(t,i,e)}visitMactionNode(t,e){this.childrenComplexity(t);const i=this.getComplexity(t.selected);return this.setComplexity(t,i,e)}visitMsemanticsNode(t,e){const i=t.childNodes[0];let s=0;return i&&(this.visitNode(i,!0),s=this.getComplexity(i)),this.setComplexity(t,s,e)}visitAnnotationNode(t,e){return this.setComplexity(t,this.complexity.xml,e)}visitAnnotation_xmlNode(t,e){return this.setComplexity(t,this.complexity.xml,e)}visitMglyphNode(t,e){return this.setComplexity(t,this.complexity.glyph,e)}getComplexity(t){const e=t.getProperty("collapsedComplexity");return null!=e?e:t.attributes.get("data-semantic-complexity")}setComplexity(t,e,i){return i&&(this.options.identifyCollapsible&&(e=this.collapse.check(t,e)),t.attributes.set("data-semantic-complexity",e)),e}childrenComplexity(t){super.visitDefault(t,!0);let e=0;for(const i of t.childNodes)e+=this.getComplexity(i);return t.childNodes.length>1&&(e+=t.childNodes.length*this.complexity.child),e}}function P(t,e){return class extends t{constructor(){super(...arguments),this.initialID=null}complexity(t,i=!1){this.state()>=a.COMPLEXITY||(this.isEscaped||!t.options.enableComplexity&&!i||(this.enrich(t,!0),e(this)),this.state(a.COMPLEXITY))}}}function k(t){var e;return(e=class extends t{constructor(...t){super(...t);const e=this.constructor.ProcessBits;e.has("complexity")||e.allocate("complexity");const i=N(this.options,this.options.ComplexityVisitor.OPTIONS);this.complexityVisitor=new this.options.ComplexityVisitor(this.mmlFactory,i);this.options.MathItem=P(this.options.MathItem,(t=>{t.initialID=this.complexityVisitor.visitTree(t.root,t.initialID)}))}complexity(){if(!this.processed.isSet("complexity")){if(this.options.enableComplexity)for(const t of this.math)t.complexity(this);this.processed.set("complexity")}return this}state(t,e=!1){return super.state(t,e),t<a.COMPLEXITY&&this.processed.clear("complexity"),this}}).OPTIONS=Object.assign(Object.assign(Object.assign({},t.OPTIONS),O.OPTIONS),{enableComplexity:!0,ComplexityVisitor:O,renderActions:g(Object.assign(Object.assign({},t.OPTIONS.renderActions),{complexity:[a.COMPLEXITY]}))}),e}function T(t,e=null){return!t.documentClass.prototype.enrich&&e&&(t=x(t,e)),t.documentClass=k(t.documentClass),t}O.OPTIONS={identifyCollapsible:!0,makeCollapsible:!0,Collapse:C},p("COMPLEXITY",40),MathJax.loader&&MathJax.loader.checkVersion("a11y/complexity","4.1.0","a11y"),c({_:{a11y:{complexity_ts:o,complexity:{collapse:i,visitor:s},"semantic-enrich":e}}}),MathJax.startup&&(MathJax.startup.extendHandler((t=>T(t))),l(MathJax.config,"options",MathJax.config["a11y/complexity"]||{}))})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{AbstractRegion:()=>M,DummyRegion:()=>N,HoverRegion:()=>I,LiveRegion:()=>T,SpeechRegion:()=>O,StringRegion:()=>E,ToolTip:()=>R});var i={};t.r(i),t.d(i,{AbstractExplorer:()=>L});var s={};t.r(s),t.d(s,{SpeechExplorer:()=>K,hasModifiers:()=>F,isContainer:()=>J});var o={};t.r(o),t.d(o,{AbstractMouseExplorer:()=>q,ContentHoverer:()=>W,FlameHoverer:()=>Y,Hoverer:()=>X,ValueHoverer:()=>z});var r={};t.r(r),t.d(r,{AbstractTreeExplorer:()=>G,ContrastPicker:()=>tt,FlameColorer:()=>Q,TreeColorer:()=>Z});var n={};t.r(n),t.d(n,{ATTR:()=>st,getHighlighter:()=>at});var a={};t.r(a),t.d(a,{ExplorerPool:()=>ut,RegionPool:()=>lt});var h={};t.r(h),t.d(h,{ExplorerHandler:()=>mt,ExplorerMathDocumentMixin:()=>gt,ExplorerMathItemMixin:()=>pt,setA11yOption:()=>ft,setA11yOptions:()=>bt});const l=("undefined"!=typeof window?window:t.g).MathJax._.components.global,c=(l.GLOBAL,l.isObject,l.combineConfig,l.combineDefaults,l.combineWithMathJax),u=(l.MathJax,MathJax._.core.MathItem),d=(u.protoItem,u.AbstractMathItem,u.STATE),p=u.newState,g=MathJax._.a11y.speech_ts,m=(g.SpeechMathItemMixin,g.SpeechMathDocumentMixin,g.SpeechHandler),b=MathJax._.util.Options,f=(b.isObject,b.APPEND,b.REMOVE,b.OPTIONS,b.Expandable,b.expandable),x=(b.makeArray,b.keys,b.copy,b.insert,b.defaultOptions,b.userOptions,b.selectOptions,b.selectOptionsFromKeys,b.separateOptions,b.lookup,MathJax._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor),v=MathJax._.util.context,y=v.hasWindow,A=v.context,S=MathJax._.util.StyleJson.StyleJsonSheet,k=MathJax._.a11y.speech.SpeechUtil,w=(k.ssmlParsing,k.buildLabel,k.buildSpeech),j=k.honk,C=(k.InPlace,k.SemAttr);class M{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 o=this.document.adaptor.document.getElementsByClassName(this.CLASS.className+"_Show");for(let t,e=0;t=o[e];e++)t!==this.div&&(i=Math.max(t.getBoundingClientRect().bottom,i),s=Math.min(t.getBoundingClientRect().left,s));const r=(i||e.bottom+10)+window.scrollY,n=(s<Number.POSITIVE_INFINITY?s:e.left)+window.scrollX;this.div.style.top=r+"px",this.div.style.left=n+"px"}}class N extends M{Clear(){}Update(){}Hide(){}Show(){}AddElement(){}AddStyles(){}position(){}}class E extends M{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 R extends E{}R.className="MJX_ToolTip",R.style=new S({[`.${R.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},[`.${R.className} > div`]:{"border-radius":"inherit",padding:"0 2px"},"@media (prefers-color-scheme: dark)":{["."+R.className]:{"background-color":"#222025","box-shadow":"0px 5px 20px #000",border:"1px solid #7C7C7C"}}});class T extends E{static setColor(t,e,i,s){const o=this.styleSheet;if(o){const r=o.sheet.cssRules[0].style,n=`--mjx-${t}${e}-color`,a=`rgba(var(--mjx-${t}-${i}), ${1===s?1:`var(--mjx-${t}${e}-alpha)`})`;r.getPropertyValue(n)!==a&&r.setProperty(n,a);const h=`--mjx-${t}${e}-alpha`;r.getPropertyValue(h)!==String(s)&&(r.setProperty(h,s),o.sheet.cssRules[1].cssRules[0].style.setProperty(h,Math.pow(s,.7071)))}}}T.className="MJX_LiveRegion",T.priority={primary:1,secondary:2},T.style=new S({":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}},[`.${T.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)"},[`.${T.className}_Show`]:{display:"block"},[`.${T.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 O extends T{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]=w(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}}O.style=null;class I extends M{position(t){const e=t.getBoundingClientRect(),i=this.div.getBoundingClientRect();let s,o=e.left+e.width/2-i.width/2;switch(o=o<0?0:o,o+=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=o+"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 o=Array.from(i.querySelectorAll("[data-sre-enclosed]"));"svg"===s.nodeName?this.svgClone(t,o,e,i):this.chtmlClone(t,o,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 o;let{x:r,y:n,width:a,height:h}=t.getBBox();if(e.length){i.firstChild.remove();const o=s.querySelector("g").cloneNode(!1);for(const i of e){const e=o.appendChild(i.cloneNode(!0));i===t&&e.setAttribute("data-mjx-clone","true");const[s,r]=this.xy(i);e.setAttribute("transform",`translate(${s}, ${r})`)}i.appendChild(o);const l=t.previousSibling,c=l.getBBox();a=c.width,h=c.height;const[u,d]=this.xy(l);r=u,n=d+c.y}const l=s.querySelector("g");if("full"===s.getAttribute("width")&&l.firstChild.lastChild===t)return i.innerHTML="",i.appendChild(s.cloneNode(!0).firstChild),i.querySelector(".mjx-selected").setAttribute("data-mjx-clone","true"),void(null===(o=i.querySelector("[data-sre-highlighter-added]"))||void 0===o||o.remove());i.firstChild.setAttribute("transform","scale(1, -1)");const c=parseFloat((i.getAttribute("viewBox")||i.getAttribute("data-mjx-viewBox")).split(/ /)[2]),u=parseFloat(i.style.minWidth||i.getAttribute("width"));i.setAttribute("viewBox",[r,-(n+h),a,h].join(" ")),i.removeAttribute("style"),i.setAttribute("width",u/c*a+"ex"),i.setAttribute("height",u/c*h+"ex")}xy(t){const e=DOMPoint.fromPoint({x:0,y:0}).matrixTransform(t.getCTM().inverse());return[-e.x,-e.y]}}I.className="MJX_HoverRegion",I.style=new S({[`.${I.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"},[`.${I.className} > div`]:{overflow:"hidden",color:"var(--mjx-fg1-color)","background-color":"var(--mjx-bg1-color)"},"@media (prefers-color-scheme: dark)":{["."+I.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 L{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,...o){return new this(t,e,i,s,...o)}constructor(t,e,i,s,...o){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&&L.stopEvent(t)}}const P=MathJax._.ui.dialog.InfoDialog.InfoDialog;var D=function(t,e,i,s){return new(i||(i=Promise))((function(o,r){function n(t){try{h(s.next(t))}catch(t){r(t)}}function a(t){try{h(s.throw(t))}catch(t){r(t)}}function h(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,a)}h((s=s.apply(t,e||[])).next())}))};const H="Windows"===A.os,B=Array(40).fill("\u2800").join(""),_="[data-speech-node]";function J(t){return t.matches("mjx-container")}function F(t,e=!0){return t.shiftKey&&e||t.metaKey||t.altKey||t.ctrlKey}class K extends L{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>&gt;</kbd> cycles through the available speech\n rule sets (MathSpeak, ClearSpeak).</li>\n\n <li><kbd>&lt;</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(),F(t,!1))return;const e=this.constructor,i=1===t.key.length?t.key.toLowerCase():t.key,[s,o]=e.keyMap.get(i)||[],r=s?void 0===o||this.active?s(this,t):o:this.undefinedKey(t);r||(this.stopEvent(t),!1===r&&this.sound&&this.NoMove())}MouseDown(t){var e;if(this.pendingIndex=[],this.region.cancelVoice(),F(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(F(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";F(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,o]=this.cellPosition(i);if(null==s)return!1;const r=this.cellAt(this.cellTable(i),s+t,o+e);if(!r)return!1;this.setCurrent(r)}undefinedKey(t){return!this.active||F(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()],o=this.actionable(this.current);o&&s.unshift(null!==(i=this.node.getAttribute("1"===o.getAttribute("toggle")?"data-semantic-expandable":"data-semantic-collapsible"))&&void 0!==i?i:""),this.speak(s.join(" "),this.current.getAttribute(C.BRAILLE))}summary(){if("x"===this.speechType)return void this.setCurrent(this.current);this.speechType="x";const t=this.current.getAttribute(C.SUMMARY);this.speak(t,this.current.getAttribute(C.BRAILLE),this.SsmlAttributes(this.current,C.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(A.os);P.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(C.PREFIX),t.getAttribute(C.SPEECH),t.getAttribute(C.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(C.BRAILLE),this.SsmlAttributes(t,C.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 o=this.speech,r=this.speech=document.createElement("mjx-speech");if(r.setAttribute("role",this.role),r.setAttribute("aria-label",t||this.none),r.setAttribute("aria-roledescription",s||this.none),r.setAttribute(C.SPEECH,t),i&&(r.setAttribute(C.PREFIX_SSML,i[0]||""),r.setAttribute(C.SPEECH_SSML,i[1]||""),r.setAttribute(C.POSTFIX_SSML,i[2]||"")),e&&(this.document.options.a11y.brailleSpeech&&(r.setAttribute("aria-label",e),r.setAttribute("aria-roledescription",this.brailleNone)),r.setAttribute("aria-braillelabel",e),r.setAttribute("aria-brailleroledescription",this.brailleNone),this.document.options.a11y.brailleCombine&&r.setAttribute("aria-label",e+B+t)),r.setAttribute("tabindex","0"),H){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(r),this.node.append(t),r.setAttribute("role","img")}else this.node.append(r);this.focusSpeech=!0,r.focus(),this.focusSpeech=!1,this.Update(),o&&setTimeout((()=>this.unspeak(o)),100)}unspeak(t){H&&(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,o=(i.getAttribute(C.SPEECH)||"")+(s?", "+s:"");null===(t=this.img)||void 0===t||t.remove(),this.img=this.document.adaptor.node("mjx-speech",{"aria-label":o,role:"img","aria-roledescription":e.none});const r=i.getAttribute(C.BRAILLE);r&&(this.document.options.a11y.brailleSpeech&&(this.img.setAttribute("aria-label",r),this.img.setAttribute("aria-roledescription",this.brailleNone)),this.img.setAttribute("aria-braillelabel",r),this.img.setAttribute("aria-brailleroledescription",this.brailleNone),this.document.options.a11y.brailleCombine&&this.img.setAttribute("aria-label",r+B+o)),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(_);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(_)}rootNode(){const t=this.node.querySelector("[data-semantic-structure]");if(!t)return this.node.querySelector(_);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 o,r=s.indexOf(this.nodeId(t));do{o=this.getNode(s[++r])}while(o&&!o.hasAttribute("data-speech-node"));return o}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 o,r=s.indexOf(this.nodeId(t));do{o=this.getNode(s[--r])}while(o&&!o.hasAttribute("data-speech-node"));return o}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(_);let o=null,r=this.node;for(;r;){r.matches(_)&&(o=r);const t=Array.from(r.childNodes);r=null;for(const s of t)if(s!==this.speech&&s!==this.img&&s.tagName&&"rect"!==s.tagName.toLowerCase()){const{left:t,right:o,top:n,bottom:a}=s.getBoundingClientRect();if(t<=e&&e<=o&&n<=i&&i<=a){r=s;break}}}return o}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(C.PREFIX_SSML),t.getAttribute(e),t.getAttribute(C.POSTFIX_SSML)]}restartAfter(t){return D(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,o,r,n,a){super(t,e,null,s),this.document=t,this.pool=e,this.region=i,this.node=s,this.brailleRegion=o,this.magnifyRegion=r,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 D(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()<d.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(){j()}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(_));const o=i.getAttribute(e);return o&&t.unshift(`[${e}="${o}"]`),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+/));V(i,this.subtrees)}}function V(t,e){if("string"==typeof t)return e.has(t)||e.set(t,new Set),new Set;const[i,...s]=t,o=i,r=new Set;for(const t of s){const i="string"==typeof t?t:t[0],s=V(t,e);r.add(i),s.forEach((t=>r.add(t)))}return e.set(o,r),r}K.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.","",""]]]),K.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]]))]);const $=MathJax._.a11y.sre_ts,U=($.locales,$.setupEngine,$.engineSetup);$.toEnriched,$.parseDOM,$.addPreference,$.fromPreference,$.toPreference;class q extends L{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 X extends q{constructor(t,e,i,s,o,r){super(t,e,i,s),this.document=t,this.pool=e,this.region=i,this.node=s,this.nodeQuery=o,this.nodeAccess=r}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 z extends X{}class W extends X{}class Y extends X{constructor(t,e,i,s){super(t,e,new N(t),s,(t=>this.highlighter.isMactionNode(t)),(()=>{})),this.document=t,this.pool=e,this.node=s}}class G extends L{constructor(t,e,i,s,o){super(t,e,null,s),this.document=t,this.pool=e,this.region=i,this.node=s,this.mml=o,this.stoppable=!1}Attach(){super.Attach(),this.Start()}Detach(){this.Stop(),super.Detach()}}class Q extends G{Start(){this.active||(this.active=!0,this.highlighter.highlightAll(this.node))}Stop(){this.active&&this.highlighter.unhighlightAll(),this.active=!1}}class Z extends G{constructor(){super(...arguments),this.contrast=new tt,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 tt{constructor(){this.hue=10,this.sat=100,this.light=50,this.incr=53}generate(){return tt.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,o=s*(1-Math.abs(t/60%2-1)),r=i-s/2;let n=0,a=0,h=0;return 0<=t&&t<60?[n,a,h]=[s,o,0]:60<=t&&t<120?[n,a,h]=[o,s,0]:120<=t&&t<180?[n,a,h]=[0,s,o]:180<=t&&t<240?[n,a,h]=[0,o,s]:240<=t&&t<300?[n,a,h]=[o,0,s]:300<=t&&t<360&&([n,a,h]=[s,0,o]),`rgb(${255*(n+r)}, ${255*(a+r)}, ${255*(h+r)})`}}const et={color:"blue",alpha:.2},it={color:"black",alpha:1},st={ENCLOSED:"data-sre-enclosed",BBOX:"data-sre-highlighter-bbox",ADDED:"data-sre-highlighter-added"};class ot{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,o=i.lineAttr,r=new Map;for(const e of t){const t=e.closest(s),i=t?t.getAttribute(o):"";r.has(i)||r.set(i,[]),r.get(i).push(e)}for(const i of r.values())if(i.length>1){let[s,o,r,n]=[1/0,1/0,-1/0,-1/0];for(const t of i){t.setAttribute(st.ENCLOSED,"true");const{left:e,top:i,right:a,bottom:h}=t.getBoundingClientRect();i===h&&e===a||(e<s&&(s=e),i<o&&(o=i),h>n&&(n=h),a>r&&(r=a))}const a=this.createEnclosure(s,n,r-s,n-o,e,i[0]);t.push(a)}return t}setColorCSS(t,e,i){var s,o;const r=null!==(s=e.color)&&void 0!==s?s:i.color,n=null!==(o=e.alpha)&&void 0!==o?o:i.alpha;T.setColor(t,this.priority,r,n)}setColor(t,e){this.setColorCSS("fg",e,it),this.setColorCSS("bg",t,et)}isHighlighted(t){return t.hasAttribute(this.ATTR)}setHighlighted(t){t.setAttribute(this.ATTR,"true")}unsetHighlighted(t){t.removeAttribute(this.ATTR),t.removeAttribute(st.ENCLOSED)}}class rt extends ot{highlightNode(t){if(this.isHighlighted(t)||"svg"===t.tagName||"MJX-CONTAINER"===t.tagName||t.hasAttribute(st.BBOX)||t.hasAttribute(st.ENCLOSED))return;const{x:e,y:i,width:s,height:o}=t.getBBox(),r=this.createRect(e,i,s,o,t.getAttribute("transform"));this.setHighlighted(r),t.parentNode.insertBefore(r,t)}unhighlightNode(t){if(t.hasAttribute(st.BBOX))return void t.remove();const e=t.previousSibling;(null==e?void 0:e.hasAttribute(st.ADDED))&&e.remove()}createEnclosure(t,e,i,s,o,r){const[n,a]=this.screen2svg(t,e,r),[h,l]=this.screen2svg(t+i,e-s,r),c=this.createRect(n,a,h-n,l-a,r.getAttribute("transform"));return c.setAttribute(st.BBOX,"true"),r.parentNode.insertBefore(c,r),c}screen2svg(t,e,i){const s=i,o=DOMPoint.fromPoint({x:t,y:e}).matrixTransform(s.getScreenCTM().inverse());return[o.x,o.y]}createRect(t,e,i,s,o){const r=document.createElementNS("http://www.w3.org/2000/svg","rect");return r.setAttribute(st.ADDED,"true"),r.setAttribute("x",String(t-40)),r.setAttribute("y",String(e-40)),r.setAttribute("width",String(i+80)),r.setAttribute("height",String(s+80)),o&&r.setAttribute("transform",o),r}isMactionNode(t){return"maction"===t.getAttribute("data-mml-node")}getMactionNodes(t){return Array.from(t.querySelectorAll('[data-mml-node="maction"]'))}}rt.lineSelector="[data-mjx-linebox]",rt.lineAttr="data-mjx-lineno";class nt extends ot{highlightNode(t){}unhighlightNode(t){"mjx-bbox"===t.tagName.toLowerCase()&&t.remove()}createEnclosure(t,e,i,s,o){const r=o.getBoundingClientRect(),n=document.createElement("mjx-bbox");return n.style.width=i+"px",n.style.height=s+"px",n.style.left=t-r.left+"px",n.style.top=e-s-r.top+"px",n.style.position="absolute",o.prepend(n),n}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 at(t,e,i,s){const o=new ht[s](t);return o.setColor(e,i),o}nt.lineSelector="mjx-linebox",nt.lineAttr="lineno";const ht={SVG:rt,CHTML:nt,generic:nt};class lt{constructor(t){this.document=t,this.speechRegion=new O(this.document),this.brailleRegion=new T(this.document),this.magnifier=new I(this.document),this.tooltip1=new R(this.document),this.tooltip2=new R(this.document),this.tooltip3=new R(this.document)}}const ct={speech:(t,e,i,...s)=>{const o=K.create(t,e,t.explorerRegions.speechRegion,i,t.explorerRegions.brailleRegion,t.explorerRegions.magnifier,s[0],s[1]);return o.sound=!0,o},mouseMagnifier:(t,e,i,...s)=>W.create(t,e,t.explorerRegions.magnifier,i,(t=>t.hasAttribute("data-semantic-type")),(t=>t)),hover:(t,e,i,...s)=>Y.create(t,e,null,i),infoType:(t,e,i,...s)=>z.create(t,e,t.explorerRegions.tooltip1,i,(t=>t.hasAttribute("data-semantic-type")),(t=>t.getAttribute("data-semantic-type"))),infoRole:(t,e,i,...s)=>z.create(t,e,t.explorerRegions.tooltip2,i,(t=>t.hasAttribute("data-semantic-role")),(t=>t.getAttribute("data-semantic-role"))),infoPrefix:(t,e,i,...s)=>z.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)=>Q.create(t,e,null,i),treeColoring:(t,e,i,...s)=>Z.create(t,e,null,i,...s)};class ut{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(ct))this.explorers[t]=ct[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 K?(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=at(T.priority.primary,e,t,this.document.outputJax.name)}setSecondaryHighlighter(){this.secondaryHighlighter=at(T.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 dt="Unix"===A.os;function pt(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()>=d.EXPLORER)){if(!this.isEscaped&&(t.options.enableExplorer||i)){const i=this.typesetRoot,s=e(this.root);this.explorers||(this.explorers=new ut),this.explorers.init(t,i,s,this)}this.state(d.EXPLORER)}}state(t=null,e=!1){if(t<d.EXPLORER&&this.explorers)for(const t of Object.values(this.explorers.explorers))t.active&&t.Stop();return super.state(t,e)}rerender(t,e=d.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 o=t.adaptor;o.append(o.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=dt?"tree":"application",i.roleDescription="math",i.none="\x91",i.brailleNone="\u2800",i}function gt(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 x(this.mmlFactory),s=this.options;s.a11y.speechRules||(s.a11y.speechRules=`${s.sre.domain}-${s.sre.style}`);const o=s.MathItem=pt(s.MathItem,(t=>i.visitTree(t)));o.roleDescription=s.roleDescription,this.explorerRegions=new lt(this),"addStyles"in this&&this.addStyles(this.constructor.speechStyles);const r=this.adaptor,n="http://www.w3.org/2000/svg";this.infoIcon=r.node("mjx-help",{},[r.node("svg",{viewBox:"0 0 18 18",xmlns:n,"aria-hidden":"true"},[r.node("circle",{stroke:"none"},[],n),r.node("circle",{},[],n),r.node("line",{x1:9,y1:9,x2:9,y2:13},[],n),r.node("line",{x1:9,y1:5.5,x2:9,y2:5.5},[],n)],n)]),this.tmpFocus=r.node("mjx-focus",{tabIndex:0,style:{outline:"none",display:"block",position:"absolute",top:0,left:"-10px",width:"1px",height:"1px",overflow:"hidden"},role:o.ariaRole,"aria-label":o.none,"aria-roledescription":o.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<d.EXPLORER&&this.processed.clear("explorer"),this}}).OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableExplorer:y,enableExplorerHelp:!0,renderActions:f(Object.assign(Object.assign({},t.OPTIONS.renderActions),{explorable:[d.EXPLORER]})),sre:f(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 mt(t,e=null){return t.documentClass.prototype.attachSpeech||(t=m(t,e)),t.documentClass=gt(t.documentClass),t}function bt(t,e){var i;const s=U();for(const i in e)void 0!==t.options.a11y[i]?ft(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 ft(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}}p("EXPLORER",d.INSERTED+30),MathJax.loader&&MathJax.loader.checkVersion("a11y/explorer","4.1.0","a11y"),c({_:{a11y:{explorer_ts:h,explorer:{Explorer:i,ExplorerPool:a,Highlighter:n,KeyExplorer:s,MouseExplorer:o,Region:e,TreeExplorer:r}}}}),MathJax.startup&&y&&MathJax.startup.extendHandler((t=>mt(t)))})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{EnrichHandler:()=>f,EnrichedMathDocumentMixin:()=>M,EnrichedMathItemMixin:()=>p,enrichVisitor:()=>u});const i=("undefined"!=typeof window?window:t.g).MathJax._.components.global,n=(i.GLOBAL,i.isObject,i.combineConfig,i.combineDefaults,i.combineWithMathJax),r=(i.MathJax,MathJax._.core.MathItem),s=(r.protoItem,r.AbstractMathItem,r.STATE),a=r.newState,o=MathJax._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor,c=MathJax._.util.Options,h=(c.isObject,c.APPEND,c.REMOVE,c.OPTIONS,c.Expandable,c.expandable),l=(c.makeArray,c.keys,c.copy,c.insert,c.defaultOptions,c.userOptions,c.selectOptions,c.selectOptionsFromKeys,c.separateOptions,c.lookup,MathJax._.a11y.sre_ts),d=(l.locales,l.setupEngine),m=(l.engineSetup,l.toEnriched);l.parseDOM,l.addPreference,l.fromPreference,l.toPreference;a("ENRICHED",s.COMPILED+10);class u extends o{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,n]=0===t.childNodes.length?["",""]:["\n",e],r=this.childNodeMml(t,e+" ",i);let s=this.getAttributes(t);if("toggle"===t.attributes.get("actiontype")){const e=++this.mactionId;t.setProperty("mactionId",e),s=` data-maction-id="${e}" selection="${t.attributes.get("selection")}"`+s.replace(/ selection="\d+"/,"").replace(/ data-maction-id="\d+"/,"")}return`${e}<maction${s}>`+(r.match(/\S/)?i+r+n:"")+"</maction>"}}function p(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()>=s.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 n=m(e);this.inputData.enrichedMml=i.math=this.serializeMml(n),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(s.ENRICHED)}}toEnriched(t){return this.serializeMml(m(t))}unEnrich(t){const i=this.inputData.originalMml;if(!i)return;const n=new t.options.MathItem("",e);n.math=i,n.display=this.display,n.compile(t),this.root=n.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,n)=>`${i}"${e[n].attributes.get("selection")}"`))}}}function M(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 n=new u(this.mmlFactory);this.options.MathItem=p(this.options.MathItem,e,((t,e)=>n.visitTree(t,e)))}enrich(){if(!this.processed.isSet("enriched")){if(this.options.enableEnrichment){d(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<s.ENRICHED&&(this.processed.clear("enriched"),t>=s.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:h(Object.assign(Object.assign({},t.OPTIONS.renderActions),{enrich:[s.ENRICHED]})),sre:h({speech:"none",locale:"en",domain:"clearspeak",style:"default",braille:"nemeth",structure:!0,aria:!0})}),i}function f(t,e){return e.setAdaptor(t.adaptor),t.documentClass=M(t.documentClass,e),t}MathJax.loader&&MathJax.loader.checkVersion("a11y/semantic-enrich","4.1.0","a11y"),n({_:{a11y:{"semantic-enrich":e}}});const E=MathJax._.input.mathml_ts.MathML;MathJax.startup&&MathJax.startup.extendHandler((t=>f(t,new E({allowHtmlInTokenNodes:!0}))))})();
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e={d:(t,s)=>{for(var a in s)e.o(s,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:s[a]})}};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var t={};e.r(t),e.d(t,{InPlace:()=>E,SemAttr:()=>M,buildLabel:()=>x,buildSpeech:()=>L,honk:()=>O,ssmlParsing:()=>y});var s={};e.r(s),e.d(s,{GeneratorPool:()=>j});var a={};e.r(a),e.d(a,{WorkerHandler:()=>R});var i={};e.r(i),e.d(i,{SpeechHandler:()=>H,SpeechMathDocumentMixin:()=>D,SpeechMathItemMixin:()=>I});const o=("undefined"!=typeof window?window:e.g).MathJax._.components.global,n=(o.GLOBAL,o.isObject,o.combineConfig,o.combineDefaults),r=o.combineWithMathJax,c=o.MathJax,h=MathJax._.a11y["semantic-enrich"],d=(h.enrichVisitor,h.EnrichedMathItemMixin,h.EnrichedMathDocumentMixin,h.EnrichHandler),l=MathJax._.core.MathItem,p=(l.protoItem,l.AbstractMathItem,l.STATE),u=l.newState,m=MathJax._.util.Options,f=(m.isObject,m.APPEND,m.REMOVE,m.OPTIONS,m.Expandable,m.expandable),b=(m.makeArray,m.keys,m.copy,m.insert,m.defaultOptions,m.userOptions,m.selectOptions,m.selectOptionsFromKeys,m.separateOptions,m.lookup,MathJax._.a11y.sre_ts),g=(b.locales,b.setupEngine,b.engineSetup,b.toEnriched,b.parseDOM),v=(b.addPreference,b.fromPreference,b.toPreference,["pitch","rate","volume"]);function y(e){const t=g(e),s=[],a=[];return w(Array.from(t.childNodes),s,a),[a.join(" "),s]}function w(e,t,s,a={}){for(const i of e)if(3!==i.nodeType){if(1===i.nodeType){const e=i,o=e.tagName;if("speak"===o)continue;if("prosody"===o){w(Array.from(i.childNodes),t,s,k(e,a));continue}switch(o){case"break":t.push({pause:e.getAttribute("time")});break;case"mark":t.push({mark:e.getAttribute("name")});break;case"say-as":{const i=e.textContent;t.push(Object.assign({text:i,character:!0},a)),s.push(i);break}}}}else{const e=i.textContent.trim();e&&(s.push(e),t.push(Object.assign({text:e},a)))}}const S={pitch:(e,t)=>e/100*1,volume:(e,t)=>e/100*.5,rate:(e,t)=>e/100*1};function k(e,t){const s={};for(const a of v)if(e.hasAttribute(a)){const[i,o]=A(e.getAttribute(a));if(!i){s[a]="volume"===a?.5:1;continue}let n=t[a];n=n||("volume"===a?.5:1);const r=S[a](parseInt(o,10),i);s[a]="-"===i?n-r:n+r}return s}const P=/([+-]?)([0-9]+)%/;function A(e){const t=e.match(P);return t?[t[1],t[2]]:(console.warn("Something went wrong with the prosody matching."),["","100"])}function x(e,t,s,a=" "){if(!e)return"";const i=[e];return t&&i.unshift(t),s&&i.push(s),i.join(a)}function L(e,t="en",s="100"){return y(`<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="${t}"><prosody rate="${s}%">${e}</prosody></speak>`)}function O(){const e=new AudioContext,t=e.createOscillator();t.frequency.value=300,t.connect(e.destination),t.start(e.currentTime),t.stop(e.currentTime+.05)}var E,M;!function(e){e[e.NONE=0]="NONE",e[e.DEPTH=1]="DEPTH",e[e.SUMMARY=2]="SUMMARY"}(E||(E={})),function(e){e.SPEECH="data-semantic-speech-none",e.SPEECH_SSML="data-semantic-speech",e.SUMMARY="data-semantic-summary-none",e.SUMMARY_SSML="data-semantic-summary",e.PREFIX="data-semantic-prefix-none",e.PREFIX_SSML="data-semantic-prefix",e.POSTFIX="data-semantic-postfix-none",e.POSTFIX_SSML="data-semantic-postfix",e.BRAILLE="data-semantic-braille"}(M||(M={}));class j{constructor(){this.promise=Promise.resolve(),this.adaptor=null,this._options={},this._init=!1}set element(e){this._element=e}get element(){return this._element}set options(e){this._options=Object.assign({},(null==e?void 0:e.sre)||{},{enableSpeech:e.enableSpeech,enableBraille:e.enableBraille}),delete this._options.custom}get options(){return this._options}init(e,t,s){this.options=e,this._init||(this.adaptor=t,this.webworker=s,this._init=!0)}update(e){Object.assign(this.options,e)}Speech(e){const t=e.outputData.mml,s=Object.assign({},this.options,{modality:"speech"});return this.promise=this.webworker.Speech(t,s,e)}SpeechFor(e,t){const s=Object.assign({},this.options,{modality:"speech"});return this.webworker.speechFor(t,s,e)}cancel(e){var t;null===(t=this.webworker)||void 0===t||t.Cancel(e)}updateRegions(e,t,s){t.Update(this.getLabel(e)),s.Update(this.getBraille(e))}getOptions(e){var t,s,a,i;return{locale:null!==(t=this.adaptor.getAttribute(e,"data-semantic-locale"))&&void 0!==t?t:"",domain:null!==(s=this.adaptor.getAttribute(e,"data-semantic-domain"))&&void 0!==s?s:"",style:null!==(a=this.adaptor.getAttribute(e,"data-semantic-style"))&&void 0!==a?a:"",domain2style:null!==(i=this.adaptor.getAttribute(e,"data-semantic-domain2style"))&&void 0!==i?i:""}}nextRules(e){const t=this.getOptions(e.typesetRoot);return this.update(t),this.promise=this.webworker.nextRules(e.outputData.mml,Object.assign({},this.options,{modality:"speech"}),e)}nextStyle(e,t){const s=this.getOptions(t.typesetRoot);return this.update(s),this.promise=this.webworker.nextStyle(t.outputData.mml,Object.assign({},this.options,{modality:"speech"}),this.adaptor.getAttribute(e,"data-semantic-id"),t)}getLabel(e,t="",s=" "){const a=this.adaptor;return x(a.getAttribute(e,M.SPEECH_SSML),a.getAttribute(e,M.PREFIX_SSML),a.getAttribute(e,M.POSTFIX_SSML),s)||a.getAttribute(e,"aria-label")}getBraille(e){const t=this.adaptor;return t.getAttribute(e,"aria-braillelabel")||t.getAttribute(e,M.BRAILLE)}getLocalePreferences(e){return this.promise=this.webworker.clearspeakLocalePreferences(this.options,e)}getRelevantPreferences(e,t,s,a){const i=e.outputData.mml;return this.promise=this.webworker.clearspeakRelevantPreferences(i,t,s,a)}}var C=function(e,t,s,a){return new(s||(s=Promise))((function(i,o){function n(e){try{c(a.next(e))}catch(e){o(e)}}function r(e){try{c(a.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(n,r)}c((a=a.apply(e,t||[])).next())}))};class T{constructor(e,t,s,a){this.cmd=e,this.item=t,this.resolve=s,this.reject=a}}class R{constructor(e,t){this.adaptor=e,this.options=t,this.ready=!1,this.tasks=[],this.Commands={Ready(e,t){e.ready=!0,e.postNext()},Finished(e,t){const s=e.tasks.shift();t.success?s.resolve(t.result):s.reject(t.error),e.postNext()},Log(e,t){e.options.debug&&console.log("Log:",t)}}}Start(){return C(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(e,...t){this.options.debug&&console.info(e,...t)}Listener(e){this.debug("Worker >>> Client:",e.data),Object.hasOwn(this.Commands,e.data.cmd)?this.Commands[e.data.cmd](this,e.data.data):this.debug("Invalid command from worker: "+e.data.cmd)}Post(e,t){const s=new Promise(((s,a)=>{this.tasks.push(new T(e,t,s,a))}));return this.ready&&1===this.tasks.length&&this.postNext(),s}postNext(){if(this.tasks.length){const e=Object.assign({},this.tasks[0].cmd,{debug:this.options.debug});this.worker.postMessage(e)}}Cancel(e){const t=this.tasks.findIndex((t=>t.item===e));t>0&&(this.tasks[t].reject(`Task ${this.tasks[t].cmd.cmd} cancelled`),this.tasks.splice(t,1))}Setup(e){return this.Post({cmd:"setup",data:{domain:e.domain,style:e.style,locale:e.locale,modality:e.modality}})}Speech(e,t,s){return C(this,void 0,void 0,(function*(){this.Attach(s,t.enableSpeech,t.enableBraille,yield this.Post({cmd:"speech",data:{mml:e,options:t}},s))}))}nextRules(e,t,s){return C(this,void 0,void 0,(function*(){this.Attach(s,t.enableSpeech,t.enableBraille,yield this.Post({cmd:"nextRules",data:{mml:e,options:t}},s))}))}nextStyle(e,t,s,a){return C(this,void 0,void 0,(function*(){this.Attach(a,t.enableSpeech,t.enableBraille,yield this.Post({cmd:"nextStyle",data:{mml:e,options:t,nodeId:s}},a))}))}speechFor(e,t,s){return C(this,void 0,void 0,(function*(){const a=yield this.Post({cmd:"speech",data:{mml:e,options:t}},s);return JSON.parse(a)}))}Attach(e,t,s,a){const i=JSON.parse(a),o=e.typesetRoot;if(!o)return;this.setSpecialAttributes(o,i.options,"data-semantic-",["locale","domain","style","domain2style"]);const n=this.adaptor;this.setSpecialAttributes(o,i.translations,"data-semantic-");for(const[e,t]of Object.entries(i.mactions)){let s=n.getElement("#"+e,o);s&&n.childNodes(s)[0]&&(s=n.childNodes(s)[0],"rect"===n.kind(s)&&(s=n.next(s)),n.setAttribute(s,"data-semantic-type","dummy"),this.setSpecialAttributes(s,t,""))}this.setSpeechAttributes(n.childNodes(o)[0],"",i,t,s),t&&(i.label&&(n.setAttribute(o,M.SPEECH,i.label),n.setAttribute(o,M.SPEECH_SSML,i.ssml),e.outputData.speech=i.label),n.setAttribute(o,"data-speech-attached","true")),s&&(i.braillelabel&&(n.setAttribute(o,M.BRAILLE,i.braillelabel),e.outputData.braille=i.braillelabel),i.braille&&n.setAttribute(o,"data-braille-attached","true"))}setSpeechAttribute(e,t,s,a){var i,o;const n=this.adaptor,r=n.getAttribute(e,"data-semantic-id");if(n.removeAttribute(e,"data-speech-node"),s&&t.speech[r]["speech-none"]){n.setAttribute(e,"data-speech-node","true");for(let[s,a]of Object.entries(t.speech[r]))s=s.replace(/-ssml$/,""),a&&n.setAttribute(e,`data-semantic-${s}`,a)}if(a&&(null===(o=null===(i=t.braille)||void 0===i?void 0:i[r])||void 0===o?void 0:o["braille-none"])){n.setAttribute(e,"data-speech-node","true");const s=t.braille[r]["braille-none"];n.setAttribute(e,M.BRAILLE,s)}}setSpeechAttributes(e,t,s,a,i){const o=this.adaptor;if(!e||"#text"===o.kind(e)||"#comment"===o.kind(e))return t;o.hasAttribute(e,"data-semantic-id")&&(this.setSpeechAttribute(e,s,a,i),t||o.hasAttribute(e,"data-semantic-parent")||(t=o.getAttribute(e,"data-semantic-id")));for(const n of Array.from(o.childNodes(e)))t=this.setSpeechAttributes(n,t,s,a,i);return t}setSpecialAttributes(e,t,s,a){if(t){a=a||Object.keys(t);for(const i of a){const a=t[i];a&&this.adaptor.setAttribute(e,`${s}${i.toLowerCase()}`,a)}}}Detach(e){const t=e.typesetRoot;this.adaptor.removeAttribute(t,"data-speech-attached"),this.adaptor.removeAttribute(t,"data-braille-attached"),this.detachSpeech(t)}detachSpeech(e){const t=this.adaptor,s=t.childNodes(e);if(s){if("#text"!==t.kind(e))for(const s of["none","summary-none","speech","speech-none","summary","braille"])t.removeAttribute(e,`data-semantic-${s}`);for(const e of s)this.detachSpeech(e)}}Terminate(){this.debug("Terminating pending tasks");for(const e of this.tasks)e.reject(`${e.cmd.data.cmd} cancelled by WorkerHandler termination`);return this.tasks=[],this.debug("Terminating worker"),this.worker.terminate()}Stop(){return C(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(e,t){return C(this,void 0,void 0,(function*(){yield this.Post({cmd:"localePreferences",data:{options:e}}).then((s=>{t.set(e.locale,JSON.parse(s))}))}))}clearspeakRelevantPreferences(e,t,s,a){return C(this,void 0,void 0,(function*(){yield this.Post({cmd:"relevantPreferences",data:{mml:e,id:t}}).then((e=>{s.set(a,e)}))}))}}const _=c.config||{},F=()=>(_?.loader?.paths?.mathjax||_?.__dirname||"/")+"/sre";var N=function(e,t,s,a){return new(s||(s=Promise))((function(i,o){function n(e){try{c(a.next(e))}catch(e){o(e)}}function r(e){try{c(a.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(n,r)}c((a=a.apply(e,t||[])).next())}))};function I(e){return class extends e{constructor(){super(...arguments),this.generatorPool=new j}attachSpeech(e){if(this.outputData.speechPromise=null,this.state()>=p.ATTACHSPEECH)return;if(this.state(p.ATTACHSPEECH),this.isEscaped||!e.options.enableSpeech&&!e.options.enableBraille||!e.options.enableEnrichment)return;e.getWebworker(),this.generatorPool.init(e.options,e.adaptor,e.webworker),this.outputData.mml=this.toMathML(this.root,this);const t=this.generatorPool.Speech(this).catch((t=>e.options.speechError(e,this,t)));e.savePromise(t),this.outputData.speechPromise=t}detachSpeech(e){e.webworker.Detach(this)}speechFor(e){return N(this,void 0,void 0,(function*(){e=this.toEnriched(e);const t=yield this.generatorPool.SpeechFor(this,e);return[t.label,t.braillelabel]}))}clear(){this.generatorPool.cancel(this)}}}function D(e){var t;return(t=class extends e{constructor(...e){super(...e),this.webworker=null;const t=this.constructor.ProcessBits;t.has("attach-speech")||t.allocate("attach-speech"),this.options.MathItem=I(this.options.MathItem)}getWebworker(){this.webworker||(this.webworker=new R(this.adaptor,this.options.worker),this.webworker.Start())}attachSpeech(){if(!this.processed.isSet("attach-speech")){const e=this.options;if(e.enableEnrichment&&(e.enableSpeech||e.enableBraille)){this.getWebworker();for(const e of this.math)e.attachSpeech(this)}this.processed.set("attach-speech")}return this}speechError(e,t,s){console.warn("Speech generation error:",s)}state(e,t=!1){if(super.state(e,t),e<p.ATTACHSPEECH&&(this.processed.clear("attach-speech"),e>=p.TYPESET))for(const e of this.math)e.detachSpeech(this);return this}done(){const e=Object.create(null,{done:{get:()=>super.done}});return N(this,void 0,void 0,(function*(){var t;return yield null===(t=this.webworker)||void 0===t?void 0:t.Stop(),e.done.call(this)}))}}).OPTIONS=Object.assign(Object.assign({},e.OPTIONS),{enableSpeech:!0,enableBraille:!0,speechError:(e,t,s)=>e.speechError(e,t,s),renderActions:f(Object.assign(Object.assign({},e.OPTIONS.renderActions),{attachSpeech:[p.ATTACHSPEECH]})),worker:{path:F(),maps:F().replace(/[cm]js\/a11y\/sre$/,"bundle/sre/mathmaps"),worker:"speech-worker.js",debug:!1},a11y:f({speech:!0,braille:!0})}),t}function H(e,t){return!e.documentClass.prototype.enrich&&t&&(e=d(e,t)),e.documentClass=D(e.documentClass),e}u("ATTACHSPEECH",p.INSERTED+10),MathJax.loader&&MathJax.loader.checkVersion("a11y/speech","4.1.0","a11y"),r({_:{a11y:{speech_ts:i,speech:{GeneratorPool:s,SpeechUtil:t,WebWorker:a}}}});const $=MathJax._.util.FunctionList.FunctionList,J=c.config||{},B=MathJax._.util.context,W=(B.hasWindow,B.context);var q=function(e,t,s,a){return new(s||(s=Promise))((function(i,o){function n(e){try{c(a.next(e))}catch(e){o(e)}}function r(e){try{c(a.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(n,r)}c((a=a.apply(e,t||[])).next())}))};const U=e=>(Object.hasOwn(Q.source,e.name)&&(e.name=Q.source[e.name]),!0),V=e=>{const t=e.name;return t.match(/^(?:[a-z]+:\/)?\/|[a-z]:[/\\]|\[/i)||(e.name="[mathjax]/"+t.replace(/^\.\//,"")),!0},X=e=>{let t;for(;(t=e.name.match(/^\[([^\]]*)\]/))&&Object.hasOwn(Q.paths,t[1]);)e.name=Q.paths[t[1]]+e.name.substring(t[0].length);return!0},Y=e=>(e.addExtension&&!e.name.match(/\.[^/]+$/)&&(e.name+=".js"),!0),G=c.version,z={versions:new Map,nestedLoads:[],ready(...e){0===e.length&&(e=Array.from(ee.packages.keys()));const t=[];for(const s of e){const e=ee.packages.get(s)||new ee(s,!0);t.push(e.promise)}return Promise.all(t)},load(...e){if(0===e.length)return Promise.resolve([]);let t=[];this.nestedLoads.unshift(t);const s=Promise.resolve().then((()=>q(this,void 0,void 0,(function*(){const s=[];for(const t of e){let e=ee.packages.get(t);e||(e=new ee(t),e.provides(Q.provides[t])),e.checkNoLoad(),s.push(e.promise.then((()=>(Q.versionWarnings&&e.isLoaded&&!z.versions.has(ee.resolvePath(t))&&console.warn(`No version information available for component ${t}`),e.result))))}ee.loadAll();const a=yield Promise.all(s);for(;t.length;){const e=Promise.all(t);t=this.nestedLoads[this.nestedLoads.indexOf(t)]=[],yield e}return this.nestedLoads.splice(this.nestedLoads.indexOf(t),1),a}))));return this.nestedLoads.slice(1).forEach((e=>e.push(s))),s},preLoaded(...e){for(const t of e){let e=ee.packages.get(t);e||(e=new ee(t,!0),e.provides(Q.provides[t])),e.loaded()}},addPackageData(e,t){let s=Q[e];s||(s=Q[e]={});for(const[e,a]of Object.entries(t))if(Array.isArray(a)){s[e]||(s[e]=[]);const t=new Set([...s[e],...a]);s[e]=[...t]}else s[e]=a},defaultReady(){void 0!==K.startup&&K.config.startup.ready()},getRoot(){if(W.document){const e=W.document.currentScript||W.document.getElementById("MathJax-script");if(e&&e instanceof HTMLScriptElement)return e.src.replace(/\/[^/]*$/,"")}return J?.loader?.paths?.mathjax||J?.__dirname||"/"},checkVersion(e,t,s){return this.saveVersion(e),!(!Q.versionWarnings||t===G)&&(console.warn(`Component ${e} uses ${t} of MathJax; version in use is ${G}`),!0)},saveVersion(e){z.versions.set(ee.resolvePath(e),G)},pathFilters:new $};z.pathFilters.add(U,0),z.pathFilters.add(V,10),z.pathFilters.add(X,20),z.pathFilters.add(Y,30);const K=c;if(void 0===K.loader){n(K.config,"loader",{paths:{mathjax:z.getRoot(),fonts:W.window?"https://cdn.jsdelivr.net/npm/@mathjax":"@mathjax"},source:{},dependencies:{},provides:{},load:[],ready:z.defaultReady.bind(z),failed:e=>console.log(`MathJax(${e.package||"?"}): ${e.message}`),require:null,pathFilters:[],versionWarnings:!0}),r({loader:z});for(const e of K.config.loader.pathFilters)Array.isArray(e)?z.pathFilters.add(e[0],e[1]):z.pathFilters.add(e)}const Q=K.config.loader;class Z extends Error{constructor(e,t){super(e),this.package=t}}class ee{get canLoad(){return 0===this.dependencyCount&&!this.noLoad&&!this.isLoading&&!this.hasFailed}static loadPromise(e){const t=Q[e]||{},s=t.extraLoads?z.load(...t.extraLoads):Promise.resolve(),a=t.checkReady||(()=>Promise.resolve());return s.then((()=>a()))}static resolvePath(e,t=!0){const s={name:e,original:e,addExtension:t};return z.pathFilters.execute(s),s.name}static loadAll(){for(const e of this.packages.values())e.canLoad&&e.load()}constructor(e,t=!1){this.isLoaded=!1,this.result={},this.isLoading=!1,this.hasFailed=!1,this.dependents=[],this.dependencies=[],this.dependencyCount=0,this.provided=[],this.name=e,this.noLoad=t,ee.packages.set(e,this),this.promise=this.makePromise(this.makeDependencies())}makeDependencies(){const e=[],t=ee.packages,s=this.noLoad,a=this.name,i=[];Object.hasOwn(Q.dependencies,a)?i.push(...Q.dependencies[a]):"core"!==a&&i.push("core");for(const a of i){const i=t.get(a)||new ee(a,s);this.dependencies.includes(i)||(i.addDependent(this,s),this.dependencies.push(i),i.isLoaded||(this.dependencyCount++,e.push(i.promise)))}return e}makePromise(e){let t=new Promise(((e,t)=>{this.resolve=e,this.reject=t}));const s=Q[this.name]||{};return s.ready&&(t=t.then((e=>s.ready(this.name)))),e.length&&(e.push(t),t=Promise.all(e).then((e=>e.join(", ")))),s.failed&&t.catch((e=>s.failed(new Z(e,this.name)))),t}load(){if(!this.isLoaded&&!this.isLoading&&!this.noLoad){this.isLoading=!0;const e=ee.resolvePath(this.name);Q.require?this.loadCustom(e):this.loadScript(e)}}loadCustom(e){try{const t=Q.require(e);t instanceof Promise?t.then((e=>this.result=e)).then((()=>this.checkLoad())).catch((t=>this.failed("Can't load \""+e+'"\n'+t.message.trim()))):(this.result=t,this.checkLoad())}catch(e){this.failed(e.message)}}loadScript(e){const t=W.document.createElement("script");t.src=e,t.charset="UTF-8",t.onload=e=>this.checkLoad(),t.onerror=t=>this.failed("Can't load \""+e+'"'),W.document.head.appendChild(t)}loaded(){this.isLoaded=!0,this.isLoading=!1;for(const e of this.dependents)e.requirementSatisfied();for(const e of this.provided)e.loaded();this.resolve(this.name)}failed(e){this.hasFailed=!0,this.isLoading=!1,this.reject(new Z(e,this.name))}checkLoad(){ee.loadPromise(this.name).then((()=>this.loaded())).catch((e=>this.failed(e)))}requirementSatisfied(){this.dependencyCount&&(this.dependencyCount--,this.canLoad&&this.load())}provides(e=[]){for(const t of e){let e=ee.packages.get(t);e||(Q.dependencies[t]||(Q.dependencies[t]=[]),Q.dependencies[t].push(t),e=new ee(t,!0),e.isLoading=!0),this.provided.push(e)}}addDependent(e,t){this.dependents.push(e),t||this.checkNoLoad()}checkNoLoad(){if(this.noLoad){this.noLoad=!1;for(const e of this.dependencies)e.checkNoLoad()}}}if(ee.packages=new Map,MathJax.loader){let e=ee.resolvePath("[sre]",!1),t=ee.resolvePath("[mathmaps]",!1);if(W.window)e=new URL(e,location).href,t=new URL(t,location).href;else{const s="undefined"!=typeof require?require:MathJax.config.loader.require;s?.resolve?(e=W.path(s.resolve(`${e}/require.mjs`)).replace(/\/[^\/]*$/,""),t=W.path(s.resolve(`${t}/base.json`)).replace(/\/[^\/]*$/,"")):e=t=""}e&&n(MathJax.config,"options",{worker:{path:e,maps:t}})}MathJax.startup&&MathJax.startup.extendHandler((e=>H(e)))})();