!function(){"use strict";const e=(e,t,n)=>{(e instanceof NodeList?e:[e]).forEach(e=>e.addEventListener(t,t=>n(t,e)))},t=(e,t)=>{r(e,t,"toggle")},n=(e,t)=>{r(e,t,"add")},o=(e,t)=>{r(e,t,"remove")},r=(e,t,n)=>{const o=t.split(" ");(e instanceof NodeList?e:[e]).forEach(e=>e.classList[n].apply(e.classList,o))};let i=null,c=2;const s=()=>{const{masonryStatus:e,masonryColumns:t,blogLayout:n}=NeveProperties;"enabled"!==e||t<2||(i=document.querySelector(".nv-index-posts .posts-wrapper"),null!==i&&imagesLoaded(i,()=>{const e="article.layout-".concat(n);window.nvMasonry=new Masonry(i,{itemSelector:e,columnWidth:e,percentPosition:!0})}))},a=()=>{"enabled"===NeveProperties.infScroll&&null!==document.querySelector(".nv-index-posts .posts-wrapper")&&((e,t,n=.5)=>{if(!e)return;new IntersectionObserver(o=>{if(o[0].intersectionRatio<=n)return;t();const r=setInterval(()=>{const n=e.getBoundingClientRect(),{top:o,left:i,right:c,bottom:s}=n,{innerWidth:a,innerHeight:l}=window;o>=0&&i>=0&&c<=a&&s<=l?t():clearInterval(r)},750)}).observe(e)})(document.querySelector(".infinite-scroll-trigger"),()=>{if(parent&&parent.wp&&parent.wp.customize)return parent.wp.customize.requestChangesetUpdate().then(()=>{l()}),!1;l()})},l=()=>{const e=window.document,t=window.NeveProperties,n=e.querySelector(".infinite-scroll-trigger");if(null===n)return;const o=e.querySelector(".nv-loader");if(o.style.display="block",c>t.maxPages)return n.parentNode.removeChild(n),void(o.style.display="none");const r=e.querySelector(".nv-index-posts .posts-wrapper"),i=t.lang,s=t.endpoint+c,a=d(i?s+"/"+i:s);c++;const l=e.createElement("div");r.appendChild(l),((e,t,n)=>{const o=new XMLHttpRequest;o.onload=()=>{4===o.readyState&&200===o.status&&t(o.response)},o.onerror=()=>{},o.open("POST",e,!0),o.setRequestHeader("Content-Type","application/json; charset=UTF-8"),o.send(n)})(a,e=>{if(l.outerHTML=JSON.parse(e),"enabled"!==t.masonryStatus)return!1;window.nvMasonry.reloadItems(),window.nvMasonry.layout()},t.query)},d=e=>"undefined"==typeof wp||void 0===wp.customize?e:(e+="?customize_changeset_uuid="+wp.customize.settings.changeset.uuid+"&customize_autosaved=on","undefined"==typeof _wpCustomizeSettings?e:e+="&customize_preview_nonce="+_wpCustomizeSettings.nonce.preview),u=["dropdown-open","active","nav-clickaway-overlay"],p=()=>{m(),document.addEventListener("click",(function(e){e.target.hash&&e.target.hash.includes("#")&&window.HFG.toggleMenuSidebar(!1)})),f(),g(),S(),function(){const e=document.querySelectorAll(".responsive-nav-cart.dropdown");if(0===e.length)return;const t=()=>window.matchMedia("(max-width: 959px)").matches;e.forEach(e=>{const n=e.querySelector(".cart-icon-wrapper");null!==n&&n.addEventListener("click",(function(n){t()&&!e.classList.contains("cart-is-empty")&&(n.preventDefault(),e.classList.toggle("cart-dropdown-open"))}))}),document.addEventListener("click",(function(n){t()&&e.forEach(e=>{e.classList.contains("cart-dropdown-open")&&!e.contains(n.target)&&e.classList.remove("cart-dropdown-open")})}))}(),window.HFG.initSearch=function(){g(),f()}},m=()=>{const{isRTL:e}=NeveProperties,t=document.querySelectorAll(".sub-menu, .minimal .nv-nav-search");if(0===t.length)return;const n=window.innerWidth;t.forEach(t=>{let o=t.getBoundingClientRect(),r=o.left;r<0&&(t.style.right=e?"-100%":"auto",t.style.left=e?"auto":0),r+o.width>=n&&(t.style.right=e?0:"100%",t.style.left="auto"),o=t.getBoundingClientRect(),r=o.left,(r<0||r+o.width>=n)&&(t.style.transform="translateX("+(e?"-":"")+(Math.abs(r)+20)+"px)")}),"undefined"!=typeof menuCalcEvent&&window.dispatchEvent(menuCalcEvent)};function f(){const t=document.querySelectorAll(".caret-wrap");e(t,"click",v)}function v(e,n){e.preventDefault(),e.stopPropagation();const o=n.parentNode.parentNode.querySelector(".sub-menu");t(n,u[0]),t(o,u[0]),b(document.querySelectorAll(".".concat(u[0])),u[0])}const y=e=>e===document||"none"!==window.getComputedStyle(e,null).display&&y(e.parentNode);let h={};function w(e){const t=function(e=document){return[...e.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])')].filter(e=>!e.hasAttribute("disabled")&&!e.getAttribute("aria-hidden")&&y(e))}(h.container),n=9===e.keyCode,o=e.shiftKey,r=27===e.keyCode,i=document.activeElement,c=t[t.length-1],s=t[0];r&&(e.preventDefault(),h.backFocus.focus(),window.HFG.toggleMenuSidebar(!1),document.dispatchEvent(new CustomEvent("ftrap-end"))),!o&&n&&c===i&&(e.preventDefault(),s.focus()),o&&n&&s===i&&(e.preventDefault(),c.focus()),n&&s===c&&e.preventDefault()}function g(){const n=window.document,r=n.querySelectorAll(".nv-nav-search")||[],i=n.querySelectorAll(".menu-item-nav-search")||[],c=n.querySelectorAll(".close-responsive-search")||[];e(i,"click",(e,o)=>{e.preventDefault(),e.stopPropagation(),t(o,u[1]),b(o,u[1]),n.dispatchEvent(new CustomEvent("ftrap-run",{detail:{container:o.querySelector(".nv-nav-search"),close:".close-responsive-search",firstFocus:".search-field",backFocus:o}}))}),e(r,"click",e=>{e.stopPropagation()}),e(c,"click",e=>{e.preventDefault(),o(i,u[1]);const t=n.querySelector(".".concat(u[2]));null!==t&&t.parentNode.removeChild(t)})}function S(){const e=document.querySelectorAll(".header--row .menu-item-nav-cart");if(0===e.length)return;const t=window.matchMedia("(max-width: 959px)").matches;e.forEach(e=>{const n=e.querySelector(".nv-nav-cart:not(.cart-off-canvas)");if(null!==n){if(n.style.left="",n.style.right="",t){const t=Math.min(360,window.innerWidth-32),o=e.getBoundingClientRect().left;return n.style.width="".concat(t,"px"),n.style.maxWidth="calc(100vw - ".concat(32,"px)"),n.style.left="".concat((window.innerWidth-t)/2-o,"px"),void(n.style.right="auto")}n.style.width="",n.style.maxWidth="",n.style.left=e.getBoundingClientRect().left<350?0:""}})}function b(e,t){let r=document.querySelector(".".concat(u[2]));null!==r&&r.parentNode.removeChild(r),r=document.createElement("div"),n(r,u[2]);const i=document.querySelector("header.header");i.parentNode.insertBefore(r,i),r.addEventListener("click",()=>{o(e,t),r.parentNode.removeChild(r)})}document.addEventListener("ftrap-run",(function(e){h=e.detail,setTimeout((function(e){e.container.querySelector(e.firstFocus).focus()}),100,h),document.addEventListener("keydown",w)})),document.addEventListener("ftrap-end",(function(){h={},document.removeEventListener("keydown",w)})),window.addEventListener("resize",S);const q=".close-sidebar-panel .navbar-toggle",E=["is-menu-sidebar","hiding-header-menu-sidebar","is-active"],L=function(){this.options={menuToggleDuration:300},this.init()},C=(e,t=!0)=>{e.forEach((function(e){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}))};function k(){window.HFG=new L,(()=>{if(null===document.querySelector(".blog.nv-index-posts"))return!1;s(),a()})(),p()}function x(){m()}let A;L.prototype.init=function(t=!1){const n=window.document;if(!1===t){const t=n.querySelectorAll(q);e(t,"click",()=>{this.toggleMenuSidebar(!1)})}const o=n.querySelectorAll(".menu-mobile-toggle");e(o,"click",e=>{this.toggleMenuSidebar(!e.target.parentElement.classList.contains("is-active"),e.target)});const r=n.querySelector(".header-menu-sidebar-overlay");r&&e(r,"click",function(){this.toggleMenuSidebar(!1)}.bind(this))},L.prototype.toggleMenuSidebar=function(e,t=null){const r=window.document,i=r.querySelectorAll(".menu-mobile-toggle");o(r.body,E[1]);const c=r.querySelectorAll("#header-menu-sidebar, .hfg-ov"),s=r.querySelectorAll(".neve-skip-link, #content, .scroll-to-top, #site-footer, .header--row");if(!NeveProperties.isCustomize&&r.body.classList.contains(E[0])||!1===e){const e=r.querySelector(".nav-clickaway-overlay");null!==e&&e.parentNode.removeChild(e),n(r.body,E[1]),o(r.body,E[0]),o(i,E[2]),setTimeout(function(){o(r.body,E[1])}.bind(this),1e3),C(s,!1),C(c),r.dispatchEvent(new CustomEvent("ftrap-end"))}else n(r.body,E[0]),n(i,E[2]),t&&r.dispatchEvent(new CustomEvent("ftrap-run",{detail:{container:r.getElementById("header-menu-sidebar"),close:q,firstFocus:q+",.menu-item a",backFocus:t}})),C(c,!1),C(s)},window.addEventListener("load",()=>{k()}),window.addEventListener("resize",()=>{clearTimeout(A),A=setTimeout(x,500)})}();