This repository has been archived on 2024-11-04. You can view files and clone it, but cannot push or open issues or pull requests.
cs763/website/docs/assets/custom-js/katex/contrib/auto-render.min.js

1 line
8.7 KiB
JavaScript
Raw Normal View History

2018-09-04 03:43:48 +00:00
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("katex")):"function"==typeof define&&define.amd?define(["katex"],e):"object"==typeof exports?exports.renderMathInElement=e(require("katex")):t.renderMathInElement=e(t.katex)}("undefined"!=typeof self?self:this,function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}([function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){t.exports=!n(0)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var n=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=n)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,n){e.exports=t},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){var r=n(24);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){var r=n(8),o=n(7);t.exports=function(t){return r(o(t))}},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){t.exports={default:n(39),__esModule:!0}},function(t,e,n){"use strict";n.r(e);var r=n(11),o=n.n(r),i=n(5),u=n.n(i),c=function(t,e,n){for(var r=n,o=0,i=t.length;r<e.length;){var u=e[r];if(o<=0&&e.slice(r,r+i)===t)return r;"\\"===u?r++:"{"===u?o++:"}"===u&&o--,r++}return-1},f=function(t,e,n,r){for(var o=[],i=0;i<t.length;i++)if("text"===t[i].type){var u=t[i].data,f=!0,a=0,s=void 0;for(-1!==(s=u.indexOf(e))&&(a=s,o.push({type:"text",data:u.slice(0,a)}),f=!1);;){if(f){if(-1===(s=u.indexOf(e,a)))break;o.push({type:"text",data:u.slice(a,s)}),a=s}else{if(-1===(s=c(n,u,a+e.length)))break;o.push({type:"math",data:u.slice(a+e.length,s),rawData:u.slice(a,s+n.length),display:r}),a=s+n.length}f=!f}o.push({type:"text",data:u.slice(a)})}else o.push(t[i]);return o},a=function(t,e){for(var n=function(t,e){for(var n=[{type:"text",data:t}],r=0;r<e.length;r++){var o=e[r];n=f(n,o.left,o.right,o.display||!1)}return n}(t,e.delimiters),r=document.createDocumentFragment(),o=0;o<n.length;o++)if("text"===n[o].type)r.appendChild(document.createTextNode(n[o].data));else{var i=document.createElement("span"),c=n[o].data;e.displayMode=n[o].display;try{u.a.render(c,i,e)}catch(t){if(!(t instanceof u.a.ParseError))throw t;e.errorCallback("KaTeX auto-render: Failed to parse `"+n[o].data+"` with ",t),r.appendChild(document.createTextNode(n[o].rawData));continue}r.appendChild(i)}return r},s={delimiters:[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\[",right:"\\]",display:!0}],ignoredTags:["script","noscript","style","textarea","pre","code"],errorCallback:function(t,e){console.error(t,e)}};e.default=function(t,e){if(!t)throw new Error("No element provided to render");!function t(e,n){for(var r=0;r<e.childNodes.length;r++){var o=e.childNodes[r];i