"mousemove touchmove touchstart touchend wheel".split(" ").forEach(function (e) { window.addEventListener(e, function () { if (window.jQuery) { jQuery('body').addClass('penci-ready-js'); } }, false); }); var menuhbh_mobile = document.querySelector(".button-menu-mobile"); if (menuhbh_mobile !== null) { menuhbh_mobile.addEventListener('click', function () { if (window.jQuery) { return false; } if (menuhbh_mobile.classList.contains('header-builder')) { document.body.classList.toggle("open-mobile-builder-sidebar-nav"); } else { document.body.classList.toggle("open-sidebar-nav"); } }); } var menuhbh_toggle = document.querySelector(".penci-menuhbg-toggle"); if (menuhbh_toggle !== null) { menuhbh_toggle.addEventListener('click', function () { if (window.jQuery) { return false; } this.classList.toggle('active'); document.body.classList.toggle("penci-menuhbg-open"); }); } var menuhbh_search = document.querySelector(".pcheader-icon a.search-click"); if (menuhbh_search !== null) { menuhbh_search.addEventListener('click', function (e) { if (window.jQuery) { return false; } var closet = this.closest('.wrapper-boxed'), pbcloset = this.closest('.penci_nav_col'), sform = document.querySelector('.show-search'); if (closet.classList.contains('header-search-style-showup')) { this.classList.toggle('active'); sform.classList.toggle('active'); } else { this.classList.toggle('fade'); sform.classList.toggle('fade'); } var opentimeout = setTimeout(function () { closet.querySelector('.search-input').focus(); if (pbcloset !== null && !!pbcloset.querySelector('.search-input')) { pbcloset.querySelector('.search-input').focus(); } }, 200, function () { clearTimeout(opentimeout); }); e.stopPropagation(); return false; }); } function penci_check_isValidHttpUrl(string) { let url; try { url = new URL(string); } catch (_) { return false; } return url.protocol === "http:" || url.protocol === "https:"; } var links = document.querySelectorAll("a"); if (links !== null) { links.forEach((link) => { link.addEventListener('click', function (e) { if (window.jQuery) { return false; } var linkurl = this.getAttribute('href'); if (linkurl !== null && penci_check_isValidHttpUrl(linkurl)) { window.location.href = linkurl; } }); link.addEventListener('ontouchstart', function (e) { if (window.jQuery) { return false; } var linkurl = this.getAttribute('href'); if (linkurl !== null && penci_check_isValidHttpUrl(linkurl)) { window.location.href = linkurl; } }); }); } class SoledadLazyLoad{constructor(e){this.triggerEvents=e,this.eventOptions={passive:!0},this.userEventListener=this.triggerListener.bind(this),this.delayedScripts={normal:[],async:[],defer:[]},this.allJQueries=[]}_addUserInteractionListener(e){this.triggerEvents.forEach(t=>window.addEventListener(t,e.userEventListener,e.eventOptions))}_removeUserInteractionListener(e){this.triggerEvents.forEach(t=>window.removeEventListener(t,e.userEventListener,e.eventOptions))}triggerListener(){this._removeUserInteractionListener(this),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",this._loadEverythingNow.bind(this)):this._loadEverythingNow()}async _loadEverythingNow(){this._delayEventListeners(),this._delayJQueryReady(this),this._handleDocumentWrite(),this._registerAllDelayedScripts(),this._preloadAllScripts(),await this._loadScriptsFromList(this.delayedScripts.normal),await this._loadScriptsFromList(this.delayedScripts.defer),await this._loadScriptsFromList(this.delayedScripts.async),await this._triggerDOMContentLoaded(),await this._triggerWindowLoad(),window.dispatchEvent(new Event("soledadspeed-allScriptsLoaded"))}_registerAllDelayedScripts(){document.querySelectorAll("script[type=PenciLazyScript]").forEach(e=>{e.hasAttribute("src")?e.hasAttribute("async")&&!1!==e.async?this.delayedScripts.async.push(e):e.hasAttribute("defer")&&!1!==e.defer||"module"===e.getAttribute("data-pencilazy-type")?this.delayedScripts.defer.push(e):this.delayedScripts.normal.push(e):this.delayedScripts.normal.push(e)})}async _transformScript(e){return await this._requestAnimFrame(),new Promise(t=>{const n=document.createElement("script");let i;[...e.attributes].forEach(e=>{let t=e.nodeName;"type"!==t&&("data-pencilazy-type"===t&&(t="type",i=e.nodeValue),n.setAttribute(t,e.nodeValue))}),e.hasAttribute("src")?(n.addEventListener("load",t),n.addEventListener("error",t)):(n.text=e.text,t()),e.parentNode.replaceChild(n,e)})}async _loadScriptsFromList(e){const t=e.shift();return t?(await this._transformScript(t),this._loadScriptsFromList(e)):Promise.resolve()}_preloadAllScripts(){var e=document.createDocumentFragment();[...this.delayedScripts.normal,...this.delayedScripts.defer,...this.delayedScripts.async].forEach(t=>{const n=t.getAttribute("src");if(n){const t=document.createElement("link");t.href=n,t.rel="preload",t.as="script",e.appendChild(t)}}),document.head.appendChild(e)}_delayEventListeners(){let e={};function t(t,n){!function(t){function n(n){return e[t].eventsToRewrite.indexOf(n)>=0?"soledadspeed-"+n:n}e[t]||(e[t]={originalFunctions:{add:t.addEventListener,remove:t.removeEventListener},eventsToRewrite:[]},t.addEventListener=function(){arguments[0]=n(arguments[0]),e[t].