newblog/static/js/katexbundle.min.js

1 line
258 KiB
JavaScript
Raw Permalink Normal View History

2024-07-01 15:20:09 +02:00
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.katex=t():e.katex=t()}("undefined"!=typeof self?self:this,function(){function B(e){for(var t=0;t<we.length;t+=2)if(e>=we[t]&&e<=we[t+1])return 1}function C(e,t,r){if(!Me[t])throw Error("Font metrics not found for font: "+t+".");var n=e.charCodeAt(0),i=Me[t][n];if(!i&&e[0]in Ae&&(n=Ae[e[0]].charCodeAt(0),i=Me[t][n]),i||"text"!==r||B(n)&&(i=Me[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}function q(e){if(e instanceof b)return e;throw Error("Expected symbolNode but got "+e+".")}function e(e,t,r,n,i,a){nt[e][i]={font:t,group:r,replace:n},a&&n&&(nt[e][n]=nt[e][i])}function t(e){for(var t=e.type,r=e.names,n=e.props,i=e.handler,a=e.htmlBuilder,e=e.mathmlBuilder,o={type:t,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:void 0===n.allowedInMath||n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:i},s=0;s<r.length;++s)Lt[r[s]]=o;t&&(a&&(Pt[t]=a),e)&&(Ft[t]=e)}function N(e){t({type:e.type,names:[],props:{numArgs:0},handler:function(){throw Error("Should never be called.")},htmlBuilder:e.htmlBuilder,mathmlBuilder:e.mathmlBuilder})}function I(e,t){e=Vt(["base"],e,t),t=Vt(["strut"]);return t.style.height=Q(e.height+e.depth),e.depth&&(t.style.verticalAlign=Q(-e.depth)),e.children.unshift(t),e}function R(e,t){var r=null;1===e.length&&"tag"===e[0].type&&(r=e[0].tag,e=e[0].body);var n,i=ee(e,t,"root");2===i.length&&i[1].hasClass("tag")&&(n=i.pop());for(var a,o=[],s=[],l=0;l<i.length;l++)if(s.push(i[l]),i[l].hasClass("mbin")||i[l].hasClass("mrel")||i[l].hasClass("allowbreak")){for(var h=!1;l<i.length-1&&i[l+1].hasClass("mspace")&&!i[l+1].hasClass("newline");)l++,s.push(i[l]),i[l].hasClass("nobreak")&&(h=!0);h||(o.push(I(s,t)),s=[])}else i[l].hasClass("newline")&&(s.pop(),0<s.length&&(o.push(I(s,t)),s=[]),o.push(i[l]));0<s.length&&o.push(I(s,t)),r?((a=I(ee(r,t,!0))).classes=["tag"],o.push(a)):n&&o.push(n);e=Vt(["katex-html"],o);return e.setAttribute("aria-hidden","true"),a&&((r=a.children[0]).style.height=Q(e.height+e.depth),e.depth)&&(r.style.verticalAlign=Q(-e.depth)),e}function O(e){return new Se(e)}function E(e,t,r,n,i){e=A(e,r),r=1===e.length&&e[0]instanceof jt&&Z.contains(["mrow","mtable"],e[0].type)?e[0]:new z.MathNode("mrow",e),e=new z.MathNode("annotation",[new z.TextNode(t)]),e.setAttribute("encoding","application/x-tex"),t=new z.MathNode("semantics",[r,e]),r=new z.MathNode("math",[t]);return r.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&r.setAttribute("display","block"),te.makeSpan([i?"katex":"katex-mathml"],[r])}function d(e,t){if(e&&e.type===t)return e;throw Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:""+e))}function H(e){var t=D(e);if(t)return t;throw Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:""+e))}function D(e){return e&&("atom"===e.type||rt.hasOwnProperty(e.type))?e:null}function L(e,t){var r=D(e);if(r&&Z.contains(G0,r.text))return r;throw new j(r?"Invalid delimiter '"+r.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function P(e){if(!e.body)throw Error("Bug: The leftright ParseNode wasn't fully parsed.")}function F(e){for(var t=e.type,r=e.names,n=e.props,i=e.handler,a=e.htmlBuilder,e=e.mathmlBuilder,o={type:t,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},s=0;s<r.length;++s)U0[r[s]]=o;a&&(Pt[t]=a),e&&(Ft[t]=e)}function r(e,t){Y0[e]=t}function V(e){var t=[];e.consumeSpaces();for(var r=e.fetch().text;"\\hline"===r||"\\hdashline"===r;)e.consume(),t.push("\\hdashline"===r),e.consumeSpaces(),r=e.fetch().text;return t}function G(e){if(!~e.indexOf("ed"))return!~e.indexOf("*")}function U(e,t,r){function n(){m&&e.gullet.macros.set("\\@eqnsw","1",!0)}function i(){x&&(e.gullet.macros.get("\\df@tag")?(x.push(e.subparse([new X0("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):x.push