@algorisys/yappydraw 0.8.253

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +45 -0
  3. package/chunks/AllPackages-DNX4gUvL.js +6879 -0
  4. package/chunks/BaseConfiguration-iE_YypNt.js +4401 -0
  5. package/chunks/Entities-XwxJEcR3.js +467 -0
  6. package/chunks/Factory--zguTNZ7.js +2768 -0
  7. package/chunks/InputJax-BYq2tqUz.js +42 -0
  8. package/chunks/MathItem-DD5NNBjZ.js +76 -0
  9. package/chunks/Options-BStFr0zv.js +199 -0
  10. package/chunks/PrioritizedList-TjDg4i-s.js +39 -0
  11. package/chunks/Styles-DdTYCumM.js +397 -0
  12. package/chunks/TeXAtom-Bp5xoo7F.js +2175 -0
  13. package/chunks/ai-providers-CycU8sO1.js +229 -0
  14. package/chunks/canva-ai-BREIRXSl.js +285 -0
  15. package/chunks/design-generator-C89SKTqv.js +149 -0
  16. package/chunks/drawing-engine-DLFI-cNg.js +903 -0
  17. package/chunks/drawings-store-C-PoHakg.js +109 -0
  18. package/chunks/ds-operations-D5B9Z5vO.js +253 -0
  19. package/chunks/export-game-DOlM1w0F.js +104 -0
  20. package/chunks/game-runtime-Hn9umSvi.js +346 -0
  21. package/chunks/gifenc.esm-48qFK9lH.js +278 -0
  22. package/chunks/html-DxnOvKy4.js +1694 -0
  23. package/chunks/image-utils-CJQBaGoQ.js +37 -0
  24. package/chunks/index-Bm3Inzn8.js +62744 -0
  25. package/chunks/lengths-DNFHULBn.js +70 -0
  26. package/chunks/liteAdaptor-BZby1Qz2.js +919 -0
  27. package/chunks/lucide-solid-D_6t_rbY.js +35452 -0
  28. package/chunks/markdown-to-slides-_1GIcD8M.js +96 -0
  29. package/chunks/mathjax-CnUrFnFS.js +117 -0
  30. package/chunks/mathjax-D6cR72fZ.js +26 -0
  31. package/chunks/morph-animator-7qX2s9j_.js +25 -0
  32. package/chunks/onboarding-tour-CthiVc3W.js +192 -0
  33. package/chunks/rocket-settings-CU8w9S9I.js +100 -0
  34. package/chunks/search-CnWoMV6A.js +384 -0
  35. package/chunks/slide-generator-BG0Oacui.js +553 -0
  36. package/chunks/svg-BvVc02XL.js +12498 -0
  37. package/chunks/tex-Cfi4Kfun.js +442 -0
  38. package/chunks/tinyfly-engine-Wfa50sVI.js +1804 -0
  39. package/chunks/turntable-ai-Bfq-oSsD.js +120 -0
  40. package/chunks/yappy-NspTXSPk.css +1 -0
  41. package/package.json +21 -0
  42. package/yappy.d.ts +34 -0
  43. package/yappy.js +9 -0
