!function(e,t){var n,i,a=e.config.menuSettings,o=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){return function(){e.apply(t,arguments)}},s=Object.keys||function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},u=MathJax.Ajax.config.path;u.a11y||(u.a11y=e.config.root+"/extensions/a11y");var l=t["accessibility-menu"]={version:"1.6.0",prefix:"",defaults:{},modules:[],MakeOption:function(e){return l.prefix+e},GetOption:function(e){return a[l.MakeOption(e)]},AddDefaults:function(){for(var e,t=s(l.defaults),n=0;e=t[n];n++){var i=l.MakeOption(e);void 0===a[i]&&(a[i]=l.defaults[e])}},AddMenu:function(){for(var e,t=Array(this.modules.length),a=0;e=this.modules[a];a++)t[a]=e.placeHolder;var o,s,u=i.FindId("Accessibility");u?(t.unshift(n.RULE()),u.submenu.items.push.apply(u.submenu.items,t)):((o=(i.FindId("Settings","Renderer")||{}).submenu)&&(t.unshift(n.RULE()),t.unshift(o.items.pop()),t.unshift(o.items.pop())),t.unshift("Accessibility"),u=n.SUBMENU.apply(n.SUBMENU,t),(s=i.IndexOfId("Locale"))?i.items.splice(s,0,u):i.items.push(n.RULE(),u))},Register:function(e){l.defaults[e.option]=!1,l.modules.push(e)},Startup:function(){n=MathJax.Menu.ITEM,i=MathJax.Menu.menu;for(var e,t=0;e=this.modules[t];t++)e.CreateMenu();this.AddMenu()},LoadExtensions:function(){for(var t,n=[],i=0;t=this.modules[i];i++)a[t.option]&&n.push(t.module);return n.length?e.Startup.loadArray(n):null}},r=MathJax.Extension.ModuleLoader=MathJax.Object.Subclass({option:"",name:["",""],module:"",placeHolder:null,submenu:!1,extension:null,Init:function(e,t,n,i,a){this.option=e,this.name=[t.replace(/ /g,""),t],this.module=n,this.extension=i,this.submenu=a||!1},CreateMenu:function(){var e=o(this.Load,this);this.submenu?this.placeHolder=n.SUBMENU(this.name,n.CHECKBOX(["Activate","Activate"],l.MakeOption(this.option),{action:e}),n.RULE(),n.COMMAND(["OptionsWhenActive","(Options when Active)"],null,{disabled:!0})):this.placeHolder=n.CHECKBOX(this.name,l.MakeOption(this.option),{action:e})},Load:function(){e.Queue(["Require",MathJax.Ajax,this.module,["Enable",this]])},Enable:function(e){var t=MathJax.Extension[this.extension];t&&(t.Enable(!0,!0),MathJax.Menu.saveCookie())}});l.Register(r("collapsible","Collapsible Math","[a11y]/collapsible.js","collapsible")),l.Register(r("autocollapse","Auto Collapse","[a11y]/auto-collapse.js","auto-collapse")),l.Register(r("explorer","Explorer","[a11y]/explorer.js","explorer",!0)),l.AddDefaults(),e.Register.StartupHook("End Extensions",function(){e.Register.StartupHook("MathMenu Ready",function(){l.Startup(),e.Startup.signal.Post("Accessibility Menu Ready")},5)},5),MathJax.Hub.Register.StartupHook("End Cookie",function(){MathJax.Callback.Queue(["LoadExtensions",l],["loadComplete",MathJax.Ajax,"[a11y]/accessibility-menu.js"])})}(MathJax.Hub,MathJax.Extension);