afg-website/static/js/mathjax/output/svg.js

1 line
178 KiB
JavaScript
Raw Permalink Normal View History

2024-05-11 13:51:37 +02:00
!function(t){var e={};function r(o){if(e[o])return e[o].exports;var n=e[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(o,n,function(e){return t[e]}.bind(null,n));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=106)}([function(t,e,r){"use strict";var o,n=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)}),i=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.")},s=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,n,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)s.push(o.value)}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return s};Object.defineProperty(e,"__esModule",{value:!0}),e.SVGWrapper=void 0;var a=r(18),l=r(9),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.element=null,e}return n(e,t),e.prototype.toSVG=function(t){this.addChildren(this.standardSVGnode(t))},e.prototype.addChildren=function(t){var e,r,o=0;try{for(var n=i(this.childNodes),s=n.next();!s.done;s=n.next()){var a=s.value;a.toSVG(t),a.element&&a.place(o+a.bbox.L*a.bbox.rscale,0),o+=(a.bbox.L+a.bbox.w+a.bbox.R)*a.bbox.rscale}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},e.prototype.standardSVGnode=function(t){var e=this.createSVGnode(t);return this.handleStyles(),this.handleScale(),this.handleColor(),this.handleAttributes(),e},e.prototype.createSVGnode=function(t){var e=this.node.attributes.get("href");if(e){t=this.adaptor.append(t,this.svg("a",{href:e}));var r=this.getBBox(),o=r.h,n=r.d,i=r.w;this.adaptor.append(t,this.svg("rect",{"data-hitbox":!0,fill:"none",stroke:"none","pointer-events":"all",width:this.fixed(i),height:this.fixed(o+n),y:this.fixed(-n)}))}return this.element=this.adaptor.append(t,this.svg("g",{"data-mml-node":this.node.kind})),this.element},e.prototype.handleStyles=function(){if(this.styles){var t=this.styles.cssText;t&&this.adaptor.setAttribute(this.element,"style",t)}},e.prototype.handleScale=function(){if(1!==this.bbox.rscale){var t="scale("+this.fixed(this.bbox.rscale/1e3,3)+")";this.adaptor.setAttribute(this.element,"transform",t)}},e.prototype.handleColor=function(){var t=this.adaptor,e=this.node.attributes,r=e.getExplicit("mathcolor"),o=e.getExplicit("color"),n=e.getExplicit("mathbackground"),i=e.getExplicit("background");if((r||o)&&(t.setAttribute(this.element,"fill",r||o),t.setAttribute(this.element,"stroke",r||o)),n||i){var s=this.getBBox(),a=s.h,l=s.d,h=s.w,c=this.svg("rect",{fill:n||i,x:0,y:this.fixed(-l),width:this.fixed(h),height:this.fixed(a+l),"data-bgcolor":!0}),u=t.firstChild(this.element);u?t.insert(c,u):t.append(this.element,c)}},e.prototype.handleAttributes=function(){var t,r,o,n,s=this.node.attributes,a=s.getAllDefaults(),l=e.skipAttributes;try{for(var h=i(s.getExplicitNames()),c=h.next();!