/*! awesome-toc 2019-01-17 */
!function(a){var b=!1,c=function(a){b&&console.log(a)},d={},e={css:{fontSize:"90%",largeFontSize:"120%",fontColor:"#999",activeFontColor:"#87daff",lineHeight:"1.8",backgroundColor:"rgba(0,0,0,0.7)",zIndex:999999},title:"文章目录",windowMinWidth:100,sideBarId:"sidebar-toc-Ik4D",sideBarWidth:"16em",sideBarPrefix:"sidebar-toc-Ik4D-",itemPrefix:"- ",headingList:["h1","h2","h3","h4","h5","h6"],enableToTopButton:!0,enableToc:!0,overlay:!1,autoDetectHeadings:!0,contentId:"",contentClass:"",displayNow:!1,topOffset:0},f=function(){var b=document.createElement("div");b.setAttribute("id",e.sideBarId),b.setAttribute("class",e.sideBarId),a("body").append(b),a(b).css({background:e.css.backgroundColor+" none repeat scroll 0 0",bottom:"0","box-shadow":"0 2px 4px #000 inset",position:"fixed",right:"0",top:"0",width:"0","z-index":""+e.css.zIndex,color:e.css.fontColor,overflow:"auto","font-size":e.css.fontSize,"text-align":"left"}),g(),n()},g=function(b){var b=b||document;contentRef=b.body,e.contentClass.length>0&&(contentRef=document.getElementsByClassName(e.contentClass)[0]),e.contentId.length>0&&(contentRef=document.getElementById(e.contentId)),c(contentRef);var d=b.getElementById(e.sideBarId),f=b.createElement("div");a(f).css({"text-align":"center","border-bottom-color":e.css.activeFontColor,color:e.css.activeFontColor,"border-width":"0 0 1.5px 0","border-style":"solid","font-size":e.css.largeFontSize,padding:"8px 0"}),f.textContent=e.title,d.appendChild(f);var g=e.headingList;if(g.length>0){[].slice.call(contentRef.querySelectorAll(g.join(", "))).forEach(function(c,f){var i=b.createElement("a");i.setAttribute("name",""+e.sideBarPrefix+f),i.setAttribute("id",""+e.sideBarPrefix+f),c.parentNode.insertBefore(i,c);var j=b.createElement("a");j.setAttribute("href","#"+e.sideBarPrefix+f),j.textContent=e.itemPrefix+c.textContent,a(j).click(function(b){a(this).parent().parent().find("a").css({color:e.css.fontColor}),a(this).css({color:e.css.activeFontColor});var c=a(a(this).attr("href")).offset().top-e.topOffset;m(),a("html, body").stop().animate({scrollTop:c},{duration:300,complete:n}),b.preventDefault()});var k=b.createElement("div");a(k).css({"padding-left":h(c.tagName.toLowerCase(),g,20),"text-align":"left"}),k.appendChild(j),d.appendChild(k)})}a("#"+e.sideBarId+" div").css({margin:"0 12px"});var i="#"+e.sideBarId+" a, ";i+="#"+e.sideBarId+" a:hover, ",i+="#"+e.sideBarId+" a:visited",a(i).css({color:e.css.fontColor,"word-wrap":"break-word","text-decoration":"none","line-height":e.css.lineHeight})},h=function(a,b,c){for(var d=0;d<b.length&&a!==b[d];d++);return d>=b.length&&(d=0),d*c+"px"},i=function(){var b=document.createElement("div");b.setAttribute("id",e.sideBarPrefix+"toggleBtn"),a(b).css({background:"#222 none repeat scroll 0 0",bottom:"55px",cursor:"pointer",height:"15px","line-height":"0",padding:"5px",position:"fixed",right:"50px",width:"15px","z-index":""+(e.css.zIndex+1)});for(var c=0;c<3;c++){var d=document.createElement("span");a(d).css({background:"#87daff none repeat scroll 0 0",display:"inline-block",height:"2px","margin-top":"2px",position:"relative","vertical-align":"top",width:"100%"}).appendTo(b)}a("body").append(b),b.onclick=j},j=function(){if(c("in toggleButtonClickListener: overlay "+e.overlay),!(a(window).width()<e.windowMinWidth)){var b=a("#"+e.sideBarId);b.hasClass(e.sideBarPrefix+"active")?(b.removeClass(e.sideBarPrefix+"active"),a(b).animate({width:"0"}),e.overlay||a("body").animate({"margin-right":"0"})):(b.addClass(e.sideBarPrefix+"active"),a(b).animate({width:e.sideBarWidth}),e.overlay||a("body").animate({"margin-right":e.sideBarWidth}))}},k=function(){var b=document.createElement("div");b.setAttribute("id",e.sideBarPrefix+"toTopBtn"),a(b).css({background:"#222 none repeat scroll 0 0",bottom:"25px",cursor:"pointer",height:"15px","line-height":"15px",padding:"5px",position:"fixed",right:"50px",width:"15px","z-index":""+(e.css.zIndex+1),color:"#fff","font-size":"16px","text-align":"center"}).html('<span style="margin: 0 auto">&#9650;</span>'),b.onclick=function(){a("html, body").animate({scrollTop:0},600)},a("body").append(b)},l=function(){var b=a(this).scrollTop()+10,c=d.scrollItems.map(function(){if(a(this).offset().top<b)return this});c=c[c.length-1];var f=c&&c.length?c[0].id:"";d.lastId!==f&&(d.lastId=f,d.menuItems.css({color:e.css.fontColor}),d.menuItems.filter("[href=#"+f+"]").css({color:e.css.activeFontColor}))},m=function(){a(window).off("scroll",l)},n=function(){a(window).scroll(l)},o=function(){var b="body";return e.contentClass.length>0&&(b="."+e.contentClass),e.contentId.length>0&&(b="#"+e.contentId),a(b)},p=function(b,c){b=b||1,c=c||6;var d=["h1","h2","h3","h4","h5","h6"];scope=o();for(var e=[],f=0;f<d.length&&(heading=d[f],0==e.length?scope.find(heading).length>=b&&e.push(heading):a(heading).length>=1&&e.push(heading),!(e.length>=c));f++);return e},q=function(a){scope=o();for(var b=[],c=0;c<a.length;c++)heading=a[c],scope.find(heading).length>0&&b.push(heading.toLowerCase());return b},r=function(){return 0!=a("#"+e.sideBarPrefix+"toggleBtn").length},s=function(){return 0!=a("#"+e.sideBarPrefix+"toTopBtn").length};a.extend({awesome_toc:function(b){a.extend(!0,e,b),e.contentId=e.contentId.trim(),e.contentClass=e.contentClass.trim(),e.autoDetectHeadings&&(e.headingList=p()),e.headingList=q(e.headingList),e.enableToc&&!r()&&(f(),i(),d.lastId="",d.sideBar=a("#"+e.sideBarId),d.menuItems=d.sideBar.find("a"),d.scrollItems=d.menuItems.map(function(){var b=a(a(this).attr("href"));if(b.length)return b}),c(d)),e.enableToTopButton&&!s()&&k(),e.displayNow&&j()}})}(jQuery);