@@ -0,0 +1,1694 @@
1
+ import { r as Lt, g as Et } from "./PrioritizedList-TjDg4i-s.js";
2
+ import { r as Dt } from "./mathjax-CnUrFnFS.js";
3
+ import { r as it } from "./Options-BStFr0zv.js";
4
+ import { r as Pt } from "./InputJax-BYq2tqUz.js";
5
+ import { a as Ht, c as kt, d as It, f as qt, h as Nt, e as Rt, b as Ct, k as Ft, l as Jt, m as Bt, g as $t, i as Xt, j as zt, n as Wt, w as Yt, v as Kt, o as Ut, p as Gt, q as Qt, s as Vt, t as Zt, u as te, y as ee, x as re, z as ne, r as ie } from "./TeXAtom-Bp5xoo7F.js";
6
+ import { r as ot } from "./MathItem-DD5NNBjZ.js";
7
+ import { b as oe, a as rt, f as jt, c as ae } from "./Factory--zguTNZ7.js";
8
+ function se(f, O) {
9
+ for (var w = 0; w < O.length; w++) {
10
+ const h = O[w];
11
+ if (typeof h != "string" && !Array.isArray(h)) {
12
+ for (const o in h)
13
+ if (o !== "default" && !(o in f)) {
14
+ const n = Object.getOwnPropertyDescriptor(h, o);
15
+ n && Object.defineProperty(f, o, n.get ? n : {
16
+ enumerable: !0,
17
+ get: () => h[o]
18
+ });
19
+ }
20
+ }
21
+ }
22
+ return Object.freeze(Object.defineProperty(f, Symbol.toStringTag, { value: "Module" }));
23
+ }
24
+ var tt = {}, z = {}, W = {}, N = {}, Y = {}, R = {}, at;
25
+ function ue() {
26
+ return at || (at = 1, (function(f) {
27
+ var O = R && R.__generator || function(r, e) {
28
+ var i = { label: 0, sent: function() {
29
+ if (c[0] & 1) throw c[1];
30
+ return c[1];
31
+ }, trys: [], ops: [] }, y, u, c, p;
32
+ return p = { next: _(0), throw: _(1), return: _(2) }, typeof Symbol == "function" && (p[Symbol.iterator] = function() {
33
+ return this;
34
+ }), p;
35
+ function _(d) {
36
+ return function(T) {
37
+ return x([d, T]);
38
+ };
39
+ }
40
+ function x(d) {
41
+ if (y) throw new TypeError("Generator is already executing.");
42
+ for (; i; ) try {
43
+ if (y = 1, u && (c = d[0] & 2 ? u.return : d[0] ? u.throw || ((c = u.return) && c.call(u), 0) : u.next) && !(c = c.call(u, d[1])).done) return c;
44
+ switch (u = 0, c && (d = [d[0] & 2, c.value]), d[0]) {
45
+ case 0:
46
+ case 1:
47
+ c = d;
48
+ break;
49
+ case 4:
50
+ return i.label++, { value: d[1], done: !1 };
51
+ case 5:
52
+ i.label++, u = d[1], d = [0];
53
+ continue;
54
+ case 7:
55
+ d = i.ops.pop(), i.trys.pop();
56
+ continue;
57
+ default:
58
+ if (c = i.trys, !(c = c.length > 0 && c[c.length - 1]) && (d[0] === 6 || d[0] === 2)) {
59
+ i = 0;
60
+ continue;
61
+ }
62
+ if (d[0] === 3 && (!c || d[1] > c[0] && d[1] < c[3])) {
63
+ i.label = d[1];
64
+ break;
65
+ }
66
+ if (d[0] === 6 && i.label < c[1]) {
67
+ i.label = c[1], c = d;
68
+ break;
69
+ }
70
+ if (c && i.label < c[2]) {
71
+ i.label = c[2], i.ops.push(d);
72
+ break;
73
+ }
74
+ c[2] && i.ops.pop(), i.trys.pop();
75
+ continue;
76
+ }
77
+ d = e.call(r, i);
78
+ } catch (T) {
79
+ d = [6, T], u = 0;
80
+ } finally {
81
+ y = c = 0;
82
+ }
83
+ if (d[0] & 5) throw d[1];
84
+ return { value: d[0] ? d[1] : void 0, done: !0 };
85
+ }
86
+ }, w = R && R.__read || function(r, e) {
87
+ var i = typeof Symbol == "function" && r[Symbol.iterator];
88
+ if (!i) return r;
89
+ var y = i.call(r), u, c = [], p;
90
+ try {
91
+ for (; (e === void 0 || e-- > 0) && !(u = y.next()).done; ) c.push(u.value);
92
+ } catch (_) {
93
+ p = { error: _ };
94
+ } finally {
95
+ try {
96
+ u && !u.done && (i = y.return) && i.call(y);
97
+ } finally {
98
+ if (p) throw p.error;
99
+ }
100
+ }
101
+ return c;
102
+ }, h = R && R.__spreadArray || function(r, e, i) {
103
+ if (i || arguments.length === 2) for (var y = 0, u = e.length, c; y < u; y++)
104
+ (c || !(y in e)) && (c || (c = Array.prototype.slice.call(e, 0, y)), c[y] = e[y]);
105
+ return r.concat(c || Array.prototype.slice.call(e));
106
+ }, o = R && R.__values || function(r) {
107
+ var e = typeof Symbol == "function" && Symbol.iterator, i = e && r[e], y = 0;
108
+ if (i) return i.call(r);
109
+ if (r && typeof r.length == "number") return {
110
+ next: function() {
111
+ return r && y >= r.length && (r = void 0), { value: r && r[y++], done: !r };
112
+ }
113
+ };
114
+ throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
115
+ };
116
+ Object.defineProperty(f, "__esModule", { value: !0 }), f.LinkedList = f.ListItem = f.END = void 0, f.END = /* @__PURE__ */ Symbol();
117
+ var n = /* @__PURE__ */ (function() {
118
+ function r(e) {
119
+ e === void 0 && (e = null), this.next = null, this.prev = null, this.data = e;
120
+ }
121
+ return r;
122
+ })();
123
+ f.ListItem = n;
124
+ var t = (function() {
125
+ function r() {
126
+ for (var e = [], i = 0; i < arguments.length; i++)
127
+ e[i] = arguments[i];
128
+ this.list = new n(f.END), this.list.next = this.list.prev = this.list, this.push.apply(this, h([], w(e), !1));
129
+ }
130
+ return r.prototype.isBefore = function(e, i) {
131
+ return e < i;
132
+ }, r.prototype.push = function() {
133
+ for (var e, i, y = [], u = 0; u < arguments.length; u++)
134
+ y[u] = arguments[u];
135
+ try {
136
+ for (var c = o(y), p = c.next(); !p.done; p = c.next()) {
137
+ var _ = p.value, x = new n(_);
138
+ x.next = this.list, x.prev = this.list.prev, this.list.prev = x, x.prev.next = x;
139
+ }
140
+ } catch (d) {
141
+ e = { error: d };
142
+ } finally {
143
+ try {
144
+ p && !p.done && (i = c.return) && i.call(c);
145
+ } finally {
146
+ if (e) throw e.error;
147
+ }
148
+ }
149
+ return this;
150
+ }, r.prototype.pop = function() {
151
+ var e = this.list.prev;
152
+ return e.data === f.END ? null : (this.list.prev = e.prev, e.prev.next = this.list, e.next = e.prev = null, e.data);
153
+ }, r.prototype.unshift = function() {
154
+ for (var e, i, y = [], u = 0; u < arguments.length; u++)
155
+ y[u] = arguments[u];
156
+ try {
157
+ for (var c = o(y.slice(0).reverse()), p = c.next(); !p.done; p = c.next()) {
158
+ var _ = p.value, x = new n(_);
159
+ x.next = this.list.next, x.prev = this.list, this.list.next = x, x.next.prev = x;
160
+ }
161
+ } catch (d) {
162
+ e = { error: d };
163
+ } finally {
164
+ try {
165
+ p && !p.done && (i = c.return) && i.call(c);
166
+ } finally {
167
+ if (e) throw e.error;
168
+ }
169
+ }
170
+ return this;
171
+ }, r.prototype.shift = function() {
172
+ var e = this.list.next;
173
+ return e.data === f.END ? null : (this.list.next = e.next, e.next.prev = this.list, e.next = e.prev = null, e.data);
174
+ }, r.prototype.remove = function() {
175
+ for (var e, i, y = [], u = 0; u < arguments.length; u++)
176
+ y[u] = arguments[u];
177
+ var c = /* @__PURE__ */ new Map();
178
+ try {
179
+ for (var p = o(y), _ = p.next(); !_.done; _ = p.next()) {
180
+ var x = _.value;
181
+ c.set(x, !0);
182
+ }
183
+ } catch (L) {
184
+ e = { error: L };
185
+ } finally {
186
+ try {
187
+ _ && !_.done && (i = p.return) && i.call(p);
188
+ } finally {
189
+ if (e) throw e.error;
190
+ }
191
+ }
192
+ for (var d = this.list.next; d.data !== f.END; ) {
193
+ var T = d.next;
194
+ c.has(d.data) && (d.prev.next = d.next, d.next.prev = d.prev, d.next = d.prev = null), d = T;
195
+ }
196
+ }, r.prototype.clear = function() {
197
+ return this.list.next.prev = this.list.prev.next = null, this.list.next = this.list.prev = this.list, this;
198
+ }, r.prototype[Symbol.iterator] = function() {
199
+ var e;
200
+ return O(this, function(i) {
201
+ switch (i.label) {
202
+ case 0:
203
+ e = this.list.next, i.label = 1;
204
+ case 1:
205
+ return e.data === f.END ? [3, 3] : [4, e.data];
206
+ case 2:
207
+ return i.sent(), e = e.next, [3, 1];
208
+ case 3:
209
+ return [2];
210
+ }
211
+ });
212
+ }, r.prototype.reversed = function() {
213
+ var e;
214
+ return O(this, function(i) {
215
+ switch (i.label) {
216
+ case 0:
217
+ e = this.list.prev, i.label = 1;
218
+ case 1:
219
+ return e.data === f.END ? [3, 3] : [4, e.data];
220
+ case 2:
221
+ return i.sent(), e = e.prev, [3, 1];
222
+ case 3:
223
+ return [2];
224
+ }
225
+ });
226
+ }, r.prototype.insert = function(e, i) {
227
+ i === void 0 && (i = null), i === null && (i = this.isBefore.bind(this));
228
+ for (var y = new n(e), u = this.list.next; u.data !== f.END && i(u.data, y.data); )
229
+ u = u.next;
230
+ return y.prev = u.prev, y.next = u, u.prev.next = u.prev = y, this;
231
+ }, r.prototype.sort = function(e) {
232
+ var i, y;
233
+ e === void 0 && (e = null), e === null && (e = this.isBefore.bind(this));
234
+ var u = [];
235
+ try {
236
+ for (var c = o(this), p = c.next(); !p.done; p = c.next()) {
237
+ var _ = p.value;
238
+ u.push(new r(_));
239
+ }
240
+ } catch (T) {
241
+ i = { error: T };
242
+ } finally {
243
+ try {
244
+ p && !p.done && (y = c.return) && y.call(c);
245
+ } finally {
246
+ if (i) throw i.error;
247
+ }
248
+ }
249
+ for (this.list.next = this.list.prev = this.list; u.length > 1; ) {
250
+ var x = u.shift(), d = u.shift();
251
+ x.merge(d, e), u.push(x);
252
+ }
253
+ return u.length && (this.list = u[0].list), this;
254
+ }, r.prototype.merge = function(e, i) {
255
+ var y, u, c, p, _;
256
+ i === void 0 && (i = null), i === null && (i = this.isBefore.bind(this));
257
+ for (var x = this.list.next, d = e.list.next; x.data !== f.END && d.data !== f.END; )
258
+ i(d.data, x.data) ? (y = w([x, d], 2), d.prev.next = y[0], x.prev.next = y[1], u = w([x.prev, d.prev], 2), d.prev = u[0], x.prev = u[1], c = w([e.list, this.list], 2), this.list.prev.next = c[0], e.list.prev.next = c[1], p = w([e.list.prev, this.list.prev], 2), this.list.prev = p[0], e.list.prev = p[1], _ = w([d.next, x], 2), x = _[0], d = _[1]) : x = x.next;
259
+ return d.data !== f.END && (this.list.prev.next = e.list.next, e.list.next.prev = this.list.prev, e.list.prev.next = this.list, this.list.prev = e.list.prev, e.list.next = e.list.prev = e.list), this;
260
+ }, r;
261
+ })();
262
+ f.LinkedList = t;
263
+ })(R)), R;
264
+ }
265
+ var st;
266
+ function St() {
267
+ if (st) return Y;
268
+ st = 1;
269
+ var f = Y && Y.__extends || /* @__PURE__ */ (function() {
270
+ var h = function(o, n) {
271
+ return h = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
272
+ t.__proto__ = r;
273
+ } || function(t, r) {
274
+ for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && (t[e] = r[e]);
275
+ }, h(o, n);
276
+ };
277
+ return function(o, n) {
278
+ if (typeof n != "function" && n !== null)
279
+ throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
280
+ h(o, n);
281
+ function t() {
282
+ this.constructor = o;
283
+ }
284
+ o.prototype = n === null ? Object.create(n) : (t.prototype = n.prototype, new t());
285
+ };
286
+ })();
287
+ Object.defineProperty(Y, "__esModule", { value: !0 }), Y.AbstractMathList = void 0;
288
+ var O = ue(), w = (function(h) {
289
+ f(o, h);
290
+ function o() {
291
+ return h !== null && h.apply(this, arguments) || this;
292
+ }
293
+ return o.prototype.isBefore = function(n, t) {
294
+ return n.start.i < t.start.i || n.start.i === t.start.i && n.start.n < t.start.n;
295
+ }, o;
296
+ })(O.LinkedList);
297
+ return Y.AbstractMathList = w, Y;
298
+ }
299
+ var K = {}, U = {}, ut;
300
+ function le() {
301
+ if (ut) return U;
302
+ ut = 1;
303
+ var f = U && U.__extends || /* @__PURE__ */ (function() {
304
+ var h = function(o, n) {
305
+ return h = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
306
+ t.__proto__ = r;
307
+ } || function(t, r) {
308
+ for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && (t[e] = r[e]);
309
+ }, h(o, n);
310
+ };
311
+ return function(o, n) {
312
+ if (typeof n != "function" && n !== null)
313
+ throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
314
+ h(o, n);
315
+ function t() {
316
+ this.constructor = o;
317
+ }
318
+ o.prototype = n === null ? Object.create(n) : (t.prototype = n.prototype, new t());
319
+ };
320
+ })();
321
+ Object.defineProperty(U, "__esModule", { value: !0 }), U.AbstractNodeFactory = void 0;
322
+ var O = oe(), w = (function(h) {
323
+ f(o, h);
324
+ function o() {
325
+ return h !== null && h.apply(this, arguments) || this;
326
+ }
327
+ return o.prototype.create = function(n, t, r) {
328
+ return t === void 0 && (t = {}), r === void 0 && (r = []), this.node[n](t, r);
329
+ }, o;
330
+ })(O.AbstractFactory);
331
+ return U.AbstractNodeFactory = w, U;
332
+ }
333
+ var et = {}, F = {}, lt;
334
+ function ce() {
335
+ if (lt) return F;
336
+ lt = 1;
337
+ var f = F && F.__extends || /* @__PURE__ */ (function() {
338
+ var n = function(t, r) {
339
+ return n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, i) {
340
+ e.__proto__ = i;
341
+ } || function(e, i) {
342
+ for (var y in i) Object.prototype.hasOwnProperty.call(i, y) && (e[y] = i[y]);
343
+ }, n(t, r);
344
+ };
345
+ return function(t, r) {
346
+ if (typeof r != "function" && r !== null)
347
+ throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
348
+ n(t, r);
349
+ function e() {
350
+ this.constructor = t;
351
+ }
352
+ t.prototype = r === null ? Object.create(r) : (e.prototype = r.prototype, new e());
353
+ };
354
+ })(), O = F && F.__assign || function() {
355
+ return O = Object.assign || function(n) {
356
+ for (var t, r = 1, e = arguments.length; r < e; r++) {
357
+ t = arguments[r];
358
+ for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (n[i] = t[i]);
359
+ }
360
+ return n;
361
+ }, O.apply(this, arguments);
362
+ };
363
+ Object.defineProperty(F, "__esModule", { value: !0 }), F.MmlMstyle = void 0;
364
+ var w = rt(), h = jt(), o = (function(n) {
365
+ f(t, n);
366
+ function t() {
367
+ return n !== null && n.apply(this, arguments) || this;
368
+ }
369
+ return Object.defineProperty(t.prototype, "kind", {
370
+ get: function() {
371
+ return "mstyle";
372
+ },
373
+ enumerable: !1,
374
+ configurable: !0
375
+ }), Object.defineProperty(t.prototype, "notParent", {
376
+ get: function() {
377
+ return this.childNodes[0] && this.childNodes[0].childNodes.length === 1;
378
+ },
379
+ enumerable: !1,
380
+ configurable: !0
381
+ }), t.prototype.setChildInheritedAttributes = function(r, e, i, y) {
382
+ var u = this.attributes.getExplicit("scriptlevel");
383
+ u != null && (u = u.toString(), u.match(/^\s*[-+]/) ? i += parseInt(u) : i = parseInt(u), y = !1);
384
+ var c = this.attributes.getExplicit("displaystyle");
385
+ c != null && (e = c === !0, y = !1);
386
+ var p = this.attributes.getExplicit("data-cramped");
387
+ p != null && (y = p), r = this.addInheritedAttributes(r, this.attributes.getAllAttributes()), this.childNodes[0].setInheritedAttributes(r, e, i, y);
388
+ }, t.defaults = O(O({}, w.AbstractMmlLayoutNode.defaults), { scriptlevel: h.INHERIT, displaystyle: h.INHERIT, scriptsizemultiplier: 1 / Math.sqrt(2), scriptminsize: "8px", mathbackground: h.INHERIT, mathcolor: h.INHERIT, dir: h.INHERIT, infixlinebreakstyle: "before" }), t;
389
+ })(w.AbstractMmlLayoutNode);
390
+ return F.MmlMstyle = o, F;
391
+ }
392
+ var J = {}, ct;
393
+ function fe() {
394
+ if (ct) return J;
395
+ ct = 1;
396
+ var f = J && J.__extends || /* @__PURE__ */ (function() {
397
+ var n = function(t, r) {
398
+ return n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, i) {
399
+ e.__proto__ = i;
400
+ } || function(e, i) {
401
+ for (var y in i) Object.prototype.hasOwnProperty.call(i, y) && (e[y] = i[y]);
402
+ }, n(t, r);
403
+ };
404
+ return function(t, r) {
405
+ if (typeof r != "function" && r !== null)
406
+ throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
407
+ n(t, r);
408
+ function e() {
409
+ this.constructor = t;
410
+ }
411
+ t.prototype = r === null ? Object.create(r) : (e.prototype = r.prototype, new e());
412
+ };
413
+ })(), O = J && J.__assign || function() {
414
+ return O = Object.assign || function(n) {
415
+ for (var t, r = 1, e = arguments.length; r < e; r++) {
416
+ t = arguments[r];
417
+ for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (n[i] = t[i]);
418
+ }
419
+ return n;
420
+ }, O.apply(this, arguments);
421
+ };
422
+ Object.defineProperty(J, "__esModule", { value: !0 }), J.MmlMaligngroup = void 0;
423
+ var w = rt(), h = jt(), o = (function(n) {
424
+ f(t, n);
425
+ function t() {
426
+ return n !== null && n.apply(this, arguments) || this;
427
+ }
428
+ return Object.defineProperty(t.prototype, "kind", {
429
+ get: function() {
430
+ return "maligngroup";
431
+ },
432
+ enumerable: !1,
433
+ configurable: !0
434
+ }), Object.defineProperty(t.prototype, "isSpacelike", {
435
+ get: function() {
436
+ return !0;
437
+ },
438
+ enumerable: !1,
439
+ configurable: !0
440
+ }), t.prototype.setChildInheritedAttributes = function(r, e, i, y) {
441
+ r = this.addInheritedAttributes(r, this.attributes.getAllAttributes()), n.prototype.setChildInheritedAttributes.call(this, r, e, i, y);
442
+ }, t.defaults = O(O({}, w.AbstractMmlLayoutNode.defaults), { groupalign: h.INHERIT }), t;
443
+ })(w.AbstractMmlLayoutNode);
444
+ return J.MmlMaligngroup = o, J;
445
+ }
446
+ var B = {}, ft;
447
+ function pe() {
448
+ if (ft) return B;
449
+ ft = 1;
450
+ var f = B && B.__extends || /* @__PURE__ */ (function() {
451
+ var o = function(n, t) {
452
+ return o = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, e) {
453
+ r.__proto__ = e;
454
+ } || function(r, e) {
455
+ for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (r[i] = e[i]);
456
+ }, o(n, t);
457
+ };
458
+ return function(n, t) {
459
+ if (typeof t != "function" && t !== null)
460
+ throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
461
+ o(n, t);
462
+ function r() {
463
+ this.constructor = n;
464
+ }
465
+ n.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
466
+ };
467
+ })(), O = B && B.__assign || function() {
468
+ return O = Object.assign || function(o) {
469
+ for (var n, t = 1, r = arguments.length; t < r; t++) {
470
+ n = arguments[t];
471
+ for (var e in n) Object.prototype.hasOwnProperty.call(n, e) && (o[e] = n[e]);
472
+ }
473
+ return o;
474
+ }, O.apply(this, arguments);
475
+ };
476
+ Object.defineProperty(B, "__esModule", { value: !0 }), B.MmlMalignmark = void 0;
477
+ var w = rt(), h = (function(o) {
478
+ f(n, o);
479
+ function n() {
480
+ return o !== null && o.apply(this, arguments) || this;
481
+ }
482
+ return Object.defineProperty(n.prototype, "kind", {
483
+ get: function() {
484
+ return "malignmark";
485
+ },
486
+ enumerable: !1,
487
+ configurable: !0
488
+ }), Object.defineProperty(n.prototype, "arity", {
489
+ get: function() {
490
+ return 0;
491
+ },
492
+ enumerable: !1,
493
+ configurable: !0
494
+ }), Object.defineProperty(n.prototype, "isSpacelike", {
495
+ get: function() {
496
+ return !0;
497
+ },
498
+ enumerable: !1,
499
+ configurable: !0
500
+ }), n.defaults = O(O({}, w.AbstractMmlNode.defaults), { edge: "left" }), n;
501
+ })(w.AbstractMmlNode);
502
+ return B.MmlMalignmark = h, B;
503
+ }
504
+ var $ = {}, pt;
505
+ function he() {
506
+ if (pt) return $;
507
+ pt = 1;
508
+ var f = $ && $.__extends || /* @__PURE__ */ (function() {
509
+ var o = function(n, t) {
510
+ return o = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, e) {
511
+ r.__proto__ = e;
512
+ } || function(r, e) {
513
+ for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (r[i] = e[i]);
514
+ }, o(n, t);
515
+ };
516
+ return function(n, t) {
517
+ if (typeof t != "function" && t !== null)
518
+ throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
519
+ o(n, t);
520
+ function r() {
521
+ this.constructor = n;
522
+ }
523
+ n.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
524
+ };
525
+ })(), O = $ && $.__assign || function() {
526
+ return O = Object.assign || function(o) {
527
+ for (var n, t = 1, r = arguments.length; t < r; t++) {
528
+ n = arguments[t];
529
+ for (var e in n) Object.prototype.hasOwnProperty.call(n, e) && (o[e] = n[e]);
530
+ }
531
+ return o;
532
+ }, O.apply(this, arguments);
533
+ };
534
+ Object.defineProperty($, "__esModule", { value: !0 }), $.MathChoice = void 0;
535
+ var w = rt(), h = (function(o) {
536
+ f(n, o);
537
+ function n() {
538
+ return o !== null && o.apply(this, arguments) || this;
539
+ }
540
+ return Object.defineProperty(n.prototype, "kind", {
541
+ get: function() {
542
+ return "MathChoice";
543
+ },
544
+ enumerable: !1,
545
+ configurable: !0
546
+ }), Object.defineProperty(n.prototype, "arity", {
547
+ get: function() {
548
+ return 4;
549
+ },
550
+ enumerable: !1,
551
+ configurable: !0
552
+ }), Object.defineProperty(n.prototype, "notParent", {
553
+ get: function() {
554
+ return !0;
555
+ },
556
+ enumerable: !1,
557
+ configurable: !0
558
+ }), n.prototype.setInheritedAttributes = function(t, r, e, i) {
559
+ var y = r ? 0 : Math.max(0, Math.min(e, 2)) + 1, u = this.childNodes[y] || this.factory.create("mrow");
560
+ this.parent.replaceChild(u, this), u.setInheritedAttributes(t, r, e, i);
561
+ }, n.defaults = O({}, w.AbstractMmlBaseNode.defaults), n;
562
+ })(w.AbstractMmlBaseNode);
563
+ return $.MathChoice = h, $;
564
+ }
565
+ var ht;
566
+ function de() {
567
+ if (ht) return et;
568
+ ht = 1;
569
+ var f;
570
+ Object.defineProperty(et, "__esModule", { value: !0 }), et.MML = void 0;
571
+ var O = rt(), w = Ht(), h = kt(), o = It(), n = ae(), t = qt(), r = Nt(), e = Rt(), i = Ct(), y = Ft(), u = Jt(), c = Bt(), p = ce(), _ = $t(), x = Xt(), d = zt(), T = Wt(), L = Yt(), v = Kt(), a = Ut(), l = Gt(), s = Qt(), m = Vt(), M = Zt(), g = te(), j = fe(), S = pe(), A = ee(), b = re(), D = ne(), E = he();
572
+ return et.MML = (f = {}, f[w.MmlMath.prototype.kind] = w.MmlMath, f[h.MmlMi.prototype.kind] = h.MmlMi, f[o.MmlMn.prototype.kind] = o.MmlMn, f[n.MmlMo.prototype.kind] = n.MmlMo, f[t.MmlMtext.prototype.kind] = t.MmlMtext, f[r.MmlMspace.prototype.kind] = r.MmlMspace, f[e.MmlMs.prototype.kind] = e.MmlMs, f[i.MmlMrow.prototype.kind] = i.MmlMrow, f[i.MmlInferredMrow.prototype.kind] = i.MmlInferredMrow, f[y.MmlMfrac.prototype.kind] = y.MmlMfrac, f[u.MmlMsqrt.prototype.kind] = u.MmlMsqrt, f[c.MmlMroot.prototype.kind] = c.MmlMroot, f[p.MmlMstyle.prototype.kind] = p.MmlMstyle, f[_.MmlMerror.prototype.kind] = _.MmlMerror, f[x.MmlMpadded.prototype.kind] = x.MmlMpadded, f[d.MmlMphantom.prototype.kind] = d.MmlMphantom, f[T.MmlMfenced.prototype.kind] = T.MmlMfenced, f[L.MmlMenclose.prototype.kind] = L.MmlMenclose, f[v.MmlMaction.prototype.kind] = v.MmlMaction, f[a.MmlMsub.prototype.kind] = a.MmlMsub, f[a.MmlMsup.prototype.kind] = a.MmlMsup, f[a.MmlMsubsup.prototype.kind] = a.MmlMsubsup, f[l.MmlMunder.prototype.kind] = l.MmlMunder, f[l.MmlMover.prototype.kind] = l.MmlMover, f[l.MmlMunderover.prototype.kind] = l.MmlMunderover, f[s.MmlMmultiscripts.prototype.kind] = s.MmlMmultiscripts, f[s.MmlMprescripts.prototype.kind] = s.MmlMprescripts, f[s.MmlNone.prototype.kind] = s.MmlNone, f[m.MmlMtable.prototype.kind] = m.MmlMtable, f[M.MmlMlabeledtr.prototype.kind] = M.MmlMlabeledtr, f[M.MmlMtr.prototype.kind] = M.MmlMtr, f[g.MmlMtd.prototype.kind] = g.MmlMtd, f[j.MmlMaligngroup.prototype.kind] = j.MmlMaligngroup, f[S.MmlMalignmark.prototype.kind] = S.MmlMalignmark, f[A.MmlMglyph.prototype.kind] = A.MmlMglyph, f[b.MmlSemantics.prototype.kind] = b.MmlSemantics, f[b.MmlAnnotation.prototype.kind] = b.MmlAnnotation, f[b.MmlAnnotationXML.prototype.kind] = b.MmlAnnotationXML, f[D.TeXAtom.prototype.kind] = D.TeXAtom, f[E.MathChoice.prototype.kind] = E.MathChoice, f[O.TextNode.prototype.kind] = O.TextNode, f[O.XMLNode.prototype.kind] = O.XMLNode, f), et;
573
+ }
574
+ var dt;
575
+ function ye() {
576
+ if (dt) return K;
577
+ dt = 1;
578
+ var f = K && K.__extends || /* @__PURE__ */ (function() {
579
+ var o = function(n, t) {
580
+ return o = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, e) {
581
+ r.__proto__ = e;
582
+ } || function(r, e) {
583
+ for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (r[i] = e[i]);
584
+ }, o(n, t);
585
+ };
586
+ return function(n, t) {
587
+ if (typeof t != "function" && t !== null)
588
+ throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
589
+ o(n, t);
590
+ function r() {
591
+ this.constructor = n;
592
+ }
593
+ n.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
594
+ };
595
+ })();
596
+ Object.defineProperty(K, "__esModule", { value: !0 }), K.MmlFactory = void 0;
597
+ var O = le(), w = de(), h = (function(o) {
598
+ f(n, o);
599
+ function n() {
600
+ return o !== null && o.apply(this, arguments) || this;
601
+ }
602
+ return Object.defineProperty(n.prototype, "MML", {
603
+ get: function() {
604
+ return this.node;
605
+ },
606
+ enumerable: !1,
607
+ configurable: !0
608
+ }), n.defaultNodes = w.MML, n;
609
+ })(O.AbstractNodeFactory);
610
+ return K.MmlFactory = h, K;
611
+ }
612
+ var H = {}, yt;
613
+ function ve() {
614
+ if (yt) return H;
615
+ yt = 1;
616
+ var f = H && H.__extends || /* @__PURE__ */ (function() {
617
+ var t = function(r, e) {
618
+ return t = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(i, y) {
619
+ i.__proto__ = y;
620
+ } || function(i, y) {
621
+ for (var u in y) Object.prototype.hasOwnProperty.call(y, u) && (i[u] = y[u]);
622
+ }, t(r, e);
623
+ };
624
+ return function(r, e) {
625
+ if (typeof e != "function" && e !== null)
626
+ throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
627
+ t(r, e);
628
+ function i() {
629
+ this.constructor = r;
630
+ }
631
+ r.prototype = e === null ? Object.create(e) : (i.prototype = e.prototype, new i());
632
+ };
633
+ })(), O = H && H.__values || function(t) {
634
+ var r = typeof Symbol == "function" && Symbol.iterator, e = r && t[r], i = 0;
635
+ if (e) return e.call(t);
636
+ if (t && typeof t.length == "number") return {
637
+ next: function() {
638
+ return t && i >= t.length && (t = void 0), { value: t && t[i++], done: !t };
639
+ }
640
+ };
641
+ throw new TypeError(r ? "Object is not iterable." : "Symbol.iterator is not defined.");
642
+ }, w = H && H.__read || function(t, r) {
643
+ var e = typeof Symbol == "function" && t[Symbol.iterator];
644
+ if (!e) return t;
645
+ var i = e.call(t), y, u = [], c;
646
+ try {
647
+ for (; (r === void 0 || r-- > 0) && !(y = i.next()).done; ) u.push(y.value);
648
+ } catch (p) {
649
+ c = { error: p };
650
+ } finally {
651
+ try {
652
+ y && !y.done && (e = i.return) && e.call(i);
653
+ } finally {
654
+ if (c) throw c.error;
655
+ }
656
+ }
657
+ return u;
658
+ }, h = H && H.__spreadArray || function(t, r, e) {
659
+ if (e || arguments.length === 2) for (var i = 0, y = r.length, u; i < y; i++)
660
+ (u || !(i in r)) && (u || (u = Array.prototype.slice.call(r, 0, i)), u[i] = r[i]);
661
+ return t.concat(u || Array.prototype.slice.call(r));
662
+ };
663
+ Object.defineProperty(H, "__esModule", { value: !0 }), H.BitFieldClass = H.BitField = void 0;
664
+ var o = (function() {
665
+ function t() {
666
+ this.bits = 0;
667
+ }
668
+ return t.allocate = function() {
669
+ for (var r, e, i = [], y = 0; y < arguments.length; y++)
670
+ i[y] = arguments[y];
671
+ try {
672
+ for (var u = O(i), c = u.next(); !c.done; c = u.next()) {
673
+ var p = c.value;
674
+ if (this.has(p))
675
+ throw new Error("Bit already allocated for " + p);
676
+ if (this.next === t.MAXBIT)
677
+ throw new Error("Maximum number of bits already allocated");
678
+ this.names.set(p, this.next), this.next <<= 1;
679
+ }
680
+ } catch (_) {
681
+ r = { error: _ };
682
+ } finally {
683
+ try {
684
+ c && !c.done && (e = u.return) && e.call(u);
685
+ } finally {
686
+ if (r) throw r.error;
687
+ }
688
+ }
689
+ }, t.has = function(r) {
690
+ return this.names.has(r);
691
+ }, t.prototype.set = function(r) {
692
+ this.bits |= this.getBit(r);
693
+ }, t.prototype.clear = function(r) {
694
+ this.bits &= ~this.getBit(r);
695
+ }, t.prototype.isSet = function(r) {
696
+ return !!(this.bits & this.getBit(r));
697
+ }, t.prototype.reset = function() {
698
+ this.bits = 0;
699
+ }, t.prototype.getBit = function(r) {
700
+ var e = this.constructor.names.get(r);
701
+ if (!e)
702
+ throw new Error("Unknown bit-field name: " + r);
703
+ return e;
704
+ }, t.MAXBIT = 1 << 31, t.next = 1, t.names = /* @__PURE__ */ new Map(), t;
705
+ })();
706
+ H.BitField = o;
707
+ function n() {
708
+ for (var t = [], r = 0; r < arguments.length; r++)
709
+ t[r] = arguments[r];
710
+ var e = (function(i) {
711
+ f(y, i);
712
+ function y() {
713
+ return i !== null && i.apply(this, arguments) || this;
714
+ }
715
+ return y;
716
+ })(o);
717
+ return e.allocate.apply(e, h([], w(t), !1)), e;
718
+ }
719
+ return H.BitFieldClass = n, H;
720
+ }
721
+ var vt;
722
+ function Tt() {
723
+ return vt || (vt = 1, (function(f) {
724
+ var O = N && N.__extends || /* @__PURE__ */ (function() {
725
+ var v = function(a, l) {
726
+ return v = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(s, m) {
727
+ s.__proto__ = m;
728
+ } || function(s, m) {
729
+ for (var M in m) Object.prototype.hasOwnProperty.call(m, M) && (s[M] = m[M]);
730
+ }, v(a, l);
731
+ };
732
+ return function(a, l) {
733
+ if (typeof l != "function" && l !== null)
734
+ throw new TypeError("Class extends value " + String(l) + " is not a constructor or null");
735
+ v(a, l);
736
+ function s() {
737
+ this.constructor = a;
738
+ }
739
+ a.prototype = l === null ? Object.create(l) : (s.prototype = l.prototype, new s());
740
+ };
741
+ })(), w = N && N.__values || function(v) {
742
+ var a = typeof Symbol == "function" && Symbol.iterator, l = a && v[a], s = 0;
743
+ if (l) return l.call(v);
744
+ if (v && typeof v.length == "number") return {
745
+ next: function() {
746
+ return v && s >= v.length && (v = void 0), { value: v && v[s++], done: !v };
747
+ }
748
+ };
749
+ throw new TypeError(a ? "Object is not iterable." : "Symbol.iterator is not defined.");
750
+ }, h = N && N.__read || function(v, a) {
751
+ var l = typeof Symbol == "function" && v[Symbol.iterator];
752
+ if (!l) return v;
753
+ var s = l.call(v), m, M = [], g;
754
+ try {
755
+ for (; (a === void 0 || a-- > 0) && !(m = s.next()).done; ) M.push(m.value);
756
+ } catch (j) {
757
+ g = { error: j };
758
+ } finally {
759
+ try {
760
+ m && !m.done && (l = s.return) && l.call(s);
761
+ } finally {
762
+ if (g) throw g.error;
763
+ }
764
+ }
765
+ return M;
766
+ }, o = N && N.__spreadArray || function(v, a, l) {
767
+ if (l || arguments.length === 2) for (var s = 0, m = a.length, M; s < m; s++)
768
+ (M || !(s in a)) && (M || (M = Array.prototype.slice.call(a, 0, s)), M[s] = a[s]);
769
+ return v.concat(M || Array.prototype.slice.call(a));
770
+ };
771
+ Object.defineProperty(f, "__esModule", { value: !0 }), f.AbstractMathDocument = f.resetAllOptions = f.resetOptions = f.RenderList = void 0;
772
+ var n = it(), t = Pt(), r = ie(), e = St(), i = ot(), y = ye(), u = ve(), c = Lt(), p = (function(v) {
773
+ O(a, v);
774
+ function a() {
775
+ return v !== null && v.apply(this, arguments) || this;
776
+ }
777
+ return a.create = function(l) {
778
+ var s, m, M = new this();
779
+ try {
780
+ for (var g = w(Object.keys(l)), j = g.next(); !j.done; j = g.next()) {
781
+ var S = j.value, A = h(this.action(S, l[S]), 2), b = A[0], D = A[1];
782
+ D && M.add(b, D);
783
+ }
784
+ } catch (E) {
785
+ s = { error: E };
786
+ } finally {
787
+ try {
788
+ j && !j.done && (m = g.return) && m.call(g);
789
+ } finally {
790
+ if (s) throw s.error;
791
+ }
792
+ }
793
+ return M;
794
+ }, a.action = function(l, s) {
795
+ var m, M, g, j, S, A, b = !0, D = s[0];
796
+ if (s.length === 1 || typeof s[1] == "boolean")
797
+ s.length === 2 && (b = s[1]), m = h(this.methodActions(l), 2), S = m[0], A = m[1];
798
+ else if (typeof s[1] == "string")
799
+ if (typeof s[2] == "string") {
800
+ s.length === 4 && (b = s[3]);
801
+ var E = h(s.slice(1), 2), k = E[0], P = E[1];
802
+ M = h(this.methodActions(k, P), 2), S = M[0], A = M[1];
803
+ } else
804
+ s.length === 3 && (b = s[2]), g = h(this.methodActions(s[1]), 2), S = g[0], A = g[1];
805
+ else
806
+ s.length === 4 && (b = s[3]), j = h(s.slice(1), 2), S = j[0], A = j[1];
807
+ return [{ id: l, renderDoc: S, renderMath: A, convert: b }, D];
808
+ }, a.methodActions = function(l, s) {
809
+ return s === void 0 && (s = l), [
810
+ function(m) {
811
+ return l && m[l](), !1;
812
+ },
813
+ function(m, M) {
814
+ return s && m[s](M), !1;
815
+ }
816
+ ];
817
+ }, a.prototype.renderDoc = function(l, s) {
818
+ var m, M;
819
+ s === void 0 && (s = i.STATE.UNPROCESSED);
820
+ try {
821
+ for (var g = w(this.items), j = g.next(); !j.done; j = g.next()) {
822
+ var S = j.value;
823
+ if (S.priority >= s && S.item.renderDoc(l))
824
+ return;
825
+ }
826
+ } catch (A) {
827
+ m = { error: A };
828
+ } finally {
829
+ try {
830
+ j && !j.done && (M = g.return) && M.call(g);
831
+ } finally {
832
+ if (m) throw m.error;
833
+ }
834
+ }
835
+ }, a.prototype.renderMath = function(l, s, m) {
836
+ var M, g;
837
+ m === void 0 && (m = i.STATE.UNPROCESSED);
838
+ try {
839
+ for (var j = w(this.items), S = j.next(); !S.done; S = j.next()) {
840
+ var A = S.value;
841
+ if (A.priority >= m && A.item.renderMath(l, s))
842
+ return;
843
+ }
844
+ } catch (b) {
845
+ M = { error: b };
846
+ } finally {
847
+ try {
848
+ S && !S.done && (g = j.return) && g.call(j);
849
+ } finally {
850
+ if (M) throw M.error;
851
+ }
852
+ }
853
+ }, a.prototype.renderConvert = function(l, s, m) {
854
+ var M, g;
855
+ m === void 0 && (m = i.STATE.LAST);
856
+ try {
857
+ for (var j = w(this.items), S = j.next(); !S.done; S = j.next()) {
858
+ var A = S.value;
859
+ if (A.priority > m || A.item.convert && A.item.renderMath(l, s))
860
+ return;
861
+ }
862
+ } catch (b) {
863
+ M = { error: b };
864
+ } finally {
865
+ try {
866
+ S && !S.done && (g = j.return) && g.call(j);
867
+ } finally {
868
+ if (M) throw M.error;
869
+ }
870
+ }
871
+ }, a.prototype.findID = function(l) {
872
+ var s, m;
873
+ try {
874
+ for (var M = w(this.items), g = M.next(); !g.done; g = M.next()) {
875
+ var j = g.value;
876
+ if (j.item.id === l)
877
+ return j.item;
878
+ }
879
+ } catch (S) {
880
+ s = { error: S };
881
+ } finally {
882
+ try {
883
+ g && !g.done && (m = M.return) && m.call(M);
884
+ } finally {
885
+ if (s) throw s.error;
886
+ }
887
+ }
888
+ return null;
889
+ }, a;
890
+ })(c.PrioritizedList);
891
+ f.RenderList = p, f.resetOptions = {
892
+ all: !1,
893
+ processed: !1,
894
+ inputJax: null,
895
+ outputJax: null
896
+ }, f.resetAllOptions = {
897
+ all: !0,
898
+ processed: !0,
899
+ inputJax: [],
900
+ outputJax: []
901
+ };
902
+ var _ = (function(v) {
903
+ O(a, v);
904
+ function a() {
905
+ return v !== null && v.apply(this, arguments) || this;
906
+ }
907
+ return a.prototype.compile = function(l) {
908
+ return null;
909
+ }, a;
910
+ })(t.AbstractInputJax), x = (function(v) {
911
+ O(a, v);
912
+ function a() {
913
+ return v !== null && v.apply(this, arguments) || this;
914
+ }
915
+ return a.prototype.typeset = function(l, s) {
916
+ return null;
917
+ }, a.prototype.escaped = function(l, s) {
918
+ return null;
919
+ }, a;
920
+ })(r.AbstractOutputJax), d = (function(v) {
921
+ O(a, v);
922
+ function a() {
923
+ return v !== null && v.apply(this, arguments) || this;
924
+ }
925
+ return a;
926
+ })(e.AbstractMathList), T = (function(v) {
927
+ O(a, v);
928
+ function a() {
929
+ return v !== null && v.apply(this, arguments) || this;
930
+ }
931
+ return a;
932
+ })(i.AbstractMathItem), L = (function() {
933
+ function v(a, l, s) {
934
+ var m = this, M = this.constructor;
935
+ this.document = a, this.options = (0, n.userOptions)((0, n.defaultOptions)({}, M.OPTIONS), s), this.math = new (this.options.MathList || d)(), this.renderActions = p.create(this.options.renderActions), this.processed = new v.ProcessBits(), this.outputJax = this.options.OutputJax || new x();
936
+ var g = this.options.InputJax || [new _()];
937
+ Array.isArray(g) || (g = [g]), this.inputJax = g, this.adaptor = l, this.outputJax.setAdaptor(l), this.inputJax.map(function(j) {
938
+ return j.setAdaptor(l);
939
+ }), this.mmlFactory = this.options.MmlFactory || new y.MmlFactory(), this.inputJax.map(function(j) {
940
+ return j.setMmlFactory(m.mmlFactory);
941
+ }), this.outputJax.initialize(), this.inputJax.map(function(j) {
942
+ return j.initialize();
943
+ });
944
+ }
945
+ return Object.defineProperty(v.prototype, "kind", {
946
+ get: function() {
947
+ return this.constructor.KIND;
948
+ },
949
+ enumerable: !1,
950
+ configurable: !0
951
+ }), v.prototype.addRenderAction = function(a) {
952
+ for (var l = [], s = 1; s < arguments.length; s++)
953
+ l[s - 1] = arguments[s];
954
+ var m = h(p.action(a, l), 2), M = m[0], g = m[1];
955
+ this.renderActions.add(M, g);
956
+ }, v.prototype.removeRenderAction = function(a) {
957
+ var l = this.renderActions.findID(a);
958
+ l && this.renderActions.remove(l);
959
+ }, v.prototype.render = function() {
960
+ return this.renderActions.renderDoc(this), this;
961
+ }, v.prototype.rerender = function(a) {
962
+ return a === void 0 && (a = i.STATE.RERENDER), this.state(a - 1), this.render(), this;
963
+ }, v.prototype.convert = function(a, l) {
964
+ l === void 0 && (l = {});
965
+ var s = (0, n.userOptions)({
966
+ format: this.inputJax[0].name,
967
+ display: !0,
968
+ end: i.STATE.LAST,
969
+ em: 16,
970
+ ex: 8,
971
+ containerWidth: null,
972
+ lineWidth: 1e6,
973
+ scale: 1,
974
+ family: ""
975
+ }, l), m = s.format, M = s.display, g = s.end, j = s.ex, S = s.em, A = s.containerWidth, b = s.lineWidth, D = s.scale, E = s.family;
976
+ A === null && (A = 80 * j);
977
+ var k = this.inputJax.reduce(function(q, C) {
978
+ return C.name === m ? C : q;
979
+ }, null), P = new this.options.MathItem(a, k, M);
980
+ return P.start.node = this.adaptor.body(this.document), P.setMetrics(S, j, A, b, D), this.outputJax.options.mtextInheritFont && (P.outputData.mtextFamily = E), this.outputJax.options.merrorInheritFont && (P.outputData.merrorFamily = E), P.convert(this, g), P.typesetRoot || P.root;
981
+ }, v.prototype.findMath = function(a) {
982
+ return this.processed.set("findMath"), this;
983
+ }, v.prototype.compile = function() {
984
+ var a, l, s, m;
985
+ if (!this.processed.isSet("compile")) {
986
+ var M = [];
987
+ try {
988
+ for (var g = w(this.math), j = g.next(); !j.done; j = g.next()) {
989
+ var S = j.value;
990
+ this.compileMath(S), S.inputData.recompile !== void 0 && M.push(S);
991
+ }
992
+ } catch (E) {
993
+ a = { error: E };
994
+ } finally {
995
+ try {
996
+ j && !j.done && (l = g.return) && l.call(g);
997
+ } finally {
998
+ if (a) throw a.error;
999
+ }
1000
+ }
1001
+ try {
1002
+ for (var A = w(M), b = A.next(); !b.done; b = A.next()) {
1003
+ var S = b.value, D = S.inputData.recompile;
1004
+ S.state(D.state), S.inputData.recompile = D, this.compileMath(S);
1005
+ }
1006
+ } catch (E) {
1007
+ s = { error: E };
1008
+ } finally {
1009
+ try {
1010
+ b && !b.done && (m = A.return) && m.call(A);
1011
+ } finally {
1012
+ if (s) throw s.error;
1013
+ }
1014
+ }
1015
+ this.processed.set("compile");
1016
+ }
1017
+ return this;
1018
+ }, v.prototype.compileMath = function(a) {
1019
+ try {
1020
+ a.compile(this);
1021
+ } catch (l) {
1022
+ if (l.retry || l.restart)
1023
+ throw l;
1024
+ this.options.compileError(this, a, l), a.inputData.error = l;
1025
+ }
1026
+ }, v.prototype.compileError = function(a, l) {
1027
+ a.root = this.mmlFactory.create("math", null, [
1028
+ this.mmlFactory.create("merror", { "data-mjx-error": l.message, title: l.message }, [
1029
+ this.mmlFactory.create("mtext", null, [
1030
+ this.mmlFactory.create("text").setText("Math input error")
1031
+ ])
1032
+ ])
1033
+ ]), a.display && a.root.attributes.set("display", "block"), a.inputData.error = l.message;
1034
+ }, v.prototype.typeset = function() {
1035
+ var a, l;
1036
+ if (!this.processed.isSet("typeset")) {
1037
+ try {
1038
+ for (var s = w(this.math), m = s.next(); !m.done; m = s.next()) {
1039
+ var M = m.value;
1040
+ try {
1041
+ M.typeset(this);
1042
+ } catch (g) {
1043
+ if (g.retry || g.restart)
1044
+ throw g;
1045
+ this.options.typesetError(this, M, g), M.outputData.error = g;
1046
+ }
1047
+ }
1048
+ } catch (g) {
1049
+ a = { error: g };
1050
+ } finally {
1051
+ try {
1052
+ m && !m.done && (l = s.return) && l.call(s);
1053
+ } finally {
1054
+ if (a) throw a.error;
1055
+ }
1056
+ }
1057
+ this.processed.set("typeset");
1058
+ }
1059
+ return this;
1060
+ }, v.prototype.typesetError = function(a, l) {
1061
+ a.typesetRoot = this.adaptor.node("mjx-container", {
1062
+ class: "MathJax mjx-output-error",
1063
+ jax: this.outputJax.name
1064
+ }, [
1065
+ this.adaptor.node("span", {
1066
+ "data-mjx-error": l.message,
1067
+ title: l.message,
1068
+ style: {
1069
+ color: "red",
1070
+ "background-color": "yellow",
1071
+ "line-height": "normal"
1072
+ }
1073
+ }, [
1074
+ this.adaptor.text("Math output error")
1075
+ ])
1076
+ ]), a.display && this.adaptor.setAttributes(a.typesetRoot, {
1077
+ style: {
1078
+ display: "block",
1079
+ margin: "1em 0",
1080
+ "text-align": "center"
1081
+ }
1082
+ }), a.outputData.error = l.message;
1083
+ }, v.prototype.getMetrics = function() {
1084
+ return this.processed.isSet("getMetrics") || (this.outputJax.getMetrics(this), this.processed.set("getMetrics")), this;
1085
+ }, v.prototype.updateDocument = function() {
1086
+ var a, l;
1087
+ if (!this.processed.isSet("updateDocument")) {
1088
+ try {
1089
+ for (var s = w(this.math.reversed()), m = s.next(); !m.done; m = s.next()) {
1090
+ var M = m.value;
1091
+ M.updateDocument(this);
1092
+ }
1093
+ } catch (g) {
1094
+ a = { error: g };
1095
+ } finally {
1096
+ try {
1097
+ m && !m.done && (l = s.return) && l.call(s);
1098
+ } finally {
1099
+ if (a) throw a.error;
1100
+ }
1101
+ }
1102
+ this.processed.set("updateDocument");
1103
+ }
1104
+ return this;
1105
+ }, v.prototype.removeFromDocument = function(a) {
1106
+ return this;
1107
+ }, v.prototype.state = function(a, l) {
1108
+ var s, m;
1109
+ l === void 0 && (l = !1);
1110
+ try {
1111
+ for (var M = w(this.math), g = M.next(); !g.done; g = M.next()) {
1112
+ var j = g.value;
1113
+ j.state(a, l);
1114
+ }
1115
+ } catch (S) {
1116
+ s = { error: S };
1117
+ } finally {
1118
+ try {
1119
+ g && !g.done && (m = M.return) && m.call(M);
1120
+ } finally {
1121
+ if (s) throw s.error;
1122
+ }
1123
+ }
1124
+ return a < i.STATE.INSERTED && this.processed.clear("updateDocument"), a < i.STATE.TYPESET && (this.processed.clear("typeset"), this.processed.clear("getMetrics")), a < i.STATE.COMPILED && this.processed.clear("compile"), this;
1125
+ }, v.prototype.reset = function(a) {
1126
+ var l;
1127
+ return a === void 0 && (a = { processed: !0 }), a = (0, n.userOptions)(Object.assign({}, f.resetOptions), a), a.all && Object.assign(a, f.resetAllOptions), a.processed && this.processed.reset(), a.inputJax && this.inputJax.forEach(function(s) {
1128
+ return s.reset.apply(s, o([], h(a.inputJax), !1));
1129
+ }), a.outputJax && (l = this.outputJax).reset.apply(l, o([], h(a.outputJax), !1)), this;
1130
+ }, v.prototype.clear = function() {
1131
+ return this.reset(), this.math.clear(), this;
1132
+ }, v.prototype.concat = function(a) {
1133
+ return this.math.merge(a), this;
1134
+ }, v.prototype.clearMathItemsWithin = function(a) {
1135
+ var l, s = this.getMathItemsWithin(a);
1136
+ return (l = this.math).remove.apply(l, o([], h(s), !1)), s;
1137
+ }, v.prototype.getMathItemsWithin = function(a) {
1138
+ var l, s, m, M;
1139
+ Array.isArray(a) || (a = [a]);
1140
+ var g = this.adaptor, j = [], S = g.getElements(a, this.document);
1141
+ try {
1142
+ t: for (var A = w(this.math), b = A.next(); !b.done; b = A.next()) {
1143
+ var D = b.value;
1144
+ try {
1145
+ for (var E = (m = void 0, w(S)), k = E.next(); !k.done; k = E.next()) {
1146
+ var P = k.value;
1147
+ if (D.start.node && g.contains(P, D.start.node)) {
1148
+ j.push(D);
1149
+ continue t;
1150
+ }
1151
+ }
1152
+ } catch (q) {
1153
+ m = { error: q };
1154
+ } finally {
1155
+ try {
1156
+ k && !k.done && (M = E.return) && M.call(E);
1157
+ } finally {
1158
+ if (m) throw m.error;
1159
+ }
1160
+ }
1161
+ }
1162
+ } catch (q) {
1163
+ l = { error: q };
1164
+ } finally {
1165
+ try {
1166
+ b && !b.done && (s = A.return) && s.call(A);
1167
+ } finally {
1168
+ if (l) throw l.error;
1169
+ }
1170
+ }
1171
+ return j;
1172
+ }, v.KIND = "MathDocument", v.OPTIONS = {
1173
+ OutputJax: null,
1174
+ InputJax: null,
1175
+ MmlFactory: null,
1176
+ MathList: d,
1177
+ MathItem: T,
1178
+ compileError: function(a, l, s) {
1179
+ a.compileError(l, s);
1180
+ },
1181
+ typesetError: function(a, l, s) {
1182
+ a.typesetError(l, s);
1183
+ },
1184
+ renderActions: (0, n.expandable)({
1185
+ find: [i.STATE.FINDMATH, "findMath", "", !1],
1186
+ compile: [i.STATE.COMPILED],
1187
+ metrics: [i.STATE.METRICS, "getMetrics", "", !1],
1188
+ typeset: [i.STATE.TYPESET],
1189
+ update: [i.STATE.INSERTED, "updateDocument", !1]
1190
+ })
1191
+ }, v.ProcessBits = (0, u.BitFieldClass)("findMath", "compile", "getMetrics", "typeset", "updateDocument"), v;
1192
+ })();
1193
+ f.AbstractMathDocument = L;
1194
+ })(N)), N;
1195
+ }
1196
+ var mt;
1197
+ function me() {
1198
+ if (mt) return W;
1199
+ mt = 1;
1200
+ var f = W && W.__extends || /* @__PURE__ */ (function() {
1201
+ var o = function(n, t) {
1202
+ return o = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, e) {
1203
+ r.__proto__ = e;
1204
+ } || function(r, e) {
1205
+ for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (r[i] = e[i]);
1206
+ }, o(n, t);
1207
+ };
1208
+ return function(n, t) {
1209
+ if (typeof t != "function" && t !== null)
1210
+ throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
1211
+ o(n, t);
1212
+ function r() {
1213
+ this.constructor = n;
1214
+ }
1215
+ n.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
1216
+ };
1217
+ })();
1218
+ Object.defineProperty(W, "__esModule", { value: !0 }), W.AbstractHandler = void 0;
1219
+ var O = Tt(), w = (function(o) {
1220
+ f(n, o);
1221
+ function n() {
1222
+ return o !== null && o.apply(this, arguments) || this;
1223
+ }
1224
+ return n;
1225
+ })(O.AbstractMathDocument), h = (function() {
1226
+ function o(n, t) {
1227
+ t === void 0 && (t = 5), this.documentClass = w, this.adaptor = n, this.priority = t;
1228
+ }
1229
+ return Object.defineProperty(o.prototype, "name", {
1230
+ get: function() {
1231
+ return this.constructor.NAME;
1232
+ },
1233
+ enumerable: !1,
1234
+ configurable: !0
1235
+ }), o.prototype.handlesDocument = function(n) {
1236
+ return !1;
1237
+ }, o.prototype.create = function(n, t) {
1238
+ return new this.documentClass(n, this.adaptor, t);
1239
+ }, o.NAME = "generic", o;
1240
+ })();
1241
+ return W.AbstractHandler = h, W;
1242
+ }
1243
+ var I = {}, G = {}, Mt;
1244
+ function Me() {
1245
+ if (Mt) return G;
1246
+ Mt = 1;
1247
+ var f = G && G.__extends || /* @__PURE__ */ (function() {
1248
+ var h = function(o, n) {
1249
+ return h = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
1250
+ t.__proto__ = r;
1251
+ } || function(t, r) {
1252
+ for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && (t[e] = r[e]);
1253
+ }, h(o, n);
1254
+ };
1255
+ return function(o, n) {
1256
+ if (typeof n != "function" && n !== null)
1257
+ throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
1258
+ h(o, n);
1259
+ function t() {
1260
+ this.constructor = o;
1261
+ }
1262
+ o.prototype = n === null ? Object.create(n) : (t.prototype = n.prototype, new t());
1263
+ };
1264
+ })();
1265
+ Object.defineProperty(G, "__esModule", { value: !0 }), G.HTMLMathItem = void 0;
1266
+ var O = ot(), w = (function(h) {
1267
+ f(o, h);
1268
+ function o(n, t, r, e, i) {
1269
+ return r === void 0 && (r = !0), e === void 0 && (e = { node: null, n: 0, delim: "" }), i === void 0 && (i = { node: null, n: 0, delim: "" }), h.call(this, n, t, r, e, i) || this;
1270
+ }
1271
+ return Object.defineProperty(o.prototype, "adaptor", {
1272
+ get: function() {
1273
+ return this.inputJax.adaptor;
1274
+ },
1275
+ enumerable: !1,
1276
+ configurable: !0
1277
+ }), o.prototype.updateDocument = function(n) {
1278
+ if (this.state() < O.STATE.INSERTED) {
1279
+ if (this.inputJax.processStrings) {
1280
+ var t = this.start.node;
1281
+ if (t === this.end.node)
1282
+ this.end.n && this.end.n < this.adaptor.value(this.end.node).length && this.adaptor.split(this.end.node, this.end.n), this.start.n && (t = this.adaptor.split(this.start.node, this.start.n)), this.adaptor.replace(this.typesetRoot, t);
1283
+ else {
1284
+ for (this.start.n && (t = this.adaptor.split(t, this.start.n)); t !== this.end.node; ) {
1285
+ var r = this.adaptor.next(t);
1286
+ this.adaptor.remove(t), t = r;
1287
+ }
1288
+ this.adaptor.insert(this.typesetRoot, t), this.end.n < this.adaptor.value(t).length && this.adaptor.split(t, this.end.n), this.adaptor.remove(t);
1289
+ }
1290
+ } else
1291
+ this.adaptor.replace(this.typesetRoot, this.start.node);
1292
+ this.start.node = this.end.node = this.typesetRoot, this.start.n = this.end.n = 0, this.state(O.STATE.INSERTED);
1293
+ }
1294
+ }, o.prototype.updateStyleSheet = function(n) {
1295
+ n.addStyleSheet();
1296
+ }, o.prototype.removeFromDocument = function(n) {
1297
+ if (n === void 0 && (n = !1), this.state() >= O.STATE.TYPESET) {
1298
+ var t = this.adaptor, r = this.start.node, e = t.text("");
1299
+ if (n) {
1300
+ var i = this.start.delim + this.math + this.end.delim;
1301
+ if (this.inputJax.processStrings)
1302
+ e = t.text(i);
1303
+ else {
1304
+ var y = t.parse(i, "text/html");
1305
+ e = t.firstChild(t.body(y));
1306
+ }
1307
+ }
1308
+ t.parent(r) && t.replace(e, r), this.start.node = this.end.node = e, this.start.n = this.end.n = 0;
1309
+ }
1310
+ }, o;
1311
+ })(O.AbstractMathItem);
1312
+ return G.HTMLMathItem = w, G;
1313
+ }
1314
+ var Q = {}, _t;
1315
+ function _e() {
1316
+ if (_t) return Q;
1317
+ _t = 1;
1318
+ var f = Q && Q.__extends || /* @__PURE__ */ (function() {
1319
+ var h = function(o, n) {
1320
+ return h = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
1321
+ t.__proto__ = r;
1322
+ } || function(t, r) {
1323
+ for (var e in r) Object.prototype.hasOwnProperty.call(r, e) && (t[e] = r[e]);
1324
+ }, h(o, n);
1325
+ };
1326
+ return function(o, n) {
1327
+ if (typeof n != "function" && n !== null)
1328
+ throw new TypeError("Class extends value " + String(n) + " is not a constructor or null");
1329
+ h(o, n);
1330
+ function t() {
1331
+ this.constructor = o;
1332
+ }
1333
+ o.prototype = n === null ? Object.create(n) : (t.prototype = n.prototype, new t());
1334
+ };
1335
+ })();
1336
+ Object.defineProperty(Q, "__esModule", { value: !0 }), Q.HTMLMathList = void 0;
1337
+ var O = St(), w = (function(h) {
1338
+ f(o, h);
1339
+ function o() {
1340
+ return h !== null && h.apply(this, arguments) || this;
1341
+ }
1342
+ return o;
1343
+ })(O.AbstractMathList);
1344
+ return Q.HTMLMathList = w, Q;
1345
+ }
1346
+ var V = {}, gt;
1347
+ function ge() {
1348
+ if (gt) return V;
1349
+ gt = 1;
1350
+ var f = V && V.__read || function(h, o) {
1351
+ var n = typeof Symbol == "function" && h[Symbol.iterator];
1352
+ if (!n) return h;
1353
+ var t = n.call(h), r, e = [], i;
1354
+ try {
1355
+ for (; (o === void 0 || o-- > 0) && !(r = t.next()).done; ) e.push(r.value);
1356
+ } catch (y) {
1357
+ i = { error: y };
1358
+ } finally {
1359
+ try {
1360
+ r && !r.done && (n = t.return) && n.call(t);
1361
+ } finally {
1362
+ if (i) throw i.error;
1363
+ }
1364
+ }
1365
+ return e;
1366
+ };
1367
+ Object.defineProperty(V, "__esModule", { value: !0 }), V.HTMLDomStrings = void 0;
1368
+ var O = it(), w = (function() {
1369
+ function h(o) {
1370
+ o === void 0 && (o = null);
1371
+ var n = this.constructor;
1372
+ this.options = (0, O.userOptions)((0, O.defaultOptions)({}, n.OPTIONS), o), this.init(), this.getPatterns();
1373
+ }
1374
+ return h.prototype.init = function() {
1375
+ this.strings = [], this.string = "", this.snodes = [], this.nodes = [], this.stack = [];
1376
+ }, h.prototype.getPatterns = function() {
1377
+ var o = (0, O.makeArray)(this.options.skipHtmlTags), n = (0, O.makeArray)(this.options.ignoreHtmlClass), t = (0, O.makeArray)(this.options.processHtmlClass);
1378
+ this.skipHtmlTags = new RegExp("^(?:" + o.join("|") + ")$", "i"), this.ignoreHtmlClass = new RegExp("(?:^| )(?:" + n.join("|") + ")(?: |$)"), this.processHtmlClass = new RegExp("(?:^| )(?:" + t + ")(?: |$)");
1379
+ }, h.prototype.pushString = function() {
1380
+ this.string.match(/\S/) && (this.strings.push(this.string), this.nodes.push(this.snodes)), this.string = "", this.snodes = [];
1381
+ }, h.prototype.extendString = function(o, n) {
1382
+ this.snodes.push([o, n.length]), this.string += n;
1383
+ }, h.prototype.handleText = function(o, n) {
1384
+ return n || this.extendString(o, this.adaptor.value(o)), this.adaptor.next(o);
1385
+ }, h.prototype.handleTag = function(o, n) {
1386
+ if (!n) {
1387
+ var t = this.options.includeHtmlTags[this.adaptor.kind(o)];
1388
+ this.extendString(o, t);
1389
+ }
1390
+ return this.adaptor.next(o);
1391
+ }, h.prototype.handleContainer = function(o, n) {
1392
+ this.pushString();
1393
+ var t = this.adaptor.getAttribute(o, "class") || "", r = this.adaptor.kind(o) || "", e = this.processHtmlClass.exec(t), i = o;
1394
+ return this.adaptor.firstChild(o) && !this.adaptor.getAttribute(o, "data-MJX") && (e || !this.skipHtmlTags.exec(r)) ? (this.adaptor.next(o) && this.stack.push([this.adaptor.next(o), n]), i = this.adaptor.firstChild(o), n = (n || this.ignoreHtmlClass.exec(t)) && !e) : i = this.adaptor.next(o), [i, n];
1395
+ }, h.prototype.handleOther = function(o, n) {
1396
+ return this.pushString(), this.adaptor.next(o);
1397
+ }, h.prototype.find = function(o) {
1398
+ var n, t;
1399
+ this.init();
1400
+ for (var r = this.adaptor.next(o), e = !1, i = this.options.includeHtmlTags; o && o !== r; ) {
1401
+ var y = this.adaptor.kind(o);
1402
+ y === "#text" ? o = this.handleText(o, e) : i.hasOwnProperty(y) ? o = this.handleTag(o, e) : y ? (n = f(this.handleContainer(o, e), 2), o = n[0], e = n[1]) : o = this.handleOther(o, e), !o && this.stack.length && (this.pushString(), t = f(this.stack.pop(), 2), o = t[0], e = t[1]);
1403
+ }
1404
+ this.pushString();
1405
+ var u = [this.strings, this.nodes];
1406
+ return this.init(), u;
1407
+ }, h.OPTIONS = {
1408
+ skipHtmlTags: ["script", "noscript", "style", "textarea", "pre", "code", "annotation", "annotation-xml"],
1409
+ includeHtmlTags: { br: `
1410
+ `, wbr: "", "#comment": "" },
1411
+ ignoreHtmlClass: "mathjax_ignore",
1412
+ processHtmlClass: "mathjax_process"
1413
+ }, h;
1414
+ })();
1415
+ return V.HTMLDomStrings = w, V;
1416
+ }
1417
+ var xt;
1418
+ function xe() {
1419
+ if (xt) return I;
1420
+ xt = 1;
1421
+ var f = I && I.__extends || /* @__PURE__ */ (function() {
1422
+ var u = function(c, p) {
1423
+ return u = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(_, x) {
1424
+ _.__proto__ = x;
1425
+ } || function(_, x) {
1426
+ for (var d in x) Object.prototype.hasOwnProperty.call(x, d) && (_[d] = x[d]);
1427
+ }, u(c, p);
1428
+ };
1429
+ return function(c, p) {
1430
+ if (typeof p != "function" && p !== null)
1431
+ throw new TypeError("Class extends value " + String(p) + " is not a constructor or null");
1432
+ u(c, p);
1433
+ function _() {
1434
+ this.constructor = c;
1435
+ }
1436
+ c.prototype = p === null ? Object.create(p) : (_.prototype = p.prototype, new _());
1437
+ };
1438
+ })(), O = I && I.__assign || function() {
1439
+ return O = Object.assign || function(u) {
1440
+ for (var c, p = 1, _ = arguments.length; p < _; p++) {
1441
+ c = arguments[p];
1442
+ for (var x in c) Object.prototype.hasOwnProperty.call(c, x) && (u[x] = c[x]);
1443
+ }
1444
+ return u;
1445
+ }, O.apply(this, arguments);
1446
+ }, w = I && I.__read || function(u, c) {
1447
+ var p = typeof Symbol == "function" && u[Symbol.iterator];
1448
+ if (!p) return u;
1449
+ var _ = p.call(u), x, d = [], T;
1450
+ try {
1451
+ for (; (c === void 0 || c-- > 0) && !(x = _.next()).done; ) d.push(x.value);
1452
+ } catch (L) {
1453
+ T = { error: L };
1454
+ } finally {
1455
+ try {
1456
+ x && !x.done && (p = _.return) && p.call(_);
1457
+ } finally {
1458
+ if (T) throw T.error;
1459
+ }
1460
+ }
1461
+ return d;
1462
+ }, h = I && I.__values || function(u) {
1463
+ var c = typeof Symbol == "function" && Symbol.iterator, p = c && u[c], _ = 0;
1464
+ if (p) return p.call(u);
1465
+ if (u && typeof u.length == "number") return {
1466
+ next: function() {
1467
+ return u && _ >= u.length && (u = void 0), { value: u && u[_++], done: !u };
1468
+ }
1469
+ };
1470
+ throw new TypeError(c ? "Object is not iterable." : "Symbol.iterator is not defined.");
1471
+ };
1472
+ Object.defineProperty(I, "__esModule", { value: !0 }), I.HTMLDocument = void 0;
1473
+ var o = Tt(), n = it(), t = Me(), r = _e(), e = ge(), i = ot(), y = (function(u) {
1474
+ f(c, u);
1475
+ function c(p, _, x) {
1476
+ var d = this, T = w((0, n.separateOptions)(x, e.HTMLDomStrings.OPTIONS), 2), L = T[0], v = T[1];
1477
+ return d = u.call(this, p, _, L) || this, d.domStrings = d.options.DomStrings || new e.HTMLDomStrings(v), d.domStrings.adaptor = _, d.styles = [], d;
1478
+ }
1479
+ return c.prototype.findPosition = function(p, _, x, d) {
1480
+ var T, L, v = this.adaptor;
1481
+ try {
1482
+ for (var a = h(d[p]), l = a.next(); !l.done; l = a.next()) {
1483
+ var s = l.value, m = w(s, 2), M = m[0], g = m[1];
1484
+ if (_ <= g && v.kind(M) === "#text")
1485
+ return { node: M, n: Math.max(_, 0), delim: x };
1486
+ _ -= g;
1487
+ }
1488
+ } catch (j) {
1489
+ T = { error: j };
1490
+ } finally {
1491
+ try {
1492
+ l && !l.done && (L = a.return) && L.call(a);
1493
+ } finally {
1494
+ if (T) throw T.error;
1495
+ }
1496
+ }
1497
+ return { node: null, n: 0, delim: x };
1498
+ }, c.prototype.mathItem = function(p, _, x) {
1499
+ var d = p.math, T = this.findPosition(p.n, p.start.n, p.open, x), L = this.findPosition(p.n, p.end.n, p.close, x);
1500
+ return new this.options.MathItem(d, _, p.display, T, L);
1501
+ }, c.prototype.findMath = function(p) {
1502
+ var _, x, d, T, L, v, a, l, s;
1503
+ if (!this.processed.isSet("findMath")) {
1504
+ this.adaptor.document = this.document, p = (0, n.userOptions)({ elements: this.options.elements || [this.adaptor.body(this.document)] }, p);
1505
+ try {
1506
+ for (var m = h(this.adaptor.getElements(p.elements, this.document)), M = m.next(); !M.done; M = m.next()) {
1507
+ var g = M.value, j = w([null, null], 2), S = j[0], A = j[1];
1508
+ try {
1509
+ for (var b = (d = void 0, h(this.inputJax)), D = b.next(); !D.done; D = b.next()) {
1510
+ var E = D.value, k = new this.options.MathList();
1511
+ if (E.processStrings) {
1512
+ S === null && (L = w(this.domStrings.find(g), 2), S = L[0], A = L[1]);
1513
+ try {
1514
+ for (var P = (v = void 0, h(E.findMath(S))), q = P.next(); !q.done; q = P.next()) {
1515
+ var C = q.value;
1516
+ k.push(this.mathItem(C, E, A));
1517
+ }
1518
+ } catch (X) {
1519
+ v = { error: X };
1520
+ } finally {
1521
+ try {
1522
+ q && !q.done && (a = P.return) && a.call(P);
1523
+ } finally {
1524
+ if (v) throw v.error;
1525
+ }
1526
+ }
1527
+ } else
1528
+ try {
1529
+ for (var nt = (l = void 0, h(E.findMath(g))), Z = nt.next(); !Z.done; Z = nt.next()) {
1530
+ var C = Z.value, bt = new this.options.MathItem(C.math, E, C.display, C.start, C.end);
1531
+ k.push(bt);
1532
+ }
1533
+ } catch (X) {
1534
+ l = { error: X };
1535
+ } finally {
1536
+ try {
1537
+ Z && !Z.done && (s = nt.return) && s.call(nt);
1538
+ } finally {
1539
+ if (l) throw l.error;
1540
+ }
1541
+ }
1542
+ this.math.merge(k);
1543
+ }
1544
+ } catch (X) {
1545
+ d = { error: X };
1546
+ } finally {
1547
+ try {
1548
+ D && !D.done && (T = b.return) && T.call(b);
1549
+ } finally {
1550
+ if (d) throw d.error;
1551
+ }
1552
+ }
1553
+ }
1554
+ } catch (X) {
1555
+ _ = { error: X };
1556
+ } finally {
1557
+ try {
1558
+ M && !M.done && (x = m.return) && x.call(m);
1559
+ } finally {
1560
+ if (_) throw _.error;
1561
+ }
1562
+ }
1563
+ this.processed.set("findMath");
1564
+ }
1565
+ return this;
1566
+ }, c.prototype.updateDocument = function() {
1567
+ return this.processed.isSet("updateDocument") || (this.addPageElements(), this.addStyleSheet(), u.prototype.updateDocument.call(this), this.processed.set("updateDocument")), this;
1568
+ }, c.prototype.addPageElements = function() {
1569
+ var p = this.adaptor.body(this.document), _ = this.documentPageElements();
1570
+ _ && this.adaptor.append(p, _);
1571
+ }, c.prototype.addStyleSheet = function() {
1572
+ var p = this.documentStyleSheet(), _ = this.adaptor;
1573
+ if (p && !_.parent(p)) {
1574
+ var x = _.head(this.document), d = this.findSheet(x, _.getAttribute(p, "id"));
1575
+ d ? _.replace(p, d) : _.append(x, p);
1576
+ }
1577
+ }, c.prototype.findSheet = function(p, _) {
1578
+ var x, d;
1579
+ if (_)
1580
+ try {
1581
+ for (var T = h(this.adaptor.tags(p, "style")), L = T.next(); !L.done; L = T.next()) {
1582
+ var v = L.value;
1583
+ if (this.adaptor.getAttribute(v, "id") === _)
1584
+ return v;
1585
+ }
1586
+ } catch (a) {
1587
+ x = { error: a };
1588
+ } finally {
1589
+ try {
1590
+ L && !L.done && (d = T.return) && d.call(T);
1591
+ } finally {
1592
+ if (x) throw x.error;
1593
+ }
1594
+ }
1595
+ return null;
1596
+ }, c.prototype.removeFromDocument = function(p) {
1597
+ var _, x;
1598
+ if (p === void 0 && (p = !1), this.processed.isSet("updateDocument"))
1599
+ try {
1600
+ for (var d = h(this.math), T = d.next(); !T.done; T = d.next()) {
1601
+ var L = T.value;
1602
+ L.state() >= i.STATE.INSERTED && L.state(i.STATE.TYPESET, p);
1603
+ }
1604
+ } catch (v) {
1605
+ _ = { error: v };
1606
+ } finally {
1607
+ try {
1608
+ T && !T.done && (x = d.return) && x.call(d);
1609
+ } finally {
1610
+ if (_) throw _.error;
1611
+ }
1612
+ }
1613
+ return this.processed.clear("updateDocument"), this;
1614
+ }, c.prototype.documentStyleSheet = function() {
1615
+ return this.outputJax.styleSheet(this);
1616
+ }, c.prototype.documentPageElements = function() {
1617
+ return this.outputJax.pageElements(this);
1618
+ }, c.prototype.addStyles = function(p) {
1619
+ this.styles.push(p);
1620
+ }, c.prototype.getStyles = function() {
1621
+ return this.styles;
1622
+ }, c.KIND = "HTML", c.OPTIONS = O(O({}, o.AbstractMathDocument.OPTIONS), { renderActions: (0, n.expandable)(O(O({}, o.AbstractMathDocument.OPTIONS.renderActions), { styles: [i.STATE.INSERTED + 1, "", "updateStyleSheet", !1] })), MathList: r.HTMLMathList, MathItem: t.HTMLMathItem, DomStrings: null }), c;
1623
+ })(o.AbstractMathDocument);
1624
+ return I.HTMLDocument = y, I;
1625
+ }
1626
+ var Ot;
1627
+ function Oe() {
1628
+ if (Ot) return z;
1629
+ Ot = 1;
1630
+ var f = z && z.__extends || /* @__PURE__ */ (function() {
1631
+ var o = function(n, t) {
1632
+ return o = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, e) {
1633
+ r.__proto__ = e;
1634
+ } || function(r, e) {
1635
+ for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && (r[i] = e[i]);
1636
+ }, o(n, t);
1637
+ };
1638
+ return function(n, t) {
1639
+ if (typeof t != "function" && t !== null)
1640
+ throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
1641
+ o(n, t);
1642
+ function r() {
1643
+ this.constructor = n;
1644
+ }
1645
+ n.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
1646
+ };
1647
+ })();
1648
+ Object.defineProperty(z, "__esModule", { value: !0 }), z.HTMLHandler = void 0;
1649
+ var O = me(), w = xe(), h = (function(o) {
1650
+ f(n, o);
1651
+ function n() {
1652
+ var t = o !== null && o.apply(this, arguments) || this;
1653
+ return t.documentClass = w.HTMLDocument, t;
1654
+ }
1655
+ return n.prototype.handlesDocument = function(t) {
1656
+ var r = this.adaptor;
1657
+ if (typeof t == "string")
1658
+ try {
1659
+ t = r.parse(t, "text/html");
1660
+ } catch {
1661
+ }
1662
+ return t instanceof r.window.Document || t instanceof r.window.HTMLElement || t instanceof r.window.DocumentFragment;
1663
+ }, n.prototype.create = function(t, r) {
1664
+ var e = this.adaptor;
1665
+ if (typeof t == "string")
1666
+ t = e.parse(t, "text/html");
1667
+ else if (t instanceof e.window.HTMLElement || t instanceof e.window.DocumentFragment) {
1668
+ var i = t;
1669
+ t = e.parse("", "text/html"), e.append(e.body(t), i);
1670
+ }
1671
+ return o.prototype.create.call(this, t, r);
1672
+ }, n;
1673
+ })(O.AbstractHandler);
1674
+ return z.HTMLHandler = h, z;
1675
+ }
1676
+ var wt;
1677
+ function we() {
1678
+ if (wt) return tt;
1679
+ wt = 1, Object.defineProperty(tt, "__esModule", { value: !0 }), tt.RegisterHTMLHandler = void 0;
1680
+ var f = Dt(), O = Oe();
1681
+ function w(h) {
1682
+ var o = new O.HTMLHandler(h);
1683
+ return f.mathjax.handlers.register(o), o;
1684
+ }
1685
+ return tt.RegisterHTMLHandler = w, tt;
1686
+ }
1687
+ var At = we();
1688
+ const je = /* @__PURE__ */ Et(At), Pe = /* @__PURE__ */ se({
1689
+ __proto__: null,
1690
+ default: je
1691
+ }, [At]);
1692
+ export {
1693
+ Pe as h
1694
+ };