diff --git a/dist/mathlive.d.ts b/dist/mathlive.d.ts
index 0a3397f5f..499bc3641 100644
--- a/dist/mathlive.d.ts
+++ b/dist/mathlive.d.ts
@@ -38,6 +38,7 @@ declare type MathFieldCallback = (mathfield: MathField) => void;
@property {boolean} keypressVibration?
@property {string} keypressSound?
@property {string} plonkSound?
+ @property {boolean} readOnly?
@property {"mathlive" | "sre"} textToSpeechRules?
@property {"ssml" | "mac"} textToSpeechMarkup?
@property {object} textToSpeechRulesOptions?
@@ -99,6 +100,7 @@ declare type MathFieldConfig = {
keypressVibration?: boolean;
keypressSound?: string;
plonkSound?: string;
+ readOnly?: boolean;
textToSpeechRules?: "mathlive" | "sre";
textToSpeechMarkup?: "ssml" | "mac";
textToSpeechRulesOptions?: any;
diff --git a/dist/mathlive.js b/dist/mathlive.js
index 2ad64bfd2..9bbdf1a78 100644
--- a/dist/mathlive.js
+++ b/dist/mathlive.js
@@ -6449,62 +6449,52 @@ var global, factory;
};
});
const vt = {
- '\\#': '#',
- '\\&': '&',
- '\\$': '$',
- '\\%': '%',
- '\\_': '_',
- '\\euro': '€',
- '\\maltese': '✠',
- '\\{': '{',
- '\\}': '}',
- '\\nobreakspace': ' ',
- '\\ldots': '…',
- '\\textellipsis': '…',
- '\\backslash': '\\',
- '`': '‘',
- "'": '’',
- '``': '“',
- "''": '”',
- '\\degree': '°',
- '\\textasciicircum': '^',
- '\\textasciitilde': '~',
- '\\textasteriskcentered': '*',
- '\\textbackslash': '\\',
- '\\textbraceleft': '{',
- '\\textbraceright': '}',
- '\\textbullet': '•',
- '\\textdollar': '$',
- '\\textsterling': '£',
- '–': '–',
- '—': '—',
- '‘': '‘',
- '’': '’',
- '“': '“',
- '”': '”',
- '"': '”',
- '\\ss': 'ß',
- '\\ae': 'æ',
- '\\oe': 'œ',
- '\\AE': 'Æ',
- '\\OE': 'Œ',
- '\\O': 'Ø',
- '\\i': 'ı',
- '\\j': 'ȷ',
- '\\aa': 'å',
- '\\AA': 'Å',
- },
- wt =
- 'undefined' != typeof navigator &&
- /firefox|edge/i.test(navigator.userAgent)
- ? /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/
- : new RegExp('\\p{Letter}', 'u'),
- St =
- 'undefined' != typeof navigator &&
- /firefox|edge/i.test(navigator.userAgent)
- ? /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/
- : new RegExp('[0-9\\p{Letter}]', 'u');
- var At = {
+ '\\#': '#',
+ '\\&': '&',
+ '\\$': '$',
+ '\\%': '%',
+ '\\_': '_',
+ '\\euro': '€',
+ '\\maltese': '✠',
+ '\\{': '{',
+ '\\}': '}',
+ '\\nobreakspace': ' ',
+ '\\ldots': '…',
+ '\\textellipsis': '…',
+ '\\backslash': '\\',
+ '`': '‘',
+ "'": '’',
+ '``': '“',
+ "''": '”',
+ '\\degree': '°',
+ '\\textasciicircum': '^',
+ '\\textasciitilde': '~',
+ '\\textasteriskcentered': '*',
+ '\\textbackslash': '\\',
+ '\\textbraceleft': '{',
+ '\\textbraceright': '}',
+ '\\textbullet': '•',
+ '\\textdollar': '$',
+ '\\textsterling': '£',
+ '–': '–',
+ '—': '—',
+ '‘': '‘',
+ '’': '’',
+ '“': '“',
+ '”': '”',
+ '"': '”',
+ '\\ss': 'ß',
+ '\\ae': 'æ',
+ '\\oe': 'œ',
+ '\\AE': 'Æ',
+ '\\OE': 'Œ',
+ '\\O': 'Ø',
+ '\\i': 'ı',
+ '\\j': 'ȷ',
+ '\\aa': 'å',
+ '\\AA': 'Å',
+ };
+ var wt = {
matchCodepoint: et,
commandAllowed: function(t, e) {
return (
@@ -6676,17 +6666,17 @@ var global, factory;
Set: '\\left\\lbrace #1 \\right\\rbrace',
},
COMMAND_MODE_CHARACTERS: /[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%#&^_" ]/,
- LETTER: wt,
- LETTER_AND_DIGITS: St,
+ LETTER: /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/,
+ LETTER_AND_DIGITS: /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓ󌜏źŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/,
};
- const Mt = $.makeSymbol,
- Ct = $.makeSpan,
- _t = $.makeVlist;
- function Tt(t, e, i, s, a, o) {
- const n = Mt('Size' + i + '-Regular', At.getValue('math', e)),
+ const St = $.makeSymbol,
+ At = $.makeSpan,
+ Mt = $.makeVlist;
+ function Ct(t, e, i, s, a, o) {
+ const n = St('Size' + i + '-Regular', wt.getValue('math', e)),
r = $.makeStyleWrap(
t,
- Ct(n, 'delimsizing size' + i),
+ At(n, 'delimsizing size' + i),
a.mathstyle,
M.TEXT,
o
@@ -6703,18 +6693,18 @@ var global, factory;
r
);
}
- function Lt(t, e) {
+ function _t(t, e) {
let i = '';
return (
'Size1-Regular' === e
? (i = ' delim-size1')
: 'Size4-Regular' === e && (i = ' delim-size4'),
- Ct(Mt(e, At.getValue('math', t)), 'delimsizinginner' + i)
+ At(St(e, wt.getValue('math', t)), 'delimsizinginner' + i)
);
}
- function Ft(t, e, i, s, a, o) {
+ function Tt(t, e, i, s, a, o) {
let n, r, l, c;
- (n = l = c = At.getValue('math', e)), (r = null);
+ (n = l = c = wt.getValue('math', e)), (r = null);
let h = 'Size1-Regular';
'\\vert' === e ||
'\\lvert' === e ||
@@ -6785,16 +6775,16 @@ var global, factory;
: '\\llcorner' === e
? ((c = '└'), (l = n = ' '))
: '\\lrcorner' === e && ((n = '┘'), (l = n = ' '));
- const d = m.getCharacterMetrics(At.getValue('math', n), h),
+ const d = m.getCharacterMetrics(wt.getValue('math', n), h),
p = d.height + d.depth,
- u = m.getCharacterMetrics(At.getValue('math', l), h),
+ u = m.getCharacterMetrics(wt.getValue('math', l), h),
f = u.height + u.depth,
- g = m.getCharacterMetrics(At.getValue('math', c), h),
+ g = m.getCharacterMetrics(wt.getValue('math', c), h),
y = g.height + g.depth;
let b = 0,
x = 1;
if (null !== r) {
- const t = m.getCharacterMetrics(At.getValue('math', r), h);
+ const t = m.getCharacterMetrics(wt.getValue('math', r), h);
(b = t.height + t.depth), (x = 2);
}
const k = p + y + b,
@@ -6804,29 +6794,29 @@ var global, factory;
s && (S *= a.mathstyle.sizeMultiplier);
const A = w / 2 - S,
C = [];
- if ((C.push(Lt(c, h)), null === r))
- for (let t = 0; t < v; t++) C.push(Lt(l, h));
+ if ((C.push(_t(c, h)), null === r))
+ for (let t = 0; t < v; t++) C.push(_t(l, h));
else {
- for (let t = 0; t < v; t++) C.push(Lt(l, h));
- C.push(Lt(r, h));
- for (let t = 0; t < v; t++) C.push(Lt(l, h));
+ for (let t = 0; t < v; t++) C.push(_t(l, h));
+ C.push(_t(r, h));
+ for (let t = 0; t < v; t++) C.push(_t(l, h));
}
- C.push(Lt(n, h));
- const _ = _t(a, C, 'bottom', A);
+ C.push(_t(n, h));
+ const _ = Mt(a, C, 'bottom', A);
return (
_.setStyle('color', a.color),
'number' == typeof a.opacity &&
_.setStyle('opacity', a.opacity),
$.makeStyleWrap(
t,
- Ct(_, 'delimsizing mult'),
+ At(_, 'delimsizing mult'),
a.mathstyle,
M.TEXT,
o
)
);
}
- const Dt = [
+ const Lt = [
'(',
')',
'[',
@@ -6843,7 +6833,7 @@ var global, factory;
'\\rceil',
'\\surd',
],
- zt = [
+ Ft = [
'\\uparrow',
'\\downarrow',
'\\updownarrow',
@@ -6865,7 +6855,7 @@ var global, factory;
'\\lmoustache',
'\\rmoustache',
],
- Et = [
+ Dt = [
'<',
'>',
'\\langle',
@@ -6875,8 +6865,8 @@ var global, factory;
'\\lt',
'\\gt',
],
- qt = [0, 1.2, 1.8, 2.4, 3],
- Pt = [
+ zt = [0, 1.2, 1.8, 2.4, 3],
+ Et = [
{ type: 'small', mathstyle: M.SCRIPTSCRIPT },
{ type: 'small', mathstyle: M.SCRIPT },
{ type: 'small', mathstyle: M.TEXT },
@@ -6885,13 +6875,13 @@ var global, factory;
{ type: 'large', size: 3 },
{ type: 'large', size: 4 },
],
- It = [
+ qt = [
{ type: 'small', mathstyle: M.SCRIPTSCRIPT },
{ type: 'small', mathstyle: M.SCRIPT },
{ type: 'small', mathstyle: M.TEXT },
{ type: 'stack' },
],
- Bt = [
+ Pt = [
{ type: 'small', mathstyle: M.SCRIPTSCRIPT },
{ type: 'small', mathstyle: M.SCRIPT },
{ type: 'small', mathstyle: M.TEXT },
@@ -6901,13 +6891,13 @@ var global, factory;
{ type: 'large', size: 4 },
{ type: 'stack' },
];
- function Ot(t, e, i, s, a, o) {
- if (!e || 0 === e.length || '.' === e) return Rt(t, a, t);
+ function It(t, e, i, s, a, o) {
+ if (!e || 0 === e.length || '.' === e) return Bt(t, a, t);
let n;
'<' === e || '\\lt' === e
? (e = '\\langle')
: ('>' !== e && '\\gt' !== e) || (e = '\\rangle'),
- (n = Et.includes(e) ? Pt : Dt.includes(e) ? Bt : It);
+ (n = Dt.includes(e) ? Et : Lt.includes(e) ? Pt : qt);
const r = (function(t, e, i, s) {
for (
let o = Math.min(2, 3 - s.mathstyle.size);
@@ -6934,10 +6924,10 @@ var global, factory;
}
var a;
return i[i.length - 1];
- })(At.getValue('math', e), i, n, a);
+ })(wt.getValue('math', e), i, n, a);
return 'small' === r.type
? (function(t, e, i, s, a, o) {
- const n = Mt('AMS-Regular', At.getValue('math', e)),
+ const n = St('AMS-Regular', wt.getValue('math', e)),
r = $.makeStyleWrap(t, n, a.mathstyle, i, o);
return (
s &&
@@ -6954,10 +6944,10 @@ var global, factory;
);
})(t, e, r.mathstyle, s, a, o)
: 'large' === r.type
- ? Tt(t, e, r.size, s, a, o)
- : Ft(t, e, i, s, a, o);
+ ? Ct(t, e, r.size, s, a, o)
+ : Tt(t, e, i, s, a, o);
}
- function Rt(t, e, i) {
+ function Bt(t, e, i) {
return $.makeSpanOfType(
t,
'',
@@ -6967,22 +6957,22 @@ var global, factory;
(i || '')
);
}
- var Kt = {
+ var Ot = {
makeSizedDelim: function(t, e, i, s, a) {
return '.' === e
- ? Rt(t, s, a)
+ ? Bt(t, s, a)
: ('<' === e || '\\lt' === e
? (e = '\\langle')
: ('>' !== e && '\\gt' !== e) || (e = '\\rangle'),
- Dt.includes(e) || Et.includes(e)
- ? Tt(t, e, i, !1, s, a)
- : zt.includes(e)
- ? Ft(t, e, qt[i], !1, s, a)
+ Lt.includes(e) || Dt.includes(e)
+ ? Ct(t, e, i, !1, s, a)
+ : Ft.includes(e)
+ ? Tt(t, e, zt[i], !1, s, a)
: null);
},
- makeCustomSizedDelim: Ot,
+ makeCustomSizedDelim: It,
makeLeftRightDelim: function(t, e, i, s, a, o) {
- if ('.' === e) return Rt(t, a, o);
+ if ('.' === e) return Bt(t, a, o);
const n =
a.mathstyle.metrics.axisHeight *
a.mathstyle.sizeMultiplier,
@@ -6992,18 +6982,18 @@ var global, factory;
c = Math.max(l, c);
let h = (901 * c) / 500;
return (
- (l = 2 * c - r), (h = Math.max(h, l)), Ot(t, e, h, !0, a, o)
+ (l = 2 * c - r), (h = Math.max(h, l)), It(t, e, h, !0, a, o)
);
},
};
- const Nt = $.makeSpan,
- $t = $.makeOrd,
- Wt = $.makeInner,
- Ht = $.makeHlist,
- Vt = $.makeVlist,
- Ut = /\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,
- jt = /^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,
- Gt = {
+ const Rt = $.makeSpan,
+ Kt = $.makeOrd,
+ Nt = $.makeInner,
+ $t = $.makeHlist,
+ Wt = $.makeVlist,
+ Ht = /\u0393|\u0394|\u0398|\u039b|\u039E|\u03A0|\u03A3|\u03a5|\u03a6|\u03a8|\u03a9|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5/,
+ Vt = /^([A-Za-z]|[\u03b1-\u03c9]|\u03d1|\u03d5|\u03d6|\u03f1|\u03f5)$/,
+ Ut = {
size1: 0.5,
size2: 0.7,
size3: 0.8,
@@ -7015,7 +7005,7 @@ var global, factory;
size9: 2.07,
size10: 2.49,
};
- class Zt {
+ class jt {
constructor(t, e, i, s) {
(this.mode = t),
(this.type = e),
@@ -7049,16 +7039,16 @@ var global, factory;
'none' === this.backgroundColor &&
(this.backgroundColor = ''),
'auto' === this.fontSize && (this.fontSize = ''),
- this.fontSize && (this.maxFontSize = Gt[this.fontSize]),
+ this.fontSize && (this.maxFontSize = Ut[this.fontSize]),
'math' === this.mode)
) {
const t = 'string' == typeof this.body ? this.body : '';
(this.autoFontFamily = 'cmr'),
- jt.test(t)
+ Vt.test(t)
? (this.autoFontFamily = 'math')
: /\\imath|\\jmath|\\pounds/.test(t)
? (this.autoFontFamily = 'mainit')
- : Ut.test(t) ||
+ : Ht.test(t) ||
'math' !== this.baseFontFamily ||
(this.autoFontFamily = 'cmr');
} else
@@ -7132,7 +7122,7 @@ var global, factory;
}
decomposeGroup(t) {
const e = t.clone({ mathstyle: this.mathstyle }),
- i = $t(Qt(e, this.body));
+ i = Kt(Jt(e, this.body));
return (
this.cssId && (i.cssId = this.cssId),
i.applyStyle({
@@ -7189,11 +7179,11 @@ var global, factory;
const h = [];
for (let e = 0; e < s.length; ++e) {
const i =
- Qt(
+ Jt(
t.clone({ mathstyle: this.mathstyle }),
s[e]
) || [],
- n = [$t(null)].concat(i);
+ n = [Kt(null)].concat(i);
(o = Math.max(o, $.depth(n))),
(a = Math.max(a, $.height(n))),
h.push(n);
@@ -7222,7 +7212,7 @@ var global, factory;
i.push(s),
i.push(t.pos - m));
}
- i.length > 0 && u.push(Vt(t, i, 'individualShift'));
+ i.length > 0 && u.push(Wt(t, i, 'individualShift'));
}
const f = [];
let g = !1,
@@ -7233,22 +7223,22 @@ var global, factory;
if (i.align && b >= u.length) break;
if (i.align && b < u.length)
g
- ? f.push(Xt(2 * h.arraycolsep))
- : (y || x) && f.push(Xt(h.arraycolsep)),
- f.push(Nt(u[b], 'col-align-' + i.align)),
+ ? f.push(Gt(2 * h.arraycolsep))
+ : (y || x) && f.push(Gt(h.arraycolsep)),
+ f.push(Rt(u[b], 'col-align-' + i.align)),
b++,
(g = !0),
(y = !1),
(x = !1);
else if (void 0 !== i.gap)
'number' == typeof i.gap
- ? f.push(Xt(i.gap))
- : f.push(Jt(t, d, m, i.gap)),
+ ? f.push(Gt(i.gap))
+ : f.push(Zt(t, d, m, i.gap)),
(g = !1),
(y = !1),
(x = !1);
else if (i.rule) {
- const e = Nt(null, 'vertical-separator');
+ const e = Rt(null, 'vertical-separator');
e.setStyle('height', l, 'em'),
e.setStyle(
'margin-top',
@@ -7268,25 +7258,25 @@ var global, factory;
}
}
if (
- (g && !this.rFence && f.push(Xt(h.arraycolsep)),
+ (g && !this.rFence && f.push(Gt(h.arraycolsep)),
!(
(this.lFence && '.' !== this.lFence) ||
(this.rFence && '.' !== this.rFence)
))
)
- return $t(f, 'mtable');
- const k = Nt(f, 'mtable'),
+ return Kt(f, 'mtable');
+ const k = Rt(f, 'mtable'),
v = $.height(k),
w = $.depth(k);
- return $t([
+ return Kt([
this.bind(
t,
- Kt.makeLeftRightDelim('mopen', this.lFence, v, w, t)
+ Ot.makeLeftRightDelim('mopen', this.lFence, v, w, t)
),
k,
this.bind(
t,
- Kt.makeLeftRightDelim('mclose', this.rFence, v, w, t)
+ Ot.makeLeftRightDelim('mclose', this.rFence, v, w, t)
),
]);
}
@@ -7297,15 +7287,15 @@ var global, factory;
: M.toMathstyle(this.mathstyle),
i = t.clone({ mathstyle: e });
let s = [];
- this.numerPrefix && s.push($t(this.numerPrefix));
+ this.numerPrefix && s.push(Kt(this.numerPrefix));
const a = this.continuousFraction ? e : e.fracNum();
- s = s.concat(Qt(i.clone({ mathstyle: a }), this.numer));
- const o = Ht(s, t.mathstyle.adjustTo(a));
+ s = s.concat(Jt(i.clone({ mathstyle: a }), this.numer));
+ const o = $t(s, t.mathstyle.adjustTo(a));
let n = [];
- this.denomPrefix && n.push($t(this.denomPrefix));
+ this.denomPrefix && n.push(Kt(this.denomPrefix));
const r = this.continuousFraction ? e : e.fracDen();
- n = n.concat(Qt(i.clone({ mathstyle: r }), this.denom));
- const l = Ht(n, t.mathstyle.adjustTo(r)),
+ n = n.concat(Jt(i.clone({ mathstyle: r }), this.denom));
+ const l = $t(n, t.mathstyle.adjustTo(r)),
c = this.hasBarLine
? h.defaultRuleThickness / e.sizeMultiplier
: 0;
@@ -7325,21 +7315,21 @@ var global, factory;
if (0 === c) {
const t = d - u - (f - m);
t < p && ((d += 0.5 * (p - t)), (m += 0.5 * (p - t))),
- (g = Vt(i, [o, -d, l, m], 'individualShift'));
+ (g = Wt(i, [o, -d, l, m], 'individualShift'));
} else {
const t = e.metrics.axisHeight;
d - u - (t + 0.5 * c) < p &&
(d += p - (d - u - (t + 0.5 * c))),
t - 0.5 * c - (f - m) < p &&
(m += p - (t - 0.5 * c - (f - m)));
- const s = Nt(null, ' frac-line');
+ const s = Rt(null, ' frac-line');
s.applyStyle(this.getStyle()), (s.height = c);
const a = [];
o && (a.push(o), a.push(-d)),
a.push(s),
a.push(c / 2 - t),
l && (a.push(l), a.push(m)),
- (g = Vt(i, a, 'individualShift'));
+ (g = Wt(i, a, 'individualShift'));
}
(g.classes += ' mfrac'),
(g.height *= e.sizeMultiplier / t.mathstyle.sizeMultiplier),
@@ -7350,7 +7340,7 @@ var global, factory;
: e.metrics.delim2,
b = this.bind(
t,
- Kt.makeCustomSizedDelim(
+ Ot.makeCustomSizedDelim(
'mopen',
this.leftDelim,
y,
@@ -7360,7 +7350,7 @@ var global, factory;
),
x = this.bind(
t,
- Kt.makeCustomSizedDelim(
+ Ot.makeCustomSizedDelim(
'mclose',
this.rightDelim,
y,
@@ -7369,7 +7359,7 @@ var global, factory;
)
);
b.applyStyle(this.getStyle()), x.applyStyle(this.getStyle());
- const k = $t(
+ const k = Kt(
[b, g, x],
t.parentSize !== t.size
? 'sizing reset-' + t.parentSize + ' ' + t.size
@@ -7380,12 +7370,12 @@ var global, factory;
decomposeLeftright(t) {
if (!this.body)
return this.leftDelim
- ? new Zt('math', 'mopen', this.leftDelim).decompose(t)
+ ? new jt('math', 'mopen', this.leftDelim).decompose(t)
: this.rightDelim
- ? new Zt('math', 'mclose', this.rightDelim).decompose(t)
+ ? new jt('math', 'mclose', this.rightDelim).decompose(t)
: null;
const e = t.clone(),
- i = Qt(e, this.body),
+ i = Jt(e, this.body),
s = e.mathstyle;
let a = 0,
o = 0,
@@ -7397,7 +7387,7 @@ var global, factory;
(n.push(
this.bind(
t,
- Kt.makeLeftRightDelim(
+ Ot.makeLeftRightDelim(
'mopen',
this.leftDelim,
a,
@@ -7415,7 +7405,7 @@ var global, factory;
r = /ML__selected/.test(i[s].classes);
(i[s] = this.bind(
t,
- Kt.makeLeftRightDelim(
+ Ot.makeLeftRightDelim(
'minner',
i[s].delim,
a,
@@ -7455,16 +7445,16 @@ var global, factory;
n.push(
this.bind(
t,
- Kt.makeLeftRightDelim('mclose', s, a, o, e, i)
+ Ot.makeLeftRightDelim('mclose', s, a, o, e, i)
)
),
n[n.length - 1].applyStyle(this.getStyle());
}
- return this.inner ? Wt(n, s.cls()) : n;
+ return this.inner ? Nt(n, s.cls()) : n;
}
decomposeSurd(t) {
const e = t.mathstyle,
- i = Qt(t.cramp(), this.body),
+ i = Jt(t.cramp(), this.body),
s = h.defaultRuleThickness / e.sizeMultiplier;
let a = s;
e.id < M.TEXT.id && (a = e.metrics.xHeight);
@@ -7475,8 +7465,8 @@ var global, factory;
($.height(i) + $.depth(i)) * e.sizeMultiplier
) +
(o + s),
- r = Nt(
- Kt.makeCustomSizedDelim('', '\\surd', n, !1, t),
+ r = Rt(
+ Ot.makeCustomSizedDelim('', '\\surd', n, !1, t),
'sqrt-sign'
);
r.applyStyle(this.getStyle());
@@ -7484,22 +7474,22 @@ var global, factory;
l > $.height(i) + $.depth(i) + o &&
(o = (o + l - ($.height(i) + $.depth(i))) / 2),
r.setTop(r.height - $.height(i) - (o + s));
- const c = Nt(null, t.mathstyle.adjustTo(M.TEXT) + ' sqrt-line');
+ const c = Rt(null, t.mathstyle.adjustTo(M.TEXT) + ' sqrt-line');
c.applyStyle(this.getStyle()), (c.height = s);
- const d = Vt(t, [i, o, c, s]);
- if (!this.index) return this.bind(t, $t([r, d], 'sqrt'));
+ const d = Wt(t, [i, o, c, s]);
+ if (!this.index) return this.bind(t, Kt([r, d], 'sqrt'));
const p = t.clone({ mathstyle: M.SCRIPTSCRIPT }),
- m = Nt(Qt(p, this.index), e.adjustTo(M.SCRIPTSCRIPT)),
+ m = Rt(Jt(p, this.index), e.adjustTo(M.SCRIPTSCRIPT)),
u = Math.max(r.height, d.height),
f = Math.max(r.depth, d.depth),
- g = Vt(t, [m], 'shift', -0.6 * (u - f));
- return this.bind(t, $t([Nt(g, 'root'), r, d], 'sqrt'));
+ g = Wt(t, [m], 'shift', -0.6 * (u - f));
+ return this.bind(t, Kt([Rt(g, 'root'), r, d], 'sqrt'));
}
decomposeAccent(t) {
const e = t.mathstyle;
- let i = Qt(t.cramp(), this.body);
+ let i = Jt(t.cramp(), this.body);
(this.superscript || this.subscript) &&
- (i = this.attachSupsub(t, $t(i), 'mord'));
+ (i = this.attachSupsub(t, Kt(i), 'mord'));
let s = 0;
Array.isArray(this.body) &&
1 === this.body.length &&
@@ -7509,18 +7499,18 @@ var global, factory;
o = $.makeSymbol('Main-Regular', this.accent, 'math');
o.italic = 0;
const n = '⃗' === this.accent ? ' accent-vec' : '';
- let r = Nt(Nt(o), 'accent-body' + n);
+ let r = Rt(Rt(o), 'accent-body' + n);
return (
- (r = Vt(t, [i, -a, r])),
+ (r = Wt(t, [i, -a, r])),
r.children[1].setLeft(2 * s),
- $t(r, 'accent')
+ Kt(r, 'accent')
);
}
decomposeLine(t) {
const e = t.mathstyle,
- i = Qt(t.cramp(), this.body),
+ i = Jt(t.cramp(), this.body),
s = h.defaultRuleThickness / e.sizeMultiplier,
- a = Nt(
+ a = Rt(
null,
t.mathstyle.adjustTo(M.TEXT) +
' ' +
@@ -7533,40 +7523,40 @@ var global, factory;
(a.maxFontSize = 1),
'overline' === this.position)
)
- o = Vt(t, [i, 3 * s, a, s]);
+ o = Wt(t, [i, 3 * s, a, s]);
else {
- const e = Nt(i);
- o = Vt(t, [s, a, 3 * s, e], 'top', $.height(e));
+ const e = Rt(i);
+ o = Wt(t, [s, a, 3 * s, e], 'top', $.height(e));
}
- return $t(o, this.position);
+ return Kt(o, this.position);
}
decomposeOverunder(t) {
- const e = Qt(t, this.body),
+ const e = Jt(t, this.body),
i = t.clone({ mathstyle: 'scriptstyle' }),
s = this.overscript
- ? Nt(
- Qt(i, this.overscript),
+ ? Rt(
+ Jt(i, this.overscript),
t.mathstyle.adjustTo(i.mathstyle)
)
: null,
a = this.underscript
- ? Nt(
- Qt(i, this.underscript),
+ ? Rt(
+ Jt(i, this.underscript),
t.mathstyle.adjustTo(i.mathstyle)
)
: null;
- return Yt(t, e, 0, 0, s, a, this.mathtype || 'mrel');
+ return Xt(t, e, 0, 0, s, a, this.mathtype || 'mrel');
}
decomposeOverlap(t) {
- const e = Nt(Qt(t, this.body), 'inner');
- return $t(
- [e, Nt(null, 'fix')],
+ const e = Rt(Jt(t, this.body), 'inner');
+ return Kt(
+ [e, Rt(null, 'fix')],
'left' === this.align ? 'llap' : 'rlap'
);
}
decomposeRule(t) {
const e = t.mathstyle,
- i = $t('', 'rule');
+ i = Kt('', 'rule');
let s = this.shift && !isNaN(this.shift) ? this.shift : 0;
s /= e.sizeMultiplier;
const a = this.width / e.sizeMultiplier,
@@ -7607,7 +7597,7 @@ var global, factory;
this.bind(t, i);
} else
Array.isArray(this.body)
- ? ((i = $.makeOp(Qt(t, this.body))), this.bind(t, i))
+ ? ((i = $.makeOp(Jt(t, this.body))), this.bind(t, i))
: (i = this.makeSpan(t, this.body));
if (this.superscript || this.subscript) {
const s = this.limits || 'auto';
@@ -7620,8 +7610,8 @@ var global, factory;
return this.symbol && i.setTop(a), i;
}
decomposeBox(t) {
- const e = $t(Qt(t, this.body)),
- i = Nt();
+ const e = Kt(Jt(t, this.body)),
+ i = Rt();
i.setStyle('position', 'absolute');
const s =
'number' == typeof this.padding ? this.padding : h.fboxsep;
@@ -7643,7 +7633,7 @@ var global, factory;
e.setStyle('display', 'inline-block'),
e.setStyle('height', e.height + e.depth, 'em'),
e.setStyle('vertical-align', -e.depth + s, 'em');
- const a = Nt([i, e]);
+ const a = Rt([i, e]);
return (
a.setStyle('position', 'relative'),
a.setStyle('vertical-align', -s + e.depth, 'em'),
@@ -7655,7 +7645,7 @@ var global, factory;
);
}
decomposeEnclose(t) {
- const e = $t(Qt(t, this.body)),
+ const e = Kt(Jt(t, this.body)),
i = 'auto' === this.padding ? 0.2 : this.padding;
e.setStyle('padding', i, 'em'),
e.setStyle('display', 'inline-block'),
@@ -7747,7 +7737,7 @@ var global, factory;
(i =
'string' == typeof this.body
? this.makeSpan(t, this.body)
- : this.makeSpan(t, Qt(t, this.body))),
+ : this.makeSpan(t, Jt(t, this.body))),
(i.type = this.type);
else if ('group' === this.type || 'root' === this.type)
i = this.decomposeGroup(t);
@@ -7758,11 +7748,11 @@ var global, factory;
else if ('leftright' === this.type)
i = this.decomposeLeftright(t);
else if ('delim' === this.type)
- (i = Nt(null, '')), (i.delim = this.delim);
+ (i = Rt(null, '')), (i.delim = this.delim);
else if ('sizeddelim' === this.type)
i = this.bind(
t,
- Kt.makeSizedDelim(this.cls, this.delim, this.size, t)
+ Ot.makeSizedDelim(this.cls, this.delim, this.size, t)
);
else if ('line' === this.type) i = this.decomposeLine(t);
else if ('overunder' === this.type)
@@ -7771,7 +7761,7 @@ var global, factory;
else if ('rule' === this.type) i = this.decomposeRule(t);
else if ('styling' === this.type);
else if ('msubsup' === this.type)
- (i = $t('')),
+ (i = Kt('')),
e && ((i.height = e[0].height), (i.depth = e[0].depth));
else if ('mop' === this.type) i = this.decomposeOp(t);
else if ('space' === this.type) i = this.makeSpan(t, ' ');
@@ -7783,7 +7773,7 @@ var global, factory;
? this.makeSpan(t, ' ')
: this.makeSpan(t, ' ');
else if (this.width)
- (i = Nt('', 'mspace ')),
+ (i = Rt('', 'mspace ')),
this.width > 0
? i.setWidth(this.width)
: i.setStyle('margin-left', this.width, 'em');
@@ -7798,7 +7788,7 @@ var global, factory;
',': 'thinspace',
'!': 'negativethinspace',
}[this.body] || 'quad';
- i = Nt('', 'mspace ' + t);
+ i = Rt('', 'mspace ' + t);
}
else
'mathstyle' === this.type
@@ -7840,12 +7830,12 @@ var global, factory;
let a = null,
o = null;
if (this.superscript) {
- const e = Qt(t.sup(), this.superscript);
- a = Nt(e, s.adjustTo(s.sup()));
+ const e = Jt(t.sup(), this.superscript);
+ a = Rt(e, s.adjustTo(s.sup()));
}
if (this.subscript) {
- const e = Qt(t.sub(), this.subscript);
- o = Nt(e, s.adjustTo(s.sub()));
+ const e = Jt(t.sub(), this.subscript);
+ o = Rt(e, s.adjustTo(s.sub()));
}
let n,
r = 0,
@@ -7871,7 +7861,7 @@ var global, factory;
const t = 0.8 * s.metrics.xHeight - (r - $.depth(a));
t > 0 && ((r += t), (l -= t));
}
- (p = Vt(t, [o, l, a, -r], 'individualShift')),
+ (p = Wt(t, [o, l, a, -r], 'individualShift')),
this.symbol && p.children[0].setLeft(-$.italic(e));
} else
o && !a
@@ -7880,7 +7870,7 @@ var global, factory;
s.metrics.sub1,
$.height(o) - 0.8 * s.metrics.xHeight
)),
- (p = Vt(t, [o], 'shift', l)),
+ (p = Wt(t, [o], 'shift', l)),
p.children[0].setRight(d),
this.isCharacterBox() &&
p.children[0].setLeft(-$.italic(e)))
@@ -7891,9 +7881,9 @@ var global, factory;
n,
a.depth + 0.25 * s.metrics.xHeight
)),
- (p = Vt(t, [a], 'shift', -r)),
+ (p = Wt(t, [a], 'shift', -r)),
p.children[0].setRight(d));
- const m = Nt(p, 'msubsup');
+ const m = Rt(p, 'msubsup');
return (
this.caret && (m.caret = this.caret),
$.makeSpanOfType(i, [e, m])
@@ -7901,18 +7891,18 @@ var global, factory;
}
attachLimits(t, e, i, s) {
const a = this.superscript
- ? Nt(
- Qt(t.sup(), this.superscript),
+ ? Rt(
+ Jt(t.sup(), this.superscript),
t.mathstyle.adjustTo(t.mathstyle.sup())
)
: null,
o = this.subscript
- ? Nt(
- Qt(t.sub(), this.subscript),
+ ? Rt(
+ Jt(t.sub(), this.subscript),
t.mathstyle.adjustTo(t.mathstyle.sub())
)
: null;
- return Yt(t, e, i, s, a, o, 'mop');
+ return Xt(t, e, i, s, a, o, 'mop');
}
bind(t, e) {
return (
@@ -7976,24 +7966,24 @@ var global, factory;
);
}
}
- function Xt(t) {
- const e = Nt('', 'arraycolsep');
+ function Gt(t) {
+ const e = Rt('', 'arraycolsep');
return e.setWidth(t, 'em'), e;
}
- function Jt(t, e, i, s) {
+ function Zt(t, e, i, s) {
const a = [];
for (const o of e) {
- const e = Nt(Qt(t, s));
+ const e = Rt(Jt(t, s));
(e.depth = o.depth),
(e.height = o.height),
a.push(e),
a.push(o.pos - i);
}
- return Vt(t, a, 'individualShift');
+ return Wt(t, a, 'individualShift');
}
- function Yt(t, e, i, s, a, o, n) {
+ function Xt(t, e, i, s, a, o, n) {
if (!a && !o) return e;
- e = Nt(e);
+ e = Rt(e);
let r = 0,
l = 0;
a && (r = Math.max(h.bigOpSpacing1, h.bigOpSpacing3 - a.depth)),
@@ -8008,7 +7998,7 @@ var global, factory;
l +
$.depth(e) +
i;
- (c = Vt(
+ (c = Wt(
t,
[h.bigOpSpacing5, o, l, e, r, a, h.bigOpSpacing5],
'bottom',
@@ -8018,16 +8008,16 @@ var global, factory;
c.children[2].setLeft(s);
} else if (o && !a) {
const a = $.height(e) - i;
- (c = Vt(t, [h.bigOpSpacing5, o, l, e], 'top', a)),
+ (c = Wt(t, [h.bigOpSpacing5, o, l, e], 'top', a)),
c.children[0].setLeft(-s);
} else if (!o && a) {
const o = $.depth(e) + i;
- (c = Vt(t, [e, r, a, h.bigOpSpacing5], 'bottom', o)),
+ (c = Wt(t, [e, r, a, h.bigOpSpacing5], 'bottom', o)),
c.children[1].setLeft(s);
}
return $.makeSpanOfType(n, c, 'op-limits');
}
- function Qt(t, e) {
+ function Jt(t, e) {
function i(t) {
return 'mord' === t.type && /[0-9,.]/.test(t.latex);
}
@@ -8107,25 +8097,25 @@ var global, factory;
for (const t of o) (t.height *= e), (t.depth *= e);
}
if (t.size !== t.parentSize) {
- const e = Gt[t.size] / Gt[t.parentSize];
+ const e = Ut[t.size] / Ut[t.parentSize];
for (const t of o) (t.height *= e), (t.depth *= e);
}
return o;
}
- var te = {
- MathAtom: Zt,
- decompose: Qt,
+ var Yt = {
+ MathAtom: jt,
+ decompose: Jt,
makeRoot: function(t, e) {
- const i = new Zt((t = t || 'math'), 'root', e || []);
+ const i = new jt((t = t || 'math'), 'root', e || []);
return (
(0 !== i.body.length && 'first' === i.body[0].type) ||
- i.body.unshift(new Zt('', 'first')),
+ i.body.unshift(new jt('', 'first')),
i
);
},
- GREEK_REGEX: Ut,
+ GREEK_REGEX: Ht,
};
- const ee = {
+ const Qt = {
m0: '#3f3d99',
m1: '#993d71',
m2: '#998b3d',
@@ -8137,7 +8127,7 @@ var global, factory;
m8: '#3d7999',
m9: '#843d99',
},
- ie = {
+ te = {
apricot: '#FBB982',
aquamarine: '#00B5BE',
bittersweet: '#C04F17',
@@ -8207,7 +8197,7 @@ var global, factory;
yellowgreen: '#98CC70',
yelloworange: '#FAA21A',
};
- var se = function(t) {
+ var ee = function(t) {
const e = t.toLowerCase().split('!');
let i,
s,
@@ -8222,7 +8212,7 @@ var global, factory;
(i = o), (s = n), (a = r);
let c = e[t].match(/([a-z0-9]*)/);
c && (c = c[1]);
- let h = ie[c] || ee[c];
+ let h = te[c] || Qt[c];
h || (h = e[t]);
let d = h.match(
/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i
@@ -8278,21 +8268,21 @@ var global, factory;
('00' + Math.round(r).toString(16)).slice(-2)
);
},
- ae = function(t) {
+ ie = function(t) {
let e = t.toUpperCase();
- for (const t in ie)
- if (ie[t] === e) {
+ for (const t in te)
+ if (te[t] === e) {
e = t;
break;
}
- for (const t in ee)
- if (ee[t] === e) {
+ for (const t in Qt)
+ if (Qt[t] === e) {
e = t;
break;
}
return e;
},
- oe = [
+ se = [
'#d35d60',
'#7293cb',
'#e1974d',
@@ -8306,7 +8296,7 @@ var global, factory;
'#d4d5d2',
'#ffffff',
],
- ne = [
+ ae = [
'#cc2428',
'#3769b1',
'#da7e30',
@@ -8320,8 +8310,8 @@ var global, factory;
'#adafaa',
'#ffffff',
];
- const re = te.MathAtom;
- class le {
+ const oe = Yt.MathAtom;
+ class ne {
constructor(t, e, i) {
(this.tokens = t),
(this.index = 0),
@@ -8365,7 +8355,7 @@ var global, factory;
? 'none'
: this.mathList[this.mathList.length - 1].type;
if ('mop' !== t && 'msubsup' !== t) {
- const t = new re(this.parseMode, 'msubsup', '');
+ const t = new oe(this.parseMode, 'msubsup', '');
(t.attributes = { 'aria-hidden': !0 }),
this.mathList.push(t);
}
@@ -8403,7 +8393,7 @@ var global, factory;
t < this.tokens.length &&
'command' === this.tokens[t].type
) {
- const e = At.getInfo(
+ const e = wt.getInfo(
'\\' + this.tokens[t].value,
this.parseMode,
this.macros
@@ -8434,13 +8424,13 @@ var global, factory;
}
placeholder() {
if (this.args && 'string' == typeof this.args['?'])
- return ce(
+ return re(
n(this.args['?']),
this.parseMode,
null,
this.macros
);
- const t = new re(
+ const t = new oe(
this.parseMode,
'placeholder',
'?',
@@ -8516,7 +8506,7 @@ var global, factory;
return t;
}
scanColor() {
- return se(this.scanString());
+ return ee(this.scanString());
}
scanNumber(t) {
const e = this.parseLiteral('-');
@@ -8612,7 +8602,7 @@ var global, factory;
)
return null;
const e = this.swapParseMode('math'),
- i = new re('math', 'group');
+ i = new oe('math', 'group');
return (
(i.mathstyle = ')' === t ? 'textstyle' : 'displaystyle'),
(i.body = this.scanImplicitGroup(
@@ -8626,7 +8616,7 @@ var global, factory;
scanModeShift() {
if (!this.hasToken('$') && !this.hasToken('$$')) return null;
const t = this.get().type,
- e = new re('math', 'group');
+ e = new oe('math', 'group');
(e.mathstyle = '$' === t ? 'textstyle' : 'displaystyle'),
(e.latexOpen = 'textstyle' === e.mathstyle ? '$' : '$$'),
(e.latexClose = e.latexOpen);
@@ -8641,7 +8631,7 @@ var global, factory;
scanEnvironment() {
if (!this.parseCommand('begin')) return null;
const t = this.scanArg('string'),
- e = At.getEnvironmentInfo(t),
+ e = wt.getEnvironmentInfo(t),
i = [];
if (e && e.params)
for (const t of e.params)
@@ -8692,7 +8682,7 @@ var global, factory;
)
return null;
if (e.tabular && 0 === n.length) return null;
- const d = new re(
+ const d = new oe(
this.parseMode,
'array',
h,
@@ -8727,7 +8717,7 @@ var global, factory;
])
) {
this.parseMode = 'math';
- const t = new re('math', 'mathstyle');
+ const t = new oe('math', 'mathstyle');
(t.mathstyle = this.get().value), this.mathList.push(t);
} else
this.hasInfixCommand() && !i
@@ -8736,10 +8726,10 @@ var global, factory;
let o;
if (i) {
const t = this.swapMathList(a),
- e = At.getInfo('\\' + i.value, 'math', this.macros);
+ e = wt.getInfo('\\' + i.value, 'math', this.macros);
o = e
? [
- new re(
+ new oe(
this.parseMode,
e.type,
e.value || i.value,
@@ -8748,13 +8738,13 @@ var global, factory;
: null
),
]
- : [new re(this.parseMode, 'mop', i.value)];
+ : [new oe(this.parseMode, 'mop', i.value)];
} else o = this.swapMathList(a);
return (this.style = e), o;
}
scanGroup() {
if (!this.parseToken('{')) return null;
- const t = new re(this.parseMode, 'group');
+ const t = new oe(this.parseMode, 'group');
return (
(t.body = this.scanImplicitGroup(t => '}' === t.type)),
this.parseToken('}'),
@@ -8766,7 +8756,7 @@ var global, factory;
scanSmartFence() {
if ((this.skipWhitespace(), !this.parseLiteral('(')))
return null;
- const t = new re(this.parseMode, 'leftright');
+ const t = new oe(this.parseMode, 'leftright');
(t.leftDelim = '('), (t.inner = !1);
const e = this.swapMathList([]);
let i = 1;
@@ -8789,7 +8779,7 @@ var global, factory;
'command' === t.type
? (e = '\\' + t.value)
: 'literal' === t.type && (e = t.value);
- const i = At.getInfo(e, 'math', this.macros);
+ const i = wt.getInfo(e, 'math', this.macros);
return i
? 'mopen' === i.type || 'mclose' === i.type
? e
@@ -8815,7 +8805,7 @@ var global, factory;
for (; !this.end() && !this.parseCommand(e); ) this.parseAtom();
this.style = t;
const a = this.scanDelim(),
- o = new re(this.parseMode, 'leftright');
+ o = new oe(this.parseMode, 'leftright');
return (
(o.leftDelim = i),
(o.rightDelim = a),
@@ -8852,7 +8842,7 @@ var global, factory;
const e = this.lastMathAtom();
(e.superscript = e.superscript || []),
e.superscript.push(
- new re(e.parseMode, 'mord', '′')
+ new oe(e.parseMode, 'mord', '′')
),
(t = !0);
}
@@ -8894,7 +8884,7 @@ var global, factory;
.trim()
.split(/,(?![^(]*\)(?:(?:[^(]*\)){2})*[^"]*$)/);
for (const e of t) {
- const t = se(e);
+ const t = ee(e);
if (t) (s = s || {}), (s.backgroundcolor = t);
else {
const t = e.match(
@@ -8985,13 +8975,13 @@ var global, factory;
let e = null;
if ('space' === t.type)
'text' === this.parseMode &&
- (e = new re('text', '', ' ', this.style));
+ (e = new oe('text', '', ' ', this.style));
else if ('placeholder' === t.type)
- (e = new re(this.parseMode, 'placeholder', t.value)),
+ (e = new oe(this.parseMode, 'placeholder', t.value)),
(e.captureSelection = !0);
else if ('command' === t.type) {
if ('placeholder' === t.value)
- (e = new re(
+ (e = new oe(
this.parseMode,
'placeholder',
this.scanArg('string'),
@@ -9001,7 +8991,7 @@ var global, factory;
else if ('char' === t.value) {
let t = Math.floor(this.scanNumber(!0));
(!isFinite(t) || t < 0 || t > 1114111) && (t = 10067),
- (e = new re(
+ (e = new oe(
this.parseMode,
'math' === this.parseMode ? 'mord' : '',
String.fromCodePoint(t)
@@ -9015,7 +9005,7 @@ var global, factory;
} else if ('hskip' === t.value || 'kern' === t.value) {
const i = this.scanSkip();
isFinite(i) &&
- ((e = new re(
+ ((e = new oe(
this.parseMode,
'spacing',
null,
@@ -9024,7 +9014,7 @@ var global, factory;
(e.width = i)),
(e.latex = '\\' + t.value);
} else if (((e = this.scanMacro(t.value)), !e)) {
- const i = At.getInfo(
+ const i = wt.getInfo(
'\\' + t.value,
this.parseMode,
this.macros
@@ -9051,7 +9041,7 @@ var global, factory;
)
s.push(e);
else if (t.placeholder) {
- const e = new re(
+ const e = new oe(
this.parseMode,
'placeholder',
t.placeholder
@@ -9066,7 +9056,7 @@ var global, factory;
if (i.parse) {
const a = i.parse('\\' + t.value, s);
if (a.type)
- e = new re(
+ e = new oe(
this.parseMode,
i.type,
o ? this.scanArg(o) : null,
@@ -9091,7 +9081,7 @@ var global, factory;
const s = { ...this.style };
i.baseFontFamily &&
(s.baseFontFamily = i.baseFontFamily),
- (e = new re(
+ (e = new oe(
this.parseMode,
i.type || 'mop',
i.value || t.value,
@@ -9111,7 +9101,7 @@ var global, factory;
}
}
i ||
- ((e = new re(
+ ((e = new oe(
this.parseMode,
'error',
'\\' + t.value
@@ -9119,12 +9109,12 @@ var global, factory;
(e.latex = '\\' + t.value));
}
} else if ('literal' === t.type) {
- const i = At.getInfo(t.value, this.parseMode, this.macros);
+ const i = wt.getInfo(t.value, this.parseMode, this.macros);
if (i) {
const s = { ...this.style };
i.baseFontFamily &&
(s.baseFontFamily = i.baseFontFamily),
- (e = new re(
+ (e = new oe(
this.parseMode,
i.type,
i.value || t.value,
@@ -9132,14 +9122,14 @@ var global, factory;
)),
i.isFunction && (e.isFunction = !0);
} else
- e = new re(
+ e = new oe(
this.parseMode,
'math' === this.parseMode ? 'mord' : '',
t.value,
this.style
);
if (
- ((e.latex = At.matchCodepoint(
+ ((e.latex = wt.matchCodepoint(
this.parseMode,
t.value.codePointAt(0)
)),
@@ -9157,7 +9147,7 @@ var global, factory;
)
e = e[0];
else if (Array.isArray(e)) {
- const t = new re(this.parseMode, 'group');
+ const t = new oe(this.parseMode, 'group');
(t.body = e), (e = t);
} else e = this.placeholder();
return e;
@@ -9184,10 +9174,10 @@ var global, factory;
this.args &&
'string' == typeof this.args['?'] &&
(e['?'] = this.args['?']);
- const a = new re(
+ const a = new oe(
this.parseMode,
'group',
- ce(n(i), this.parseMode, e, this.macros)
+ re(n(i), this.parseMode, e, this.macros)
);
(a.captureSelection = !0), (a.latex = '\\' + t);
let o = '';
@@ -9216,9 +9206,9 @@ var global, factory;
);
}
}
- function ce(t, e, i, s, a) {
+ function re(t, e, i, s, a) {
let o = [];
- const n = new le(t, i, s);
+ const n = new ne(t, i, s);
for (
n.parseMode = e || 'math', a && (n.smartFence = !0);
!n.end();
@@ -9227,13 +9217,13 @@ var global, factory;
o = o.concat(n.scanImplicitGroup());
return o;
}
- var he = { Parser: le, parseTokens: ce };
- function de(t, e) {
+ var le = { Parser: ne, parseTokens: re };
+ function ce(t, e) {
let i = '';
for (const e of t) i += e.relation + ':' + e.offset + '/';
return e && (i += '#' + e), i;
}
- function pe(t) {
+ function he(t) {
const e = { path: [], extent: 0 },
i = t.split('#');
i.length > 1 && (e.extent = parseInt(i[1]));
@@ -9244,9 +9234,9 @@ var global, factory;
}
return e;
}
- var me = {
- pathFromString: pe,
- pathToString: de,
+ var de = {
+ pathFromString: he,
+ pathToString: ce,
pathDistance: function(t, e) {
let i = 0,
s = -1,
@@ -9287,10 +9277,10 @@ var global, factory;
return i;
},
clone: function(t) {
- return pe(de(t)).path;
+ return he(ce(t)).path;
},
};
- const ue = {
+ const pe = {
Left: 'moveToPreviousChar',
Right: 'moveToNextChar',
Up: 'moveUp',
@@ -9528,7 +9518,7 @@ var global, factory;
{ withHighlighting: !0 },
],
},
- fe = {
+ me = {
'\\theta': 'Alt-KeyQ',
'\\sqrt': ['Alt-KeyV', 'Ctrl-Digit2'],
'\\pi': 'Alt-KeyP',
@@ -9551,7 +9541,7 @@ var global, factory;
'\\varnothing': 'Alt-Shift-KeyO',
'\\~': '~',
},
- ge = {
+ ue = {
"''": { mode: 'math', value: '^{\\doubleprime}' },
alpha: '\\alpha',
delta: '\\delta',
@@ -9803,7 +9793,7 @@ var global, factory;
'}': '\\}',
'*': '\\cdot',
};
- function ye(t, e, i) {
+ function fe(t, e, i) {
if (!i) return i;
if ('string' == typeof i) return i;
if ('string' == typeof i.mode && i.mode !== t) return null;
@@ -9830,7 +9820,7 @@ var global, factory;
(s = !y || 'first' === y.type),
y &&
((f = 'text' === y.mode),
- (a = !f && 'mord' === y.type && At.LETTER.test(y.body)),
+ (a = !f && 'mord' === y.type && wt.LETTER.test(y.body)),
(o = !f && 'mord' === y.type && /[0-9]+$/.test(y.body)),
(n = !f && y.isFunction),
(r = 'genfrac' === y.type),
@@ -9862,7 +9852,7 @@ var global, factory;
: i.value
);
}
- function be(t) {
+ function ge(t) {
let e = 'other';
return (
navigator &&
@@ -9883,7 +9873,7 @@ var global, factory;
e === t ? t : '!' + t
);
}
- function xe(t) {
+ function ye(t) {
let e = t;
return (
Array.isArray(e) &&
@@ -9892,7 +9882,7 @@ var global, factory;
e
);
}
- function ke(t, e) {
+ function be(t, e) {
let i = '';
Array.isArray(t) || (t = [t]);
for (const s of t) {
@@ -9900,12 +9890,12 @@ var global, factory;
const a = s.match(/(^[^:]*):/),
o = a ? a[1] : '';
if (
- o === be('mac') ||
- o === be('win') ||
- o === be('ios') ||
- o === be('android') ||
- o === be('chromeos') ||
- o === be('other')
+ o === ge('mac') ||
+ o === ge('win') ||
+ o === ge('ios') ||
+ o === ge('android') ||
+ o === ge('chromeos') ||
+ o === ge('other')
) {
const e = s.match(/:([^:]*)$/);
t = e ? e[1] : s;
@@ -9929,7 +9919,7 @@ var global, factory;
t = e ? e[1] : s;
}
if (t) {
- const s = 'mac' === be('mac') || 'ios' === be('ios'),
+ const s = 'mac' === ge('mac') || 'ios' === ge('ios'),
a = t.length > 1 ? t.split('-') : [t];
let o = '';
for (const t of a)
@@ -9987,16 +9977,16 @@ var global, factory;
}
return i;
}
- var ve = {
- KEYBOARD_SHORTCUTS: ue,
- INLINE_SHORTCUTS: ge,
- stringify: ke,
+ var xe = {
+ KEYBOARD_SHORTCUTS: pe,
+ INLINE_SHORTCUTS: ue,
+ stringify: be,
startsWithString: function(t, e) {
const i = [];
for (let s = 0; s <= t.length - 1; s++) {
const a = t.substring(s);
(e && e.overrideDefaultInlineShortcuts) ||
- Object.keys(ge).forEach(t => {
+ Object.keys(ue).forEach(t => {
t.startsWith(a) && !i.includes(t) && i.push(t);
});
const o = e && e.inlineShortcuts ? e.inlineShortcuts : null;
@@ -10010,37 +10000,37 @@ var global, factory;
forString: function(t, e, i, s) {
let a = '';
(s && s.overrideDefaultInlineShortcuts) ||
- (a = ye(t, e, ge[i]));
+ (a = fe(t, e, ue[i]));
const o = s && s.inlineShortcuts ? s.inlineShortcuts : null;
let n;
- return o && (n = ye(t, e, o[i])), n || a;
+ return o && (n = fe(t, e, o[i])), n || a;
},
selectorForKeystroke: function(t, e) {
for (const i of [
- be('mac') + ':' + t + ':' + e,
- be('win') + ':' + t + ':' + e,
- be('ios') + ':' + t + ':' + e,
- be('android') + ':' + t + ':' + e,
- be('chromeos') + ':' + t + ':' + e,
- be('other') + ':' + t + ':' + e,
- be('mac') + ':' + e,
- be('win') + ':' + e,
- be('ios') + ':' + e,
- be('android') + ':' + e,
- be('chromeos') + ':' + e,
+ ge('mac') + ':' + t + ':' + e,
+ ge('win') + ':' + t + ':' + e,
+ ge('ios') + ':' + t + ':' + e,
+ ge('android') + ':' + t + ':' + e,
+ ge('chromeos') + ':' + t + ':' + e,
+ ge('other') + ':' + t + ':' + e,
+ ge('mac') + ':' + e,
+ ge('win') + ':' + e,
+ ge('ios') + ':' + e,
+ ge('android') + ':' + e,
+ ge('chromeos') + ':' + e,
t + ':' + e,
e,
])
- if (ue[i]) return ue[i];
+ if (pe[i]) return pe[i];
return '';
},
forCommand: function(t) {
let e = [];
if ('string' == typeof t) {
- const i = fe[t];
+ const i = me[t];
Array.isArray(i) ? (e = i.slice()) : i && e.push(i);
}
- t = xe(t);
+ t = ye(t);
const i = new RegExp(
'^' +
t
@@ -10052,35 +10042,35 @@ var global, factory;
'([^*a-zA-Z]|$)'
);
return (
- Object.keys(ue).forEach(t => {
- if (i.test(xe(ue[t]))) {
+ Object.keys(pe).forEach(t => {
+ if (i.test(ye(pe[t]))) {
const i = t.match(/:([^:]*)$/);
i && e.push(i[1]);
}
}),
- ke(e)
+ be(e)
);
},
};
- function we(t, e) {
- (this.root = te.makeRoot()),
+ function ke(t, e) {
+ (this.root = Yt.makeRoot()),
(this.path = [{ relation: 'body', offset: 0 }]),
(this.extent = 0),
(this.config = t ? { ...t } : {}),
(this.target = e),
(this.suppressChangeNotifications = !1);
}
- function Se(t) {
- const e = Object.assign(new we(t.config, t.target), t);
- return (e.path = me.clone(t.path)), e;
+ function ve(t) {
+ const e = Object.assign(new ke(t.config, t.target), t);
+ return (e.path = de.clone(t.path)), e;
}
- function Ae(t, e) {
+ function we(t, e) {
let i = 0;
for (let s = 0; s < e.row; s++)
for (let e = 0; e < t[s].length; e++) i += 1;
return (i += e.col), i;
}
- function Me(t, e) {
+ function Se(t, e) {
if ('string' == typeof e) {
const t = e.match(/cell([0-9]*)$/);
t && (e = parseInt(t[1]));
@@ -10093,25 +10083,25 @@ var global, factory;
(e -= 1);
return i;
}
- function Ce(t, e) {
+ function Ae(t, e) {
let i;
return (
- 'object' != typeof e && (e = Me(t, e)),
+ 'object' != typeof e && (e = Se(t, e)),
Array.isArray(t[e.row]) && (i = t[e.row][e.col] || null),
!i ||
(0 !== i.length && 'first' === i[0].type) ||
- i.unshift(Be()),
+ i.unshift(Pe()),
i
);
}
- function _e(t) {
+ function Me(t) {
let e = 0,
i = 0,
s = 1;
for (const e of t) (i += 1), e.length > s && (s = e.length);
return (e = i * s), e;
}
- function Te(t, e, i) {
+ function Ce(t, e, i) {
if (!t) return [];
e || (e = ',');
let s,
@@ -10122,35 +10112,35 @@ var global, factory;
o.length > 0 &&
(s
? a.push(s)
- : (s = new te.MathAtom('math', 'mpunct', e, i)),
+ : (s = new Yt.MathAtom('math', 'mpunct', e, i)),
(a = a.concat(o)));
return a;
}
- function Le(t, e, i) {
+ function _e(t, e, i) {
const s = { ...e };
if (((s.row += i), s.row < 0)) {
if (((s.col += i), (s.row = t.length - 1), s.col < 0))
return null;
- for (; s.row >= 0 && !Ce(t, s); ) s.row -= 1;
+ for (; s.row >= 0 && !Ae(t, s); ) s.row -= 1;
if (s.row < 0) return null;
} else if (s.row >= t.length) {
- for (s.col += i, s.row = 0; s.row < t.length && !Ce(t, s); )
+ for (s.col += i, s.row = 0; s.row < t.length && !Ae(t, s); )
s.row += 1;
if (s.row > t.length - 1) return null;
}
return s;
}
- function Fe(t) {
+ function Te(t) {
return (
!!t &&
(('mord' === t.type && /[0-9.]/.test(t.body)) ||
('mpunct' === t.type && ',' === t.body))
);
}
- function De(t, e) {
+ function Le(t, e) {
if (!t) return !1;
if (Array.isArray(t)) {
- for (const i of t) if (De(i, e)) return !0;
+ for (const i of t) if (Le(i, e)) return !0;
} else {
if (t === e) return !0;
if (
@@ -10164,17 +10154,17 @@ var global, factory;
'underscript',
'overscript',
].some(function(i) {
- return i === e || De(t[i], e);
+ return i === e || Le(t[i], e);
})
)
return !0;
if (t.array)
- for (let i = _e(t.array); i >= 0; i--)
- if (De(Ce(t.array, i), e)) return !0;
+ for (let i = Me(t.array); i >= 0; i--)
+ if (Le(Ae(t.array, i), e)) return !0;
}
return !1;
}
- function ze(t) {
+ function Fe(t) {
if (t)
return (
1 === t.length &&
@@ -10184,7 +10174,7 @@ var global, factory;
t
);
}
- function Ee(t, e) {
+ function De(t, e) {
if (!t) return '';
if (t.length <= 1) return t;
if (!e || 'ASCIIMath' !== e.format) {
@@ -10195,7 +10185,7 @@ var global, factory;
if (((t = t.replace(/\\\\([^\s\n])/g, '\\$1')), /\\/.test(t)))
return t;
}
- return qe(
+ return ze(
(t = (t = (t = (t = (t = (t = t.replace(
/\u2061/gu,
''
@@ -10209,66 +10199,66 @@ var global, factory;
e
);
}
- function qe(t, e) {
+ function ze(t, e) {
if (!t) return '';
let i,
s = !1;
if (
(s ||
('^' !== t[0] && '_' !== t[0]) ||
- ((i = Pe(t.substr(1), { ...e, noWrap: !0 })),
+ ((i = Ee(t.substr(1), { ...e, noWrap: !0 })),
(t = t[0] + '{' + i.match + '}'),
- (t += qe(i.rest, e)),
+ (t += ze(i.rest, e)),
(s = !0)),
s ||
((i = t.match(/^(sqrt|\u221a)(.*)/)),
i &&
- ((i = Pe(i[2], { ...e, noWrap: !0 })),
+ ((i = Ee(i[2], { ...e, noWrap: !0 })),
(t = '\\sqrt{' + i.match + '}'),
- (t += qe(i.rest, e)),
+ (t += ze(i.rest, e)),
(s = !0))),
s ||
((i = t.match(/^(\\cbrt|\u221b)(.*)/)),
i &&
- ((i = Pe(i[2], { ...e, noWrap: !0 })),
+ ((i = Ee(i[2], { ...e, noWrap: !0 })),
(t = '\\sqrt[3]{' + i.match + '}'),
- (t += qe(i.rest, e)),
+ (t += ze(i.rest, e)),
(s = !0))),
s ||
((i = t.match(/^abs(.*)/)),
i &&
- ((i = Pe(i[1], { ...e, noWrap: !0 })),
+ ((i = Ee(i[1], { ...e, noWrap: !0 })),
(t = '\\left|' + i.match + '\\right|'),
- (t += qe(i.rest, e)),
+ (t += ze(i.rest, e)),
(s = !0))),
s ||
((i = t.match(/^["”“](.*?)["”“](.*)/)),
i &&
((t = '\\text{' + i[1] + '}'),
- (t += qe(i[2], e)),
+ (t += ze(i[2], e)),
(s = !0))),
s ||
((i = t.match(/^([^a-zA-Z({[_^\\\s"]+)(.*)/)),
- i && ((t = Ie(i[1], e)), (t += qe(i[2], e)), (s = !0))),
+ i && ((t = qe(i[1], e)), (t += ze(i[2], e)), (s = !0))),
!s &&
/^(f|g|h)[^a-zA-Z]/.test(t) &&
- ((i = Pe(t.substring(1), { ...e, noWrap: !0 })),
+ ((i = Ee(t.substring(1), { ...e, noWrap: !0 })),
(t =
'(' === t[1]
? t[0] + '\\mleft(' + i.match + '\\mright)'
: t[0] + i.match),
- (t += qe(i.rest, e)),
+ (t += ze(i.rest, e)),
(s = !0)),
s ||
((i = t.match(/^([a-zA-Z]+)(.*)/)),
- i && ((t = Ie(i[1], e)), (t += qe(i[2], e)), (s = !0))),
+ i && ((t = qe(i[1], e)), (t += ze(i[2], e)), (s = !0))),
!s)
)
if (
- ((i = Pe(t, { ...e, noWrap: !0 })),
+ ((i = Ee(t, { ...e, noWrap: !0 })),
i.match && '/' === i.rest[0])
) {
- const a = Pe(i.rest.substr(1), { ...e, noWrap: !0 });
+ const a = Ee(i.rest.substr(1), { ...e, noWrap: !0 });
a.match &&
(t =
'\\frac{' +
@@ -10276,7 +10266,7 @@ var global, factory;
'}{' +
a.match +
'}' +
- qe(a.rest, e)),
+ ze(a.rest, e)),
(s = !0);
} else
i.match &&
@@ -10285,17 +10275,17 @@ var global, factory;
? '\\left(' +
i.match +
'\\right)' +
- qe(i.rest, e)
- : i.match + qe(i.rest, e)),
+ ze(i.rest, e)
+ : i.match + ze(i.rest, e)),
(s = !0));
return (
s ||
((i = t.match(/^(\s+)(.*)$/)),
- i && ((t = ' ' + qe(i[2], e)), (s = !0))),
+ i && ((t = ' ' + ze(i[2], e)), (s = !0))),
t
);
}
- function Pe(t, e) {
+ function Ee(t, e) {
let i = '',
s = (t = t.trim()),
a = t.charAt(0),
@@ -10307,14 +10297,14 @@ var global, factory;
t[r] === a && n++, t[r] === o && n--, r++;
0 === n
? (e.noWrap && '(' === a
- ? (i = qe(t.substring(1, r - 1), e))
+ ? (i = ze(t.substring(1, r - 1), e))
: ('{' === a &&
'}' === o &&
((a = '\\{'), (o = '\\}')),
(i =
'\\left' +
a +
- qe(t.substring(1, r - 1), e) +
+ ze(t.substring(1, r - 1), e) +
'\\right' +
o)),
(s = t.substring(r)))
@@ -10322,7 +10312,7 @@ var global, factory;
} else {
let a = t.match(/^([a-zA-Z]+)/);
if (a) {
- let i = ve.forString('math', null, t, e);
+ let i = xe.forString('math', null, t, e);
if (i)
return (
(i = i.replace('_{#?}', '')),
@@ -10340,8 +10330,8 @@ var global, factory;
}
return { match: i, rest: s };
}
- function Ie(t, e) {
- let i = ve.forString('math', null, t, e);
+ function qe(t, e) {
+ let i = xe.forString('math', null, t, e);
return (
i
? ((i = i.replace('_{#?}', '')),
@@ -10351,18 +10341,18 @@ var global, factory;
i
);
}
- function Be() {
- return new te.MathAtom('', 'first');
+ function Pe() {
+ return new Yt.MathAtom('', 'first');
}
- (we.prototype._announce = function(t, e, i) {
+ (ke.prototype._announce = function(t, e, i) {
'function' == typeof this.config.onAnnounce &&
this.config.onAnnounce(this.target, t, e, i);
}),
- (we.prototype.filter = function(t, e) {
+ (ke.prototype.filter = function(t, e) {
e = e < 0 ? -1 : 1;
const i = [],
- s = new we();
- (s.path = me.clone(this.path)),
+ s = new ke();
+ (s.path = de.clone(this.path)),
(s.extent = this.extent),
(s.root = this.root),
e >= 0
@@ -10377,10 +10367,10 @@ var global, factory;
} while (a !== s.anchor());
return i;
}),
- (we.prototype.forEach = function(t) {
+ (ke.prototype.forEach = function(t) {
this.root.forEach(t);
}),
- (we.prototype.forEachSelected = function(t, e) {
+ (ke.prototype.forEachSelected = function(t, e) {
(e = e || {}).recursive = void 0 !== e.recursive && e.recursive;
const i = this.siblings(),
s = this.startOffset() + 1,
@@ -10392,10 +10382,10 @@ var global, factory;
for (let e = s; e < a; e++)
i[e] && 'first' !== i[e].type && t(i[e]);
}),
- (we.prototype.toString = function() {
- return me.pathToString(this.path, this.extent);
+ (ke.prototype.toString = function() {
+ return de.pathToString(this.path, this.extent);
}),
- (we.prototype.adjustPlaceholder = function() {
+ (ke.prototype.adjustPlaceholder = function() {
const t = this.siblings();
if (t && t.length <= 1) {
let e;
@@ -10414,7 +10404,7 @@ var global, factory;
e)
) {
const e = [
- new te.MathAtom(
+ new Yt.MathAtom(
'math',
'placeholder',
'⬚',
@@ -10425,30 +10415,30 @@ var global, factory;
}
}
}),
- (we.prototype.selectionWillChange = function() {
+ (ke.prototype.selectionWillChange = function() {
'function' != typeof this.config.onSelectionWillChange ||
this.suppressChangeNotifications ||
this.config.onSelectionWillChange(this.target);
}),
- (we.prototype.selectionDidChange = function() {
+ (ke.prototype.selectionDidChange = function() {
'function' != typeof this.config.onSelectionDidChange ||
this.suppressChangeNotifications ||
this.config.onSelectionDidChange(this.target);
}),
- (we.prototype.contentWillChange = function() {
+ (ke.prototype.contentWillChange = function() {
'function' != typeof this.config.onContentWillChange ||
this.suppressChangeNotifications ||
this.config.onContentWillChange(this.target);
}),
- (we.prototype.contentDidChange = function() {
+ (ke.prototype.contentDidChange = function() {
'function' != typeof this.config.onContentDidChange ||
this.suppressChangeNotifications ||
this.config.onContentDidChange(this.target);
}),
- (we.prototype.setPath = function(t, e) {
- if ('string' == typeof t) t = me.pathFromString(t);
+ (ke.prototype.setPath = function(t, e) {
+ if ('string' == typeof t) t = de.pathFromString(t);
else if (Array.isArray(t)) {
- const i = me.clone(t),
+ const i = de.clone(t),
s = this.path;
(this.path = i),
0 === e &&
@@ -10457,13 +10447,13 @@ var global, factory;
(t = { path: i, extent: e || 0 }),
(this.path = s);
}
- const i = 0 !== me.pathDistance(this.path, t.path),
+ const i = 0 !== de.pathDistance(this.path, t.path),
s = t.extent !== this.extent;
return (
(i || s) &&
(i && this.adjustPlaceholder(),
this.selectionWillChange(),
- (this.path = me.clone(t.path)),
+ (this.path = de.clone(t.path)),
this.siblings().length < this.anchorOffset()
? ((this.path = [{ relation: 'body', offset: 0 }]),
(this.extent = 0))
@@ -10472,16 +10462,16 @@ var global, factory;
i || s
);
}),
- (we.prototype.wordBoundary = function(t, e) {
+ (ke.prototype.wordBoundary = function(t, e) {
e = e < 0 ? -1 : 1;
- const i = new we();
- (i.path = me.clone(t)), (i.root = this.root);
+ const i = new ke();
+ (i.path = de.clone(t)), (i.root = this.root);
let s = 0;
for (
;
i.sibling(s) &&
'text' === i.sibling(s).mode &&
- At.LETTER_AND_DIGITS.test(i.sibling(s).body);
+ wt.LETTER_AND_DIGITS.test(i.sibling(s).body);
)
s += e;
@@ -10491,19 +10481,19 @@ var global, factory;
i.path
);
}),
- (we.prototype.wordBoundaryOffset = function(t, e) {
+ (ke.prototype.wordBoundaryOffset = function(t, e) {
e = e < 0 ? -1 : 1;
const i = this.siblings();
if (!i[t]) return t;
if ('text' !== i[t].mode) return t;
let s;
- if (At.LETTER_AND_DIGITS.test(i[t].body)) {
+ if (wt.LETTER_AND_DIGITS.test(i[t].body)) {
let a,
o = t;
do {
(a =
'text' === i[o].mode &&
- At.LETTER_AND_DIGITS.test(i[o].body)),
+ wt.LETTER_AND_DIGITS.test(i[o].body)),
(o += e);
} while (i[o] && a);
s = i[o] ? o - 2 * e : o - e;
@@ -10541,24 +10531,24 @@ var global, factory;
}
return s - (e > 0 ? 0 : 1);
}),
- (we.prototype.setRange = function(t, e, i) {
+ (ke.prototype.setRange = function(t, e, i) {
i = i || {};
- const s = me.pathDistance(t, e);
+ const s = de.pathDistance(t, e);
if (0 === s)
return i.extendToWordBoundary
? ((t = this.wordBoundary(t, -1)),
(e = this.wordBoundary(e, 1)),
this.setRange(t, e))
- : this.setPath(me.clone(t), 0);
+ : this.setPath(de.clone(t), 0);
if (1 === s) {
const s = e[e.length - 1].offset - t[t.length - 1].offset;
return i.extendToWordBoundary
? ((t = this.wordBoundary(t, s < 0 ? 1 : -1)),
(e = this.wordBoundary(e, s < 0 ? -1 : 1)),
this.setRange(t, e))
- : this.setPath(me.clone(t), s);
+ : this.setPath(de.clone(t), s);
}
- let a = me.pathCommonAncestor(t, e);
+ let a = de.pathCommonAncestor(t, e);
const o = a.length;
if (
t.length === o ||
@@ -10566,7 +10556,7 @@ var global, factory;
t[o].relation !== e[o].relation
)
return this.setPath(a, -1);
- a.push(t[o]), (a = me.clone(a));
+ a.push(t[o]), (a = de.clone(a));
let n = e[o].offset - t[o].offset + 1;
return (
n <= 0
@@ -10584,18 +10574,18 @@ var global, factory;
this.setPath(a, n)
);
}),
- (we.prototype.ancestor = function(t) {
+ (ke.prototype.ancestor = function(t) {
if (t > this.path.length) return null;
let e = this.root;
for (let i = 0; i < this.path.length - t; i++) {
const t = this.path[i];
- if (e.array) e = Ce(e.array, t.relation)[t.offset];
+ if (e.array) e = Ae(e.array, t.relation)[t.offset];
else {
if (!e[t.relation]) return null;
{
(0 !== e[t.relation].length &&
'first' === e[t.relation][0].type) ||
- e[t.relation].unshift(Be());
+ e[t.relation].unshift(Pe());
const i = Math.min(
t.offset,
e[t.relation].length - 1
@@ -10606,76 +10596,76 @@ var global, factory;
}
return e;
}),
- (we.prototype.anchor = function() {
+ (ke.prototype.anchor = function() {
if (this.parent().array)
- return Ce(this.parent().array, this.relation())[
+ return Ae(this.parent().array, this.relation())[
this.anchorOffset()
];
const t = this.siblings();
return t[Math.min(t.length - 1, this.anchorOffset())];
}),
- (we.prototype.parent = function() {
+ (ke.prototype.parent = function() {
return this.ancestor(1);
}),
- (we.prototype.relation = function() {
+ (ke.prototype.relation = function() {
return this.path.length > 0
? this.path[this.path.length - 1].relation
: '';
}),
- (we.prototype.anchorOffset = function() {
+ (ke.prototype.anchorOffset = function() {
return this.path.length > 0
? this.path[this.path.length - 1].offset
: 0;
}),
- (we.prototype.focusOffset = function() {
+ (ke.prototype.focusOffset = function() {
return this.path.length > 0
? this.path[this.path.length - 1].offset + this.extent
: 0;
}),
- (we.prototype.startOffset = function() {
+ (ke.prototype.startOffset = function() {
return Math.min(this.focusOffset(), this.anchorOffset());
}),
- (we.prototype.endOffset = function() {
+ (ke.prototype.endOffset = function() {
return Math.max(this.focusOffset(), this.anchorOffset());
}),
- (we.prototype.insertFirstAtom = function() {
+ (ke.prototype.insertFirstAtom = function() {
this.siblings();
}),
- (we.prototype.siblings = function() {
+ (ke.prototype.siblings = function() {
if (0 === this.path.length) return [];
let t;
return (
this.parent().array
- ? (t = Ce(this.parent().array, this.relation()))
+ ? (t = Ae(this.parent().array, this.relation()))
: ((t = this.parent()[this.relation()] || []),
'string' == typeof t && (t = [])),
(0 !== t.length && 'first' === t[0].type) ||
- t.unshift(Be()),
+ t.unshift(Pe()),
t
);
}),
- (we.prototype.sibling = function(t) {
+ (ke.prototype.sibling = function(t) {
return this.siblings()[this.startOffset() + t];
}),
- (we.prototype.isCollapsed = function() {
+ (ke.prototype.isCollapsed = function() {
return 0 === this.extent;
}),
- (we.prototype.setExtent = function(t) {
+ (ke.prototype.setExtent = function(t) {
this.extent = t;
}),
- (we.prototype.collapseForward = function() {
+ (ke.prototype.collapseForward = function() {
return (
0 !== this.extent &&
(this.setSelection(this.endOffset()), !0)
);
}),
- (we.prototype.collapseBackward = function() {
+ (ke.prototype.collapseBackward = function() {
return (
0 !== this.extent &&
(this.setSelection(this.startOffset()), !0)
);
}),
- (we.prototype.selectGroup_ = function() {
+ (ke.prototype.selectGroup_ = function() {
const t = this.siblings();
if ('text' === this.anchorMode()) {
let e = this.startOffset(),
@@ -10684,7 +10674,7 @@ var global, factory;
;
t[e] &&
'text' === t[e].mode &&
- At.LETTER_AND_DIGITS.test(t[e].body);
+ wt.LETTER_AND_DIGITS.test(t[e].body);
)
e -= 1;
@@ -10692,7 +10682,7 @@ var global, factory;
;
t[i] &&
'text' === t[i].mode &&
- At.LETTER_AND_DIGITS.test(t[i].body);
+ wt.LETTER_AND_DIGITS.test(t[i].body);
)
i += 1;
@@ -10705,27 +10695,27 @@ var global, factory;
) {
let e = this.startOffset(),
i = this.endOffset();
- for (; Fe(t[e]); ) e -= 1;
- for (; Fe(t[i]); ) i += 1;
+ for (; Te(t[e]); ) e -= 1;
+ for (; Te(t[i]); ) i += 1;
(i -= 1), this.setSelection(e, i - e);
} else this.setSelection(0, 'end');
}),
- (we.prototype.selectAll_ = function() {
+ (ke.prototype.selectAll_ = function() {
(this.path = [{ relation: 'body', offset: 0 }]),
this.setSelection(0, 'end');
}),
- (we.prototype.deleteAll_ = function() {
+ (ke.prototype.deleteAll_ = function() {
this.selectAll_(), this.delete_();
}),
- (we.prototype.contains = function(t) {
+ (ke.prototype.contains = function(t) {
if (this.isCollapsed()) return !1;
const e = this.siblings(),
i = this.startOffset(),
s = this.endOffset();
- for (let a = i; a < s; a++) if (De(e[a], t)) return !0;
+ for (let a = i; a < s; a++) if (Le(e[a], t)) return !0;
return !1;
}),
- (we.prototype.getSelectedAtoms = function() {
+ (ke.prototype.getSelectedAtoms = function() {
if (this.isCollapsed()) return null;
const t = [],
e = this.siblings(),
@@ -10735,7 +10725,7 @@ var global, factory;
e[a] && 'first' !== e[a].type && t.push(e[a]);
return t;
}),
- (we.prototype.commandOffsets = function() {
+ (ke.prototype.commandOffsets = function() {
const t = this.siblings();
if (t.length <= 1) return null;
let e = Math.min(this.endOffset(), t.length - 1);
@@ -10745,7 +10735,7 @@ var global, factory;
for (; i <= t.length - 1 && 'command' === t[i].type; ) i += 1;
return i > e ? { start: e + 1, end: i } : null;
}),
- (we.prototype.extractCommandStringAroundInsertionPoint = function(
+ (ke.prototype.extractCommandStringAroundInsertionPoint = function(
t
) {
let e = '';
@@ -10757,7 +10747,7 @@ var global, factory;
}
return e;
}),
- (we.prototype.decorateCommandStringAroundInsertionPoint = function(
+ (ke.prototype.decorateCommandStringAroundInsertionPoint = function(
t
) {
const e = this.commandOffsets();
@@ -10766,7 +10756,7 @@ var global, factory;
for (let s = e.start; s < e.end; s++) i[s].error = t;
}
}),
- (we.prototype.commitCommandStringBeforeInsertionPoint = function() {
+ (ke.prototype.commitCommandStringBeforeInsertionPoint = function() {
const t = this.commandOffsets();
if (t) {
const e = this.siblings(),
@@ -10775,7 +10765,7 @@ var global, factory;
e[s] && (e[s].suggestion = !1);
}
}),
- (we.prototype.spliceCommandStringAroundInsertionPoint = function(
+ (ke.prototype.spliceCommandStringAroundInsertionPoint = function(
t
) {
const e = this.commandOffsets();
@@ -10801,7 +10791,7 @@ var global, factory;
this.contentDidChange();
}
}),
- (we.prototype.removeCommandString = function() {
+ (ke.prototype.removeCommandString = function() {
this.contentWillChange();
const t = this.suppressChangeNotifications;
(this.suppressChangeNotifications = !0),
@@ -10823,13 +10813,13 @@ var global, factory;
t(e.index),
e.array)
)
- for (let i = _e(e.array); i >= 0; i--)
- t(Ce(e.array, i));
+ for (let i = Me(e.array); i >= 0; i--)
+ t(Ae(e.array, i));
})(this.root.body),
(this.suppressChangeNotifications = t),
this.contentDidChange();
}),
- (we.prototype.extractArgBeforeInsertionPoint = function() {
+ (ke.prototype.extractArgBeforeInsertionPoint = function() {
const t = this.siblings();
if (t.length <= 1) return [];
const e = [];
@@ -10847,7 +10837,7 @@ var global, factory;
e.unshift(t[i]), i--;
return e;
}),
- (we.prototype.setSelection = function(t, e, i) {
+ (ke.prototype.setSelection = function(t, e, i) {
(t = t || 0), (e = e || 0);
const s = this.path[this.path.length - 1].relation;
i || (i = s);
@@ -10878,7 +10868,7 @@ var global, factory;
!0
);
}),
- (we.prototype.next = function(t) {
+ (ke.prototype.next = function(t) {
t = t || {};
const e = {
body: 'numer',
@@ -10896,14 +10886,14 @@ var global, factory;
for (; i && !s[i]; ) i = e[i];
if (i) return void this.setSelection(0, 0, i);
if (this.parent().array) {
- const t = _e(this.parent().array);
+ const t = Me(this.parent().array);
let e =
parseInt(
this.relation().match(/cell([0-9]*)$/)[1]
) + 1;
for (; e < t; ) {
if (
- Ce(this.parent().array, e) &&
+ Ae(this.parent().array, e) &&
this.setSelection(0, 0, 'cell' + e)
)
return void this.selectionDidChange();
@@ -10928,9 +10918,9 @@ var global, factory;
if (i.array) {
let t = 0;
s = '';
- const e = _e(i.array);
+ const e = Me(i.array);
for (; !s && t < e; )
- Ce(i.array, t) && (s = 'cell' + t.toString()),
+ Ae(i.array, t) && (s = 'cell' + t.toString()),
(t += 1);
return (
this.path.push({ relation: s, offset: 0 }),
@@ -10952,7 +10942,7 @@ var global, factory;
}
}
}),
- (we.prototype.previous = function(t) {
+ (ke.prototype.previous = function(t) {
const e = {
numer: 'body',
denom: 'numer',
@@ -10991,7 +10981,7 @@ var global, factory;
) - 1;
for (; t >= 0; ) {
if (
- Ce(this.parent().array, t) &&
+ Ae(this.parent().array, t) &&
this.setSelection(-1, 0, 'cell' + t)
)
return void this.selectionDidChange();
@@ -11014,16 +11004,16 @@ var global, factory;
let t;
if (i.array) {
t = '';
- const e = _e(i.array);
+ const e = Me(i.array);
let s = e - 1;
for (; !t && s < e; )
- Ce(i.array, s) && (t = 'cell' + s.toString()),
+ Ae(i.array, s) && (t = 'cell' + s.toString()),
(s -= 1);
return (
(s += 1),
this.path.push({
relation: t,
- offset: Ce(i.array, s).length - 1,
+ offset: Ae(i.array, s).length - 1,
}),
void this.setSelection(-1, 0, t)
);
@@ -11046,11 +11036,11 @@ var global, factory;
this.sibling(0).skipBoundary &&
this.previous(t);
}),
- (we.prototype.move = function(t, e) {
+ (ke.prototype.move = function(t, e) {
const i = (e = e || { extend: !1 }).extend || !1;
if ((this.removeSuggestion(), i)) this.extend(t, e);
else {
- const e = Se(this);
+ const e = ve(this);
if (t > 0)
for (this.collapseForward() && t--; t > 0; )
this.next(), t--;
@@ -11060,7 +11050,7 @@ var global, factory;
this._announce('move', e);
}
}),
- (we.prototype.up = function(t) {
+ (ke.prototype.up = function(t) {
const e = (t = t || { extend: !1 }).extend || !1;
this.collapseBackward();
const i = this.relation();
@@ -11074,17 +11064,17 @@ var global, factory;
: this.setSelection(this.anchorOffset(), 0, 'numer'),
this._announce('moveUp');
else if (this.parent().array) {
- let e = Me(this.parent().array, i);
- (e = Le(this.parent().array, e, -1)),
- e && Ce(e)
+ let e = Se(this.parent().array, i);
+ (e = _e(this.parent().array, e, -1)),
+ e && Ae(e)
? ((this.path[this.path.length - 1].relation =
- 'cell' + Ae(this.parent().array, e)),
+ 'cell' + we(this.parent().array, e)),
this.setSelection(this.anchorOffset()),
this._announce('moveUp'))
: this.move(-1, t);
} else this._announce('line');
}),
- (we.prototype.down = function(t) {
+ (ke.prototype.down = function(t) {
const e = (t = t || { extend: !1 }).extend || !1;
this.collapseForward();
const i = this.relation();
@@ -11098,20 +11088,20 @@ var global, factory;
: this.setSelection(this.anchorOffset(), 0, 'denom'),
this._announce('moveDown');
else if (this.parent().array) {
- let e = Me(this.parent().array, i);
- (e = Le(this.parent().array, e, 1)),
- e && Ce(e)
+ let e = Se(this.parent().array, i);
+ (e = _e(this.parent().array, e, 1)),
+ e && Ae(e)
? ((this.path[this.path.length - 1].relation =
- 'cell' + Ae(this.parent().array, e)),
+ 'cell' + we(this.parent().array, e)),
this.setSelection(this.anchorOffset()),
this._announce('moveDown'))
: this.move(1, t);
} else this._announce('line');
}),
- (we.prototype.extend = function(t) {
+ (ke.prototype.extend = function(t) {
let e = this.path[this.path.length - 1].offset,
i = 0;
- const s = Se(this);
+ const s = ve(this);
i = this.extent + t;
const a = e + i;
if (a < 0 && 0 !== i) {
@@ -11139,10 +11129,10 @@ var global, factory;
}
this.setSelection(e, i), this._announce('move', s);
}),
- (we.prototype.skip = function(t, e) {
+ (ke.prototype.skip = function(t, e) {
const i = (e = e || { extend: !1 }).extend || !1;
t = t < 0 ? -1 : 1;
- const s = Se(this),
+ const s = ve(this),
a = this.siblings(),
o = this.focusOffset();
let n = o + t;
@@ -11194,7 +11184,7 @@ var global, factory;
this._announce('move', s);
}
}),
- (we.prototype.jump = function(t, e) {
+ (ke.prototype.jump = function(t, e) {
const i = (e = e || { extend: !1 }).extend || !1;
t = t < 0 ? -1 : 1;
const s = this.siblings();
@@ -11203,10 +11193,10 @@ var global, factory;
const o = t < 0 ? 0 : s.length - 1;
i ? this.extend(o - a) : this.move(o - a);
}),
- (we.prototype.jumpToMathFieldBoundary = function(t, e) {
+ (ke.prototype.jumpToMathFieldBoundary = function(t, e) {
const i = (e = e || { extend: !1 }).extend || !1;
t = (t = t || 1) < 0 ? -1 : 1;
- const s = Se(this),
+ const s = ve(this),
a = [{ relation: 'body', offset: this.path[0].offset }];
let o;
i
@@ -11219,11 +11209,11 @@ var global, factory;
this.setPath(a, o),
this._announce('move', s);
}),
- (we.prototype.leap = function(t, e) {
+ (ke.prototype.leap = function(t, e) {
(t = (t = t || 1) < 0 ? -1 : 1), (e = e || !0);
const i = this.suppressChangeNotifications;
this.suppressChangeNotifications = !0;
- const s = Se(this),
+ const s = ve(this),
a = this.extent;
this.move(t),
'placeholder' === this.anchor().type && this.move(t);
@@ -11270,7 +11260,7 @@ var global, factory;
!0
);
}),
- (we.prototype.anchorMode = function() {
+ (ke.prototype.anchorMode = function() {
const t = this.isCollapsed() ? this.anchor() : this.sibling(1);
let e;
if (t) {
@@ -11284,7 +11274,7 @@ var global, factory;
s && (e = s.mode), (i += 1), (s = this.ancestor(i));
return e;
}),
- (we.prototype.anchorStyle = function() {
+ (ke.prototype.anchorStyle = function() {
const t = this.isCollapsed() ? this.anchor() : this.sibling(1);
let e;
if (t && 'first' !== t.type) {
@@ -11315,7 +11305,7 @@ var global, factory;
(s = this.ancestor(i));
return e;
}),
- (we.prototype.simplifyParen = function(t) {
+ (ke.prototype.simplifyParen = function(t) {
if (t && this.config.removeExtraneousParentheses) {
for (let e = 0; t[e]; e++)
if (
@@ -11337,37 +11327,37 @@ var global, factory;
('genfrac' === t.type &&
(this.simplifyParen(t.numer),
this.simplifyParen(t.denom),
- (t.numer = ze(t.numer)),
- (t.denom = ze(t.denom))),
+ (t.numer = Fe(t.numer)),
+ (t.denom = Fe(t.denom))),
t.superscript &&
(this.simplifyParen(t.superscript),
- (t.superscript = ze(t.superscript))),
+ (t.superscript = Fe(t.superscript))),
t.subscript &&
(this.simplifyParen(t.subscript),
- (t.subscript = ze(t.subscript))),
+ (t.subscript = Fe(t.subscript))),
t.underscript &&
(this.simplifyParen(t.underscript),
- (t.underscript = ze(t.underscript))),
+ (t.underscript = Fe(t.underscript))),
t.overscript &&
(this.simplifyParen(t.overscript),
- (t.overscript = ze(t.overscript))),
+ (t.overscript = Fe(t.overscript))),
t.index &&
(this.simplifyParen(t.index),
- (t.index = ze(t.index))),
+ (t.index = Fe(t.index))),
'surd' === t.type
? (this.simplifyParen(t.body),
- (t.body = ze(t.body)))
+ (t.body = Fe(t.body)))
: t.body &&
Array.isArray(t.body) &&
this.simplifyParen(t.body),
t.array)
)
- for (let e = _e(t.array); e >= 0; e--)
- this.simplifyParen(Ce(t.array, e));
+ for (let e = Me(t.array); e >= 0; e--)
+ this.simplifyParen(Ae(t.array, e));
});
}
}),
- (we.prototype.insert = function(t, e) {
+ (ke.prototype.insert = function(t, e) {
if (
(e = e || {}).smartFence &&
this._insertSmartFence(t, e.style)
@@ -11410,23 +11400,23 @@ var global, factory;
this.delete_(-1),
'math' === a && 'ASCIIMath' === e.format)
)
- (t = Ee(t, { ...this.config, format: 'ASCIIMath' })),
- (o = he.parseTokens(n(t), 'math', null, e.macros, !1)),
+ (t = De(t, { ...this.config, format: 'ASCIIMath' })),
+ (o = le.parseTokens(n(t), 'math', null, e.macros, !1)),
this.simplifyParen(o);
else if ('text' !== a && 'auto' === e.format)
if ('command' === a) {
o = [];
for (const e of t)
- At.COMMAND_MODE_CHARACTERS.test(e) &&
+ wt.COMMAND_MODE_CHARACTERS.test(e) &&
o.push(
- new te.MathAtom('command', 'command', e)
+ new Yt.MathAtom('command', 'command', e)
);
} else
'' === t
? (o = [
- new te.MathAtom('command', 'command', '\\'),
+ new Yt.MathAtom('command', 'command', '\\'),
])
- : ((t = Ee(t, this.config)),
+ : ((t = De(t, this.config)),
r[0]
? (t = t.replace(/(^|[^\\])#@/g, '$1#0'))
: /(^|[^\\])#@/.test(t)
@@ -11437,7 +11427,7 @@ var global, factory;
0 === r[0].length &&
(r[0] = void 0))
: (t = t.replace(/(^|[^\\])#@/g, '$1#?')),
- (o = he.parseTokens(
+ (o = le.parseTokens(
n(t),
a,
r,
@@ -11447,7 +11437,7 @@ var global, factory;
this.simplifyParen(o));
else
'latex' === e.format
- ? (o = he.parseTokens(
+ ? (o = le.parseTokens(
n(t),
a,
r,
@@ -11474,7 +11464,7 @@ var global, factory;
/£/g,
'\\textsterling '
)),
- (o = he.parseTokens(n(t), 'text', r, e.macros, !1)));
+ (o = le.parseTokens(n(t), 'text', r, e.macros, !1)));
!(function t(e, i) {
e &&
i &&
@@ -11536,7 +11526,7 @@ var global, factory;
this.setSelection(this.anchorOffset(), o.length));
this.contentDidChange(), (this.suppressChangeNotifications = i);
}),
- (we.prototype._insertSmartFence = function(t, e) {
+ (ke.prototype._insertSmartFence = function(t, e) {
const i = this.parent();
if (
'leftright' === i.type &&
@@ -11555,7 +11545,7 @@ var global, factory;
('}' !== t && '\\}' !== t) || (t = '\\rbrace'),
('[' !== t && '\\[' !== t) || (t = '\\lbrack'),
(']' !== t && '\\]' !== t) || (t = '\\rbrack');
- const s = At.RIGHT_DELIM[t];
+ const s = wt.RIGHT_DELIM[t];
if (s && ('leftright' !== i.type || '|' !== i.leftDelim)) {
let i = '';
const a =
@@ -11583,8 +11573,8 @@ var global, factory;
}
let a;
if (
- (Object.keys(At.RIGHT_DELIM).forEach(e => {
- t === At.RIGHT_DELIM[e] && (a = e);
+ (Object.keys(wt.RIGHT_DELIM).forEach(e => {
+ t === wt.RIGHT_DELIM[e] && (a = e);
}),
a)
) {
@@ -11649,24 +11639,24 @@ var global, factory;
}
return !1;
}),
- (we.prototype.positionInsertionPointAfterCommitedCommand = function() {
+ (ke.prototype.positionInsertionPointAfterCommitedCommand = function() {
const t = this.siblings(),
e = this.commandOffsets();
let i = e.start;
for (; i < e.end && !t[i].suggestion; ) i++;
this.setSelection(i - 1);
}),
- (we.prototype.removeSuggestion = function() {
+ (ke.prototype.removeSuggestion = function() {
const t = this.siblings();
for (let e = t.length - 1; e >= 0; e--)
t[e].suggestion && t.splice(e, 1);
}),
- (we.prototype.insertSuggestion = function(t, e) {
+ (ke.prototype.insertSuggestion = function(t, e) {
this.removeSuggestion();
const i = [],
s = t.substr(e);
for (const t of s) {
- const e = new te.MathAtom('command', 'command', t);
+ const e = new Yt.MathAtom('command', 'command', t);
(e.suggestion = !0), i.push(e);
}
Array.prototype.splice.apply(
@@ -11674,18 +11664,18 @@ var global, factory;
[this.anchorOffset() + 1, 0].concat(i)
);
}),
- (we.prototype._deleteAtoms = function(t) {
+ (ke.prototype._deleteAtoms = function(t) {
t > 0
? this.siblings().splice(this.anchorOffset() + 1, t)
: (this.siblings().splice(this.anchorOffset() + t + 1, -t),
this.setSelection(this.anchorOffset() + t));
}),
- (we.prototype.delete = function(t) {
+ (ke.prototype.delete = function(t) {
if (0 === (t = t || 0)) this.delete_(0);
else if (t > 0) for (; t > 0; ) this.delete_(1), t--;
else for (; t < 0; ) this.delete_(-1), t++;
}),
- (we.prototype.delete_ = function(t) {
+ (ke.prototype.delete_ = function(t) {
this.contentWillChange(), this.selectionWillChange();
const e = this.suppressChangeNotifications;
if (
@@ -11698,8 +11688,8 @@ var global, factory;
if (
(function(t) {
const e = { col: 0, row: 0 };
- for (; e.row < t.length && !Ce(t, e); ) e.row += 1;
- return Ce(t, e) ? 'cell' + Ae(t, e) : '';
+ for (; e.row < t.length && !Ae(t, e); ) e.row += 1;
+ return Ae(t, e) ? 'cell' + we(t, e) : '';
})(t) === this.relation()
) {
const e = (function(t, e, i) {
@@ -11709,13 +11699,13 @@ var global, factory;
for (const i of t)
s
? a.push(s)
- : (s = new te.MathAtom(
+ : (s = new Yt.MathAtom(
'math',
'mpunct',
e[0],
void 0
)),
- (a = a.concat(Te(i, e[1])));
+ (a = a.concat(Ce(i, e[1])));
return a;
})(t);
this.path.pop(),
@@ -11729,14 +11719,14 @@ var global, factory;
e.length
);
} else {
- const e = Me(t, this.relation());
+ const e = Se(t, this.relation());
if (0 === e.col) {
- const i = Le(t, e, -1);
+ const i = _e(t, e, -1);
(i.col = t[i.row].length - 1),
(this.path[this.path.length - 1].relation =
- 'cell' + Ae(t, i));
+ 'cell' + we(t, i));
const s = t[i.row][i.col].length,
- a = Te(t[e.row]);
+ a = Ce(t[e.row]);
(t[i.row][i.col] = t[i.row][i.col].concat(a)),
this.setSelection(s - 1, a.length),
(function(t, e) {
@@ -11748,7 +11738,7 @@ var global, factory;
let i = 0;
const s = { col: e, row: 0 };
for (; s.row < t.length; ) {
- const e = Ce(t, s);
+ const e = Ae(t, s);
if (e && e.length > 0) {
let t = e.length;
'first' === e[0].type && (t -= 1),
@@ -11766,7 +11756,7 @@ var global, factory;
})(t, e.col),
(e.col -= 1),
(this.path[this.path.length - 1].relation =
- 'cell' + Ae(t, e));
+ 'cell' + we(t, e));
const i = t[e.row][e.col];
this.setSelection(i.length - 1, 0);
}
@@ -11900,116 +11890,116 @@ var global, factory;
this.selectionDidChange(),
this.contentDidChange();
}),
- (we.prototype.moveToNextPlaceholder_ = function() {
+ (ke.prototype.moveToNextPlaceholder_ = function() {
this.leap(1);
}),
- (we.prototype.moveToPreviousPlaceholder_ = function() {
+ (ke.prototype.moveToPreviousPlaceholder_ = function() {
this.leap(-1);
}),
- (we.prototype.moveToNextChar_ = function() {
+ (ke.prototype.moveToNextChar_ = function() {
this.move(1);
}),
- (we.prototype.moveToPreviousChar_ = function() {
+ (ke.prototype.moveToPreviousChar_ = function() {
this.move(-1);
}),
- (we.prototype.moveUp_ = function() {
+ (ke.prototype.moveUp_ = function() {
this.up();
}),
- (we.prototype.moveDown_ = function() {
+ (ke.prototype.moveDown_ = function() {
this.down();
}),
- (we.prototype.moveToNextWord_ = function() {
+ (ke.prototype.moveToNextWord_ = function() {
this.skip(1);
}),
- (we.prototype.moveToPreviousWord_ = function() {
+ (ke.prototype.moveToPreviousWord_ = function() {
this.skip(-1);
}),
- (we.prototype.moveToGroupStart_ = function() {
+ (ke.prototype.moveToGroupStart_ = function() {
this.setSelection(0);
}),
- (we.prototype.moveToGroupEnd_ = function() {
+ (ke.prototype.moveToGroupEnd_ = function() {
this.setSelection(-1);
}),
- (we.prototype.moveToMathFieldStart_ = function() {
+ (ke.prototype.moveToMathFieldStart_ = function() {
this.jumpToMathFieldBoundary(-1);
}),
- (we.prototype.moveToMathFieldEnd_ = function() {
+ (ke.prototype.moveToMathFieldEnd_ = function() {
this.jumpToMathFieldBoundary(1);
}),
- (we.prototype.deleteNextChar_ = function() {
+ (ke.prototype.deleteNextChar_ = function() {
this.delete_(1);
}),
- (we.prototype.deletePreviousChar_ = function() {
+ (ke.prototype.deletePreviousChar_ = function() {
this.delete_(-1);
}),
- (we.prototype.deleteNextWord_ = function() {
+ (ke.prototype.deleteNextWord_ = function() {
this.extendToNextBoundary(), this.delete_();
}),
- (we.prototype.deletePreviousWord_ = function() {
+ (ke.prototype.deletePreviousWord_ = function() {
this.extendToPreviousBoundary(), this.delete_();
}),
- (we.prototype.deleteToGroupStart_ = function() {
+ (ke.prototype.deleteToGroupStart_ = function() {
this.extendToGroupStart(), this.delete_();
}),
- (we.prototype.deleteToGroupEnd_ = function() {
+ (ke.prototype.deleteToGroupEnd_ = function() {
this.extendToMathFieldStart(), this.delete_();
}),
- (we.prototype.deleteToMathFieldEnd_ = function() {
+ (ke.prototype.deleteToMathFieldEnd_ = function() {
this.extendToMathFieldEnd(), this.delete_();
}),
- (we.prototype.transpose_ = function() {}),
- (we.prototype.extendToNextChar_ = function() {
+ (ke.prototype.transpose_ = function() {}),
+ (ke.prototype.extendToNextChar_ = function() {
this.extend(1);
}),
- (we.prototype.extendToPreviousChar_ = function() {
+ (ke.prototype.extendToPreviousChar_ = function() {
this.extend(-1);
}),
- (we.prototype.extendToNextWord_ = function() {
+ (ke.prototype.extendToNextWord_ = function() {
this.skip(1, { extend: !0 });
}),
- (we.prototype.extendToPreviousWord_ = function() {
+ (ke.prototype.extendToPreviousWord_ = function() {
this.skip(-1, { extend: !0 });
}),
- (we.prototype.extendUp_ = function() {
+ (ke.prototype.extendUp_ = function() {
this.up({ extend: !0 });
}),
- (we.prototype.extendDown_ = function() {
+ (ke.prototype.extendDown_ = function() {
this.down({ extend: !0 });
}),
- (we.prototype.extendToNextBoundary_ = function() {
+ (ke.prototype.extendToNextBoundary_ = function() {
this.skip(1, { extend: !0 });
}),
- (we.prototype.extendToPreviousBoundary_ = function() {
+ (ke.prototype.extendToPreviousBoundary_ = function() {
this.skip(-1, { extend: !0 });
}),
- (we.prototype.extendToGroupStart_ = function() {
+ (ke.prototype.extendToGroupStart_ = function() {
this.setExtent(-this.anchorOffset());
}),
- (we.prototype.extendToGroupEnd_ = function() {
+ (ke.prototype.extendToGroupEnd_ = function() {
this.setExtent(this.siblings().length - this.anchorOffset());
}),
- (we.prototype.extendToMathFieldStart_ = function() {
+ (ke.prototype.extendToMathFieldStart_ = function() {
this.jumpToMathFieldBoundary(-1, { extend: !0 });
}),
- (we.prototype.extendToMathFieldEnd_ = function() {
+ (ke.prototype.extendToMathFieldEnd_ = function() {
this.jumpToMathFieldBoundary(1, { extend: !0 });
}),
- (we.prototype.moveToSuperscript_ = function() {
+ (ke.prototype.moveToSuperscript_ = function() {
if ((this.collapseForward(), !this.anchor().superscript))
if (this.anchor().subscript)
- this.anchor().superscript = [Be()];
+ this.anchor().superscript = [Pe()];
else {
const t = this.sibling(1);
t && t.superscript
? (this.path[this.path.length - 1].offset += 1)
: t && t.subscript
? ((this.path[this.path.length - 1].offset += 1),
- (this.anchor().superscript = [Be()]))
+ (this.anchor().superscript = [Pe()]))
: ('limits' !== this.anchor().limits &&
(this.siblings().splice(
this.anchorOffset() + 1,
0,
- new te.MathAtom(
+ new Yt.MathAtom(
this.parent().anchorMode,
'msubsup',
'',
@@ -12019,27 +12009,27 @@ var global, factory;
(this.path[
this.path.length - 1
].offset += 1)),
- (this.anchor().superscript = [Be()]));
+ (this.anchor().superscript = [Pe()]));
}
this.path.push({ relation: 'superscript', offset: 0 }),
this.selectGroup_();
}),
- (we.prototype.moveToSubscript_ = function() {
+ (ke.prototype.moveToSubscript_ = function() {
if ((this.collapseForward(), !this.anchor().subscript))
if (this.anchor().superscript)
- this.anchor().subscript = [Be()];
+ this.anchor().subscript = [Pe()];
else {
const t = this.sibling(1);
t && t.subscript
? (this.path[this.path.length - 1].offset += 1)
: t && t.superscript
? ((this.path[this.path.length - 1].offset += 1),
- (this.anchor().subscript = [Be()]))
+ (this.anchor().subscript = [Pe()]))
: ('limits' !== this.anchor().limits &&
(this.siblings().splice(
this.anchorOffset() + 1,
0,
- new te.MathAtom(
+ new Yt.MathAtom(
this.parent().anchorMode,
'msubsup',
'',
@@ -12049,12 +12039,12 @@ var global, factory;
(this.path[
this.path.length - 1
].offset += 1)),
- (this.anchor().subscript = [Be()]));
+ (this.anchor().subscript = [Pe()]));
}
this.path.push({ relation: 'subscript', offset: 0 }),
this.selectGroup_();
}),
- (we.prototype.moveToOpposite_ = function() {
+ (ke.prototype.moveToOpposite_ = function() {
const t = {
superscript: 'subscript',
subscript: 'superscript',
@@ -12062,36 +12052,36 @@ var global, factory;
numer: 'denom',
}[this.relation()];
t || this.moveToSuperscript_(),
- this.parent()[t] || (this.parent()[t] = [Be()]),
+ this.parent()[t] || (this.parent()[t] = [Pe()]),
this.setSelection(0, 'end', t);
}),
- (we.prototype.moveBeforeParent_ = function() {
+ (ke.prototype.moveBeforeParent_ = function() {
this.path.length > 1
? (this.path.pop(),
this.setSelection(this.anchorOffset() - 1))
: this._announce('plonk');
}),
- (we.prototype.moveAfterParent_ = function() {
+ (ke.prototype.moveAfterParent_ = function() {
if (this.path.length > 1) {
- const t = Se(this);
+ const t = ve(this);
this.path.pop(),
this.setExtent(0),
this._announce('move', t);
} else this._announce('plonk');
}),
- (we.prototype._addCell = function(t) {
+ (ke.prototype._addCell = function(t) {
const e = this.parent();
if (e && 'array' === e.type && Array.isArray(e.array)) {
const i = this.relation();
if (e.array) {
- const s = Me(e.array, i);
+ const s = Se(e.array, i);
'after row' === t || 'before row' === t
? ((s.col = 0),
(s.row = s.row + ('after row' === t ? 1 : 0)),
e.array.splice(s.row, 0, [[]]))
: ((s.col += 'after column' === t ? 1 : 0),
e.array[s.row].splice(s.col, 0, []));
- const a = Ae(e.array, s);
+ const a = we(e.array, s);
this.path.pop(),
this.path.push({
relation: 'cell' + a.toString(),
@@ -12101,7 +12091,7 @@ var global, factory;
}
}
}),
- (we.prototype.convertParentToArray = function() {
+ (ke.prototype.convertParentToArray = function() {
const t = this.parent();
if ('leftright' === t.type) {
t.type = 'array';
@@ -12111,7 +12101,7 @@ var global, factory;
'\\lbrack': 'bmatrix',
'\\lbrace': 'cases',
}[t.leftDelim] || 'matrix',
- i = At.getEnvironmentInfo(e),
+ i = wt.getEnvironmentInfo(e),
s = [[t.body]];
i.parser && Object.assign(t, i.parser(e, [], s)),
(t.tabularMode = i.tabular),
@@ -12124,31 +12114,31 @@ var global, factory;
(this.path[this.path.length - 1].relation = 'cell0');
}
}),
- (we.prototype.addRowAfter_ = function() {
+ (ke.prototype.addRowAfter_ = function() {
this.contentWillChange(),
this.convertParentToArray(),
this._addCell('after row'),
this.contentDidChange();
}),
- (we.prototype.addRowBefore_ = function() {
+ (ke.prototype.addRowBefore_ = function() {
this.contentWillChange(),
this.convertParentToArray(),
this._addCell('before row'),
this.contentDidChange();
}),
- (we.prototype.addColumnAfter_ = function() {
+ (ke.prototype.addColumnAfter_ = function() {
this.contentWillChange(),
this.convertParentToArray(),
this._addCell('after column'),
this.contentDidChange();
}),
- (we.prototype.addColumnBefore_ = function() {
+ (ke.prototype.addColumnBefore_ = function() {
this.contentWillChange(),
this.convertParentToArray(),
this._addCell('before column'),
this.contentDidChange();
}),
- (we.prototype._applyStyle = function(t) {
+ (ke.prototype._applyStyle = function(t) {
if (this.isCollapsed()) return;
const e = this;
function i(t, i) {
@@ -12188,8 +12178,8 @@ var global, factory;
}),
this.contentDidChange();
});
- var Oe = { EditableMathlist: we, parseMathString: Ee };
- const Re = {
+ var Ie = { EditableMathlist: ke, parseMathString: De };
+ const Be = {
'#': '#',
'|': '|',
'[': 'BracketLeft',
@@ -12200,7 +12190,7 @@ var global, factory;
'/': 'Slash',
'\\': 'Backslash',
},
- Ke = {
+ Oe = {
Space: 'Spacebar',
' ': 'Spacebar',
Escape: 'Esc',
@@ -12210,7 +12200,7 @@ var global, factory;
ArrowDown: 'Down',
Delete: 'Del',
},
- Ne = {
+ Re = {
q: 'KeyQ',
w: 'KeyW',
e: 'KeyE',
@@ -12265,16 +12255,16 @@ var global, factory;
'?': 'Shift-Slash',
' ': 'Spacebar',
};
- function $e(t) {
+ function Ke(t) {
let e,
i = !0;
'Unidentified' === t.key &&
t.target &&
- (e = Ne[t.target.value] || t.target.value),
+ (e = Re[t.target.value] || t.target.value),
e ||
- (Re[t.key] ? ((e = Re[t.key]), (i = !1)) : (e = Ke[t.key]),
- e || (e = Ne[t.key.toLowerCase()])),
- !e && t.code && (e = Ke[t.code] || t.code);
+ (Be[t.key] ? ((e = Be[t.key]), (i = !1)) : (e = Oe[t.key]),
+ e || (e = Re[t.key.toLowerCase()])),
+ !e && t.code && (e = Oe[t.code] || t.code);
const s = [];
return (
t.ctrlKey && s.push('Ctrl'),
@@ -12284,7 +12274,7 @@ var global, factory;
0 === s.length ? e : (s.push(e), s.join('-'))
);
}
- function We(t, e) {
+ function Ne(t, e) {
let i,
s = null,
a = null,
@@ -12334,7 +12324,7 @@ var global, factory;
!o &&
'CapsLock' !== i.code &&
!/(Control|Meta|Alt|Shift)(Right|Left)/.test(i.code)
- ) || ((s = i), (a = null), e.keystroke($e(i), i))
+ ) || ((s = i), (a = null), e.keystroke(Ke(i), i))
);
},
!0
@@ -12342,7 +12332,7 @@ var global, factory;
c.addEventListener(
'keypress',
function(t) {
- o || (s && a && e.keystroke($e(s), s), (a = t), r(l));
+ o || (s && a && e.keystroke(Ke(s), s), (a = t), r(l));
},
!0
),
@@ -12420,10 +12410,10 @@ var global, factory;
} else o || r(l);
});
}
- var He = {
- delegateKeyboardEvents: We,
- select: We.select,
- keyboardEventToString: $e,
+ var $e = {
+ delegateKeyboardEvents: Ne,
+ select: Ne.select,
+ keyboardEventToString: Ke,
eventToChar: function(t) {
if (!t) return '';
let e;
@@ -12448,7 +12438,7 @@ var global, factory;
};
},
};
- const Ve = {
+ const We = {
'\\mathrm': '\\mathrm{x=+3.14, x\\in A}',
'\\mathbf': '\\mathbf{x=+3.14, x\\in A}',
'\\bf': '\\bf{x=+3.14, x\\in A}',
@@ -12549,7 +12539,7 @@ var global, factory;
'\\rlap': '\\rlap{x}o',
'\\llap': 'o\\llap{/}',
},
- Ue = {
+ He = {
'\\text': 'roman text',
'\\textrm': 'roman text',
'\\textnormal': 'roman text',
@@ -12784,16 +12774,16 @@ var global, factory;
'\\bullet': 'bullet',
'\\lim': 'limit',
};
- function je(t) {
- let e = Ue[t] || '';
+ function Ve(t) {
+ let e = He[t] || '';
return Array.isArray(e) && (e = e.join('
')), e;
}
- function Ge(t, e) {
+ function Ue(t, e) {
t.popover.innerHTML = e;
const i = t._getCaretPosition();
- i && Ze(t, i), t.popover.classList.add('is-visible');
+ i && je(t, i), t.popover.classList.add('is-visible');
}
- function Ze(t, e) {
+ function je(t, e) {
const i =
window.innerHeight ||
document.documentElement.clientHeight ||
@@ -12820,24 +12810,24 @@ var global, factory;
: (t.popover.classList.remove('reverse-direction'),
(t.popover.style.top = e.y + 5 + 'px'));
}
- function Xe(t) {
+ function Ge(t) {
t.popover.classList.remove('is-visible');
}
- var Je = {
- getNote: je,
- SAMPLES: Ve,
- NOTES: Ue,
+ var Ze = {
+ getNote: Ve,
+ SAMPLES: We,
+ NOTES: He,
showPopoverWithLatex: function(t, e, i) {
- if (!e || 0 === e.length) return void Xe(t);
+ if (!e || 0 === e.length) return void Ge(t);
const s = e,
a = (function(t, e) {
- const i = he.parseTokens(
+ const i = le.parseTokens(
n(t),
'math',
null,
e.config.macros
),
- s = te.decompose(
+ s = Yt.decompose(
{
mathstyle: 'displaystyle',
macros: e.config.macros,
@@ -12853,9 +12843,9 @@ var global, factory;
r.setStyle('vertical-align', -a.depth, 'em'),
$.makeSpan([o, r, a], 'ML__mathlive').toMarkup()
);
- })(Ve[s] || e, t),
- o = je(s),
- r = ve.forCommand(s);
+ })(We[s] || e, t),
+ o = Ve(s),
+ r = xe.forCommand(s);
let l = i
? '