"use strict";!function(o){o.bind("preview-ready",function(){var E=document,x=window,I=document.getElementById.bind(document);o.selectiveRefresh.bind("partial-content-rendered",function(e){switch(e.partial.params.selector){case"#to-top-wrap":var t,i,o,a,n,s=I("to-top"),r=(s&&(s.addEventListener("click",function(e){e.preventDefault(),x.scroll({top:0,left:0,behavior:"smooth"})}),x.addEventListener("scroll",function(e){60<x.pageYOffset?s.classList.add("visible"):s.classList.remove("visible")}),x.dispatchEvent(new Event("scroll"))),E.querySelector("#layout > article")),c=E.querySelector("#read-progress div");r&&c&&(t=E.querySelector("#read-progress span"),i=!(!t||"50%"!==t.style.left),o=r.getBoundingClientRect(),a=o.y+x.pageYOffset,n=o.height+a,x.addEventListener("scroll",function(){var e,s=x.pageYOffset;a<s&&s<n?e=100*(s-a)/o.height:(s<a&&(e=0),a<s&&(e=100)),c.style.width=e+"%",t&&(i&&(t.style.left=e/2+"%"),t.innerText=Math.round(e)+"%")},{passive:!0}),x.addEventListener("resize",function(){o=r.getBoundingClientRect(),a=o.y+x.pageYOffset,n=o.height+a}),x.dispatchEvent(new Event("scroll")));break;case"#top-wrap":I("header-affix-wrap")&&(g=I("header"),w=(h=g).offsetTop,g=h.id,L=E.getElementById("header-absolute-wrap"),m=h.getAttribute("data-bg"),y=[],(_="header"===g&&L&&m&&h.classList.contains("transparent"))&&(y=m.split(" ")),x.onscroll=function(e){x.pageYOffset>=w?h.classList.contains("affix")||(_&&b(h,y,!0),h.classList.add("affix")):h.classList.contains("affix")&&(_&&b(h,y,!1),h.classList.remove("affix")),0===x.pageYOffset&&h.classList.contains("affix")&&(_&&b(h,y,!1),h.classList.remove("affix")),this.oldScroll>this.scrollY?(h.classList.add("scrolling-up"),h.classList.remove("scrolling-down")):(h.classList.remove("scrolling-up"),h.classList.add("scrolling-down")),this.oldScroll=this.scrollY}),x.dispatchEvent(new Event("scroll"));g=I("nav_close");function l(e,s){var t=new Date,t=(t.setTime(t.getTime()+31536e6),"expires="+t.toUTCString());E.cookie=e+"="+s+";"+t+";path=/"}function d(e){if(x.exsInverse)for(var s in x.exsInverse[e])E.documentElement.style.setProperty("--"+s,x.exsInverse[e][s])}g&&g.addEventListener("click",function(){x.dispatchEvent(new Event("scroll"))}),E.body.classList.remove("top-menu-active","side-menu-active","search-dropdown-active");var v=I("toggle_inverse");v&&v.addEventListener("click",function(e){v.classList.contains("active")?(v.classList.remove("active"),d("light"),l("exs-color-inverse","0")):(v.classList.add("active"),d("dark"),l("exs-color-inverse","1"))});break;case"#preloader-wrap":var f=I("preloader");f&&setTimeout(function(){f.classList.add("loaded")},1500);break;case"#layout":if("undefined"!=typeof Masonry&&"undefined"!=typeof imagesLoaded){var p=E.querySelectorAll(".masonry");if(p.length)for(var u=0;u<p.length;u++)imagesLoaded(p[u],function(e){new Masonry(e.elements[0],{itemSelector:".grid-item",columnWidth:".grid-sizer",percentPosition:!0})})}break;case"head":jQuery("body").animate({opacity:1},500)}function b(s,e,t){var i=s.classList.contains("header-inverse");t?s.classList.contains("affix")||(i?s.classList.remove("l"):s.classList.remove("i"),e.forEach(function(e){s.classList.add(e)})):s.classList.contains("affix")&&(e.forEach(function(e){s.classList.remove(e)}),i?s.classList.add("l"):s.classList.add("i"))}var h,w,g,L,m,y,_});[{controlId:"blog_single_sidebar_position",view:"post"},{controlId:"blog_sidebar_position",view:"archive"},{controlId:"search_sidebar_position",view:"search"},{controlId:"shop_sidebar_position",view:"shop"},{controlId:"product_sidebar_position",view:"product"},{controlId:"bbpress_sidebar_position",view:"bbpress"},{controlId:"buddypress_sidebar_position",view:"buddypress"},{controlId:"events_sidebar_position",view:"events"},{controlId:"event_sidebar_position",view:"event"},{controlId:"wpjm_sidebar_position",view:"wpjm"}].forEach(function(e,s){var t,i;t=e.controlId,i=e.view,o(t,function(e){e.bind(function(e){if(i===x.exsPreviewObject.viewGlobal)switch(E.body.classList.remove("with-sidebar","sidebar-left"),e){case"left":E.body.classList.add("with-sidebar","sidebar-left");break;case"right":E.body.classList.add("with-sidebar")}})})})})}(wp.customize);