'use strict';(function($){var $storage=true;var added_ids=[];var key=Cookies.get('klbwl_key');try{$storage=('sessionStorage'in window&&window.sessionStorage!==null);window.sessionStorage.setItem('klbwl','test');window.sessionStorage.removeItem('klbwl');}catch(err){$storage=false;}$(function(){if(key===null||key===undefined||key===''){key=klbwl_get_key();Cookies.set('klbwl_key',key,{expires:7});}klbwl_load_data();});$(document).on('klbwl_change_count',function(){klbwl_load_count();});$(document).on('click touch','.klbwl-btn',function(e){var $this=$(this);var id=$this.attr('data-product_id');var pid=$this.attr('data-pid');var product_id=$this.attr('data-product_id');var product_title=$this.attr('data-product_title');if(typeof pid!==typeof undefined&&pid!==false){id=pid;}if(typeof product_id!==typeof undefined&&product_id!==false){id=product_id;}var data={cache:false,action:'wishlist_add',product_id:id,};$this.addClass('klbwl-adding');$.post(klbwl_vars.ajax_url,data,function(response){$this.removeClass('klbwl-adding');if(response.content!=null){$('#klbwl_wishlist').html(response.content).addClass('klbwl-loaded');}if(response.notice!=null){klbwl_notice(response.notice.replace('{name}','<strong>'+product_title+'</strong>'));}klbwl_wishlist_show();if(response.count!=null){klbwl_change_count(response.count);}if(response.totalcount!=null){$this.closest('.wishlist-button').find('.totalcount').html(response.totalcount);}if(response.status===1){klbwl_refresh_button_id(id);}if($storage&&response.data){sessionStorage.setItem('klbwl_data_'+response.data.key,JSON.stringify(response.data));}if(response.data.ids){klbwl_refresh_buttons(response.data.ids);klbwl_refresh_ids(response.data.ids);}$(document.body).trigger('klbwl_add',[id]);});e.preventDefault();});$(document).on('click touch','.klbwl-item--remove span',function(e){var $this=$(this);var key=$this.closest('.klbwl-popup-inner').data('key');var $this_item=$this.closest('.klbwl-item');var product_id=$this_item.attr('data-product_id');var data={action:'wishlist_remove',product_id:product_id,key:key,};$this.addClass('klbwl-removing');$.post(klbwl_vars.ajax_url,data,function(response){$this.removeClass('klbwl-removing');$this_item.remove();if(response.content!=null){$('#klbwl_wishlist').html(response.content).addClass('klbwl-loaded');}if(response.notice!=null){klbwl_notice(response.notice);}if(response.count!=null){klbwl_change_count(response.count);}if($storage&&response.data){sessionStorage.setItem('klbwl_data_'+response.data.key,JSON.stringify(response.data));}if(response.data.ids){klbwl_refresh_buttons(response.data.ids);klbwl_refresh_ids(response.data.ids);}$(document.body).trigger('klbwl_remove',[product_id]);});e.preventDefault();});$(document).on('click touch','.klbwl-popup',function(e){var klbwl_content=$('.klbwl-popup-content');if($(e.target).closest(klbwl_content).length==0){klbwl_wishlist_hide();}});$(document).on('click touch','#klbwl_wishlist .klbwl-popup-close',function(e){klbwl_wishlist_hide();e.preventDefault();});function klbwl_load_count(){var data={action:'wishlist_load_count',};$.post(klbwl_vars.ajax_url,data,function(response){if(response.count!=null){var count=response.count;$('.klbwl-wishlist-count').html(count);klbwl_change_count(count);$(document.body).trigger('klbwl_load_count',[count]);}});}function klbwl_wishlist_show(){$('#klbwl_wishlist').addClass('klbwl-show');$(document.body).trigger('klbwl_wishlist_show');}function klbwl_wishlist_hide(){$('#klbwl_wishlist').removeClass('klbwl-show');$(document.body).trigger('klbwl_wishlist_hide');}function klbwl_change_count(count){$('#klbwl_wishlist .klbwl-count').html(count);if(parseInt(count)>0){$('.klbwl-empty').show();}else{$('.klbwl-empty').hide();}$(document.body).trigger('klbwl_change_count',[count]);}function klbwl_notice(notice){$('.klbwl-notice').html(notice);klbwl_notice_show();setTimeout(function(){klbwl_notice_hide();},3000);}function klbwl_notice_show(){$('#klbwl_wishlist .klbwl-notice').addClass('klbwl-notice-show');}function klbwl_notice_hide(){$('#klbwl_wishlist .klbwl-notice').removeClass('klbwl-notice-show');}function klbwl_html_entities(str){return String(str).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;');}function klbwl_get_key(){var result=[];var characters='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';var charactersLength=characters.length;for(var i=0;i<6;i++){result.push(characters.charAt(Math.floor(Math.random()*charactersLength)));}return result.join('');}function klbwl_load_data(){if($storage){try{var data=JSON.parse(sessionStorage.getItem('klbwl_data_'+key));if(data.ids){klbwl_refresh_buttons(data.ids);klbwl_refresh_ids(data.ids);}if(data.key&&(key===null||key===undefined||key==='')){Cookies.set('klbwl_key',data.key,{expires:7});}}catch(err){klbwl_get_data();}}else{klbwl_get_data();}}function klbwl_get_data(){var data={action:'klbwl_get_data',};$.post(klbwl_vars.ajax_url,data,function(response){if(response){if($storage){sessionStorage.setItem('klbwl_data_'+response.key,JSON.stringify(response));}if(response.ids){klbwl_refresh_buttons(response.ids);klbwl_refresh_ids(response.ids);}if(response.key&&(key===null||key===undefined||key===''||key!==response.key)){Cookies.set('klbwl_key',response.key,{expires:7});}$(document.body).trigger('klbwl_data_refreshed',[response]);}});}function klbwl_refresh_ids(ids){added_ids=ids;}function klbwl_refresh_buttons(ids){$('.klbwl-btn').removeClass('klbwl-product-in-list');$('.klbwl-btn').html(klbwl_vars.button_text);$.each(ids,function(key,value){$('.klbwl-btn-'+key).addClass('klbwl-product-in-list');$('.klbwl-btn-'+key).html(klbwl_vars.button_text_added);if(value.parent!==undefined){$('.klbwl-btn-'+value.parent).addClass('klbwl-product-in-list');$('.klbwl-btn-'+value.parent).html(klbwl_vars.button_text_added);}});$(document.body).trigger('klbwl_buttons_refreshed',[ids]);}function klbwl_refresh_button_id(id){$('.klbwl-btn[data-product_id="'+id+'"]').removeClass('klbwl-product-in-list');$('.klbwl-btn[data-product_id="'+id+'"]').html(klbwl_vars.button_text);$.each(added_ids,function(key){if(parseInt(key)===parseInt(id)){$('.klbwl-btn[data-product_id="'+id+'"]').addClass('klbwl-product-in-list');$('.klbwl-btn[data-product_id="'+id+'"]').html(klbwl_vars.button_text_added);}});$(document.body).trigger('klbwl_refresh_button_id',[id,added_ids]);}})(jQuery);(function($){"use strict";$(document).on('blonweShopPageInit',function(){woocommerceProductBoxVariableAjax();});function woocommerceProductBoxVariableAjax(){$('body').append('<div class="klb-notice-ajax"></div>');$('.products .product a.product_type_variable').on('click',function(e){e.preventDefault();setTimeout(()=>{$(this).closest('.product').find('.variations_form button.single_add_to_cart_button').trigger('click');},10);});$('.products .product form.variations_form').on('submit',function(e){e.preventDefault();var form=$(this);var formData=new FormData(form[0]);formData.append('add-to-cart',form.find('[name=add-to-cart]').val());formData.append('klb-product-box-variable',form.find('[name=add-to-cart]').val());$.ajax({url:wc_add_to_cart_params.wc_ajax_url.toString().replace('%%endpoint%%','blonwe_add_to_cart_variable_archive'),data:formData,type:'POST',processData:false,contentType:false,beforeSend:function(){form.closest('.product').find('a.product_type_variable').addClass('loading');},complete:function(response){response=response.responseJSON;if(wc_add_to_cart_params.cart_redirect_after_add==='yes'){window.location=wc_add_to_cart_params.cart_url;return;}if(!response){return;}if(response.error&&response.product_url){window.location=response.product_url;return;}var $thisbutton=form.find('.single_add_to_cart_button');$(document.body).trigger('added_to_cart',[response.fragments,response.cart_hash,$thisbutton]);$(response.fragments.notices_html).appendTo('.klb-notice-ajax').delay(3000).fadeOut(300,function(){$(this).remove();});$('.woocommerce-message, .woocommerce-error').append('<div class="klb-notice-close"><i class="klb-icon-xmark-thin"></i></div>');$('.klb-notice-close').on('click',function(){$(this).closest('.woocommerce-message, .woocommerce-error').remove();});form.closest('.product').find('a.product_type_variable').removeClass('loading');},dataType:'json'});});}$(document).ready(function(){woocommerceProductBoxVariableAjax();});}(jQuery));var blonweThemeModule={};(function($){blonweThemeModule.$window=$(window);blonweThemeModule.$document=$(document);blonweThemeModule.$body=$('body');})(jQuery);(function($){function fnPjax(selector,container,options){options=optionsFor(container,options);return this.on('click.pjax',selector,function(event){var opts=options;if(!opts.container){opts=$.extend({},options);opts.container=$(this).attr('data-pjax');}handleClick(event,opts);});}function handleClick(event,container,options){options=optionsFor(container,options);var link=event.currentTarget;var $link=$(link);if(link.tagName.toUpperCase()!=='A'){throw'$.fn.pjax or $.pjax.click requires an anchor element';}if(event.which>1||event.metaKey||event.ctrlKey||event.shiftKey||event.altKey){return;}if(location.protocol!==link.protocol||location.hostname!==link.hostname){return;}if(link.href.indexOf('#')>-1&&stripHash(link)==stripHash(location)){return;}if(event.isDefaultPrevented()){return;}var defaults={url:link.href,container:$link.attr('data-pjax'),target:link};var opts=$.extend({},defaults,options);var clickEvent=$.Event('pjax:click');$link.trigger(clickEvent,[opts]);if(!clickEvent.isDefaultPrevented()){pjax(opts);event.preventDefault();$link.trigger('pjax:clicked',[opts]);}}function handleSubmit(event,container,options){options=optionsFor(container,options);var form=event.currentTarget;var $form=$(form);if(form.tagName.toUpperCase()!=='FORM'){throw'$.pjax.submit requires a form element';}var defaults={type:($form.attr('method')||'GET').toUpperCase(),url:$form.attr('action'),container:$form.attr('data-pjax'),target:form};if(defaults.type!=='GET'&&window.FormData!==undefined){defaults.data=new FormData(form);defaults.processData=false;defaults.contentType=false;}else{if($form.find(':file').length){return;}defaults.data=$form.serializeArray();}pjax($.extend({},defaults,options));event.preventDefault();}function pjax(options){options=$.extend(true,{},$.ajaxSettings,pjax.defaults,options);if(typeof options.url==='function'){options.url=options.url();}var hash=parseURL(options.url).hash;var containerType=typeof options.container;if(containerType!=='string'){throw'expected string value for \'container\' option; got '+containerType;}var context=options.context=$(options.container);if(!context.length){throw'the container selector \''+options.container+'\' did not match anything';}if(!options.data){options.data={};}if(Array.isArray(options.data)){options.data.push({name:'_pjax',value:options.container});}else{options.data._pjax=options.container;}function fire(type,args,props){if(!props){props={};}props.relatedTarget=options.target;var event=$.Event(type,props);context.trigger(event,args);return!event.isDefaultPrevented();}var timeoutTimer;options.beforeSend=function(xhr,settings){if(settings.type!=='GET'){settings.timeout=0;}xhr.setRequestHeader('X-PJAX','true');xhr.setRequestHeader('X-PJAX-Container',options.container);if(!fire('pjax:beforeSend',[xhr,settings])){return false;}if(settings.timeout>0){timeoutTimer=setTimeout(function(){if(fire('pjax:timeout',[xhr,options])){xhr.abort('timeout');}},settings.timeout);settings.timeout=0;}var url=parseURL(settings.url);if(hash){url.hash=hash;}options.requestUrl=stripInternalParams(url);};options.complete=function(xhr,textStatus){if(timeoutTimer){clearTimeout(timeoutTimer);}fire('pjax:complete',[xhr,textStatus,options]);fire('pjax:end',[xhr,options]);};options.error=function(xhr,textStatus,errorThrown){var container=extractContainer('',xhr,options);var allowed=fire('pjax:error',[xhr,textStatus,errorThrown,options]);if(options.type=='GET'&&textStatus!=='abort'&&allowed){locationReplace(container.url);}};options.success=function(data,status,xhr){var previousState=pjax.state;var currentVersion=typeof $.pjax.defaults.version==='function'?$.pjax.defaults.version():$.pjax.defaults.version;var latestVersion=xhr.getResponseHeader('X-PJAX-Version');var container=extractContainer(data,xhr,options);var url=parseURL(container.url);if(hash){url.hash=hash;container.url=url.href;}if(currentVersion&&latestVersion&&currentVersion!==latestVersion){locationReplace(container.url);return;}if(!container.contents){locationReplace(container.url);return;}pjax.state={id:options.id||uniqueId(),url:container.url,title:container.title,container:options.container,fragment:options.fragment,timeout:options.timeout};if(options.push||options.replace){window.history.replaceState(pjax.state,container.title,container.url);}var blurFocus=$.contains(context,document.activeElement);if(blurFocus){try{document.activeElement.blur();}catch(e){}}if(container.title){document.title=container.title;}fire('pjax:beforeReplace',[container.contents,options],{state:pjax.state,previousState:previousState});if('function'===typeof options.renderCallback){options.renderCallback(context,container.contents,afterRender);}else{context.html(container.contents);afterRender();}function afterRender(){var autofocusEl=context.find('input[autofocus], textarea[autofocus]').last()[0];if(autofocusEl&&document.activeElement!==autofocusEl){autofocusEl.focus();}executeScriptTags(container.scripts);var scrollTo=options.scrollTo;if(hash){var name=decodeURIComponent(hash.slice(1));var target=document.getElementById(name)||document.getElementsByName(name)[0];if(target){scrollTo=$(target).offset().top;}}if(typeof scrollTo=='number'){$(window).scrollTop(scrollTo);}fire('pjax:success',[data,status,xhr,options]);}};if(!pjax.state){pjax.state={id:uniqueId(),url:window.location.href,title:document.title,container:options.container,fragment:options.fragment,timeout:options.timeout};window.history.replaceState(pjax.state,document.title);}abortXHR(pjax.xhr);pjax.options=options;var xhr=pjax.xhr=$.ajax(options);if(xhr.readyState>0){if(options.push&&!options.replace){cachePush(pjax.state.id,[options.container,cloneContents(context)]);window.history.pushState(null,'',options.requestUrl);}fire('pjax:start',[xhr,options]);fire('pjax:send',[xhr,options]);}return pjax.xhr;}function pjaxReload(container,options){var defaults={url:window.location.href,push:false,replace:true,scrollTo:false};return pjax($.extend(defaults,optionsFor(container,options)));}function locationReplace(url){window.history.replaceState(null,'',pjax.state.url);window.location.replace(url);}var initialPop=true;var initialURL=window.location.href;var initialState=window.history.state;if(initialState&&initialState.container){pjax.state=initialState;}if('state'in window.history){initialPop=false;}function onPjaxPopstate(event){if(!initialPop){abortXHR(pjax.xhr);}var previousState=pjax.state;var state=event.state;var direction;if(state&&state.container){if(initialPop&&initialURL==state.url){return;}if(previousState){if(previousState.id===state.id){return;}direction=previousState.id<state.id?'forward':'back';}var cache=cacheMapping[state.id]||[];var containerSelector=cache[0]||state.container;var container=$(containerSelector),contents=cache[1];if(container.length){if(previousState){cachePop(direction,previousState.id,[containerSelector,cloneContents(container)]);}var popstateEvent=$.Event('pjax:popstate',{state:state,direction:direction});container.trigger(popstateEvent);var options={id:state.id,url:state.url,container:containerSelector,push:false,fragment:state.fragment,timeout:state.timeout,scrollTo:false};if(contents){container.trigger('pjax:start',[null,options]);pjax.state=state;if(state.title){document.title=state.title;}var beforeReplaceEvent=$.Event('pjax:beforeReplace',{state:state,previousState:previousState});container.trigger(beforeReplaceEvent,[contents,options]);container.html(contents);container.trigger('pjax:end',[null,options]);}else{pjax(options);}container[0].offsetHeight;}else{locationReplace(location.href);}}initialPop=false;}function fallbackPjax(options){var url=typeof options.url==='function'?options.url():options.url,method=options.type?options.type.toUpperCase():'GET';var form=$('<form>',{method:method==='GET'?'GET':'POST',action:url,style:'display:none'});if(method!=='GET'&&method!=='POST'){form.append($('<input>',{type:'hidden',name:'_method',value:method.toLowerCase()}));}var data=options.data;if(typeof data==='string'){$.each(data.split('&'),function(index,value){var pair=value.split('=');form.append($('<input>',{type:'hidden',name:pair[0],value:pair[1]}));});}else if(Array.isArray(data)){$.each(data,function(index,value){form.append($('<input>',{type:'hidden',name:value.name,value:value.value}));});}else if(typeof data==='object'){var key;for(key in data){form.append($('<input>',{type:'hidden',name:key,value:data[key]}));}}$(document.body).append(form);form.submit();}function abortXHR(xhr){if(xhr&&xhr.readyState<4){xhr.onreadystatechange=$.noop;xhr.abort();}}function uniqueId(){return(new Date).getTime();}function cloneContents(container){var cloned=container.clone();cloned.find('script').each(function(){if(!this.src){jQuery._data(this,'globalEval',false);}});return cloned.contents();}function stripInternalParams(url){url.search=url.search.replace(/([?&])(_pjax|_)=[^&]*/g,'').replace(/^&/,'');return url.href.replace(/\?($|#)/,'$1');}function parseURL(url){var a=document.createElement('a');a.href=url;return a;}function stripHash(location){return location.href.replace(/#.*/,'');}function optionsFor(container,options){if(container&&options){options=$.extend({},options);options.container=container;return options;}else if($.isPlainObject(container)){return container;}else{return{container:container};}}function findAll(elems,selector){return elems.filter(selector).add(elems.find(selector));}function parseHTML(html){return $.parseHTML(html,document,true);}function extractContainer(data,xhr,options){var obj={},fullDocument=/<html/i.test(data);var serverUrl=xhr.getResponseHeader('X-PJAX-URL');obj.url=serverUrl?stripInternalParams(parseURL(serverUrl)):options.requestUrl;var $head,$body;if(fullDocument){$body=$(parseHTML(data.match(/<body[^>]*>([\s\S.]*)<\/body>/i)[0]));var head=data.match(/<head[^>]*>([\s\S.]*)<\/head>/i);$head=head!=null?$(parseHTML(head[0])):$body;}else{$head=$body=$(parseHTML(data));}if($body.length===0){return obj;}obj.title=findAll($head,'title').last().text();if(options.fragment){var $fragment=$body;if(options.fragment!=='body'){$fragment=findAll($fragment,options.fragment).first();}if($fragment.length){obj.contents=options.fragment==='body'?$fragment:$fragment.contents();if(!obj.title){obj.title=$fragment.attr('title')||$fragment.data('title');}}}else if(!fullDocument){obj.contents=$body;}if(obj.contents){obj.contents=obj.contents.not(function(){return $(this).is('title');});obj.contents.find('title').remove();obj.scripts=findAll(obj.contents,'script[src]').remove();obj.contents=obj.contents.not(obj.scripts);}if(obj.title){obj.title=$.trim(obj.title);}return obj;}function executeScriptTags(scripts){if(!scripts){return;}var existingScripts=$('script[src]');scripts.each(function(){var src=this.src;var matchedScripts=existingScripts.filter(function(){return this.src===src;});if(matchedScripts.length){return;}var script=document.createElement('script');var type=$(this).attr('type');if(type){script.type=type;}script.src=$(this).attr('src');document.head.appendChild(script);});}var cacheMapping={};var cacheForwardStack=[];var cacheBackStack=[];function cachePush(id,value){cacheMapping[id]=value;cacheBackStack.push(id);trimCacheStack(cacheForwardStack,0);trimCacheStack(cacheBackStack,pjax.defaults.maxCacheLength);}function cachePop(direction,id,value){var pushStack,popStack;cacheMapping[id]=value;if(direction==='forward'){pushStack=cacheBackStack;popStack=cacheForwardStack;}else{pushStack=cacheForwardStack;popStack=cacheBackStack;}pushStack.push(id);id=popStack.pop();if(id){delete cacheMapping[id];}trimCacheStack(pushStack,pjax.defaults.maxCacheLength);}function trimCacheStack(stack,length){while(stack.length>length){delete cacheMapping[stack.shift()];}}function findVersion(){return $('meta').filter(function(){var name=$(this).attr('http-equiv');return name&&name.toUpperCase()==='X-PJAX-VERSION';}).attr('content');}function enable(){$.fn.pjax=fnPjax;$.pjax=pjax;$.pjax.enable=$.noop;$.pjax.disable=disable;$.pjax.click=handleClick;$.pjax.submit=handleSubmit;$.pjax.reload=pjaxReload;$.pjax.defaults={timeout:5000,push:true,replace:false,type:'GET',dataType:'html',scrollTo:0,maxCacheLength:20,version:findVersion};$(window).on('popstate.pjax',onPjaxPopstate);}function disable(){$.fn.pjax=function(){return this;};$.pjax=fallbackPjax;$.pjax.enable=enable;$.pjax.disable=$.noop;$.pjax.click=$.noop;$.pjax.submit=$.noop;$.pjax.reload=function(){window.location.reload();};$(window).off('popstate.pjax',onPjaxPopstate);}if($.event.props&&$.inArray('state',$.event.props)<0){$.event.props.push('state');}else if(!('state'in $.Event.prototype)){$.event.addProp('state');}$.support.pjax=window.history&&window.history.pushState&&window.history.replaceState&&!navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]\D|WebApps\/.+CFNetwork)/)
if($.support.pjax){enable()}else{disable()}})(jQuery);(function($){blonweThemeModule.$document.on('blonweShopPageInit',function(){blonweThemeModule.sortByWidget();});blonweThemeModule.sortByWidget=function(){var $wcOrdering=$('.woocommerce-ordering');$wcOrdering.on('change','select.orderby',function(){var $form=$(this).closest('form');$form.find('[name="_pjax"]').remove();$.pjax({container:'.site-content',timeout:blonwe_settings.pjax_timeout,url:'?'+$form.serialize(),scrollTo:false,renderCallback:function(context,html,afterRender){context.html(html);afterRender();}});});$wcOrdering.on('submit',function(e){e.preventDefault(e);});};$(document).ready(function(){blonweThemeModule.sortByWidget();});})(jQuery);(function($){blonweThemeModule.$document.on('blonweShopPageInit',function(){blonweThemeModule.perpage();});blonweThemeModule.perpage=function(){var $wcperpage=$('.products-per-page');$wcperpage.on('change','select.perpage',function(){var $form=$(this).closest('form');$form.find('[name="_pjax"]').remove();$.pjax({container:'.site-content',timeout:blonwe_settings.pjax_timeout,url:'?'+$form.serialize(),scrollTo:false,renderCallback:function(context,html,afterRender){context.html(html);afterRender();}});});$wcperpage.on('submit',function(e){e.preventDefault(e);});};$(document).ready(function(){blonweThemeModule.perpage();});})(jQuery);(function($){blonweThemeModule.$document.on(' blonweShopPageInit',function(){blonweThemeModule.woocommercePriceSlider1();});blonweThemeModule.woocommercePriceSlider1=function(){if($(".widget_price_filter")[0]){$(document.body).on('price_slider_create price_slider_slide',function(event,min,max){$('.price_slider_amount span.from').html(accounting.formatMoney(min,{symbol:woocommerce_price_slider_params.currency_format_symbol,decimal:woocommerce_price_slider_params.currency_format_decimal_sep,thousand:woocommerce_price_slider_params.currency_format_thousand_sep,precision:woocommerce_price_slider_params.currency_format_num_decimals,format:woocommerce_price_slider_params.currency_format}));$('.price_slider_amount span.to').html(accounting.formatMoney(max,{symbol:woocommerce_price_slider_params.currency_format_symbol,decimal:woocommerce_price_slider_params.currency_format_decimal_sep,thousand:woocommerce_price_slider_params.currency_format_thousand_sep,precision:woocommerce_price_slider_params.currency_format_num_decimals,format:woocommerce_price_slider_params.currency_format}));$(document.body).trigger('price_slider_updated',[min,max]);});function init_price_filter(){$('input#min_price, input#max_price').hide();$('.price_slider, .price_label').show();var min_price=$('.price_slider_amount #min_price').data('min'),max_price=$('.price_slider_amount #max_price').data('max'),step=$('.price_slider_amount').data('step')||1,current_min_price=$('.price_slider_amount #min_price').val(),current_max_price=$('.price_slider_amount #max_price').val();$('.price_slider:not(.ui-slider)').slider({range:true,animate:true,min:min_price,max:max_price,step:step,values:[current_min_price,current_max_price],create:function(){$('.price_slider_amount #min_price').val(current_min_price);$('.price_slider_amount #max_price').val(current_max_price);$(document.body).trigger('price_slider_create',[current_min_price,current_max_price]);},slide:function(event,ui){$('input#min_price').val(ui.values[0]);$('input#max_price').val(ui.values[1]);$(document.body).trigger('price_slider_slide',[ui.values[0],ui.values[1]]);},change:function(event,ui){$(document.body).trigger('price_slider_change',[ui.values[0],ui.values[1]]);}});}init_price_filter();$(document.body).on('init_price_filter',init_price_filter);var hasSelectiveRefresh=('undefined'!==typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.widgetsPreview&&wp.customize.widgetsPreview.WidgetPartial);if(hasSelectiveRefresh){wp.customize.selectiveRefresh.bind('partial-content-rendered',function(){init_price_filter();});}var $min_price=$('.price_slider_amount #min_price');var $max_price=$('.price_slider_amount #max_price');var $products=$('.products');if(typeof woocommerce_price_slider_params==='undefined'||$min_price.length<1||!$.fn.slider){return false;}var $slider=$('.price_slider');if($slider.slider('instance')!==undefined){return;}$('input#min_price, input#max_price').hide();$('.price_slider, .price_label').show();var min_price=$min_price.data('min'),max_price=$max_price.data('max'),current_min_price=parseInt(min_price,10),current_max_price=parseInt(max_price,10);if($products.attr('data-min_price')&&$products.attr('data-min_price').length>0){current_min_price=parseInt($products.attr('data-min_price'),10);}if($products.attr('data-max_price')&&$products.attr('data-max_price').length>0){current_max_price=parseInt($products.attr('data-max_price'),10);}$slider.slider({range:true,animate:true,min:min_price,max:max_price,values:[current_min_price,current_max_price],create:function(){$min_price.val(current_min_price);$max_price.val(current_max_price);blonweThemeModule.$body.trigger('price_slider_create',[current_min_price,current_max_price]);},slide:function(event,ui){$('input#min_price').val(ui.values[0]);$('input#max_price').val(ui.values[1]);blonweThemeModule.$body.trigger('price_slider_slide',[ui.values[0],ui.values[1]]);},change:function(event,ui){blonweThemeModule.$body.trigger('price_slider_change',[ui.values[0],ui.values[1]]);}});setTimeout(function(){blonweThemeModule.$body.trigger('price_slider_create',[current_min_price,current_max_price]);if($slider.find('.ui-slider-range').length>1){$slider.find('.ui-slider-range').first().remove();}},10);}};})(jQuery);