jQuery(document).ready(function($){window.xooEl=window.xooEl||{};function objectifyForm($form){var form=$form instanceof jQuery?$form[0]:$form;var formData=new FormData(form);var result={};formData.forEach(function(value,name){if(value instanceof File)return;if(result.hasOwnProperty(name)){if(!Array.isArray(result[name])){result[name]=[result[name]]} result[name].push(value)}else{result[name]=value}});return result} function parse_notice(message,type){type=(typeof type!=='undefined')?type:'error';return xoo_el_localize.html.notice[type].replace('%s',message)} var classReferral={'xoo-el-login-tgr':'login','xoo-el-reg-tgr':'register',} function getReferral(className){return classReferral[className]?classReferral[className]:''} function getFormsTrigger($container){$container=$container||'';var isSingle=!1;if($container.length&&$container.find('.xoo-el-section[data-section="single"]').length){isSingle=!0} var formsTrigger={'xoo-el-sing-tgr':'single','xoo-el-login-tgr':isSingle?'single':'login','xoo-el-reg-tgr':isSingle?'single':'register','xoo-el-lostpw-tgr':'lostpw','xoo-el-resetpw-tgr':'resetpw','xoo-el-forcereg-tgr':'register','xoo-el-forcelogin-tgr':'login',} return formsTrigger} class Container{constructor($container){this.$container=$container;this.$tabs=$container.find('ul.xoo-el-tabs').length?$container.find('ul.xoo-el-tabs'):null;this.display=$container.hasClass('xoo-el-form-inline')?'inline':'popup';this.formRetries=0;if(this.$container.attr('data-active')){this.toggleForm(this.$container.attr('data-active'))} this.createFormsTriggerHTML();this.eventHandlers()} createFormsTriggerHTML(){var HTML='
';$.each(getFormsTrigger(this.$container),function(triggerClass,type){HTML+=''}) HTML+='
';this.$container.append(HTML)} eventHandlers(){this.$container.on('submit','.xoo-el-action-form',this.submitForm.bind(this));this.$container.on('click','.xoo-el-edit-em',this.emailFieldEditClick.bind(this));$(document.body).on('xoo_el_form_submitted',this.singleFormProcess.bind(this));this.formTriggerEvent()} emailFieldEditClick(e){this.toggleForm('single');this.$container.find('input[name="xoo-el-sing-user"]').val($(e.currentTarget).siblings('input').val()).focus().trigger('keyup')} formTriggerEvent(){var container=this,formsTrigger=getFormsTrigger(container.$container);$.each(formsTrigger,function(triggerClass,formType){$(container.$container).on('click','.'+triggerClass,function(e){e.preventDefault();e.stopImmediatePropagation();container.toggleForm(formType,getReferral(triggerClass))})})} toggleForm(formType,referral){referral=referral||'';this.$container.attr('data-active',formType);var $section=this.$container.find('.xoo-el-section[data-section="'+formType+'"]'),activeClass='xoo-el-active';if($section.length){var $sectionForm=$section.find('form');this.$container.find('.xoo-el-section').removeClass(activeClass);$section.addClass(activeClass);$section.find('.xoo-el-notice').html('').hide();$section.find('.xoo-el-action-form').show();if($sectionForm.length&&referral&&$sectionForm.find('input[name="_xoo_el_referral"]').length){$sectionForm.find('input[name="_xoo_el_referral"]').val(referral)}} if(this.$tabs){this.$tabs.find('li').removeClass(activeClass);if(this.$tabs.find('li[data-tab="'+formType+'"]').length){this.$tabs.find('li[data-tab="'+formType+'"]').addClass(activeClass)}} $(document.body).trigger('xoo_el_form_toggled',[formType,this,referral]);this.$container.triggerHandler('xoo_el_form_toggled',[formType,this,referral])} submitForm(e){e.preventDefault();var $form=$(e.currentTarget),$button=$form.find('button[type="submit"]'),$section=$form.parents('.xoo-el-section'),buttonTxt=$button.text(),$notice=$section.find('.xoo-el-notice'),formType=$section.attr('data-section'),container=this;$notice.html('');$button.html(xoo_el_localize.html.spinner).addClass('xoo-el-processing');var form_data=new FormData($form[0]);form_data.append('action','xoo_el_form_action');form_data.append('display',container.display);form_data.append('_ajax_nonce',xoo_el_localize.nonce);$.ajax({url:xoo_el_localize.adminurl,type:'POST',processData:!1,contentType:!1,cache:!1,enctype:'multipart/form-data',data:form_data,complete:function(xhr,status){$button.removeClass('xoo-el-processing').html(buttonTxt);if((status!=='success'||!xhr.responseJSON||xhr.responseJSON.error===undefined)){if(container.formRetries<2){$form.submit();container.formRetries++;return} if(xoo_el_localize.errorLog==='yes'){$notice.html(parse_notice("We could not process your request, please check console or try again later.",'error')).show()}else if(status!=='error'){location.reload()}}},success:function(response){container.formRetries=0;if(response.error===undefined){console.log(response);return} if(response.notice){$notice.html(response.notice).show();if(container.display==='inline'){$('html, body').animate({scrollTop:$notice.offset().top-100},500)}} if(response.error===0){if(response.redirect){setTimeout(function(){window.location=response.redirect},xoo_el_localize.redirectDelay)}else{$form.hide()} $form.trigger('reset');if(formType==='resetpw'&&xoo_el_localize.resetPwPattern==='link'){$form.add('.xoo-el-resetpw-hnotice').remove()}} $(document.body).trigger('xoo_el_form_submitted',[response,$form,container]);$form.triggerHandler('xoo_el_form_submitted',[response,$form,container])}}).fail(function(jqXHR,textStatus,errorThrown){if(container.formRetries<2)return;$('body, .xoo-el-popup-notice').addClass('xoo-el-popup-notice-active');var iframe=$('.xoo-el-notice-wrap iframe').get(0);iframe.contentWindow.document.open();iframe.contentWindow.document.write(jqXHR.responseText);iframe.contentWindow.document.close();var iframeDocument=iframe.contentWindow.document;var style=iframeDocument.createElement("style");style.textContent=$('.xoo-el-notice-iframestyle').text();iframeDocument.head.appendChild(style)})} singleFormProcess(e,response,$form,container){if(this!==container)return;if(response.field){var $field=this.$container.find(response.field);if($field.length){this.toggleForm($field.closest('.xoo-el-section').attr('data-section'));$field.closest('form').show();$field.val(response.fieldValue);$field.closest('.xoo-el-section').find('.xoo-el-notice').html(response.notice).show();var $fieldCont=$field.closest('.xoo-aff-group');if(!$fieldCont.find('.xoo-el-edit-em').length){$fieldCont.addClass('xoo-el-block-edit');$(xoo_el_localize.html.editField).insertAfter($field)}}}}} class Popup{constructor($popup){this.$popup=$popup;this.eventHandlers()} eventHandlers(){if(!xoo_el_localize.preventClosing){this.$popup.on('click','.xoo-el-close, .xoo-el-modal, .xoo-el-opac',this.closeOnClick.bind(this));$(document.body).on('xoo_el_popup_toggled.xooEscEvent',this.onPopupToggled.bind(this))} $(document.body).on('xoo_el_form_submitted',this.onFormSubmitSuccess.bind(this));this.$popup.on('click','.xoo-el-action-btn',this.setScrollBarOnSubmit.bind(this));$(window).on('hashchange load',this.openViaHash.bind(this));this.triggerPopupOnClick();if(xoo_el_localize.checkout&&xoo_el_localize.checkout.loginEnabled==='yes'){$('body').on('click','.wc-block-checkout__login-prompt, .wc-block-must-login-prompt',this.checkoutPageLinkClick.bind(this))}} onPopupToggled(e,type){if($('body').hasClass('xoo-el-popup-active')){$(document).on('keydown.xooEscClose',this.closeOnEscPress.bind(this))}else{$(document).off('keydown.xooEscClose')}} closeOnEscPress(e){if(event.key==="Escape"||event.keyCode===27){popup.toggle('hide')}} checkoutPageLinkClick(e){e.preventDefault();$(e.currentTarget).attr('data-redirect',xoo_el_localize.checkout.loginRedirect).addClass('xoo-el-login-tgr').trigger('click')} triggerPopupOnClick(){$.each(getFormsTrigger(this.$popup),function(triggerClass,formType){$(document.body).on('click','.'+triggerClass,function(e){if($(this).parents('.xoo-el-form-container').length)return!0;e.preventDefault();e.stopImmediatePropagation();popup.toggle('show');if($(this).attr('data-redirect')){popup.$popup.find('input[name="xoo_el_redirect"]').val($(this).attr('data-redirect'))} popup.$popup.find('.'+triggerClass).trigger('click');return!1})})} toggle(type){var $els=this.$popup.add('body'),activeClass='xoo-el-popup-active';if(type==='show'){$els.addClass(activeClass)}else if(type==='hide'){$els.removeClass(activeClass)}else{$els.toggleClass(activeClass)} $(document.body).trigger('xoo_el_popup_toggled',[type])} closeOnClick(e){var elClassList=e.target.classList;if(elClassList.contains('xoo-el-close')||elClassList.contains('xoo-el-modal')||elClassList.contains('xoo-el-opac')){this.toggle('hide')}} setScrollbarPosition(position){this.$popup.find('.xoo-el-srcont').animate({scrollTop:position||0},300);console.log(this.$popup.find('.xoo-el-srcont').scrollTop)} onFormSubmitSuccess(e,response,$form,container){this.setScrollbarPosition()} setScrollBarOnSubmit(e){var invalid_els=$(e.currentTarget).closest('form').find('input:invalid');if(invalid_els.length===0)return;this.setScrollbarPosition(invalid_els.filter(":first").closest('.xoo-aff-group').position().top)} openViaHash(){var hash=$(location).attr('hash');if(hash==='#login'||hash==='#register'){this.toggle('show');var uri=window.location.toString(),clean_uri=uri.substring(0,uri.indexOf("#"));window.history.replaceState({},document.title,clean_uri)} if(hash==='#login'){this.$popup.find('.xoo-el-login-tgr').trigger('click')}else if(hash==='#register'){this.$popup.find('.xoo-el-reg-tgr').trigger('click')}}} class Form{constructor($form){this.$form=$form} eventHandlers(){}} var popup=null;if($('.xoo-el-container').length){popup=new Popup($('.xoo-el-container'))} if(xoo_el_localize.isLoggedIn==="no"&&xoo_el_localize.autoOpenPopup==='yes'&&localStorage.getItem("xoo_el_popup_opened")!=="yes"){if(xoo_el_localize.autoOpenPopupOnce==="yes"){localStorage.setItem("xoo_el_popup_opened","yes")} setTimeout(function(){popup.toggle('show')},xoo_el_localize.aoDelay)} $('.xoo-el-form-container').each(function(key,el){new Container($(el))}) if($('form.xoo-el-form-resetpw').length&&xoo_el_localize.resetPwPattern==="link"){if($('.xoo-el-form-inline').length){$([document.documentElement,document.body]).animate({scrollTop:$(".xoo-el-form-inline").offset().top},500)}else{if(popup){popup.toggle('show')}}} if($('body.woocommerce-checkout').length&&$('.xoo-el-form-inline').length&&$('a.showlogin').length){var $inlineForm=$('.xoo-el-form-inline');$inlineForm.hide();$(document.body).on('click','a.showlogin',function(){$inlineForm.slideToggle();$inlineForm.find('.xoo-el-login-tgr').trigger('click')})} if(popup&&xoo_el_localize.loginClass&&$('.'+xoo_el_localize.loginClass).length){$('body:not(.logged-in) .'+xoo_el_localize.loginClass).on('click',function(e){e.preventDefault();e.stopImmediatePropagation();popup.toggle('show');popup.$popup.find('.xoo-el-login-tgr').trigger('click')})} if(popup&&xoo_el_localize.registerClass&&$('.'+xoo_el_localize.registerClass).length){$('body:not(.logged-in) .'+xoo_el_localize.registerClass).on('click',function(e){e.preventDefault();e.stopImmediatePropagation();popup.toggle('show');popup.$popup.find('.xoo-el-reg-tgr').trigger('click')})} $('.xoo-el-notice-close').on('click',function(){$('body, .xoo-el-popup-notice').removeClass('xoo-el-popup-notice-active')}) class CodeFormHandler{constructor($codeForm){const existing=CodeFormHandler.instances.get($codeForm[0]);if(existing)return existing;this.$codeForm=$codeForm;this.codeFormID=this.$codeForm.data('code');this.$parentForm=this.$codeForm.data('parentform')?$(this.$codeForm.siblings(this.$codeForm.data('parentform')).get(0)):$();this.CodePasted=!1;this.resendData={};this.$noticeCont=this.$codeForm.find('.xoo-el-code-notice');this.$submitBtn=this.$codeForm.find('.xoo-el-code-submit-btn');this.submitBtnTxt=this.$submitBtn.html();this.$inputs=this.$codeForm.find('.xoo-el-code-input');this.$resendLink=this.$codeForm.find('.xoo-el-code-resend-link');this.noticeTimout=this.resendTimer=!1;this.parentFormValues={} this.codesent=!1;this.$container=this.$codeForm.closest('.xoo-el-form-container');this.events();CodeFormHandler.instances.set($codeForm[0],this)} events(){this.$resendLink.on('click',{_thisObj:this},this.resendCode);this.$codeForm.find('.xoo-el-code-no-change').on('click',{_thisObj:this},this.changeParentInput);this.$codeForm.on('submit',{_thisObj:this},this.onSubmit);this.$inputs.on('paste',{_thisObj:this},this.onCodeInputPaste);this.$inputs.on('input',{_thisObj:this},this.onCodeInputChange);this.$inputs.on('keydown ',{_thisObj:this},this.beforeCodeInputChange);this.$container.on('xoo_el_form_toggled',this.onParentFormToggled.bind(this))} onParentFormToggled(e,formType,containerObj,referral){let _thisObj=this;if(_thisObj.codesent){_thisObj.$parentForm.hide();_thisObj.$codeForm.show()}} onCodeInputPaste(event){var _thisObj=event.data._thisObj,_this=$(this);_thisObj.CodePasted=!0;setTimeout(function(){var inputVal=_this.val().trim(),inputValLength=inputVal.length;_thisObj.$inputs.val('');for(var i=0;i1&&!_thisObj.CodePasted){$(this).trigger('paste');return} if(_thisObj.CodePasted||_thisObj.processing){return} _thisObj.processing=!0;var $nextInput=$(this).next('input.xoo-el-code-input'),$prevInput=$(this).prev('input.xoo-el-code-input');if(inputValLength&&$nextInput.length!==0){$nextInput.focus()} _thisObj.processing=!1} beforeCodeInputChange(event){var _thisObj=event.data._thisObj,inputVal=$(this).val(),inputValLength=inputVal.length;var $nextInput=$(this).next('input.xoo-el-code-input'),$prevInput=$(this).prev('input.xoo-el-code-input');if(inputVal.length&&event.keyCode!=8&&event.keyCode!==13){if($nextInput.length&&!$nextInput.val()){$nextInput.focus()}else{$(this).val('')}} if(!inputValLength&&event.keyCode==8&&$prevInput.length!==0){$prevInput.focus()}} onSubmit(event){event.preventDefault();var _thisObj=event.data._thisObj;if(!_thisObj.validateInputs()||!_thisObj.getCodeValue().length)return!1;_thisObj.$submitBtn.html(xoo_el_localize.html.spinner).addClass('xoo-el-processing');_thisObj.verifyCode()} changeParentInput(event){var _thisObj=event.data._thisObj;_thisObj.codesent=!1;_thisObj.$codeForm.hide();_thisObj.$parentForm.show();_thisObj.$inputs.val('')} resendCode(event){event.preventDefault();var _thisObj=event.data._thisObj;_thisObj.startResendTimer();var form_data={action:'xoo_el_resend_code','parentFormData':objectifyForm(_thisObj.$parentForm),} form_data=Object.assign({},form_data,_thisObj.resendData);_thisObj.$resendLink.addClass('xoo-el-processing');$.ajax({url:xoo_el_localize.adminurl,type:'POST',data:form_data,success:function(response){_thisObj.$resendLink.trigger('xoo_el_code_resent',[response,_thisObj]);_thisObj.$resendLink.removeClass('xoo-el-processing');if(response.notice){_thisObj.showNotice(response.notice)}},complete:function(){}})} validateInputs(){var passedValidation=!0;this.$inputs.each(function(index,input){var $input=$(input);if($input.val().trim()===''){$input.focus();passedValidation=!1;return!1}});return passedValidation} onSuccess(response){this.$codeForm.removeAttr('data-processing');this.codesent=!1;this.$codeForm.hide();this.$inputs.val('');if(this.$parentForm.length){if(response.notice){this.$parentForm.closest('.xoo-el-section').find('.xoo-el-notice').html(response.notice).show()} this.$parentForm.show()}} startResendTimer(){var _thisObj=this,$cont=this.$codeForm.find('.xoo-el-code-resend'),$resendLink=$cont.find('.xoo-el-code-resend-link'),$timer=$cont.find('.xoo-el-code-resend-timer'),resendTime=parseInt(xoo_el_localize.resend_wait);if(resendTime===0)return;$resendLink.addClass('xoo-el-disabled');clearInterval(this.resendTimer);this.resendTimer=setInterval(function(){$timer.html('('+resendTime+')');if(resendTime<=0){clearInterval(_thisObj.resendTimer);$resendLink.removeClass('xoo-el-disabled');$timer.html('')} resendTime--},1000)} showNotice(notice){var _thisObj=this;clearTimeout(this.noticeTimout);this.$noticeCont.html(notice).show();this.noticeTimout=setTimeout(function(){_thisObj.$noticeCont.hide()},4000)} onCodeSent(response){var _thisObj=this;if(response.error)return;_thisObj.codesent=!0;_thisObj.$codeForm.show();if(response.code_txt){_thisObj.$codeForm.find('.xoo-el-code-no-txt').html(response.code_txt)} setTimeout(function(){_thisObj.$inputs.first().trigger('click');_thisObj.$inputs.first().focus();_thisObj.$inputs.first().attr('autofocus',!0)},500) _thisObj.startResendTimer();_thisObj.parentFormValues=_thisObj.$parentForm.serialize();_thisObj.$codeForm.attr('data-processing','yes');_thisObj.$parentForm.hide()} verifyCode(data){var _thisObj=this;var form_data=$.extend({'code':_thisObj.getCodeValue(),'action':'xoo_el_code_form_submit','xoo_el_code_ajax':_thisObj.codeFormID,'parentFormData':objectifyForm(_thisObj.$parentForm),'_ajax_nonce':xoo_el_localize.nonce},data);$.ajax({url:xoo_el_localize.adminurl,type:'POST',data:form_data,success:function(response){_thisObj.$submitBtn.removeClass('xoo-el-processing').html(_thisObj.submitBtnTxt);if(response.notice){_thisObj.showNotice(response.notice)} if(response.error===0){_thisObj.onSuccess(response);_thisObj.$codeForm.trigger('xoo_el_on_code_success',[response])}}})} validateFormSubmit(){if(this.validateInputs()&&this.getCodeValue().length){this.$submitBtn.html(xoo_el_localize.html.spinner).addClass('xoo-el-processing');return!0}} getCodeValue(){var code='';this.$inputs.each(function(index,input){code+=$(input).val()});return code}} CodeFormHandler.instances=new WeakMap();$('.xoo-el-code-form').each(function(index,codeForm){new CodeFormHandler($(codeForm))});window.xooEl.CodeFormHandler=CodeFormHandler;if(xoo_el_localize.resetPwPattern==="code"){class lostPasswordFormHandler{constructor($form){this.$form=$form;this.$section=this.$form.closest('.xoo-el-section');this.$resetPwSection=this.$section.siblings('[data-section="resetpw"]');this.$resetPwForm=this.$resetPwSection.find('.xoo-el-form-resetpw');this.$container=this.$section.closest('.xoo-el-form-container');this.codeFormHandler=new CodeFormHandler($form.siblings('.xoo-el-code-form'));this.events()} events(){this.$form.on('xoo_el_form_submitted',this.onFormSubmit.bind(this));this.$resetPwForm.on('xoo_el_form_submitted',this.onResetPWFormSubmit.bind(this));this.codeFormHandler.$codeForm.on('xoo_el_on_code_success',this.onCodeVerificationSuccess.bind(this));this.$container.on('xoo_el_form_toggled',this.onLostPasswordFormToggle.bind(this))} onFormSubmit(e,response,$form,container){let _thisObj=this;_thisObj.codeFormHandler.onCodeSent(response);_thisObj.$resetPwSection.removeAttr('data-verified','yes')} onResetPWFormSubmit(e,response,$form,containerObj){let _thisObj=this;_thisObj.$resetPwSection.removeAttr('data-verified','yes');if(response.error){_thisObj.$section.find('.xoo-el-notice').html(response.notice).show();if(response.error_code==='code_reset'){containerObj.toggleForm('lostpw')}}else{containerObj.toggleForm('login');this.$container.find('.xoo-el-section[data-section="login"]').find('.xoo-el-notice').html(response.notice).show()}} onCodeVerificationSuccess(e,response){let _thisObj=this;_thisObj.$container.find('.xoo-el-resetpw-tgr').trigger('click');_thisObj.$resetPwSection.attr('data-verified','yes')} onLostPasswordFormToggle(e,formType,containerObj,referral){let _thisObj=this;if(formType!=='lostpw')return;if(_thisObj.$resetPwSection.attr('data-verified')==="yes"){containerObj.toggleForm('resetpw')}}} $('form.xoo-el-form-lostpw').each(function(index,el){new lostPasswordFormHandler($(el))})}}); (function($){var aThemesTeamCarouselrun=function($scope,$){if($().owlCarouselFork){$(".roll-team:not(.roll-team.no-carousel)").owlCarouselFork({navigation:!1,pagination:!0,responsive:!0,items:3,itemsDesktopSmall:[1400,3],itemsTablet:[970,2],itemsTabletSmall:[600,1],itemsMobile:[360,1],touchDrag:!0,mouseDrag:!0,autoHeight:!1,autoPlay:!1,})}};var aThemesTestimonialsCarouselrun=function($scope,$){if($().owlCarouselFork){$('.roll-testimonials').not('.owl-carousel').owlCarouselFork({navigation:!1,pagination:!0,responsive:!0,items:1,itemsDesktop:[3000,1],itemsDesktopSmall:[1400,1],itemsTablet:[970,1],itemsTabletSmall:[600,1],itemsMobile:[360,1],touchDrag:!0,mouseDrag:!0,autoHeight:!0,autoPlay:$('.roll-testimonials').data('autoplay')})}};var aThemesNewsCarouselrun=function($scope,$){if($().owlCarouselFork){$(".panel-grid-cell .latest-news-wrapper").owlCarouselFork({navigation:!1,pagination:!0,responsive:!0,items:3,itemsDesktopSmall:[1400,3],itemsTablet:[970,2],itemsTabletSmall:[600,1],itemsMobile:[360,1],touchDrag:!0,mouseDrag:!0,autoHeight:!1,autoPlay:!1})}};var aThemesgroupProductYITHActions=function(){var product=$('.woocommerce ul.products li.product');product.each(function(index,el){var placeholder=$(el).find('.yith-placeholder');var wcqv=$(el).find('.yith-wcqv-button');var wcwl=$(el).find('.yith-wcwl-add-to-wishlist');var compare=$(el).find('.compare.button');placeholder.append(wcqv,wcwl,compare)})} $(window).on('elementor/frontend/init',function(){elementorFrontend.hooks.addAction('frontend/element_ready/athemes-testimonials.default',aThemesTestimonialsCarouselrun);elementorFrontend.hooks.addAction('frontend/element_ready/athemes-posts.default',aThemesNewsCarouselrun);elementorFrontend.hooks.addAction('frontend/element_ready/athemes-employee-carousel.default',aThemesTeamCarouselrun);elementorFrontend.hooks.addAction('frontend/element_ready/global',function($scope){aThemesgroupProductYITHActions()})})})(jQuery); (function($){var aThemesTestimonialsCarouselrun=function($scope,$){if($().owlCarouselFork){$('.roll-testimonials').not('.owl-carousel').owlCarouselFork({navigation:!1,pagination:!0,responsive:!0,items:1,itemsDesktop:[3000,1],itemsDesktopSmall:[1400,1],itemsTablet:[970,1],itemsTabletSmall:[600,1],itemsMobile:[360,1],touchDrag:!0,mouseDrag:!0,autoHeight:!0,autoPlay:$('.roll-testimonials').data('autoplay')})}};var aThemesTestimonialsSkinCarouselrun=function($scope,$){var $carousel=$('.roll-testimonials.athemes-testimonials-skin',$scope);if($().owlCarouselFork){$carousel.not('.owl-carousel').owlCarouselFork({navigation:!0,pagination:!1,navigationText:[$('.tc-next'),$('.tc-prev')],responsive:!0,slideSpeed:1000,transitionStyle:"custfade",items:1,itemsDesktop:[3000,1],itemsDesktopSmall:[1400,1],itemsTablet:[970,1],itemsTabletSmall:[600,1],itemsMobile:[360,1],touchDrag:!0,mouseDrag:!0,autoHeight:!0,autoPlay:$('.roll-testimonials').data('autoplay')})}};var aThemesNewsCarouselrun=function($scope,$){if($().owlCarouselFork){$(".panel-grid-cell .latest-news-wrapper").owlCarouselFork({navigation:!1,pagination:!0,responsive:!0,items:3,itemsDesktopSmall:[1400,3],itemsTablet:[970,2],itemsTabletSmall:[600,1],itemsMobile:[360,1],touchDrag:!0,mouseDrag:!0,autoHeight:!1,autoPlay:!1})}};var aThemesIsotoperun=function($scope,$){if($('.project-wrap').length){$('.project-wrap').each(function(){var self=$(this);var filterNav=self.find('.project-filter').find('a');var projectIsotope=function($selector){$selector.isotope({filter:'*',itemSelector:'.project-item',percentPosition:!0,animationOptions:{duration:750,easing:'liniar',queue:!1,}})} self.children().find('.isotope-container').imagesLoaded(function(){projectIsotope(self.children().find('.isotope-container'))});$(window).load(function(){projectIsotope(self.children().find('.isotope-container'))});filterNav.click(function(){var selector=$(this).attr('data-filter');filterNav.removeClass('active');$(this).addClass('active');self.find('.isotope-container').isotope({filter:selector,animationOptions:{duration:750,easing:'liniar',queue:!1,}});return!1})})}};var aThemesPortfolioExt=function($scope,$){$('.sydney-portfolio-wrapper').each(function(){var $gallery=$('.sydney-portfolio-items',$scope);var $filter=$('.sydney-portfolio-filter',$scope);$gallery.isotope({itemSelector:'.sydney-portfolio-item',});$gallery.imagesLoaded().progress(function(){$gallery.isotope('layout')});$filter.on('click','a',function(e){e.preventDefault();$(this).addClass('active');$(this).parent().siblings().find('a').removeClass('active');var filterValue=$(this).attr('data-filter');$gallery.isotope({filter:filterValue})})})};var aThemesTeamSocial=function($scope,$){$('.roll-team.type-b.style2').find('.team-item').each(function(){var socials=$(this).find('.team-social');socials.appendTo($(this).find('.team-inner'))})};var aThemesHeroSlider=function($scope,$){$(document).ready(function(){var swiperConfig={effect:'fade',direction:'horizontal',loop:!0,autoplay:!0,speed:1000,navigation:{nextEl:'.swiper-button-next',prevEl:'.swiper-button-prev',},pagination:{el:'.swiper-pagination',clickable:!0,},} if('undefined'===typeof Swiper){const asyncSwiper=elementorFrontend.utils.swiper;new asyncSwiper($('.athemes-hero-slider'),swiperConfig).then((newSwiperInstance)=>{swiperElement=newSwiperInstance})}else{var swiperElement=new Swiper($('.athemes-hero-slider'),swiperConfig)}})};$(window).on('elementor/frontend/init',function(){elementorFrontend.hooks.addAction('frontend/element_ready/athemes-testimonials.default',aThemesTestimonialsCarouselrun);elementorFrontend.hooks.addAction('frontend/element_ready/athemes-testimonials.athemes-testimonials-skin',aThemesTestimonialsSkinCarouselrun);elementorFrontend.hooks.addAction('frontend/element_ready/athemes-posts.default',aThemesNewsCarouselrun);elementorFrontend.hooks.addAction('frontend/element_ready/athemes-portfolio.default',aThemesIsotoperun);elementorFrontend.hooks.addAction('frontend/element_ready/athemes-portfolio-ext.default',aThemesPortfolioExt);elementorFrontend.hooks.addAction('frontend/element_ready/athemes-portfolio-ext.athemes-portfolio-ext-overlap-skin',aThemesPortfolioExt);elementorFrontend.hooks.addAction('frontend/element_ready/athemes-portfolio-ext.athemes-portfolio-ext-classic-skin',aThemesPortfolioExt);elementorFrontend.hooks.addAction('frontend/element_ready/athemes-portfolio-ext.athemes-portfolio-ext-metro-skin',aThemesPortfolioExt);elementorFrontend.hooks.addAction('frontend/element_ready/athemes-employee.default',aThemesTeamSocial);elementorFrontend.hooks.addAction('frontend/element_ready/sydney-hero-slider.default',aThemesHeroSlider)})}(jQuery,window.elementorFrontend)); var merchant=merchant||{};merchant.modules={};; var merchant=merchant||{};merchant.modules=merchant.modules||{},(u=>{merchant.modules.quickView={init:function(){var i=this,t=u(".merchant-quick-view-modal");t.length&&t.each(function(){var a=u(this),e=a.find(".merchant-quick-view-close-button"),n=a.find(".merchant-quick-view-inner"),o=a.find(".merchant-quick-view-content"),t=a.find(".merchant-quick-view-overlay"),r=!1;u(document).on("click",".merchant-quick-view-button",function(t){t.preventDefault(),o.empty(),a.addClass("merchant-show"),a.addClass("merchant-loading"),r=!0,u.post(window.merchant.setting.ajax_url,{action:"merchant_quick_view_content",nonce:window.merchant.setting.nonce,product_id:u(this).data("product-id")},function(t){var e;t.success&&r?(o.html(t.data),n.addClass("merchant-show"),a.removeClass("merchant-loading"),e=o.find(".woocommerce-product-gallery"),wc_single_product_params.zoom_enabled=window.merchant.setting.quick_view_zoom,"function"==typeof u.fn.wc_product_gallery&&e.length&&(e.trigger("wc-product-gallery-before-init",[e.get(0),wc_single_product_params]),wc_single_product_params.flexslider_enabled="1",e.wc_product_gallery(wc_single_product_params),e.trigger("wc-product-gallery-after-init",[e.get(0),wc_single_product_params])),e=o.find(".variations_form"),"function"==typeof u.fn.wc_variation_form&&e.length&&e.each(function(){u(this).wc_variation_form()}),window.botiga&&window.botiga.productSwatch&&window.botiga.productSwatch.init(),window.botiga&&window.botiga.qtyButton&&window.botiga.qtyButton.init("quick-view"),window.merchant.setting.ajax_add_to_cart&&i.initAjaxAddToCart(o,a)):(o.html(t.data),n.addClass("merchant-show"),a.removeClass("merchant-loading")),window.dispatchEvent(new Event("merchant.quickview.ajax.loaded"))}).fail(function(t,e){o.html(e),n.addClass("merchant-show"),a.removeClass("merchant-loading")})}),t.on("click",function(t){t.preventDefault(),e.trigger("click")}),e.on("click",function(t){t.preventDefault(),r=!1,a.removeClass("merchant-show"),n.removeClass("merchant-show")})})},initAjaxAddToCart:function(s,l){var m=this;s.off("submit","form.cart"),s.on("submit","form.cart",function(t){var n,a,o,r,i,e=t.originalEvent?t.originalEvent.submitter:null,c=u(e),d=!1;if(d=e&&"add-to-cart"!==c.attr("name")&&!c.hasClass("single_add_to_cart_button")?d:!0)return t.preventDefault(),t.stopImmediatePropagation(),c=(e=u(this)).find('button[type="submit"], input[type="submit"]'),(n=(n=e.find(".single_add_to_cart_button")).length?n:c.first()).hasClass("loading")||n.prop("disabled")||(d=e.serializeArray(),a={action:"merchant_quick_view_add_to_cart",nonce:window.merchant.setting.nonce},o=!1,u.each(d,function(t,e){if(e.name&&0===e.name.indexOf("quantity["))return!(o=!0)}),u.each(d,function(t,e){"quantity"!==e.name&&"add-to-cart"!==e.name&&(a[e.name]=e.value)}),(t=e.closest('[id^="product-"]')).length&&(c=t.attr("id").match(/product-(\d+)/))&&c[1]&&(a.product_id=c[1]),a.product_id||(d=e.find('input[name="add-to-cart"]')).length&&d.val()&&(a.product_id=d.val()),a.product_id?(e.find(".variations_form").length&&(t=e.find('input[name="variation_id"]').val())&&(a.variation_id=parseInt(t,10)),o?delete a.quantity:(delete a.quantity,d=(c=e.find('input[name="quantity"]')).length?parseInt(c.val(),10):1,(isNaN(d)||d<1)&&(d=1),a.quantity=d),r=n.html(),i=n.prop("disabled"),n.addClass("loading").prop("disabled",!0),n.is("button")&&(n.data("original-text",r),n.html('')),u.ajax({type:"POST",url:window.merchant.setting.ajax_url,data:a,success:function(t){m.handleAddToCartSuccess(t,n,r,i,s,l)},error:function(t,e,a){m.handleAddToCartError(t,e,a,n,r,i,s)}})):console.error("Quick View: Could not determine product ID")),!1})},handleAddToCartSuccess:function(t,e,a,n,o,r){e.removeClass("loading").prop("disabled",n),e.is("button")&&e.data("original-text")&&e.html(e.data("original-text")),t.success&&t.data?(t.data.fragments&&u.each(t.data.fragments,function(t,e){u(t).replaceWith(e)}),u(document.body).trigger("added_to_cart",[t.data.fragments,t.data.cart_hash,e,"quick-view"]),u(document.body).trigger("wc_fragment_refresh"),t.data.message&&(o.find(".merchant-quick-view-inner .woocommerce-error, .woocommerce-message, .woocommerce-info").remove(),u(document).trigger("merchant_quick_view_add_to_cart_success",[t.data.message,o]))):this.handleAddToCartError(null,"error","Unexpected response format",e,a,n,o)},handleAddToCartError:function(t,e,a,n,o,r,i){n.removeClass("loading").prop("disabled",r),n.is("button")&&n.data("original-text")&&n.html(n.data("original-text"));r="",t&&t.responseJSON&&t.responseJSON.data&&t.responseJSON.data.message?r=t.responseJSON.data.message:t&&t.responseJSON&&t.responseJSON.data&&t.responseJSON.data.notices?(n=t.responseJSON.data.notices).error&&0').text(r);i.find("form.cart").before(t),t[0].scrollIntoView({behavior:"smooth",block:"nearest"})}},u(document).ready(function(){merchant.modules.quickView.init()})})(jQuery);; /** * @license MIT or GPL-2.0 * @fileOverview Favico animations * @author Miroslav Magda, http://blog.ejci.net * @source: https://github.com/ejci/favico.js * @version 0.3.10 */ (function(){var Favico=(function(opt){'use strict';opt=(opt)?opt:{};var _def={bgColor:'#d00',textColor:'#fff',fontFamily:'sans-serif',fontStyle:'bold',type:'circle',position:'down',animation:'slide',elementId:!1,element:null,dataUrl:!1,win:window};var _opt,_orig,_h,_w,_canvas,_context,_img,_ready,_lastBadge,_running,_readyCb,_stop,_browser,_animTimeout,_drawTimeout,_doc;_browser={};_browser.ff=typeof InstallTrigger!='undefined';_browser.chrome=!!window.chrome;_browser.opera=!!window.opera||navigator.userAgent.indexOf('Opera')>=0;_browser.ie=!1;_browser.safari=Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor')>0;_browser.supported=(_browser.chrome||_browser.ff||_browser.opera);var _queue=[];_readyCb=function(){};_ready=_stop=!1;var init=function(){_opt=merge(_def,opt);_opt.bgColor=hexToRgb(_opt.bgColor);_opt.textColor=hexToRgb(_opt.textColor);_opt.position=_opt.position.toLowerCase();_opt.animation=(animation.types[''+_opt.animation])?_opt.animation:_def.animation;_doc=_opt.win.document;var isUp=_opt.position.indexOf('up')>-1;var isLeft=_opt.position.indexOf('left')>-1;if(isUp||isLeft){for(var a in animation.types){for(var i=0;i0)?_img.height:32;_w=(_img.width>0)?_img.width:32;_canvas.height=_h;_canvas.width=_w;_context=_canvas.getContext('2d');icon.ready()};_img.setAttribute('src',lastIcon.getAttribute('href'))}else{_h=32;_w=32;_img.height=_h;_img.width=_w;_canvas.height=_h;_canvas.width=_w;_context=_canvas.getContext('2d');icon.ready()}};var icon={};icon.ready=function(){_ready=!0;icon.reset();_readyCb()};icon.reset=function(){if(!_ready){return} _queue=[];_lastBadge=!1;_running=!1;_context.clearRect(0,0,_w,_h);_context.drawImage(_img,0,0,_w,_h);link.setIcon(_canvas);window.clearTimeout(_animTimeout);window.clearTimeout(_drawTimeout)};icon.start=function(){if(!_ready||_running){return} var finished=function(){_lastBadge=_queue[0];_running=!1;if(_queue.length>0){_queue.shift();icon.start()}else{}};if(_queue.length>0){_running=!0;var run=function(){['type','animation','bgColor','textColor','fontFamily','fontStyle'].forEach(function(a){if(a in _queue[0].options){_opt[a]=_queue[0].options[a]}});animation.run(_queue[0].options,function(){finished()},!1)};if(_lastBadge){animation.run(_lastBadge.options,function(){run()},!0)}else{run()}}};var type={};var options=function(opt){opt.n=((typeof opt.n)==='number')?Math.abs(opt.n|0):opt.n;opt.x=_w*opt.x;opt.y=_h*opt.y;opt.w=_w*opt.w;opt.h=_h*opt.h;opt.len=(""+opt.n).length;return opt};type.circle=function(opt){opt=options(opt);var more=!1;if(opt.len===2){opt.x=opt.x-opt.w*0.4;opt.w=opt.w*1.4;more=!0}else if(opt.len>=3){opt.x=opt.x-opt.w*0.65;opt.w=opt.w*1.65;more=!0} _context.clearRect(0,0,_w,_h);_context.drawImage(_img,0,0,_w,_h);_context.beginPath();_context.font=_opt.fontStyle+" "+Math.floor(opt.h*(opt.n>99?0.85:1))+"px "+_opt.fontFamily;_context.textAlign='center';if(more){_context.moveTo(opt.x+opt.w/2,opt.y);_context.lineTo(opt.x+opt.w-opt.h/2,opt.y);_context.quadraticCurveTo(opt.x+opt.w,opt.y,opt.x+opt.w,opt.y+opt.h/2);_context.lineTo(opt.x+opt.w,opt.y+opt.h-opt.h/2);_context.quadraticCurveTo(opt.x+opt.w,opt.y+opt.h,opt.x+opt.w-opt.h/2,opt.y+opt.h);_context.lineTo(opt.x+opt.h/2,opt.y+opt.h);_context.quadraticCurveTo(opt.x,opt.y+opt.h,opt.x,opt.y+opt.h-opt.h/2);_context.lineTo(opt.x,opt.y+opt.h/2);_context.quadraticCurveTo(opt.x,opt.y,opt.x+opt.h/2,opt.y)}else{_context.arc(opt.x+opt.w/2,opt.y+opt.h/2,opt.h/2,0,2*Math.PI)} _context.fillStyle='rgba('+_opt.bgColor.r+','+_opt.bgColor.g+','+_opt.bgColor.b+','+opt.o+')';_context.fill();_context.closePath();_context.beginPath();_context.stroke();_context.fillStyle='rgba('+_opt.textColor.r+','+_opt.textColor.g+','+_opt.textColor.b+','+opt.o+')';if((typeof opt.n)==='number'&&opt.n>999){_context.fillText(((opt.n>9999)?9:Math.floor(opt.n/1000))+'k+',Math.floor(opt.x+opt.w/2),Math.floor(opt.y+opt.h-opt.h*0.2))}else{_context.fillText(opt.n,Math.floor(opt.x+opt.w/2),Math.floor(opt.y+opt.h-opt.h*0.15))} _context.closePath()};type.rectangle=function(opt){opt=options(opt);var more=!1;if(opt.len===2){opt.x=opt.x-opt.w*0.4;opt.w=opt.w*1.4;more=!0}else if(opt.len>=3){opt.x=opt.x-opt.w*0.65;opt.w=opt.w*1.65;more=!0} _context.clearRect(0,0,_w,_h);_context.drawImage(_img,0,0,_w,_h);_context.beginPath();_context.font=_opt.fontStyle+" "+Math.floor(opt.h*(opt.n>99?0.9:1))+"px "+_opt.fontFamily;_context.textAlign='center';_context.fillStyle='rgba('+_opt.bgColor.r+','+_opt.bgColor.g+','+_opt.bgColor.b+','+opt.o+')';_context.fillRect(opt.x,opt.y,opt.w,opt.h);_context.fillStyle='rgba('+_opt.textColor.r+','+_opt.textColor.g+','+_opt.textColor.b+','+opt.o+')';if((typeof opt.n)==='number'&&opt.n>999){_context.fillText(((opt.n>9999)?9:Math.floor(opt.n/1000))+'k+',Math.floor(opt.x+opt.w/2),Math.floor(opt.y+opt.h-opt.h*0.2))}else{_context.fillText(opt.n,Math.floor(opt.x+opt.w/2),Math.floor(opt.y+opt.h-opt.h*0.15))} _context.closePath()};var badge=function(number,opts){opts=((typeof opts)==='string'?{animation:opts}:opts)||{};_readyCb=function(){try{if(typeof(number)==='number'?(number>0):(number!=='')){var q={type:'badge',options:{n:number}};if('animation' in opts&&animation.types[''+opts.animation]){q.options.animation=''+opts.animation} if('type' in opts&&type[''+opts.type]){q.options.type=''+opts.type}['bgColor','textColor'].forEach(function(o){if(o in opts){q.options[o]=hexToRgb(opts[o])}});['fontStyle','fontFamily'].forEach(function(o){if(o in opts){q.options[o]=opts[o]}});_queue.push(q);if(_queue.length>100){throw new Error('Too many badges requests in queue.')} icon.start()}else{icon.reset()}}catch(e){throw new Error('Error setting badge. Message: '+e.message)}};if(_ready){_readyCb()}};var image=function(imageElement){_readyCb=function(){try{var w=imageElement.width;var h=imageElement.height;var newImg=document.createElement('img');var ratio=(w/_w=0)){type[_opt.type](merge(opt,animationType[step]));_animTimeout=setTimeout(function(){if(revert){step=step-1}else{step=step+1} animation.run(opt,cb,revert,step)},animation.duration);link.setIcon(_canvas)}else{cb();return}};init();return{badge:badge,video:video,image:image,rawImageSrc:rawImageSrc,webcam:webcam,setOpt:setOpt,reset:icon.reset,browser:{supported:_browser.supported}}});if(typeof define!=='undefined'&&define.amd){define([],function(){return Favico})}else if(typeof module!=='undefined'&&module.exports){module.exports=Favico}else{this.Favico=Favico}})(); var merchant=merchant||{};merchant.modules=merchant.modules||{},(n=>{merchant.modules.inactiveTabMessage={defaultTitle:"",originalFaviconElements:[],faviconSentinel:null,faviconSwapped:!1,rotationTimer:null,returnTimer:null,scrollTimer:null,scrollDelayTimer:null,currentRotationIndex:0,cartCount:0,cartTotalRaw:0,cartTotal:"",siteName:"",settings:{},init:function(){var t=merchant.setting||{};this.settings={message:t.inactive_tab_message||"",abandonedMessage:t.inactive_tab_abandoned_message||"",highValueMessage:t.inactive_tab_high_value_message||"",highValueThreshold:parseFloat(t.inactive_tab_high_value_threshold)||0,enableRotation:parseInt(t.inactive_tab_enable_rotation,10)||0,rotationMessages:t.inactive_tab_rotation_messages||[],rotationInterval:1e3*(parseInt(t.inactive_tab_rotation_interval,10)||3),enableFavicon:parseInt(t.inactive_tab_enable_favicon,10)||0,faviconType:t.inactive_tab_favicon_type||"emoji",faviconEmoji:t.inactive_tab_favicon_emoji||"",faviconUrl:t.inactive_tab_favicon_url||"",returnMessage:t.inactive_tab_return_message||"",returnDuration:1e3*(parseInt(t.inactive_tab_return_duration,10)||2),enableScroll:parseInt(t.inactive_tab_enable_scroll,10)||0},this.cartCount=parseInt(t.inactive_tab_cart_count,10)||0,this.cartTotal=t.inactive_tab_cart_total||"",this.cartTotalRaw=parseFloat(t.inactive_tab_cart_total_raw)||0,this.siteName=t.inactive_tab_site_name||"",this.defaultTitle=document.title,this.faviconSentinel=document.createElement("link"),this.faviconSentinel.rel="icon",this.bindCartEvents(),document.addEventListener("visibilitychange",this.onVisibilityChange.bind(this))},bindCartEvents:function(){var i=this;n(document.body).on("added_to_cart removed_from_cart updated_wc_div",function(t,e){e&&void 0!==e[".merchant_cart_count"]?(i.cartCount=parseInt(e[".merchant_cart_count"],10)||0,i.cartTotalRaw=parseFloat(e[".merchant_cart_total_raw"])||i.cartTotalRaw,e[".merchant_cart_total"]?i.cartTotal=e[".merchant_cart_total"]:i.cartTotal=i.formatCurrency(i.cartTotalRaw)):i.cartCount=n(".woocommerce-cart-form tr.cart_item").length})},onVisibilityChange:function(){document.hidden?this.onTabHidden():this.onTabVisible()},onTabHidden:function(){var t,e,i;this.settings.enableFavicon&&this.swapFavicon(),this.settings.enableRotation&&0=this.settings.highValueThreshold&&this.settings.highValueMessage?this.settings.highValueMessage:this.settings.abandonedMessage},interpolate:function(t){return t?t.replace(/\{cart_count\}/g,this.cartCount).replace(/\{cart_total\}/g,this.cartTotal).replace(/\{site_name\}/g,this.siteName):""},setTitle:function(t,e,i){t=this.interpolate(t).replaceAll("'","'");this.settings.enableScroll&&!i?this.startScroll(t,e):(this.stopScroll(),document.title=t)},isRTL:function(t){return/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/.test(t)},startScroll:function(e,i){this.stopScroll();var n,a,s,r;e.length<=15?(document.title=e,i&&(this.scrollDelayTimer=setTimeout(i,this.settings.rotationInterval))):(a=(n=this).isRTL(e),s=0,r=-1!==e.indexOf(" "),document.title=e,this.scrollTimer=setInterval(function(){var t;(s+=1)>=e.length||(t=a?e.slice(0,e.length-s):e.slice(s),r&&-1===t.indexOf(" "))?(clearInterval(n.scrollTimer),n.scrollTimer=null,i&&i()):document.title=t},1e3))},stopScroll:function(){this.scrollTimer&&(clearInterval(this.scrollTimer),this.scrollTimer=null),this.scrollDelayTimer&&(clearTimeout(this.scrollDelayTimer),this.scrollDelayTimer=null)},startRotation:function(){var t,e=this,i=this.settings.rotationMessages;this.currentRotationIndex=0,this.settings.enableScroll?(t=function(){e.setTitle(i[e.currentRotationIndex],function(){e.currentRotationIndex=(e.currentRotationIndex+1)%i.length,t()})})():(this.setTitle(i[0]),this.rotationTimer=setInterval(function(){e.currentRotationIndex=(e.currentRotationIndex+1)%i.length,e.setTitle(i[e.currentRotationIndex])},this.settings.rotationInterval))},stopRotation:function(){this.rotationTimer&&(clearInterval(this.rotationTimer),this.rotationTimer=null),this.stopScroll(),this.currentRotationIndex=0},swapFavicon:function(){var t,e;this.isSafari()||(e="","image"===this.settings.faviconType&&this.settings.faviconUrl?e=this.settings.faviconUrl:"emoji"===this.settings.faviconType&&this.settings.faviconEmoji&&(t={wave:"👋",bell:"🔔",cart:"🛒",clock:"⏰",alert:"❗",money:"💰",fire:"🔥",star:"⭐"}[this.settings.faviconEmoji]||this.settings.faviconEmoji,e=this.emojiToDataUrl(t)),e&&this.setFaviconHref(e))},restoreFavicon:function(){if(!this.isSafari()&&this.faviconSwapped){this.faviconSentinel.parentNode&&this.faviconSentinel.parentNode.removeChild(this.faviconSentinel);for(var t=0;t