File manager - Edit - /home/aresglob/public_html/wp/wp-includes/images/smilies/unminified.zip
Back
PK Vj[�'�3 3 customizer-quick-tour.jsnu �[��� /** * Astra Theme Customizer Tour * * @package Astra * @since x.x.x */ (function($) { /** * Quick easy navigation. */ jQuery(document).ready(function($) { let container = jQuery('#customize-header-actions'), button = jQuery('<button name="astra-tour" id="astra-tour" title="' + astraTour.title + '" class="button-secondary button"> <svg class="flex-shrink-0 mr-4 stroke-inherit" fill="none" width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M9 3V1M9 3C7.89543 3 7 3.89543 7 5C7 6.10457 7.89543 7 9 7M9 3C10.1046 3 11 3.89543 11 5C11 6.10457 10.1046 7 9 7M3 15C4.10457 15 5 14.1046 5 13C5 11.8954 4.10457 11 3 11M3 15C1.89543 15 1 14.1046 1 13C1 11.8954 1.89543 11 3 11M3 15V17M3 11V1M9 7V17M15 15C16.1046 15 17 14.1046 17 13C17 11.8954 16.1046 11 15 11M15 15C13.8954 15 13 14.1046 13 13C13 11.8954 13.8954 11 15 11M15 15V17M15 11V1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg> </button>'), tourItem = jQuery('.ast-quick-setup-navigation .ast-quick-tour-item'); container.append(button); button.on('click', function(event) { event.preventDefault(); event.stopPropagation(); document.body.style.overflow = 'hidden'; }); tourItem.on('click', function(event) { event.preventDefault(); event.stopPropagation(); let type = jQuery(this).data('type'), link = jQuery(this).data('link'); switch (type) { case 'section': var section = wp.customize.section(link); section.expand(); break; case 'panel': var panel = wp.customize.panel(link); panel.expand(); break; case 'control': wp.customize.control(link).focus(); setTimeout(() => { wp.customize.control(link).focus(); }, 500); break; default: break; } }); }); })(jQuery); PK Vj[�3@� � extend-customizer.jsnu �[��� /** * Extend Customizer Panel * * @package Astra */ ( function( $ ) { var api = wp.customize; api.bind( 'pane-contents-reflowed', function() { // Reflow sections var sections = []; api.section.each( function( section ) { if ( 'ast_section' !== section.params.type || 'undefined' === typeof section.params.section ) { return; } sections.push( section ); }); sections.sort( api.utils.prioritySort ).reverse(); $.each( sections, function( i, section ) { var parentContainer = $( '#sub-accordion-section-' + section.params.section ); parentContainer.children( '.section-meta' ).after( section.headContainer ); }); // Reflow panels var panels = []; api.panel.each( function( panel ) { if ( 'ast_panel' !== panel.params.type || 'undefined' === typeof panel.params.panel ) { return; } panels.push( panel ); }); panels.sort( api.utils.prioritySort ).reverse(); $.each( panels, function( i, panel ) { var parentContainer = $( '#sub-accordion-panel-' + panel.params.panel ); parentContainer.children( '.panel-meta' ).after( panel.headContainer ); }); }); // Extend Panel var _panelEmbed = wp.customize.Panel.prototype.embed; var _panelIsContextuallyActive = wp.customize.Panel.prototype.isContextuallyActive; var _panelAttachEvents = wp.customize.Panel.prototype.attachEvents; wp.customize.Panel = wp.customize.Panel.extend({ attachEvents: function() { if ( 'ast_panel' !== this.params.type || 'undefined' === typeof this.params.panel ) { _panelAttachEvents.call( this ); return; } _panelAttachEvents.call( this ); var panel = this; panel.expanded.bind( function( expanded ) { var parent = api.panel( panel.params.panel ); if ( expanded ) { parent.contentContainer.addClass( 'current-panel-parent' ); } else { parent.contentContainer.removeClass( 'current-panel-parent' ); } }); panel.container.find( '.customize-panel-back' ) .off( 'click keydown' ) .on( 'click keydown', function( event ) { if ( api.utils.isKeydownButNotEnterEvent( event ) ) { return; } event.preventDefault(); // Keep this AFTER the key filter above if ( panel.expanded() ) { api.panel( panel.params.panel ).expand(); } }); }, embed: function() { if ( 'ast_panel' !== this.params.type || 'undefined' === typeof this.params.panel ) { _panelEmbed.call( this ); return; } _panelEmbed.call( this ); var panel = this; var parentContainer = $( '#sub-accordion-panel-' + this.params.panel ); parentContainer.append( panel.headContainer ); }, isContextuallyActive: function() { if ( 'ast_panel' !== this.params.type ) { return _panelIsContextuallyActive.call( this ); } var panel = this; var children = this._children( 'panel', 'section' ); api.panel.each( function( child ) { if ( ! child.params.panel ) { return; } if ( child.params.panel !== panel.id ) { return; } children.push( child ); }); children.sort( api.utils.prioritySort ); var activeCount = 0; _( children ).each( function ( child ) { if ( child.active() && child.isContextuallyActive() ) { activeCount += 1; } }); return ( activeCount !== 0 ); } }); // Extend Section var _sectionEmbed = wp.customize.Section.prototype.embed; var _sectionIsContextuallyActive = wp.customize.Section.prototype.isContextuallyActive; var _sectionAttachEvents = wp.customize.Section.prototype.attachEvents; wp.customize.Section = wp.customize.Section.extend({ attachEvents: function() { if ( 'ast_section' !== this.params.type || 'undefined' === typeof this.params.section ) { _sectionAttachEvents.call( this ); return; } _sectionAttachEvents.call( this ); var section = this; section.expanded.bind( function( expanded ) { var parent = api.section( section.params.section ); if ( expanded ) { parent.contentContainer.addClass( 'current-section-parent' ); } else { parent.contentContainer.removeClass( 'current-section-parent' ); } }); section.container.find( '.customize-section-back' ) .off( 'click keydown' ) .on( 'click keydown', function( event ) { if ( api.utils.isKeydownButNotEnterEvent( event ) ) { return; } event.preventDefault(); // Keep this AFTER the key filter above if ( section.expanded() ) { api.section( section.params.section ).expand(); } }); }, embed: function() { if ( 'ast_section' !== this.params.type || 'undefined' === typeof this.params.section ) { _sectionEmbed.call( this ); return; } _sectionEmbed.call( this ); var section = this; var parentContainer = $( '#sub-accordion-section-' + this.params.section ); parentContainer.append( section.headContainer ); }, isContextuallyActive: function() { if ( 'ast_section' !== this.params.type ) { return _sectionIsContextuallyActive.call( this ); } var section = this; var children = this._children( 'section', 'control' ); api.section.each( function( child ) { if ( ! child.params.section ) { return; } if ( child.params.section !== section.id ) { return; } children.push( child ); }); children.sort( api.utils.prioritySort ); var activeCount = 0; _( children ).each( function ( child ) { if ( 'undefined' !== typeof child.isContextuallyActive ) { if ( child.active() && child.isContextuallyActive() ) { activeCount += 1; } } else { if ( child.active() ) { activeCount += 1; } } }); return ( activeCount !== 0 ); } }); })( jQuery );PK Vj[T�5� � customizer-preview.jsnu �[��� /** * This file adds some LIVE to the Customizer live preview. To leverage * this, set your custom settings to 'postMessage' and then add your handling * here. Your javascript should grab settings from customizer controls, and * then make any necessary changes to the page using jQuery. * * @package Astra * @since x.x.x */ ( function( $ ) { var selector = '.ast-edd-site-header-cart'; var responsive_selector = '.astra-cart-drawer.edd-active'; // Icon Color. astra_css( 'astra-settings[edd-header-cart-icon-color]', 'color', selector + ' .ast-edd-cart-menu-wrap .count, ' + selector + ' .ast-edd-cart-menu-wrap .count:after,' + selector + ' .ast-edd-header-cart-info-wrap' ); // Icon Color. astra_css( 'astra-settings[edd-header-cart-icon-color]', 'border-color', selector + ' .ast-edd-cart-menu-wrap .count, ' + selector + ' .ast-edd-cart-menu-wrap .count:after' ); // EDD Cart Colors. astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-cart-text-color]', 'color', selector + ' .widget_edd_cart_widget span, ' + selector + ' .widget_edd_cart_widget strong, ' + selector + ' .widget_edd_cart_widget *, ' + responsive_selector + ' .widget_edd_cart_widget span, .astra-cart-drawer .widget_edd_cart_widget *, ' + responsive_selector + ' .astra-cart-drawer-title' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-cart-link-color]', 'color', selector + ' .widget_edd_cart_widget a, ' + selector + ' .widget_edd_cart_widget a.edd-remove-from-cart, ' + selector + ' .widget_edd_cart_widget .cart-total, ' + selector + ' .widget_edd_cart_widget a.edd-remove-from-cart:after, '+ responsive_selector + ' .widget_edd_cart_widget a, ' + responsive_selector + ' .widget_edd_cart_widget a.edd-remove-from-cart, ' + responsive_selector + ' .widget_edd_cart_widget .cart-total, ' + responsive_selector + ' .widget_edd_cart_widget a.edd-remove-from-cart:after' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-cart-link-color]', 'border-color', selector + ' .widget_edd_cart_widget a.edd-remove-from-cart:after,' + responsive_selector + ' .widget_edd_cart_widget a.edd-remove-from-cart:after,' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-cart-background-color]', 'background-color', '.ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget ,' + responsive_selector + ', ' + responsive_selector + '#astra-mobile-cart-drawer' ); astra_color_responsive_css( 'edd-cart-border-color', 'astra-settings[header-edd-cart-background-color]', 'border-color', '.ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget, ' + responsive_selector + ' .widget_edd_cart_widget' ); astra_color_responsive_css( 'edd-cart-border-bottom-color', 'astra-settings[header-edd-cart-background-color]', 'border-bottom-color', '.ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget:before, .ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget:after, ' + responsive_selector + ' .widget_edd_cart_widget:before, ' + responsive_selector + ' .widget_edd_cart_widget:after' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-cart-separator-color]', 'border-bottom-color', '.ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget .edd-cart-item, .ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget .edd-cart-number-of-items, .ast-builder-layout-element ' + selector + ' .widget_edd_cart_widget .edd-cart-meta,'+ responsive_selector + ' .widget_edd_cart_widget .edd-cart-item, ' + responsive_selector + ' .widget_edd_cart_widget .edd-cart-number-of-items, ' + responsive_selector + ' .widget_edd_cart_widget .edd-cart-meta, ' + responsive_selector + ' .astra-cart-drawer-header' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-checkout-btn-text-color]', 'color', selector + ' .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a, '+ responsive_selector + ' .widget_edd_cart_widget .edd_checkout a' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-checkout-btn-background-color]', 'background-color', selector + ' .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a,' + responsive_selector + ' .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a' ); astra_color_responsive_css( 'edd-cart-border-color', 'astra-settings[header-edd-checkout-btn-background-color]', 'border-color', selector + ' .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a,' + responsive_selector + ' .widget_edd_cart_widget .edd_checkout a, .widget_edd_cart_widget .edd_checkout a' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-checkout-btn-text-hover-color]', 'color', selector +' .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover,' + responsive_selector +' .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover' ); astra_color_responsive_css( 'edd-cart-colors', 'astra-settings[header-edd-checkout-btn-bg-hover-color]', 'background-color', selector +' .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover, ' + responsive_selector + ' .widget_edd_cart_widget .edd_checkout a:hover, .widget_edd_cart_widget .edd_checkout a:hover' ); /** * Cart icon style */ wp.customize( 'astra-settings[edd-header-cart-icon-style]', function( setting ) { setting.bind( function( icon_style ) { var buttons = $(document).find('.ast-edd-site-header-cart'); buttons.removeClass('ast-edd-menu-cart-fill ast-edd-menu-cart-outline'); buttons.addClass( 'ast-edd-menu-cart-' + icon_style ); var dynamicStyle = '.ast-edd-site-header-cart a, .ast-edd-site-header-cart a *{ transition: all 0s; } '; astra_add_dynamic_css( 'edd-header-cart-icon-style', dynamicStyle ); wp.customize.preview.send( 'refresh' ); } ); } ); /** * EDD Cart Button Color */ wp.customize( 'astra-settings[edd-header-cart-icon-color]', function( setting ) { setting.bind( function( cart_icon_color ) { wp.customize.preview.send( 'refresh' ); }); }); /** * Button Border Radius */ wp.customize( 'astra-settings[edd-header-cart-icon-radius]', function( setting ) { setting.bind( function( border ) { var dynamicStyle = '.ast-edd-site-header-cart.ast-edd-menu-cart-outline .ast-addon-cart-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-fill .ast-addon-cart-wrap, .ast-edd-site-header-cart.ast-edd-menu-cart-outline .count, .ast-edd-site-header-cart.ast-edd-menu-cart-fill .count{ border-radius: ' + ( parseInt( border ) ) + 'px } '; astra_add_dynamic_css( 'edd-header-cart-icon-radius', dynamicStyle ); } ); } ); /** * Transparent Header EDD-Cart color options - Customizer preview CSS. */ wp.customize( 'astra-settings[transparent-header-edd-cart-icon-color]', function( setting ) { setting.bind( function( cart_icon_color ) { wp.customize.preview.send( 'refresh' ); }); }); // Advanced Visibility CSS Generation. astra_builder_visibility_css( 'section-header-edd-cart', '.ast-header-edd-cart' ); } )( jQuery ); PK Vj[��Œ live-search.jsnu �[��� /** * Astra's Live Search * * @package Astra * @since x.x.x */ (function () { function decodeHTMLEntities(string) { var doc = new DOMParser().parseFromString(string, "text/html"); return doc.documentElement.textContent; } function getSearchResultPostMarkup(resultsData) { let processedHtml = ""; Object.entries(resultsData).forEach(([postType, postsData]) => { let postTypeLabel = astra_search.search_post_types_labels[postType] ? astra_search.search_post_types_labels[postType] : postType + "s"; processedHtml += `<label class="ast-search--posttype-heading"> ${postTypeLabel} </label>`; postsData.forEach((post) => { const searchPostTitle = decodeHTMLEntities(post.title.rendered); const headerCoverSearch = document.getElementById("ast-search-form"); const fullScreenSearch = document.getElementById("ast-seach-full-screen-form"); if (fullScreenSearch || headerCoverSearch) { processedHtml += `<a class="ast-search-item" role="option" target="_self" href="${post.link}" tabindex="1"> <span> ${searchPostTitle} </span> </a>`; } else { processedHtml += `<a class="ast-search-item" role="option" target="_self" href="${post.link}"> <span> ${searchPostTitle} </span> </a>`; } }); }); return processedHtml; } window.addEventListener("load", function (e) { const searchInputs = document.querySelectorAll(".search-field"); searchInputs.forEach((searchInput) => { searchInput.addEventListener("input", function (event) { const searchForm = searchInput.closest("form.search-form"); const searchTerm = event.target.value.trim(); const postTypes = astra_search.search_page_condition ? astra_search.search_page_post_types : astra_search.search_post_types; const searchResultsWrappers = document.querySelectorAll( ".ast-live-search-results" ); if (searchResultsWrappers) { searchResultsWrappers.forEach(function (wrap) { wrap.parentNode.removeChild(wrap); }); } try { const restRequest = `${ astra_search.rest_api_url }wp/v2/posts${ astra_search.rest_api_url.indexOf("?") > -1 ? "&" : "?" }_embed=1&post_type=ast_queried:${postTypes.join( ":" )}&per_page=${ astra_search.search_posts_per_page }&search=${searchTerm}${ astra_search.search_language ? `&lang=${astra_search.search_language}` : "" }`; var xhr = new XMLHttpRequest(); xhr.open("GET", restRequest, true); xhr.onreadystatechange = function () { if (xhr.readyState === 4 && xhr.status === 200) { const postsData = JSON.parse(xhr.responseText); let resultsContainer = ""; if (postsData.length > 0) { let formattedPostsData = {}; postsData.forEach((post) => { if (post.type in formattedPostsData) { formattedPostsData[post.type].push( post ); } else { formattedPostsData[post.type] = [post]; } }); let searchResultMarkup = getSearchResultPostMarkup( formattedPostsData ); resultsContainer = ` <div class="ast-live-search-results" role="listbox" aria-label="Search results" style="top: ${parseInt(searchForm.offsetHeight) + 10}px;" > ${searchResultMarkup} </div> `; } else { resultsContainer = ` <div class="ast-live-search-results" role="listbox" aria-label="Search results" style="top: ${parseInt(searchForm.offsetHeight) + 10}px;" > <label class="ast-search--no-results-heading"> ${ astra_search.no_live_results_found } </label> </div> `; } const searchResultsWrappers = document.querySelectorAll( ".ast-live-search-results" ); if (searchResultsWrappers) { searchResultsWrappers.forEach(function (wrap) { wrap.parentNode.removeChild(wrap); }); } searchForm.insertAdjacentHTML( "beforeend", resultsContainer ); } }; xhr.send(); } catch (error) { console.error("Error while fetching data:", error); } }); }); }); // Add a click event listener to the document. document.addEventListener("click", function (event) { const searchForm = event.target.closest("form.search-form"); // Check if the clicked element is the search bar or the results dropdown if (null !== searchForm) { // Clicked inside the search bar or dropdown, do nothing if (searchForm.querySelector(".ast-live-search-results")) { searchForm.querySelector( ".ast-live-search-results" ).style.display = "block"; } } else { // Clicked outside the search bar and dropdown, hide the dropdown const searchResultsWrappers = document.querySelectorAll( ".ast-live-search-results" ); if (searchResultsWrappers) { searchResultsWrappers.forEach(function (wrap) { wrap.style.display = "none"; }); } } }); })(); PK Vj[�@2*� � sticky-add-to-cart.jsnu �[��� (function () { // Triggers sticky add to cart on scroll. const astraStickyAddToCart = document.querySelector(".ast-sticky-add-to-cart"); if (astraStickyAddToCart) { const scrollOffset = document.querySelector('.product .single_add_to_cart_button').offsetTop; window.addEventListener("scroll", function () { if (window.scrollY >= scrollOffset) { astraStickyAddToCart.classList.add('is-active'); } else { astraStickyAddToCart.classList.remove('is-active'); } }) } // Smooth scrolls if select option button is active. const AstraSmoothScrollBtn = document.querySelector(".ast-sticky-add-to-cart-action-wrap .single_link_to_cart_button"); const element = document.querySelector(".single_add_to_cart_button"); if (AstraSmoothScrollBtn && element) { const headerOffset = 230; const elementPosition = document.querySelector('.single_add_to_cart_button').offsetTop; if (elementPosition) { const offsetPosition = elementPosition - headerOffset; if (offsetPosition) { AstraSmoothScrollBtn.addEventListener('click', function (e) { e.preventDefault(); window.scrollTo({ top: offsetPosition, behavior: "smooth" }); }); } } } })();PK Wj[@V���� �� frontend.jsnu �[��� /** * File fronend.js * * Handles toggling the navigation menu for small screens and enables tab * support for dropdown menus. * * @package Astra */ /** * Get all of an element's parent elements up the DOM tree * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var astraGetParents = function ( elem, selector ) { // Element.matches() polyfill. if ( ! Element.prototype.matches) { Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function(s) { var matches = (this.document || this.ownerDocument).querySelectorAll( s ), i = matches.length; while (--i >= 0 && matches.item( i ) !== this) {} return i > -1; }; } // Setup parents array. var parents = []; // Get matching parent elements. for ( ; elem && elem !== document; elem = elem.parentNode ) { // Add matching parents to array. if ( selector ) { if ( elem.matches( selector ) ) { parents.push( elem ); } } else { parents.push( elem ); } } return parents; }; /** * Deprecated: Get all of an element's parent elements up the DOM tree * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var getParents = function ( elem, selector ) { console.warn( 'getParents() function has been deprecated since version 2.5.0 or above of Astra Theme and will be removed in the future. Use astraGetParents() instead.' ); astraGetParents( elem, selector ); } /** * Toggle Class funtion * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var astraToggleClass = function ( el, className ) { if ( el.classList.contains( className ) ) { el.classList.remove( className ); } else { el.classList.add( className ); } }; /** * Deprecated: Toggle Class funtion * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var toggleClass = function ( el, className ) { console.warn( 'toggleClass() function has been deprecated since version 2.5.0 or above of Astra Theme and will be removed in the future. Use astraToggleClass() instead.' ); astraToggleClass( el, className ); }; // CustomEvent() constructor functionality in Internet Explorer 9 and higher. (function () { if (typeof window.CustomEvent === "function") return false; function CustomEvent(event, params) { params = params || { bubbles: false, cancelable: false, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent; })(); /** * Trigget custom JS Event. * * @since 1.4.6 * * @link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent * @param {Node} el Dom Node element on which the event is to be triggered. * @param {Node} typeArg A DOMString representing the name of the event. * @param {String} A CustomEventInit dictionary, having the following fields: * "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event. */ var astraTriggerEvent = function astraTriggerEvent( el, typeArg ) { var customEventInit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var event = new CustomEvent(typeArg, customEventInit); el.dispatchEvent(event); }; /** * Scroll to ID/Top with smooth scroll behavior. * * @since x.x.x * * @param {Event} e Event which is been fired. * @param {String} top offset from top. */ astraSmoothScroll = function astraSmoothScroll( e, top ) { e.preventDefault(); window.scrollTo({ top: top, left: 0, behavior: 'smooth' }); }; /** * Scroll to Top trigger visibility adjustments. * * @since x.x.x * * @param {Node} masthead Page header. * @param {Node} astScrollTop Scroll to Top selector. */ astScrollToTopHandler = function ( masthead, astScrollTop ) { var content = getComputedStyle(astScrollTop).content, device = astScrollTop.dataset.onDevices; content = content.replace( /[^0-9]/g, '' ); if( 'both' == device || ( 'desktop' == device && '769' == content ) || ( 'mobile' == device && '' == content ) ) { // Get current window / document scroll. var scrollTop = window.pageYOffset || document.body.scrollTop; // If masthead found. if( masthead && masthead.length ) { if (scrollTop > masthead.offsetHeight + 100) { astScrollTop.style.display = "block"; } else { astScrollTop.style.display = "none"; } } else { // If there is no masthead set default start scroll if ( window.pageYOffset > 300 ) { astScrollTop.style.display = "block"; } else { astScrollTop.style.display = "none"; } } } else { astScrollTop.style.display = "none"; } }; ( function() { var menu_toggle_all = document.querySelectorAll( '#masthead .main-header-menu-toggle' ), main_header_masthead = document.getElementById('masthead'), menu_click_listeners_nav = {}, mobileHeaderType = '', body = document.body, mobileHeader = ''; if ( undefined !== main_header_masthead && null !== main_header_masthead ) { mobileHeader = main_header_masthead.querySelector("#ast-mobile-header"); } if ( '' !== mobileHeader && null !== mobileHeader ) { mobileHeaderType = mobileHeader.dataset.type; } document.addEventListener( 'astMobileHeaderTypeChange', updateHeaderType, false ); /** * Updates the header type. */ function updateHeaderType( e ) { mobileHeaderType = e.detail.type; var popupTrigger = document.querySelectorAll( '.menu-toggle' ); if( 'dropdown' === mobileHeaderType ) { document.getElementById( 'ast-mobile-popup' ).classList.remove( 'active', 'show' ); updateTrigger('updateHeader'); } if ( 'off-canvas' === mobileHeaderType ) { popupTrigger.forEach(function (trigger) { if (trigger && trigger.classList.contains('toggled')) { trigger.click(); } }); } init(mobileHeaderType); } function syncToggledClass() { const buttons = document.querySelectorAll('.menu-toggle'); const allToggled = Array.from(buttons).every(button => button.classList.contains('toggled')); buttons.forEach(button => { if (allToggled) { button.classList.remove('toggled'); } else { button.classList.add('toggled'); } }); } document.addEventListener('click', function (e) { const button = e.target.closest('.menu-toggle'); if (button) { button.classList.toggle('toggled'); syncToggledClass(); } }); /** * Opens the Popup when trigger is clicked. */ popupTriggerClick = function ( event ) { var triggerType = event.currentTarget.trigger_type; var popupWrap = document.getElementById( 'ast-mobile-popup' ); const menuToggleClose = document.getElementById('menu-toggle-close'); if( menuToggleClose ) { menuToggleClose.focus(); } if ( ! body.classList.contains( 'ast-popup-nav-open' ) ) { body.classList.add( 'ast-popup-nav-open' ); } if ( ! body.classList.contains( 'ast-main-header-nav-open' ) && 'mobile' !== triggerType ) { body.classList.add( 'ast-main-header-nav-open' ); } if ( ! document.documentElement.classList.contains( 'ast-off-canvas-active' ) ) { document.documentElement.classList.add( 'ast-off-canvas-active' ); } if ( 'desktop' === triggerType ) { popupWrap.querySelector( '.ast-mobile-popup-content' ).style.display = 'none'; popupWrap.querySelector( '.ast-desktop-popup-content' ).style.display = 'block'; } if ( 'mobile' === triggerType ) { popupWrap.querySelector( '.ast-desktop-popup-content' ).style.display = 'none'; popupWrap.querySelector( '.ast-mobile-popup-content' ).style.display = 'block'; } this.style.display = 'none'; popupWrap.classList.add( 'active', 'show' ); } /** * Closes the Trigger when Popup is Closed. */ function updateTrigger(currentElement) { mobileHeader = main_header_masthead.querySelector( "#ast-mobile-header" ); var parent_li_sibling = ''; if( undefined !== mobileHeader && null !== mobileHeader && 'dropdown' === mobileHeader.dataset.type && 'updateHeader' !== currentElement ) { return; } if ( undefined !== currentElement && 'updateHeader' !== currentElement ) { parent_li_sibling = currentElement.closest( '.ast-mobile-popup-inner' ).querySelectorAll('.menu-item-has-children'); } else { var popup = document.querySelector( '#ast-mobile-popup' ); parent_li_sibling = popup.querySelectorAll('.menu-item-has-children'); } parent_li_sibling.forEach((li_sibling) => { li_sibling.classList.remove('ast-submenu-expanded'); const all_sub_menu = Array.from(li_sibling.querySelectorAll('.sub-menu')); all_sub_menu.forEach((sub_menu) => { if (!sub_menu.hasAttribute('data-initial-display')) { sub_menu.setAttribute('data-initial-display', window.getComputedStyle(sub_menu).display); } if (sub_menu.getAttribute('data-initial-display') === 'block') { sub_menu.style.display = 'block'; } else { sub_menu.style.display = 'none'; } }); }); var popupTrigger = document.querySelectorAll( '.menu-toggle' ); document.body.classList.remove( 'ast-main-header-nav-open', 'ast-popup-nav-open' ); document.documentElement.classList.remove( 'ast-off-canvas-active' ); for ( var item = 0; item < popupTrigger.length; item++ ) { popupTrigger[item].classList.remove( 'toggled' ); popupTrigger[item].style.display = 'flex'; } } /** * Main Init Function. */ function init( mobileHeaderType ) { var popupTriggerMobile = document.querySelectorAll( '#ast-mobile-header .menu-toggle' ); var popupTriggerDesktop = document.querySelectorAll( '#ast-desktop-header .menu-toggle' ); if ( undefined === mobileHeaderType && null !== main_header_masthead ) { mobileHeader = main_header_masthead.querySelector("#ast-mobile-header"); if( mobileHeader ) { mobileHeaderType = mobileHeader.dataset.type; } else { var desktopHeader = main_header_masthead.querySelector("#ast-desktop-header"); if ( desktopHeader ) { mobileHeaderType = desktopHeader.dataset.toggleType; } else { return; } } } if ( 'off-canvas' === mobileHeaderType ) { var popupClose = document.getElementById( 'menu-toggle-close' ), popupInner = document.querySelector( '.ast-mobile-popup-inner' ); if ( undefined === popupInner || null === popupInner ){ return; // if toggel button component is not loaded. } popupLinks = popupInner.getElementsByTagName('a'); for ( var item = 0; item < popupTriggerMobile.length; item++ ) { popupTriggerMobile[item].removeEventListener("click", astraNavMenuToggle, false); // Open the Popup when click on trigger popupTriggerMobile[item].removeEventListener("click", popupTriggerClick); popupTriggerMobile[item].addEventListener("click", popupTriggerClick, false); popupTriggerMobile[item].trigger_type = 'mobile'; } for ( var item = 0; item < popupTriggerDesktop.length; item++ ) { popupTriggerDesktop[item].removeEventListener("click", astraNavMenuToggle, false); // Open the Popup when click on trigger popupTriggerDesktop[item].removeEventListener("click", popupTriggerClick); popupTriggerDesktop[item].addEventListener("click", popupTriggerClick, false); popupTriggerDesktop[item].trigger_type = 'desktop'; } // Getting menu toggle button element. const menuToggleButton = document.querySelector('.ast-button-wrap .menu-toggle'); //Close Popup on CLose Button Click. popupClose.addEventListener("click", function( e ) { document.getElementById( 'ast-mobile-popup' ).classList.remove( 'active', 'show' ); updateTrigger(this); menuToggleButton?.focus(); }); // Close Popup if esc is pressed. document.addEventListener( 'keyup', function (event) { // 27 is keymap for esc key. if ( event.keyCode === 27 ) { event.preventDefault(); document.getElementById( 'ast-mobile-popup' ).classList.remove( 'active', 'show' ); updateTrigger(); menuToggleButton?.focus(); } }); // Close Popup on outside click. document.addEventListener('click', function (event) { var target = event.target; var modal = document.querySelector( '.ast-mobile-popup-drawer.active .ast-mobile-popup-overlay' ); if ( target === modal ) { document.getElementById( 'ast-mobile-popup' ).classList.remove( 'active', 'show' ); updateTrigger(); menuToggleButton?.focus(); } }); // Close Popup on # link click inside Popup. for ( let link = 0, len = popupLinks.length; link < len; link++ ) { if( null !== popupLinks[link].getAttribute("href") && ( popupLinks[link].getAttribute("href").startsWith('#') || -1 !== popupLinks[link].getAttribute("href").search("#") ) && ( ! popupLinks[link].parentElement.classList.contains('menu-item-has-children') || ( popupLinks[link].parentElement.classList.contains('menu-item-has-children') && document.querySelector('header.site-header').classList.contains('ast-builder-menu-toggle-icon') ) ) ){ popupLinks[link].addEventListener( 'click', triggerToggleClose, true ); popupLinks[link].headerType = 'off-canvas'; } } AstraToggleSetup(); } else if ( 'dropdown' === mobileHeaderType ) { var mobileDropdownContent = document.querySelectorAll( '.ast-mobile-header-content' ) || false, desktopDropdownContent = document.querySelector( '.ast-desktop-header-content' ) || false; // Close Popup on # link click inside Popup. if ( mobileDropdownContent.length > 0 ) { for ( let index = 0; index < mobileDropdownContent.length; index++ ) { var mobileLinks = mobileDropdownContent[ index ].getElementsByTagName( 'a' ); for ( link = 0, len = mobileLinks.length; link < len; link++ ) { // Check if the link is not inside the tabs container const isNotInsideTabsContainer = mobileLinks[ link ].closest( '.wp-block-uagb-tabs' ) === null; if ( null !== mobileLinks[ link ].getAttribute( 'href' ) && ( mobileLinks[ link ].getAttribute( 'href' ).startsWith( '#' ) || -1 !== mobileLinks[ link ].getAttribute( 'href' ).search( '#' ) ) && ( ! mobileLinks[ link ].parentElement.classList.contains( 'menu-item-has-children' ) || ( mobileLinks[ link ].parentElement.classList.contains( 'menu-item-has-children' ) && document.querySelector( 'header.site-header' ).classList.contains( 'ast-builder-menu-toggle-icon' ) ) ) && isNotInsideTabsContainer ) { mobileLinks[ link ].addEventListener( 'click', triggerToggleClose, true ); mobileLinks[ link ].headerType = 'dropdown'; } } } } // Close Popup on # link click inside Popup. if ( desktopDropdownContent ) { var desktopLinks = desktopDropdownContent.getElementsByTagName( 'a' ); for ( link = 0, len = desktopLinks.length; link < len; link++ ) { desktopLinks[ link ].addEventListener( 'click', triggerToggleClose, true ); desktopLinks[ link ].headerType = 'dropdown'; } } for ( var item = 0; item < popupTriggerMobile.length; item++ ) { popupTriggerMobile[ item ].removeEventListener( 'click', popupTriggerClick, false ); popupTriggerMobile[ item ].removeEventListener( 'click', astraNavMenuToggle ); popupTriggerMobile[ item ].addEventListener( 'click', astraNavMenuToggle, false ); popupTriggerMobile[ item ].trigger_type = 'mobile'; } for ( var item = 0; item < popupTriggerDesktop.length; item++ ) { popupTriggerDesktop[ item ].removeEventListener( 'click', popupTriggerClick, false ); popupTriggerDesktop[ item ].removeEventListener( 'click', astraNavMenuToggle ); popupTriggerDesktop[ item ].addEventListener( 'click', astraNavMenuToggle, false ); popupTriggerDesktop[ item ].trigger_type = 'desktop'; } AstraToggleSetup(); } accountPopupTrigger(); } function triggerToggleClose( event ) { var headerType = event.currentTarget.headerType; switch( headerType ) { case 'dropdown': var popupTrigger = document.querySelectorAll( '.menu-toggle.toggled' ); for ( var item = 0; item < popupTrigger.length; item++ ) { popupTrigger[item].click(); } break; case 'off-canvas': var popupClose = document.getElementById( 'menu-toggle-close' ); popupClose.click(); break; default: break; } } window.addEventListener( 'load', function() { init(); } ); document.addEventListener( 'astLayoutWidthChanged', function() { init(); } ); document.addEventListener( 'astPartialContentRendered', function() { menu_toggle_all = document.querySelectorAll( '.main-header-menu-toggle' ); body.classList.remove("ast-main-header-nav-open"); document.addEventListener( 'astMobileHeaderTypeChange', updateHeaderType, false ); init(); accountPopupTrigger(); } ); var mobile_width = ( null !== navigator.userAgent.match(/Android/i) && 'Android' === navigator.userAgent.match(/Android/i)[0] ) ? window.visualViewport.width : window.innerWidth; function AstraHandleResizeEvent() { var menu_offcanvas_close = document.getElementById('menu-toggle-close'); var menu_dropdown_close = document.querySelector('.menu-toggle.toggled'); var desktop_header_content = document.querySelector('#masthead > #ast-desktop-header .ast-desktop-header-content'); var elementor_editor = document.querySelector('.elementor-editor-active'); if ( desktop_header_content ) { desktop_header_content.style.display = 'none'; } var mobileResizeWidth = ( null !== navigator.userAgent.match(/Android/i) && 'Android' === navigator.userAgent.match(/Android/i)[0] ) ? window.visualViewport.width : window.innerWidth; if ( mobileResizeWidth !== mobile_width ) { if ( menu_dropdown_close && null === elementor_editor ) { menu_dropdown_close.click(); } document.body.classList.remove( 'ast-main-header-nav-open', 'ast-popup-nav-open' ); if( menu_offcanvas_close && null == elementor_editor ) { menu_offcanvas_close.click(); } } updateHeaderBreakPoint(); AstraToggleSetup(); } window.addEventListener('resize', function(){ // Skip resize event when keyboard display event triggers on devices. if( 'INPUT' !== document.activeElement.tagName ) { AstraHandleResizeEvent(); } } ); document.addEventListener('DOMContentLoaded', function () { AstraToggleSetup(); /** * Navigation Keyboard Navigation. */ var containerButton; if ( body.classList.contains('ast-header-break-point') ) { containerButton = document.getElementById( 'ast-mobile-header' ); } else { containerButton = document.getElementById( 'ast-desktop-header' ); } if( null !== containerButton ) { var containerMenu = containerButton.querySelector( '.navigation-accessibility' ); navigation_accessibility( containerMenu, containerButton ); } }); var get_window_width = function () { return document.documentElement.clientWidth; } /* Add break point Class and related trigger */ var updateHeaderBreakPoint = function () { // Content overrflowing out of screen can give incorrect window.innerWidth. // Adding overflow hidden and then calculating the window.innerWidth fixes the problem. var originalOverflow = body.style.overflow; body.style.overflow = 'hidden'; var ww = get_window_width(); body.style.overflow = originalOverflow; var break_point = astra.break_point; /** * This case is when one hits a URL one after the other via `Open in New Tab` option * Chrome returns the value of outer width as 0 in this case. * This mis-calculates the width of the window and header seems invisible. * This could be fixed by using `0 === ww` condition below. */ if (ww > break_point || 0 === ww) { //remove menu toggled class. if ( menu_toggle_all.length > 0 ) { for (var i = 0; i < menu_toggle_all.length; i++) { if( null !== menu_toggle_all[i] ) { menu_toggle_all[i].classList.remove('toggled'); } } } body.classList.remove("ast-header-break-point"); body.classList.add("ast-desktop"); astraTriggerEvent(body, "astra-header-responsive-enabled"); } else { body.classList.add("ast-header-break-point"); body.classList.remove("ast-desktop"); astraTriggerEvent(body, "astra-header-responsive-disabled") } } var accountPopupTrigger = function () { // Account login form popup. var header_account_trigger = document.querySelectorAll( '.ast-account-action-login' ); if (!header_account_trigger.length) { return; } const formWrapper = document.querySelector('#ast-hb-account-login-wrap'); if (!formWrapper) { return; } const formCloseBtn = document.querySelector('#ast-hb-login-close'); header_account_trigger.forEach(function(_trigger) { _trigger.addEventListener('click', function(e) { e.preventDefault(); formWrapper.classList.add('show'); }); }); if (formCloseBtn) { formCloseBtn.addEventListener('click', function(e) { e.preventDefault(); formWrapper.classList.remove('show'); }); } } updateHeaderBreakPoint(); AstraToggleSubMenu = function( event ) { event.preventDefault(); if ('false' === event.target.getAttribute('aria-expanded') || ! event.target.getAttribute('aria-expanded')) { event.target.setAttribute('aria-expanded', 'true'); } else { event.target.setAttribute('aria-expanded', 'false'); } var parent_li = this.parentNode; if ( parent_li.classList.contains('ast-submenu-expanded') && document.querySelector('header.site-header').classList.contains('ast-builder-menu-toggle-link') ) { if (!this.classList.contains('ast-menu-toggle')) { var link = parent_li.querySelector('a').getAttribute('href'); if ( '' !== link && '#' !== link) { window.location = link; } } } var parent_li_child = parent_li.querySelectorAll('.menu-item-has-children'); for (var j = 0; j < parent_li_child.length; j++) { parent_li_child[j].classList.remove('ast-submenu-expanded'); var parent_li_child_sub_menu = parent_li_child[j].querySelector('.sub-menu, .children'); if( null !== parent_li_child_sub_menu ) { parent_li_child_sub_menu.style.display = 'none'; } } var parent_li_sibling = parent_li.parentNode.querySelectorAll('.menu-item-has-children'); for (var j = 0; j < parent_li_sibling.length; j++) { if (parent_li_sibling[j] != parent_li) { parent_li_sibling[j].classList.remove('ast-submenu-expanded'); var all_sub_menu = parent_li_sibling[j].querySelectorAll('.sub-menu'); for (var k = 0; k < all_sub_menu.length; k++) { all_sub_menu[k].style.display = 'none'; } } } if (parent_li.classList.contains('menu-item-has-children') ) { astraToggleClass(parent_li, 'ast-submenu-expanded'); if (parent_li.classList.contains('ast-submenu-expanded')) { parent_li.querySelector('.sub-menu').style.display = 'block'; } else { parent_li.querySelector('.sub-menu').style.display = 'none'; } } }; AstraToggleSetup = function () { if( typeof astraAddon != 'undefined' && typeof astraToggleSetupPro === "function" ) { astraToggleSetupPro( mobileHeaderType, body, menu_click_listeners_nav ); } else { var flag = false; var menuToggleAllLength; if ( 'off-canvas' === mobileHeaderType || 'full-width' === mobileHeaderType ) { // comma separated selector added, if menu is outside of Off-Canvas then submenu is not clickable, it work only for Off-Canvas area with dropdown style. var __main_header_all = document.querySelectorAll( '#ast-mobile-popup, #ast-mobile-header' ); var menu_toggle_all = document.querySelectorAll('#ast-mobile-header .main-header-menu-toggle'); menuToggleAllLength = menu_toggle_all.length; } else { var __main_header_all = document.querySelectorAll( '#ast-mobile-header' ), menu_toggle_all = document.querySelectorAll('#ast-mobile-header .main-header-menu-toggle'); menuToggleAllLength = menu_toggle_all.length; flag = menuToggleAllLength > 0 ? false : true; menuToggleAllLength = flag ? 1 : menuToggleAllLength; } if ( menuToggleAllLength > 0 || flag ) { for (var i = 0; i < menuToggleAllLength; i++) { if ( ! flag ) { menu_toggle_all[i].setAttribute('data-index', i); if ( ! menu_click_listeners_nav[i] ) { menu_click_listeners_nav[i] = menu_toggle_all[i]; menu_toggle_all[i].removeEventListener('click', astraNavMenuToggle); menu_toggle_all[i].addEventListener('click', astraNavMenuToggle, false); } } if ('undefined' !== typeof __main_header_all[i]) { // To handle the comma seprated selector added above we need this loop. for( var mainHeaderCount =0; mainHeaderCount < __main_header_all.length; mainHeaderCount++ ){ if (document.querySelector('header.site-header').classList.contains('ast-builder-menu-toggle-link')) { var astra_menu_toggle = __main_header_all[mainHeaderCount].querySelectorAll('ul.main-header-menu .menu-item-has-children > .menu-link, ul.main-header-menu .ast-menu-toggle'); } else { var astra_menu_toggle = __main_header_all[mainHeaderCount].querySelectorAll('ul.main-header-menu .ast-menu-toggle'); } // Add Eventlisteners for Submenu. if (astra_menu_toggle.length > 0) { for (var j = 0; j < astra_menu_toggle.length; j++) { astra_menu_toggle[j].removeEventListener('click', AstraToggleSubMenu); astra_menu_toggle[j].addEventListener('click', AstraToggleSubMenu, false); } } } } } } } }; astraNavMenuToggle = function ( event ) { if( typeof astraAddon != 'undefined' ) { astraNavMenuTogglePro( event, body, mobileHeaderType, this ); } else { event.preventDefault(); var __main_header_all = document.querySelectorAll('#masthead > #ast-mobile-header .main-header-bar-navigation'); menu_toggle_all = document.querySelectorAll( '#masthead > #ast-mobile-header .main-header-menu-toggle' ) var event_index = '0'; if ( null !== this.closest( '#ast-fixed-header' ) ) { __main_header_all = document.querySelectorAll('#ast-fixed-header > #ast-mobile-header .main-header-bar-navigation'); menu_toggle_all = document.querySelectorAll( '#ast-fixed-header .main-header-menu-toggle' ) event_index = '0'; } if ('undefined' === typeof __main_header_all[event_index]) { return false; } var menuHasChildren = __main_header_all[event_index].querySelectorAll('.menu-item-has-children'); for (var i = 0; i < menuHasChildren.length; i++) { menuHasChildren[i].classList.remove('ast-submenu-expanded'); var menuHasChildrenSubMenu = menuHasChildren[i].querySelectorAll('.sub-menu'); for (var j = 0; j < menuHasChildrenSubMenu.length; j++) { menuHasChildrenSubMenu[j].style.display = 'none'; } } var menu_class = this.getAttribute('class') || ''; if ( menu_class.indexOf('main-header-menu-toggle') !== -1 ) { astraToggleClass(__main_header_all[event_index], 'toggle-on'); astraToggleClass(menu_toggle_all[event_index], 'toggled'); if (__main_header_all[event_index].classList.contains('toggle-on')) { __main_header_all[event_index].style.display = 'block'; body.classList.add("ast-main-header-nav-open"); } else { __main_header_all[event_index].style.display = ''; body.classList.remove("ast-main-header-nav-open"); } } } }; body.addEventListener("astra-header-responsive-enabled", function () { var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); if (__main_header_all.length > 0) { for (var i = 0; i < __main_header_all.length; i++) { if (null != __main_header_all[i]) { __main_header_all[i].classList.remove('toggle-on'); __main_header_all[i].style.display = ''; } var sub_menu = __main_header_all[i].getElementsByClassName('sub-menu'); for (var j = 0; j < sub_menu.length; j++) { sub_menu[j].style.display = ''; } var child_menu = __main_header_all[i].getElementsByClassName('children'); for (var k = 0; k < child_menu.length; k++) { child_menu[k].style.display = ''; } var searchIcons = __main_header_all[i].getElementsByClassName('ast-search-menu-icon'); for (var l = 0; l < searchIcons.length; l++) { searchIcons[l].classList.remove('ast-dropdown-active'); searchIcons[l].style.display = ''; } } } }, false); var get_browser = function () { var ua = navigator.userAgent,tem,M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; if(/trident/i.test(M[1])) { tem = /\brv[ :]+(\d+)/g.exec(ua) || []; return; } if( 'Chrome' === M[1] ) { tem = ua.match(/\bOPR|Edge\/(\d+)/) if(tem != null) { return; } } M = M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?']; if((tem = ua.match(/version\/(\d+)/i)) != null) { M.splice(1,1,tem[1]); } if( 'Safari' === M[0] && M[1] < 11 ) { document.body.classList.add( "ast-safari-browser-less-than-11" ); } } get_browser(); /* Search Script */ var SearchIcons = document.getElementsByClassName( 'astra-search-icon' ); for (var i = 0; i < SearchIcons.length; i++) { SearchIcons[i].onclick = function(event) { if ( this.classList.contains( 'slide-search' ) ) { event.preventDefault(); var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' ); if ( ! sibling.classList.contains( 'ast-dropdown-active' ) ) { sibling.classList.add( 'ast-dropdown-active' ); sibling.querySelector( '.search-field' ).setAttribute('autocomplete','off'); setTimeout(function() { sibling.querySelector( '.search-field' ).focus(); },200); } else { var searchTerm = sibling.querySelector( '.search-field' ).value || ''; if( '' !== searchTerm ) { sibling.querySelector( '.search-form' ).submit(); } sibling.classList.remove( 'ast-dropdown-active' ); } } } } var SearchInputs = document.querySelectorAll( '.search-field' ); SearchInputs.forEach(input => { input.addEventListener('focus', function (e) { var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' ); if ( sibling ) { astraToggleClass( sibling, 'ast-dropdown-active' ); } }); input.addEventListener('blur', function (e) { var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' ); if ( sibling ) { sibling.classList.remove( 'ast-dropdown-active' ); astraToggleClass( sibling, 'ast-dropdown-active' ); } }); }); /* Hide Dropdown on body click*/ body.onclick = function( event ) { if ( typeof event.target.classList !== 'undefined' ) { if ( ! event.target.classList.contains( 'ast-search-menu-icon' ) && astraGetParents( event.target, '.ast-search-menu-icon' ).length === 0 && astraGetParents( event.target, '.ast-search-icon' ).length === 0 ) { var dropdownSearchWrap = document.getElementsByClassName( 'ast-search-menu-icon' ); for (var i = 0; i < dropdownSearchWrap.length; i++) { dropdownSearchWrap[i].classList.remove( 'ast-dropdown-active' ); } } } } /** * Navigation Keyboard Navigation. */ function navigation_accessibility(containerMenu, containerButton) { if (!containerMenu || !containerButton) { return; } var button = containerButton.getElementsByTagName('button')[0] || containerButton.getElementsByTagName('a')[0]; if (!button || (button.classList.contains('astra-search-icon'))) { return; } var menu = containerMenu.getElementsByTagName('ul')[0]; // Hide menu toggle button if menu is empty and return early. if (!menu) { button.style.display = 'none'; return; } if (!menu.className.includes('nav-menu')) { menu.className += ' nav-menu'; } document.addEventListener('DOMContentLoaded', function () { if ('off-canvas' === mobileHeaderType) { var popupClose = document.getElementById('menu-toggle-close'); if (popupClose) { popupClose.onclick = function () { var toggled = containerMenu.className.includes('toggled'); containerMenu.className = toggled ? containerMenu.className.replace(' toggled', '') : containerMenu.className + ' toggled'; button.setAttribute('aria-expanded', toggled ? 'false' : 'true'); menu.setAttribute('aria-expanded', toggled ? 'false' : 'true'); }; } } }); button.onclick = function () { var toggled = containerMenu.className.includes('toggled'); containerMenu.className = toggled ? containerMenu.className.replace(' toggled', '') : containerMenu.className + ' toggled'; button.setAttribute('aria-expanded', toggled ? 'false' : 'true'); menu.setAttribute('aria-expanded', toggled ? 'false' : 'true'); }; if (!astra.is_header_footer_builder_active) { // Get all the link elements within the menu. var links = menu.getElementsByTagName('a'); var subMenus = menu.getElementsByTagName('ul'); // Set menu items with submenus to aria-haspopup="true". for (var i = 0, len = subMenus.length; i < len; i++) { subMenus[i].parentNode.setAttribute('aria-haspopup', 'true'); } // Each time a menu link is focused or blurred, toggle focus. for (var i = 0, len = links.length; i < len; i++) { links[i].addEventListener('focus', toggleFocus, true); links[i].addEventListener('blur', toggleFocus, true); links[i].addEventListener('click', toggleClose, true); } } if (astra.is_header_footer_builder_active) { tabNavigation(); } } // Tab navigation for accessibility. function tabNavigation() { const dropdownToggleLinks = document.querySelectorAll('nav.site-navigation .menu-item-has-children > a .ast-header-navigation-arrow'); const siteNavigationSubMenu = document.querySelectorAll('nav.site-navigation .sub-menu'); const menuLi = document.querySelectorAll('nav.site-navigation .menu-item-has-children'); const megaMenuFullWidth = document.querySelectorAll('.astra-full-megamenu-wrapper'); if (dropdownToggleLinks) { dropdownToggleLinks.forEach(element => { element.addEventListener('keydown', function (e) { if ('Enter' === e.key) { // Check if the user is on a mobile device and prevent default and stop propagation if true. if ( /Mobi|Android|iPad|iPhone/i.test( navigator.userAgent ) ) { e.preventDefault(); e.stopPropagation(); } const closestLi = e.target.closest('li'); const subMenu = closestLi.querySelector('.sub-menu'); const isMegaMenu = subMenu && subMenu.classList.contains('astra-megamenu'); setTimeout(() => { if (!isMegaMenu) { subMenu.classList.toggle('toggled-on'); closestLi.classList.toggle('ast-menu-hover'); } else { const fullMegaMenuWrapper = closestLi.querySelector('.astra-full-megamenu-wrapper'); if (subMenu) subMenu.classList.toggle('astra-megamenu-focus'); if (fullMegaMenuWrapper) fullMegaMenuWrapper.classList.toggle('astra-megamenu-wrapper-focus'); closestLi.classList.toggle('ast-menu-hover'); } const ariaExpanded = e.target.getAttribute('aria-expanded'); e.target.setAttribute('aria-expanded', ariaExpanded === 'false' || !ariaExpanded ? 'true' : 'false'); }, 10); } }); }); if (siteNavigationSubMenu || menuLi) { document.addEventListener('click', function (e) { closeNavigationMenu(siteNavigationSubMenu, dropdownToggleLinks, menuLi, megaMenuFullWidth); }, false); document.addEventListener('keydown', function (e) { if ('Escape' === e.key) { closeNavigationMenu(siteNavigationSubMenu, dropdownToggleLinks, menuLi, megaMenuFullWidth); } }, false); } } const allParentMenu = document.querySelectorAll('nav.site-navigation .ast-nav-menu > .menu-item-has-children > a .ast-header-navigation-arrow'); if (allParentMenu) { allParentMenu.forEach(element => { element.addEventListener('keydown', function (e) { if (!e.target.closest('li').classList.contains('ast-menu-hover') && 'Enter' === e.key) { closeNavigationMenu(siteNavigationSubMenu, dropdownToggleLinks, menuLi, megaMenuFullWidth); } }, false); }); } } function closeNavigationMenu(siteNavigationSubMenu, dropdownToggleLinks, menuLi, megaMenuFullWidth) { if (siteNavigationSubMenu) { siteNavigationSubMenu.forEach(element => { element.classList.remove('astra-megamenu-focus'); element.classList.remove('toggled-on'); }); } if (menuLi) { menuLi.forEach(element => { element.classList.remove('ast-menu-hover'); }); } if (megaMenuFullWidth) { megaMenuFullWidth.forEach(element => { element.classList.remove('astra-megamenu-wrapper-focus') }); } if (dropdownToggleLinks) { dropdownToggleLinks.forEach(element => { element.setAttribute('aria-expanded', 'false'); }); } } /** * Close the Toggle Menu on Click on hash (#) link. * * @since 1.3.2 * @return void */ function toggleClose( ) { var self = this || '', hash = '#'; if( self && ! self.classList.contains('astra-search-icon') && null === self.closest('.ast-builder-menu') ) { var link = String( self ); if( link.indexOf( hash ) !== -1 ) { var link_parent = self.parentNode; if ( body.classList.contains('ast-header-break-point') ) { if( ! ( document.querySelector('header.site-header').classList.contains('ast-builder-menu-toggle-link') && link_parent.classList.contains('menu-item-has-children') ) ) { /* Close Builder Header Menu */ var builder_header_menu_toggle = document.querySelector( '.main-header-menu-toggle' ); builder_header_menu_toggle.classList.remove( 'toggled' ); var main_header_bar_navigation = document.querySelector( '.main-header-bar-navigation' ); main_header_bar_navigation.classList.remove( 'toggle-on' ); main_header_bar_navigation.style.display = 'none'; astraTriggerEvent( document.querySelector('body'), 'astraMenuHashLinkClicked' ); } } else { while ( -1 === self.className.indexOf( 'nav-menu' ) ) { // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { if ( -1 !== self.className.indexOf( 'focus' ) ) { self.className = self.className.replace( ' focus', '' ); } } self = self.parentElement; } } } } } /** * Sets or removes .focus class on an element on focus. */ function toggleFocus() { var self = this; // Move up through the ancestors of the current link until we hit .nav-menu. while ( -1 === self.className.indexOf( 'navigation-accessibility' ) ) { // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { self.classList.toggle('focus'); } self = self.parentElement; } } if( ! astra.is_header_footer_builder_active ) { /* Add class if mouse clicked and remove if tab pressed */ if ( 'querySelector' in document && 'addEventListener' in window ) { body.addEventListener( 'mousedown', function() { body.classList.add( 'ast-mouse-clicked' ); } ); body.addEventListener( 'keydown', function() { body.classList.remove( 'ast-mouse-clicked' ); } ); } } /** * Scroll to specific hash link. * * @since x.x.x */ if ( astra.is_scroll_to_id ) { // Calculate the offset top of an element, accounting for nested elements. const getOffsetTop = (element) => { let offsetTop = 0; while (element) { offsetTop += element.offsetTop; element = element.offsetParent; } return offsetTop; } const scrollToIDHandler = ( e, hash = null ) => { let offset = 0; const siteHeader = document.querySelector('.site-header'); if (siteHeader) { // Check and add offset to scroll top if header is sticky. const stickyHeaders = siteHeader.querySelectorAll( 'div[data-stick-support]' ); if ( stickyHeaders.length > 0 ) { stickyHeaders.forEach( ( header ) => ( offset += header.clientHeight ) ); } else if ( typeof astraAddon !== 'undefined' && ! ( Number( astraAddon.sticky_hide_on_scroll ) && ! document?.querySelector( '.ast-header-sticked' ) ) ) { const fixedHeader = document.querySelector( '#ast-fixed-header' ); if ( fixedHeader ) { offset = fixedHeader?.clientHeight; if ( Number( astraAddon?.header_main_shrink ) ) { const headers = fixedHeader?.querySelectorAll( '.ast-above-header-wrap, .ast-below-header-wrap' ); headers?.forEach( () => ( offset -= 10 ) ); } } } const href = hash ? hash : e.target?.closest( 'a' ).hash; if (href) { const scrollId = document.querySelector(href); if (scrollId) { const elementOffsetTop = getOffsetTop( scrollId ); if ( typeof astraAddon !== 'undefined' && Number( astraAddon.sticky_hide_on_scroll ) && window?.scrollY < elementOffsetTop ) { offset = 0; } const scrollOffsetTop = elementOffsetTop - offset; if( scrollOffsetTop ) { astraSmoothScroll( e, scrollOffsetTop ); } } } } } let hashLinks = []; const links = document.querySelectorAll( 'a[href*="#"]:not([href="#"]):not([href="#0"]):not([href*="uagb-tab"]):not(.uagb-toc-link__trigger):not(.skip-link):not(.nav-links a):not([href*="tab-"])' ); if (links) { for (const link of links) { if (link.href.split("#")[0] !== location.href.split("#")[0]) { // Store the hash hashLinks.push({ hash: link.hash, url: link.href.split("#")[0], }); } else if (link.hash !== "") { link.addEventListener("click", scrollToIDHandler); } } } window.addEventListener('DOMContentLoaded', (event) => { for (let link of hashLinks) { if (window.location.href.split('#')[0] === link.url) { const siteHeader = document.querySelector('.site-header'); let offset = 0; // Check and add offset to scroll top if header is sticky. const headerHeight = siteHeader.querySelectorAll('div[data-stick-support]'); if (headerHeight) { headerHeight.forEach(single => { offset += single.clientHeight; }); } const scrollId = document.querySelector(link.hash); if (scrollId) { const scrollOffsetTop = getOffsetTop(scrollId) - offset; if (scrollOffsetTop) { astraSmoothScroll(event, scrollOffsetTop); } } } } // If there is a hash in the URL when the page loads, scroll to that element after a short delay. if ( location.hash ) { setTimeout( () => scrollToIDHandler( new Event( 'click' ), location.hash ), 750 ); } }); } /** * Scroll to top. * * @since x.x.x */ if ( astra.is_scroll_to_top ) { var masthead = document.querySelector( '#page header' ); var astScrollTop = document.getElementById( 'ast-scroll-top' ); astScrollToTopHandler(masthead, astScrollTop); window.addEventListener('scroll', function () { astScrollToTopHandler(masthead, astScrollTop); }); astScrollTop.onclick = function(e){ astraSmoothScroll( e, 0 ); }; astScrollTop.addEventListener( 'keydown' , function(e) { if ( e.key === 'Enter') { astraSmoothScroll( e, 0 ); } }); } if ( astra?.is_dark_palette ) { document.documentElement.classList.add("astra-dark-mode-enable"); } else { document.documentElement.classList.remove("astra-dark-mode-enable"); } /** * To remove the blank space when the store notice gets dismissed. * To adjust the height of the store notice when hanged over top. * * @since x.x.x */ window.addEventListener('DOMContentLoaded', (event) => { const isHangOverTopNotice = document.querySelector('.ast-woocommerce-store-notice-hanged'); const adjustBodyHeight = () => { const storeNotice = document.querySelector('.woocommerce-store-notice[data-position="hang-over-top"]'); document.body.style.paddingTop = `${storeNotice?.clientHeight || 0}px`; } if (isHangOverTopNotice) { window.addEventListener('resize', adjustBodyHeight); setTimeout(() => adjustBodyHeight(), 0); } document .querySelector('.woocommerce-store-notice__dismiss-link') ?.addEventListener('click', () => { if ( typeof wp === 'undefined' || ! wp?.customize ) { document.body.classList.remove('ast-woocommerce-store-notice-hanged'); window.removeEventListener('resize', adjustBodyHeight); document.body.style.paddingTop = 0; } }); }); })(); // Accessibility improvement for menu items. document.addEventListener('DOMContentLoaded', function () { const submenuToggles = document.querySelectorAll('.menu-link .dropdown-menu-toggle'); const menuItemsWithSubmenu = document.querySelectorAll('.menu-item-has-children > a'); // Ensuring the submenu toggle action is handled with appropriate CSS, with cross browser compatibility for Enter key press. menuItemsWithSubmenu.forEach(item => { item.addEventListener('keydown', function(event) { if (event.key === 'Enter') { const submenu = item.nextElementSibling; if (submenu && submenu.classList.contains('sub-menu')) { submenu.classList.toggle('ast-visible'); const ariaExpanded = item.getAttribute('aria-expanded') === 'false' ? 'true' : 'false'; item.setAttribute('aria-expanded', ariaExpanded); } } }); }); // Add event listeners for focus, blur, and keydown events. submenuToggles.forEach(toggle => { toggle.addEventListener('focus', () => updateAriaExpanded(toggle)); toggle.addEventListener('blur', () => updateAriaExpanded(toggle)); toggle.addEventListener('keydown', event => { if (event.key === 'Enter') { event.preventDefault(); toggleAriaExpanded(toggle); } }); }); // Add event listener for Escape key press to close all submenus. document.addEventListener('keydown', event => { if (event.key === 'Escape') { closeAllSubmenus(); } }); /** * Updates the `aria-expanded` attribute based on submenu visibility. * @param {HTMLElement} toggle - The toggle element. */ function updateAriaExpanded(toggle) { const menuItemLink = toggle.closest('.menu-link'); const submenu = menuItemLink.nextElementSibling; const isSubmenuVisible = submenu.classList.contains('toggled-on'); menuItemLink.setAttribute('aria-expanded', isSubmenuVisible ? 'true' : 'false'); } /** * Toggles the `aria-expanded` attribute for a given toggle element. * @param {HTMLElement} toggle - The toggle element. */ function toggleAriaExpanded(toggle) { const menuItemLink = toggle.closest('.menu-link'); const currentState = menuItemLink.getAttribute('aria-expanded'); menuItemLink.setAttribute('aria-expanded', currentState === 'true' ? 'false' : 'true'); } /** * Closes all submenus by updating the `aria-expanded` attribute. */ function closeAllSubmenus() { submenuToggles.forEach(toggle => updateAriaExpanded(toggle)); } // This event listener is triggered when the device orientation changes, and it dispatches a 'resize' event to ensure layout adjustments are made. window.addEventListener( 'orientationchange', () => { setTimeout( () => window.dispatchEvent( new Event( 'resize' ) ), 50 ); } ); }); // Accessibility improvement for product card quick view and add to cart buttons. document.addEventListener('DOMContentLoaded', () => { const thumbnailWraps = document.querySelectorAll('.astra-shop-thumbnail-wrap'); thumbnailWraps.forEach(wrap => { const focusableElements = wrap.querySelectorAll('a, span'); focusableElements.forEach(el => { el.addEventListener('focus', () => { wrap.querySelectorAll('.ast-on-card-button, .ast-quick-view-trigger').forEach(btn => { btn.style.opacity = '1'; btn.style.visibility = 'visible'; btn.style.borderStyle = 'none'; }); }); el.addEventListener('blur', () => { // Added Check to check if child elements are still focused. const isAnyFocused = Array.from(focusableElements).some(child => child === document.activeElement); if (!isAnyFocused) { wrap.querySelectorAll('.ast-on-card-button, .ast-quick-view-trigger').forEach(btn => { btn.style.opacity = ''; btn.style.visibility = ''; }); } }); }); }); }); /* * Close any open mobile navigation when a menu link is clicked. * This is to ensure that the mobile navigation is closed when a menu link is clicked * Used Jquery here as a exception becase plane js will not work due to Missing delegation. */ jQuery( document ).on( 'click', '.main-header-bar-navigation a', function() { if ( jQuery( 'body' ).hasClass( 'ast-main-header-nav-open' ) ) { jQuery( '.main-header-menu-toggle.toggled' ).removeClass( 'toggled' ); jQuery( '.main-header-bar-navigation.toggle-on' ).removeClass( 'toggle-on' ).css( 'display', '' ); jQuery( 'body' ).removeClass( 'ast-main-header-nav-open' ); } } ); PK Wj[��iJ J customizer-controls.jsnu �[��� /** * Customizer controls * * @package Astra */ ( function( $ ) { /* Internal shorthand */ var api = wp.customize; /** * Helper class for the main Customizer interface. * * @since 1.0.0 * @class ASTCustomizer */ ASTCustomizer = { controls : {}, /** * Initializes our custom logic for the Customizer. * * @since 1.0.0 * @method init */ init: function() { ASTCustomizer._initToggles(); ASTCustomizer._initSubControlsToggle(); }, /** * Initializes the logic for showing and hiding controls * when a setting changes. * * @since 1.0.0 * @method _initToggles */ _initToggles: function() { // Trigger the Adv Tab Click trigger. ASTControlTrigger.triggerHook( 'astra-toggle-control', api ); // Loop through each setting. $.each( ASTCustomizerToggles, function( settingId, toggles ) { // Get the setting object. api( settingId, function( setting ) { // Loop though the toggles for the setting. $.each( toggles, function( i, toggle ) { // Loop through the controls for the toggle. $.each( toggle.controls, function( k, controlId ) { // Get the control object. api.control( controlId, function( control ) { // Define the visibility callback. var visibility = function( to ) { control.container.toggle( toggle.callback( to ) ); }; // Init visibility. visibility( setting.get() ); // Bind the visibility callback to the setting. setting.bind( visibility ); }); }); }); }); }); }, /** * Toggle sub control visibility CSS. * * @since x.x.x */ subControlsToggleCSS( controlValue, dependents ) { $.each( dependents, function( controlOption, dependentSubControls ) { $.each( dependentSubControls, function( dependentIndex, subControl ) { // Remove old. jQuery( 'style#ast-sub-control-' + subControl ).remove(); // Add new. if ( controlValue !== controlOption ) { // Concat and append new <style>. jQuery( 'head' ).append( '<style id="ast-sub-control-' + subControl + '">' + '#customize-control-' + subControl + ' { display: none; }' + '</style>' ); } }); }); }, /** * Initializes the logic for showing and hiding sub controls * when a setting changes. * * @since x.x.x * @method _initSubControlsToggle * @return void */ _initSubControlsToggle: function() { document.addEventListener('AstraToggleSubControls', function (e) { let subControlData = e.detail; ASTCustomizer.subControlsToggleCSS( subControlData.controlValue, subControlData.dependents ); }); } }; $( function() { ASTCustomizer.init(); } ); })( jQuery ); ( function( api ) { // Extends our custom astra-pro section. api.sectionConstructor['astra-pro'] = api.Section.extend( { // No events for this type of section. attachEvents: function () {}, // Always make the section active. isContextuallyActive: function () { return true; } } ); } )( wp.customize ); PK Wj[uFB, skip-link-focus-fix.jsnu �[��� /** * File skip-link-focus-fix.js * * Helps with accessibility for keyboard only users. * This is the source file for what is minified in the astra_skip_link_focus_fix() PHP function. * * Learn more: https://github.com/Automattic/_s/pull/136 * * @package Astra */ ( function() { var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1, is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) { window.addEventListener( 'hashchange', function() { var id = location.hash.substring( 1 ), element; if ( ! ( /^[a-zA-Z0-9_-]+$/.test( id ) ) ) { return; } element = document.getElementById( id ); if ( element ) { if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { element.tabIndex = -1; } element.focus(); } }, false ); } })(); PK Wj[M��^C C sticky-sidebar.jsnu �[��� /** * File sticky-sidebar.js. * * Feature: Sticky Sidebar * Description: Calculates offset for sticky sidebar positioning. * @package Astra * @since x.x.x */ (function () { 'use strict'; window.astraStickySidebar = { /** * Check whether the header type is sticky and active or not. */ isStickyHeaderActive: function( header, headerStick ) { return ( headerStick && "0" !== headerStick && null !== header ); }, /** * Get the top offset from header for sticky sidebar start position. */ getOffset: function () { let offset = 0; const abvHeader = document.querySelector('.ast-above-header-bar'); const primaryHeader = document.querySelector('.ast-primary-header-bar'); const blwHeader = document.querySelector('.ast-below-header-bar'); const desktopBreakpoint = astra_sticky_sidebar.desktop_breakpoint ? parseInt( astra_sticky_sidebar.desktop_breakpoint ) : 922; if ( window.innerWidth >= desktopBreakpoint && ( abvHeader || primaryHeader || blwHeader ) ) { if ( document.body.classList.contains( 'admin-bar' ) ) { offset += 32; } if ( astra_sticky_sidebar.sticky_header_addon ) { if ( window.astraStickySidebar.isStickyHeaderActive( abvHeader, astra_sticky_sidebar.header_above_stick ) ) { offset += Math.floor( parseInt( astra_sticky_sidebar.header_above_height.desktop ) ); } if ( window.astraStickySidebar.isStickyHeaderActive( primaryHeader, astra_sticky_sidebar.header_main_stick ) ) { offset += Math.floor( parseInt( astra_sticky_sidebar.header_height.desktop ) ); } if ( window.astraStickySidebar.isStickyHeaderActive( blwHeader, astra_sticky_sidebar.header_below_stick ) ) { offset += Math.floor( parseInt( astra_sticky_sidebar.header_below_height.desktop ) ); } } return offset; } }, /** * Initiate the sticky sidebar. */ activateStickySidebar: function() { if ( ! document.body.classList.contains( 'ast-sticky-sidebar' ) ) { return; } const sidebar = document.querySelector( '#secondary .sidebar-main' ); if ( sidebar && astra_sticky_sidebar.sticky_sidebar_on ) { const offset = window.astraStickySidebar.getOffset(); sidebar.style.top = Math.floor( offset + 50 ) + 'px'; sidebar.style.maxHeight = 'calc( 100vh - ' + Math.floor( offset + 50 ) + 'px )'; } }, init: function () { // Kick off the sticky sidebar activation. window.astraStickySidebar.activateStickySidebar(); } } if ( 'loading' === document.readyState ) { // The DOM has not yet been loaded. document.addEventListener( 'DOMContentLoaded', window.astraStickySidebar.init ); } else { // The DOM has already been loaded. window.astraStickySidebar.init(); } })();PK Wj[��=�w w customizer-style-guide.jsnu �[��� /** * Astra Theme Customizer Style Guide * * @package Astra * @since x.x.x */ (function($, api) { /** * Style Guide navigation. */ jQuery(document).ready(function($) { let headerContainer = jQuery('#customize-header-actions'), button = jQuery('<button name="astra-tour" id="astra-tour" class="button-secondary button"> <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M6.79688 8.92573L12.8494 2.88073C13.0467 2.67706 13.2825 2.51469 13.5432 2.40306C13.8038 2.29144 14.0841 2.23279 14.3677 2.23054C14.6512 2.22828 14.9324 2.28247 15.1948 2.38994C15.4572 2.49741 15.6956 2.65602 15.8961 2.85653C16.0966 3.05703 16.2552 3.29543 16.3627 3.55783C16.4701 3.82024 16.5243 4.1014 16.5221 4.38495C16.5198 4.6685 16.4612 4.94876 16.3495 5.20943C16.2379 5.47009 16.0755 5.70593 15.8719 5.90323L9.82688 11.9632" stroke="#3B4349" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> <path d="M5.30349 11.2031C4.05849 11.2031 3.05349 12.2156 3.05349 13.4681C3.05349 14.4656 1.17849 14.6081 1.55349 14.9831C2.36349 15.8081 3.42099 16.4981 4.55349 16.4981C6.20349 16.4981 7.55349 15.1481 7.55349 13.4681C7.55448 13.1717 7.49706 12.8779 7.38452 12.6036C7.27198 12.3294 7.10653 12.08 6.89759 11.8696C6.68866 11.6593 6.44035 11.4922 6.16683 11.3778C5.89332 11.2635 5.59995 11.2041 5.30349 11.2031Z" stroke="#3B4349" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> </svg><div class="ast-style-guide-tooltip">Style Guide</div></button>'); let indicatorDot = $('<span class="indicator-dot"></span>'); headerContainer.append(indicatorDot); headerContainer.append(button); // Added function to check visit count and show/hide the red dot. function checkVisitCount() { let visitCount = localStorage.getItem('customizerVisitCount'); visitCount = visitCount ? parseInt(visitCount, 10) : 0; if (visitCount < 5) { indicatorDot.show(); visitCount++; localStorage.setItem('customizerVisitCount', visitCount); } else { indicatorDot.hide(); } } checkVisitCount(); button.on('click', function(event) { event.preventDefault(); event.stopPropagation(); // Access the iframe's content var iframeBody = $('#customize-preview').find('iframe').contents().find('body'); // Apply the custom class to the iframe's body iframeBody.toggleClass('ast-sg-loaded'); // Creating new state for restricting the preview refresh. api.state.create('astra-style-guide-status'); api.state('astra-style-guide-status').set('loaded'); }); // Bind the click event to the button to focus on the style guide section. const urlParams = new URLSearchParams( window.location.search ); const autofocus = urlParams.get( 'autofocus' ); if ( autofocus === 'astra-tour' ) { let hasTriggered = false; // flag to ensure it only fires once wp.customize.previewer.bind( 'ready', () => { if ( hasTriggered ) { return; // if already triggered, do nothing } button.trigger( 'click' ); hasTriggered = true; // set the flag to true after triggering } ); } }); // development code. $('#customize-preview iframe').on('load', function() { // Access the iframe's content var iframeBody = $('#customize-preview').find('iframe').contents().find('body'); // Apply the custom class to the iframe's body iframeBody.addClass('ast-sg-loaded'); }); })(jQuery, wp.customize); PK Wj[6w�g �g navigation.jsnu �[��� /** * File navigation.js * * Handles toggling the navigation menu for small screens and enables tab * support for dropdown menus. * * @package Astra */ /** * Get all of an element's parent elements up the DOM tree * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var astraGetParents = function ( elem, selector ) { // Element.matches() polyfill. if ( ! Element.prototype.matches) { Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function(s) { var matches = (this.document || this.ownerDocument).querySelectorAll( s ), i = matches.length; while (--i >= 0 && matches.item( i ) !== this) {} return i > -1; }; } // Setup parents array. var parents = []; // Get matching parent elements. for ( ; elem && elem !== document; elem = elem.parentNode ) { // Add matching parents to array. if ( selector ) { if ( elem.matches( selector ) ) { parents.push( elem ); } } else { parents.push( elem ); } } return parents; }; /** * Deprecated: Get all of an element's parent elements up the DOM tree * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var getParents = function ( elem, selector ) { console.warn( 'getParents() function has been deprecated since version 2.5.0 or above of Astra Theme and will be removed in the future. Use astraGetParents() instead.' ); astraGetParents( elem, selector ); } /** * Toggle Class funtion * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var astraToggleClass = function ( el, className ) { if ( el.classList.contains( className ) ) { el.classList.remove( className ); } else { el.classList.add( className ); } }; /** * Deprecated: Toggle Class funtion * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var toggleClass = function ( el, className ) { console.warn( 'toggleClass() function has been deprecated since version 2.5.0 or above of Astra Theme and will be removed in the future. Use astraToggleClass() instead.' ); astraToggleClass( el, className ); }; // CustomEvent() constructor functionality in Internet Explorer 9 and higher. (function () { if (typeof window.CustomEvent === "function") return false; function CustomEvent(event, params) { params = params || { bubbles: false, cancelable: false, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent; })(); /** * Trigget custom JS Event. * * @since 1.4.6 * * @link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent * @param {Node} el Dom Node element on which the event is to be triggered. * @param {Node} typeArg A DOMString representing the name of the event. * @param {String} A CustomEventInit dictionary, having the following fields: * "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event. */ var astraTriggerEvent = function astraTriggerEvent( el, typeArg ) { var customEventInit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var event = new CustomEvent(typeArg, customEventInit); el.dispatchEvent(event); }; /** * Scroll to ID/Top with smooth scroll behavior. * * @since x.x.x * * @param {Event} e Event which is been fired. * @param {String} top offset from top. */ astraSmoothScroll = function astraSmoothScroll( e, top ) { e.preventDefault(); window.scrollTo({ top: top, left: 0, behavior: 'smooth' }); }; /** * Scroll to Top trigger visibility adjustments. * * @since x.x.x * * @param {Node} masthead Page header. * @param {Node} astScrollTop Scroll to Top selector. */ astScrollToTopHandler = function ( masthead, astScrollTop ) { var content = getComputedStyle(astScrollTop).content, device = astScrollTop.dataset.onDevices; content = content.replace( /[^0-9]/g, '' ); if( 'both' == device || ( 'desktop' == device && '769' == content ) || ( 'mobile' == device && '' == content ) ) { // Get current window / document scroll. var scrollTop = window.pageYOffset || document.body.scrollTop; // If masthead found. if( masthead && masthead.length ) { if (scrollTop > masthead.offsetHeight + 100) { astScrollTop.style.display = "block"; } else { astScrollTop.style.display = "none"; } } else { // If there is no masthead set default start scroll if ( window.pageYOffset > 300 ) { astScrollTop.style.display = "block"; } else { astScrollTop.style.display = "none"; } } } else { astScrollTop.style.display = "none"; } }; ( function() { var menu_toggle_all = document.querySelectorAll( '.main-header-menu-toggle' ); var menu_click_listeners_nav = {}; /* Add break point Class and related trigger */ var updateHeaderBreakPoint = function () { // Content overrflowing out of screen can give incorrect window.innerWidth. // Adding overflow hidden and then calculating the window.innerWidth fixes the problem. var originalOverflow = document.querySelector('body').style.overflow; document.querySelector('body').style.overflow = 'hidden'; var ww = window.innerWidth; document.querySelector('body').style.overflow = originalOverflow; var break_point = astra.break_point, headerWrap = document.querySelectorAll('.main-header-bar-wrap'); if (headerWrap.length > 0) { for (var i = 0; i < headerWrap.length; i++) { if (headerWrap[i].tagName == 'DIV' && headerWrap[i].classList.contains('main-header-bar-wrap')) { if (ww > break_point) { //remove menu toggled class. if (null != menu_toggle_all[i]) { menu_toggle_all[i].classList.remove('toggled'); } document.body.classList.remove("ast-header-break-point"); document.body.classList.add("ast-desktop"); astraTriggerEvent(document.body, "astra-header-responsive-enabled"); } else { document.body.classList.add("ast-header-break-point"); document.body.classList.remove("ast-desktop"); astraTriggerEvent(document.body, "astra-header-responsive-disabled") } } } } } updateHeaderBreakPoint(); AstraToggleSubMenu = function() { var parent_li = this.parentNode; if (parent_li.classList.contains('ast-submenu-expanded') && document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link")) { if (!this.classList.contains('ast-menu-toggle')) { var link = parent_li.querySelector('a').getAttribute('href'); if ('' !== link || '#' !== link) { window.location = link; } } } var parent_li_child = parent_li.querySelectorAll('.menu-item-has-children'); for (var j = 0; j < parent_li_child.length; j++) { parent_li_child[j].classList.remove('ast-submenu-expanded'); var parent_li_child_sub_menu = parent_li_child[j].querySelector('.sub-menu, .children'); if( null !== parent_li_child_sub_menu ) { parent_li_child_sub_menu.style.display = 'none'; } } var parent_li_sibling = parent_li.parentNode.querySelectorAll('.menu-item-has-children'); for (var j = 0; j < parent_li_sibling.length; j++) { if (parent_li_sibling[j] != parent_li) { parent_li_sibling[j].classList.remove('ast-submenu-expanded'); var all_sub_menu = parent_li_sibling[j].querySelectorAll('.sub-menu'); for (var k = 0; k < all_sub_menu.length; k++) { all_sub_menu[k].style.display = 'none'; } } } if (parent_li.classList.contains('menu-item-has-children') ) { astraToggleClass(parent_li, 'ast-submenu-expanded'); if (parent_li.classList.contains('ast-submenu-expanded')) { parent_li.querySelector('.sub-menu').style.display = 'block'; } else { parent_li.querySelector('.sub-menu').style.display = 'none'; } } }; AstraNavigationMenu = function( parentList ) { console.warn( 'AstraNavigationMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future.' ); }; AstraToggleMenu = function( astra_menu_toggle ) { console.warn('AstraToggleMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future. Use AstraToggleSubMenu() instead.'); // Add Eventlisteners for Submenu. if (astra_menu_toggle.length > 0) { for (var i = 0; i < astra_menu_toggle.length; i++) { astra_menu_toggle[i].removeEventListener('click', AstraToggleSubMenu); astra_menu_toggle[i].addEventListener('click', AstraToggleSubMenu, false); } } }; AstraToggleSetup = function () { var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); if (menu_toggle_all.length > 0) { for (var i = 0; i < menu_toggle_all.length; i++) { menu_toggle_all[i].setAttribute('data-index', i); if ( ! menu_click_listeners_nav[i] ) { menu_click_listeners_nav[i] = menu_toggle_all[i]; menu_toggle_all[i].removeEventListener('click', astraNavMenuToggle); menu_toggle_all[i].addEventListener('click', astraNavMenuToggle, false); } if ('undefined' !== typeof __main_header_all[i]) { if (document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link")) { var astra_menu_toggle = __main_header_all[i].querySelectorAll('.ast-header-break-point .main-header-menu .menu-item-has-children > .menu-link, .ast-header-break-point ul.main-header-menu .ast-menu-toggle'); } else { var astra_menu_toggle = __main_header_all[i].querySelectorAll('ul.main-header-menu .ast-menu-toggle'); } // Add Eventlisteners for Submenu. if (astra_menu_toggle.length > 0) { for (var j = 0; j < astra_menu_toggle.length; j++) { astra_menu_toggle[j].removeEventListener('click', AstraToggleSubMenu); astra_menu_toggle[j].addEventListener('click', AstraToggleSubMenu, false); } } } } } }; astraNavMenuToggle = function ( event ) { event.preventDefault(); var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); var event_index = this.getAttribute('data-index'); if ('undefined' === typeof __main_header_all[event_index]) { return false; } var menuHasChildren = __main_header_all[event_index].querySelectorAll('.menu-item-has-children'); for (var i = 0; i < menuHasChildren.length; i++) { menuHasChildren[i].classList.remove('ast-submenu-expanded'); var menuHasChildrenSubMenu = menuHasChildren[i].querySelectorAll('.sub-menu'); for (var j = 0; j < menuHasChildrenSubMenu.length; j++) { menuHasChildrenSubMenu[j].style.display = 'none'; } } var menu_class = this.getAttribute('class') || ''; if ( menu_class.indexOf('main-header-menu-toggle') !== -1 ) { astraToggleClass(__main_header_all[event_index], 'toggle-on'); astraToggleClass(menu_toggle_all[event_index], 'toggled'); if (__main_header_all[event_index].classList.contains('toggle-on')) { __main_header_all[event_index].style.display = 'block'; document.body.classList.add("ast-main-header-nav-open"); } else { __main_header_all[event_index].style.display = ''; document.body.classList.remove("ast-main-header-nav-open"); } } }; document.body.addEventListener("astra-header-responsive-enabled", function () { var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); if (__main_header_all.length > 0) { for (var i = 0; i < __main_header_all.length; i++) { if (null != __main_header_all[i]) { __main_header_all[i].classList.remove('toggle-on'); __main_header_all[i].style.display = ''; } var sub_menu = __main_header_all[i].getElementsByClassName('sub-menu'); for (var j = 0; j < sub_menu.length; j++) { sub_menu[j].style.display = ''; } var child_menu = __main_header_all[i].getElementsByClassName('children'); for (var k = 0; k < child_menu.length; k++) { child_menu[k].style.display = ''; } var searchIcons = __main_header_all[i].getElementsByClassName('ast-search-menu-icon'); for (var l = 0; l < searchIcons.length; l++) { searchIcons[l].classList.remove('ast-dropdown-active'); searchIcons[l].style.display = ''; } } } }, false); window.addEventListener('resize', function () { // Skip resize event when keyboard display event triggers on devices. if( 'INPUT' !== document.activeElement.tagName ) { updateHeaderBreakPoint(); AstraToggleSetup(); } }); document.addEventListener('DOMContentLoaded', function () { AstraToggleSetup(); /** * Navigation Keyboard Navigation. */ var container, count; container = document.querySelectorAll( '.navigation-accessibility' ); for ( count = 0; count <= container.length - 1; count++ ) { if ( container[count] ) { navigation_accessibility( container[count] ); } } }); var get_browser = function () { var ua = navigator.userAgent,tem,M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; if(/trident/i.test(M[1])) { tem = /\brv[ :]+(\d+)/g.exec(ua) || []; return; } if( 'Chrome' === M[1] ) { tem = ua.match(/\bOPR|Edge\/(\d+)/) if(tem != null) { return; } } M = M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?']; if((tem = ua.match(/version\/(\d+)/i)) != null) { M.splice(1,1,tem[1]); } var bodyElement = document.body; if( 'Safari' === M[0] && M[1] < 11 ) { bodyElement.classList.add( "ast-safari-browser-less-than-11" ); } } get_browser(); /* Search Script */ var SearchIcons = document.getElementsByClassName( 'astra-search-icon' ); for (var i = 0; i < SearchIcons.length; i++) { SearchIcons[i].onclick = function(event) { if ( this.classList.contains( 'slide-search' ) ) { event.preventDefault(); var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' ); if ( ! sibling.classList.contains( 'ast-dropdown-active' ) ) { sibling.classList.add( 'ast-dropdown-active' ); sibling.querySelector( '.search-field' ).setAttribute('autocomplete','off'); setTimeout(function() { sibling.querySelector( '.search-field' ).focus(); },200); } else { var searchTerm = sibling.querySelector( '.search-field' ).value || ''; if( '' !== searchTerm ) { sibling.querySelector( '.search-form' ).submit(); } sibling.classList.remove( 'ast-dropdown-active' ); } } } } var SearchInputs = document.querySelectorAll( '.search-field' ); SearchInputs.forEach(input => { input.addEventListener('focus', function (e) { var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' ); astraToggleClass( sibling, 'ast-dropdown-active' ); }); input.addEventListener('blur', function (e) { var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' ); sibling.classList.remove( 'ast-dropdown-active' ); astraToggleClass( sibling, 'ast-dropdown-active' ); }); }); /* Hide Dropdown on body click*/ document.body.onclick = function( event ) { if ( typeof event.target.classList !== 'undefined' ) { if ( ! event.target.classList.contains( 'ast-search-menu-icon' ) && astraGetParents( event.target, '.ast-search-menu-icon' ).length === 0 && astraGetParents( event.target, '.ast-search-icon' ).length === 0 ) { var dropdownSearchWrap = document.getElementsByClassName( 'ast-search-menu-icon' ); for (var i = 0; i < dropdownSearchWrap.length; i++) { dropdownSearchWrap[i].classList.remove( 'ast-dropdown-active' ); } } } } /** * Navigation Keyboard Navigation. */ function navigation_accessibility( container ) { if ( ! container ) { return; } var button = container.getElementsByTagName( 'button' )[0]; if ( 'undefined' === typeof button ) { button = container.getElementsByTagName( 'a' )[0]; if ( 'undefined' === typeof button ) { return; } } var menu = container.getElementsByTagName( 'ul' )[0]; // Hide menu toggle button if menu is empty and return early. if ( 'undefined' === typeof menu ) { button.style.display = 'none'; return; } menu.setAttribute( 'aria-expanded', 'false' ); if ( -1 === menu.className.indexOf( 'nav-menu' ) ) { menu.className += ' nav-menu'; } button.onclick = function() { if ( -1 !== container.className.indexOf( 'toggled' ) ) { container.className = container.className.replace( ' toggled', '' ); button.setAttribute( 'aria-expanded', 'false' ); menu.setAttribute( 'aria-expanded', 'false' ); } else { container.className += ' toggled'; button.setAttribute( 'aria-expanded', 'true' ); menu.setAttribute( 'aria-expanded', 'true' ); } }; // Get all the link elements within the menu. var links = menu.getElementsByTagName( 'a' ); var subMenus = menu.getElementsByTagName( 'ul' ); // Set menu items with submenus to aria-haspopup="true". for ( var i = 0, len = subMenus.length; i < len; i++ ) { subMenus[i].parentNode.setAttribute( 'aria-haspopup', 'true' ); } // Each time a menu link is focused or blurred, toggle focus. for ( i = 0, len = links.length; i < len; i++ ) { links[i].addEventListener( 'focus', toggleFocus, true ); links[i].addEventListener( 'blur', toggleBlurFocus, true ); links[i].addEventListener( 'click', toggleClose, true ); } } /** * Close the Toggle Menu on Click on hash (#) link. * * @since 1.3.2 * @return void */ function toggleClose( ) { var self = this || '', hash = '#'; if( self && ! self.classList.contains('astra-search-icon') ) { var link = String( self ); if( link.indexOf( hash ) !== -1 ) { var link_parent = self.parentNode; if ( document.body.classList.contains('ast-header-break-point') && ! ( document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link") && link_parent.classList.contains("menu-item-has-children") ) ) { /* Close Main Header Menu */ var main_header_menu_toggle = document.querySelector( '.main-header-menu-toggle' ); main_header_menu_toggle.classList.remove( 'toggled' ); var main_header_bar_navigation = document.querySelector( '.main-header-bar-navigation' ); main_header_bar_navigation.classList.remove( 'toggle-on' ); main_header_bar_navigation.style.display = 'none'; /* Close Below Header Menu */ var before_header_menu_toggle = document.querySelector( '.menu-below-header-toggle' ); var before_header_bar_navigation = document.querySelector( '.ast-below-header' ); var before_header_bar = document.querySelector( '.ast-below-header-actual-nav' ); if ( before_header_menu_toggle && before_header_bar_navigation && before_header_bar ) { before_header_menu_toggle.classList.remove( 'toggled' ); before_header_bar_navigation.classList.remove( 'toggle-on' ); before_header_bar.style.display = 'none'; } /* Close After Header Menu */ var after_header_menu_toggle = document.querySelector( '.menu-above-header-toggle' ); var after_header_bar_navigation = document.querySelector( '.ast-above-header' ); var after_header_bar = document.querySelector( '.ast-above-header-navigation' ); if ( after_header_menu_toggle && after_header_bar_navigation && after_header_bar ) { after_header_menu_toggle.classList.remove( 'toggled' ); after_header_bar_navigation.classList.remove( 'toggle-on' ); after_header_bar.style.display = 'none'; } astraTriggerEvent( document.querySelector('body'), 'astraMenuHashLinkClicked' ); } else { while ( -1 === self.className.indexOf( 'nav-menu' ) ) { // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { if ( -1 !== self.className.indexOf( 'focus' ) ) { self.className = self.className.replace( ' focus', '' ); } } self = self.parentElement; } } } } } /** * Sets or removes .focus class on an element and its ancestors until a specific class is found. * @param {Element} element - The element to apply the .focus class and traverse its ancestors. * @param {string} targetClass - The class name to search for in the ancestors. */ function toggleFocusAndAncestors(element, targetClass) { while (-1 === element.className.indexOf(targetClass)) { if ('li' === element.tagName.toLowerCase()) { if (element.classList.contains('focus')) { element.classList.remove('focus'); } else { element.classList.add('focus'); } } element = element.parentElement; } } /** * Sets or removes .focus class on an element on focus. */ function toggleFocus() { var self = this; toggleFocusAndAncestors(self, 'nav-menu'); } /** * Sets or removes .focus class on an element on blur. */ function toggleBlurFocus() { var self = this || '', hash = '#'; var link = String(self); if (link.includes(hash) && document.body.classList.contains('ast-mouse-clicked')) { return; } toggleFocusAndAncestors(self, 'nav-menu'); } /* Add class if mouse clicked and remove if tab pressed */ if ( 'querySelector' in document && 'addEventListener' in window ) { var body = document.body; body.addEventListener( 'mousedown', function() { body.classList.add( 'ast-mouse-clicked' ); } ); body.addEventListener( 'keydown', function() { body.classList.remove( 'ast-mouse-clicked' ); } ); } /** * Scroll to specific hash link. * * @since x.x.x */ if ( astra.is_scroll_to_id ) { // Calculate the offset top of an element, accounting for nested elements. const getOffsetTop = (element) => { let offsetTop = 0; while (element) { offsetTop += element.offsetTop; element = element.offsetParent; } return offsetTop; } const scrollToIDHandler = ( e, hash = null ) => { let offset = 0; const siteHeader = document.querySelector('.site-header'); if (siteHeader) { // Check and add offset to scroll top if header is sticky. const stickyHeaders = siteHeader.querySelectorAll( 'div[data-stick-support]' ); if ( stickyHeaders.length > 0 ) { stickyHeaders.forEach( ( header ) => ( offset += header.clientHeight ) ); } else if ( typeof astraAddon !== 'undefined' && ! ( Number( astraAddon.sticky_hide_on_scroll ) && ! document?.querySelector( '.ast-header-sticked' ) ) ) { const fixedHeader = document.querySelector( '#ast-fixed-header' ); if ( fixedHeader ) { offset = fixedHeader?.clientHeight; if ( Number( astraAddon?.header_main_shrink ) ) { const headers = fixedHeader?.querySelectorAll( '.ast-above-header-wrap, .ast-below-header-wrap' ); headers?.forEach( () => ( offset -= 10 ) ); } } } const href = hash ? hash : e.target?.closest( 'a' ).hash; if (href) { const scrollId = document.querySelector(href); if (scrollId) { const elementOffsetTop = getOffsetTop( scrollId ); if ( typeof astraAddon !== 'undefined' && Number( astraAddon.sticky_hide_on_scroll ) && window?.scrollY < elementOffsetTop ) { offset = 0; } const scrollOffsetTop = elementOffsetTop - offset; if( scrollOffsetTop ) { astraSmoothScroll( e, scrollOffsetTop ); } } } } } let hashLinks = []; const links = document.querySelectorAll( 'a[href*="#"]:not([href="#"]):not([href="#0"]):not([href*="uagb-tab"]):not(.uagb-toc-link__trigger):not(.skip-link):not(.nav-links a):not([href*="tab-"])' ); if (links) { for (const link of links) { if (link.href.split("#")[0] !== location.href.split("#")[0]) { // Store the hash hashLinks.push({ hash: link.hash, url: link.href.split("#")[0], }); } else if (link.hash !== "") { link.addEventListener("click", scrollToIDHandler); } } } window.addEventListener('DOMContentLoaded', (event) => { for (let link of hashLinks) { if (window.location.href.split('#')[0] === link.url) { const siteHeader = document.querySelector('.site-header'); let offset = 0; // Check and add offset to scroll top if header is sticky. const headerHeight = siteHeader.querySelectorAll('div[data-stick-support]'); if (headerHeight) { headerHeight.forEach(single => { offset += single.clientHeight; }); } const scrollId = document.querySelector(link.hash); if (scrollId) { const scrollOffsetTop = getOffsetTop(scrollId) - offset; if (scrollOffsetTop) { astraSmoothScroll(event, scrollOffsetTop); } } } } // If there is a hash in the URL when the page loads, scroll to that element after a short delay. if ( location.hash ) { setTimeout( () => scrollToIDHandler( new Event( 'click' ), location.hash ), 750 ); } }); } /** * Scroll to top. * * @since x.x.x */ if ( astra.is_scroll_to_top ) { var masthead = document.querySelector( '#page header' ); var astScrollTop = document.getElementById( 'ast-scroll-top' ); astScrollToTopHandler(masthead, astScrollTop); window.addEventListener('scroll', function () { astScrollToTopHandler(masthead, astScrollTop); }); astScrollTop.onclick = function(e){ astraSmoothScroll( e, 0 ); }; } } )(); PK Wj[6w�g �g style.jsnu �[��� /** * File navigation.js * * Handles toggling the navigation menu for small screens and enables tab * support for dropdown menus. * * @package Astra */ /** * Get all of an element's parent elements up the DOM tree * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var astraGetParents = function ( elem, selector ) { // Element.matches() polyfill. if ( ! Element.prototype.matches) { Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function(s) { var matches = (this.document || this.ownerDocument).querySelectorAll( s ), i = matches.length; while (--i >= 0 && matches.item( i ) !== this) {} return i > -1; }; } // Setup parents array. var parents = []; // Get matching parent elements. for ( ; elem && elem !== document; elem = elem.parentNode ) { // Add matching parents to array. if ( selector ) { if ( elem.matches( selector ) ) { parents.push( elem ); } } else { parents.push( elem ); } } return parents; }; /** * Deprecated: Get all of an element's parent elements up the DOM tree * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var getParents = function ( elem, selector ) { console.warn( 'getParents() function has been deprecated since version 2.5.0 or above of Astra Theme and will be removed in the future. Use astraGetParents() instead.' ); astraGetParents( elem, selector ); } /** * Toggle Class funtion * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var astraToggleClass = function ( el, className ) { if ( el.classList.contains( className ) ) { el.classList.remove( className ); } else { el.classList.add( className ); } }; /** * Deprecated: Toggle Class funtion * * @param {Node} elem The element. * @param {String} selector Selector to match against [optional]. * @return {Array} The parent elements. */ var toggleClass = function ( el, className ) { console.warn( 'toggleClass() function has been deprecated since version 2.5.0 or above of Astra Theme and will be removed in the future. Use astraToggleClass() instead.' ); astraToggleClass( el, className ); }; // CustomEvent() constructor functionality in Internet Explorer 9 and higher. (function () { if (typeof window.CustomEvent === "function") return false; function CustomEvent(event, params) { params = params || { bubbles: false, cancelable: false, detail: undefined }; var evt = document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent; })(); /** * Trigget custom JS Event. * * @since 1.4.6 * * @link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent * @param {Node} el Dom Node element on which the event is to be triggered. * @param {Node} typeArg A DOMString representing the name of the event. * @param {String} A CustomEventInit dictionary, having the following fields: * "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event. */ var astraTriggerEvent = function astraTriggerEvent( el, typeArg ) { var customEventInit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var event = new CustomEvent(typeArg, customEventInit); el.dispatchEvent(event); }; /** * Scroll to ID/Top with smooth scroll behavior. * * @since x.x.x * * @param {Event} e Event which is been fired. * @param {String} top offset from top. */ astraSmoothScroll = function astraSmoothScroll( e, top ) { e.preventDefault(); window.scrollTo({ top: top, left: 0, behavior: 'smooth' }); }; /** * Scroll to Top trigger visibility adjustments. * * @since x.x.x * * @param {Node} masthead Page header. * @param {Node} astScrollTop Scroll to Top selector. */ astScrollToTopHandler = function ( masthead, astScrollTop ) { var content = getComputedStyle(astScrollTop).content, device = astScrollTop.dataset.onDevices; content = content.replace( /[^0-9]/g, '' ); if( 'both' == device || ( 'desktop' == device && '769' == content ) || ( 'mobile' == device && '' == content ) ) { // Get current window / document scroll. var scrollTop = window.pageYOffset || document.body.scrollTop; // If masthead found. if( masthead && masthead.length ) { if (scrollTop > masthead.offsetHeight + 100) { astScrollTop.style.display = "block"; } else { astScrollTop.style.display = "none"; } } else { // If there is no masthead set default start scroll if ( window.pageYOffset > 300 ) { astScrollTop.style.display = "block"; } else { astScrollTop.style.display = "none"; } } } else { astScrollTop.style.display = "none"; } }; ( function() { var menu_toggle_all = document.querySelectorAll( '.main-header-menu-toggle' ); var menu_click_listeners_nav = {}; /* Add break point Class and related trigger */ var updateHeaderBreakPoint = function () { // Content overrflowing out of screen can give incorrect window.innerWidth. // Adding overflow hidden and then calculating the window.innerWidth fixes the problem. var originalOverflow = document.querySelector('body').style.overflow; document.querySelector('body').style.overflow = 'hidden'; var ww = window.innerWidth; document.querySelector('body').style.overflow = originalOverflow; var break_point = astra.break_point, headerWrap = document.querySelectorAll('.main-header-bar-wrap'); if (headerWrap.length > 0) { for (var i = 0; i < headerWrap.length; i++) { if (headerWrap[i].tagName == 'DIV' && headerWrap[i].classList.contains('main-header-bar-wrap')) { if (ww > break_point) { //remove menu toggled class. if (null != menu_toggle_all[i]) { menu_toggle_all[i].classList.remove('toggled'); } document.body.classList.remove("ast-header-break-point"); document.body.classList.add("ast-desktop"); astraTriggerEvent(document.body, "astra-header-responsive-enabled"); } else { document.body.classList.add("ast-header-break-point"); document.body.classList.remove("ast-desktop"); astraTriggerEvent(document.body, "astra-header-responsive-disabled") } } } } } updateHeaderBreakPoint(); AstraToggleSubMenu = function() { var parent_li = this.parentNode; if (parent_li.classList.contains('ast-submenu-expanded') && document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link")) { if (!this.classList.contains('ast-menu-toggle')) { var link = parent_li.querySelector('a').getAttribute('href'); if ('' !== link || '#' !== link) { window.location = link; } } } var parent_li_child = parent_li.querySelectorAll('.menu-item-has-children'); for (var j = 0; j < parent_li_child.length; j++) { parent_li_child[j].classList.remove('ast-submenu-expanded'); var parent_li_child_sub_menu = parent_li_child[j].querySelector('.sub-menu, .children'); if( null !== parent_li_child_sub_menu ) { parent_li_child_sub_menu.style.display = 'none'; } } var parent_li_sibling = parent_li.parentNode.querySelectorAll('.menu-item-has-children'); for (var j = 0; j < parent_li_sibling.length; j++) { if (parent_li_sibling[j] != parent_li) { parent_li_sibling[j].classList.remove('ast-submenu-expanded'); var all_sub_menu = parent_li_sibling[j].querySelectorAll('.sub-menu'); for (var k = 0; k < all_sub_menu.length; k++) { all_sub_menu[k].style.display = 'none'; } } } if (parent_li.classList.contains('menu-item-has-children') ) { astraToggleClass(parent_li, 'ast-submenu-expanded'); if (parent_li.classList.contains('ast-submenu-expanded')) { parent_li.querySelector('.sub-menu').style.display = 'block'; } else { parent_li.querySelector('.sub-menu').style.display = 'none'; } } }; AstraNavigationMenu = function( parentList ) { console.warn( 'AstraNavigationMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future.' ); }; AstraToggleMenu = function( astra_menu_toggle ) { console.warn('AstraToggleMenu() function has been deprecated since version 1.6.5 or above of Astra Theme and will be removed in the future. Use AstraToggleSubMenu() instead.'); // Add Eventlisteners for Submenu. if (astra_menu_toggle.length > 0) { for (var i = 0; i < astra_menu_toggle.length; i++) { astra_menu_toggle[i].removeEventListener('click', AstraToggleSubMenu); astra_menu_toggle[i].addEventListener('click', AstraToggleSubMenu, false); } } }; AstraToggleSetup = function () { var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); if (menu_toggle_all.length > 0) { for (var i = 0; i < menu_toggle_all.length; i++) { menu_toggle_all[i].setAttribute('data-index', i); if ( ! menu_click_listeners_nav[i] ) { menu_click_listeners_nav[i] = menu_toggle_all[i]; menu_toggle_all[i].removeEventListener('click', astraNavMenuToggle); menu_toggle_all[i].addEventListener('click', astraNavMenuToggle, false); } if ('undefined' !== typeof __main_header_all[i]) { if (document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link")) { var astra_menu_toggle = __main_header_all[i].querySelectorAll('.ast-header-break-point .main-header-menu .menu-item-has-children > .menu-link, .ast-header-break-point ul.main-header-menu .ast-menu-toggle'); } else { var astra_menu_toggle = __main_header_all[i].querySelectorAll('ul.main-header-menu .ast-menu-toggle'); } // Add Eventlisteners for Submenu. if (astra_menu_toggle.length > 0) { for (var j = 0; j < astra_menu_toggle.length; j++) { astra_menu_toggle[j].removeEventListener('click', AstraToggleSubMenu); astra_menu_toggle[j].addEventListener('click', AstraToggleSubMenu, false); } } } } } }; astraNavMenuToggle = function ( event ) { event.preventDefault(); var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); var event_index = this.getAttribute('data-index'); if ('undefined' === typeof __main_header_all[event_index]) { return false; } var menuHasChildren = __main_header_all[event_index].querySelectorAll('.menu-item-has-children'); for (var i = 0; i < menuHasChildren.length; i++) { menuHasChildren[i].classList.remove('ast-submenu-expanded'); var menuHasChildrenSubMenu = menuHasChildren[i].querySelectorAll('.sub-menu'); for (var j = 0; j < menuHasChildrenSubMenu.length; j++) { menuHasChildrenSubMenu[j].style.display = 'none'; } } var menu_class = this.getAttribute('class') || ''; if ( menu_class.indexOf('main-header-menu-toggle') !== -1 ) { astraToggleClass(__main_header_all[event_index], 'toggle-on'); astraToggleClass(menu_toggle_all[event_index], 'toggled'); if (__main_header_all[event_index].classList.contains('toggle-on')) { __main_header_all[event_index].style.display = 'block'; document.body.classList.add("ast-main-header-nav-open"); } else { __main_header_all[event_index].style.display = ''; document.body.classList.remove("ast-main-header-nav-open"); } } }; document.body.addEventListener("astra-header-responsive-enabled", function () { var __main_header_all = document.querySelectorAll('.main-header-bar-navigation'); if (__main_header_all.length > 0) { for (var i = 0; i < __main_header_all.length; i++) { if (null != __main_header_all[i]) { __main_header_all[i].classList.remove('toggle-on'); __main_header_all[i].style.display = ''; } var sub_menu = __main_header_all[i].getElementsByClassName('sub-menu'); for (var j = 0; j < sub_menu.length; j++) { sub_menu[j].style.display = ''; } var child_menu = __main_header_all[i].getElementsByClassName('children'); for (var k = 0; k < child_menu.length; k++) { child_menu[k].style.display = ''; } var searchIcons = __main_header_all[i].getElementsByClassName('ast-search-menu-icon'); for (var l = 0; l < searchIcons.length; l++) { searchIcons[l].classList.remove('ast-dropdown-active'); searchIcons[l].style.display = ''; } } } }, false); window.addEventListener('resize', function () { // Skip resize event when keyboard display event triggers on devices. if( 'INPUT' !== document.activeElement.tagName ) { updateHeaderBreakPoint(); AstraToggleSetup(); } }); document.addEventListener('DOMContentLoaded', function () { AstraToggleSetup(); /** * Navigation Keyboard Navigation. */ var container, count; container = document.querySelectorAll( '.navigation-accessibility' ); for ( count = 0; count <= container.length - 1; count++ ) { if ( container[count] ) { navigation_accessibility( container[count] ); } } }); var get_browser = function () { var ua = navigator.userAgent,tem,M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; if(/trident/i.test(M[1])) { tem = /\brv[ :]+(\d+)/g.exec(ua) || []; return; } if( 'Chrome' === M[1] ) { tem = ua.match(/\bOPR|Edge\/(\d+)/) if(tem != null) { return; } } M = M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?']; if((tem = ua.match(/version\/(\d+)/i)) != null) { M.splice(1,1,tem[1]); } var bodyElement = document.body; if( 'Safari' === M[0] && M[1] < 11 ) { bodyElement.classList.add( "ast-safari-browser-less-than-11" ); } } get_browser(); /* Search Script */ var SearchIcons = document.getElementsByClassName( 'astra-search-icon' ); for (var i = 0; i < SearchIcons.length; i++) { SearchIcons[i].onclick = function(event) { if ( this.classList.contains( 'slide-search' ) ) { event.preventDefault(); var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' ); if ( ! sibling.classList.contains( 'ast-dropdown-active' ) ) { sibling.classList.add( 'ast-dropdown-active' ); sibling.querySelector( '.search-field' ).setAttribute('autocomplete','off'); setTimeout(function() { sibling.querySelector( '.search-field' ).focus(); },200); } else { var searchTerm = sibling.querySelector( '.search-field' ).value || ''; if( '' !== searchTerm ) { sibling.querySelector( '.search-form' ).submit(); } sibling.classList.remove( 'ast-dropdown-active' ); } } } } var SearchInputs = document.querySelectorAll( '.search-field' ); SearchInputs.forEach(input => { input.addEventListener('focus', function (e) { var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' ); astraToggleClass( sibling, 'ast-dropdown-active' ); }); input.addEventListener('blur', function (e) { var sibling = this.parentNode.parentNode.parentNode.querySelector( '.ast-search-menu-icon' ); sibling.classList.remove( 'ast-dropdown-active' ); astraToggleClass( sibling, 'ast-dropdown-active' ); }); }); /* Hide Dropdown on body click*/ document.body.onclick = function( event ) { if ( typeof event.target.classList !== 'undefined' ) { if ( ! event.target.classList.contains( 'ast-search-menu-icon' ) && astraGetParents( event.target, '.ast-search-menu-icon' ).length === 0 && astraGetParents( event.target, '.ast-search-icon' ).length === 0 ) { var dropdownSearchWrap = document.getElementsByClassName( 'ast-search-menu-icon' ); for (var i = 0; i < dropdownSearchWrap.length; i++) { dropdownSearchWrap[i].classList.remove( 'ast-dropdown-active' ); } } } } /** * Navigation Keyboard Navigation. */ function navigation_accessibility( container ) { if ( ! container ) { return; } var button = container.getElementsByTagName( 'button' )[0]; if ( 'undefined' === typeof button ) { button = container.getElementsByTagName( 'a' )[0]; if ( 'undefined' === typeof button ) { return; } } var menu = container.getElementsByTagName( 'ul' )[0]; // Hide menu toggle button if menu is empty and return early. if ( 'undefined' === typeof menu ) { button.style.display = 'none'; return; } menu.setAttribute( 'aria-expanded', 'false' ); if ( -1 === menu.className.indexOf( 'nav-menu' ) ) { menu.className += ' nav-menu'; } button.onclick = function() { if ( -1 !== container.className.indexOf( 'toggled' ) ) { container.className = container.className.replace( ' toggled', '' ); button.setAttribute( 'aria-expanded', 'false' ); menu.setAttribute( 'aria-expanded', 'false' ); } else { container.className += ' toggled'; button.setAttribute( 'aria-expanded', 'true' ); menu.setAttribute( 'aria-expanded', 'true' ); } }; // Get all the link elements within the menu. var links = menu.getElementsByTagName( 'a' ); var subMenus = menu.getElementsByTagName( 'ul' ); // Set menu items with submenus to aria-haspopup="true". for ( var i = 0, len = subMenus.length; i < len; i++ ) { subMenus[i].parentNode.setAttribute( 'aria-haspopup', 'true' ); } // Each time a menu link is focused or blurred, toggle focus. for ( i = 0, len = links.length; i < len; i++ ) { links[i].addEventListener( 'focus', toggleFocus, true ); links[i].addEventListener( 'blur', toggleBlurFocus, true ); links[i].addEventListener( 'click', toggleClose, true ); } } /** * Close the Toggle Menu on Click on hash (#) link. * * @since 1.3.2 * @return void */ function toggleClose( ) { var self = this || '', hash = '#'; if( self && ! self.classList.contains('astra-search-icon') ) { var link = String( self ); if( link.indexOf( hash ) !== -1 ) { var link_parent = self.parentNode; if ( document.body.classList.contains('ast-header-break-point') && ! ( document.querySelector("header.site-header").classList.contains("ast-menu-toggle-link") && link_parent.classList.contains("menu-item-has-children") ) ) { /* Close Main Header Menu */ var main_header_menu_toggle = document.querySelector( '.main-header-menu-toggle' ); main_header_menu_toggle.classList.remove( 'toggled' ); var main_header_bar_navigation = document.querySelector( '.main-header-bar-navigation' ); main_header_bar_navigation.classList.remove( 'toggle-on' ); main_header_bar_navigation.style.display = 'none'; /* Close Below Header Menu */ var before_header_menu_toggle = document.querySelector( '.menu-below-header-toggle' ); var before_header_bar_navigation = document.querySelector( '.ast-below-header' ); var before_header_bar = document.querySelector( '.ast-below-header-actual-nav' ); if ( before_header_menu_toggle && before_header_bar_navigation && before_header_bar ) { before_header_menu_toggle.classList.remove( 'toggled' ); before_header_bar_navigation.classList.remove( 'toggle-on' ); before_header_bar.style.display = 'none'; } /* Close After Header Menu */ var after_header_menu_toggle = document.querySelector( '.menu-above-header-toggle' ); var after_header_bar_navigation = document.querySelector( '.ast-above-header' ); var after_header_bar = document.querySelector( '.ast-above-header-navigation' ); if ( after_header_menu_toggle && after_header_bar_navigation && after_header_bar ) { after_header_menu_toggle.classList.remove( 'toggled' ); after_header_bar_navigation.classList.remove( 'toggle-on' ); after_header_bar.style.display = 'none'; } astraTriggerEvent( document.querySelector('body'), 'astraMenuHashLinkClicked' ); } else { while ( -1 === self.className.indexOf( 'nav-menu' ) ) { // On li elements toggle the class .focus. if ( 'li' === self.tagName.toLowerCase() ) { if ( -1 !== self.className.indexOf( 'focus' ) ) { self.className = self.className.replace( ' focus', '' ); } } self = self.parentElement; } } } } } /** * Sets or removes .focus class on an element and its ancestors until a specific class is found. * @param {Element} element - The element to apply the .focus class and traverse its ancestors. * @param {string} targetClass - The class name to search for in the ancestors. */ function toggleFocusAndAncestors(element, targetClass) { while (-1 === element.className.indexOf(targetClass)) { if ('li' === element.tagName.toLowerCase()) { if (element.classList.contains('focus')) { element.classList.remove('focus'); } else { element.classList.add('focus'); } } element = element.parentElement; } } /** * Sets or removes .focus class on an element on focus. */ function toggleFocus() { var self = this; toggleFocusAndAncestors(self, 'nav-menu'); } /** * Sets or removes .focus class on an element on blur. */ function toggleBlurFocus() { var self = this || '', hash = '#'; var link = String(self); if (link.includes(hash) && document.body.classList.contains('ast-mouse-clicked')) { return; } toggleFocusAndAncestors(self, 'nav-menu'); } /* Add class if mouse clicked and remove if tab pressed */ if ( 'querySelector' in document && 'addEventListener' in window ) { var body = document.body; body.addEventListener( 'mousedown', function() { body.classList.add( 'ast-mouse-clicked' ); } ); body.addEventListener( 'keydown', function() { body.classList.remove( 'ast-mouse-clicked' ); } ); } /** * Scroll to specific hash link. * * @since x.x.x */ if ( astra.is_scroll_to_id ) { // Calculate the offset top of an element, accounting for nested elements. const getOffsetTop = (element) => { let offsetTop = 0; while (element) { offsetTop += element.offsetTop; element = element.offsetParent; } return offsetTop; } const scrollToIDHandler = ( e, hash = null ) => { let offset = 0; const siteHeader = document.querySelector('.site-header'); if (siteHeader) { // Check and add offset to scroll top if header is sticky. const stickyHeaders = siteHeader.querySelectorAll( 'div[data-stick-support]' ); if ( stickyHeaders.length > 0 ) { stickyHeaders.forEach( ( header ) => ( offset += header.clientHeight ) ); } else if ( typeof astraAddon !== 'undefined' && ! ( Number( astraAddon.sticky_hide_on_scroll ) && ! document?.querySelector( '.ast-header-sticked' ) ) ) { const fixedHeader = document.querySelector( '#ast-fixed-header' ); if ( fixedHeader ) { offset = fixedHeader?.clientHeight; if ( Number( astraAddon?.header_main_shrink ) ) { const headers = fixedHeader?.querySelectorAll( '.ast-above-header-wrap, .ast-below-header-wrap' ); headers?.forEach( () => ( offset -= 10 ) ); } } } const href = hash ? hash : e.target?.closest( 'a' ).hash; if (href) { const scrollId = document.querySelector(href); if (scrollId) { const elementOffsetTop = getOffsetTop( scrollId ); if ( typeof astraAddon !== 'undefined' && Number( astraAddon.sticky_hide_on_scroll ) && window?.scrollY < elementOffsetTop ) { offset = 0; } const scrollOffsetTop = elementOffsetTop - offset; if( scrollOffsetTop ) { astraSmoothScroll( e, scrollOffsetTop ); } } } } } let hashLinks = []; const links = document.querySelectorAll( 'a[href*="#"]:not([href="#"]):not([href="#0"]):not([href*="uagb-tab"]):not(.uagb-toc-link__trigger):not(.skip-link):not(.nav-links a):not([href*="tab-"])' ); if (links) { for (const link of links) { if (link.href.split("#")[0] !== location.href.split("#")[0]) { // Store the hash hashLinks.push({ hash: link.hash, url: link.href.split("#")[0], }); } else if (link.hash !== "") { link.addEventListener("click", scrollToIDHandler); } } } window.addEventListener('DOMContentLoaded', (event) => { for (let link of hashLinks) { if (window.location.href.split('#')[0] === link.url) { const siteHeader = document.querySelector('.site-header'); let offset = 0; // Check and add offset to scroll top if header is sticky. const headerHeight = siteHeader.querySelectorAll('div[data-stick-support]'); if (headerHeight) { headerHeight.forEach(single => { offset += single.clientHeight; }); } const scrollId = document.querySelector(link.hash); if (scrollId) { const scrollOffsetTop = getOffsetTop(scrollId) - offset; if (scrollOffsetTop) { astraSmoothScroll(event, scrollOffsetTop); } } } } // If there is a hash in the URL when the page loads, scroll to that element after a short delay. if ( location.hash ) { setTimeout( () => scrollToIDHandler( new Event( 'click' ), location.hash ), 750 ); } }); } /** * Scroll to top. * * @since x.x.x */ if ( astra.is_scroll_to_top ) { var masthead = document.querySelector( '#page header' ); var astScrollTop = document.getElementById( 'ast-scroll-top' ); astScrollToTopHandler(masthead, astScrollTop); window.addEventListener('scroll', function () { astScrollToTopHandler(masthead, astScrollTop); }); astScrollTop.onclick = function(e){ astraSmoothScroll( e, 0 ); }; } } )(); PK Wj[:�U��+ �+ add-to-cart-quantity-btn.jsnu �[��� /** * WooCommerce quantity buttons. * * @since x.x.x */ window.addEventListener( "load", function(e) { astrawpWooQuantityButtons(); quantityInput(); }); // Here we are selecting the node that will be observed for mutations. const astraminiCarttargetNodes = document.querySelectorAll(".ast-site-header-cart"); astraminiCarttargetNodes.forEach(function(astraminiCarttargetNode) { if (astraminiCarttargetNode != null) { const config = { attributes: false, childList: true, subtree: true }; const astraMinicartObserver = () => { astrawpWooQuantityButtons(); quantityInput(); }; const observer = new MutationObserver(astraMinicartObserver); observer.observe(astraminiCarttargetNode, config); } }); /**This comment explains that in order to refresh the wc_fragments_refreshed event when an AJAX call is made, jQuery is used to update the quantity button. * Here plain JavaScript may not be able to trigger the wc_fragments_refreshed event in the same way, * hence the need to use jQuery */ jQuery( function( $ ) { $( document.body ).on( 'wc_fragments_refreshed', function() { astrawpWooQuantityButtons(); quantityInput(); }); }); (function() { // Delay the method override so that we do not interfere with the Metrix test. setTimeout(() => { var send = XMLHttpRequest.prototype.send XMLHttpRequest.prototype.send = function() { this.addEventListener('load', function() { astrawpWooQuantityButtons(); }) return send.apply(this, arguments) } }, 2000); })(); /** * Astra WooCommerce Quantity Buttons. */ function astrawpWooQuantityButtons( $quantitySelector ) { var $cart = document.querySelector( '.woocommerce div.product form.cart' ); if ( ! $quantitySelector ) { $quantitySelector = '.qty'; } $quantityBoxesWrap = document.querySelectorAll( 'div.quantity:not(.elementor-widget-woocommerce-cart .quantity):not(.buttons_added), td.quantity:not(.elementor-widget-woocommerce-cart .quantity):not(.buttons_added)' ); for ( var i = 0; i < $quantityBoxesWrap.length; i++ ) { var e = $quantityBoxesWrap[i]; var $quantityBoxes = e.querySelector( $quantitySelector ); if ( $quantityBoxes && 'date' !== $quantityBoxes.getAttribute( 'type' ) && 'hidden' !== $quantityBoxes.getAttribute( 'type' ) ) { // Add plus and minus icons. $qty_parent = $quantityBoxes.parentElement; $qty_parent.classList.add( 'buttons_added' ); const minusBtn = `<span class="screen-reader-text">${ astra_qty_btn.minus_qty }</span><a href="javascript:void(0)" id="minus_qty-${ i }" class="minus %s">-</a>`; const plusBtn = `<span class="screen-reader-text">${ astra_qty_btn.plus_qty }</span><a href="javascript:void(0)" id="plus_qty-${ i }" class="plus %s">+</a>`; if ( 'vertical-icon' === astra_qty_btn.style_type ) { $qty_parent.classList.add( 'ast-vertical-style-applied' ); $quantityBoxes.classList.add( 'vertical-icons-applied' ); $qty_parent.insertAdjacentHTML( 'beforeend', minusBtn.replace( '%s', 'ast-vertical-icon' ) + plusBtn.replace( '%s', 'ast-vertical-icon' ) ); } else { let styleTypeClass = ''; if ( 'no-internal-border' === astra_qty_btn.style_type ) { $quantityBoxes.classList.add( 'ast-no-internal-border' ); styleTypeClass = 'no-internal-border'; } $qty_parent.insertAdjacentHTML( 'afterbegin', minusBtn.replace( '%s', styleTypeClass ) ); $qty_parent.insertAdjacentHTML( 'beforeend', plusBtn.replace( '%s', styleTypeClass ) ); } $quantityEach = document.querySelectorAll( 'input' + $quantitySelector + ':not(.product-quantity)' ); for ( var j = 0; j < $quantityEach.length; j++ ) { var el = $quantityEach[j]; var $min = el.getAttribute( 'min' ); if ( $min && $min > 0 && parseFloat( el.value ) < $min ) { el.value = $min; } } // Quantity input. let objbody = document.getElementsByTagName('BODY')[0]; let cart = document.getElementsByClassName('cart')[0]; if (objbody.classList.contains('single-product') && !cart.classList.contains('grouped_form')) { let quantityInput = document.querySelector('.woocommerce input[type=number].qty'); // Check for single product page. if (quantityInput) { quantityInput.addEventListener('keyup', function () { let qtyVal = quantityInput.value; quantityInput.value = qtyVal; }); } } var plus_minus_obj = e.querySelectorAll( '.plus, .minus' ); for ( var l = 0; l < plus_minus_obj.length; l++ ) { var pm_el = plus_minus_obj[l]; pm_el.addEventListener( "click", function(ev) { // Quantity. var $quantityBox; $quantityBox = ev.target.parentElement.querySelector( $quantitySelector ); // Get values. var $currentQuantity = parseFloat( $quantityBox.value ), $maxQuantity = parseFloat( $quantityBox.getAttribute( 'max' ) ), $minQuantity = parseFloat( $quantityBox.getAttribute( 'min' ) ), $step = parseFloat( $quantityBox.getAttribute( 'step' ) ), checkStepInteger = Number.isInteger( $step ), finalValue; // Fallback default values on falsy values like '' and NaN. if ( ! $currentQuantity ) { $currentQuantity = 0; } if ( ! $maxQuantity ) { $maxQuantity = ''; } if ( ! $minQuantity ) { $minQuantity = 0; } if ( ! $step ) { $step = 1; } // Change the value. if ( ev.target.classList.contains( 'plus' ) ) { if ( $maxQuantity && ( $maxQuantity === $currentQuantity || $currentQuantity > Number( $maxQuantity ) ) ) { $quantityBox.value = $maxQuantity; } else { finalValue = $currentQuantity + parseFloat( $step ); $quantityBox.value = checkStepInteger ? finalValue : ( finalValue ).toFixed(1); } } else { if ( $minQuantity && ( $minQuantity === $currentQuantity || $currentQuantity < $minQuantity ) ) { $quantityBox.value = $minQuantity; } else if ( $currentQuantity > 0 ) { finalValue = $currentQuantity - parseFloat( $step ); $quantityBox.value = checkStepInteger ? finalValue : ( finalValue ).toFixed(1); } } // Trigger the change event on the input. var changeEvent = new Event('change', { bubbles: true }); $quantityBox.dispatchEvent(changeEvent); // Trigger change event. var update_cart_btn = document.getElementsByName("update_cart"); if (update_cart_btn.length > 0) { for ( var btn = 0; btn < update_cart_btn.length; btn++ ) { update_cart_btn[btn].disabled = false; update_cart_btn[btn].click(); } } const quantity = $quantityBox.value; const itemHash = $quantityBox.getAttribute('name').replace(/cart\[([\w]+)\]\[qty\]/g, '$1'); sendAjaxQuantityRequest(ev.currentTarget, quantity, itemHash) }, false); } } } } function sendAjaxQuantityRequest(currentTarget, quantity, itemHash ) { // Send AJAX request from mini cart. const miniCart = currentTarget.closest( '.woocommerce-mini-cart' ); if ( miniCart && astra && astra.single_product_qty_ajax_nonce && astra.ajax_url ) { let qtyNonce = astra.single_product_qty_ajax_nonce; miniCart.classList.add('ajax-mini-cart-qty-loading'); // Creating a XMLHttpRequest object. let xhrRequest = new XMLHttpRequest(); xhrRequest.open( 'POST', astra.ajax_url, true ); // Send the proper header information along with the request xhrRequest.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded" ); xhrRequest.send( 'action=astra_add_cart_single_product_quantity&hash=' + itemHash + '&quantity=' + quantity + '&qtyNonce=' + qtyNonce ); xhrRequest.onload = function () { if ( xhrRequest.readyState == XMLHttpRequest.DONE ) { // XMLHttpRequest.DONE == 4 if ( 200 <= xhrRequest.status || 400 <= xhrRequest.status ) { // Trigger event so themes can refresh other areas. var event = document.createEvent( 'HTMLEvents' ); event.initEvent( 'wc_fragment_refresh', true, false ); document.body.dispatchEvent(event); setTimeout(() => { miniCart.classList.remove('ajax-mini-cart-qty-loading'); }, 500); if ( typeof wc_add_to_cart_params === 'undefined' ) { return; } } } }; } } let typingTimer; //timer identifier let doneTypingInterval = 500; function quantityInput() { const quantityInputContainer = document.querySelector('.woocommerce-mini-cart'); if( quantityInputContainer ) { const quantityInput = document.querySelectorAll('.input-text.qty'); quantityInput.forEach( single => { single.addEventListener('keyup', (e) => { if ( e.key === 'Tab' || e.keyCode === 9 ) { return; } clearTimeout(typingTimer); if (single.value) { typingTimer = setTimeout(() => { const quantity = e.target.value; const itemHash = e.target.getAttribute('name').replace(/cart\[([\w]+)\]\[qty\]/g, '$1'); if( quantity ) { sendAjaxQuantityRequest(e.target, quantity,itemHash); } }, doneTypingInterval); } }); }); } }PK Wj[�|Q�� � style-guide-previewer.jsnu �[��� /** * Astra Theme Style Guide Preview Updater. * * @package Astra * @since x.x.x */ (function($) { /** * Quick easy navigation. */ jQuery(document).ready(function($) { document.addEventListener('AstraStyleGuideElementUpdated', function (e) { let element = $(document.body).find( e.detail.selector ); let value = e.detail.value; // Check if value is an object or else set the value. if ( typeof value === 'object' ) { let desktopValue = value.desktop; let tabletValue = value.tablet; let mobileValue = value.mobile; element.find( '.ast-sg-desktop' ).html( desktopValue ); element.find( '.ast-sg-tablet' ).html( tabletValue ); element.find( '.ast-sg-mobile' ).html( mobileValue ); } else { element.html( value ); } }); let closeTrigger = $('.ast-close-tour'); closeTrigger.on('click', function(e) { e.preventDefault(); e.stopPropagation(); $( document.body ).removeClass('ast-sg-loaded'); }); }); })(jQuery); PK Wj[�Ud��d �d flexibility.jsnu �[��� /** * Flexibility is a JavaScript polyfill for Flexbox By Jonathan Neal, 10up. (https://github.com/jonathantneal/flexibility) * Licensed under MIT ( https://github.com/jonathantneal/flexibility/blob/master/LICENSE.md ) */ ! function(e) { if ("object" == typeof exports && "undefined" != typeof module) module.exports = e(); else if ("function" == typeof define && define.amd) define([], e); else { var t; t = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this, t.flexibility = e() } }(function() { return function e(t, r, l) { function n(f, i) { if (!r[f]) { if (!t[f]) { var s = "function" == typeof require && require; if (!i && s) return s(f, !0); if (o) return o(f, !0); var a = new Error("Cannot find module '" + f + "'"); throw a.code = "MODULE_NOT_FOUND", a } var c = r[f] = { exports: {} }; t[f][0].call(c.exports, function(e) { var r = t[f][1][e]; return n(r ? r : e) }, c, c.exports, e, t, r, l) } return r[f].exports } for (var o = "function" == typeof require && require, f = 0; f < l.length; f++) n(l[f]); return n }({ 1: [function(e, t, r) { t.exports = function(e) { var t, r, l, n = -1; if (e.lines.length > 1 && "flex-start" === e.style.alignContent) for (t = 0; l = e.lines[++n];) l.crossStart = t, t += l.cross; else if (e.lines.length > 1 && "flex-end" === e.style.alignContent) for (t = e.flexStyle.crossSpace; l = e.lines[++n];) l.crossStart = t, t += l.cross; else if (e.lines.length > 1 && "center" === e.style.alignContent) for (t = e.flexStyle.crossSpace / 2; l = e.lines[++n];) l.crossStart = t, t += l.cross; else if (e.lines.length > 1 && "space-between" === e.style.alignContent) for (r = e.flexStyle.crossSpace / (e.lines.length - 1), t = 0; l = e.lines[++n];) l.crossStart = t, t += l.cross + r; else if (e.lines.length > 1 && "space-around" === e.style.alignContent) for (r = 2 * e.flexStyle.crossSpace / (2 * e.lines.length), t = r / 2; l = e.lines[++n];) l.crossStart = t, t += l.cross + r; else for (r = e.flexStyle.crossSpace / e.lines.length, t = e.flexStyle.crossInnerBefore; l = e.lines[++n];) l.crossStart = t, l.cross += r, t += l.cross } }, {}], 2: [function(e, t, r) { t.exports = function(e) { for (var t, r = -1; line = e.lines[++r];) for (t = -1; child = line.children[++t];) { var l = child.style.alignSelf; "auto" === l && (l = e.style.alignItems), "flex-start" === l ? child.flexStyle.crossStart = line.crossStart : "flex-end" === l ? child.flexStyle.crossStart = line.crossStart + line.cross - child.flexStyle.crossOuter : "center" === l ? child.flexStyle.crossStart = line.crossStart + (line.cross - child.flexStyle.crossOuter) / 2 : (child.flexStyle.crossStart = line.crossStart, child.flexStyle.crossOuter = line.cross, child.flexStyle.cross = child.flexStyle.crossOuter - child.flexStyle.crossBefore - child.flexStyle.crossAfter) } } }, {}], 3: [function(e, t, r) { t.exports = function l(e, l) { var t = "row" === l || "row-reverse" === l, r = e.mainAxis; if (r) { var n = t && "inline" === r || !t && "block" === r; n || (e.flexStyle = { main: e.flexStyle.cross, cross: e.flexStyle.main, mainOffset: e.flexStyle.crossOffset, crossOffset: e.flexStyle.mainOffset, mainBefore: e.flexStyle.crossBefore, mainAfter: e.flexStyle.crossAfter, crossBefore: e.flexStyle.mainBefore, crossAfter: e.flexStyle.mainAfter, mainInnerBefore: e.flexStyle.crossInnerBefore, mainInnerAfter: e.flexStyle.crossInnerAfter, crossInnerBefore: e.flexStyle.mainInnerBefore, crossInnerAfter: e.flexStyle.mainInnerAfter, mainBorderBefore: e.flexStyle.crossBorderBefore, mainBorderAfter: e.flexStyle.crossBorderAfter, crossBorderBefore: e.flexStyle.mainBorderBefore, crossBorderAfter: e.flexStyle.mainBorderAfter }) } else t ? e.flexStyle = { main: e.style.width, cross: e.style.height, mainOffset: e.style.offsetWidth, crossOffset: e.style.offsetHeight, mainBefore: e.style.marginLeft, mainAfter: e.style.marginRight, crossBefore: e.style.marginTop, crossAfter: e.style.marginBottom, mainInnerBefore: e.style.paddingLeft, mainInnerAfter: e.style.paddingRight, crossInnerBefore: e.style.paddingTop, crossInnerAfter: e.style.paddingBottom, mainBorderBefore: e.style.borderLeftWidth, mainBorderAfter: e.style.borderRightWidth, crossBorderBefore: e.style.borderTopWidth, crossBorderAfter: e.style.borderBottomWidth } : e.flexStyle = { main: e.style.height, cross: e.style.width, mainOffset: e.style.offsetHeight, crossOffset: e.style.offsetWidth, mainBefore: e.style.marginTop, mainAfter: e.style.marginBottom, crossBefore: e.style.marginLeft, crossAfter: e.style.marginRight, mainInnerBefore: e.style.paddingTop, mainInnerAfter: e.style.paddingBottom, crossInnerBefore: e.style.paddingLeft, crossInnerAfter: e.style.paddingRight, mainBorderBefore: e.style.borderTopWidth, mainBorderAfter: e.style.borderBottomWidth, crossBorderBefore: e.style.borderLeftWidth, crossBorderAfter: e.style.borderRightWidth }, "content-box" === e.style.boxSizing && ("number" == typeof e.flexStyle.main && (e.flexStyle.main += e.flexStyle.mainInnerBefore + e.flexStyle.mainInnerAfter + e.flexStyle.mainBorderBefore + e.flexStyle.mainBorderAfter), "number" == typeof e.flexStyle.cross && (e.flexStyle.cross += e.flexStyle.crossInnerBefore + e.flexStyle.crossInnerAfter + e.flexStyle.crossBorderBefore + e.flexStyle.crossBorderAfter)); e.mainAxis = t ? "inline" : "block", e.crossAxis = t ? "block" : "inline", "number" == typeof e.style.flexBasis && (e.flexStyle.main = e.style.flexBasis + e.flexStyle.mainInnerBefore + e.flexStyle.mainInnerAfter + e.flexStyle.mainBorderBefore + e.flexStyle.mainBorderAfter), e.flexStyle.mainOuter = e.flexStyle.main, e.flexStyle.crossOuter = e.flexStyle.cross, "auto" === e.flexStyle.mainOuter && (e.flexStyle.mainOuter = e.flexStyle.mainOffset), "auto" === e.flexStyle.crossOuter && (e.flexStyle.crossOuter = e.flexStyle.crossOffset), "number" == typeof e.flexStyle.mainBefore && (e.flexStyle.mainOuter += e.flexStyle.mainBefore), "number" == typeof e.flexStyle.mainAfter && (e.flexStyle.mainOuter += e.flexStyle.mainAfter), "number" == typeof e.flexStyle.crossBefore && (e.flexStyle.crossOuter += e.flexStyle.crossBefore), "number" == typeof e.flexStyle.crossAfter && (e.flexStyle.crossOuter += e.flexStyle.crossAfter) } }, {}], 4: [function(e, t, r) { var l = e("../reduce"); t.exports = function(e) { if (e.mainSpace > 0) { var t = l(e.children, function(e, t) { return e + parseFloat(t.style.flexGrow) }, 0); t > 0 && (e.main = l(e.children, function(r, l) { return "auto" === l.flexStyle.main ? l.flexStyle.main = l.flexStyle.mainOffset + parseFloat(l.style.flexGrow) / t * e.mainSpace : l.flexStyle.main += parseFloat(l.style.flexGrow) / t * e.mainSpace, l.flexStyle.mainOuter = l.flexStyle.main + l.flexStyle.mainBefore + l.flexStyle.mainAfter, r + l.flexStyle.mainOuter }, 0), e.mainSpace = 0) } } }, { "../reduce": 12 }], 5: [function(e, t, r) { var l = e("../reduce"); t.exports = function(e) { if (e.mainSpace < 0) { var t = l(e.children, function(e, t) { return e + parseFloat(t.style.flexShrink) }, 0); t > 0 && (e.main = l(e.children, function(r, l) { return l.flexStyle.main += parseFloat(l.style.flexShrink) / t * e.mainSpace, l.flexStyle.mainOuter = l.flexStyle.main + l.flexStyle.mainBefore + l.flexStyle.mainAfter, r + l.flexStyle.mainOuter }, 0), e.mainSpace = 0) } } }, { "../reduce": 12 }], 6: [function(e, t, r) { var l = e("../reduce"); t.exports = function(e) { var t; e.lines = [t = { main: 0, cross: 0, children: [] }]; for (var r, n = -1; r = e.children[++n];) "nowrap" === e.style.flexWrap || 0 === t.children.length || "auto" === e.flexStyle.main || e.flexStyle.main - e.flexStyle.mainInnerBefore - e.flexStyle.mainInnerAfter - e.flexStyle.mainBorderBefore - e.flexStyle.mainBorderAfter >= t.main + r.flexStyle.mainOuter ? (t.main += r.flexStyle.mainOuter, t.cross = Math.max(t.cross, r.flexStyle.crossOuter)) : e.lines.push(t = { main: r.flexStyle.mainOuter, cross: r.flexStyle.crossOuter, children: [] }), t.children.push(r); e.flexStyle.mainLines = l(e.lines, function(e, t) { return Math.max(e, t.main) }, 0), e.flexStyle.crossLines = l(e.lines, function(e, t) { return e + t.cross }, 0), "auto" === e.flexStyle.main && (e.flexStyle.main = Math.max(e.flexStyle.mainOffset, e.flexStyle.mainLines + e.flexStyle.mainInnerBefore + e.flexStyle.mainInnerAfter + e.flexStyle.mainBorderBefore + e.flexStyle.mainBorderAfter)), "auto" === e.flexStyle.cross && (e.flexStyle.cross = Math.max(e.flexStyle.crossOffset, e.flexStyle.crossLines + e.flexStyle.crossInnerBefore + e.flexStyle.crossInnerAfter + e.flexStyle.crossBorderBefore + e.flexStyle.crossBorderAfter)), e.flexStyle.crossSpace = e.flexStyle.cross - e.flexStyle.crossInnerBefore - e.flexStyle.crossInnerAfter - e.flexStyle.crossBorderBefore - e.flexStyle.crossBorderAfter - e.flexStyle.crossLines, e.flexStyle.mainOuter = e.flexStyle.main + e.flexStyle.mainBefore + e.flexStyle.mainAfter, e.flexStyle.crossOuter = e.flexStyle.cross + e.flexStyle.crossBefore + e.flexStyle.crossAfter } }, { "../reduce": 12 }], 7: [function(e, t, r) { function l(t) { for (var r, l = -1; r = t.children[++l];) e("./flex-direction")(r, t.style.flexDirection); e("./flex-direction")(t, t.style.flexDirection), e("./order")(t), e("./flexbox-lines")(t), e("./align-content")(t), l = -1; for (var n; n = t.lines[++l];) n.mainSpace = t.flexStyle.main - t.flexStyle.mainInnerBefore - t.flexStyle.mainInnerAfter - t.flexStyle.mainBorderBefore - t.flexStyle.mainBorderAfter - n.main, e("./flex-grow")(n), e("./flex-shrink")(n), e("./margin-main")(n), e("./margin-cross")(n), e("./justify-content")(n, t.style.justifyContent, t); e("./align-items")(t) } t.exports = l }, { "./align-content": 1, "./align-items": 2, "./flex-direction": 3, "./flex-grow": 4, "./flex-shrink": 5, "./flexbox-lines": 6, "./justify-content": 8, "./margin-cross": 9, "./margin-main": 10, "./order": 11 }], 8: [function(e, t, r) { t.exports = function(e, t, r) { var l, n, o, f = r.flexStyle.mainInnerBefore, i = -1; if ("flex-end" === t) for (l = e.mainSpace, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter; else if ("center" === t) for (l = e.mainSpace / 2, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter; else if ("space-between" === t) for (n = e.mainSpace / (e.children.length - 1), l = 0, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter + n; else if ("space-around" === t) for (n = 2 * e.mainSpace / (2 * e.children.length), l = n / 2, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter + n; else for (l = 0, l += f; o = e.children[++i];) o.flexStyle.mainStart = l, l += o.flexStyle.mainOuter } }, {}], 9: [function(e, t, r) { t.exports = function(e) { for (var t, r = -1; t = e.children[++r];) { var l = 0; "auto" === t.flexStyle.crossBefore && ++l, "auto" === t.flexStyle.crossAfter && ++l; var n = e.cross - t.flexStyle.crossOuter; "auto" === t.flexStyle.crossBefore && (t.flexStyle.crossBefore = n / l), "auto" === t.flexStyle.crossAfter && (t.flexStyle.crossAfter = n / l), "auto" === t.flexStyle.cross ? t.flexStyle.crossOuter = t.flexStyle.crossOffset + t.flexStyle.crossBefore + t.flexStyle.crossAfter : t.flexStyle.crossOuter = t.flexStyle.cross + t.flexStyle.crossBefore + t.flexStyle.crossAfter } } }, {}], 10: [function(e, t, r) { t.exports = function(e) { for (var t, r = 0, l = -1; t = e.children[++l];) "auto" === t.flexStyle.mainBefore && ++r, "auto" === t.flexStyle.mainAfter && ++r; if (r > 0) { for (l = -1; t = e.children[++l];) "auto" === t.flexStyle.mainBefore && (t.flexStyle.mainBefore = e.mainSpace / r), "auto" === t.flexStyle.mainAfter && (t.flexStyle.mainAfter = e.mainSpace / r), "auto" === t.flexStyle.main ? t.flexStyle.mainOuter = t.flexStyle.mainOffset + t.flexStyle.mainBefore + t.flexStyle.mainAfter : t.flexStyle.mainOuter = t.flexStyle.main + t.flexStyle.mainBefore + t.flexStyle.mainAfter; e.mainSpace = 0 } } }, {}], 11: [function(e, t, r) { var l = /^(column|row)-reverse$/; t.exports = function(e) { e.children.sort(function(e, t) { return e.style.order - t.style.order || e.index - t.index }), l.test(e.style.flexDirection) && e.children.reverse() } }, {}], 12: [function(e, t, r) { function l(e, t, r) { for (var l = e.length, n = -1; ++n < l;) n in e && (r = t(r, e[n], n)); return r } t.exports = l }, {}], 13: [function(e, t, r) { function l(e) { i(f(e)) } var n = e("./read"), o = e("./write"), f = e("./readAll"), i = e("./writeAll"); t.exports = l, t.exports.read = n, t.exports.write = o, t.exports.readAll = f, t.exports.writeAll = i }, { "./read": 15, "./readAll": 16, "./write": 17, "./writeAll": 18 }], 14: [function(e, t, r) { function l(e, t, r) { var l = e[t], f = String(l).match(o); if (!f) { var a = t.match(s); if (a) { var c = e["border" + a[1] + "Style"]; return "none" === c ? 0 : i[l] || 0 } return l } var y = f[1], x = f[2]; return "px" === x ? 1 * y : "cm" === x ? .3937 * y * 96 : "in" === x ? 96 * y : "mm" === x ? .3937 * y * 96 / 10 : "pc" === x ? 12 * y * 96 / 72 : "pt" === x ? 96 * y / 72 : "rem" === x ? 16 * y : n(l, r) } function n(e, t) { f.style.cssText = "border:none!important;clip:rect(0 0 0 0)!important;display:block!important;font-size:1em!important;height:0!important;margin:0!important;padding:0!important;position:relative!important;width:" + e + "!important", t.parentNode.insertBefore(f, t.nextSibling); var r = f.offsetWidth; return t.parentNode.removeChild(f), r } t.exports = l; var o = /^([-+]?\d*\.?\d+)(%|[a-z]+)$/, f = document.createElement("div"), i = { medium: 4, none: 0, thick: 6, thin: 2 }, s = /^border(Bottom|Left|Right|Top)Width$/ }, {}], 15: [function(e, t, r) { function l(e) { var t = { alignContent: "stretch", alignItems: "stretch", alignSelf: "auto", borderBottomStyle: "none", borderBottomWidth: 0, borderLeftStyle: "none", borderLeftWidth: 0, borderRightStyle: "none", borderRightWidth: 0, borderTopStyle: "none", borderTopWidth: 0, boxSizing: "content-box", display: "inline", flexBasis: "auto", flexDirection: "row", flexGrow: 0, flexShrink: 1, flexWrap: "nowrap", justifyContent: "flex-start", height: "auto", marginTop: 0, marginRight: 0, marginLeft: 0, marginBottom: 0, paddingTop: 0, paddingRight: 0, paddingLeft: 0, paddingBottom: 0, maxHeight: "none", maxWidth: "none", minHeight: 0, minWidth: 0, order: 0, position: "static", width: "auto" }, r = e instanceof Element; if (r) { var l = e.hasAttribute("data-style"), i = l ? e.getAttribute("data-style") : e.getAttribute("style") || ""; l || e.setAttribute("data-style", i); var s = window.getComputedStyle && getComputedStyle(e) || {}; f(t, s); var c = e.currentStyle || {}; n(t, c), o(t, i); for (var y in t) t[y] = a(t, y, e); var x = e.getBoundingClientRect(); t.offsetHeight = x.height || e.offsetHeight, t.offsetWidth = x.width || e.offsetWidth } var S = { element: e, style: t }; return S } function n(e, t) { for (var r in e) { var l = r in t; if (l) e[r] = t[r]; else { // Replace uppercase characters with lowercase. var n = r.replace(/[A-Z]/g, "-$&").toLowerCase(), o = n in t; o && (e[r] = t[n]) } } var f = "-js-display" in t; f && (e.display = t["-js-display"]) } function o(e, t) { for (var r; r = i.exec(t);) { // Replace lowercase characters with uppercase. var l = r[1].toLowerCase().replace(/-[a-z]/g, function(e) { return e.slice(1).toUpperCase() }); e[l] = r[2] } } function f(e, t) { for (var r in e) { var l = r in t; l && !s.test(r) && (e[r] = t[r]) } } t.exports = l; var i = /([^\s:;]+)\s*:\s*([^;]+?)\s*(;|$)/g, s = /^(alignSelf|height|width)$/, a = e("./getComputedLength") }, { "./getComputedLength": 14 }], 16: [function(e, t, r) { function l(e) { var t = []; return n(e, t), t } function n(e, t) { for (var r, l = o(e), i = [], s = -1; r = e.childNodes[++s];) { var a = 3 === r.nodeType && !/^\s*$/.test(r.nodeValue); if (l && a) { var c = r; r = e.insertBefore(document.createElement("flex-item"), c), r.appendChild(c) } var y = r instanceof Element; if (y) { var x = n(r, t); if (l) { var S = r.style; S.display = "inline-block", S.position = "absolute", x.style = f(r).style, i.push(x) } } } var m = { element: e, children: i }; return l && (m.style = f(e).style, t.push(m)), m } function o(e) { var t = e instanceof Element, r = t && e.getAttribute("data-style"), l = t && e.currentStyle && e.currentStyle["-js-display"], n = i.test(r) || s.test(l); return n } t.exports = l; var f = e("../read"), i = /(^|;)\s*display\s*:\s*(inline-)?flex\s*(;|$)/i, s = /^(inline-)?flex$/i }, { "../read": 15 }], 17: [function(e, t, r) { function l(e) { o(e); var t = e.element.style, r = "inline" === e.mainAxis ? ["main", "cross"] : ["cross", "main"]; t.boxSizing = "content-box", t.display = "block", t.position = "relative", t.width = n(e.flexStyle[r[0]] - e.flexStyle[r[0] + "InnerBefore"] - e.flexStyle[r[0] + "InnerAfter"] - e.flexStyle[r[0] + "BorderBefore"] - e.flexStyle[r[0] + "BorderAfter"]), t.height = n(e.flexStyle[r[1]] - e.flexStyle[r[1] + "InnerBefore"] - e.flexStyle[r[1] + "InnerAfter"] - e.flexStyle[r[1] + "BorderBefore"] - e.flexStyle[r[1] + "BorderAfter"]); for (var l, f = -1; l = e.children[++f];) { var i = l.element.style, s = "inline" === l.mainAxis ? ["main", "cross"] : ["cross", "main"]; i.boxSizing = "content-box", i.display = "block", i.position = "absolute", "auto" !== l.flexStyle[s[0]] && (i.width = n(l.flexStyle[s[0]] - l.flexStyle[s[0] + "InnerBefore"] - l.flexStyle[s[0] + "InnerAfter"] - l.flexStyle[s[0] + "BorderBefore"] - l.flexStyle[s[0] + "BorderAfter"])), "auto" !== l.flexStyle[s[1]] && (i.height = n(l.flexStyle[s[1]] - l.flexStyle[s[1] + "InnerBefore"] - l.flexStyle[s[1] + "InnerAfter"] - l.flexStyle[s[1] + "BorderBefore"] - l.flexStyle[s[1] + "BorderAfter"])), i.top = n(l.flexStyle[s[1] + "Start"]), i.left = n(l.flexStyle[s[0] + "Start"]), i.marginTop = n(l.flexStyle[s[1] + "Before"]), i.marginRight = n(l.flexStyle[s[0] + "After"]), i.marginBottom = n(l.flexStyle[s[1] + "After"]), i.marginLeft = n(l.flexStyle[s[0] + "Before"]) } } function n(e) { return "string" == typeof e ? e : Math.max(e, 0) + "px" } t.exports = l; var o = e("../flexbox") }, { "../flexbox": 7 }], 18: [function(e, t, r) { function l(e) { for (var t, r = -1; t = e[++r];) n(t) } t.exports = l; var n = e("../write") }, { "../write": 17 }] }, {}, [13])(13) }); PK Wj[n���� � shop-add-to-cart.jsnu �[��� jQuery(document).ready(function() { jQuery(document.body).on('added_to_cart', function() { const singleProductButton = jQuery('.single_add_to_cart_button'); if (!singleProductButton.hasClass('loading') && astra_shop_add_to_cart.shop_add_to_cart_action) { const slideInCart = jQuery('#astra-mobile-cart-drawer'); if (astra_shop_add_to_cart.elementor_preview_active) { return; } else { if ('slide_in_cart' === astra_shop_add_to_cart.shop_add_to_cart_action && slideInCart.length > 0) { slideInCart.addClass('active'); jQuery('html').addClass('ast-mobile-cart-active'); } if (astra_shop_add_to_cart.is_astra_pro) { if ('redirect_cart_page' === astra_shop_add_to_cart.shop_add_to_cart_action) { window.open(astra_shop_add_to_cart.cart_url, "_self"); } if ('redirect_checkout_page' === astra_shop_add_to_cart.shop_add_to_cart_action) { window.open(astra_shop_add_to_cart.checkout_url, "_self"); } } } } }); });PK Wj[ g 1v v customizer-controls-toggle.jsnu �[��� /** * Customizer controls toggles * * @package Astra */ ( function( $ ) { /** * Trigger hooks */ ASTControlTrigger = { /** * Trigger a hook. * * @since 1.0.0 * @method triggerHook * @param {String} hook The hook to trigger. * @param {Array} args An array of args to pass to the hook. */ triggerHook: function( hook, args ) { $( 'body' ).trigger( 'astra-control-trigger.' + hook, args ); }, /** * Add a hook. * * @since 1.0.0 * @method addHook * @param {String} hook The hook to add. * @param {Function} callback A function to call when the hook is triggered. */ addHook: function( hook, callback ) { $( 'body' ).on( 'astra-control-trigger.' + hook, callback ); }, /** * Remove a hook. * * @since 1.0.0 * @method removeHook * @param {String} hook The hook to remove. * @param {Function} callback The callback function to remove. */ removeHook: function( hook, callback ) { $( 'body' ).off( 'astra-control-trigger.' + hook, callback ); }, }; /** * Helper class that contains data for showing and hiding controls. * * @since 1.0.0 * @class ASTCustomizerToggles */ ASTCustomizerToggles = { 'astra-settings[display-site-title-responsive]' : [], 'astra-settings[display-site-tagline-responsive]' : [], 'astra-settings[ast-header-retina-logo]' :[], 'custom_logo' : [], /** * Section - Header * * @link ?autofocus[section]=section-header */ /** * Layout 2 */ // Layout 2 > Right Section > Text / HTML // Layout 2 > Right Section > Search Type // Layout 2 > Right Section > Search Type > Search Box Type. 'astra-settings[header-main-rt-section]' : [], 'astra-settings[hide-custom-menu-mobile]' :[], /** * Blog */ 'astra-settings[blog-width]' :[], 'astra-settings[blog-post-structure]' :[], /** * Blog Single */ 'astra-settings[blog-single-post-structure]' : [], 'astra-settings[blog-single-width]' : [], 'astra-settings[blog-single-meta]' :[], /** * Small Footer */ 'astra-settings[footer-sml-layout]' : [], 'astra-settings[footer-sml-section-1]' :[], 'astra-settings[footer-sml-section-2]' :[], 'astra-settings[footer-sml-divider]' :[], 'astra-settings[header-main-sep]' :[], 'astra-settings[disable-primary-nav]' :[], /** * Footer Widgets */ 'astra-settings[footer-adv]' :[], 'astra-settings[shop-archive-width]' :[], 'astra-settings[mobile-header-logo]' :[], 'astra-settings[different-mobile-logo]' :[], }; } )( jQuery ); PK Wj[3�x� � frontend-pro.jsnu �[��� /** * File fronend-pro.js * * Handles toggling the navigation menu for Addon widget * * @package Astra */ astraToggleSetupPro = function( mobileHeaderType, body, menu_click_listeners ) { var flag = false; var menuToggleAllLength; if ( 'off-canvas' === mobileHeaderType || 'full-width' === mobileHeaderType ) { // comma separated selector added, if menu is outside of Off-Canvas then submenu is not clickable, it work only for Off-Canvas area with dropdown style. var __main_header_all = document.querySelectorAll( '#ast-mobile-popup, #ast-mobile-header' ); if ( body.classList.contains('ast-header-break-point') ) { var menu_toggle_all = document.querySelectorAll('#ast-mobile-header .main-header-menu-toggle'); } else { menu_toggle_all = document.querySelectorAll('#ast-desktop-header .main-header-menu-toggle'); } menuToggleAllLength = menu_toggle_all.length; } else { if ( body.classList.contains('ast-header-break-point') ) { var __main_header_all = document.querySelectorAll( '#ast-mobile-header' ), menu_toggle_all = document.querySelectorAll( '#ast-mobile-header .main-header-menu-toggle' ); } else { var __main_header_all = document.querySelectorAll( '#ast-desktop-header' ), menu_toggle_all = document.querySelectorAll( '#ast-desktop-header .main-header-menu-toggle' ); } menuToggleAllLength = menu_toggle_all.length; flag = menuToggleAllLength > 0 ? false : true; menuToggleAllLength = flag ? 1 : menuToggleAllLength; } if ( menuToggleAllLength > 0 || flag ) { for (var i = 0; i < menuToggleAllLength; i++) { if ( !flag ) { menu_toggle_all[i].setAttribute('data-index', i); if (!menu_click_listeners[i]) { menu_click_listeners[i] = menu_toggle_all[i]; menu_toggle_all[i].removeEventListener('click', astraNavMenuToggle); menu_toggle_all[i].addEventListener('click', astraNavMenuToggle, false); } } if ('undefined' !== typeof __main_header_all[i]) { // To handle the comma seprated selector added above we need this loop. for( var mainHeaderCount =0; mainHeaderCount < __main_header_all.length; mainHeaderCount++ ){ if (document.querySelector('header.site-header').classList.contains('ast-builder-menu-toggle-link')) { var astra_menu_toggle = __main_header_all[mainHeaderCount].querySelectorAll('ul.main-header-menu .menu-item-has-children > .menu-link, ul.main-header-menu .ast-menu-toggle'); } else { var astra_menu_toggle = __main_header_all[mainHeaderCount].querySelectorAll('ul.main-header-menu .ast-menu-toggle'); } // Add Eventlisteners for Submenu. if (astra_menu_toggle.length > 0) { for (var j = 0; j < astra_menu_toggle.length; j++) { astra_menu_toggle[j].removeEventListener('click', AstraToggleSubMenu); astra_menu_toggle[j].addEventListener('click', AstraToggleSubMenu, false); } } } } } } } astraNavMenuTogglePro = function ( event, body, mobileHeaderType, thisObj ) { event.preventDefault(); var desktop_header = event.target.closest('#ast-desktop-header'); var desktop_header_content = document.querySelector('#masthead > #ast-desktop-header .ast-desktop-header-content'); if ( null !== desktop_header && undefined !== desktop_header && '' !== desktop_header ) { var desktop_toggle = desktop_header.querySelector( '.main-header-menu-toggle' ); } else { var desktop_toggle = document.querySelector('#masthead > #ast-desktop-header .main-header-menu-toggle'); } var desktop_menu = document.querySelector('#masthead > #ast-desktop-header .ast-desktop-header-content .main-header-bar-navigation'); if ( 'desktop' === event.currentTarget.trigger_type ) { if ( null !== desktop_menu && '' !== desktop_menu && undefined !== desktop_menu ) { astraToggleClass(desktop_menu, 'toggle-on'); if (desktop_menu.classList.contains('toggle-on')) { desktop_menu.style.display = 'block'; } else { desktop_menu.style.display = ''; } } astraToggleClass(desktop_toggle, 'toggled'); if ( desktop_toggle.classList.contains( 'toggled' ) ) { body.classList.add("ast-main-header-nav-open"); if ( 'dropdown' === mobileHeaderType ) { desktop_header_content.style.display = 'block'; } } else { body.classList.remove("ast-main-header-nav-open"); desktop_header_content.style.display = 'none'; } return; } var __main_header_all = document.querySelectorAll('#masthead > #ast-mobile-header .main-header-bar-navigation'); menu_toggle_all = document.querySelectorAll( '#masthead > #ast-mobile-header .main-header-menu-toggle' ) var event_index = '0'; var sticky_header = false; if ( null !== thisObj.closest( '#ast-fixed-header' ) ) { __main_header_all = document.querySelectorAll('#ast-fixed-header > #ast-mobile-header .main-header-bar-navigation'); menu_toggle_all = document.querySelectorAll( '#ast-fixed-header .main-header-menu-toggle' ) event_index = '0'; sticky_header = true; } if ('undefined' === typeof __main_header_all[event_index]) { return false; } var menuHasChildren = __main_header_all[event_index].querySelectorAll('.menu-item-has-children'); for (var i = 0; i < menuHasChildren.length; i++) { menuHasChildren[i].classList.remove('ast-submenu-expanded'); var menuHasChildrenSubMenu = menuHasChildren[i].querySelectorAll('.sub-menu'); for (var j = 0; j < menuHasChildrenSubMenu.length; j++) { menuHasChildrenSubMenu[j].style.display = 'none'; } } var menu_class = thisObj.getAttribute('class') || ''; if ( menu_class.indexOf('main-header-menu-toggle') !== -1 ) { astraToggleClass(__main_header_all[event_index], 'toggle-on'); astraToggleClass(menu_toggle_all[event_index], 'toggled'); if ( sticky_header && 1 < menu_toggle_all.length ) { astraToggleClass(menu_toggle_all['1'], 'toggled'); } if (__main_header_all[event_index].classList.contains('toggle-on')) { __main_header_all[event_index].style.display = 'block'; body.classList.add("ast-main-header-nav-open"); } else { __main_header_all[event_index].style.display = ''; body.classList.remove("ast-main-header-nav-open"); } } } PK Wj[D~{m�, �, mobile-cart.jsnu �[��� /** * * Handle Mobile Cart events. * * @since 3.1.0 * @package Astra */ (function () { var cart_flyout = document.getElementById('astra-mobile-cart-drawer'), main_header_masthead = document.getElementById('masthead'), responsive_cart_click = astra_cart.responsive_cart_click; // Variable to store the element that opened the cart var lastFocusedElement = null; // Return if masthead not exixts. if (!main_header_masthead) { return; } var woo_data = '', mobileHeader = main_header_masthead.querySelector("#ast-mobile-header"), edd_data = ''; if (undefined !== cart_flyout && '' !== cart_flyout && null !== cart_flyout) { woo_data = cart_flyout.querySelector('.widget_shopping_cart.woocommerce'); edd_data = cart_flyout.querySelector('.widget_edd_cart_widget'); } /** * Manages focus for accessibility */ const focusManager = { /** * Moves focus to the close button */ moveToCloseButton: function() { var closeButton = document.querySelector('.astra-cart-drawer-close'); if (closeButton) { closeButton.focus(); } }, /** * Returns focus to the triggering element */ returnToTrigger: function() { if (lastFocusedElement) { lastFocusedElement.focus(); } else { // Fallback if we don't have the original element - try multiple selectors var cartIcon = document.querySelector('.ast-header-woo-cart .ast-site-header-cart .ast-site-header-cart-li a.cart-container'); if (!cartIcon) { cartIcon = document.querySelector('.ast-site-header-cart-li a'); } if (!cartIcon) { cartIcon = document.querySelector('.ast-header-woo-cart a'); } if (cartIcon) { cartIcon.focus(); } } }, /** * Sets up a focus trap within the cart flyout */ setupFocusTrap: function() { if (!cart_flyout) return; // Remove any existing event listeners first document.removeEventListener('keydown', this.trapTabKey); // Add the event listener for tab key document.addEventListener('keydown', this.trapTabKey); }, /** * Traps the tab key within the cart flyout */ trapTabKey: function(e) { // Only run if cart flyout is active and tab key is pressed if (!cart_flyout.classList.contains('active') || e.key !== 'Tab') { return; } // Get all focusable elements inside the flyout var focusableElements = cart_flyout.querySelectorAll( 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])' ); // Filter out hidden elements focusableElements = Array.prototype.filter.call(focusableElements, function(element) { return element.offsetWidth > 0 && element.offsetHeight > 0 && window.getComputedStyle(element).visibility !== 'hidden'; }); if (focusableElements.length === 0) return; var firstElement = focusableElements[0]; var lastElement = focusableElements[focusableElements.length - 1]; // If shift+tab on first element, go to last element if (e.shiftKey && document.activeElement === firstElement) { e.preventDefault(); lastElement.focus(); } // If tab on last element, go to first element else if (!e.shiftKey && document.activeElement === lastElement) { e.preventDefault(); firstElement.focus(); } } }; /** * Opens the Cart Flyout. */ cartFlyoutOpen = function (event) { // Store the element that opened the cart for returning focus later lastFocusedElement = event.currentTarget.querySelector('a.cart-container') || event.currentTarget; // Check if responsive_cart_click is "redirect" and body has class "ast-header-break-point" if ((responsive_cart_click === 'redirect' && document.body.classList.contains('ast-header-break-point')) ) { return; } event.preventDefault(); var current_cart = event.currentTarget.cart_type; if ('woocommerce' === current_cart && document.body.classList.contains('woocommerce-cart')) { return; } cart_flyout.classList.remove('active'); cart_flyout.classList.remove('woocommerce-active'); cart_flyout.classList.remove('edd-active'); if (undefined !== cart_flyout && '' !== cart_flyout && null !== cart_flyout) { cart_flyout.classList.add('active'); document.documentElement.classList.add('ast-mobile-cart-active'); if (undefined !== edd_data && '' !== edd_data && null !== edd_data) { edd_data.style.display = 'block'; if ('woocommerce' === current_cart) { edd_data.style.display = 'none'; cart_flyout.classList.add('woocommerce-active'); } } if (undefined !== woo_data && '' !== woo_data && null !== woo_data) { woo_data.style.display = 'block'; if ('edd' === current_cart) { woo_data.style.display = 'none'; cart_flyout.classList.add('edd-active'); } } } document.dispatchEvent( new CustomEvent( "astra_on_slide_In_cart_open", { "detail": {} }) ); // Accessibility improvement: Move focus to close button after cart is opened setTimeout(function() { focusManager.moveToCloseButton(); focusManager.setupFocusTrap(); }, 100); } /** * Closes the Cart Flyout. */ cartFlyoutClose = function (event) { event.preventDefault(); if (undefined !== cart_flyout && '' !== cart_flyout && null !== cart_flyout) { cart_flyout.classList.remove('active'); document.documentElement.classList.remove('ast-mobile-cart-active'); } // Return focus to the element that opened the cart setTimeout(function() { focusManager.returnToTrigger(); }, 100); } /** * Main Init Function. */ function cartInit() { // Close Popup if esc is pressed. document.addEventListener('keyup', function (event) { // 27 is keymap for esc key. if (event.keyCode === 27) { event.preventDefault(); cart_flyout.classList.remove('active'); document.documentElement.classList.remove('ast-mobile-cart-active'); updateTrigger(); // Return focus to the element that opened the cart setTimeout(function() { focusManager.returnToTrigger(); }, 100); } }); // Close Popup on outside click. document.addEventListener('click', function (event) { var target = event.target; var cart_modal = document.querySelector('.ast-mobile-cart-active .astra-mobile-cart-overlay'); if (target === cart_modal) { cart_flyout.classList.remove('active'); document.documentElement.classList.remove('ast-mobile-cart-active'); // Return focus to the element that opened the cart setTimeout(function() { focusManager.returnToTrigger(); }, 100); } }); if (undefined !== mobileHeader && '' !== mobileHeader && null !== mobileHeader) { // Mobile Header Cart Flyout. if( 'flyout' == astra_cart.desktop_layout ) { var woo_carts = document.querySelectorAll('.ast-mobile-header-wrap .ast-header-woo-cart, #ast-desktop-header .ast-desktop-cart-flyout'); } else { var woo_carts = document.querySelectorAll('.ast-mobile-header-wrap .ast-header-woo-cart'); } var edd_cart = document.querySelector('.ast-mobile-header-wrap .ast-header-edd-cart'); var cart_close = document.querySelector('.astra-cart-drawer-close'); if( 0 < woo_carts.length ){ woo_carts.forEach(function callbackFn(woo_cart) { if (undefined !== woo_cart && '' !== woo_cart && null !== woo_cart && cart_flyout) { woo_cart.addEventListener("click", cartFlyoutOpen, false); woo_cart.cart_type = 'woocommerce'; } }) } if (undefined !== edd_cart && '' !== edd_cart && null !== edd_cart && cart_flyout) { edd_cart.addEventListener("click", cartFlyoutOpen, false); edd_cart.cart_type = 'edd'; } if (undefined !== cart_close && '' !== cart_close && null !== cart_close) { cart_close.addEventListener("click", cartFlyoutClose, false); } } // Add keyboard event listeners to cart icons for accessibility var cartIcons = document.querySelectorAll('.ast-site-header-cart .ast-site-header-cart-li a'); if (cartIcons.length > 0) { cartIcons.forEach(function(cartIcon) { cartIcon.addEventListener('keydown', function(e) { if (e.key === 'Enter' || e.keyCode === 13) { e.preventDefault(); // Store this element as the last focused element lastFocusedElement = cartIcon; cartIcon.click(); } }); }); } } // Slide in cart 'astra_woo_slide_in_cart' PRO shortcode compatibility. if(document.querySelector('.ast-slidein-cart')){ document.querySelector('.ast-slidein-cart').addEventListener('click', (e)=> { // Store this element as the last focused element lastFocusedElement = e.currentTarget; document.querySelector('#astra-mobile-cart-drawer').classList.add('active'); document.querySelector('html').classList.add('ast-mobile-cart-active'); e.preventDefault(); // Accessibility improvement: Move focus to close button setTimeout(function() { focusManager.moveToCloseButton(); focusManager.setupFocusTrap(); }, 100); }); } // Get the screen inner width. var screenInnerWidth = window.innerWidth; window.addEventListener('resize', function () { // Close Cart var cart_close = document.querySelector('.astra-cart-drawer-close'); if ( undefined !== cart_close && '' !== cart_close && null !== cart_close && 'INPUT' !== document.activeElement.tagName && cart_flyout.classList.contains( 'active' ) ) { // Get the modified screen inner width. var modifiedInnerWidth = window.innerWidth; if ( modifiedInnerWidth !== screenInnerWidth ) { screenInnerWidth = modifiedInnerWidth; cart_close.click(); } } }); window.addEventListener('load', function () { cartInit(); }); document.addEventListener('astLayoutWidthChanged', function () { cartInit(); }); document.addEventListener('astPartialContentRendered', function () { cartInit(); }); let initialWidth = window.innerWidth; // Store the initial device width. var layoutChangeDelay; window.addEventListener('resize', function () { let newWidth = window.innerWidth; // Get
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings