=t.length?void 0: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.Menu=void 0;var i=r(5713),c=r(4474),o=r(9515),a=r(7233),s=r(5865),l=r(473),p=r(4414),h=r(4922),f=r(6914),d=r(3463),y=r(7309),m=o.MathJax,v="undefined"!=typeof window&&window.navigator&&"Mac"===window.navigator.platform.substr(0,3),o=(Object.defineProperty(b.prototype,"isLoading",{get:function(){return 0/g,">")},b.prototype.toMML=function(t){return this.MmlVisitor.visitTree(t.root,t,{texHints:this.settings.texHints,semantics:this.settings.semantics&&"MathML"!==t.inputJax.name})},b.prototype.zoom=function(t,e,r){t&&!this.isZoomEvent(t,e)||(this.menu.mathItem=r,t&&this.menu.post(t),this.zoomBox.post())},b.prototype.isZoomEvent=function(t,e){return this.settings.zoom===e&&(!this.settings.alt||t.altKey)&&(!this.settings.ctrl||t.ctrlKey)&&(!this.settings.cmd||t.metaKey)&&(!this.settings.shift||t.shiftKey)},b.prototype.rerender=function(t){void 0===t&&(t=c.STATE.TYPESET),this.rerenderStart=Math.min(t,this.rerenderStart),b.loading||(this.rerenderStart<=c.STATE.COMPILED&&this.document.reset({inputJax:[]}),this.document.rerender(this.rerenderStart),this.rerenderStart=c.STATE.LAST)},b.prototype.copyMathML=function(){this.copyToClipboard(this.toMML(this.menu.mathItem))},b.prototype.copyOriginal=function(){this.copyToClipboard(this.menu.mathItem.math.trim())},b.prototype.copyAnnotation=function(){this.copyToClipboard(this.menu.annotation.trim())},b.prototype.copyToClipboard=function(t){var e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.style.cssText="height: 1px; width: 1px; padding: 1px; position: absolute; left: -10px",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch(t){alert("Can't copy to clipboard: "+t.message)}document.body.removeChild(e)},b.prototype.addMenu=function(e){var r=this,t=e.typesetRoot;t.addEventListener("contextmenu",function(){return r.menu.mathItem=e},!0),t.addEventListener("keydown",function(){return r.menu.mathItem=e},!0),t.addEventListener("click",function(t){return r.zoom(t,"Click",e)},!0),t.addEventListener("dblclick",function(t){return r.zoom(t,"DoubleClick",e)},!0),this.menu.store.insert(t)},b.prototype.clear=function(){this.menu.store.clear()},b.prototype.variable=function(e,r){var n=this;return{name:e,getter:function(){return n.settings[e]},setter:function(t){n.settings[e]=t,r&&r(t),n.saveUserSettings()}}},b.prototype.a11yVar=function(r,n){var o=this;return{name:r,getter:function(){return o.getA11y(r)},setter:function(t){o.settings[r]=t;var e={};e[r]=t,o.setA11y(e),n&&n(t),o.saveUserSettings()}}},b.prototype.submenu=function(t,e,r,n){var o,i;void 0===r&&(r=[]),void 0===n&&(n=!1);var a=[];try{for(var s=u(r),l=s.next();!l.done;l=s.next()){var c=l.value;Array.isArray(c)?a=a.concat(c):a.push(c)}}catch(t){o={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return{type:"submenu",id:t,content:e,menu:{items:a},disabled:0===a.length||n}},b.prototype.command=function(t,e,r,n){return void 0===n&&(n={}),Object.assign({type:"command",id:t,content:e,action:r},n)},b.prototype.checkbox=function(t,e,r,n){return void 0===n&&(n={}),Object.assign({type:"checkbox",id:t,content:e,variable:r},n)},b.prototype.radioGroup=function(e,t){var r=this;return t.map(function(t){return r.radio(t[0],t[1]||t[0],e)})},b.prototype.radio=function(t,e,r,n){return void 0===n&&(n={}),Object.assign({type:"radio",id:t,content:e,variable:r},n)},b.prototype.label=function(t,e){return{type:"label",id:t,content:e}},b.prototype.rule=function(){return{type:"rule"}},b.MENU_STORAGE="MathJax-Menu-Settings",b.OPTIONS={settings:{texHints:!0,semantics:!1,zoom:"NoZoom",zscale:"200%",renderer:"CHTML",alt:!1,cmd:!1,ctrl:!1,shift:!1,scale:1,autocollapse:!1,collapsible:!1,inTabOrder:!0,assistiveMml:!0,explorer:!1},jax:{CHTML:null,SVG:null},annotationTypes:a.expandable({TeX:["TeX","LaTeX","application/x-tex"],StarMath:["StarMath 5.0"],Maple:["Maple"],ContentMathML:["MathML-Content","application/mathml-content+xml"],OpenMath:["OpenMath"]})},b.loading=0,b.loadingPromises=new Map,b._loadingPromise=null,b._loadingOK=null,b._loadingFailed=null,b);function b(t,e){var r=this;void 0===e&&(e={}),this.settings=null,this.defaultSettings=null,this.menu=null,this.MmlVisitor=new l.MmlVisitor,this.jax={CHTML:null,SVG:null},this.rerenderStart=c.STATE.LAST,this.about=new h.Info('MathJax v'+i.mathjax.version,function(){var t=[];return t.push("Input Jax: "+r.document.inputJax.map(function(t){return t.name}).join(", ")),t.push("Output Jax: "+r.document.outputJax.name),t.push("Document Type: "+r.document.kind),t.join("
")},'www.mathjax.org'),this.help=new h.Info("MathJax Help",function(){return["MathJax is a JavaScript library that allows page"," authors to include mathematics within their web pages."," As a reader, you don't need to do anything to make that happen.
","Browsers: MathJax works with all modern browsers including"," Edge, Firefox, Chrome, Safari, Opera, and most mobile browsers.
","Math Menu: MathJax adds a contextual menu to equations."," Right-click or CTRL-click on any mathematics to access the menu.
",'',"
Show Math As: These options allow you to view the formula's"," source markup (as MathML or in its original format).
","
Copy to Clipboard: These options copy the formula's source markup,"," as MathML or in its original format, to the clipboard"," (in browsers that support that).
","
Math Settings: These give you control over features of MathJax,"," such the size of the mathematics, and the mechanism used"," to display equations.
","
Accessibility: MathJax can work with screen"," readers to make mathematics accessible to the visually impaired."," Turn on the explorer to enable generation of speech strings"," and the ability to investigate expressions interactively.
","
Language: This menu lets you select the language used by MathJax"," for its menus and warning messages. (Not yet implemented in version 3.)
","
","Math Zoom: If you are having difficulty reading an"," equation, MathJax can enlarge it to help you see it better, or"," you can scall all the math on the page to make it larger."," Turn these features on in the Math Settings menu.
","Preferences: MathJax uses your browser's localStorage database"," to save the preferences set via this menu locally in your browser. These"," are not used to track you, and are not transferred or used remotely by"," MathJax in any way.
"].join("\n")},'www.mathjax.org'),this.mathmlCode=new p.SelectableInfo("MathJax MathML Expression",function(){if(!r.menu.mathItem)return"";var t=r.toMML(r.menu.mathItem);return""+r.formatSource(t)+"
"},""),this.originalText=new p.SelectableInfo("MathJax Original Source",function(){if(!r.menu.mathItem)return"";var t=r.menu.mathItem.math;return''+r.formatSource(t)+"
"},""),this.annotationText=new p.SelectableInfo("MathJax Annotation Text",function(){if(!r.menu.mathItem)return"";var t=r.menu.annotation;return''+r.formatSource(t)+"
"},""),this.zoomBox=new h.Info("MathJax Zoomed Expression",function(){if(!r.menu.mathItem)return"";var t=r.menu.mathItem.typesetRoot.cloneNode(!0);return t.style.margin="0",''+t.outerHTML+"
"},""),this.document=t,this.options=a.userOptions(a.defaultOptions({},this.constructor.OPTIONS),e),this.initSettings(),this.mergeUserSettings(),this.initMenu()}e.Menu=o},4001:function(t,e,r){var n,i=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)}),a=this&&this.__assign||function(){return(a=Object.assign||function(t){for(var e,r=1,n=arguments.length;r=t.length?void 0: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.MenuHandler=e.MenuMathDocumentMixin=e.MenuMathItemMixin=void 0;var u=r(5713),p=r(4474),h=r(7233),f=r(8310);function d(t){return i(e,r=t),e.prototype.addMenu=function(t,e){void 0===e&&(e=!1),this.state()>=p.STATE.CONTEXT_MENU||(this.isEscaped||!t.options.enableMenu&&!e||t.menu.addMenu(this),this.state(p.STATE.CONTEXT_MENU))},e.prototype.checkLoading=function(t){t.checkLoading()},e;function e(){return null!==r&&r.apply(this,arguments)||this}var r}function o(t){var e,o;return i(r,o=t),r.prototype.addMenu=function(){var t,e;if(!this.processed.isSet("context-menu")){try{for(var r=c(this.math),n=r.next();!n.done;n=r.next())n.value.addMenu(this)}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this.processed.set("context-menu")}return this},r.prototype.checkLoading=function(){this.menu.isLoading&&u.mathjax.retryAfter(this.menu.loadingPromise.catch(function(t){return console.log(t)}));var t=this.menu.settings;return t.collapsible&&(this.options.enableComplexity=!0,this.menu.checkComponent("a11y/complexity")),t.explorer&&(this.options.enableEnrichment=!0,this.options.enableExplorer=!0,this.menu.checkComponent("a11y/explorer")),this},r.prototype.state=function(t,e){return o.prototype.state.call(this,t,e=void 0===e?!1:e),t\n"+this.childNodeMml(t,e+" ","\n")+e+""},l.prototype.visitMathNode=function(t,e){if(!this.options.semantics||"TeX"!==this.mathItem.inputJax.name)return i.prototype.visitDefault.call(this,t,e);var r=t.childNodes.length&&1\n"+e+" \n"+(r?e+" \n":"")+this.childNodeMml(t,e+(r?" ":" "),"\n")+(r?e+" \n":"")+e+' '+this.mathItem.math+"\n"+e+" \n"+e+"