10
2
Fork 0
has-writeup/mathjax/output/chtml.js

1 line
193 KiB
JavaScript
Raw Normal View History

2020-06-04 00:31:32 +00:00
!function(r){var o={};function i(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}i.m=r,i.c=o,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(r,o,function(t){return e[t]}.bind(null,o));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=102)}([function(t,c,e){"use strict";var o,r,i=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),f=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],o=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},u=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,i,n=r.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(o=n.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a};Object.defineProperty(c,"__esModule",{value:!0});var n=e(2),a=e(23),s=e(17);c.FONTSIZE={"70.7%":"s","70%":"s","50%":"ss","60%":"Tn","85%":"sm","120%":"lg","144%":"Lg","173%":"LG","207%":"hg","249%":"HG"},c.SPACE=((r={})[n.em(2/18)]="1",r[n.em(3/18)]="2",r[n.em(4/18)]="3",r[n.em(5/18)]="4",r[n.em(6/18)]="5",r);var l,h=(l=a.CommonWrapper,i(m,l),m.prototype.toCHTML=function(t){var e,r,o=this.standardCHTMLnode(t);try{for(var i=f(this.childNodes),n=i.next();!n.done;n=i.next())n.value.toCHTML(o)}catch(t){e={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}},m.prototype.standardCHTMLnode=function(t){this.markUsed();var e=this.createCHTMLnode(t);return this.handleStyles(),this.handleVariant(),this.handleScale(),this.handleColor(),this.handleSpace(),this.handleAttributes(),this.handlePWidth(),e},m.prototype.markUsed=function(){this.constructor.used=!0},m.prototype.createCHTMLnode=function(t){var e=this.node.attributes.get("href");return e&&(t=this.adaptor.append(t,this.html("a",{href:e}))),this.chtml=this.adaptor.append(t,this.html("mjx-"+this.node.kind)),this.chtml},m.prototype.handleStyles=function(){if(this.styles){var t=this.styles.cssText;if(t){this.adaptor.setAttribute(this.chtml,"style",t);var e=this.styles.get("font-family");e&&this.adaptor.setStyle(this.chtml,"font-family","MJXZERO, "+e)}}},m.prototype.handleVariant=function(){this.node.isToken&&"-explicitFont"!==this.variant&&this.adaptor.setAttribute(this.chtml,"class",(this.font.getVariant(this.variant)||this.font.getVariant("normal")).classes)},m.prototype.handleScale=function(){this.setScale(this.chtml,this.bbox.rscale)},m.prototype.setScale=function(t,e){var r=Math.abs(e-1)<.001?1:e;if(t&&1!==r){var o=this.percent(r);c.FONTSIZE[o]?this.adaptor.setAttribute(t,"size",c.FONTSIZE[o]):this.adaptor.setStyle(t,"fontSize",o)}return t},m.prototype.handleSpace=function(){var e,t;try{for(var r=f([[this.bbox.L,"space","marginLeft"],[this.bbox.R,"rspace","marginRight"]]),o=r.next();!o.done;o=r.next()){var i=o.value,n=u(i,3),a=n[0],s=n[1],l=n[2];if(a){var h=this.em(a);c.SPACE[h]?this.adaptor.setAttribute(this.chtml,s,c.SPACE[h]):this.adaptor.setStyle(this.chtml,l,h)}}}catch(t){