(()=>{"use strict";const t=function(t){return"string"!=typeof t||""===t?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(t)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)},n=function(t){return"string"!=typeof t||""===t?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(t)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(t)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)},e=function(e,o){return function(r,i,s){let c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10;const l=e[o];if(!n(r))return;if(!t(i))return;if("function"!=typeof s)return void console.error("The hook callback must be a function.");if("number"!=typeof c)return void console.error("If specified, the hook priority must be a number.");const a={callback:s,priority:c,namespace:i};if(l[r]){const t=l[r].handlers;let n;for(n=t.length;n>0&&!(c>=t[n-1].priority);n--);n===t.length?t[n]=a:t.splice(n,0,a),l.__current.forEach((t=>{t.name===r&&t.currentIndex>=n&&t.currentIndex++}))}else l[r]={handlers:[a],runs:0};"hookAdded"!==r&&e.doAction("hookAdded",r,i,s,c)}},o=function(e,o){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(i,s){const c=e[o];if(!n(i))return;if(!r&&!t(s))return;if(!c[i])return 0;let l=0;if(r)l=c[i].handlers.length,c[i]={runs:c[i].runs,handlers:[]};else{const t=c[i].handlers;for(let n=t.length-1;n>=0;n--)t[n].namespace===s&&(t.splice(n,1),l++,c.__current.forEach((t=>{t.name===i&&t.currentIndex>=n&&t.currentIndex--})))}return"hookRemoved"!==i&&e.doAction("hookRemoved",i,s),l}},r=function(t,n){return function(e,o){const r=t[n];return void 0!==o?e in r&&r[e].handlers.some((t=>t.namespace===o)):e in r}},i=function(t,n){let e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(o){const r=t[n];r[o]||(r[o]={handlers:[],runs:0}),r[o].runs++;const i=r[o].handlers;for(var s=arguments.length,c=new Array(s>1?s-1:0),l=1;l<s;l++)c[l-1]=arguments[l];if(!i||!i.length)return e?c[0]:void 0;const a={name:o,currentIndex:0};for(r.__current.push(a);a.currentIndex<i.length;){const t=i[a.currentIndex].callback.apply(null,c);e&&(c[0]=t),a.currentIndex++}return r.__current.pop(),e?c[0]:void 0}},s=function(t,n){return function(){var e,o;const r=t[n];return null!==(e=null===(o=r.__current[r.__current.length-1])||void 0===o?void 0:o.name)&&void 0!==e?e:null}},c=function(t,n){return function(e){const o=t[n];return void 0===e?void 0!==o.__current[0]:!!o.__current[0]&&e===o.__current[0].name}},l=function(t,e){return function(o){const r=t[e];if(n(o))return r[o]&&r[o].runs?r[o].runs:0}};class a{constructor(){this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=e(this,"actions"),this.addFilter=e(this,"filters"),this.removeAction=o(this,"actions"),this.removeFilter=o(this,"filters"),this.hasAction=r(this,"actions"),this.hasFilter=r(this,"filters"),this.removeAllActions=o(this,"actions",!0),this.removeAllFilters=o(this,"filters",!0),this.doAction=i(this,"actions"),this.applyFilters=i(this,"filters",!0),this.currentAction=s(this,"actions"),this.currentFilter=s(this,"filters"),this.doingAction=c(this,"actions"),this.doingFilter=c(this,"filters"),this.didAction=l(this,"actions"),this.didFilter=l(this,"filters")}}const u=function(){return new a},h=u(),{addAction:d,addFilter:f,removeAction:m,removeFilter:k,hasAction:v,hasFilter:p,removeAllActions:b,removeAllFilters:y,doAction:g,applyFilters:A,currentAction:_,currentFilter:F,doingAction:B,doingFilter:w,didAction:I,didFilter:N,actions:j,filters:x}=h;function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function T(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,C(o.key),o)}}function P(t,n,e){return(n=C(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function C(t){var n=function(t,n){if("object"!==S(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var o=e.call(t,"string");if("object"!==S(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===S(n)?n:String(n)}var O=function(){function t(n){!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),P(this,"hooks",void 0),P(this,"globalNamespace","jet-plugins"),P(this,"blocksNamespace","frontend.element-ready"),P(this,"blocksConditions",{}),this.hooks=n||u()}var n,e;return n=t,(e=[{key:"hookNameFromBlock",value:function(t){var n=this.getBlockName(t);return n?"".concat(this.globalNamespace,".").concat(this.blocksNamespace,".").concat(n):""}},{key:"getBlockName",value:function(t){var n;return"string"==typeof t?t.replace("/","."):this.getBlockName((null==t||null===(n=t.dataset)||void 0===n?void 0:n.isBlock)||"")}},{key:"init",value:function(t,n){var e=this;if(n&&n.length&&this.bulkBlocksInit(n),(t=t||jQuery("body"))&&t.length){var o=t.find('[data-is-block*="/"]');o&&o.length&&o.each((function(t,n){e.initBlock(n)}))}}},{key:"isBlockRequiresInit",value:function(t){var n=void 0===t.dataset.jetInited,e=this.getBlockName(t);return n&&this.blocksConditions[e]&&(n=this.blocksConditions[e](t)),n}},{key:"initBlock",value:function(t,n){n=n||!1;var e=this.hookNameFromBlock(t);if(e&&this.hasHandlers(e)){var o=n;o||(o=this.isBlockRequiresInit(t)),o&&(this.hooks.doAction(e,jQuery(t)),t.dataset.jetInited=!0)}}},{key:"hasHandlers",value:function(t){return!!this.hooks.actions[t]&&!(!this.hooks.actions[t].handlers||!this.hooks.actions[t].handlers.length)}},{key:"registerBlockHandlers",value:function(t){var n=this.getBlockName(t.block);this.hooks.addAction(this.hookNameFromBlock(n),"".concat(this.globalNamespace,"/").concat(t.block),t.callback),t.condition&&"function"==typeof t.condition&&(this.blocksConditions[n]=t.condition)}},{key:"bulkBlocksInit",value:function(t){for(var n=0;n<t.length;n++)this.registerBlockHandlers(t[n])}}])&&T(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),t}();window.JetPlugins=window.JetPlugins||new O})();
(function($){
"use strict";
let JetWooBuilder={
init: function(){
if(! window.elementorFrontend||! window.elementorFrontend.hooks){
return;
}
window.elementorFrontend.hooks.addAction('frontend/element_ready/jet-single-images.default',
function($scope){
$scope.find('.jet-single-images__loading').remove();
}
);
window.elementorFrontend.hooks.addAction('frontend/element_ready/jet-single-tabs.default',
function($scope){
$scope.find('.jet-single-tabs__loading').remove();
}
);
window.elementorFrontend.hooks.addFilter('jet-popup/widget-extensions/popup-data', JetWooBuilder.prepareJetPopup);
$(window).on('jet-popup/render-content/ajax/success', JetWooBuilder.jetPopupLoaded);
$(document)
.on('wc_update_cart added_to_cart', JetWooBuilder.handleJetPopupWithWCEvents)
.on('jet-filter-content-rendered', function(_, $scope){
JetWooBuilder.initFilteredContentWidgets($scope);
})
.on('click.JetWooBuilder', '.jet-woo-item-overlay-wrap', JetWooBuilder.handleListingItemClick);
$(document.body).on('wc_cart_emptied', function (){
if($('.jet-woo-builder-woocommerce-empty-cart').length){
JetWooBuilder.elementorFrontendInit($('.jet-woo-builder-woocommerce-empty-cart') );
}});
$(document).on('jet-ajax-search/show-results/listing', function(){
$('.jet-woo-builder-archive-add-to-cart .add_to_cart_button.ajax_add_to_cart').on('click', function(e){
e.preventDefault();
let _this=$(this);
if(_this.attr('data-product_id') ){
let addToCartData={};
$.each(_this[0].dataset, function(key, value){
addToCartData[ key ]=value;
});
_this.prop('disabled', true);
$.ajax({
type: 'POST',
url: wc_add_to_cart_params.wc_ajax_url.toString().replace('%%endpoint%%', 'add_to_cart'),
dataType: 'json',
data: addToCartData,
success: function(response){
$(document.body).trigger('wc_fragment_refresh');
$(document.body).trigger('added_to_cart');
_this.prop('disabled', false);
},
error: function(xhr, status, error){
_this.prop('disabled', false);
}});
}});
});
},
registerWidgetHandler: function(widgetName, callback){
if(! window.elementorFrontend||! window.elementorFrontend.hooks){
$(window).on('elementor/frontend/init', function(){
if(window.elementorFrontend&&window.elementorFrontend.hooks){
window.elementorFrontend.hooks.addAction('frontend/element_ready/' + widgetName,
callback
);
}});
return;
}
window.elementorFrontend.hooks.addAction('frontend/element_ready/' + widgetName,
callback
);
},
commonInit: function (){
if(window.jetWooBuilderData&&window.jetWooBuilderData.single_ajax_add_to_cart){
let $product=$('.woocommerce div.product');
if(! $product.hasClass('product-type-external') ){
$(document).on('click.JetWooBuilder', '.single_add_to_cart_button:not(.disabled)', JetWooBuilder.singleProductAjaxAddToCart);
}}
if(navigator.userAgent.indexOf('Safari')!==-1&&navigator.userAgent.indexOf('Chrome')===-1){
document.addEventListener('click', function(event){
if(event.target.matches('.add_to_cart_button .button-text') ){
event.target.parentNode.focus();
}
if(event.target.matches('.add_to_cart_button')||event.target.matches('.single_add_to_cart_button') ){
event.target.focus();
}});
}
$(document.body).bind('country_to_state_changing', function(event, country, wrapper){
setTimeout(function (){
JetWooBuilder.setAddressFieldsRequiredValidation(wrapper);
}, 500);
});
},
setAddressFieldsRequiredValidation: function(wrapper){
let $widget=wrapper.closest('.elementor-element'),
settings=JetWooBuilder.getElementorElementSettings($widget);
if(settings&&settings.modify_field){
let locale_fields=$.parseJSON(wc_address_i18n_params.locale_fields);
if(locale_fields){
$.each(locale_fields, function(key, value){
let fields_ids=value.split(',');
$.each(fields_ids, function(index, id){
let field=wrapper.find(id.trim());
if(field.length){
if(field.hasClass('jwb-field-required') ){
JetWooBuilder.fieldIsRequired(field, true);
}else if(field.hasClass('jwb-field-optional') ){
JetWooBuilder.fieldIsRequired(field, false);
}}
});
});
}}
},
fieldIsRequired: function(field, isRequired){
JetWooBuilder.modifyFieldLabelWhitespace(field);
if(isRequired){
field.find('label .optional').remove();
field.addClass('validate-required');
if(0===field.find('label .required').length){
field.find('label').append('&nbsp;<abbr class="required" title="' + wc_address_i18n_params.i18n_required_text + '">*</abbr>');
}}else{
field.find('label .required').remove();
field.removeClass('validate-required woocommerce-invalid woocommerce-invalid-required-field');
if(0===field.find('label .optional').length){
field.find('label').append('&nbsp;<span class="optional">(' + wc_address_i18n_params.i18n_optional_text + ')</span>');
}}
},
modifyFieldLabelWhitespace: function(field){
let label=field.find('label').html();
if(label){
field.find('label').html(label.replace(/&nbsp;/g, '').trim());
}},
handleInputQuantityValue: function($scope){
let $eWidget=$scope.closest('.elementor-widget'),
settings=JetWooBuilder.getElementorElementSettings($eWidget);
if(settings&&'yes'===settings.show_quantity){
let $cartForm=$scope.find('form.cart');
$cartForm.on('change', 'input.qty', function(){
if('0'===this.value&&! $(this.form).hasClass('grouped_form') ){
this.value='1';
}
let $button=$(this.form).find('button[data-quantity]');
$button.attr('data-quantity', this.value);
if(this.max){
if(+this.value > +this.max){
$button.removeClass('ajax_add_to_cart');
}else if(! $button.hasClass('ajax_add_to_cart') ){
$button.addClass('ajax_add_to_cart');
}}
});
}},
jetPopupLoaded:function(event, popupData){
if(! popupData.data.isJetWooBuilder){
return;
}
const $jetPopup=$('#' + popupData.data.popupId);
$jetPopup.addClass('woocommerce product single-product quick-view-product');
$jetPopup.find('.jet-popup__container-content').addClass('product');
setTimeout(function(){
$(window).trigger('resize');
$('.jet-popup .variations_form').each(function(){
$(this).wc_variation_form();
});
$('.jet-popup .woocommerce-product-gallery.images').each(function(){
$(this).wc_product_gallery();
});
}, 300);
},
prepareJetPopup: function(popupData, widgetData, $scope, event){
if(widgetData['is-jet-woo-builder']){
let $product;
popupData['isJetWooBuilder']=true;
popupData['templateId']=widgetData['jet-woo-builder-qv-template'];
if($scope.hasClass('elementor-widget-jet-woo-products')||$scope.hasClass('elementor-widget-jet-woo-products-list') ){
$product=$(event.target).parents('.jet-woo-builder-product');
}else{
$product=$scope.parents('.jet-woo-builder-product');
}
if($product.length){
popupData['productId']=$product.data('product-id');
}}
return popupData;
},
mobileHoverOnTouch: function($item, thumbnail){
if('undefined'!==typeof window.ontouchstart){
$item.each(function(){
let $this=$(this),
$thumbnailLink=$this.find(thumbnail + ' a'),
$adjacentItems=$this.siblings();
if($this.hasClass('jet-woo-products__item') ){
let $itemContent=$this.not(thumbnail);
$itemContent.each(function(){
let $currentItem=$(this);
JetWooBuilder.mobileTouchEvent($this, $currentItem, $adjacentItems);
});
}
JetWooBuilder.mobileTouchEvent($this, $thumbnailLink, $adjacentItems);
});
}},
mobileTouchEvent: function($target, $item, $adjacentItems){
$item.on('click', function(event){
if(! $target.hasClass('mobile-hover') ){
event.preventDefault();
$adjacentItems.each(function(){
if($(this).hasClass('mobile-hover') ){
$(this).removeClass('mobile-hover');
}});
$target.addClass('mobile-hover');
}});
},
initCarousel: function($target, options){
let $eWidget=$target.closest('.elementor-widget'),
slidesCount=$target.find('.swiper-slide').length,
settings=JetWooBuilder.getElementorElementSettings($eWidget),
eBreakpoints=window.elementorFrontend.config.responsive.activeBreakpoints,
defaultOptions={},
slidesToShow=+settings.columns||4,
slideOverflow=settings.slides_overflow_enabled&&settings.slides_overflow ? +settings.slides_overflow:0,
spaceBetween=undefined!==settings.space_between_slides ? +settings.space_between_slides:10,
defaultSlidesToShowMap={
mobile: 1,
tablet: 2
};
defaultOptions={
slidesPerView: slidesToShow + slideOverflow,
spaceBetween: spaceBetween,
crossFade: 'fade'===options.effect,
handleElementorBreakpoints: true
}
defaultOptions.breakpoints={};
let lastBreakpointSlidesToShowValue=slidesToShow;
Object.keys(eBreakpoints).reverse().forEach(breakpointName=> {
const defaultSlidesToShow=defaultSlidesToShowMap[ breakpointName ] ? defaultSlidesToShowMap[ breakpointName ]:lastBreakpointSlidesToShowValue;
const bpSlidesToShow=+settings[ 'columns_' + breakpointName ]||defaultSlidesToShow;
const bpSlideOverflow=settings.slides_overflow_enabled&&settings[ 'slides_overflow_' + breakpointName ] ? +settings[ 'slides_overflow_' + breakpointName ]:slideOverflow;
defaultOptions.breakpoints[ eBreakpoints[ breakpointName ].value ]={
slidesPerView: bpSlidesToShow + bpSlideOverflow,
slidesPerGroup: +settings[ 'slides_to_scroll_' + breakpointName ]||options.slidesPerGroup,
spaceBetween: undefined!==settings['space_between_slides_' + breakpointName] ? +settings['space_between_slides_' + breakpointName]:spaceBetween
};
lastBreakpointSlidesToShowValue=+settings[ 'columns_' + breakpointName ]||defaultSlidesToShow;
});
if(options.paginationEnable){
defaultOptions.pagination={
el: '.swiper-pagination',
clickable: true,
dynamicBullets: options.dynamicBullets
}}
if(options.navigationEnable){
defaultOptions.navigation={
nextEl: '.jet-swiper-button-next',
prevEl: '.jet-swiper-button-prev',
}}
let currentDeviceSlidePerView=+settings[ 'columns_' + elementorFrontend.getCurrentDeviceMode() ]||+settings['columns'];
if(slidesCount > currentDeviceSlidePerView){
const Swiper=elementorFrontend.utils.swiper;
new Swiper($target, $.extend({}, defaultOptions, options) ).then(swiper=> {
$(document).trigger('jet-woo-builder-swiper-initialized', swiper);
if('vertical'===options.direction&&options.paginationEnable&&options.dynamicBullets){
$target.find('.swiper-pagination').css('width', $target.find('.swiper-pagination-bullet-active').width());
}});
$target.find('.jet-arrow').show();
}else if(options.direction==='vertical'){
$target.addClass('swiper-container-vertical');
$target.find('.jet-arrow').hide();
}else{
$target.find('.jet-arrow').hide();
}},
handleJetPopupWithWCEvents: function(event, fragments, hash, button){
let popupWrapper=$(button).closest('.jet-popup');
if(popupWrapper.length&&popupWrapper.hasClass('quick-view-product') ){
$(window).trigger({
type: 'jet-popup-close-trigger',
popupData: {
popupId: popupWrapper.attr('id'),
constantly: false
}});
}
let purchasePopupData=$(button).closest('[data-purchase-popup-id]');
if(purchasePopupData.length){
let popupId=purchasePopupData.data('purchase-popup-id');
if(popupId){
$(window).trigger({
type: 'jet-popup-open-trigger',
popupData: window.JetPlugins.hooks.applyFilters('jet-woo-builder.purchase-popup.data', {
popupId: 'jet-popup-' + popupId
}, event, fragments, hash, button)
});
}}
},
singleProductAjaxAddToCart: function(event){
if(event){
event.preventDefault();
}
let $form=$(this).closest('form');
if(! $form[0].checkValidity()){
$form[0].reportValidity();
return false;
}
let $thisBtn=$(this),
product_id=$thisBtn.val()||'',
cartFormData=$form.serialize();
$.ajax({
type: 'POST',
url: window.jetWooBuilderData.ajax_url,
data: 'action=jet_woo_builder_add_cart_single_product&add-to-cart=' + product_id + '&' + cartFormData,
beforeSend: function (){
$thisBtn.removeClass('added').addClass('loading');
},
complete: function (){
$thisBtn.addClass('added').removeClass('loading');
},
success: function(response){
if(! response){
return;
}
if(response.error&&response.product_url){
window.location=response.product_url;
return;
}
if('undefined'===typeof wc_add_to_cart_params){
return;
}
$(document.body).trigger('wc_fragment_refresh');
$(document.body).trigger('added_to_cart', [ response.fragments, response.cart_hash, $thisBtn ]);
$('.woocommerce-notices-wrapper').html(response.fragments.notices_html);
},
});
return false;
},
handleListingItemClick: function(event){
let url=$(this).data('url'),
target=$(this).data('target')||false;
if(url){
event.preventDefault();
if((window.elementorFrontend&&window.elementorFrontend.isEditMode())
|| $(event.target).parents('.jet-compare-button__link').length
|| $(event.target).parents('.jet-wishlist-button__link').length
|| $(event.target).parents('.jet-quickview-button__link').length
){
return;
}
if('_blank'===target){
window.open(url);
return;
}
window.location=url;
}},
getElementorElementSettings: function($scope){
if(window.elementorFrontend&&window.elementorFrontend.isEditMode()&&$scope.hasClass('elementor-element-edit-mode') ){
return JetWooBuilder.getEditorElementSettings($scope);
}
return $scope.data('settings')||{};},
getEditorElementSettings: function($scope){
let modelCID=$scope.data('model-cid'),
elementData;
if(! modelCID){
return {};}
if(! window.elementorFrontend.hasOwnProperty('config') ){
return {};}
if(! window.elementorFrontend.config.hasOwnProperty('elements') ){
return {};}
if(! window.elementorFrontend.config.elements.hasOwnProperty('data') ){
return {};}
elementData=window.elementorFrontend.config.elements.data[ modelCID ];
if(! elementData){
return {};}
return elementData.toJSON();
},
initFilteredContentWidgets: function($content){
if(! window.elementorFrontend||! window.elementorFrontend.hooks){
return;
}
let widgetTypes=[
'jet-woo-products.default',
'jet-woo-products-list.default',
'jet-woo-builder-archive-add-to-cart.default',
'jet-woo-categories.default',
'jet-cart-table.default',
'jet-woo-builder-products-loop.default',
];
widgetTypes.forEach(function(widgetType){
$content
.find('[data-widget_type="' + widgetType + '"]')
.addBack('[data-widget_type="' + widgetType + '"]')
.each(function(){
window.elementorFrontend.hooks.doAction('frontend/element_ready/' + widgetType, $(this), $);
});
});
},
elementorFrontendInit: function($content){
if(! window.elementorFrontend||! window.elementorFrontend.hooks){
return;
}
$content.find('[data-element_type]').each(function(){
let $this=$(this),
elementType=$this.data('element_type');
if(! elementType){
return;
}
if('widget'===elementType){
elementType=$this.data('widget_type');
window.elementorFrontend.hooks.doAction('frontend/element_ready/widget', $this, $);
}
window.elementorFrontend.hooks.doAction('frontend/element_ready/global', $this, $);
window.elementorFrontend.hooks.doAction('frontend/element_ready/' + elementType, $this, $);
});
}};
$(window).on('elementor/frontend/init', JetWooBuilder.init);
JetWooBuilder.commonInit();
window.JetWooBuilder=JetWooBuilder;
}(jQuery) );