UNPKG

mathjax

Version:

Beautiful and accessible math in all browsers. MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all browsers. This package includes the packaged components (install mathjax-full to get the source

1 lines 260 kB
(function(){"use strict";var __webpack_modules__={444:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.HTMLAdaptor=void 0;var a=function(t){function e(e){var r=t.call(this,e.document)||this;return r.window=e,r.parser=new e.DOMParser,r}return o(e,t),e.prototype.parse=function(t,e){return void 0===e&&(e="text/html"),this.parser.parseFromString(t,e)},e.prototype.create=function(t,e){return e?this.document.createElementNS(e,t):this.document.createElement(t)},e.prototype.text=function(t){return this.document.createTextNode(t)},e.prototype.head=function(t){return t.head},e.prototype.body=function(t){return t.body},e.prototype.root=function(t){return t.documentElement},e.prototype.doctype=function(t){return t.doctype?"<!DOCTYPE "+t.doctype.name+">":""},e.prototype.tags=function(t,e,r){void 0===r&&(r=null);var n=r?t.getElementsByTagNameNS(r,e):t.getElementsByTagName(e);return Array.from(n)},e.prototype.getElements=function(t,e){var r,n,o=[];try{for(var a=i(t),s=a.next();!s.done;s=a.next()){var l=s.value;"string"==typeof l?o=o.concat(Array.from(this.document.querySelectorAll(l))):Array.isArray(l)||l instanceof this.window.NodeList||l instanceof this.window.HTMLCollection?o=o.concat(Array.from(l)):o.push(l)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o},e.prototype.contains=function(t,e){return t.contains(e)},e.prototype.parent=function(t){return t.parentNode},e.prototype.append=function(t,e){return t.appendChild(e)},e.prototype.insert=function(t,e){return this.parent(e).insertBefore(t,e)},e.prototype.remove=function(t){return this.parent(t).removeChild(t)},e.prototype.replace=function(t,e){return this.parent(e).replaceChild(t,e)},e.prototype.clone=function(t){return t.cloneNode(!0)},e.prototype.split=function(t,e){return t.splitText(e)},e.prototype.next=function(t){return t.nextSibling},e.prototype.previous=function(t){return t.previousSibling},e.prototype.firstChild=function(t){return t.firstChild},e.prototype.lastChild=function(t){return t.lastChild},e.prototype.childNodes=function(t){return Array.from(t.childNodes)},e.prototype.childNode=function(t,e){return t.childNodes[e]},e.prototype.kind=function(t){var e=t.nodeType;return 1===e||3===e||8===e?t.nodeName.toLowerCase():""},e.prototype.value=function(t){return t.nodeValue||""},e.prototype.textContent=function(t){return t.textContent},e.prototype.innerHTML=function(t){return t.innerHTML},e.prototype.outerHTML=function(t){return t.outerHTML},e.prototype.serializeXML=function(t){return(new this.window.XMLSerializer).serializeToString(t)},e.prototype.setAttribute=function(t,e,r,n){return void 0===n&&(n=null),n?(e=n.replace(/.*\//,"")+":"+e.replace(/^.*:/,""),t.setAttributeNS(n,e,r)):t.setAttribute(e,r)},e.prototype.getAttribute=function(t,e){return t.getAttribute(e)},e.prototype.removeAttribute=function(t,e){return t.removeAttribute(e)},e.prototype.hasAttribute=function(t,e){return t.hasAttribute(e)},e.prototype.allAttributes=function(t){return Array.from(t.attributes).map((function(t){return{name:t.name,value:t.value}}))},e.prototype.addClass=function(t,e){t.classList?t.classList.add(e):t.className=(t.className+" "+e).trim()},e.prototype.removeClass=function(t,e){t.classList?t.classList.remove(e):t.className=t.className.split(/ /).filter((function(t){return t!==e})).join(" ")},e.prototype.hasClass=function(t,e){return t.classList?t.classList.contains(e):t.className.split(/ /).indexOf(e)>=0},e.prototype.setStyle=function(t,e,r){t.style[e]=r},e.prototype.getStyle=function(t,e){return t.style[e]},e.prototype.allStyles=function(t){return t.style.cssText},e.prototype.insertRules=function(t,e){var r,n;try{for(var o=i(e.reverse()),a=o.next();!a.done;a=o.next()){var s=a.value;try{t.sheet.insertRule(s,0)}catch(t){console.warn("MathJax: can't insert css rule '"+s+"': "+t.message)}}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},e.prototype.fontSize=function(t){var e=this.window.getComputedStyle(t);return parseFloat(e.fontSize)},e.prototype.fontFamily=function(t){return this.window.getComputedStyle(t).fontFamily||""},e.prototype.nodeSize=function(t,e,r){if(void 0===e&&(e=1),void 0===r&&(r=!1),r&&t.getBBox){var n=t.getBBox();return[n.width/e,n.height/e]}return[t.offsetWidth/e,t.offsetHeight/e]},e.prototype.nodeBBox=function(t){var e=t.getBoundingClientRect();return{left:e.left,right:e.right,top:e.top,bottom:e.bottom}},e}(r(5009).AbstractDOMAdaptor);e.HTMLAdaptor=a},6191:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.browserAdaptor=void 0;var n=r(444);e.browserAdaptor=function(){return new n.HTMLAdaptor(window)}},7062:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.LiteDocument=void 0;var n=r(1168),o=function(){function t(){this.root=new n.LiteElement("html",{},[this.head=new n.LiteElement("head"),this.body=new n.LiteElement("body")]),this.type=""}return Object.defineProperty(t.prototype,"kind",{get:function(){return"#document"},enumerable:!1,configurable:!0}),t}();e.LiteDocument=o},1168:function(t,e){var r=this&&this.__assign||function(){return(r=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t},i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.LiteElement=void 0;var a=function(t,e,a){var s,l;void 0===e&&(e={}),void 0===a&&(a=[]),this.kind=t,this.attributes=r({},e),this.children=o([],n(a));try{for(var u=i(this.children),c=u.next();!c.done;c=u.next())c.value.parent=this}catch(t){s={error:t}}finally{try{c&&!c.done&&(l=u.return)&&l.call(u)}finally{if(s)throw s.error}}this.styles=null};e.LiteElement=a},315:function(t,e){var r=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},n=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.LiteList=void 0;var o=function(){function t(t){this.nodes=[],this.nodes=n([],r(t))}return t.prototype.append=function(t){this.nodes.push(t)},t.prototype[Symbol.iterator]=function(){var t=0;return{next:function(){return t===this.nodes.length?{value:null,done:!0}:{value:this.nodes[t++],done:!1}}}},t}();e.LiteList=o},5020:function(t,e,r){var n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.LiteParser=e.PATTERNS=void 0;var i,a=r(5368),s=r(1168),l=r(2560);!function(t){t.TAGNAME="[a-z][^\\s\\n>]*",t.ATTNAME="[a-z][^\\s\\n>=]*",t.VALUE="(?:'[^']*'|\"[^\"]*\"|[^\\s\\n]+)",t.VALUESPLIT="(?:'([^']*)'|\"([^\"]*)\"|([^\\s\\n]+))",t.SPACE="(?:\\s|\\n)+",t.OPTIONALSPACE="(?:\\s|\\n)*",t.ATTRIBUTE=t.ATTNAME+"(?:"+t.OPTIONALSPACE+"="+t.OPTIONALSPACE+t.VALUE+")?",t.ATTRIBUTESPLIT="("+t.ATTNAME+")(?:"+t.OPTIONALSPACE+"="+t.OPTIONALSPACE+t.VALUESPLIT+")?",t.TAG="(<(?:"+t.TAGNAME+"(?:"+t.SPACE+t.ATTRIBUTE+")*"+t.OPTIONALSPACE+"/?|/"+t.TAGNAME+"|!--[^]*?--|![^]*?)(?:>|$))",t.tag=new RegExp(t.TAG,"i"),t.attr=new RegExp(t.ATTRIBUTE,"i"),t.attrsplit=new RegExp(t.ATTRIBUTESPLIT,"i")}(i=e.PATTERNS||(e.PATTERNS={}));var u=function(){function t(){}return t.prototype.parseFromString=function(t,e,r){void 0===e&&(e="text/html"),void 0===r&&(r=null);for(var n=r.createDocument(),o=r.body(n),a=t.replace(/<\?.*?\?>/g,"").split(i.tag);a.length;){var s=a.shift(),l=a.shift();s&&this.addText(r,o,s),l&&">"===l.charAt(l.length-1)&&("!"===l.charAt(1)?this.addComment(r,o,l):o="/"===l.charAt(1)?this.closeTag(r,o,l):this.openTag(r,o,l,a))}return this.checkDocument(r,n),n},t.prototype.addText=function(t,e,r){return r=a.translate(r),t.append(e,t.text(r))},t.prototype.addComment=function(t,e,r){return t.append(e,new l.LiteComment(r))},t.prototype.closeTag=function(t,e,r){for(var n=r.slice(2,r.length-1).toLowerCase();t.parent(e)&&t.kind(e)!==n;)e=t.parent(e);return t.parent(e)},t.prototype.openTag=function(t,e,r,n){var o=this.constructor.PCDATA,a=this.constructor.SELF_CLOSING,s=r.match(/<(.*?)[\s\n>\/]/)[1].toLowerCase(),l=t.node(s),u=r.replace(/^<.*?[\s\n>]/,"").split(i.attrsplit);return(u.pop().match(/>$/)||u.length<5)&&(this.addAttributes(t,l,u),t.append(e,l),a[s]||r.match(/\/>$/)||(o[s]?this.handlePCDATA(t,l,s,n):e=l)),e},t.prototype.addAttributes=function(t,e,r){for(var o=this.constructor.CDATA_ATTR;r.length;){var i=n(r.splice(0,5),5),s=i[1],l=i[2],u=i[3],c=i[4],p=l||u||c||"";o[s]||(p=a.translate(p)),t.setAttribute(e,s,p)}},t.prototype.handlePCDATA=function(t,e,r,n){for(var o=[],i="</"+r+">",a="";n.length&&a!==i;)o.push(a),o.push(n.shift()),a=n.shift();t.append(e,t.text(o.join("")))},t.prototype.checkDocument=function(t,e){var r,n,i,a,s=this.getOnlyChild(t,t.body(e));if(s){try{for(var u=o(t.childNodes(t.body(e))),c=u.next();!c.done;c=u.next()){if((h=c.value)===s)break;h instanceof l.LiteComment&&h.value.match(/^<!DOCTYPE/)&&(e.type=h.value)}}catch(t){r={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}switch(t.kind(s)){case"html":try{for(var p=o(s.children),f=p.next();!f.done;f=p.next()){var h=f.value;switch(t.kind(h)){case"head":e.head=h;break;case"body":e.body=h}}}catch(t){i={error:t}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}e.root=s,t.remove(s),t.parent(e.body)!==s&&t.append(s,e.body),t.parent(e.head)!==s&&t.insert(e.head,e.body);break;case"head":e.head=t.replace(s,e.head);break;case"body":e.body=t.replace(s,e.body)}}},t.prototype.getOnlyChild=function(t,e){var r,n,i=null;try{for(var a=o(t.childNodes(e)),l=a.next();!l.done;l=a.next()){var u=l.value;if(u instanceof s.LiteElement){if(i)return null;i=u}}}catch(t){r={error:t}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},t.prototype.serialize=function(t,e,r){var n=this;void 0===r&&(r=!1);var o=this.constructor.SELF_CLOSING,i=this.constructor.CDATA_ATTR,a=t.kind(e),s=t.allAttributes(e).map((function(t){return t.name+'="'+(i[t.name]?t.value:n.protectAttribute(t.value))+'"'})).join(" "),l=this.serializeInner(t,e,r);return"<"+a+(s?" "+s:"")+(r&&!l||o[a]?r?"/>":">":">"+l+"</"+a+">")},t.prototype.serializeInner=function(t,e,r){var n=this;return void 0===r&&(r=!1),this.constructor.PCDATA.hasOwnProperty(e.kind)?t.childNodes(e).map((function(e){return t.value(e)})).join(""):t.childNodes(e).map((function(e){var o=t.kind(e);return"#text"===o?n.protectHTML(t.value(e)):"#comment"===o?e.value:n.serialize(t,e,r)})).join("")},t.prototype.protectAttribute=function(t){return"string"!=typeof t&&(t=String(t)),t.replace(/"/g,"&quot;")},t.prototype.protectHTML=function(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},t.SELF_CLOSING={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,menuitem:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},t.PCDATA={option:!0,textarea:!0,fieldset:!0,title:!0,style:!0,script:!0},t.CDATA_ATTR={style:!0,datafld:!0,datasrc:!0,href:!0,src:!0,longdesc:!0,usemap:!0,cite:!0,datetime:!0,action:!0,axis:!0,profile:!0,content:!0,scheme:!0},t}();e.LiteParser=u},2560:function(t,e){var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0}),e.LiteComment=e.LiteText=void 0;var o=function(){function t(t){void 0===t&&(t=""),this.value=t}return Object.defineProperty(t.prototype,"kind",{get:function(){return"#text"},enumerable:!1,configurable:!0}),t}();e.LiteText=o;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),Object.defineProperty(e.prototype,"kind",{get:function(){return"#comment"},enumerable:!1,configurable:!0}),e}(o);e.LiteComment=i},1248:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.LiteWindow=void 0;var n=r(1168),o=r(7062),i=r(315),a=r(5020),s=function(){this.DOMParser=a.LiteParser,this.NodeList=i.LiteList,this.HTMLCollection=i.LiteList,this.HTMLElement=n.LiteElement,this.DocumentFragment=i.LiteList,this.Document=o.LiteDocument,this.document=new o.LiteDocument};e.LiteWindow=s},4907:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},l=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.liteAdaptor=e.LiteAdaptor=void 0;var u=r(5009),c=r(7062),p=r(1168),f=r(2560),h=r(1248),d=r(5020),y=r(8054),O=r(7233),m=function(t){function e(e){void 0===e&&(e=null);var r=t.call(this)||this,n=r.constructor;return r.options=O.userOptions(O.defaultOptions({},n.OPTIONS),e),r.parser=new d.LiteParser,r.window=new h.LiteWindow,r}return o(e,t),e.prototype.parse=function(t,e){return this.parser.parseFromString(t,e,this)},e.prototype.create=function(t,e){return void 0===e&&(e=null),new p.LiteElement(t)},e.prototype.text=function(t){return new f.LiteText(t)},e.prototype.comment=function(t){return new f.LiteComment(t)},e.prototype.createDocument=function(){return new c.LiteDocument},e.prototype.head=function(t){return t.head},e.prototype.body=function(t){return t.body},e.prototype.root=function(t){return t.root},e.prototype.doctype=function(t){return t.type},e.prototype.tags=function(t,e,r){void 0===r&&(r=null);var n=[],o=[];if(r)return o;for(var i=t;i;){var a=i.kind;"#text"!==a&&"#comment"!==a&&(i=i,a===e&&o.push(i),i.children.length&&(n=i.children.concat(n))),i=n.shift()}return o},e.prototype.elementById=function(t,e){for(var r=[],n=t;n;){if("#text"!==n.kind&&"#comment"!==n.kind){if((n=n).attributes.id===e)return n;n.children.length&&(r=n.children.concat(r))}n=r.shift()}return null},e.prototype.elementsByClass=function(t,e){for(var r=[],n=[],o=t;o;){if("#text"!==o.kind&&"#comment"!==o.kind)((o=o).attributes.class||"").trim().split(/ +/).includes(e)&&n.push(o),o.children.length&&(r=o.children.concat(r));o=r.shift()}return n},e.prototype.getElements=function(t,e){var r,n,o=[],i=this.body(e);try{for(var s=a(t),l=s.next();!l.done;l=s.next()){var u=l.value;if("string"==typeof u)if("#"===u.charAt(0)){var c=this.elementById(i,u.slice(1));c&&o.push(c)}else"."===u.charAt(0)?o=o.concat(this.elementsByClass(i,u.slice(1))):u.match(/^[-a-z][-a-z0-9]*$/i)&&(o=o.concat(this.tags(i,u)));else Array.isArray(u)?o=o.concat(u):u instanceof this.window.NodeList||u instanceof this.window.HTMLCollection?o=o.concat(u.nodes):o.push(u)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return o},e.prototype.contains=function(t,e){for(;e&&e!==t;)e=this.parent(e);return!!e},e.prototype.parent=function(t){return t.parent},e.prototype.childIndex=function(t){return t.parent?t.parent.children.findIndex((function(e){return e===t})):-1},e.prototype.append=function(t,e){return e.parent&&this.remove(e),t.children.push(e),e.parent=t,e},e.prototype.insert=function(t,e){if(t.parent&&this.remove(t),e&&e.parent){var r=this.childIndex(e);e.parent.children.splice(r,0,t),t.parent=e.parent}},e.prototype.remove=function(t){var e=this.childIndex(t);return e>=0&&t.parent.children.splice(e,1),t.parent=null,t},e.prototype.replace=function(t,e){var r=this.childIndex(e);return r>=0&&(e.parent.children[r]=t,t.parent=e.parent,e.parent=null),e},e.prototype.clone=function(t){var e=this,r=new p.LiteElement(t.kind);return r.attributes=i({},t.attributes),r.children=t.children.map((function(t){if("#text"===t.kind)return new f.LiteText(t.value);if("#comment"===t.kind)return new f.LiteComment(t.value);var n=e.clone(t);return n.parent=r,n})),r},e.prototype.split=function(t,e){var r=new f.LiteText(t.value.slice(e));return t.value=t.value.slice(0,e),t.parent.children.splice(this.childIndex(t)+1,0,r),r.parent=t.parent,r},e.prototype.next=function(t){var e=t.parent;if(!e)return null;var r=this.childIndex(t)+1;return r>=0&&r<e.children.length?e.children[r]:null},e.prototype.previous=function(t){var e=t.parent;if(!e)return null;var r=this.childIndex(t)-1;return r>=0?e.children[r]:null},e.prototype.firstChild=function(t){return t.children[0]},e.prototype.lastChild=function(t){return t.children[t.children.length-1]},e.prototype.childNodes=function(t){return l([],s(t.children))},e.prototype.childNode=function(t,e){return t.children[e]},e.prototype.kind=function(t){return t.kind},e.prototype.value=function(t){return"#text"===t.kind?t.value:"#comment"===t.kind?t.value.replace(/^<!(--)?((?:.|\n)*)\1>$/,"$2"):""},e.prototype.textContent=function(t){var e=this;return t.children.reduce((function(t,r){return t+("#text"===r.kind?r.value:"#comment"===r.kind?"":e.textContent(r))}),"")},e.prototype.innerHTML=function(t){return this.parser.serializeInner(this,t)},e.prototype.outerHTML=function(t){return this.parser.serialize(this,t)},e.prototype.serializeXML=function(t){return this.parser.serialize(this,t,!0)},e.prototype.setAttribute=function(t,e,r,n){void 0===n&&(n=null),"string"!=typeof r&&(r=String(r)),n&&(e=n.replace(/.*\//,"")+":"+e.replace(/^.*:/,"")),t.attributes[e]=r,"style"===e&&(t.styles=null)},e.prototype.getAttribute=function(t,e){return t.attributes[e]},e.prototype.removeAttribute=function(t,e){delete t.attributes[e]},e.prototype.hasAttribute=function(t,e){return t.attributes.hasOwnProperty(e)},e.prototype.allAttributes=function(t){var e,r,n=t.attributes,o=[];try{for(var i=a(Object.keys(n)),s=i.next();!s.done;s=i.next()){var l=s.value;o.push({name:l,value:n[l]})}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return o},e.prototype.addClass=function(t,e){var r=(t.attributes.class||"").split(/ /);r.find((function(t){return t===e}))||(r.push(e),t.attributes.class=r.join(" "))},e.prototype.removeClass=function(t,e){var r=(t.attributes.class||"").split(/ /),n=r.findIndex((function(t){return t===e}));n>=0&&(r.splice(n,1),t.attributes.class=r.join(" "))},e.prototype.hasClass=function(t,e){return!!(t.attributes.class||"").split(/ /).find((function(t){return t===e}))},e.prototype.setStyle=function(t,e,r){t.styles||(t.styles=new y.Styles(this.getAttribute(t,"style"))),t.styles.set(e,r),t.attributes.style=t.styles.cssText},e.prototype.getStyle=function(t,e){if(!t.styles){var r=this.getAttribute(t,"style");if(!r)return"";t.styles=new y.Styles(r)}return t.styles.get(e)},e.prototype.allStyles=function(t){return this.getAttribute(t,"style")},e.prototype.insertRules=function(t,e){t.children=[this.text(e.join("\n\n")+"\n\n"+this.textContent(t))]},e.prototype.fontSize=function(t){return this.options.fontSize},e.prototype.fontFamily=function(t){return this.options.fontFamily},e.prototype.nodeSize=function(t,r,n){void 0===r&&(r=1),void 0===n&&(n=null);var o=this.textContent(t),i=Array.from(o.replace(e.cjkPattern,"")).length;return[(Array.from(o).length-i)*this.options.cjkCharWidth+i*this.options.unknownCharWidth,this.options.unknownCharHeight]},e.prototype.nodeBBox=function(t){return{left:0,right:0,top:0,bottom:0}},e.OPTIONS={fontSize:16,fontFamily:"Times",cjkCharWidth:1,unknownCharWidth:.6,unknownCharHeight:.8},e.cjkPattern=new RegExp(["[","\u1100-\u115f","\u2329\u232a","\u2e80-\u303e","\u3040-\u3247","\u3250-\u4dbf","\u4e00-\ua4c6","\ua960-\ua97c","\uac00-\ud7a3","\uf900-\ufaff","\ufe10-\ufe19","\ufe30-\ufe6b","\uff01-\uff60\uffe0-\uffe6","\ud82c\udc00-\ud82c\udc01","\ud83c\ude00-\ud83c\ude51","\ud840\udc00-\ud8bf\udffd","]"].join(""),"gu"),e}(u.AbstractDOMAdaptor);e.LiteAdaptor=m,e.liteAdaptor=function(t){return void 0===t&&(t=null),new m(t)}},9515:function(t,e,r){var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function o(t){return"object"==typeof t&&null!==t}function i(t,e){var r,a;try{for(var s=n(Object.keys(e)),l=s.next();!l.done;l=s.next()){var u=l.value;"__esModule"!==u&&(!o(t[u])||!o(e[u])||e[u]instanceof Promise?null!==e[u]&&void 0!==e[u]&&(t[u]=e[u]):i(t[u],e[u]))}}catch(t){r={error:t}}finally{try{l&&!l.done&&(a=s.return)&&a.call(s)}finally{if(r)throw r.error}}return t}Object.defineProperty(e,"__esModule",{value:!0}),e.MathJax=e.combineWithMathJax=e.combineDefaults=e.combineConfig=e.isObject=void 0,e.isObject=o,e.combineConfig=i,e.combineDefaults=function t(e,r,i){var a,s;e[r]||(e[r]={}),e=e[r];try{for(var l=n(Object.keys(i)),u=l.next();!u.done;u=l.next()){var c=u.value;o(e[c])&&o(i[c])?t(e,c,i[c]):null==e[c]&&null!=i[c]&&(e[c]=i[c])}}catch(t){a={error:t}}finally{try{u&&!u.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}return e},e.combineWithMathJax=function(t){return i(e.MathJax,t)},void 0===r.g.MathJax&&(r.g.MathJax={}),r.g.MathJax.version||(r.g.MathJax={version:"3.2.0",_:{},config:r.g.MathJax}),e.MathJax=r.g.MathJax},235:function(t,e,r){var n,o,i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.CONFIG=e.MathJax=e.Loader=e.PathFilters=e.PackageError=e.Package=void 0;var a=r(9515),s=r(265),l=r(265);Object.defineProperty(e,"Package",{enumerable:!0,get:function(){return l.Package}}),Object.defineProperty(e,"PackageError",{enumerable:!0,get:function(){return l.PackageError}});var u,c=r(7525);if(e.PathFilters={source:function(t){return e.CONFIG.source.hasOwnProperty(t.name)&&(t.name=e.CONFIG.source[t.name]),!0},normalize:function(t){var e=t.name;return e.match(/^(?:[a-z]+:\/)?\/|[a-z]:\\|\[/i)||(t.name="[mathjax]/"+e.replace(/^\.\//,"")),t.addExtension&&!e.match(/\.[^\/]+$/)&&(t.name+=".js"),!0},prefix:function(t){for(var r;(r=t.name.match(/^\[([^\]]*)\]/))&&e.CONFIG.paths.hasOwnProperty(r[1]);)t.name=e.CONFIG.paths[r[1]]+t.name.substr(r[0].length);return!0}},function(t){t.ready=function(){for(var t,e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];0===r.length&&(r=Array.from(s.Package.packages.keys()));var o=[];try{for(var a=i(r),l=a.next();!l.done;l=a.next()){var u=l.value,c=s.Package.packages.get(u)||new s.Package(u,!0);o.push(c.promise)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return Promise.all(o)},t.load=function(){for(var t,r,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(0===n.length)return Promise.resolve();var a=[];try{for(var l=i(n),u=l.next();!u.done;u=l.next()){var c=u.value,p=s.Package.packages.get(c);p||(p=new s.Package(c)).provides(e.CONFIG.provides[c]),p.checkNoLoad(),a.push(p.promise)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}return s.Package.loadAll(),Promise.all(a)},t.preLoad=function(){for(var t,r,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];try{for(var a=i(n),l=a.next();!l.done;l=a.next()){var u=l.value,c=s.Package.packages.get(u);c||(c=new s.Package(u,!0)).provides(e.CONFIG.provides[u]),c.loaded()}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}},t.defaultReady=function(){void 0!==e.MathJax.startup&&e.MathJax.config.startup.ready()},t.getRoot=function(){var t="//../../es5";if("undefined"!=typeof document){var e=document.currentScript||document.getElementById("MathJax-script");e&&(t=e.src.replace(/\/[^\/]*$/,""))}return t},t.pathFilters=new c.FunctionList,t.pathFilters.add(e.PathFilters.source,0),t.pathFilters.add(e.PathFilters.normalize,10),t.pathFilters.add(e.PathFilters.prefix,20)}(u=e.Loader||(e.Loader={})),e.MathJax=a.MathJax,void 0===e.MathJax.loader){a.combineDefaults(e.MathJax.config,"loader",{paths:{mathjax:u.getRoot()},source:{},dependencies:{},provides:{},load:[],ready:u.defaultReady.bind(u),failed:function(t){return console.log("MathJax("+(t.package||"?")+"): "+t.message)},require:null,pathFilters:[]}),a.combineWithMathJax({loader:u});try{for(var p=i(e.MathJax.config.loader.pathFilters),f=p.next();!f.done;f=p.next()){var h=f.value;Array.isArray(h)?u.pathFilters.add(h[0],h[1]):u.pathFilters.add(h)}}catch(t){n={error:t}}finally{try{f&&!f.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}}e.CONFIG=e.MathJax.config.loader},265:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},s=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.Package=e.PackageError=void 0;var l=r(235),u=function(t){function e(e,r){var n=t.call(this,e)||this;return n.package=r,n}return o(e,t),e}(Error);e.PackageError=u;var c=function(){function t(e,r){void 0===r&&(r=!1),this.isLoaded=!1,this.isLoading=!1,this.hasFailed=!1,this.dependents=[],this.dependencies=[],this.dependencyCount=0,this.provided=[],this.name=e,this.noLoad=r,t.packages.set(e,this),this.promise=this.makePromise(this.makeDependencies())}return Object.defineProperty(t.prototype,"canLoad",{get:function(){return 0===this.dependencyCount&&!this.noLoad&&!this.isLoading&&!this.hasFailed},enumerable:!1,configurable:!0}),t.resolvePath=function(t,e){void 0===e&&(e=!0);var r={name:t,original:t,addExtension:e};return l.Loader.pathFilters.execute(r),r.name},t.loadAll=function(){var t,e;try{for(var r=i(this.packages.values()),n=r.next();!n.done;n=r.next()){var o=n.value;o.canLoad&&o.load()}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.makeDependencies=function(){var e,r,n=[],o=t.packages,u=this.noLoad,c=this.name,p=[];l.CONFIG.dependencies.hasOwnProperty(c)?p.push.apply(p,s([],a(l.CONFIG.dependencies[c]))):"core"!==c&&p.push("core");try{for(var f=i(p),h=f.next();!h.done;h=f.next()){var d=h.value,y=o.get(d)||new t(d,u);this.dependencies.indexOf(y)<0&&(y.addDependent(this,u),this.dependencies.push(y),y.isLoaded||(this.dependencyCount++,n.push(y.promise)))}}catch(t){e={error:t}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(e)throw e.error}}return n},t.prototype.makePromise=function(t){var e=this,r=new Promise((function(t,r){e.resolve=t,e.reject=r})),n=l.CONFIG[this.name]||{};return n.ready&&(r=r.then((function(t){return n.ready(e.name)}))),t.length&&(t.push(r),r=Promise.all(t).then((function(t){return t.join(", ")}))),n.failed&&r.catch((function(t){return n.failed(new u(t,e.name))})),r},t.prototype.load=function(){if(!this.isLoaded&&!this.isLoading&&!this.noLoad){this.isLoading=!0;var e=t.resolvePath(this.name);l.CONFIG.require?this.loadCustom(e):this.loadScript(e)}},t.prototype.loadCustom=function(t){var e=this;try{var r=l.CONFIG.require(t);r instanceof Promise?r.then((function(){return e.checkLoad()})).catch((function(r){return e.failed("Can't load \""+t+'"\n'+r.message.trim())})):this.checkLoad()}catch(t){this.failed(t.message)}},t.prototype.loadScript=function(t){var e=this,r=document.createElement("script");r.src=t,r.charset="UTF-8",r.onload=function(t){return e.checkLoad()},r.onerror=function(r){return e.failed("Can't load \""+t+'"')},document.head.appendChild(r)},t.prototype.loaded=function(){var t,e,r,n;this.isLoaded=!0,this.isLoading=!1;try{for(var o=i(this.dependents),a=o.next();!a.done;a=o.next()){a.value.requirementSatisfied()}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}try{for(var s=i(this.provided),l=s.next();!l.done;l=s.next()){l.value.loaded()}}catch(t){r={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}this.resolve(this.name)},t.prototype.failed=function(t){this.hasFailed=!0,this.isLoading=!1,this.reject(new u(t,this.name))},t.prototype.checkLoad=function(){var t=this;((l.CONFIG[this.name]||{}).checkReady||function(){return Promise.resolve()})().then((function(){return t.loaded()})).catch((function(e){return t.failed(e)}))},t.prototype.requirementSatisfied=function(){this.dependencyCount&&(this.dependencyCount--,this.canLoad&&this.load())},t.prototype.provides=function(e){var r,n;void 0===e&&(e=[]);try{for(var o=i(e),a=o.next();!a.done;a=o.next()){var s=a.value,u=t.packages.get(s);u||(l.CONFIG.dependencies[s]||(l.CONFIG.dependencies[s]=[]),l.CONFIG.dependencies[s].push(s),(u=new t(s,!0)).isLoading=!0),this.provided.push(u)}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},t.prototype.addDependent=function(t,e){this.dependents.push(t),e||this.checkNoLoad()},t.prototype.checkNoLoad=function(){var t,e;if(this.noLoad){this.noLoad=!1;try{for(var r=i(this.dependencies),n=r.next();!n.done;n=r.next()){n.value.checkNoLoad()}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}}},t.packages=new Map,t}();e.Package=c},2388:function(t,e,r){var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},a=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.CONFIG=e.MathJax=e.Startup=void 0;var s,l=r(9515),u=r(8666),c=r(7233);!function(t){var s,l,c=new u.PrioritizedList;function f(e){return s.visitTree(e,t.document)}function h(){s=new e.MathJax._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor,l=e.MathJax._.mathjax.mathjax,t.input=M(),t.output=b(),t.adaptor=E(),t.handler&&l.handlers.unregister(t.handler),t.handler=g(),t.handler&&(l.handlers.register(t.handler),t.document=x())}function d(){var e,r;t.input&&t.output&&y();var n=t.output?t.output.name.toLowerCase():"";try{for(var i=o(t.input),a=i.next();!a.done;a=i.next()){var s=a.value,l=s.name.toLowerCase();m(l,s),v(l,s),t.output&&O(l,n,s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}function y(){e.MathJax.typeset=function(e){void 0===e&&(e=null),t.document.options.elements=e,t.document.reset(),t.document.render()},e.MathJax.typesetPromise=function(e){return void 0===e&&(e=null),t.document.options.elements=e,t.document.reset(),l.handleRetriesFor((function(){t.document.render()}))},e.MathJax.typesetClear=function(e){void 0===e&&(e=null),e?t.document.clearMathItemsWithin(e):t.document.clear()}}function O(r,n,o){var i=r+"2"+n;e.MathJax[i]=function(e,r){return void 0===r&&(r={}),r.format=o.name,t.document.convert(e,r)},e.MathJax[i+"Promise"]=function(e,r){return void 0===r&&(r={}),r.format=o.name,l.handleRetriesFor((function(){return t.document.convert(e,r)}))},e.MathJax[n+"Stylesheet"]=function(){return t.output.styleSheet(t.document)},"getMetricsFor"in t.output&&(e.MathJax.getMetricsFor=function(e,r){return t.output.getMetricsFor(e,r)})}function m(r,n){var o=e.MathJax._.core.MathItem.STATE;e.MathJax[r+"2mml"]=function(e,r){return void 0===r&&(r={}),r.end=o.CONVERT,r.format=n.name,f(t.document.convert(e,r))},e.MathJax[r+"2mmlPromise"]=function(e,r){return void 0===r&&(r={}),r.end=o.CONVERT,r.format=n.name,l.handleRetriesFor((function(){return f(t.document.convert(e,r))}))}}function v(t,r){e.MathJax[t+"Reset"]=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return r.reset.apply(r,a([],i(t)))}}function M(){var r,n,i=[];try{for(var a=o(e.CONFIG.input),s=a.next();!s.done;s=a.next()){var l=s.value,u=t.constructors[l];if(!u)throw Error('Input Jax "'+l+'" is not defined (has it been loaded?)');i.push(new u(e.MathJax.config[l]))}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}function b(){var r=e.CONFIG.output;if(!r)return null;var n=t.constructors[r];if(!n)throw Error('Output Jax "'+r+'" is not defined (has it been loaded?)');return new n(e.MathJax.config[r])}function E(){var r=e.CONFIG.adaptor;if(!r||"none"===r)return null;var n=t.constructors[r];if(!n)throw Error('DOMAdaptor "'+r+'" is not defined (has it been loaded?)');return n(e.MathJax.config[r])}function g(){var r,n,i=e.CONFIG.handler;if(!i||"none"===i||!t.adaptor)return null;var a=t.constructors[i];if(!a)throw Error('Handler "'+i+'" is not defined (has it been loaded?)');var s=new a(t.adaptor,5);try{for(var l=o(c),u=l.next();!u.done;u=l.next()){s=u.value.item(s)}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}return s}function x(r){return void 0===r&&(r=null),l.document(r||e.CONFIG.document,n(n({},e.MathJax.config.options),{InputJax:t.input,OutputJax:t.output}))}t.constructors={},t.input=[],t.output=null,t.handler=null,t.adaptor=null,t.elements=null,t.document=null,t.promise=new Promise((function(e,r){t.promiseResolve=e,t.promiseReject=r})),t.pagePromise=new Promise((function(t,e){var n=r.g.document;if(n&&n.readyState&&"complete"!==n.readyState&&"interactive"!==n.readyState){var o=function(){return t()};n.defaultView.addEventListener("load",o,!0),n.defaultView.addEventListener("DOMContentLoaded",o,!0)}else t()})),t.toMML=f,t.registerConstructor=function(e,r){t.constructors[e]=r},t.useHandler=function(t,r){void 0===r&&(r=!1),e.CONFIG.handler&&!r||(e.CONFIG.handler=t)},t.useAdaptor=function(t,r){void 0===r&&(r=!1),e.CONFIG.adaptor&&!r||(e.CONFIG.adaptor=t)},t.useInput=function(t,r){void 0===r&&(r=!1),p&&!r||e.CONFIG.input.push(t)},t.useOutput=function(t,r){void 0===r&&(r=!1),e.CONFIG.output&&!r||(e.CONFIG.output=t)},t.extendHandler=function(t,e){void 0===e&&(e=10),c.add(t,e)},t.defaultReady=function(){h(),d(),t.pagePromise.then((function(){return e.CONFIG.pageReady()})).then((function(){return t.promiseResolve()})).catch((function(e){return t.promiseReject(e)}))},t.defaultPageReady=function(){return e.CONFIG.typeset&&e.MathJax.typesetPromise?e.MathJax.typesetPromise(e.CONFIG.elements):Promise.resolve()},t.getComponents=h,t.makeMethods=d,t.makeTypesetMethods=y,t.makeOutputMethods=O,t.makeMmlMethods=m,t.makeResetMethod=v,t.getInputJax=M,t.getOutputJax=b,t.getAdaptor=E,t.getHandler=g,t.getDocument=x}(s=e.Startup||(e.Startup={})),e.MathJax=l.MathJax,void 0===e.MathJax._.startup&&(l.combineDefaults(e.MathJax.config,"startup",{input:[],output:"",handler:null,adaptor:null,document:"undefined"==typeof document?"":document,elements:null,typeset:!0,ready:s.defaultReady.bind(s),pageReady:s.defaultPageReady.bind(s)}),l.combineWithMathJax({startup:s,options:{}}),e.MathJax.config.startup.invalidOption&&(c.OPTIONS.invalidOption=e.MathJax.config.startup.invalidOption),e.MathJax.config.startup.optionError&&(c.OPTIONS.optionError=e.MathJax.config.startup.optionError)),e.CONFIG=e.MathJax.config.startup;var p=0!==e.CONFIG.input.length},5009:function(t,e){var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractDOMAdaptor=void 0;var n=function(){function t(t){void 0===t&&(t=null),this.document=t}return t.prototype.node=function(t,e,n,o){var i,a;void 0===e&&(e={}),void 0===n&&(n=[]);var s=this.create(t,o);this.setAttributes(s,e);try{for(var l=r(n),u=l.next();!u.done;u=l.next()){var c=u.value;this.append(s,c)}}catch(t){i={error:t}}finally{try{u&&!u.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return s},t.prototype.setAttributes=function(t,e){var n,o,i,a,s,l;if(e.style&&"string"!=typeof e.style)try{for(var u=r(Object.keys(e.style)),c=u.next();!c.done;c=u.next()){var p=c.value;this.setStyle(t,p.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()})),e.style[p])}}catch(t){n={error:t}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(n)throw n.error}}if(e.properties)try{for(var f=r(Object.keys(e.properties)),h=f.next();!h.done;h=f.next()){t[p=h.value]=e.properties[p]}}catch(t){i={error:t}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}try{for(var d=r(Object.keys(e)),y=d.next();!y.done;y=d.next()){"style"===(p=y.value)&&"string"!=typeof e.style||"properties"===p||this.setAttribute(t,p,e[p])}}catch(t){s={error:t}}finally{try{y&&!y.done&&(l=d.return)&&l.call(d)}finally{if(s)throw s.error}}},t.prototype.replace=function(t,e){return this.insert(t,e),this.remove(e),e},t.prototype.childNode=function(t,e){return this.childNodes(t)[e]},t.prototype.allClasses=function(t){var e=this.getAttribute(t,"class");return e?e.replace(/ +/g," ").replace(/^ /,"").replace(/ $/,"").split(/ /):[]},t}();e.AbstractDOMAdaptor=n},3494:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractFindMath=void 0;var n=r(7233),o=function(){function t(t){var e=this.constructor;this.options=n.userOptions(n.defaultOptions({},e.OPTIONS),t)}return t.OPTIONS={},t}();e.AbstractFindMath=o},3670:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractHandler=void 0;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(r(5722).AbstractMathDocument),a=function(){function t(t,e){void 0===e&&(e=5),this.documentClass=i,this.adaptor=t,this.priority=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.constructor.NAME},enumerable:!1,configurable:!0}),t.prototype.handlesDocument=function(t){return!1},t.prototype.create=function(t,e){return new this.documentClass(t,this.adaptor,e)},t.NAME="generic",t}();e.AbstractHandler=a},805:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.HandlerList=void 0;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.register=function(t){return this.add(t,t.priority)},e.prototype.unregister=function(t){this.remove(t)},e.prototype.handlesDocument=function(t){var e,r;try{for(var n=i(this),o=n.next();!o.done;o=n.next()){var a=o.value.item;if(a.handlesDocument(t))return a}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}throw new Error("Can't find handler for document")},e.prototype.document=function(t,e){return void 0===e&&(e=null),this.handlesDocument(t).create(t,e)},e}(r(8666).PrioritizedList);e.HandlerList=a},9206:function(t,e,r){Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractInputJax=void 0;var n=r(7233),o=r(7525),i=function(){function t(t){void 0===t&&(t={}),this.adaptor=null,this.mmlFactory=null;var e=this.constructor;this.options=n.userOptions(n.defaultOptions({},e.OPTIONS),t),this.preFilters=new o.FunctionList,this.postFilters=new o.FunctionList}return Object.defineProperty(t.prototype,"name",{get:function(){return this.constructor.NAME},enumerable:!1,configurable:!0}),t.prototype.setAdaptor=function(t){this.adaptor=t},t.prototype.setMmlFactory=function(t){this.mmlFactory=t},t.prototype.initialize=function(){},t.prototype.reset=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},Object.defineProperty(t.prototype,"processStrings",{get:function(){return!0},enumerable:!1,configurable:!0}),t.prototype.findMath=function(t,e){return[]},t.prototype.executeFilters=function(t,e,r,n){var o={math:e,document:r,data:n};return t.execute(o),o.data},t.NAME="generic",t.OPTIONS={},t}();e.AbstractInputJax=i},5722:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},s=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,o=t.length;r<n;r++,o++)t[o]=e[r];return t};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMathDocument=e.resetAllOptions=e.resetOptions=e.RenderList=void 0;var l=r(7233),u=r(9206),c=r(2975),p=r(9e3),f=r(4474),h=r(3909),d=r(6751),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.create=function(t){var e,r,n=new this;try{for(var o=i(Object.keys(t)),s=o.next();!s.done;s=o.next()){var l=s.value,u=a(this.action(l,t[l]),2),c=u[0],p=u[1];p&&n.add(c,p)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n},e.action=function(t,e){var r,n,o,i,s,l,u=!0,c=e[0];if(1===e.length||"boolean"==typeof e[1])2===e.length&&(u=e[1]),s=(r=a(this.methodActions(t),2))[0],l=r[1];else if("string"==typeof e[1])if("string"==typeof e[2]){4===e.length&&(u=e[3]);var p=a(e.slice(1),2),f=p[0],h=p[1];s=(n=a(this.methodActions(f,h),2))[0],l=n[1]}else 3===e.length&&(u=e[2]),s=(o=a(this.methodActions(e[1]),2))[0],l=o[1];else 4===e.length&&(u=e[3]),s=(i=a(e.slice(1),2))[0],l=i[1];return[{id:t,renderDoc:s,renderMath:l,convert:u},c]},e.methodActions=function(t,e){return void 0===e&&(e=t),[function(e){return t&&e[t](),!1},function(t,r){return e&&t[e](r),!1}]},e.prototype.renderDoc=function(t,e){var r,n;void 0===e&&(e=f.STATE.UNPROCESSED);try{for(var o=i(this.items),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.priority>=e&&s.item.renderDoc(t))return}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}},e.prototype.renderMath=function(t,e,r){var n,o;void 0===r&&(r=f.STATE.UNPROCESSED);try{for(var a=i(this.items),s=a.next();!s.done;s=a.next()){var l=s.value;if(l.priority>=r&&l.item.renderMath(t,e))return}}catch(t){n={error:t}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}},e.prototype.renderConvert=function(t,e,r){var n,o;void 0===r&&(r=f.STATE.LAST);try{for(var a=i(this.items),s=a.next();!s.done;s=a.next()){var l=s.value;if(l.priority>r)return;if(l.item.convert&&l.item.renderMath(t,e))return}}catch(t){n={error:t}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}},e.prototype.findID=function(t){var e,r;try{for(var n=i(this.items),o=n.next();!o.done;o=n.next()){var a=o.value;if(a.item.id===t)return a.item}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}return null},e}(r(8666).PrioritizedList);e.RenderList=y,e.resetOptions={all:!1,processed:!1,inputJax:null,outputJax:null},e.resetAllOptions={all:!0,processed:!0,inputJax:[],outputJax:[]};var O=function(t){function e(){return null