jQuery(function(t){if("undefined"!=typeof ezTOC){function e(){if(0!==t(".ez-toc-widget-container.ez-toc-affix").length){var e=30;void 0!==ezTOC.scroll_offset&&(e=parseInt(ezTOC.scroll_offset)),t(ezTOC.affixSelector).stick_in_parent({inner_scrolling:!1,offset_top:e})}if(t.fn.shrinkTOCWidth=function(){t(this).css({width:"auto",display:"table"}),/MSIE 7\./.test(navigator.userAgent)&&t(this).css("width","")},void 0!==ezTOC.visibility_hide_by_default){var i=t(".ez-toc-toggle:not(.ez-toc-loaded),.ez-toc-widget-sticky-toggle:not(.ez-toc-loaded)");ezTOC.visibility_hide_by_default,t.each(i,function(e,i){var o=t(this);t(o).addClass("ez-toc-loaded");var c=t(o).parents("#ez-toc-container,#ez-toc-widget-container,#ez-toc-widget-sticky-container").find("ul.ez-toc-list,ul.ez-toc-widget-sticky-list");if(t(c).hasClass("eztoc-toggle-hide-by-default"))var a=1;Cookies?(1==Cookies.get("ezTOC_hidetoc-"+e)?t(o).data("visible",!1):t(o).data("visible",!0),Cookies.remove("ezTOC_hidetoc-"+e)):(t(o).data("visible",!0),Cookies.remove("ezTOC_hidetoc-"+e)),a&&t(o).data("visible",!1),t(o).data("visible")||c.hide(),t(o).on("click",function(i){i.preventDefault();let o=document.querySelector("#ez-toc-container");if(o)o.classList.toggle("toc_close");else{let s=document.querySelector(".ez-toc-widget-container,.ez-toc-widget-sticky-container");s.classList.toggle("toc_close")}t(this).data("visible")?(t(this).data("visible",!1),Cookies&&(a?Cookies.set("ezTOC_hidetoc-"+e,null,{path:"/"}):Cookies.set("ezTOC_hidetoc-"+e,"1",{expires:30,path:"/"})),c.hide("fast")):(t(this).data("visible",!0),Cookies&&(a?Cookies.set("ezTOC_hidetoc-"+e,"1",{expires:30,path:"/"}):Cookies.set("ezTOC_hidetoc-"+e,null,{path:"/"})),c.show("fast"))})})}var o,c,a,s=t("span.ez-toc-section").toArray(),l=(o=s,o.reduce(function(e,i){var o;return e[i.id]=t('.ez-toc-widget-container .ez-toc-list a[href="#'+t(o=i).attr("id")+'"]'),e},{})),n=t.map(l,function(t,e){return t}),r=(c=5,void 0!==ezTOC.smooth_scroll&&1===parseInt(ezTOC.smooth_scroll)&&(c=void 0!==ezTOC.scroll_offset?parseInt(ezTOC.scroll_offset):30),a=t("#wpadminbar"),a.length&&(c+=a.height()),c);function d(){var e,i,o,c,a,d=(e=r,i=s,o=t(window).scrollTop()+e+1,c=i[0],a=o-t(c).offset().top,i.forEach(function(e){var i=o-t(e).offset().top;i>0&&i<a&&(a=i,c=e)}),c);if(d){var h,f,g,z,v,u,p,b,$,w=l[d.id];(function t(e,i){i.forEach(function(t){e!==t&&t.parent().hasClass("active")&&t.parent().removeClass("active")})})(w,n),(g=(h=w).parent()).hasClass("active")||g.addClass("active"),$=(z=f=g,v=t(z),u=v.html(),v.parent().append('<li id="ez-toc-height-test" class="active">'+u+"</li>"),p=t("#ez-toc-height-test"),b=p.height(),p.remove(),b-(v.children("ul").first().height()||0)),t(".ez-toc-widget-container ul.ez-toc-list li.active").css("height",$+"px")}}function h(){t(window).off("load resize scroll",d)}s.length>0&&t(".ez-toc-widget-container").length&&t(window).on("load resize scroll",d)}t("#ez-toc-container").length&&!t("#ez-toc-container .ez-toc-toggle label span").html()&&t("#ez-toc-container .ez-toc-toggle label").html(ezTOC.fallbackIcon),ezTOC.init=function(){e()},e()}});