execonvert 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +79 -0
- package/README.md +194 -0
- package/THIRD_PARTY_NOTICES.md +42 -0
- package/bin/execonvert.js +21 -0
- package/dist/cli/app/public/THIRD_PARTY_NOTICES.md +32 -0
- package/dist/cli/app/public/base.elpx +0 -0
- package/dist/cli/app/public/exe_math_assets.zip +0 -0
- package/dist/cli/app/public/exelearning/app/common/common_i18n.js +79 -0
- package/dist/cli/app/public/exelearning/app/common/exe_powered_logo/exe_powered_logo.png +0 -0
- package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.ca.js +79 -0
- package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.de.js +79 -0
- package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.en.js +79 -0
- package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.eo.js +79 -0
- package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.es.js +79 -0
- package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.eu.js +79 -0
- package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.gl.js +79 -0
- package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.it.js +79 -0
- package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.pt.js +79 -0
- package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.ro.js +79 -0
- package/dist/cli/app/public/exelearning/app/common/i18n/common_i18n.va.js +79 -0
- package/dist/cli/app/public/exelearning/bundles/common.zip +0 -0
- package/dist/cli/app/public/exelearning/bundles/content-css.zip +0 -0
- package/dist/cli/app/public/exelearning/bundles/idevices.zip +0 -0
- package/dist/cli/app/public/exelearning/bundles/libs.zip +0 -0
- package/dist/cli/app/public/exelearning/bundles/manifest.json +110 -0
- package/dist/cli/app/public/exelearning/bundles/themes/base.zip +0 -0
- package/dist/cli/app/public/exelearning/bundles/themes/flux.zip +0 -0
- package/dist/cli/app/public/exelearning/bundles/themes/neo.zip +0 -0
- package/dist/cli/app/public/exelearning/bundles/themes/nova.zip +0 -0
- package/dist/cli/app/public/exelearning/bundles/themes/universal.zip +0 -0
- package/dist/cli/app/public/exelearning/bundles/themes/zen.zip +0 -0
- package/dist/cli/app/public/exelearning/exporters.bundle.js +12638 -0
- package/dist/cli/app/public/exelearning/importers.bundle.js +14061 -0
- package/dist/cli/app/public/exelearning/runtime-source.json +10 -0
- package/dist/cli/app/public/favicon.svg +11 -0
- package/dist/cli/app/public/idevices/text/text.css +16 -0
- package/dist/cli/app/public/idevices/text/text.html +3 -0
- package/dist/cli/app/public/idevices/text/text.js +291 -0
- package/dist/cli/app/public/info/cli.html +955 -0
- package/dist/cli/app/public/info/docx.svg +7 -0
- package/dist/cli/app/public/info/elpx-icon.png +0 -0
- package/dist/cli/app/public/info/exe-old.png +0 -0
- package/dist/cli/app/public/info/execonvert-cli-icon.svg +16 -0
- package/dist/cli/app/public/info/execonvert-icon.svg +11 -0
- package/dist/cli/app/public/info/index.html +723 -0
- package/dist/cli/app/public/info/markdown.svg +1 -0
- package/dist/cli/app/public/info/pdf.svg +14 -0
- package/dist/cli/app/public/libs/exe_math/LICENSE +202 -0
- package/dist/cli/app/public/libs/exe_math/a11y/assistive-mml.js +1 -0
- package/dist/cli/app/public/libs/exe_math/a11y/complexity.js +1 -0
- package/dist/cli/app/public/libs/exe_math/a11y/explorer.js +1 -0
- package/dist/cli/app/public/libs/exe_math/a11y/semantic-enrich.js +1 -0
- package/dist/cli/app/public/libs/exe_math/a11y/speech.js +1 -0
- package/dist/cli/app/public/libs/exe_math/a11y/sre.js +1 -0
- package/dist/cli/app/public/libs/exe_math/adaptors/jsdom.js +1 -0
- package/dist/cli/app/public/libs/exe_math/adaptors/linkedom.js +1 -0
- package/dist/cli/app/public/libs/exe_math/adaptors/liteDOM.js +1 -0
- package/dist/cli/app/public/libs/exe_math/core.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/asciimath.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/mml/entities.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/mml/extensions/mml3.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/mml/extensions/mml3.sef.json +1 -0
- package/dist/cli/app/public/libs/exe_math/input/mml.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/action.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/ams.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/amscd.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/autoload.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/bbm.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/bboldx.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/bbox.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/begingroup.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/boldsymbol.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/braket.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/bussproofs.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/cancel.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/cases.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/centernot.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/color.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/colortbl.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/colorv2.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/configmacros.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/dsfont.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/empheq.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/enclose.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/extpfeil.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/gensymb.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/html.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/mathtools.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/mhchem.js +34 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/newcommand.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/noerrors.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/noundefined.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/physics.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/require.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/setoptions.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/tagformat.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/texhtml.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/textcomp.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/textmacros.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/unicode.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/units.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/upgreek.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex/extensions/verb.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex-base.js +1 -0
- package/dist/cli/app/public/libs/exe_math/input/tex.js +1 -0
- package/dist/cli/app/public/libs/exe_math/loader.js +1 -0
- package/dist/cli/app/public/libs/exe_math/output/chtml.js +1 -0
- package/dist/cli/app/public/libs/exe_math/output/svg.js +1 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/af.json +146 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/base.json +137 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/ca.json +140 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/da.json +140 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/de.json +146 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/en.json +158 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/es.json +140 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/euro.json +32 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/fr.json +146 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/hi.json +146 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/it.json +146 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/ko.json +146 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/nb.json +146 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/nemeth.json +125 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/nn.json +146 -0
- package/dist/cli/app/public/libs/exe_math/sre/mathmaps/sv.json +146 -0
- package/dist/cli/app/public/libs/exe_math/sre/require.d.mts +1 -0
- package/dist/cli/app/public/libs/exe_math/sre/require.mjs +2 -0
- package/dist/cli/app/public/libs/exe_math/sre/speech-worker.js +1 -0
- package/dist/cli/app/public/libs/exe_math/startup.js +1 -0
- package/dist/cli/app/public/libs/exe_math/tex-mml-svg.js +1 -0
- package/dist/cli/app/public/libs/exe_math/ui/lazy.js +1 -0
- package/dist/cli/app/public/libs/exe_math/ui/menu.js +1 -0
- package/dist/cli/app/public/libs/exe_math/ui/safe.js +1 -0
- package/dist/cli/cli/execonvert.js +807 -0
- package/dist/cli/cli/runtime.js +237 -0
- package/dist/cli/package.json +3 -0
- package/dist/cli/src/converter.js +5078 -0
- package/dist/cli/src/docx-import.js +1121 -0
- package/dist/cli/src/elpx-markdown.js +201 -0
- package/dist/cli/src/i18n.js +485 -0
- package/dist/cli/src/index.js +1 -0
- package/dist/cli/src/legacy-elp.js +846 -0
- package/dist/cli/src/markdown-import.js +26 -0
- package/package.json +68 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="208" height="128" viewBox="0 0 208 128"><rect width="198" height="118" x="5" y="5" ry="10" stroke="#000" stroke-width="10" fill="none"/><path d="M30 98V30h20l20 25 20-25h20v68H90V59L70 84 50 59v39zm125 0l-30-33h20V30h20v35h20z"/></svg>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-hidden="true">
|
|
2
|
+
<path d="M16 4h22l14 14v34a8 8 0 0 1-8 8H16a8 8 0 0 1-8-8V12a8 8 0 0 1 8-8Z" fill="#d93025"/>
|
|
3
|
+
<path d="M38 4v12a4 4 0 0 0 4 4h10" fill="#f28b82"/>
|
|
4
|
+
<text
|
|
5
|
+
x="32"
|
|
6
|
+
y="39"
|
|
7
|
+
fill="#fff"
|
|
8
|
+
font-family="Arial, Helvetica, sans-serif"
|
|
9
|
+
font-size="13"
|
|
10
|
+
font-weight="700"
|
|
11
|
+
text-anchor="middle"
|
|
12
|
+
letter-spacing="0.3"
|
|
13
|
+
>PDF</text>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -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]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{AssistiveMmlHandler:()=>M,AssistiveMmlMathDocumentMixin:()=>h,AssistiveMmlMathItemMixin:()=>d,LimitedMmlVisitor:()=>c});const s=("undefined"!=typeof window?window:global).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,m=(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 c extends l{getAttributes(t){return super.getAttributes(t).replace(/ ?id=".*?"/,"")}}function d(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 h(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 c(this.mmlFactory),this.options.MathItem=d(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:m(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 M(t){return t.documentClass=h(t.documentClass),t}r("ASSISTIVEMML",153),MathJax.loader&&MathJax.loader.checkVersion("a11y/assistive-mml","4.0.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=>M(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]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{EnrichHandler:()=>x,EnrichedMathDocumentMixin:()=>m,EnrichedMathItemMixin:()=>u,enrichVisitor:()=>d});var i={};t.r(i),t.d(i,{Collapse:()=>f});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:global).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,C=(y.DATAMJX,y.MmlVisitor);class f{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:f.NOCOLLAPSE,startpunct:f.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=t.getProperty("collapse-variant")?{mathvariant:"-tex-variant"}:{},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",Object.assign({mathcolor:"blue"},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}}f.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 C{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:f},p("COMPLEXITY",40),MathJax.loader&&MathJax.loader.checkVersion("a11y/complexity","4.0.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]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{getHighlighter:()=>T});var i={};t.r(i),t.d(i,{AbstractRegion:()=>H,DummyRegion:()=>D,HoverRegion:()=>U,LiveRegion:()=>F,SpeechRegion:()=>K,StringRegion:()=>_,ToolTip:()=>J});var s={};t.r(s),t.d(s,{AbstractExplorer:()=>V});var o={};t.r(o),t.d(o,{SpeechExplorer:()=>W,hasModifiers:()=>$,isContainer:()=>X});var r={};t.r(r),t.d(r,{AbstractMouseExplorer:()=>Q,ContentHoverer:()=>et,FlameHoverer:()=>it,Hoverer:()=>Z,ValueHoverer:()=>tt});var n={};t.r(n),t.d(n,{AbstractTreeExplorer:()=>st,ContrastPicker:()=>nt,FlameColorer:()=>ot,TreeColorer:()=>rt});var h={};t.r(h),t.d(h,{ExplorerPool:()=>lt,RegionPool:()=>ht});var a={};t.r(a),t.d(a,{ExplorerHandler:()=>pt,ExplorerMathDocumentMixin:()=>ut,ExplorerMathItemMixin:()=>dt,setA11yOption:()=>mt,setA11yOptions:()=>gt});const l=("undefined"!=typeof window?window:global).MathJax._.components.global,c=(l.GLOBAL,l.isObject,l.combineConfig,l.combineDefaults,l.combineWithMathJax),d=(l.MathJax,MathJax._.core.MathItem),u=(d.protoItem,d.AbstractMathItem,d.STATE),p=d.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),v=(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),x=MathJax._.util.context,y=x.hasWindow,k=x.context,A=MathJax._.util.StyleJson.StyleJsonSheet,S={red:{red:255,green:0,blue:0},green:{red:0,green:255,blue:0},blue:{red:0,green:0,blue:255},yellow:{red:255,green:255,blue:0},cyan:{red:0,green:255,blue:255},magenta:{red:255,green:0,blue:255},white:{red:255,green:255,blue:255},black:{red:0,green:0,blue:0}};function w(t,e){var i;const s=S[t.color]||S[e.color];return s.alpha=null!==(i=t.alpha)&&void 0!==i?i:e.alpha,function(t){var e;return`rgba(${t.red},${t.green},${t.blue},${null!==(e=t.alpha)&&void 0!==e?e:1})`}(s)}const N={color:"blue",alpha:1},M={color:"black",alpha:1};let C=0;class E{constructor(){this.counter=C++,this.ATTR="sre-highlight-"+this.counter.toString(),this.mactionName="",this.currentHighlights=[]}highlight(t){this.currentHighlights.push(t.map((t=>{const e=this.highlightNode(t);return this.setHighlighted(t),e})))}highlightAll(t){const e=this.getMactionNodes(t);for(let t,i=0;t=e[i];i++)this.highlight([t])}unhighlight(){const t=this.currentHighlights.pop();t&&t.forEach((t=>{this.isHighlighted(t.node)&&(this.unhighlightNode(t),this.unsetHighlighted(t.node))}))}unhighlightAll(){for(;this.currentHighlights.length>0;)this.unhighlight()}setColor(t,e){this._foreground=w(e,M),this._background=w(t,N)}get foreground(){return this._foreground}get background(){return this._background}getMactionNodes(t){return Array.from(t.getElementsByClassName(this.mactionName))}isMactionNode(t){const e=t.className||t.getAttribute("class");return!!e&&!!e.match(new RegExp(this.mactionName))}isHighlighted(t){return t.hasAttribute(this.ATTR)}setHighlighted(t){t.setAttribute(this.ATTR,"true")}unsetHighlighted(t){t.removeAttribute(this.ATTR)}}class R extends E{constructor(){super(),this.mactionName="mjx-maction"}highlightNode(t){const e={node:t,background:t.style.backgroundColor,foreground:t.style.color};return this.isHighlighted(t)||(t.style.backgroundColor=this.background,t.style.color=this.foreground),e}unhighlightNode(t){t.node.style.backgroundColor=t.background,t.node.style.color=t.foreground}isMactionNode(t){var e;return(null===(e=t.tagName)||void 0===e?void 0:e.toUpperCase())===this.mactionName.toUpperCase()}getMactionNodes(t){return Array.from(t.getElementsByTagName(this.mactionName))}}function T(t,e,i){const s=new O[i];return s.setColor(t,e),s}const O={SVG:class extends E{constructor(){super(),this.mactionName="maction"}highlightNode(t){let e;if(this.isHighlighted(t))return e={node:t,background:this.background,foreground:this.foreground},e;if("svg"===t.tagName||"MJX-CONTAINER"===t.tagName)return e={node:t,background:t.style.backgroundColor,foreground:t.style.color},t.style.backgroundColor=this.background,t.style.color=this.foreground,e;const i=document.createElementNS("http://www.w3.org/2000/svg","rect");i.setAttribute("sre-highlighter-added","true");const s=t.getBBox();i.setAttribute("x",(s.x-40).toString()),i.setAttribute("y",(s.y-40).toString()),i.setAttribute("width",(s.width+80).toString()),i.setAttribute("height",(s.height+80).toString());const o=t.getAttribute("transform");return o&&i.setAttribute("transform",o),i.setAttribute("fill",this.background),t.setAttribute(this.ATTR,"true"),t.parentNode.insertBefore(i,t),e={node:t,foreground:t.getAttribute("fill")},"rect"!==t.nodeName&&t.setAttribute("fill",this.foreground),e}setHighlighted(t){"svg"===t.tagName&&super.setHighlighted(t)}unhighlightNode(t){const e=t.node.previousSibling;if(e&&e.hasAttribute("sre-highlighter-added"))return t.foreground?t.node.setAttribute("fill",t.foreground):t.node.removeAttribute("fill"),void t.node.parentNode.removeChild(e);t.node.style.backgroundColor=t.background,t.node.style.color=t.foreground}isMactionNode(t){return t.getAttribute("data-mml-node")===this.mactionName}getMactionNodes(t){return Array.from(t.querySelectorAll(`[data-mml-node="${this.mactionName}"]`))}},CHTML:R,generic:R},I=MathJax._.a11y.speech.SpeechUtil,L=(I.ssmlParsing,I.buildLabel,I.buildSpeech),j=I.honk,P=(I.InPlace,I.SemAttr);class H{constructor(t){this.document=t,this.CLASS=this.constructor,this.AddStyles()}AddStyles(){if(this.CLASS.styleAdded)return;const t=this.document.adaptor.node("style");t.innerHTML=this.CLASS.style.cssText,this.document.adaptor.head(this.document.adaptor.document).appendChild(t),this.CLASS.styleAdded=!0}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,e){this.AddElement(),this.position(t),this.highlight(e),this.div.classList.add(this.CLASS.className+"_Show")}Hide(){this.div&&(this.div.parentNode.removeChild(this.div),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"}}H.styleAdded=!1;class D extends H{Clear(){}Update(){}Hide(){}Show(){}AddElement(){}AddStyles(){}position(){}highlight(t){}}class _ extends H{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)}highlight(t){this.div&&(this.inner.style.backgroundColor=t.background,this.inner.style.color=t.foreground)}}class J extends _{}J.className="MJX_ToolTip",J.style=new A({["."+J.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},["."+J.className+" > div"]:{"border-radius":"inherit",padding:"0 2px"}});class F extends _{}F.className="MJX_LiveRegion",F.style=new A({["."+F.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":"white","box-shadow":"0px 5px 20px #888",border:"2px solid #CCCCCC"},["."+F.className+"_Show"]:{display:"block"}});class K extends F{constructor(){super(...arguments),this.active=!1,this.node=null,this.clear=!1,this.highlighter=T({color:"red"},{color:"black"},this.document.outputJax.name),this.voiceRequest=!1,this.voiceCancelled=!1}Show(t,e){super.Update("\xa0"),this.node=t,super.Show(t,e)}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]=L(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}}class U extends H{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"}highlight(t){this.div&&(this.inner.firstChild&&!this.inner.firstChild.hasAttribute("sre-highlight")||(this.inner.style.backgroundColor=t.background,this.inner.style.color=t.foreground))}Show(t,e){this.AddElement(),this.div.style.fontSize=this.document.options.a11y.magnify,this.Update(t),super.Show(t,e)}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");let i=t;for(;i&&"MJX-CONTAINER"!==i.nodeName;)i=i.parentNode;if("MJX-MATH"!==e.nodeName&&"svg"!==e.nodeName){if(e=i.firstChild.cloneNode(!1).appendChild(e).parentNode,"svg"===e.nodeName){e.firstChild.setAttribute("transform","matrix(1 0 0 -1 0 0)");const s=parseFloat(e.getAttribute("viewBox").split(/ /)[2]),o=parseFloat(e.getAttribute("width")),{x:r,y:n,width:h,height:a}=t.getBBox();e.setAttribute("viewBox",[r,-(n+a),h,a].join(" ")),e.removeAttribute("style"),e.setAttribute("width",o/s*h+"ex"),e.setAttribute("height",o/s*a+"ex"),i.setAttribute("sre-highlight","false")}}e=i.cloneNode(!1).appendChild(e).parentNode,e.style.margin="0"}return e}}U.className="MJX_HoverRegion",U.style=new A({["."+U.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"},["."+U.className+" > div"]:{overflow:"hidden"}});class V{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&&V.stopEvent(t)}}var B=function(t,e,i,s){return new(i||(i=Promise))((function(o,r){function n(t){try{a(s.next(t))}catch(t){r(t)}}function h(t){try{a(s.throw(t))}catch(t){r(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,h)}a((s=s.apply(t,e||[])).next())}))};const z="[data-speech-node]";function X(t){return t.matches("mjx-container")}function $(t,e=!0){return t.shiftKey&&e||t.metaKey||t.altKey||t.ctrlKey}const q=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\nwhen the expression gets the browser focus, but if not, you can toggle\nfocus mode using NVDA+space in NVDA; for JAWS, Enter should start\nforms mode while Numpad Plus leaves it. Also note that you can use\nthe NVDA or JAWS key plus the arrow keys to explore the expression\neven in browse mode, and you can use NVDA+shift+arrow keys to\nnavigate out of an expression that has the focus in NVDA"]],["Unix",["in Unix using Orca",", and Orca should enter focus mode automatically. If not, use the\nOrca+a key to toggle focus mode on or off. Also note that you can use\nOrca+arrow keys to explore expressions even in browse mode"]],["unknown",["with a Screen Reader.",""]]]);class W extends V{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.item.none}FocusIn(t){this.item.outputData.nofocus?this.item.outputData.nofocus=!1:(this.clicked||this.Start(),this.clicked=null)}FocusOut(t){this.current&&!this.focusSpeech&&(this.setCurrent(null),this.Stop(),document.hasFocus()||this.focusTop())}KeyDown(t){if(this.pendingIndex.shift(),this.region.cancelVoice(),$(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(),$(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($(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";$(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(){this.refocus=this.current,this.help()}escapeKey(){return this.Stop(),this.focusTop(),!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||$(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()}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("aria-level"))&&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(P.BRAILLE))}summary(){if("x"===this.speechType)return void this.setCurrent(this.current);this.speechType="x";const t=this.current.getAttribute(P.SUMMARY);this.speak(t,this.current.getAttribute(P.BRAILLE),this.SsmlAttributes(this.current,P.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(){const t=this.document.adaptor,e=t.node("mjx-help-background"),i=t=>{e.remove(),this.node.focus(),this.stopEvent(t)};e.addEventListener("click",i);const s=t.node("mjx-help-sizer",{},[t.node("mjx-help-dialog",{tabindex:0,role:"dialog","aria-labeledby":"mjx-help-label"},[t.node("h1",{id:"mjx-help-label"},[t.text("MathJax Expression Explorer Help")]),t.node("div"),t.node("input",{type:"button",value:"Close"})])]);e.append(s);const o=s.firstChild;o.addEventListener("click",(t=>this.stopEvent(t))),o.lastChild.addEventListener("click",i),o.addEventListener("keydown",(t=>{"Escape"===t.code&&i(t)}));const[r,n]=q.get(k.os);o.childNodes[1].innerHTML=function(t,e){return`\n<H2>Exploring expressions ${t}</h2>\n\n<p>The mathematics on this page is being rendered by <a\nhref="https://www.mathjax.org/" target="_blank">MathJax</a>, which\ngenerates both the text spoken by screen readers, as well as the\nvisual layout for sighted users.</p>\n\n<p>Expressions typeset by MathJax can be explored interactively, and\nare focusable. You can use the <kbd>Tab</kbd> key to move to a typeset\nexpression${e}. Initially, the expression will be read in full,\nbut you can use the following keys to explore the expression\nfurther:<p>\n\n<ul>\n\n<li><kbd>Down Arrow</kbd> moves one level deeper into the expression to\nallow you to explore the current subexpression term by term.</li>\n\n<li><kbd>Up Arrow</kbd> moves back up a level within the expression.</li>\n\n<li><kbd>Right Arrow</kbd> moves to the next term in the current\nsubexpression.</li>\n\n<li><kbd>Left Arrow</kbd> moves to the next term in the current\nsubexpression.</li>\n\n<li><kbd>Shift</kbd>+<kbd>Arrow</kbd> moves to a neighboring cell within a table.\n\n<li><kbd>0-9</kbd>+<kbd>0-9</kbd> jumps to a cell by its index in the table, where 0 = 10.\n\n<li><kbd>Home</kbd> takes you to the top of the expression.</li>\n\n<li><kbd>Enter</kbd> or <kbd>Return</kbd> clicks a link or activates an active\nsubexpression.</li>\n\n<li><kbd>Space</kbd> opens the MathJax contextual menu where you can view\nor copy the source format of the expression, or modify MathJax's\nsettings.</li>\n\n<li><kbd>Escape</kbd> exits the expression explorer.</li>\n\n<li><kbd>x</kbd> gives a summary of the current subexpression.</li>\n\n<li><kbd>z</kbd> gives the full text of a collapsed expression.</li>\n\n<li><kbd>d</kbd> gives the current depth within the expression.</li>\n\n<li><kbd>s</kbd> starts or stops auto-voicing with synchronized highlighting.</li>\n\n<li><kbd>v</kbd> marks the current position in the expression.</li>\n\n<li><kbd>p</kbd> cycles through the marked positions in the expression.</li>\n\n<li><kbd>u</kbd> clears all marked positions and returns to the starting position.</li>\n\n<li><kbd>></kbd> cycles through the available speech rule sets\n(MathSpeak, ClearSpeak).</li>\n\n<li><kbd><</kbd> cycles through the verbosity levels for the current\nrule set.</li>\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\nor Braille generation for mathematical expressions, the language to\nuse for the spoken mathematics, and other features of MathJax. In\nparticular, the Explorer submenu allows you to specify how the\nmathematics should be identified in the page (e.g., by saying "math"\nwhen the expression is spoken), and whether or not to include a\nmessage about the letter "h" bringing up this dialog box.</p>\n\n<p>The contextual menu also provides options for viewing or copying a\nMathML version of the expression or its original source format,\ncreating an SVG version of the expression, and viewing various other\ninformation.</p>\n\n<p>For more help, see the <a\nhref="https://docs.mathjax.org/en/latest/basic/accessibility.html"\ntarge="_blank">MathJax accessibility documentation.</a></p>\n`}(r,n),document.body.append(e),o.focus()}setCurrent(t,e=!1){if(this.speechType="",document.hasFocus()||(this.refocus=this.current),this.node.setAttribute("aria-busy","true"),this.current){for(const t of this.getSplitNodes(this.current))t.classList.remove("mjx-selected");this.pool.unhighlight(),"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);for(const t of i)t.classList.add("mjx-selected");this.pool.highlight(i),this.addSpeech(t,e)}this.node.removeAttribute("aria-busy")}getSplitNodes(t){const e=this.nodeId(t);return e?Array.from(this.node.querySelectorAll(`[data-semantic-id="${e}"]`)):[t]}addSpeech(t,e){var i;null===(i=this.img)||void 0===i||i.remove();let s=[t.getAttribute(P.PREFIX),t.getAttribute(P.SPEECH),t.getAttribute(P.POSTFIX)].join(" ").trim();if(e){let t=this.description===this.none?"":", "+this.description;this.document.options.a11y.help&&(t+=", press h for help"),s+=t}this.speak(s,t.getAttribute(P.BRAILLE),this.SsmlAttributes(t,P.SPEECH_SSML)),this.node.setAttribute("tabindex","-1")}removeSpeech(){this.speech&&(this.speech.remove(),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;this.speech=document.createElement("mjx-speech"),this.speech.setAttribute("role",this.role),this.speech.setAttribute("aria-label",t),this.speech.setAttribute(P.SPEECH,t),i&&(this.speech.setAttribute(P.PREFIX_SSML,i[0]||""),this.speech.setAttribute(P.SPEECH_SSML,i[1]||""),this.speech.setAttribute(P.POSTFIX_SSML,i[2]||"")),e&&this.speech.setAttribute("aria-braillelabel",e),this.speech.setAttribute("aria-roledescription",s),this.speech.setAttribute("tabindex","0"),this.node.append(this.speech),this.focusSpeech=!0,this.speech.focus(),this.focusSpeech=!1,this.Update(),o&&setTimeout((()=>o.remove()),100)}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(P.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}),i.appendChild(this.img)}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")}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(z);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(z)}rootNode(){const t=this.node.querySelector("[data-semantic-structure]");if(!t)return this.node.querySelector(z);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(z);let o=null,r=this.node;for(;r;){r.matches(z)&&(o=r);const t=Array.from(r.childNodes);r=null;for(const s of t)if(s!==this.speech&&s!==this.img&&"rect"!==s.tagName.toLowerCase()){const{left:t,right:o,top:n,bottom:h}=s.getBoundingClientRect();if(t<=e&&e<=o&&n<=i&&i<=h){r=s;break}}}return o}focusTop(){this.focusSpeech=!0,this.node.focus(),this.focusSpeech=!1}SsmlAttributes(t,e){return[t.getAttribute(P.PREFIX_SSML),t.getAttribute(e),t.getAttribute(P.POSTFIX_SSML)]}restartAfter(t){return B(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,h){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=h,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.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)]])}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 B(this,void 0,void 0,(function*(){if(!this.attached||this.active)return;if(this.document.activeItem=this.item,this.item.state()<u.ATTACHSPEECH&&(this.item.attachSpeech(this.document),yield this.generators.promise),this.focusSpeech)return;this.node.classList.add("mjx-explorer-active"),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,this.highlighter),s.viewBraille&&s.braille&&i.enableBraille&&this.brailleRegion.Show(this.node,this.highlighter),s.keyMagnifier&&this.magnifyRegion.Show(this.current,this.highlighter),this.Update()}))}Stop(){if(this.active){const t=this.description;this.node.getAttribute("aria-roledescription")!==t&&this.node.setAttribute("aria-roledescription",t),this.node.classList.remove("mjx-explorer-active"),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.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){var e;if(null===(e=null==t?void 0:t.getAttribute("data-semantic-postfix"))||void 0===e?void 0:e.match(/(^| )link($| )/))for(;t&&t!==this.node;){if(t instanceof HTMLAnchorElement)return t.dispatchEvent(new MouseEvent("click")),setTimeout((()=>this.FocusOut(null)),50),!0;t=t.parentNode}return!1}triggerLinkMouse(){let t=this.refocus;for(;t&&t!==this.node;){if(this.triggerLink(t))return!0;t=t.parentNode}return!1}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(z));const o=i.getAttribute(e);return o&&t.unshift(`[${e}="${o}"]`),t.join(" ")}}W.keyMap=new Map([["Tab",[()=>!0]],["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]],...[..."0123456789"].map((t=>[t,[e=>e.numberKey(parseInt(t)),!1]]))]);const Y=MathJax._.a11y.sre_ts,G=(Y.locales,Y.setupEngine,Y.engineSetup);Y.toEnriched,Y.parseDOM,Y.addPreference,Y.fromPreference,Y.toPreference;class Q extends V{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 Z 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,this.highlighter))}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 tt extends Z{}class et extends Z{}class it extends Z{constructor(t,e,i,s){super(t,e,new D(t),s,(t=>this.highlighter.isMactionNode(t)),(()=>{})),this.document=t,this.pool=e,this.node=s}}class st extends V{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 ot extends st{Start(){this.active||(this.active=!0,this.highlighter.highlightAll(this.node))}Stop(){this.active&&this.highlighter.unhighlightAll(),this.active=!1}}class rt extends st{constructor(){super(...arguments),this.contrast=new nt,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 nt{constructor(){this.hue=10,this.sat=100,this.light=50,this.incr=53}generate(){return nt.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,h=0,a=0;return 0<=t&&t<60?[n,h,a]=[s,o,0]:60<=t&&t<120?[n,h,a]=[o,s,0]:120<=t&&t<180?[n,h,a]=[0,s,o]:180<=t&&t<240?[n,h,a]=[0,o,s]:240<=t&&t<300?[n,h,a]=[o,0,s]:300<=t&&t<360&&([n,h,a]=[s,0,o]),`rgb(${255*(n+r)}, ${255*(h+r)}, ${255*(a+r)})`}}class ht{constructor(t){this.document=t,this.speechRegion=new K(this.document),this.brailleRegion=new F(this.document),this.magnifier=new U(this.document),this.tooltip1=new J(this.document),this.tooltip2=new J(this.document),this.tooltip3=new J(this.document)}}const at={speech:(t,e,i,...s)=>{const o=W.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)=>et.create(t,e,t.explorerRegions.magnifier,i,(t=>t.hasAttribute("data-semantic-type")),(t=>t)),hover:(t,e,i,...s)=>it.create(t,e,null,i),infoType:(t,e,i,...s)=>tt.create(t,e,t.explorerRegions.tooltip1,i,(t=>t.hasAttribute("data-semantic-type")),(t=>t.getAttribute("data-semantic-type"))),infoRole:(t,e,i,...s)=>tt.create(t,e,t.explorerRegions.tooltip2,i,(t=>t.hasAttribute("data-semantic-role")),(t=>t.getAttribute("data-semantic-role"))),infoPrefix:(t,e,i,...s)=>tt.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)=>ot.create(t,e,null,i),treeColoring:(t,e,i,...s)=>rt.create(t,e,null,i,...s)};class lt{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(at))this.explorers[t]=at[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 W?(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=T(e,t,this.document.outputJax.name)}setSecondaryHighlighter(){this.secondaryHighlighter=T({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 ct="Unix"===k.os;function dt(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}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()>=u.EXPLORER)){if(!this.isEscaped&&(t.options.enableExplorer||i)){const i=this.typesetRoot,s=e(this.root);this.explorers||(this.explorers=new lt),this.explorers.init(t,i,s,this)}this.state(u.EXPLORER)}}state(t=null,e=!1){if(t<u.EXPLORER&&this.explorers)for(const t of Object.values(this.explorers.explorers))t.active&&t.Stop();return super.state(t,e)}rerender(t,e=u.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=ct?"tree":"application",i.roleDescription="math",i.none="\x91",i}function ut(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 v(this.mmlFactory),s=this.options;s.a11y.speechRules||(s.a11y.speechRules=`${s.sre.domain}-${s.sre.style}`);const o=s.MathItem=dt(s.MathItem,(t=>i.visitTree(t)));o.roleDescription=s.roleDescription,this.explorerRegions=new ht(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=this.adaptor.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<u.EXPLORER&&this.processed.clear("explorer"),this}}).OPTIONS=Object.assign(Object.assign({},t.OPTIONS),{enableExplorer:y,renderActions:f(Object.assign(Object.assign({},t.OPTIONS.renderActions),{explorable:[u.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,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 > mjx-help":{display:"none",position:"absolute",top:"-.33em",right:"-.5em",width:".6em",height:".6em",cursor:"pointer"},'mjx-container[display="true"] > mjx-help':{right:0},"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:"rgba(0, 0, 255, 0.2)",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"},"mjx-help-sizer":{position:"fixed",width:"40%","max-width":"30em",top:"3em",left:"50%"},"mjx-help-dialog":{position:"absolute",width:"200%",left:"-100%",border:"3px outset","border-radius":"15px",color:"black","background-color":"#DDDDDD","z-index":"301","text-align":"right","font-style":"normal","text-indent":0,"text-transform":"none","line-height":"normal","letter-spacing":"normal","word-spacing":"normal","word-wrap":"normal",float:"none","box-shadow":"0px 10px 20px #808080",outline:"none"},"mjx-help-dialog > h1":{"font-size":"24px","text-align":"center",margin:".5em 0"},"mjx-help-dialog > div":{margin:"0 1em",padding:"3px",overflow:"auto",height:"20em",border:"2px inset black","background-color":"white","text-align":"left"},"mjx-help-dialog > input":{margin:".5em 2em"},"mjx-help-dialog kbd":{display:"inline-block",padding:"3px 5px","font-size":"11px","line-height":"10px",color:"#444d56","vertical-align":"middle","background-color":"#fafbfc",border:"solid 1.5px #c6cbd1","border-bottom-color":"#959da5","border-radius":"3px","box-shadow":"inset -.5px -1px 0 #959da5"},"mjx-help-dialog ul":{"list-style-type":"none"},"mjx-help-dialog li":{"margin-bottom":".5em"},"mjx-help-background":{position:"fixed",top:0,left:0,right:0,bottom:0}},e}function pt(t,e=null){return t.documentClass.prototype.attachSpeech||(t=m(t,e)),t.documentClass=ut(t.documentClass),t}function gt(t,e){var i;const s=G();for(const i in e)void 0!==t.options.a11y[i]?mt(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 mt(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",u.INSERTED+30),MathJax.loader&&MathJax.loader.checkVersion("a11y/explorer","4.0.0","a11y"),c({_:{a11y:{explorer_ts:a,explorer:{Explorer:s,ExplorerPool:h,Highlighter:e,KeyExplorer:o,MouseExplorer:r,Region:i,TreeExplorer:n}}}}),MathJax.startup&&y&&MathJax.startup.extendHandler((t=>pt(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]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{EnrichHandler:()=>f,EnrichedMathDocumentMixin:()=>M,EnrichedMathItemMixin:()=>u,enrichVisitor:()=>p});const i=("undefined"!=typeof window?window:global).MathJax._.components.global,n=(i.GLOBAL,i.isObject,i.combineConfig,i.combineDefaults,i.combineWithMathJax),s=(i.MathJax,MathJax._.core.MathItem),r=(s.protoItem,s.AbstractMathItem,s.STATE),a=s.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",r.COMPILED+10);class p 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],s=this.childNodeMml(t,e+" ",i);let r=this.getAttributes(t);if("toggle"===t.attributes.get("actiontype")){const e=++this.mactionId;t.setProperty("mactionId",e),r=` data-maction-id="${e}" selection="${t.attributes.get("selection")}"`+r.replace(/ selection="\d+"/,"").replace(/ data-maction-id="\d+"/,"")}return`${e}<maction${r}>`+(s.match(/\S/)?i+s+n:"")+"</maction>"}}function u(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()>=r.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-(?: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(r.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 p(this.mmlFactory);this.options.MathItem=u(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<r.ENRICHED&&(this.processed.clear("enriched"),t>=r.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:[r.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.0.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]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},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:global).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 S(Array.from(t.childNodes),s,a),[a.join(" "),s]}function S(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){S(Array.from(i.childNodes),t,s,w(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 k={pitch:(e,t)=>e/100*1,volume:(e,t)=>e/100*.5,rate:(e,t)=>e/100*1};function w(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=k[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],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||{},N=()=>(_?.loader?.paths?.mathjax||_?.__dirname||"/")+"/sre";var F=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 F(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 F(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:N(),maps:N().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.0.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,q=B.context;var U=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 V=e=>(Object.hasOwn(Z.source,e.name)&&(e.name=Z.source[e.name]),!0),X=e=>{const t=e.name;return t.match(/^(?:[a-z]+:\/)?\/|[a-z]:\\|\[/i)||(e.name="[mathjax]/"+t.replace(/^\.\//,"")),!0},Y=e=>{let t;for(;(t=e.name.match(/^\[([^\]]*)\]/))&&Object.hasOwn(Z.paths,t[1]);)e.name=Z.paths[t[1]]+e.name.substring(t[0].length);return!0},G=e=>(e.addExtension&&!e.name.match(/\.[^/]+$/)&&(e.name+=".js"),!0),z=c.version,K={versions:new Map,nestedLoads:[],ready(...e){0===e.length&&(e=Array.from(te.packages.keys()));const t=[];for(const s of e){const e=te.packages.get(s)||new te(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((()=>U(this,void 0,void 0,(function*(){const s=[];for(const t of e){let e=te.packages.get(t);e||(e=new te(t),e.provides(Z.provides[t])),e.checkNoLoad(),s.push(e.promise.then((()=>(Z.versionWarnings&&e.isLoaded&&!K.versions.has(te.resolvePath(t))&&console.warn(`No version information available for component ${t}`),e.result))))}te.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=te.packages.get(t);e||(e=new te(t,!0),e.provides(Z.provides[t])),e.loaded()}},addPackageData(e,t){let s=Z[e];s||(s=Z[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!==Q.startup&&Q.config.startup.ready()},getRoot(){if(q.document){const e=q.document.currentScript||q.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),!(!Z.versionWarnings||t===z)&&(console.warn(`Component ${e} uses ${t} of MathJax; version in use is ${z}`),!0)},saveVersion(e){K.versions.set(te.resolvePath(e),z)},pathFilters:new $};K.pathFilters.add(V,0),K.pathFilters.add(X,10),K.pathFilters.add(Y,20),K.pathFilters.add(G,30);const Q=c;if(void 0===Q.loader){n(Q.config,"loader",{paths:{mathjax:K.getRoot()},source:{},dependencies:{},provides:{},load:[],ready:K.defaultReady.bind(K),failed:e=>console.log(`MathJax(${e.package||"?"}): ${e.message}`),require:null,pathFilters:[],versionWarnings:!0}),r({loader:K});for(const e of Q.config.loader.pathFilters)Array.isArray(e)?K.pathFilters.add(e[0],e[1]):K.pathFilters.add(e)}const Z=Q.config.loader;class ee extends Error{constructor(e,t){super(e),this.package=t}}class te{get canLoad(){return 0===this.dependencyCount&&!this.noLoad&&!this.isLoading&&!this.hasFailed}static loadPromise(e){const t=Z[e]||{},s=t.extraLoads?K.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 K.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,te.packages.set(e,this),this.promise=this.makePromise(this.makeDependencies())}makeDependencies(){const e=[],t=te.packages,s=this.noLoad,a=this.name,i=[];Object.hasOwn(Z.dependencies,a)?i.push(...Z.dependencies[a]):"core"!==a&&i.push("core");for(const a of i){const i=t.get(a)||new te(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=Z[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 ee(e,this.name)))),t}load(){if(!this.isLoaded&&!this.isLoading&&!this.noLoad){this.isLoading=!0;const e=te.resolvePath(this.name);Z.require?this.loadCustom(e):this.loadScript(e)}}loadCustom(e){try{const t=Z.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=q.document.createElement("script");t.src=e,t.charset="UTF-8",t.onload=e=>this.checkLoad(),t.onerror=t=>this.failed("Can't load \""+e+'"'),q.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 ee(e,this.name))}checkLoad(){te.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=te.packages.get(t);e||(Z.dependencies[t]||(Z.dependencies[t]=[]),Z.dependencies[t].push(t),e=new te(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(te.packages=new Map,MathJax.loader){let e=te.resolvePath("[sre]",!1),t=te.resolvePath("[mathmaps]",!1);if(W)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=s.resolve(`${e}/require.mjs`).replace(/\/[^\/]*$/,""),t=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)))})();
|