!function($,undefined){"use strict";window.VAMTAM_FRONT.elementor=window.VAMTAM_FRONT.elementor||{};var VAMTAM_ELEMENTOR={domLoaded:function(){this.VamtamMainNavHandler.init(),this.VamtamActionLinksHandler.init(),this.VamtamPopupsHandler.disablePopupAutoFocus(),elementorFrontend.config.experimentalFeatures.e_optimized_css_loading&&this.VamtamImprovedCSSLoadingHandler.init()},pageLoaded:function(){this.VamtamPopupsHandler.init()},VamtamPopupsHandler:{init:function(){this.searchFormPopupsGetFocus(),this.absolutelyPositionedPopups(),this.alignedWithSelectorPopups(),this.lateInit()},lateInit:function(){setTimeout(()=>{this.hoverActivatedPopups()},50)},searchFormPopupsGetFocus:function(){window.elementorFrontendConfig.kit.vamtam_theme_search_form_popups_get_focus&&elementorFrontend.elements.$window.on("elementor/popup/show",event=>{if(!event.originalEvent)return;const id=event.originalEvent.detail.id,instance=event.originalEvent.detail.instance;if(!id||!instance)return;const popupHasSearchForm=instance.$element.find('form[role="search"]').length;if(popupHasSearchForm){const $input=instance.$element.find('input[type="search"]').first();$input.focus()}})},absolutelyPositionedPopups:function(){const cache=[];elementorFrontend.elements.$window.on("elementor/popup/show",event=>{if(!event.originalEvent)return;const id=event.originalEvent.detail.id,instance=event.originalEvent.detail.instance;if(!id||!instance||cache.includes(id))return;const isAbsPositioned=instance.$element.filter('[data-elementor-settings*="vamtam_abs_pos"]').length;isAbsPositioned&&(instance.$element.closest(`#elementor-popup-modal-${id}`).addClass("vamtam-abs-pos"),cache.push(id))})},alignedWithSelectorPopups:function(){const cache=[],resetCache=()=>{cache.length=0};elementorFrontend.elements.$window.on("elementor/popup/show",event=>{if(!event.originalEvent)return;const id=event.originalEvent.detail.id,instance=event.originalEvent.detail.instance;if(!id||!instance||cache.includes(id))return;const $alignedEl=instance.$element.filter('[data-elementor-settings*="vamtam_align_with_selector"]');if($alignedEl.length){const dialog=instance.$element.closest(".dialog-widget-content"),selector=$alignedEl.data("elementorSettings").open_selector,selectorEl=selector&&$(`${selector}:visible`);if(!selectorEl.length)return;const selectorOffset=selectorEl[0].getBoundingClientRect();window.requestAnimationFrame(()=>{dialog.css({top:selectorOffset.bottom+"px",left:selectorOffset.left+"px"})}),cache.push(id)}}),window.removeEventListener("resize",resetCache),window.addEventListener("resize",resetCache,!0)},disablePopupAutoFocus:function(){elementorFrontend.elements.$window.on("elementor/popup/show elementor/popup/hide",event=>{setTimeout(()=>{"input"!==document.activeElement.nodeName&&document.activeElement.blur()},100)})},hoverActivatedPopups:function(){if(window.elementorFrontend.isEditMode())return;const popups=this.utils.getPopups();if(!popups.length)return;const hoverActivatedPopups=[];function getHoverActivatedPopupBySelector(selector){const $selector=jQuery(selector);if(!$selector.length)return;let popupToReturn;return hoverActivatedPopups.forEach(popup=>{popupToReturn||$selector.filter(popup.selector).length&&(popupToReturn=popup)}),popupToReturn}function getHoverActivatedPopupById(id){let popupToReturn;return hoverActivatedPopups.forEach(popup=>{popupToReturn||popup.id===id&&(popupToReturn=popup)}),popupToReturn}function isValidMouseleave(el,context){return"open_selector"!==context||!jQuery(el).find("*:hover").length}popups.forEach(popup=>{const isHoverActivated=popup.instance.getDocumentSettings().vamtam_open_on_selector_hover;if(isHoverActivated){const openSelector=popup.instance.getDocumentSettings().open_selector,closeOnHoverLost=popup.instance.getDocumentSettings().vamtam_close_on_hover_lost;hoverActivatedPopups.push({id:parseInt(popup.id),selector:openSelector,instance:popup.instance,isHovering:!1,selectorIsHovering:!1,closeOnHoverLost:closeOnHoverLost,modal:popup.instance.getModal(),showPopup:function(){this.instance.showModal(),"input"!==document.activeElement.nodeName&&document.activeElement.blur()},hidePopup:function(){this.modal.hide()},isVisible:function(){return this.modal.isVisible()}})}}),hoverActivatedPopups.length&&hoverActivatedPopups.forEach(popup=>{jQuery(popup.selector).on("mouseenter",(function(){const popup=getHoverActivatedPopupBySelector(this);popup&&(popup.selectorIsHovering=!0,popup.isVisible()||popup.showPopup())})),jQuery(document.body).on("mouseenter",`#elementor-popup-modal-${popup.id} [data-elementor-id="${popup.id}"]`,(function(){const pId=parseInt(jQuery(this).data("elementorId"));if(Number.isInteger(pId)){const popup=getHoverActivatedPopupById(pId);popup&&(popup.isHovering=!0)}})),popup.closeOnHoverLost&&(jQuery(popup.selector).on("mouseleave",(function(){setTimeout(()=>{if(!isValidMouseleave(this,"open_selector"))return;const popup=getHoverActivatedPopupBySelector(this);popup&&(popup.selectorIsHovering=!1,popup.isVisible()&&!popup.isHovering&&popup.hidePopup())},200)})),jQuery(document.body).on("mouseleave",`#elementor-popup-modal-${popup.id} [data-elementor-id="${popup.id}"]`,(function(){setTimeout(()=>{const pId=parseInt(jQuery(this).data("elementorId"));if(Number.isInteger(pId)){const popup=getHoverActivatedPopupById(pId);popup&&(popup.isHovering=!1,popup.selectorIsHovering||popup.hidePopup())}},200)})))})},utils:{getPopups:function(){const docs=elementorFrontend.documentsManager.documents,popups=[];return Object.entries(docs).forEach(([docId,doc])=>{doc.initModal&&(doc.getModal||doc.initModal(),popups.push({id:docId,instance:doc}))}),popups}}},VamtamMainNavHandler:{init:function(){this.fixMenuDrodownScrolling()},fixMenuDrodownScrolling:function(){var $mainMenuDropdown=$(".elementor-location-header .elementor-nav-menu--dropdown-tablet .elementor-nav-menu--dropdown.elementor-nav-menu__container").first(),menuToggle=$mainMenuDropdown.siblings(".elementor-menu-toggle")[0];if($mainMenuDropdown.length&&menuToggle.length){var onMenuToggleClick=function(){if($(menuToggle).hasClass("elementor-active")){var height=$("html").hasClass("ios-safari")?$mainMenuDropdown[0].getBoundingClientRect().top+100:$mainMenuDropdown[0].getBoundingClientRect().top;$mainMenuDropdown.css("max-height","calc(100vh - "+height+"px)"),menuToggle.removeEventListener("click",onMenuToggleClick)}};menuToggle.addEventListener("click",onMenuToggleClick)}}},VamtamActionLinksHandler:{init:function(){this.popupActionLinks()},popupActionLinks:function(){var _self=this,prevIsBelowMax=window.VAMTAM.isBelowMaxDeviceWidth(),alignedPopups=[],handleAlignWithParent=function(popupId,popupParent,clearPrevPos){var popupWrapper=$("#elementor-popup-modal-"+popupId),popup=$(popupWrapper).find(".dialog-widget-content"),adminBarHeight=window.VAMTAM.adminBarHeight;if(popup.length&&popupParent){var parentPos=popupParent.getBoundingClientRect(),visibilityCheck;clearPrevPos?$(popup).css({top:"",left:""}):($(popup).css({top:parentPos.bottom-adminBarHeight,left:parentPos.left}),visibilityCheck=setInterval((function(){"none"===$(popupWrapper).css("display")&&($(popup).css({top:"",left:""}),clearInterval(visibilityCheck))}),500))}},repositionAlignedPopups=function(clear){alignedPopups.forEach((function(popup){clear?handleAlignWithParent(popup.id,popup.parent,!0):handleAlignWithParent(popup.id,popup.parent)}))},popupResizeHandler=function(){var isBelowMax=window.VAMTAM.isBelowMaxDeviceWidth();prevIsBelowMax!==isBelowMax?(isBelowMax?repositionAlignedPopups(!0):repositionAlignedPopups(),prevIsBelowMax=isBelowMax):isBelowMax||repositionAlignedPopups()},popupScrollHandler=function(){requestAnimationFrame((function(){repositionAlignedPopups()}))},storePopup=function(popupId,popupParent){var done;alignedPopups.forEach((function(popup){popup.id===popupId&&(popup.parent=popupParent,done=!0)})),done||alignedPopups.push({id:popupId,parent:popupParent})};function checkForStickyParent(popupParent){const parentEl=$(popupParent).parents(".elementor-element.elementor-widget")[0];if(!parentEl)return;let parentElSettings=$(parentEl).attr("data-settings");if(!parentElSettings)return;try{parentElSettings=JSON.parse(parentElSettings)}catch(error){return}const hasStickyParent=parentElSettings.sticky;hasStickyParent&&(window.removeEventListener("scroll",popupScrollHandler),window.addEventListener("scroll",popupScrollHandler,{passive:!0}))}var checkAlignWithParent=function(e){var actionLink=$(e.currentTarget).attr("href");if(actionLink){var settings=_self.utils.getSettingsFromActionLink(actionLink);settings&&settings.align_with_parent&&(storePopup(settings.id,e.currentTarget),window.VAMTAM.isMaxDeviceWidth()&&handleAlignWithParent(settings.id,e.currentTarget),window.removeEventListener("resize",popupResizeHandler),window.addEventListener("resize",popupResizeHandler,!1),checkForStickyParent(e.currentTarget))}};elementorFrontend.elements.$document.on("click",'a[href^="#elementor-action"]',checkAlignWithParent)},utils:{getSettingsFromActionLink:function(url){if(url=decodeURIComponent(url)){var settingsMatch=url.match(/settings=(.+)/),settings={};return settingsMatch&&(settings=JSON.parse(atob(settingsMatch[1]))),settings}},getActionFromActionLink:function(url){if(url=decodeURIComponent(url)){var actionMatch=url.match(/action=(.+?)&/),action;if(actionMatch)return actionMatch[1]}}}},VamtamWidgetsHandler:{isWidgetModActive:widgetName=>{if(!widgetName)return!1;const siteSettings=elementorFrontend.getKitSettings(),themePrefix="vamtam_theme_",widgetModsList=window.VAMTAM_FRONT.widget_mods_list;return!!widgetModsList[widgetName]&&("yes"===siteSettings.vamtam_theme_enable_all_widget_mods||"yes"!==siteSettings.vamtam_theme_disable_all_widget_mods&&"yes"===siteSettings[`vamtam_theme_${widgetName}`])}},VamtamImprovedCSSLoadingHandler:{init:()=>{const widgetData={...VAMTAM_FRONT.widgets_assets_data};if(!widgetData)return;$("#vamtam-all-js-after").remove(),delete VAMTAM_FRONT.widgets_assets_data;let out="";Object.keys(widgetData).forEach(widget=>{const content=widgetData[widget].content,widgetSelector=`.elementor-widget-${widget} > .elementor-widget-container`;if(content){if($(`${widgetSelector} > style, ${widgetSelector} > link`).length)return;out=out+"\r\n"+content}}),out&&$("body").append(`
${out}
`)}}};window.VAMTAM_FRONT.elementor.urlActions=VAMTAM_ELEMENTOR.VamtamActionLinksHandler.utils,window.VAMTAM_FRONT.elementor.popups=VAMTAM_ELEMENTOR.VamtamPopupsHandler.utils,window.VAMTAM_FRONT.elementor.widgets={isWidgetModActive:VAMTAM_ELEMENTOR.VamtamWidgetsHandler.isWidgetModActive},$(document).ready((function(){VAMTAM_ELEMENTOR.domLoaded()})),$(window).on("load",(function(){VAMTAM_ELEMENTOR.pageLoaded()}));class VamtamElementBase extends elementorModules.frontend.handlers.Base{onInit(...args){super.onInit(...args),this.checkAddBaseThemeStylesClass()}checkAddBaseThemeStylesClass(){const isEditor=$("body").hasClass("elementor-editor-active");isEditor&&this.isWidgetModActive()&&this.$element.addClass("vamtam-has-theme-widget-styles")}isWidgetModActive(){let widgetName=this.getElementType();return"widget"===widgetName&&(widgetName=this.getWidgetType()),VAMTAM_ELEMENTOR.VamtamWidgetsHandler.isWidgetModActive(widgetName)}}jQuery(window).on("elementor/frontend/init",()=>{const addHandler=$element=>{elementorFrontend.elementsHandler.addHandler(VamtamElementBase,{$element:$element})};elementorFrontend.hooks.addAction("frontend/element_ready/global",addHandler)})}(jQuery);