@cnblogs/markdown-it-presets 1.9.0-next1 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/{es6 → es2015}/index.mjs +0 -0
  2. package/dist/{es6 → es2015}/index.mjs.map +0 -0
  3. package/dist/{es6 → es2015}/math/factory.mjs +0 -0
  4. package/dist/{es6 → es2015}/math/factory.mjs.map +0 -0
  5. package/dist/{es6 → es2015}/math/impl.mjs +0 -0
  6. package/dist/{es6 → es2015}/math/impl.mjs.map +0 -0
  7. package/dist/{es6 → es2015}/math/index.mjs +0 -0
  8. package/dist/{es6 → es2015}/math/index.mjs.map +0 -0
  9. package/dist/{es6 → es2015}/math/model.mjs +0 -0
  10. package/dist/{es6 → es2015}/math/model.mjs.map +0 -0
  11. package/dist/{es6 → es2015}/presets/index.mjs +0 -0
  12. package/dist/{es6 → es2015}/presets/index.mjs.map +0 -0
  13. package/dist/{es6 → es2015}/presets/option.mjs +0 -0
  14. package/dist/{es6 → es2015}/presets/option.mjs.map +0 -0
  15. package/dist/{es6 → es2015}/presets/plugins/highlight-code-lines.plugin.mjs +0 -0
  16. package/dist/{es6 → es2015}/presets/plugins/highlight-code-lines.plugin.mjs.map +0 -0
  17. package/dist/{es6 → es2015}/presets/plugins/html-filter.plugin.mjs +0 -0
  18. package/dist/{es6 → es2015}/presets/plugins/html-filter.plugin.mjs.map +0 -0
  19. package/dist/{es6 → es2015}/presets/plugins/meta.mjs +0 -0
  20. package/dist/{es6 → es2015}/presets/plugins/meta.mjs.map +0 -0
  21. package/dist/{es6 → es2015}/presets/plugins/multiline-blockquote/multiline-blockquote.plugin.mjs +0 -0
  22. package/dist/{es6 → es2015}/presets/plugins/multiline-blockquote/multiline-blockquote.plugin.mjs.map +0 -0
  23. package/dist/{es6 → es2015}/presets/plugins/multiline-blockquote/multiline-blockquote.rule.mjs +0 -0
  24. package/dist/{es6 → es2015}/presets/plugins/multiline-blockquote/multiline-blockquote.rule.mjs.map +0 -0
  25. package/dist/{es6 → es2015}/presets/plugins/simple-math.plugin.mjs +0 -0
  26. package/dist/{es6 → es2015}/presets/plugins/simple-math.plugin.mjs.map +0 -0
  27. package/dist/{es6 → es2015}/presets/plugins/simple-mermaid.plugin.mjs +0 -0
  28. package/dist/{es6 → es2015}/presets/plugins/simple-mermaid.plugin.mjs.map +0 -0
  29. package/dist/{es6 → es2015}/presets/plugins/toc/index.mjs +0 -0
  30. package/dist/{es6 → es2015}/presets/plugins/toc/index.mjs.map +0 -0
  31. package/dist/{es6 → es2015}/presets/plugins/toc/slugify.mjs +0 -0
  32. package/dist/{es6 → es2015}/presets/plugins/toc/slugify.mjs.map +0 -0
  33. package/dist/{es6 → es2015}/presets/plugins/toc/toc-item.mjs +0 -0
  34. package/dist/{es6 → es2015}/presets/plugins/toc/toc-item.mjs.map +0 -0
  35. package/dist/{es6 → es2015}/presets/plugins/toc/toc-option.mjs +0 -0
  36. package/dist/{es6 → es2015}/presets/plugins/toc/toc-option.mjs.map +0 -0
  37. package/dist/{es6 → es2015}/presets/plugins/unique-custom-id.mjs +0 -0
  38. package/dist/{es6 → es2015}/presets/plugins/unique-custom-id.mjs.map +0 -0
  39. package/dist/umd/markdownItPresets.js +1 -1
  40. package/dist/umd/mathRenderer.js +1 -1
  41. package/package.json +9 -8
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mathRenderer=e():t.mathRenderer=e()}(self,(function(){return function(){"use strict";var t={d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){void 0!==v&&v.toStringTag&&Object.defineProperty(t,v.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{IMathRenderer:function(){return o.IMathRenderer},MathEngine:function(){return r},MathJax2RendererConfig:function(){return o.MathJax2RendererConfig},MathJax3RendererConfig:function(){return o.MathJax3RendererConfig},RendererConfig:function(){return o.RendererConfig},createMathJaxRenderer:function(){return me}});var n,r,o={};function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}t.r(o),t.d(o,{M:function(){return r},u:function(){return a}}),function(t){t[t.MathJax2=0]="MathJax2",t[t.MathJax3=1]="MathJax3"}(r||(r={}));var a=(i(n={},r.MathJax2,{entryScript:"https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-AMS-MML_HTMLorMML&delayStartupUntil=configured&v=20200504",document:window.document,engine:r.MathJax2,isEnabled:!0}),i(n,r.MathJax3,{entryScript:"https://mathjax.cnblogs.com/3_2_1/es5/tex-mml-chtml.js",document:window.document,engine:r.MathJax3,isEnabled:!0}),n),u=function(t,e){return t===e||t!=t&&e!=e},c=function(t,e){for(var n=t.length;n--;)if(u(t[n][0],e))return n;return-1},s=Array.prototype.splice;function f(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}f.prototype.clear=function(){this.__data__=[],this.size=0},f.prototype.delete=function(t){var e=this.__data__,n=c(e,t);return!(n<0||(n==e.length-1?e.pop():s.call(e,n,1),--this.size,0))},f.prototype.get=function(t){var e=this.__data__,n=c(e,t);return n<0?void 0:e[n][1]},f.prototype.has=function(t){return c(this.__data__,t)>-1},f.prototype.set=function(t,e){var n=this.__data__,r=c(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var l,p=f,d="object"==typeof global&&global&&global.Object===Object&&global,h="object"==typeof self&&self&&self.Object===Object&&self,y=d||h||Function("return this")(),v=y.Symbol,b=v,_=Object.prototype,g=_.hasOwnProperty,m=_.toString,j=b?b.toStringTag:void 0,x=Object.prototype.toString,O=b?b.toStringTag:void 0,w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?function(t){var e=g.call(t,j),n=t[j];try{t[j]=void 0;var r=!0}catch(t){}var o=m.call(t);return r&&(e?t[j]=n:delete t[j]),o}(t):function(t){return x.call(t)}(t)},M=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},S=function(t){if(!M(t))return!1;var e=w(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},T=y["__core-js_shared__"],P=(l=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+l:"",C=Function.prototype.toString,J=/^\[object .+?Constructor\]$/,k=Function.prototype,A=Object.prototype,E=k.toString,z=A.hasOwnProperty,R=RegExp("^"+E.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=function(t){return!(!M(t)||(e=t,P&&P in e))&&(S(t)?R:J).test(function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e},L=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return H(n)?n:void 0},$=L(y,"Map"),F=L(Object,"create"),I=Object.prototype.hasOwnProperty,D=Object.prototype.hasOwnProperty;function U(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}U.prototype.clear=function(){this.__data__=F?F(null):{},this.size=0},U.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},U.prototype.get=function(t){var e=this.__data__;if(F){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return I.call(e,t)?e[t]:void 0},U.prototype.has=function(t){var e=this.__data__;return F?void 0!==e[t]:D.call(e,t)},U.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=F&&void 0===e?"__lodash_hash_undefined__":e,this};var q=U,N=function(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map};function B(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}B.prototype.clear=function(){this.size=0,this.__data__={hash:new q,map:new($||p),string:new q}},B.prototype.delete=function(t){var e=N(this,t).delete(t);return this.size-=e?1:0,e},B.prototype.get=function(t){return N(this,t).get(t)},B.prototype.has=function(t){return N(this,t).has(t)},B.prototype.set=function(t,e){var n=N(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this};var V=B;function Q(t){var e=this.__data__=new p(t);this.size=e.size}Q.prototype.clear=function(){this.__data__=new p,this.size=0},Q.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Q.prototype.get=function(t){return this.__data__.get(t)},Q.prototype.has=function(t){return this.__data__.has(t)},Q.prototype.set=function(t,e){var n=this.__data__;if(n instanceof p){var r=n.__data__;if(!$||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new V(r)}return n.set(t,e),this.size=n.size,this};var G,W,X=Q,K=function(){try{var t=L(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Y=function(t,e,n){"__proto__"==e&&K?K(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},Z=function(t,e,n){(void 0!==n&&!u(t[e],n)||void 0===n&&!(e in t))&&Y(t,e,n)},tt=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),a=i.length;a--;){var u=i[++r];if(!1===e(o[u],u,o))break}return t},et="object"==typeof exports&&exports&&!exports.nodeType&&exports,nt=et&&"object"==typeof module&&module&&!module.nodeType&&module,rt=nt&&nt.exports===et?y.Buffer:void 0,ot=rt?rt.allocUnsafe:void 0,it=y.Uint8Array,at=function(t,e){var n,r,o=e?(n=t.buffer,r=new n.constructor(n.byteLength),new it(r).set(new it(n)),r):t.buffer;return new t.constructor(o,t.byteOffset,t.length)},ut=Object.create,ct=function(){function t(){}return function(e){if(!M(e))return{};if(ut)return ut(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),st=(G=Object.getPrototypeOf,W=Object,function(t){return G(W(t))}),ft=Object.prototype,lt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ft)},pt=function(t){return null!=t&&"object"==typeof t},dt=function(t){return pt(t)&&"[object Arguments]"==w(t)},ht=Object.prototype,yt=ht.hasOwnProperty,vt=ht.propertyIsEnumerable,bt=dt(function(){return arguments}())?dt:function(t){return pt(t)&&yt.call(t,"callee")&&!vt.call(t,"callee")},_t=bt,gt=Array.isArray,mt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},jt=function(t){return null!=t&&mt(t.length)&&!S(t)},xt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ot=xt&&"object"==typeof module&&module&&!module.nodeType&&module,wt=Ot&&Ot.exports===xt?y.Buffer:void 0,Mt=(wt?wt.isBuffer:void 0)||function(){return!1},St=Function.prototype,Tt=Object.prototype,Pt=St.toString,Ct=Tt.hasOwnProperty,Jt=Pt.call(Object),kt={};kt["[object Float32Array]"]=kt["[object Float64Array]"]=kt["[object Int8Array]"]=kt["[object Int16Array]"]=kt["[object Int32Array]"]=kt["[object Uint8Array]"]=kt["[object Uint8ClampedArray]"]=kt["[object Uint16Array]"]=kt["[object Uint32Array]"]=!0,kt["[object Arguments]"]=kt["[object Array]"]=kt["[object ArrayBuffer]"]=kt["[object Boolean]"]=kt["[object DataView]"]=kt["[object Date]"]=kt["[object Error]"]=kt["[object Function]"]=kt["[object Map]"]=kt["[object Number]"]=kt["[object Object]"]=kt["[object RegExp]"]=kt["[object Set]"]=kt["[object String]"]=kt["[object WeakMap]"]=!1;var At,Et="object"==typeof exports&&exports&&!exports.nodeType&&exports,zt=Et&&"object"==typeof module&&module&&!module.nodeType&&module,Rt=zt&&zt.exports===Et&&d.process,Ht=function(){try{return zt&&zt.require&&zt.require("util").types||Rt&&Rt.binding&&Rt.binding("util")}catch(t){}}(),Lt=Ht&&Ht.isTypedArray,$t=Lt?function(t){return function(e){return t(e)}}(Lt):function(t){return pt(t)&&mt(t.length)&&!!kt[w(t)]},Ft=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},It=Object.prototype.hasOwnProperty,Dt=function(t,e,n){var r=t[e];It.call(t,e)&&u(r,n)&&(void 0!==n||e in t)||Y(t,e,n)},Ut=/^(?:0|[1-9]\d*)$/,qt=function(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Ut.test(t))&&t>-1&&t%1==0&&t<e},Nt=Object.prototype.hasOwnProperty,Bt=function(t,e){var n=gt(t),r=!n&&_t(t),o=!n&&!r&&Mt(t),i=!n&&!r&&!o&&$t(t),a=n||r||o||i,u=a?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=u.length;for(var s in t)!e&&!Nt.call(t,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||qt(s,c))||u.push(s);return u},Vt=Object.prototype.hasOwnProperty,Qt=function(t){if(!M(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=lt(t),n=[];for(var r in t)("constructor"!=r||!e&&Vt.call(t,r))&&n.push(r);return n},Gt=function(t){return jt(t)?Bt(t,!0):Qt(t)},Wt=function(t){return function(t,e,n,r){var o=!n;n||(n={});for(var i=-1,a=e.length;++i<a;){var u=e[i],c=r?r(n[u],t[u],u,n,t):void 0;void 0===c&&(c=t[u]),o?Y(n,u,c):Dt(n,u,c)}return n}(t,Gt(t))},Xt=function(t,e,n,r,o,i,a){var u,c=Ft(t,n),s=Ft(e,n),f=a.get(s);if(f)Z(t,n,f);else{var l=i?i(c,s,n+"",t,e,a):void 0,p=void 0===l;if(p){var d=gt(s),h=!d&&Mt(s),y=!d&&!h&&$t(s);l=s,d||h||y?gt(c)?l=c:pt(u=c)&&jt(u)?l=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}(c):h?(p=!1,l=function(t,e){if(e)return t.slice();var n=t.length,r=ot?ot(n):new t.constructor(n);return t.copy(r),r}(s,!0)):y?(p=!1,l=at(s,!0)):l=[]:function(t){if(!pt(t)||"[object Object]"!=w(t))return!1;var e=st(t);if(null===e)return!0;var n=Ct.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Pt.call(n)==Jt}(s)||_t(s)?(l=c,_t(c)?l=Wt(c):M(c)&&!S(c)||(l=function(t){return"function"!=typeof t.constructor||lt(t)?{}:ct(st(t))}(s))):p=!1}p&&(a.set(s,l),o(l,s,r,i,a),a.delete(s)),Z(t,n,l)}},Kt=function t(e,n,r,o,i){e!==n&&tt(n,(function(a,u){if(i||(i=new X),M(a))Xt(e,n,u,r,t,o,i);else{var c=o?o(Ft(e,u),a,u+"",e,n,i):void 0;void 0===c&&(c=a),Z(e,u,c)}}),Gt)},Yt=function(t){return t},Zt=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},te=Math.max,ee=K?function(t,e){return K(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Yt,ne=Date.now,re=function(t){var e=0,n=0;return function(){var r=ne(),o=16-(r-n);if(n=r,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(ee),oe=function(t,e){return re(function(t,e,n){return e=te(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=te(r.length-e,0),a=Array(i);++o<i;)a[o]=r[e+o];o=-1;for(var u=Array(e+1);++o<e;)u[o]=r[o];return u[e]=n(a),Zt(t,this,u)}}(t,e,Yt),t+"")},ie=(At=function(t,e,n){Kt(t,e,n)},oe((function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=At.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!M(n))return!1;var r=typeof e;return!!("number"==r?jt(n)&&qt(e,n.length):"string"==r&&e in n)&&u(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var a=e[n];a&&At(t,a,n)}return t}))),ae=[],ue=function(t){t&&clearTimeout(t)},ce=function(t,e){var n=ae.findIndex((function(n){return t&&n[0]===t||n[0]===e}));n>=0&&ae.splice(n,1)},se={},fe=function(){return se},le=function(t){var e,n=t.src,r=t.id,o=t.timeoutSeconds,i=t.appendTo,a=t.executionStrategy;return function(t){var e,n,r=t.url,o=t.id,i=t.timeoutSeconds,a=t.appendTo,u=t.hostElementTagName,c=t.beforeElementCreateCallback,s=a?a.ownerDocument:document,f=null!==(n=null!==(e=s.defaultView)&&void 0!==e?e:s.parentWindow)&&void 0!==n?n:window,l=function(t,e){var n=ae.find((function(n){return t&&n[0]===t||n[0]===e}));return(null!=n?n:[])[1]}(s!==document?"load-resource-to-another-window-context-"+f.name+"-"+o:o,r);if(l)return l;var p=s.querySelector("".concat(u,"#").concat(o));return(p=(p=p||"script"===u&&s.querySelector('script[src="'.concat(r,'"]')))||"link"===u&&s.querySelector('link[href="'.concat(r,'"]')))?Promise.resolve(p):(l=new Promise((function(t,e){var n;n=u,function(n){var u;n.id=null!=o?o:"",null!=a||(a=s.head),i=i<=0?5:i,n instanceof HTMLLinkElement?(n.href=r,n.rel="stylesheet",n.type="text/css"):n instanceof HTMLScriptElement&&(n.src=r,n.type="text/javascript",n.defer=!0),n.onload=function(){ue(u),ce(o,r),t(n)},n.onerror=function(t){ue(u),n.remove(),ce(o,r),e(t)},null==c||c.call(void 0,n),a.append(n),u=setTimeout((function(){ue(u),n.remove(),ce(o,r),e("timeout after ".concat(i," seconds"))}),1e3*i)}(document.createElement(n))})),ae.push([o||r,l]),l)}({url:n,hostElementTagName:"script",timeoutSeconds:null!==(e=null!=o?o:fe().timeoutSeconds)&&void 0!==e?e:5,id:r,appendTo:null!=i?i:fe().appendTo,beforeElementCreateCallback:function(t){t instanceof HTMLScriptElement&&("async"===(null!=a?a:fe().executionStrategy)?(t.async=!0,t.defer=!1):(t.defer=!0,t.async=!1))}})};function pe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function de(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?pe(Object(n),!0).forEach((function(e){be(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):pe(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function he(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ye(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ve(t,e,n){return e&&ye(t.prototype,e),n&&ye(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function be(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var _e=function(){function t(){he(this,t),be(this,"_defaultConfig",a[r.MathJax2]),be(this,"_defaultMathJaxConfig",{tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]],processClass:"math",processEscapes:!0},TeX:{equationNumbers:{autoNumber:"AMS",useLabelIds:!0},extensions:["extpfeil.js","mediawiki-texvc.js"],Macros:{bm:"\\boldsymbol"}},"HTML-CSS":{linebreaks:{automatic:!0}},SVG:{linebreaks:{automatic:!0}},skipStartupTypeset:!0}),be(this,"_config",this._defaultConfig)}return ve(t,[{key:"_global",get:function(){var t;return null!==(t=this._config.document.defaultView)&&void 0!==t?t:window}},{key:"render",value:function(t,e){var n=this;return this._config.isEnabled?this.init().then((function(r){if(r){var o=n._config.onRendered;r.Hub.Queue(["Typeset",r.Hub,t]),null!=o&&r.Hub.Queue((function(){return o(r)})),e&&r.Hub.Queue(e)}})).catch(console.warn):Promise.resolve()}},{key:"config",value:function(t){return this._config=ie({},this._defaultConfig,t),this}},{key:"init",value:function(){var t=this;if(this._initTask)return this._initTask;var e=this._config,n=e.entryScript,r=e.tapMathJaxConfig,o=e.document;return this._initTask=le({src:n,id:"mathjax",timeoutSeconds:10,appendTo:o.head}).then((function(){var e,n=t._global.MathJax;if(n)return n.Hub.Config(null!==(e=null==r?void 0:r.call(void 0,Object.assign({},t._defaultMathJaxConfig)))&&void 0!==e?e:de({},t._defaultMathJaxConfig)),n.Hub.Configured(),n})).catch((function(){return t._initTask=void 0}))}}]),t}(),ge=function(){function t(){he(this,t),be(this,"_defaultConfig",a[r.MathJax3]),be(this,"_defaultMathJaxConfig",{tex:{inlineMath:[["$","$"],["\\(","\\)"]],processEscapes:!0,tags:"ams",useLabelIds:!0,macros:{bm:"\\boldsymbol"},packages:{"[+]":["noerrors","extpfeil"]}},options:{processHtmlClass:"math",ignoreHtmlClass:"tex2jax_ignore"},loader:{load:["[tex]/noerrors","[tex]/extpfeil"]},startup:{typeset:!1}}),be(this,"_config",this._defaultConfig)}return ve(t,[{key:"config",value:function(t){return this._config=ie({},this._defaultConfig,t),this}},{key:"render",value:function(t,e){var n=this;return this._config.isEnabled?this.init().then((function(r){r&&(r.startup.promise=r.startup.promise.then((function(){return r.typesetPromise([t]).then((function(){try{var t;null===(t=n._config.onRendered)||void 0===t||t.call(void 0,r)}catch(t){console.error(t)}try{null==e||e.call(void 0)}catch(t){console.error(t)}}))})))})).catch(console.warn):Promise.resolve()}},{key:"init",value:function(){var t,e=this;return(null!==(t=this._initTask)&&void 0!==t?t:this._initTask=new Promise((function(t,n){var r,o,i=e._config,a=i.entryScript,u=i.tapMathJaxConfig,c=null!==(r=i.document.defaultView)&&void 0!==r?r:window;c.MathJax=null!==(o=null==u?void 0:u.call(void 0,de({},e._defaultMathJaxConfig)))&&void 0!==o?o:de({},e._defaultMathJaxConfig),c.MathJax.startup||(c.MathJax.startup={}),c.MathJax.startup.ready=function(){var e,n;null===(e=c.MathJax)||void 0===e||null===(n=e.startup)||void 0===n||n.defaultReady(),t(c.MathJax)},le({src:a,id:"mathjax",executionStrategy:"defer",appendTo:c.document.head}).catch(n)}))).catch((function(){return e._initTask=void 0}))}}]),t}(),me=function(t){switch(t.engine){case r.MathJax2:return(new _e).config(t);case r.MathJax3:return(new ge).config(t);default:throw Error("Renderer unavailable")}};return e}()}));
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.mathRenderer=e():t.mathRenderer=e()}(self,(function(){return function(){"use strict";var t={d:function(e,n){for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{IMathRenderer:function(){return r.IMathRenderer},MathEngine:function(){return o},MathJax2RendererConfig:function(){return r.MathJax2RendererConfig},MathJax3RendererConfig:function(){return r.MathJax3RendererConfig},RendererConfig:function(){return r.RendererConfig},createMathJaxRenderer:function(){return Ce}});var n,o,r={};function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}t.r(r),t.d(r,{M:function(){return o},u:function(){return u}}),function(t){t[t.MathJax2=0]="MathJax2",t[t.MathJax3=1]="MathJax3"}(o||(o={}));var u=(i(n={},o.MathJax2,{entryScript:"https://mathjax.cnblogs.com/2_7_5/MathJax.js?config=TeX-AMS-MML_HTMLorMML&delayStartupUntil=configured&v=20200504",document:window.document,engine:o.MathJax2,isEnabled:!0}),i(n,o.MathJax3,{entryScript:"https://mathjax.cnblogs.com/3_2_1/es5/tex-mml-chtml.js",document:window.document,engine:o.MathJax3,isEnabled:!0}),n),c=function(t,e){return t===e||t!=t&&e!=e},a=function(t,e){for(var n=t.length;n--;)if(c(t[n][0],e))return n;return-1},f=Array.prototype.splice;function l(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}l.prototype.clear=function(){this.__data__=[],this.size=0},l.prototype.delete=function(t){var e=this.__data__,n=a(e,t);return!(n<0||(n==e.length-1?e.pop():f.call(e,n,1),--this.size,0))},l.prototype.get=function(t){var e=this.__data__,n=a(e,t);return n<0?void 0:e[n][1]},l.prototype.has=function(t){return a(this.__data__,t)>-1},l.prototype.set=function(t,e){var n=this.__data__,o=a(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};var s=l;function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}var y="object"==("undefined"==typeof global?"undefined":p(global))&&global&&global.Object===Object&&global;function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}var b="object"==("undefined"==typeof self?"undefined":d(self))&&self&&self.Object===Object&&self,h=y||b||Function("return this")(),m=h.Symbol,v=Object.prototype,_=v.hasOwnProperty,g=v.toString,j=m?m.toStringTag:void 0,S=Object.prototype.toString,x=m?m.toStringTag:void 0,O=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":x&&x in Object(t)?function(t){var e=_.call(t,j),n=t[j];try{t[j]=void 0;var o=!0}catch(t){}var r=g.call(t);return o&&(e?t[j]=n:delete t[j]),r}(t):function(t){return S.call(t)}(t)};function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}var M,T=function(t){var e=w(t);return null!=t&&("object"==e||"function"==e)},P=function(t){if(!T(t))return!1;var e=O(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},C=h["__core-js_shared__"],J=(M=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"",k=Function.prototype.toString,A=/^\[object .+?Constructor\]$/,E=Function.prototype,z=Object.prototype,R=E.toString,H=z.hasOwnProperty,L=RegExp("^"+R.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$=function(t){return!(!T(t)||(e=t,J&&J in e))&&(P(t)?L:A).test(function(t){if(null!=t){try{return k.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t));var e},F=function(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return $(n)?n:void 0},I=F(h,"Map"),D=F(Object,"create"),U=Object.prototype.hasOwnProperty,q=Object.prototype.hasOwnProperty;function N(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}N.prototype.clear=function(){this.__data__=D?D(null):{},this.size=0},N.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},N.prototype.get=function(t){var e=this.__data__;if(D){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return U.call(e,t)?e[t]:void 0},N.prototype.has=function(t){var e=this.__data__;return D?void 0!==e[t]:q.call(e,t)},N.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=D&&void 0===e?"__lodash_hash_undefined__":e,this};var B=N;function V(t){return V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},V(t)}var Q=function(t,e){var n,o,r=t.__data__;return("string"==(o=V(n=e))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof e?"string":"hash"]:r.map};function G(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}G.prototype.clear=function(){this.size=0,this.__data__={hash:new B,map:new(I||s),string:new B}},G.prototype.delete=function(t){var e=Q(this,t).delete(t);return this.size-=e?1:0,e},G.prototype.get=function(t){return Q(this,t).get(t)},G.prototype.has=function(t){return Q(this,t).has(t)},G.prototype.set=function(t,e){var n=Q(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this};var W=G;function X(t){var e=this.__data__=new s(t);this.size=e.size}X.prototype.clear=function(){this.__data__=new s,this.size=0},X.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},X.prototype.get=function(t){return this.__data__.get(t)},X.prototype.has=function(t){return this.__data__.has(t)},X.prototype.set=function(t,e){var n=this.__data__;if(n instanceof s){var o=n.__data__;if(!I||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new W(o)}return n.set(t,e),this.size=n.size,this};var K=X,Y=function(){try{var t=F(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Z=function(t,e,n){"__proto__"==e&&Y?Y(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n},tt=function(t,e,n){(void 0!==n&&!c(t[e],n)||void 0===n&&!(e in t))&&Z(t,e,n)},et=function(t,e,n){for(var o=-1,r=Object(t),i=n(t),u=i.length;u--;){var c=i[++o];if(!1===e(r[c],c,r))break}return t};function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}var ot,rt,it="object"==("undefined"==typeof exports?"undefined":nt(exports))&&exports&&!exports.nodeType&&exports,ut=it&&"object"==("undefined"==typeof module?"undefined":nt(module))&&module&&!module.nodeType&&module,ct=ut&&ut.exports===it?h.Buffer:void 0,at=ct?ct.allocUnsafe:void 0,ft=h.Uint8Array,lt=function(t,e){var n,o,r=e?(n=t.buffer,o=new n.constructor(n.byteLength),new ft(o).set(new ft(n)),o):t.buffer;return new t.constructor(r,t.byteOffset,t.length)},st=Object.create,pt=function(){function t(){}return function(e){if(!T(e))return{};if(st)return st(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}(),yt=(ot=Object.getPrototypeOf,rt=Object,function(t){return ot(rt(t))}),dt=Object.prototype,bt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||dt)};function ht(t){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}var mt=function(t){return null!=t&&"object"==ht(t)},vt=function(t){return mt(t)&&"[object Arguments]"==O(t)},_t=Object.prototype,gt=_t.hasOwnProperty,jt=_t.propertyIsEnumerable,St=vt(function(){return arguments}())?vt:function(t){return mt(t)&&gt.call(t,"callee")&&!jt.call(t,"callee")},xt=St,Ot=Array.isArray,wt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},Mt=function(t){return null!=t&&wt(t.length)&&!P(t)};function Tt(t){return Tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tt(t)}var Pt="object"==("undefined"==typeof exports?"undefined":Tt(exports))&&exports&&!exports.nodeType&&exports,Ct=Pt&&"object"==("undefined"==typeof module?"undefined":Tt(module))&&module&&!module.nodeType&&module,Jt=Ct&&Ct.exports===Pt?h.Buffer:void 0,kt=(Jt?Jt.isBuffer:void 0)||function(){return!1},At=Function.prototype,Et=Object.prototype,zt=At.toString,Rt=Et.hasOwnProperty,Ht=zt.call(Object),Lt={};Lt["[object Float32Array]"]=Lt["[object Float64Array]"]=Lt["[object Int8Array]"]=Lt["[object Int16Array]"]=Lt["[object Int32Array]"]=Lt["[object Uint8Array]"]=Lt["[object Uint8ClampedArray]"]=Lt["[object Uint16Array]"]=Lt["[object Uint32Array]"]=!0,Lt["[object Arguments]"]=Lt["[object Array]"]=Lt["[object ArrayBuffer]"]=Lt["[object Boolean]"]=Lt["[object DataView]"]=Lt["[object Date]"]=Lt["[object Error]"]=Lt["[object Function]"]=Lt["[object Map]"]=Lt["[object Number]"]=Lt["[object Object]"]=Lt["[object RegExp]"]=Lt["[object Set]"]=Lt["[object String]"]=Lt["[object WeakMap]"]=!1;function $t(t){return $t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(t)}var Ft="object"==("undefined"==typeof exports?"undefined":$t(exports))&&exports&&!exports.nodeType&&exports,It=Ft&&"object"==("undefined"==typeof module?"undefined":$t(module))&&module&&!module.nodeType&&module,Dt=It&&It.exports===Ft&&y.process,Ut=function(){try{return It&&It.require&&It.require("util").types||Dt&&Dt.binding&&Dt.binding("util")}catch(t){}}(),qt=Ut&&Ut.isTypedArray,Nt=qt?function(t){return function(e){return t(e)}}(qt):function(t){return mt(t)&&wt(t.length)&&!!Lt[O(t)]},Bt=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},Vt=Object.prototype.hasOwnProperty,Qt=function(t,e,n){var o=t[e];Vt.call(t,e)&&c(o,n)&&(void 0!==n||e in t)||Z(t,e,n)};function Gt(t){return Gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gt(t)}var Wt=/^(?:0|[1-9]\d*)$/,Xt=function(t,e){var n=Gt(t);return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&Wt.test(t))&&t>-1&&t%1==0&&t<e},Kt=Object.prototype.hasOwnProperty,Yt=function(t,e){var n=Ot(t),o=!n&&xt(t),r=!n&&!o&&kt(t),i=!n&&!o&&!r&&Nt(t),u=n||o||r||i,c=u?function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}(t.length,String):[],a=c.length;for(var f in t)!e&&!Kt.call(t,f)||u&&("length"==f||r&&("offset"==f||"parent"==f)||i&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||Xt(f,a))||c.push(f);return c},Zt=Object.prototype.hasOwnProperty,te=function(t){if(!T(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=bt(t),n=[];for(var o in t)("constructor"!=o||!e&&Zt.call(t,o))&&n.push(o);return n},ee=function(t){return Mt(t)?Yt(t,!0):te(t)},ne=function(t){return function(t,e,n,o){var r=!n;n||(n={});for(var i=-1,u=e.length;++i<u;){var c=e[i],a=o?o(n[c],t[c],c,n,t):void 0;void 0===a&&(a=t[c]),r?Z(n,c,a):Qt(n,c,a)}return n}(t,ee(t))},oe=function(t,e,n,o,r,i,u){var c,a=Bt(t,n),f=Bt(e,n),l=u.get(f);if(l)tt(t,n,l);else{var s=i?i(a,f,n+"",t,e,u):void 0,p=void 0===s;if(p){var y=Ot(f),d=!y&&kt(f),b=!y&&!d&&Nt(f);s=f,y||d||b?Ot(a)?s=a:mt(c=a)&&Mt(c)?s=function(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}(a):d?(p=!1,s=function(t,e){if(e)return t.slice();var n=t.length,o=at?at(n):new t.constructor(n);return t.copy(o),o}(f,!0)):b?(p=!1,s=lt(f,!0)):s=[]:function(t){if(!mt(t)||"[object Object]"!=O(t))return!1;var e=yt(t);if(null===e)return!0;var n=Rt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&zt.call(n)==Ht}(f)||xt(f)?(s=a,xt(a)?s=ne(a):T(a)&&!P(a)||(s=function(t){return"function"!=typeof t.constructor||bt(t)?{}:pt(yt(t))}(f))):p=!1}p&&(u.set(f,s),r(s,f,o,i,u),u.delete(f)),tt(t,n,s)}},re=function t(e,n,o,r,i){e!==n&&et(n,(function(u,c){if(i||(i=new K),T(u))oe(e,n,c,o,t,r,i);else{var a=r?r(Bt(e,c),u,c+"",e,n,i):void 0;void 0===a&&(a=u),tt(e,c,a)}}),ee)},ie=function(t){return t},ue=function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)},ce=Math.max,ae=Y?function(t,e){return Y(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:ie,fe=Date.now,le=function(t){var e=0,n=0;return function(){var o=fe(),r=16-(o-n);if(n=o,r>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(ae),se=function(t,e){return le(function(t,e,n){return e=ce(void 0===e?t.length-1:e,0),function(){for(var o=arguments,r=-1,i=ce(o.length-e,0),u=Array(i);++r<i;)u[r]=o[e+r];r=-1;for(var c=Array(e+1);++r<e;)c[r]=o[r];return c[e]=n(u),ue(t,this,c)}}(t,e,ie),t+"")};function pe(t){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pe(t)}var ye,de=(ye=function(t,e,n){re(t,e,n)},se((function(t,e){var n=-1,o=e.length,r=o>1?e[o-1]:void 0,i=o>2?e[2]:void 0;for(r=ye.length>3&&"function"==typeof r?(o--,r):void 0,i&&function(t,e,n){if(!T(n))return!1;var o=pe(e);return!!("number"==o?Mt(n)&&Xt(e,n.length):"string"==o&&e in n)&&c(n[e],t)}(e[0],e[1],i)&&(r=o<3?void 0:r,o=1),t=Object(t);++n<o;){var u=e[n];u&&ye(t,u,n)}return t}))),be=[],he=function(t){t&&clearTimeout(t)},me=function(t,e){var n=be.findIndex((function(n){return t&&n[0]===t||n[0]===e}));n>=0&&be.splice(n,1)},ve={},_e=function(){return ve},ge=function(t){var e,n=t.src,o=t.id,r=t.timeoutSeconds,i=t.appendTo,u=t.executionStrategy;return function(t){var e,n,o=t.url,r=t.id,i=t.timeoutSeconds,u=t.appendTo,c=t.hostElementTagName,a=t.beforeElementCreateCallback,f=u?u.ownerDocument:document,l=null!==(n=null!==(e=f.defaultView)&&void 0!==e?e:f.parentWindow)&&void 0!==n?n:window,s=function(t,e){var n=be.find((function(n){return t&&n[0]===t||n[0]===e}));return(null!=n?n:[])[1]}(f!==document?"load-resource-to-another-window-context-"+l.name+"-"+r:r,o);if(s)return s;var p=f.querySelector("".concat(c,"#").concat(r));return(p=(p=p||"script"===c&&f.querySelector('script[src="'.concat(o,'"]')))||"link"===c&&f.querySelector('link[href="'.concat(o,'"]')))?Promise.resolve(p):(s=new Promise((function(t,e){var n;n=c,function(n){var c;n.id=null!=r?r:"",null!=u||(u=f.head),i=i<=0?5:i,n instanceof HTMLLinkElement?(n.href=o,n.rel="stylesheet",n.type="text/css"):n instanceof HTMLScriptElement&&(n.src=o,n.type="text/javascript",n.defer=!0),n.onload=function(){he(c),me(r,o),t(n)},n.onerror=function(t){he(c),n.remove(),me(r,o),e(t)},null==a||a.call(void 0,n),u.append(n),c=setTimeout((function(){he(c),n.remove(),me(r,o),e("timeout after ".concat(i," seconds"))}),1e3*i)}(document.createElement(n))})),be.push([r||o,s]),s)}({url:n,hostElementTagName:"script",timeoutSeconds:null!==(e=null!=r?r:_e().timeoutSeconds)&&void 0!==e?e:5,id:o,appendTo:null!=i?i:_e().appendTo,beforeElementCreateCallback:function(t){t instanceof HTMLScriptElement&&("async"===(null!=u?u:_e().executionStrategy)?(t.async=!0,t.defer=!1):(t.defer=!0,t.async=!1))}})};function je(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function Se(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?je(Object(n),!0).forEach((function(e){Me(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):je(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function xe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oe(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function we(t,e,n){return e&&Oe(t.prototype,e),n&&Oe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Me(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Te=function(){function t(){xe(this,t),Me(this,"_defaultConfig",u[o.MathJax2]),Me(this,"_defaultMathJaxConfig",{tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]],processClass:"math",processEscapes:!0},TeX:{equationNumbers:{autoNumber:"AMS",useLabelIds:!0},extensions:["extpfeil.js","mediawiki-texvc.js"],Macros:{bm:"\\boldsymbol"}},"HTML-CSS":{linebreaks:{automatic:!0}},SVG:{linebreaks:{automatic:!0}},skipStartupTypeset:!0}),Me(this,"_config",this._defaultConfig)}return we(t,[{key:"_global",get:function(){var t;return null!==(t=this._config.document.defaultView)&&void 0!==t?t:window}},{key:"render",value:function(t,e){var n=this;return this._config.isEnabled?this.init().then((function(o){if(o){var r=n._config.onRendered;o.Hub.Queue(["Typeset",o.Hub,t]),null!=r&&o.Hub.Queue((function(){return r(o)})),e&&o.Hub.Queue(e)}})).catch(console.warn):Promise.resolve()}},{key:"config",value:function(t){return this._config=de({},this._defaultConfig,t),this}},{key:"init",value:function(){var t=this;if(this._initTask)return this._initTask;var e=this._config,n=e.entryScript,o=e.tapMathJaxConfig,r=e.document;return this._initTask=ge({src:n,id:"mathjax",timeoutSeconds:10,appendTo:r.head}).then((function(){var e,n=t._global.MathJax;if(n)return n.Hub.Config(null!==(e=null==o?void 0:o.call(void 0,Object.assign({},t._defaultMathJaxConfig)))&&void 0!==e?e:Se({},t._defaultMathJaxConfig)),n.Hub.Configured(),n})).catch((function(){return t._initTask=void 0}))}}]),t}(),Pe=function(){function t(){xe(this,t),Me(this,"_defaultConfig",u[o.MathJax3]),Me(this,"_defaultMathJaxConfig",{tex:{inlineMath:[["$","$"],["\\(","\\)"]],processEscapes:!0,tags:"ams",useLabelIds:!0,macros:{bm:"\\boldsymbol"},packages:{"[+]":["noerrors","extpfeil"]}},options:{processHtmlClass:"math",ignoreHtmlClass:"tex2jax_ignore"},loader:{load:["[tex]/noerrors","[tex]/extpfeil"]},startup:{typeset:!1}}),Me(this,"_config",this._defaultConfig)}return we(t,[{key:"config",value:function(t){return this._config=de({},this._defaultConfig,t),this}},{key:"render",value:function(t,e){var n=this;return this._config.isEnabled?this.init().then((function(o){o&&(o.startup.promise=o.startup.promise.then((function(){return o.typesetPromise([t]).then((function(){try{var t;null===(t=n._config.onRendered)||void 0===t||t.call(void 0,o)}catch(t){console.error(t)}try{null==e||e.call(void 0)}catch(t){console.error(t)}}))})))})).catch(console.warn):Promise.resolve()}},{key:"init",value:function(){var t,e=this;return(null!==(t=this._initTask)&&void 0!==t?t:this._initTask=new Promise((function(t,n){var o,r,i=e._config,u=i.entryScript,c=i.tapMathJaxConfig,a=null!==(o=i.document.defaultView)&&void 0!==o?o:window;a.MathJax=null!==(r=null==c?void 0:c.call(void 0,Se({},e._defaultMathJaxConfig)))&&void 0!==r?r:Se({},e._defaultMathJaxConfig),a.MathJax.startup||(a.MathJax.startup={}),a.MathJax.startup.ready=function(){var e,n;null===(e=a.MathJax)||void 0===e||null===(n=e.startup)||void 0===n||n.defaultReady(),t(a.MathJax)},ge({src:u,id:"mathjax",executionStrategy:"defer",appendTo:a.document.head}).catch(n)}))).catch((function(){return e._initTask=void 0}))}}]),t}(),Ce=function(t){switch(t.engine){case o.MathJax2:return(new Te).config(t);case o.MathJax3:return(new Pe).config(t);default:throw Error("Renderer unavailable")}};return e}()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnblogs/markdown-it-presets",
3
- "version": "1.9.0-next1",
3
+ "version": "1.9.1",
4
4
  "description": "Markdown-it configuration for cnblogs.com",
5
5
  "repository": "git@github.com:cnblogs/packages.git",
6
6
  "main": "index.js",
@@ -8,28 +8,29 @@
8
8
  "exports": {
9
9
  ".": {
10
10
  "require": "./dist/commonjs/index.cjs",
11
- "default": "./dist/es6/index.mjs"
11
+ "default": "./dist/es2015/index.mjs"
12
12
  },
13
13
  "./math": {
14
14
  "types": "./dist/types/math/index.d.ts",
15
15
  "require": "./dist/commonjs/math/index.cjs",
16
- "default": "./dist/es6/math/index.mjs"
17
- }
16
+ "default": "./dist/es2015/math/index.mjs"
17
+ },
18
+ "./dist/styles/*": "./dist/styles/*"
18
19
  },
19
20
  "type": "module",
20
21
  "types": "./dist/types/index.d.ts",
21
22
  "scripts": {
22
- "build": "shx rm -rf ./dist/** && npm run build:umd && npm run build:commonjs && npm run build:es6 && shx cp -r ./src/presets/styles ./dist && npm run build:types",
23
+ "build": "shx rm -rf ./dist/** && npm run build:umd && npm run build:commonjs && npm run build:es2015 && shx cp -r ./src/presets/styles ./dist && npm run build:types",
23
24
  "build:umd": "webpack --config webpack.config.mjs && shx mkdir -p ./dist/styles && shx mv ./dist/umd/styles/** ./dist/styles/ && shx rm -rf ./dist/umd/styles",
24
- "build:es6": "shx rm -rf ./out-tsc/** && tsc -p ./ -m es6 --declaration true --declarationDir ./out-tsc/ --declarationMap false -m es6 --outDir dist/es6 && renamer --find .js --replace .mjs \"dist/es6/**\"",
25
- "build:commonjs": "tsc -p ./ -m commonjs --declarationMap false -m es6 --outDir dist/commonjs && renamer --find .js --replace .cjs \"dist/commonjs/**\"",
25
+ "build:es2015": "shx rm -rf ./out-tsc/** && tsc -p ./ -m es2015 --declaration true --declarationDir ./out-tsc/ --declarationMap false -m es2015 --outDir dist/es2015 && renamer --find .js --replace .mjs \"dist/es2015/**\"",
26
+ "build:commonjs": "tsc -p ./ -m commonjs --declarationMap false -m es2015 --outDir dist/commonjs && renamer --find .js --replace .cjs \"dist/commonjs/**\"",
26
27
  "build:types": "api-extractor run --local -c api-extractor.json --verbose && api-extractor run --local -c api-extractor-math.json",
27
28
  "inspect": "webpack --config webpack.config.js --profile --json > dist/umd/stats.json && webpack-bundle-analyzer dist/umd/stats.json",
28
29
  "test": "jest",
29
30
  "format": "prettier --write ."
30
31
  },
31
32
  "dependencies": {
32
- "@cnblogs/load-script-css": "^1.5.1",
33
+ "@cnblogs/load-script-css": "^1.6.0-beta",
33
34
  "github-slugger": "^1.3.0",
34
35
  "lodash-es": "^4.17.21",
35
36
  "markdown-it": "npm:@cnblogs-gitlab/markdown-it@^12.3.2",