!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";function b(a){if(a instanceof Date)return a;if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),String(a).match(/\-/)&&(a=String(a).replace(/\-/g,"/")),new Date(a);throw new Error("Couldn't cast `"+a+"` to a date object.")}function c(a){var b=a.toString().replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");return new RegExp(b)}function d(a){return function(b){var d=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(d)for(var f=0,g=d.length;f<g;++f){var h=d[f].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),j=c(h[0]),k=h[1]||"",l=h[3]||"",m=null;h=h[2],i.hasOwnProperty(h)&&(m=i[h],m=Number(a[m])),null!==m&&("!"===k&&(m=e(l,m)),""===k&&m<10&&(m="0"+m.toString()),b=b.replace(j,m.toString()))}return b=b.replace(/%%/,"%")}}function e(a,b){var c="s",d="";return a&&(a=a.replace(/(:|;|\s)/gi,"").split(/\,/),1===a.length?c=a[0]:(d=a[0],c=a[1])),Math.abs(b)>1?c:d}var f=[],g=[],h={precision:100,elapse:!1,defer:!1};g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\/){2}[0-9]{4}([0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}([\/\-][0-9]{1,2}){2}([0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join("|"));var i={Y:"years",m:"months",n:"daysToMonth",d:"daysToWeek",w:"weeks",W:"weeksToMonth",H:"hours",M:"minutes",S:"seconds",D:"totalDays",I:"totalHours",N:"totalMinutes",T:"totalSeconds"},j=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.options=a.extend({},h),this.instanceNumber=f.length,f.push(this),this.$el.data("countdown-instance",this.instanceNumber),d&&("function"==typeof d?(this.$el.on("update.countdown",d),this.$el.on("stoped.countdown",d),this.$el.on("finish.countdown",d)):this.options=a.extend({},h,d)),this.setFinalDate(c),!1===this.options.defer&&this.start()};a.extend(j.prototype,{start:function(){null!==this.interval&&clearInterval(this.interval);var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},this.options.precision)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},toggle:function(){this.interval?this.stop():this.start()},pause:function(){this.stop()},resume:function(){this.start()},remove:function(){this.stop.call(this),f[this.instanceNumber]=null,delete this.$el.data().countdownInstance},setFinalDate:function(a){this.finalDate=b(a)},update:function(){if(0===this.$el.closest("html").length)return void this.remove();var b,c=void 0!==a._data(this.el,"events"),d=new Date;b=this.finalDate.getTime()-d.getTime(),b=Math.ceil(b/1e3),b=!this.options.elapse&&b<0?0:Math.abs(b),this.totalSecsLeft!==b&&c&&(this.totalSecsLeft=b,this.elapsed=d>=this.finalDate,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToWeek:Math.floor(this.totalSecsLeft/60/60/24)%7,daysToMonth:Math.floor(this.totalSecsLeft/60/60/24%30.4368),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),weeksToMonth:Math.floor(this.totalSecsLeft/60/60/24/7)%4,months:Math.floor(this.totalSecsLeft/60/60/24/30.4368),years:Math.abs(this.finalDate.getFullYear()-d.getFullYear()),totalDays:Math.floor(this.totalSecsLeft/60/60/24),totalHours:Math.floor(this.totalSecsLeft/60/60),totalMinutes:Math.floor(this.totalSecsLeft/60),totalSeconds:this.totalSecsLeft},this.options.elapse||0!==this.totalSecsLeft?this.dispatchEvent("update"):(this.stop(),this.dispatchEvent("finish")))},dispatchEvent:function(b){var c=a.Event(b+".countdown");c.finalDate=this.finalDate,c.elapsed=this.elapsed,c.offset=a.extend({},this.offset),c.strftime=d(this.offset),this.$el.trigger(c)}}),a.fn.wcstCountdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data("countdown-instance");if(void 0!==c){var d=f[c],e=b[0];j.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?(d.setFinalDate.call(d,e),d.start()):a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,e))}else new j(this,b[0],b[1])})}});;function humanized_time_span(a,b,c,d){function e(){for(var a=0;a<c[j].length;a++)if(null==c[j][a].ceiling||i<=c[j][a].ceiling)return c[j][a];return null}function f(){for(var a=i,b={},c=0;c<d.length;c++){var e=Math.floor(a/d[c][0]);a-=d[c][0]*e,b[d[c][1]]=e}return b}function g(a){var b=f();return h(a.text.replace(/\$(\w+)/g,function(){return b[arguments[1]]}),b)}function h(a,b){for(var c in b)if(1==b[c]){var d=new RegExp("\\b"+c+"\\b");singlularText=c.replace(d,function(){return arguments[0].replace(/s\b/g,"")}),a=a.replace(c,wcst_data.hard_texts[singlularText])}return a}c=c||{past:[{ceiling:60,text:"$seconds "+wcst_data.hard_texts.secs},{ceiling:3600,text:"$minutes "+wcst_data.hard_texts.mins},{ceiling:86400,text:"$hours "+wcst_data.hard_texts.hrs},{ceiling:604800,text:"$days "+wcst_data.hard_texts.days},{ceiling:2592e3,text:"$weeks "+wcst_data.hard_texts.weeks},{ceiling:31556926,text:"$months "+wcst_data.hard_texts.months},{ceiling:null,text:"$years years"}],future:[{ceiling:60,text:"$seconds "+wcst_data.hard_texts.secs},{ceiling:3600,text:"$minutes "+wcst_data.hard_texts.mins},{ceiling:86400,text:"$hours "+wcst_data.hard_texts.hrs},{ceiling:604800,text:"$days "+wcst_data.hard_texts.days},{ceiling:2592e3,text:"$weeks "+wcst_data.hard_texts.weeks},{ceiling:31556926,text:"$months "+wcst_data.hard_texts.months},{ceiling:null,text:"$years years"}]},d=d||[[31556926,"years"],[2629744,"months"],[604800,"weeks"],[86400,"days"],[3600,"hours"],[60,"minutes"],[1,"seconds"]],a=new Date(a),b=b?new Date(b):new Date;var i=(b-a)/1e3,j="past";return i<0&&(j="future",i=0-i),g(e())};!function(a){"use strict";function b(){a(".wcst_low_stock").html(""),a(".wcst_deal_expiry").not(".wcst_static").html(""),a(".woocommerce-variation.single_variation .wcst_you_save_variation").html("")}function c(){if(void 0!==wcst_data.settings&&void 0!==wcst_data.settings.deal_expiry)for(var b in wcst_data.settings.deal_expiry){var c=".wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b;if(0!==a(c).length){var f,g,h,i,k,l,o=wcst_data.settings.deal_expiry[b],p=a(c).find("span").attr("data-date"),q={to:p},r=q.to-wcst_data.utc0_time,s="";if(!a(c).hasClass("wcst_deal_expiry_variable")&&!a(c).hasClass("wcst_timer")&&"reverse_timer"!=o.display_mode){if("reverse_date"===o.display_mode&&(f=humanized_time_span(j(q.to),j(wcst_data.utc0_time)),g=o.reverse_date_label,h="{{time_left}}"),o.switch_period>0){if(!(r<3600*o.switch_period))continue;f="",g=o.reverse_timer_label,h="{{countdown_timer}}",i=" wcst_timer",k="days",r<86400&&(k="hrs")}f='<span data-diff="'+(q.to-wcst_data.utc0_time)+'" data-display="'+k+'">'+f+"</span>"," wcst_timer"==i&&a(".wcst_deal_expiry.wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b).addClass("wcst_timer"),l=h,s=new RegExp(l,"g"),g=g.replace(s,f),a(".wcst_deal_expiry.wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b).html(g)}}}a(".wcst_timer,.wcst_manual_timer").each(function(){a.ajax({url:wcst_data.ajax_url,type:"POST",data:{action:"wcst_refreshed_times",location:document.location.href,endDate:a(this).children("span").attr("data-date")},beforeSend:function(){m++},success:function(b){n++,a(".wcst_timer,.wcst_manual_timer").find("span[data-date='"+b.old_diff+"']").each(function(){jQuery(this).attr("data-diff",b.diff)}),m===n&&(e(),d())}})})}function d(){a(".wcst_manual_timer").length>0&&a(".wcst_manual_timer").each(function(){var b,c=a(this),d=c.children("span");b=d.attr("data-format");var e=parseInt(d.attr("data-diff")),f=(new Date).getTime()+1e3*e;d.wcstCountdown(f,function(c){a(this).text(c.strftime(b))})})}function e(){if(a(".wcst_timer").length>0){l=wcst_data.hard_texts;var b="D",c="D",d="h",e="h",f="m",g="m",h="s",i="s";void 0!==l.day&&""!=l.day&&(b=l.day),void 0!==l.days&&""!=l.days&&(c=l.days),void 0!==l.hr&&""!=l.hr&&(d=l.hr),void 0!==l.hrs&&""!=l.hrs&&(e=l.hrs),void 0!==l.mins&&""!=l.mins&&(f=l.mins),void 0!==l.min&&""!=l.min&&(g=l.min),void 0!==l.sec&&""!=l.sec&&(h=l.sec),void 0!==l.secs&&""!=l.secs&&(i=l.secs),a(".wcst_timer").each(function(){var j,k=a(this),l=k.children("span").not(".amount"),m=parseInt(l.attr("data-diff")),n=(new Date).getTime()+1e3*m,o=l.attr("data-display");l.wcstCountdown(n,function(k){var l=k.offset.totalDays>1?c:b,m=k.offset.hours>1?e:d,n=k.offset.minutes>1?f:g,p=k.offset.seconds>1?i:h;j="%H"+m+" %M"+n+" %S"+p,"days"==o&&(j="%-D "+l+" %H "+m+" %M "+n+" %S "+p),a(this).text(k.strftime(j))})})}}function f(a,b,c,d){var e,f,g=a.scarcity_label,h=a.assurance_label,i=a.backorder_label,j=a.out_of_stock_label,k=b&&"null"!=b?d.wcst_stock_qty:"";if((0===b||null===b||""===b)&&!0===d.wcst_is_on_backorder)return'<div class="wcst_low_stock_backorder"><span>'+i+"</span></div>";e="{{stock_quantity_left}}",f=new RegExp(e,"g"),g=g.replace(f,k),e="{{stock_quantity_left}}",f=new RegExp(e,"g"),h=h.replace(f,k);return!0===c?!1===d.wcst_manage_stock?'<div class="wcst_low_stock_assurance"><span>'+h+"</span></div>":0!==b&&null!==b&&""!==b||!1!==d.backorders_allowed?"0"==d.wcst_stock_qty&&!0===d.backorders_allowed?'<div class="wcst_low_stock_assurance"><span>'+h+"</span></div>":"scarcity"==a.default_mode?'<div class="wcst_low_stock_scarcity"><span>'+g+"</span></div>":a.switch_scarcity_min_stock>0&&a.switch_scarcity_min_stock>=d.wcst_stock_qty?'<div class="wcst_low_stock_scarcity"><span>'+g+"</span></div>":'<div class="wcst_low_stock_assurance"><span>'+h+"</span></div>":'<div class="wcst_low_stock_assurance"><span>'+h+"</span></div>":'<div class="wcst_low_stock_out"><span>'+j+"</span></div>"}function g(b,c,d){var e;if("yes"===c.show_below_variation_price){var f=d.display_regular_price,g=d.display_price,i=c.label,j=Math.abs(f-g);if(j>0&&a(".woocommerce-variation.single_variation").length>0&&a(".woocommerce-variation.single_variation .woocommerce-variation-price").length>0){var k=j/f*100,l=wcst_data.wc_decimal_count?wcst_data.wc_decimal_count:1;k=k.toFixed(l),k%1!=0&&"yes"!==c.hide_decimal_in_saving_percentage||(k=Math.floor(k)),e="{{savings_value}}",i.indexOf(e)>=0&&(i=i.split(e).join('<span class="you_save_value">'+h(j)+"</span>")),e="{{savings_percentage}}",i.indexOf(e)>=0&&(i=i.split(e).join('<span class="you_save_percentage">'+k+"%</span>")),e="{{savings_value_percentage}}",i.indexOf(e)>=0&&(i=i.split(e).join('<span class="you_save_value_percentage">'+h(j)+" ("+k+"%)</span>")),e="{{regular_price}}",i.indexOf(e)>=0&&(i=i.split(e).join('<span class="woocommerce-Price-amount amount">'+h(f)+"</span>")),e="{{sale_price}}",i.indexOf(e)>=0&&(i=i.split(e).join('<span class="woocommerce-Price-amount amount">'+h(g)+"</span>")),a(".woocommerce-variation.single_variation").find(".wcst_savings_variation").remove(),a(".woocommerce-variation.single_variation .woocommerce-variation-price").after('<div class="wcst_savings_variation wcst_savings_variation_key_'+wcst_data.current_postid+"_"+b+'">'+i+"</div>")}}}function h(a){var b;return"left"===wcst_data.currency_pos?b='<span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span>"+i(a,wcst_data.wc_decimal_count,wcst_data.wc_decimal_sep,wcst_data.wc_thousand_sep):"left_space"===wcst_data.currency_pos?b='<span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span> "+i(a,wcst_data.wc_decimal_count,wcst_data.wc_decimal_sep,wcst_data.wc_thousand_sep):"right"===wcst_data.currency_pos?b=i(a,wcst_data.wc_decimal_count,wcst_data.wc_decimal_sep,wcst_data.wc_thousand_sep)+'<span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span> ":"right_space"===wcst_data.currency_pos&&(b=i(a,wcst_data.wc_decimal_count,wcst_data.wc_decimal_sep,wcst_data.wc_thousand_sep)+' <span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span> "),b}function i(a,b,c,d){a=(a+"").replace(/[^0-9+\-Ee.]/g,"");var e=isFinite(+a)?+a:0,f=isFinite(+b)?Math.abs(b):0,g=void 0===d?",":d,h=void 0===c?".":c,i="",j=function(a,b){var c=Math.pow(10,b);return""+Math.round(a*c)/c};return i=(f?j(e,f):""+Math.round(e)).split("."),i[0].length>3&&(i[0]=i[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,g)),(i[1]||"").length<f&&(i[1]=i[1]||"",i[1]+=new Array(f-i[1].length+1).join("0")),i.join(h)}function j(a){var b=new Date(1e3*a),c=b.getFullYear(),d=b.getMonth(),e=b.getDate(),f=b.getHours(),g="0"+b.getMinutes(),h="0"+b.getSeconds();return d+=1,d<9&&(d="0"+d),f<9&&(f="0"+f),c+"/"+d+"/"+e+" "+f+":"+g.substr(-2)+":"+h.substr(-2)}function k(b,c,d,f){var g,h,i,k="",l="",m=0;m=d.to-wcst_data.utc0_time;var n,o,p,q,r=f.display_regular_price,s=f.display_price;"reverse_date"===c.display_mode||"expiry_date"===c.display_mode?("reverse_date"===c.display_mode&&(g=humanized_time_span(j(d.to),j(wcst_data.utc0_time)),h=c.reverse_date_label,i="{{time_left}}"),"expiry_date"==c.display_mode&&(g=f.wcst_sale_to_val,h=c.expiry_date_label,i="{{end_date}}"),c.switch_period>0&&m<3600*c.switch_period&&(h=c.reverse_timer_label,i="{{countdown_timer}}",k=" wcst_timer",l="days",m<86400&&(l="hrs")),g='<span data-diff="'+(d.to-wcst_data.utc0_time)+'" data-display="'+l+'">'+g+"</span>"," wcst_timer"==k?a(".wcst_deal_expiry.wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b).not(".wcst_static").addClass("wcst_timer"):a(".wcst_deal_expiry.wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b).not(".wcst_static").removeClass("wcst_timer"),n=i,o=new RegExp(n,"g"),h=h.replace(o,g),n="{{regular_price}}",o=new RegExp(n,"g"),p='<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span>"+r.toFixed(2)+"</span>",h=h.replace(o,p),q='<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span>"+s.toFixed(2)+"</span>",n="{{sale_price}}",o=new RegExp(n,"g"),h=h.replace(o,q),a(".wcst_deal_expiry.wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b).not(".wcst_static").html(h),e()):"reverse_timer"===c.display_mode&&(h=c.reverse_timer_label,i="{{countdown_timer}}",k=" wcst_timer",l="days",m<86400&&(l="hrs"),g='<span data-diff="'+(d.to-wcst_data.utc0_time)+'" data-display="'+l+'">'+g+"</span>"," wcst_timer"==k&&a(".wcst_deal_expiry").addClass("wcst_timer"),n=i,o=new RegExp(n,"g"),h=h.replace(o,g),n="{{regular_price}}",o=new RegExp(n,"g"),p='<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span>"+r.toFixed(2)+"</span>",h=h.replace(o,p),q='<span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">'+wcst_data.currency+"</span>"+s.toFixed(2)+"</span>",n="{{sale_price}}",o=new RegExp(n,"g"),h=h.replace(o,q),a(".wcst_deal_expiry.wcst_deal_expiry_key_"+wcst_data.current_postid+"_"+b).not(".wcst_static").html(h),e())}var l,m=0,n=0;a(".variations_form").on("woocommerce_variation_select_change",function(){b()}),a(".variations_form").on("show_variation",function(c,d){if(b(),void 0!==d&&"undefined"!=typeof wcst_data&&void 0!==wcst_data.settings){var e=(d.variation_id,{});e.from=d.wcst_sale_from,e.to=d.wcst_sale_to;var h=d.is_in_stock,i=1;d.display_price==d.display_regular_price&&(i=0);var j=d.max_qty;if(0===j&&(h=!1),0===h)return!1;void 0!==wcst_data.settings.low_stock&&-1!==wcst_data.compatibility.low_stock.indexOf(wcst_data.product_type)&&Object.keys(wcst_data.settings.low_stock).length>0&&a(".wcst_low_stock").length>0&&(a(".wcst_low_stock").html(""),a.each(wcst_data.settings.low_stock,function(b,c){var e=f(c,j,h,d);!0===h?a(".wcst_low_stock.wcst_low_stock_key_"+wcst_data.current_postid+"_"+b).removeClass("wcst_out_of_stock"):a(".wcst_low_stock.wcst_low_stock_key_"+wcst_data.current_postid+"_"+b).addClass("wcst_out_of_stock"),a(".wcst_low_stock.wcst_low_stock_key_"+wcst_data.current_postid+"_"+b).html(e)})),void 0!==wcst_data.settings.savings&&-1!==wcst_data.compatibility.savings.indexOf(wcst_data.product_type)&&Object.keys(wcst_data.settings.savings).length>0&&1===i&&!0===h&&a.each(wcst_data.settings.savings,function(a,b){g(a,b,d)}),void 0!==wcst_data.settings.deal_expiry&&-1!==wcst_data.compatibility.deal_expiry.indexOf(wcst_data.product_type)&&Object.keys(wcst_data.settings.deal_expiry).length>0&&1===i&&!0===h&&""!==e.to&&e.to>0&&wcst_data.utc0_time<e.to&&""!==e.from&&e.from>0&&wcst_data.utc0_time>e.from&&a.each(wcst_data.settings.deal_expiry,function(a,b){k(a,b,e,d)})}}),a(document.body).on("wc_fragments_refreshed",function(){e()}),a(window).bind("load",function(){a(".wcst_deal_expiry,.wcst_manual_timer").length>0&&a.ajax({url:wcst_data.wcstajax_url,type:"POST",data:{wcst_action:"wcst_reset_current_time",location:document.location.href,product:wcst_data.current_postid},success:function(a){!0===a.hasOwnProperty("utc0_time")&&(wcst_data.utc0_time=a.utc0_time,c())}})}),a(window).bind("load",function(){function b(){try{return localStorage.setItem("feature_test","yes"),"yes"===localStorage.getItem("feature_test")&&(localStorage.removeItem("feature_test"),!0)}catch(a){return!1}}var c=b();if(!0===c){var d,e=[];for(d=0;d<localStorage.length;d++)"wcst_dynamic_number_"==localStorage.key(d).substring(0,20)&&e.push(localStorage.key(d));for(d=0;d<e.length;d++){var f=localStorage.getItem(e[d]);f=JSON.parse(f);var g=f.time;g=parseInt(g);var h=(new Date).getTime();h=h.toString(),h=h.slice(0,-3),h=parseInt(h),g<h&&localStorage.removeItem(e[d])}}a(".wcst_dynamic_number").length>0&&a(".wcst_dynamic_number").each(function(){var b=a(this),d=b.attr("data-product-id"),e=b.attr("data-trigger-id"),f=b.attr("data-hold-value-type"),g="",h="";if(e.length&&d.length){if(!0===c){var i="wcst_dynamic_number_"+e;"product"==f&&(i=i+"_"+d);var j=localStorage.getItem(i);null!==j&&j.length&&(j=JSON.parse(j),g=j.time,h=j.value)}a.ajax({url:wcst_data.ajax_url,type:"POST",data:{action:"wcst_display_dynamic_number",product_id:d,trigger_id:e,time:g,value:h},success:function(a){if(a.success&&(b.html(a.text),!0===c&&!1!==a.time)){var d={time:a.time,value:a.value},e=JSON.stringify(d);localStorage.setItem(i,e)}}})}})})}(jQuery);