"use strict";function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d .chroma"),function(a){var b=a.querySelectorAll("pre.chroma > code"),c=b[b.length-1],d=c?c.className.toLowerCase():"";a.className+=" "+d}),this.util.forEach(document.querySelectorAll(".highlight > pre.chroma"),function(a){var b=document.createElement("div");b.className=a.className;var c=document.createElement("table");b.appendChild(c);var d=document.createElement("tbody");c.appendChild(d);var e=document.createElement("tr");d.appendChild(e);var f=document.createElement("td");e.appendChild(f),a.parentElement.replaceChild(b,a),f.appendChild(a)})}},{key:"initTable",value:function initTable(){this.util.forEach(document.querySelectorAll(".content table"),function(a){var b=document.createElement("div");b.className="table-wrapper",a.parentElement.replaceChild(b,a),b.appendChild(a)})}},{key:"initHeaderLink",value:function initHeaderLink(){for(var a=1;6>=a;a++)this.util.forEach(document.querySelectorAll(".page.single .content > h"+a),function(a){a.classList.add("headerLink"),a.innerHTML="").concat(a.innerHTML)})}},{key:"initToc",value:function initToc(){var a=this,b=document.getElementById("TableOfContents");if(null!==b)if(this.util.isTocStatic()){var k=document.getElementById("toc-content-static");b.parentElement!==k&&(b.parentElement.removeChild(b),k.appendChild(b)),this._tocOnScroll&&this.scrollEventSet.delete(this._tocOnScroll)}else{var l=document.getElementById("toc-content-auto");b.parentElement!==l&&(b.parentElement.removeChild(b),l.appendChild(b));var c=document.getElementById("toc-auto"),d=document.getElementsByClassName("page")[0];c.style.maxWidth="".concat(d.getBoundingClientRect().left-20,"px"),this._tocLinks=this._tocLinks||b.getElementsByTagName("a"),this._tocLis=this._tocLis||b.getElementsByTagName("li"),this._headerLinks=this._headerLinks||document.getElementsByClassName("headerLink");var e="normal"!==window.desktopHeaderMode,f=document.getElementById("header-desktop").offsetHeight,g=20+(e?f:0),h=c.offsetTop,j=h-g+(e?0:f);this._tocOnScroll=this._tocOnScroll||function(){var k=document.getElementById("post-footer").offsetTop,l=k-c.getBoundingClientRect().height,m=l-g+(e?0:f),n=d.getBoundingClientRect();a.newScrollTopm?(c.style.position="absolute",c.style.top="".concat(l,"px"),c.style.left="".concat(n.width+20,"px")):(c.style.position="fixed",c.style.top="".concat(g,"px"),c.style.left="".concat(n.left+n.width+20,"px")),a.util.forEach(a._tocLinks,function(a){a.classList.remove("active")}),a.util.forEach(a._tocLis,function(a){a.classList.remove("has-active")});for(var o=20+(e?f:0),p=a._headerLinks.length-1,q=0;qo||r<=o&&s>o){p=q;break}}if(-1!==p){a._tocLinks[p].classList.add("active");for(var t=a._tocLinks[p].parentElement;t!==b;)t.classList.add("has-active"),t=t.parentElement.parentElement}},this._tocOnScroll(),this.scrollEventSet.add(this._tocOnScroll)}}},{key:"initMermaid",value:function initMermaid(){var a=document.getElementsByClassName("mermaid");a.length&&(mermaid.initialize({startOnLoad:!1,theme:"null"}),this.util.forEach(a,function(a){mermaid.mermaidAPI.render("svg-"+a.id,window.contentMap[a.id],function(b){a.innerHTML=b},a)}))}},{key:"initEcharts",value:function initEcharts(){var a=this;this._echartsOnSwitchTheme=this._echartsOnSwitchTheme||function(){a._echartsArr=a._echartsArr||[];for(var b=0;be?(a.classList.remove("fadeInDown"),a.classList.add("fadeOutUp")):c<-e&&(a.classList.remove("fadeOutUp"),a.classList.add("fadeInDown"))}),20e?(d.classList.remove("fadeIn"),d.classList.add("fadeOut")):c<-e&&(d.style.display="block",d.classList.remove("fadeOut"),d.classList.add("fadeIn")):d.style.display="none",a._scrollTimeout||(a._scrollTimeout=window.setTimeout(function(){a._scrollTimeout=null;var b=!0,c=!1,d=void 0;try{for(var e,f,g=a.scrollEventSet[Symbol.iterator]();!(b=(e=g.next()).done);b=!0)f=e.value,f()}catch(a){c=!0,d=a}finally{try{b||null==g.return||g.return()}finally{if(c)throw d}}},10)),a.oldScrollTop=a.newScrollTop},!1)}},{key:"onResize",value:function onResize(){var a=this;window.addEventListener("resize",function(){a._resizeTimeout||(a._resizeTimeout=window.setTimeout(function(){a._resizeTimeout=null;var b=!0,c=!1,d=void 0;try{for(var e,f,g=a.resizeEventSet[Symbol.iterator]();!(b=(e=g.next()).done);b=!0)f=e.value,f()}catch(a){c=!0,d=a}finally{try{b||null==g.return||g.return()}finally{if(c)throw d}}a.initMenuMobile(),a.initToc(),a.initSmoothScroll(),a.initMermaid()},100))},!1)}},{key:"init",value:function init(){this.initMenuMobile(),this.initSwitchTheme(),this.initHighlight(),this.initTable(),this.initHeaderLink(),this.initMermaid(),this.initEcharts(),this.initMapbox(),this.initTypeit(),this.initToc(),this.initSmoothScroll(),this.onScroll(),this.onResize()}}]),b}(),c=function(){var a=new b;a.init()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",c,!1):c()})(); //# sourceMappingURL=theme.min.js.map