window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t,n=(this.document||this.ownerDocument).querySelectorAll(e),o=this;do{for(t=n.length;0<=--t&&n.item(t)!==o;);}while(t<0&&(o=o.parentElement));return o}),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,window.CustomEvent=e)}(),function(){for(var r=0,e=["ms","moz","webkit","o"],t=0;t<e.length&&!window.requestAnimationFrame;++t)window.requestAnimationFrame=window[e[t]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[t]+"CancelAnimationFrame"]||window[e[t]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e,t){var n=(new Date).getTime(),o=Math.max(0,16-(n-r)),i=window.setTimeout(function(){e(n+o)},o);return r=n+o,i}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)})}(),function(e,t){"function"==typeof define&&define.amd?define([],function(){return t(e)}):"object"==typeof exports?module.exports=t(e):e.SmoothScroll=t(e)}("undefined"!=typeof global?global:"undefined"!=typeof window?window:this,function(b){"use strict";function E(){for(var e={},t=0;t<arguments.length;t++){n=void 0;var n,o=arguments[t];for(n in o)o.hasOwnProperty(n)&&(e[n]=o[n])}return e}function c(t){var n;try{n=decodeURIComponent(t)}catch(e){n=t}return n}function s(e){"#"===e.charAt(0)&&(e=e.substr(1));for(var t,n,o=String(e),i=o.length,r=-1,a="",c=o.charCodeAt(0);++r<i;){if(0===(t=o.charCodeAt(r)))throw new InvalidCharacterError("Invalid character: the input contains U+0000.");1<=t&&t<=31||127==t||0===r&&48<=t&&t<=57||1===r&&48<=t&&t<=57&&45===c?a+="\\"+t.toString(16)+" ":a+=128<=t||45===t||95===t||48<=t&&t<=57||65<=t&&t<=90||97<=t&&t<=122?o.charAt(r):"\\"+o.charAt(r)}try{n=decodeURIComponent("#"+a)}catch(e){n="#"+a}return n}function A(e){return e?t(e)+e.offsetTop:0}function C(e,t,n,o){t.emitEvents&&"function"==typeof b.CustomEvent&&(t=new CustomEvent(e,{bubbles:!0,detail:{anchor:n,toggle:o}}),document.dispatchEvent(t))}var q={ignore:"[data-scroll-ignore]",header:null,topOnEmptyHash:!0,speed:500,clip:!0,offset:0,easing:"easeInOutCubic",customEasing:null,updateURL:!0,popstate:!0,emitEvents:!0},t=function(e){return parseInt(b.getComputedStyle(e).height,10)},O=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)};return function(o,e){function t(e){var t,n;"matchMedia"in b&&b.matchMedia("(prefers-reduced-motion)").matches||0!==e.button||e.metaKey||e.ctrlKey||"closest"in e.target&&(r=e.target.closest(o))&&"a"===r.tagName.toLowerCase()&&!e.target.closest(g.ignore)&&r.hostname===b.location.hostname&&r.pathname===b.location.pathname&&/#/.test(r.href)&&(t=s(c(r.hash)),n=(n=g.topOnEmptyHash&&"#"===t?document.documentElement:document.querySelector(t))||"#top"!==t?n:document.documentElement)&&(e.preventDefault(),S.animateScroll(n,r))}function n(e){var t;null!==history.state&&history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(g)&&history.state.anchor&&(t=document.querySelector(s(c(history.state.anchor))))&&S.animateScroll(t,null,{updateURL:!1})}function i(e){a=a||setTimeout(function(){a=null,v=A(y)},66)}var g,r,y,v,a,w,S={cancelScroll:function(e){cancelAnimationFrame(w),w=null,e||C("scrollCancel",g)}};S.animateScroll=function(o,i,e){var r,a,c,s,u,l,m,d,f,t,h=E(g||q,e||{}),p="[object Number]"===Object.prototype.toString.call(o),e=p||!o.tagName?null:o;(p||e)&&(r=b.pageYOffset,h.header&&!y&&(y=document.querySelector(h.header)),v=v||A(y),a=p?o:function(e,t,n,o){var i=0;if(e.offsetParent)for(;i+=e.offsetTop,e=e.offsetParent;);return i=Math.max(i-t-n,0),i=o?Math.min(i,O()-b.innerHeight):i}(e,v,parseInt("function"==typeof h.offset?h.offset(o,i):h.offset,10),h.clip),c=a-r,s=O(),d=function(e,t){var n=b.pageYOffset;if(e==t||n==t||(r<t&&b.innerHeight+n)>=s)return S.cancelScroll(!0),e=t,n=p,0===(t=o)&&document.body.focus(),n||(t.focus(),document.activeElement!==t&&(t.setAttribute("tabindex","-1"),t.focus(),t.style.outline="none"),b.scrollTo(0,e)),C("scrollStop",h,o,i),!(w=l=null)},f=function(e){var t,n,o;m=(u+=e-(l=l||e))/parseInt(h.speed,10),m=r+c*(n=1<m?1:m,"easeInQuad"===(t=h).easing&&(o=n*n),"easeOutQuad"===t.easing&&(o=n*(2-n)),"easeInOutQuad"===t.easing&&(o=n<.5?2*n*n:(4-2*n)*n-1),"easeInCubic"===t.easing&&(o=n*n*n),"easeOutCubic"===t.easing&&(o=--n*n*n+1),"easeInOutCubic"===t.easing&&(o=n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1),"easeInQuart"===t.easing&&(o=n*n*n*n),"easeOutQuart"===t.easing&&(o=1- --n*n*n*n),"easeInOutQuart"===t.easing&&(o=n<.5?8*n*n*n*n:1-8*--n*n*n*n),"easeInQuint"===t.easing&&(o=n*n*n*n*n),"easeOutQuint"===t.easing&&(o=1+--n*n*n*n*n),"easeInOutQuint"===t.easing&&(o=n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n),(o=t.customEasing?t.customEasing(n):o)||n),b.scrollTo(0,Math.floor(m)),d(m,a)||(w=b.requestAnimationFrame(f),l=e)},(u=0)===b.pageYOffset&&b.scrollTo(0,0),e=o,t=h,p||history.pushState&&t.updateURL&&history.pushState({smoothScroll:JSON.stringify(t),anchor:e.id},document.title,e===document.documentElement?"#top":"#"+e.id),C("scrollStart",h,o,i),S.cancelScroll(!0),b.requestAnimationFrame(f))};return S.destroy=function(){g&&(document.removeEventListener("click",t,!1),b.removeEventListener("resize",i,!1),b.removeEventListener("popstate",n,!1),S.cancelScroll(),w=a=v=y=r=g=null)},S.init=function(e){if(!("querySelector"in document&&"addEventListener"in b&&"requestAnimationFrame"in b&&"closest"in b.Element.prototype))throw"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";S.destroy(),g=E(q,e||{}),y=g.header?document.querySelector(g.header):null,v=A(y),document.addEventListener("click",t,!1),y&&b.addEventListener("resize",i,!1),g.updateURL&&g.popstate&&b.addEventListener("popstate",n,!1)},S.init(e),S}});var gpscroll=new SmoothScroll(gpSmoothScroll.elements.join(),{speed:gpSmoothScroll.duration,offset:function(e,t){var n=document.body,o=document.querySelector("#site-navigation"),i=document.querySelector("#sticky-navigation"),r=document.querySelector("#mobile-header"),a=document.querySelector(".menu-toggle"),c=0;return r&&(r.offsetWidth||r.offsetHeight||r.getClientRects().length)?n.classList.contains("mobile-header-sticky")&&(c+=r.clientHeight):a&&(a.offsetWidth||a.offsetHeight||a.getClientRects().length)?(n.classList.contains("both-sticky-menu")||n.classList.contains("mobile-sticky-menu"))&&(i?c+=i.clientHeight:o&&(c+=o.clientHeight)):(n.classList.contains("both-sticky-menu")||n.classList.contains("desktop-sticky-menu"))&&(i?c+=i.clientHeight:o&&(c+=o.clientHeight)),gpSmoothScroll.offset||c}});
(()=>{var e=document.querySelectorAll(".main-nav .sub-menu, .main-nav .children");if(e&&e.forEach(function(e){var t,n=e.closest("li"),s=n.querySelector('.dropdown-menu-toggle[role="button"]');e.id||(t=n.id||"menu-item-"+Math.floor(1e5*Math.random()),e.id=t+"-sub-menu"),(s=s||n.querySelector('a[role="button"]'))&&s.setAttribute("aria-controls",e.id)}),"querySelector"in document&&"addEventListener"in window){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;if(document.documentElement.contains(this))do{if(t.matches(e))return t}while(null!==(t=t.parentElement));return null});var o=function(t){return Array.prototype.filter.call(t.parentNode.children,function(e){return e!==t})},t=document.querySelectorAll(".menu-toggle"),n=document.querySelectorAll("nav .dropdown-menu-toggle"),s=document.querySelectorAll("nav .main-nav ul a"),l=document.querySelector(".mobile-menu-control-wrapper"),c=document.body,u=document.documentElement,d=function(e){if(e&&c.classList.contains("dropdown-hover")){var t=e.querySelectorAll("li.menu-item-has-children");for(h=0;h<t.length;h++)t[h].querySelector(".dropdown-menu-toggle").removeAttribute("tabindex"),t[h].querySelector(".dropdown-menu-toggle").setAttribute("role","presentation"),t[h].querySelector(".dropdown-menu-toggle").removeAttribute("aria-expanded"),t[h].querySelector(".dropdown-menu-toggle").removeAttribute("aria-controls"),t[h].querySelector(".dropdown-menu-toggle").removeAttribute("aria-label")}},r=function(e){"false"!==e.getAttribute("aria-expanded")&&e.getAttribute("aria-expanded")?(e.setAttribute("aria-expanded","false"),e.setAttribute("aria-label",generatepressMenu.openSubMenuLabel)):(e.setAttribute("aria-expanded","true"),e.setAttribute("aria-label",generatepressMenu.closeSubMenuLabel))},a=function(e,t){var n="";if(n=(t=t||this).getAttribute("data-nav")?document.getElementById(t.getAttribute("data-nav")):document.getElementById(t.closest("nav").getAttribute("id"))){var s=!1,o=(t.closest(".mobile-menu-control-wrapper")&&(s=!0),n.getElementsByTagName("ul")[0]);if(n.classList.contains("toggled"))n.classList.remove("toggled"),u.classList.remove("mobile-menu-open"),o&&o.setAttribute("aria-hidden","true"),t.setAttribute("aria-expanded","false"),(s||l&&n.classList.contains("main-navigation"))&&l.classList.remove("toggled"),d(o);else{n.classList.add("toggled"),u.classList.add("mobile-menu-open"),o&&o.setAttribute("aria-hidden","false"),t.setAttribute("aria-expanded","true"),s?(l.classList.add("toggled"),l.querySelector(".search-item")&&l.querySelector(".search-item").classList.contains("active")&&l.querySelector(".search-item").click()):l&&n.classList.contains("main-navigation")&&l.classList.add("toggled");t=o;if(t&&c.classList.contains("dropdown-hover")){var r=t.querySelectorAll("li.menu-item-has-children");for(h=0;h<r.length;h++){var a=r[h].querySelector(".dropdown-menu-toggle"),i=a.closest("li").querySelector(".sub-menu, .children");a.setAttribute("tabindex","0"),a.setAttribute("role","button"),a.setAttribute("aria-expanded","false"),a.setAttribute("aria-controls",i.id),a.setAttribute("aria-label",generatepressMenu.openSubMenuLabel)}}}}};for(h=0;h<t.length;h++)t[h].addEventListener("click",a,!1);var i=function(e,t){if(((t=t||this).closest("nav").classList.contains("toggled")||u.classList.contains("slide-opened"))&&!c.classList.contains("dropdown-click")){e.preventDefault();var n,t=t.closest("li");if(r(t.querySelector(".dropdown-menu-toggle")),n=t.querySelector(".sub-menu")?t.querySelector(".sub-menu"):t.querySelector(".children"),generatepressMenu.toggleOpenedSubMenus){var s=o(t);for(h=0;h<s.length;h++)s[h].classList.contains("sfHover")&&(s[h].classList.remove("sfHover"),s[h].querySelector(".toggled-on").classList.remove("toggled-on"),r(s[h].querySelector(".dropdown-menu-toggle")))}t.classList.toggle("sfHover"),n.classList.toggle("toggled-on")}e.stopPropagation()};for(h=0;h<n.length;h++)n[h].addEventListener("click",i,!1),n[h].addEventListener("keypress",function(e){"Enter"!==e.key&&" "!==e.key||i(e,this)},!1);e=function(){var e=document.querySelectorAll(".toggled, .has-active-search");for(h=0;h<e.length;h++){var t=e[h].querySelector(".menu-toggle");if((t=l&&!t.closest("nav").classList.contains("mobile-menu-control-wrapper")?l.querySelector(".menu-toggle"):t)&&null===t.offsetParent){if(e[h].classList.contains("toggled")){var n,s,o,r=!1;if((r=e[h].classList.contains("mobile-menu-control-wrapper")?!0:r)||(s=(n=e[h].getElementsByTagName("ul")[0])?n.getElementsByTagName("li"):[],o=n?n.getElementsByTagName("ul"):[]),document.activeElement.blur(),e[h].classList.remove("toggled"),u.classList.remove("mobile-menu-open"),t.setAttribute("aria-expanded","false"),!r){for(var a=0;a<s.length;a++)s[a].classList.remove("sfHover");for(var i=0;i<o.length;i++)o[i].classList.remove("toggled-on");n&&n.removeAttribute("aria-hidden")}d(e[h])}l.querySelector(".search-item")&&l.querySelector(".search-item").classList.contains("active")&&l.querySelector(".search-item").click()}}};if(window.addEventListener("resize",e,!1),window.addEventListener("orientationchange",e,!1),c.classList.contains("dropdown-hover"))for(h=0;h<s.length;h++)s[h].addEventListener("click",function(e){var t;this.hostname!==window.location.hostname&&document.activeElement.blur(),(this.closest("nav").classList.contains("toggled")||u.classList.contains("slide-opened"))&&("#"===(t=this.getAttribute("href"))||""===t)&&(e.preventDefault(),(t=this.closest("li")).classList.toggle("sfHover"),e=t.querySelector(".sub-menu"))&&e.classList.toggle("toggled-on")},!1);if(c.classList.contains("dropdown-hover")){for(var m=document.querySelectorAll(".menu-bar-items .menu-bar-item > a"),g=function(){if(!this.closest("nav").classList.contains("toggled")&&!this.closest("nav").classList.contains("slideout-navigation"))for(var e=this;-1===e.className.indexOf("main-nav");)"li"===e.tagName.toLowerCase()&&e.classList.toggle("sfHover"),e=e.parentElement},v=function(){if(!this.closest("nav").classList.contains("toggled")&&!this.closest("nav").classList.contains("slideout-navigation"))for(var e=this;-1===e.className.indexOf("menu-bar-items");)e.classList.contains("menu-bar-item")&&e.classList.toggle("sfHover"),e=e.parentElement},h=0;h<s.length;h++)s[h].addEventListener("focus",g),s[h].addEventListener("blur",g);for(h=0;h<m.length;h++)m[h].addEventListener("focus",v),m[h].addEventListener("blur",v)}if("ontouchend"in document.documentElement&&document.body.classList.contains("dropdown-hover")){var f=document.querySelectorAll(".sf-menu .menu-item-has-children");for(h=0;h<f.length;h++)f[h].addEventListener("touchend",function(e){if(!(this.closest("nav").classList.contains("toggled")||1!==e.touches.length&&0!==e.touches.length||(e.stopPropagation(),this.classList.contains("sfHover")))){e.target!==this&&e.target.parentNode!==this&&!e.target.parentNode.parentNode||e.preventDefault();var e=this.closest("li"),t=o(e);for(h=0;h<t.length;h++)t[h].classList.contains("sfHover")&&t[h].classList.remove("sfHover");this.classList.add("sfHover");var n,s=this;document.addEventListener("touchend",n=function(e){e.stopPropagation(),s.classList.remove("sfHover"),document.removeEventListener("touchend",n)})}})}}})();
(()=>{var c;"querySelector"in document&&"addEventListener"in window&&(c=document.querySelector(".generate-back-to-top"))&&(window.addEventListener("scroll",function(){var e=window.pageYOffset,t=c.getAttribute("data-start-scroll");t<e&&c.classList.add("generate-back-to-top__show"),e<t&&c.classList.remove("generate-back-to-top__show")}),c.addEventListener("click",function(e){var t,o,n,a,r;e.preventDefault(),generatepressBackToTop.smooth?(document.body,e=c.getAttribute("data-scroll-speed")||400,t=window.pageYOffset,o=document.body.offsetTop,n=(o-t)/(e/16),a=function(){window.pageYOffset<=(o||0)&&(clearInterval(r),document.activeElement.blur())},r=setInterval(function(){window.scrollBy(0,n),a()},16)):window.scrollTo(0,0)},!1))})();
(()=>{"use strict";var e,t={};function n(e){if("Tab"!==e.key&&9!==e.keyCode)return;e.preventDefault();const t=e.currentTarget,n=t.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [role="button"]:not([disabled]), [tabindex="0"]'),o=Array.from(n).filter((e=>null!==e.offsetParent&&"hidden"!==getComputedStyle(e).visibility&&"none"!==getComputedStyle(e).display));if(0===o.length)return;const a=o[0],i=o[o.length-1],s=document.activeElement;if(t.contains(s))if(e.shiftKey)if(s===a)i.focus();else{const e=o.indexOf(s);e>0&&o[e-1].focus()}else if(s===i)a.focus();else{const e=o.indexOf(s);e<o.length-1&&o[e+1].focus()}else a.focus()}function o(e){const t=e.querySelectorAll(".gb-menu-toggle"),o=e.querySelector(".gb-menu-container"),a=o.querySelector(".gb-menu"),i=a.querySelectorAll(".menu-item"),s=a.querySelectorAll(".menu-item > a"),r=a.querySelectorAll(".gb-submenu-toggle"),l=function(e){const t=e.querySelectorAll(".menu-item-has-gb-mega-menu [data-gb-overlay]"),n=[];return t.forEach((e=>{const t=e.getAttribute("data-gb-overlay");if(t){const e=document.querySelector("#"+t);e&&!n.includes(e)&&n.push(e)}})),n}(e),c=e.closest("body");requestAnimationFrame((()=>{c.removeAttribute("data-gb-menu-open"),e.classList.remove("gb-navigation--open"),o&&(o.classList.remove("gb-menu-container--toggled"),o.removeEventListener("keydown",n)),t.forEach((e=>{e&&(e.classList.remove("gb-menu-toggle--toggled"),e.ariaExpanded="false",(e.offsetHeight>0||e.offsetWidth>0)&&e.focus())})),i?.length>0&&i.forEach((e=>{e.classList.remove("gb-sub-menu--open")})),s?.length>0&&s.forEach((e=>{e.hasAttribute("aria-expanded")&&e.setAttribute("aria-expanded","false")})),r?.length>0&&r.forEach((e=>{e.hasAttribute("aria-expanded")&&e.setAttribute("aria-expanded","false")})),l?.length>0&&l.forEach((e=>{e.gbOverlayClose()}))}))}function a(e,t=null){if(!e)return;const n=e.querySelectorAll(".menu-item.gb-sub-menu--open");n&&Array.from(n).filter((e=>!e.contains(t))).forEach((e=>{const t=e.querySelector("a"),n=e.querySelector(".gb-submenu-toggle");e.classList.remove("gb-sub-menu--open"),e.setAttribute("aria-current","false"),t&&t.hasAttribute("aria-expanded")&&t.setAttribute("aria-expanded","false"),n&&n.hasAttribute("aria-expanded")&&n.setAttribute("aria-expanded","false")}))}function i(e,t=!1){if(e){t&&t.preventDefault();const n=e.closest(".gb-navigation"),o=e.closest(".menu-item");if(a(n,o),!e.getAttribute("data-gb-overlay")){const t="true"===e.getAttribute("aria-expanded");e.setAttribute("aria-expanded",t?"false":"true")}o.classList.toggle("gb-sub-menu--open")}}function s(e,t=!1){if(e){t&&t.preventDefault();const n=t.type,o=e.closest(".gb-menu-container--toggled"),i=e.closest(".gb-menu--hover");if("click"===n&&i&&!o)return;const s=e.closest(".gb-navigation"),r=e.closest(".menu-item");if(a(s,r),!e.getAttribute("data-gb-overlay")){const t="true"===e.getAttribute("aria-expanded");e.setAttribute("aria-expanded",t?"false":"true")}r.classList.toggle("gb-sub-menu--open")}}function r(e){e&&e.forEach((e=>{var t;const n=e.querySelector(".gb-menu-toggle"),a=e.querySelector(".gb-menu-container"),i=null!==(t=e.getAttribute("data-gb-mobile-breakpoint"))&&void 0!==t?t:"",s=window.matchMedia(`(max-width: ${i})`);n&&a&&n.setAttribute("aria-controls",a.id),e.classList.toggle("gb-navigation--mobile",s.matches),a.classList.toggle("gb-menu-container--mobile",s.matches),s.addEventListener("change",(t=>{e.classList.toggle("gb-navigation--mobile",t.matches),a.classList.toggle("gb-menu-container--mobile",t.matches),o(e),t.matches&&c()})),setTimeout((()=>{const t=e.querySelector(".gb-menu");if(t){const e=t.querySelectorAll(".menu-item-has-children");e.length>0&&requestAnimationFrame((()=>{e.forEach((e=>{const n=e.querySelector("a"),o=t.classList.contains("gb-menu--click")?n:e.querySelector(".gb-submenu-toggle");if(o){o.hasAttribute("aria-controls")||o.setAttribute("aria-controls",`sub-menu-${e.id}`),o.hasAttribute("aria-label")||o.setAttribute("aria-label",`${n.textContent} Sub-Menu`);const t=e.querySelector(".gb-sub-menu");t&&(t.id=`sub-menu-${e.id}`)}}))}))}}),0)}))}function l(){let e=document.querySelectorAll(".gb-navigation");if(!e.length){const t=window.frameElement;if(t&&t.id&&t.id.startsWith("pattern-"))return void new MutationObserver(((t,n)=>{e=document.querySelectorAll(".gb-navigation"),e.length&&(n.disconnect(),r(e))})).observe(document.body,{childList:!0,subtree:!0})}r(e),c()}function c(){const e=document.querySelectorAll(".gb-navigation--mobile");e&&e.length&&e.forEach((e=>{e.addEventListener("click",(t=>{const n=t.target.closest('a[href*="#"]');if(!n)return;const a=n.getAttribute("href").match(/#(.+)$/);if(a){const t=a[1];document.getElementById(t)&&setTimeout((()=>{o(e)}),50)}}))}))}t.d=(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},t.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),window.myNavigationScriptInitialized||(window.myNavigationScriptInitialized=!0,document.addEventListener("click",(e=>{const t=e.target;!function(e){if(e){var t;const a=e.closest(".gb-navigation");if(!a)return;if(e.getAttribute("data-gb-overlay"))return;a.classList.contains("gb-navigation--open")?o(a):function(e){const t=e.querySelectorAll(".gb-menu-toggle"),o=e.querySelector(".gb-menu-container"),a=e.getAttribute("data-gb-mobile-menu-type"),i=o.querySelector(".gb-menu-toggle:not(.gb-menu-toggle--clone)"),s=i||"full-overlay"!==a?null:o.querySelector("*"),r=e.closest("body");let l=!1;requestAnimationFrame((()=>{if(e.classList.add("gb-navigation--open"),r.setAttribute("data-gb-menu-open",a),t.forEach((e=>{if(e&&(e.classList.add("gb-menu-toggle--toggled"),e.ariaExpanded="true",!i&&o&&"full-overlay"===a)){s&&(s.style.opacity="0");const t=e.closest(".editor-styles-wrapper"),n=o.querySelector(".gb-menu-toggle--clone");if(t&&n){const t=e.attributes;for(const e of t)n.setAttribute(e.name,e.value);n.innerHTML=e.innerHTML,n.classList.add("gb-menu-toggle","gb-menu-toggle--toggled","gb-menu-toggle--clone"),l=!0}else if(!n){const t=e.cloneNode(!0);t.classList.add("gb-menu-toggle","gb-menu-toggle--toggled","gb-menu-toggle--clone"),o.insertAdjacentElement("afterbegin",t),l=!0}}})),l&&s?requestAnimationFrame((()=>{!function(e,t=()=>{}){const n=e.querySelector(".gb-menu-container .gb-menu-toggle");if(n){var o,a;const i=window.getComputedStyle(n),s=null!==(o=parseInt(i?.top,10))&&void 0!==o?o:0,r=null!==(a=parseInt(i?.height,10))&&void 0!==a?a:0;requestAnimationFrame((()=>{e.style.setProperty("--gb-menu-toggle-offset",r+2*s+"px"),t()}))}}(e,(()=>{s.style.opacity=""}))})):s&&"0"===s.style.opacity&&(s.style.opacity=""),o){o.classList.add("gb-menu-container--toggled");const e=o.querySelector('a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [role="button"]:not([disabled]), [tabindex="0"]');e?e.focus():o.focus(),o.addEventListener("keydown",n)}})),"partial-overlay"===a&&function(e){const t=(n=function(e){var t;const n=null!==(t=e.getAttribute("data-gb-menu-toggle-anchor"))&&void 0!==t?t:"";let o=".gb-navigation";return n?o=n:e.closest(".gb-site-header")&&(o=".gb-site-header"),e.closest(o)}(e))?n.getBoundingClientRect().bottom:0;var n;requestAnimationFrame((()=>e.style.setProperty("--gb-menu-offset",t+"px")))}(e)}(a);const i=null!==(t=window.frameElement)&&void 0!==t&&t;if(i&&i.id&&i.id.startsWith("pattern-"))if(a.classList.contains("gb-navigation--open")){const e=i.getAttribute("data-gb-original-height");e&&(i.style.height=e)}else i.style.height&&parseInt(i.style.height,10)<800&&(i.setAttribute("data-gb-original-height",i.style.height),requestAnimationFrame((()=>i.style.height="800px")))}}(t.closest(".gb-menu-toggle")),i(t.closest(".gb-menu--click .menu-item-has-children > a"),e),s(t.closest(".gb-submenu-toggle"),e);const r=document.querySelector(".menu-item.gb-sub-menu--open");r&&!r.contains(e.target)&&a(r.closest(".gb-navigation:not(.gb-navigation--open)"))})),document.addEventListener("keydown",(e=>{const t="Escape"===e.key,n="Enter"===e.key,r=" "===e.key,l="Tab"===e.key;if((n||r)&&(s(e.target.closest(".gb-submenu-toggle"),e),i(e.target.closest(".gb-menu--click .menu-item-has-children > a"),e)),l){const e=document.querySelector(".gb-sub-menu--open");e&&setTimeout((()=>{const t=document.activeElement;t.closest(".gb-sub-menu--open")||a(e.closest(".gb-navigation"),t)}),0)}if(t){const t=e.target.closest(".gb-sub-menu--open");if(t){a(t.closest(".gb-navigation"));const e=t.querySelector(".gb-submenu-toggle");e&&e.focus()}else{const e=document.querySelector(".gb-navigation--open");e&&o(e)}}})),window.addEventListener("pagehide",(()=>{const e=document.querySelectorAll(".gb-navigation--open");e.length&&e.forEach((e=>o(e)))})),document.addEventListener("gbOverlayOpening",(e=>{const t=e.detail?.trigger;t?.classList.contains("gb-menu-toggle")&&(t.classList.add("gb-menu-toggle--toggled"),t.ariaExpanded="true")})),document.addEventListener("gbOverlayClosed",(e=>{const t=e.detail?.trigger;t?.classList.contains("gb-menu-toggle")&&(t.classList.remove("gb-menu-toggle--toggled"),t.ariaExpanded="false")})),document.addEventListener("gbOverlayError",(e=>{const t=e.detail?.trigger;t?.classList.contains("gb-menu-toggle")&&(t.classList.remove("gb-menu-toggle--toggled"),t.ariaExpanded="false")})),e=()=>{document.querySelector(".editor-styles-wrapper, .wp-admin")?window.addEventListener("load",l):l()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e):e()))})();