(function(g,b,d){varf,h=b.Browser.isMobile;vare=MathJax.Object.Subclass({timeout:(h?15:8)*1000,FontInfo:{STIX:{family:"STIXSizeOneSym",testString:"() {} []"},TeX:{family:"MathJax_Size1",testString:"() {} []"}},comparisonFont:["sans-serif","monospace","script","Times","Courier","Arial","Helvetica"],testSize:["40px","50px","60px","30px","20px"],Init:function(){this.div=MathJax.HTML.addElement(document.body,"div",{id:"MathJax_Font_Test",style:{position:"absolute",visibility:"hidden",top:0,left:0,width:"auto",padding:0,border:0,margin:0,whiteSpace:"nowrap",textAlign:"left",textIndent:0,textTransform:"none",lineHeight:"normal",letterSpacing:"normal",wordSpacing:"normal",fontSize:this.testSize[0],fontWeight:"normal",fontStyle:"normal",fontSizeAdjust:"none"}},[""]);this.text=this.div.firstChild},findFont:function(n,k){if(k&&this.testCollection(k)){returnk}for(varl=0,j=n.length;l<j;l++){if(n[l]===k){continue}if(this.testCollection(n[l])){returnn[l]}}returnnull},testCollection:function(j){returnthis.testFont(this.FontInfo[j])},testFont:function(l){if(l.isWebFont&&d.FontFaceBug){this.div.style.fontWeight=this.div.style.fontStyle="normal"}else{this.div.style.fontWeight=(l.weight||"normal");this.div.style.fontStyle=(l.style||"normal")}vark=this.getComparisonWidths(l.testString,l.noStyleChar);if(k){this.div.style.fontFamily="'"+l.family+"',"+this.comparisonFont[0];if(this.div.offsetWidth==k[0]){this.div.style.fontFamily="'"+l.family+"',"+this.comparisonFont[k[2]];if(this.div.offsetWidth==k[1]){returnfalse}}if(this.div.offsetWidth!=k[3]||this.div.offsetHeight!=k[4]){if(l.noStyleChar||!d.FONTDATA||!d.FONTDATA.hasStyleChar){returntrue}for(varn=0,j=this.testSize.length;n<j;n++){if(this.testStyleChar(l,this.testSize[n])){returntrue}}}}returnfalse},styleChar:"\uEFFD",versionChar:"\uEFFE",compChar:"\uEFFF",testStyleChar:function(l,o){varr=3+(l.weight?2:0)+(l.style?4:0);vark="",m=0;varq=this.div.style.fontSize;this.div.style.fontSize=o;if(d.msieItalicWidthBug&&l.style==="italic"){this.text.nodeValue=k=this.compChar;m=this.div.offsetWidth}if(d.safariTextNodeBug){this.div.innerHTML=this.compChar+k}else{this.text.nodeValue=this.compChar+k}varj=this.div.offsetWidth-m;if(d.safariTextNodeBug){this.div.innerHTML=this.styleChar+k}else{this.text.nodeValue=this.styleChar+k}varp=Math.floor((this.div.offsetWidth-m)/j+0.5);if(p===r){if(d.safariTextNodeBug){this.div.innerHTML=this.versionChar+k}else{this.text.nodeValue=this.versionChar+k}l.version=Math.floor((this.div.offsetWidth-m)/j+1.5)/2}this.div.style.fontSize=q;return(p===r)},getComparisonWidths:function(o,l){if(d.FONTDATA&&d.FONTDATA.hasStyleChar&&!l){o+=this.styleChar+" "+this.compChar}if(d.safariTextNodeBug){this.div.innerHTML=o}else{this.text.nodeValue=o}this.div.style.fontFamily=this.comparisonFont[0];vark=this.div.offsetWidth;this.div.style.fontFamily=d.webFontDefault;varq=this.div.offsetWidth,n=this.div.offsetHeight;for(varp=1,j=this.comparisonFont.length;p<j;p++){this.div.style.fontFamily=this.comparisonFont[p];if(this.div.offsetWidth!=k){return[k,this.div.offsetWidth,p,q,n]}}returnnull},loadWebFont:function(k){b.Startup.signal.Post("HTML-CSS Jax - Web-Font "+d.fontInUse+"/"+k.directory);varm=MathJax.Message.File("Web-Font "+d.fontInUse+"/"+k.directory);varj=MathJax.Callback({});varl=MathJax.Callback(["loadComplete",this,k,m,j]);g.timer.start(g,[this.checkWebFont,k,l],0,this.timeout);returnj},loadComplete:function(l,o,k,j){MathJax.Message.Clear(o);if(j===g.STATUS.OK){this.webFontLoaded=true;k();return}this.loadError(l);if(b.Browser.isFirefox&&d.allowWebFonts){varm=document.location.protocol+"//"+document.location.hostname;if(document.location.port!=""){m+=":"+document.location.port}m+="/";if(g.fileURL(d.webfontDir).substr(0,m.length)!==m){this.firefoxFontError(l)}}if(!this.webFontLoaded){d.loadWebFontError(l,k)}else{k()}},loadError:function(j){MathJax.Message.Set("Can't load web font "+d.fontInUse+"/"+j.directory,null,2000);b.Startup.signal.Post(["HTML-CSS Jax - web font error",d.fontInUse+"/"+j.directory,j])},firefoxFontError:function(j){MathJax.Message.Set("Fire