(function ($){
function serializeForm(form, submitter){
var formData=new FormData(form, submitter);
var serializedObject={};
formData.append('product_id', $(submitter).val());
formData.forEach(function(value, key){
if(key.includes('[')){
var keys=key.split(/\[|\]/).filter(function(k){ return k; });
var current=serializedObject;
keys.forEach(function(subKey, index){
if(index===keys.length - 1){
if(Array.isArray(current[subKey])){
current[subKey].push(value);
}else if(current[subKey]){
current[subKey]=[current[subKey], value];
}else{
current[subKey]=key.includes('[]') ? [value]:value;
}}else{
if(!current[subKey]){
current[subKey]={};}
current=current[subKey];
}});
}else{
if(serializedObject[key]){
if(Array.isArray(serializedObject[key])){
serializedObject[key].push(value);
}else{
serializedObject[key]=[serializedObject[key], value];
}}else{
serializedObject[key]=value;
}}
});
if(serializedObject['variation_id']){
serializedObject['product_id']=serializedObject['variation_id'];
}else if(!serializedObject['product_id']&&serializedObject['add-to-cart']){
serializedObject['product_id']=serializedObject['add-to-cart'];
}
delete serializedObject['add-to-cart'];
return serializedObject;
}
$(document).on('click', '.single_add_to_cart_button:not(.disabled)', function (e){
var $thisbutton=$(this),
$form=$thisbutton.closest('form.cart'),
data=serializeForm($form[0], this);
e.preventDefault();
$(document.body).trigger('adding_to_cart', [$thisbutton, data]);
$.ajax({
type: 'POST',
url: woocommerce_params.wc_ajax_url.toString().replace('%%endpoint%%', 'add_to_cart'),
data: data,
beforeSend: function (response){
$thisbutton.prop('disabled', true);
$thisbutton.removeClass('added').addClass('loading');
},
complete: function (response){
$thisbutton.prop('disabled', false);
$thisbutton.addClass('added').removeClass('loading');
},
success: function (response){
if(response.error&&response.product_url){
window.location=response.product_url;
return;
}
$(document.body).trigger('added_to_cart', [response.fragments, response.cart_hash, $thisbutton]);
},
});
return false;
});
})(jQuery);
!function(t,a,i,e){var r=function(t){var a=this;a.$form=t,a.$attributeFields=t.find(".variations select"),a.$singleVariation=t.find(".single_variation"),a.$singleVariationWrap=t.find(".single_variation_wrap"),a.$resetVariations=t.find(".reset_variations"),a.$resetAlert=t.find(".reset_variations_alert"),a.$product=t.closest(".product"),a.variationData=t.data("product_variations"),a.useAjax=!1===a.variationData,a.xhr=!1,a.loading=!0,a.$singleVariationWrap.show(),a.$form.off(".wc-variation-form"),a.getChosenAttributes=a.getChosenAttributes.bind(a),a.findMatchingVariations=a.findMatchingVariations.bind(a),a.isMatch=a.isMatch.bind(a),a.toggleResetLink=a.toggleResetLink.bind(a),a.showNoMatchingVariationsMsg=a.showNoMatchingVariationsMsg.bind(a),t.on("click.wc-variation-form",".reset_variations",{variationForm:a},a.onReset),t.on("reload_product_variations",{variationForm:a},a.onReload),t.on("hide_variation",{variationForm:a},a.onHide),t.on("show_variation",{variationForm:a},a.onShow),t.on("click",".single_add_to_cart_button",{variationForm:a},a.onAddToCart),t.on("reset_data",{variationForm:a},a.onResetDisplayedVariation),t.on("reset_focus",{variationForm:a},a.onResetVariationFocus),t.on("announce_reset",{variationForm:a},a.onAnnounceReset),t.on("clear_reset_announcement",{variationForm:a},a.onClearResetAnnouncement),t.on("reset_image",{variationForm:a},a.onResetImage),t.on("change.wc-variation-form",".variations select",{variationForm:a},a.onChange),t.on("found_variation.wc-variation-form",{variationForm:a},a.onFoundVariation),t.on("check_variations.wc-variation-form",{variationForm:a},a.onFindVariation),t.on("update_variation_values.wc-variation-form",{variationForm:a},a.onUpdateAttributes),t.on("keydown.wc-variation-form",".reset_variations",{variationForm:a},a.onResetKeyDown),setTimeout(function(){t.trigger("check_variations"),t.trigger("wc_variation_form",a),a.loading=!1},100)};r.prototype.onReset=function(t){t.preventDefault(),t.data.variationForm.$attributeFields.val("").trigger("change"),t.data.variationForm.$form.trigger("announce_reset"),t.data.variationForm.$form.trigger("reset_data"),t.data.variationForm.$form.trigger("reset_focus")},r.prototype.onReload=function(t){var a=t.data.variationForm;a.variationData=a.$form.data("product_variations"),a.useAjax=!1===a.variationData,a.$form.trigger("check_variations")},r.prototype.onHide=function(t){t.preventDefault(),t.data.variationForm.$form.find(".single_add_to_cart_button").removeClass("wc-variation-is-unavailable").addClass("disabled wc-variation-selection-needed"),t.data.variationForm.$form.find(".woocommerce-variation-add-to-cart").removeClass("woocommerce-variation-add-to-cart-enabled").addClass("woocommerce-variation-add-to-cart-disabled")},r.prototype.onShow=function(a,i,e){a.preventDefault(),e?(a.data.variationForm.$form.find(".single_add_to_cart_button").removeClass("disabled wc-variation-selection-needed wc-variation-is-unavailable"),a.data.variationForm.$form.find(".woocommerce-variation-add-to-cart").removeClass("woocommerce-variation-add-to-cart-disabled").addClass("woocommerce-variation-add-to-cart-enabled")):(a.data.variationForm.$form.find(".single_add_to_cart_button").removeClass("wc-variation-selection-needed").addClass("disabled wc-variation-is-unavailable"),a.data.variationForm.$form.find(".woocommerce-variation-add-to-cart").removeClass("woocommerce-variation-add-to-cart-enabled").addClass("woocommerce-variation-add-to-cart-disabled")),wp.mediaelement&&a.data.variationForm.$form.find(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").filter(function(){return!t(this).parent().hasClass("mejs-mediaelement")}).mediaelementplayer(wp.mediaelement.settings)},r.prototype.onAddToCart=function(i){t(this).is(".disabled")&&(i.preventDefault(),t(this).is(".wc-variation-is-unavailable")?a.alert(wc_add_to_cart_variation_params.i18n_unavailable_text):t(this).is(".wc-variation-selection-needed")&&a.alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text))},r.prototype.onResetDisplayedVariation=function(t){var a=t.data.variationForm;a.$product.find(".product_meta").find(".sku").wc_reset_content(),a.$product.find(".product_weight, .woocommerce-product-attributes-item--weight .woocommerce-product-attributes-item__value").wc_reset_content(),a.$product.find(".product_dimensions, .woocommerce-product-attributes-item--dimensions .woocommerce-product-attributes-item__value").wc_reset_content(),a.$form.trigger("reset_image"),a.$singleVariation.slideUp(200).trigger("hide_variation")},r.prototype.onAnnounceReset=function(t){t.data.variationForm.$resetAlert.text(wc_add_to_cart_variation_params.i18n_reset_alert_text)},r.prototype.onResetVariationFocus=function(t){t.data.variationForm.$attributeFields[0].focus()},r.prototype.onClearResetAnnouncement=function(t){t.data.variationForm.$resetAlert.text("")},r.prototype.onResetImage=function(t){t.data.variationForm.$form.wc_variations_image_update(!1)},r.prototype.onFindVariation=function(a,i){var e=a.data.variationForm,r=void 0!==i?i:e.getChosenAttributes(),o=r.data;if(r.count&&r.count===r.chosenCount)if(e.useAjax)e.xhr&&e.xhr.abort(),e.$form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}}),o.product_id=parseInt(e.$form.data("product_id"),10),o.custom_data=e.$form.data("custom_data"),e.xhr=t.ajax({url:wc_add_to_cart_variation_params.wc_ajax_url.toString().replace("%%endpoint%%","get_variation"),type:"POST",data:o,success:function(t){t?e.$form.trigger("found_variation",[t]):(e.$form.trigger("reset_data"),r.chosenCount=0,e.loading||e.showNoMatchingVariationsMsg())},complete:function(){e.$form.unblock()}});else{e.$form.trigger("update_variation_values");var n=e.findMatchingVariations(e.variationData,o).shift();n?e.$form.trigger("found_variation",[n]):(e.$form.trigger("reset_data"),r.chosenCount=0,e.loading||e.showNoMatchingVariationsMsg())}else e.$form.trigger("update_variation_values"),e.$form.trigger("reset_data");e.toggleResetLink(r.chosenCount>0)},r.prototype.onFoundVariation=function(a,i){var e=a.data.variationForm,r=e.$product.find(".product_meta").find(".sku"),n=e.$product.find(".product_weight, .woocommerce-product-attributes-item--weight .woocommerce-product-attributes-item__value"),s=e.$product.find(".product_dimensions, .woocommerce-product-attributes-item--dimensions .woocommerce-product-attributes-item__value"),c=e.$singleVariationWrap.find('.quantity input.qty[name="quantity"]'),_=c.closest(".quantity"),d=!0,m=!1,v="";if(i.sku?r.wc_set_content(i.sku):r.wc_reset_content(),i.weight?n.wc_set_content(i.weight_html):n.wc_reset_content(),i.dimensions?s.wc_set_content(t.parseHTML(i.dimensions_html)[0].data):s.wc_reset_content(),e.$form.wc_variations_image_update(i),i.variation_is_visible?(m=o("variation-template"),i.variation_id):m=o("unavailable-variation-template"),v=(v=(v=m({variation:i})).replace("/*<![CDATA[*/","")).replace("/*]]>*/",""),e.$form.find('input[name="variation_id"], input.variation_id').val(i.variation_id).trigger("change"),"yes"===i.is_sold_individually)c.val("1").attr("min","1").attr("max","").trigger("change"),_.hide();else{var l=parseFloat(c.val());l=isNaN(l)?i.min_qty:(l=l>parseFloat(i.max_qty)?i.max_qty:l)<parseFloat(i.min_qty)?i.min_qty:l,c.attr("min",i.min_qty).attr("max",i.max_qty).val(l).trigger("change"),_.show()}i.is_purchasable&&i.is_in_stock&&i.variation_is_visible||(d=!1),setTimeout(function(){e.$singleVariation.html(v),e.$singleVariation.text().trim()?e.$singleVariation.slideDown(200).trigger("show_variation",[i,d]):e.$singleVariation.show().trigger("show_variation",[i,d])},300)},r.prototype.onChange=function(t){var a=t.data.variationForm;a.$form.find('input[name="variation_id"], input.variation_id').val("").trigger("change"),a.$form.trigger("clear_reset_announcement"),a.$form.find(".wc-no-matching-variations").parent().remove(),a.useAjax?a.$form.trigger("check_variations"):(a.$form.trigger("woocommerce_variation_select_change"),a.$form.trigger("check_variations")),a.$form.trigger("woocommerce_variation_has_changed")},r.prototype.addSlashes=function(t){return t=(t=t.replace(/'/g,"\\'")).replace(/"/g,'\\"')},r.prototype.onUpdateAttributes=function(a){var i=a.data.variationForm,e=i.getChosenAttributes().data;i.useAjax||(i.$attributeFields.each(function(a,r){var o,n=t(r),s=n.data("attribute_name")||n.attr("name"),c=t(r).data("show_option_none"),_=":gt(0)",d=t("<select/>"),m=n.val()||"",v=!0;if(!n.data("attribute_html")){var l=n.clone();l.find("option").removeAttr("attached").prop("disabled",!1).prop("selected",!1),n.data("attribute_options",l.find("option"+_).get()),n.data("attribute_html",l.html())}d.html(n.data("attribute_html"));var g=t.extend(!0,{},e);g[s]="";var u=i.findMatchingVariations(i.variationData,g);for(var f in u)if("undefined"!=typeof u[f]){var h=u[f].attributes;for(var p in h)if(h.hasOwnProperty(p)){var w=h[p],b="";if(p===s)if(u[f].variation_is_active&&(b="enabled"),w){w=t("<div/>").html(w).text();var $=d.find("option");if($.length)for(var y=0,F=$.length;y<F;y++){var x=t($[y]);if(w===x.val()){x.addClass("attached "+b);break}}}else d.find("option:gt(0)").addClass("attached "+b)}}o=d.find("option.attached").length,m&&(v=!1,0!==o&&d.find("option.attached.enabled").each(function(){var a=t(this).val();if(m===a)return v=!0,!1})),o>0&&m&&v&&"no"===c&&(d.find("option:first").remove(),_=""),d.find("option"+_+":not(.attached)").remove(),n.html(d.html()),n.find("option"+_+":not(.enabled)").prop("disabled",!0),m?v?n.val(m):n.val("").trigger("change"):n.val("")}),i.$form.trigger("woocommerce_update_variation_values"))},r.prototype.getChosenAttributes=function(){var a={},i=0,e=0;return this.$attributeFields.each(function(){var r=t(this).data("attribute_name")||t(this).attr("name"),o=t(this).val()||"";o.length>0&&e++,i++,a[r]=o}),{count:i,chosenCount:e,data:a}},r.prototype.findMatchingVariations=function(t,a){for(var i=[],e=0;e<t.length;e++){var r=t[e];this.isMatch(r.attributes,a)&&i.push(r)}return i},r.prototype.isMatch=function(t,a){var i=!0;for(var e in t)if(t.hasOwnProperty(e)){var r=t[e],o=a[e];void 0!==r&&void 0!==o&&0!==r.length&&0!==o.length&&r!==o&&(i=!1)}return i},r.prototype.toggleResetLink=function(t){t?"hidden"===this.$resetVariations.css("visibility")&&this.$resetVariations.css("visibility","visible").hide().fadeIn():this.$resetVariations.css("visibility","hidden")},r.prototype.showNoMatchingVariationsMsg=function(){this.$form.find(".single_variation").after('<div role="alert"><p class="wc-no-matching-variations woocommerce-info">'+wc_add_to_cart_variation_params.i18n_no_matching_variations_text+"</p></div>").next("div").find(".wc-no-matching-variations").slideDown(200)},r.prototype.onResetKeyDown=function(t){"Enter"!==t.code&&"Space"!==t.code||(t.preventDefault(),t.data.variationForm.onReset(t))},t.fn.wc_variation_form=function(){return new r(this),this},t.fn.wc_set_content=function(t){void 0===this.attr("data-o_content")&&this.attr("data-o_content",this.text()),this.text(t)},t.fn.wc_reset_content=function(){void 0!==this.attr("data-o_content")&&this.text(this.attr("data-o_content"))},t.fn.wc_set_variation_attr=function(t,a){void 0===this.attr("data-o_"+t)&&this.attr("data-o_"+t,this.attr(t)?this.attr(t):""),!1===a?this.removeAttr(t):this.attr(t,a)},t.fn.wc_reset_variation_attr=function(t){void 0!==this.attr("data-o_"+t)&&this.attr(t,this.attr("data-o_"+t))},t.fn.wc_maybe_trigger_slide_position_reset=function(a){var i=t(this),e=i.closest(".product").find(".images"),r=!1,o=a&&a.image_id?a.image_id:"";i.attr("current-image")!==o&&(r=!0),i.attr("current-image",o),r&&e.trigger("woocommerce_gallery_reset_slide_position")},t.fn.wc_variations_image_update=function(i){var e=this,r=e.closest(".product"),o=r.find(".images"),n=r.find(".flex-control-nav"),s=n.find("li:eq(0) img"),c=o.find(".woocommerce-product-gallery__image, .woocommerce-product-gallery__image--placeholder").eq(0),_=c.find(".wp-post-image"),d=c.find("a").eq(0);if(i&&i.image&&i.image.src&&i.image.src.length>1){n.find('li img[data-o_src="'+i.image.gallery_thumbnail_src+'"]').length>0&&e.wc_variations_image_reset();var m=n.find('li img[src="'+i.image.gallery_thumbnail_src+'"]');if(m.length>0)return m.trigger("flexslider-click"),e.attr("current-image",i.image_id),void a.setTimeout(function(){t(a).trigger("resize"),o.trigger("woocommerce_gallery_init_zoom")},20);_.wc_set_variation_attr("src",i.image.src),_.wc_set_variation_attr("height",i.image.src_h),_.wc_set_variation_attr("width",i.image.src_w),_.wc_set_variation_attr("srcset",i.image.srcset),_.wc_set_variation_attr("sizes",i.image.sizes),_.wc_set_variation_attr("title",i.image.title),_.wc_set_variation_attr("data-caption",i.image.caption),_.wc_set_variation_attr("alt",i.image.alt),_.wc_set_variation_attr("data-src",i.image.full_src),_.wc_set_variation_attr("data-large_image",i.image.full_src),_.wc_set_variation_attr("data-large_image_width",i.image.full_src_w),_.wc_set_variation_attr("data-large_image_height",i.image.full_src_h),c.wc_set_variation_attr("data-thumb",i.image.src),s.wc_set_variation_attr("src",i.image.gallery_thumbnail_src),d.wc_set_variation_attr("href",i.image.full_src)}else e.wc_variations_image_reset();a.setTimeout(function(){t(a).trigger("resize"),e.wc_maybe_trigger_slide_position_reset(i),o.trigger("woocommerce_gallery_init_zoom")},20)},t.fn.wc_variations_image_reset=function(){var t=this.closest(".product"),a=t.find(".images"),i=t.find(".flex-control-nav").find("li:eq(0) img"),e=a.find(".woocommerce-product-gallery__image, .woocommerce-product-gallery__image--placeholder").eq(0),r=e.find(".wp-post-image"),o=e.find("a").eq(0);r.wc_reset_variation_attr("src"),r.wc_reset_variation_attr("width"),r.wc_reset_variation_attr("height"),r.wc_reset_variation_attr("srcset"),r.wc_reset_variation_attr("sizes"),r.wc_reset_variation_attr("title"),r.wc_reset_variation_attr("data-caption"),r.wc_reset_variation_attr("alt"),r.wc_reset_variation_attr("data-src"),r.wc_reset_variation_attr("data-large_image"),r.wc_reset_variation_attr("data-large_image_width"),r.wc_reset_variation_attr("data-large_image_height"),e.wc_reset_variation_attr("data-thumb"),i.wc_reset_variation_attr("src"),o.wc_reset_variation_attr("href")},t(function(){"undefined"!=typeof wc_add_to_cart_variation_params&&t(".variations_form").each(function(){t(this).wc_variation_form()})});var o=function(t){var e=i.getElementById("tmpl-"+t).textContent,r=!1;return(r=(r=(r=r||/<#\s?data\./.test(e))||/{{{?\s?data\.(?!variation\.).+}}}?/.test(e))||/{{{?\s?data\.variation\.[\w-]*[^\s}]/.test(e))?wp.template(t):function(t){var i=t.variation||{};return e.replace(/({{{?)\s?data\.variation\.([\w-]*)\s?(}}}?)/g,function(t,e,r,o){if(e.length!==o.length)return"";var n=i[r]||"";return 2===e.length?a.escape(n):n})}}}(jQuery,window,document);
!function(l){function i(_){void 0!==_.price_data.size_min&&void 0!==_.price_data.size_max&&(_.min_max_validation={min:_.price_data.size_min,max:_.price_data.size_max,bind_validation_handler:function(){var o=this;_.$bundle_data.on("woocommerce-product-bundle-validate",function(_,a){var i=0,n="",e="",m=!0;if(l.each(a.bundled_items,function(_,a){a.is_selected()&&(i+=a.get_quantity())}),""!==o.min&&i<parseInt(o.min)?(m=!1,e=1===o.min?o.min===o.max?wc_pb_min_max_items_params.i18n_min_zero_max_qty_error_singular:wc_pb_min_max_items_params.i18n_min_qty_error_singular:(e=o.min===o.max?wc_pb_min_max_items_params.i18n_min_max_qty_error_plural:wc_pb_min_max_items_params.i18n_min_qty_error_plural).replace("%q",parseInt(o.min))):""!==o.max&&i>parseInt(o.max)&&(m=!1,e=1===o.max?o.min===o.max?wc_pb_min_max_items_params.i18n_min_max_qty_error_singular:wc_pb_min_max_items_params.i18n_max_qty_error_singular:(e=o.min===o.max?wc_pb_min_max_items_params.i18n_min_max_qty_error_plural:wc_pb_min_max_items_params.i18n_max_qty_error_plural).replace("%q",parseInt(o.max))),!m){if(0===i){if(n="","no"===a.price_data.zero_items_allowed){for(var t=a.get_validation_messages(),s=[],r=0;r<=t.length-1;r++)t[r]!==wc_bundle_params.i18n_zero_qty_error&&s.push(t[r]);a.validation_messages=s}}else n=1===i?wc_pb_min_max_items_params.i18n_qty_error_singular:wc_pb_min_max_items_params.i18n_qty_error_plural;n=n.replace("%s",i),0<a.validation_messages.length||""===n?a.add_validation_message(e):a.add_validation_message('<span class="status_msg"><span class="bundled_items_selection_msg">'+e+'</span><span class="bundled_items_selection_status">'+n+"</span></span>")}})}},_.min_max_validation.bind_validation_handler())}l("body .component").on("wc-composite-component-loaded",function(_,a){"bundle"===a.get_selected_product_type()&&(a=a.get_bundle_script())&&(i(a),a.update_bundle_task())}),l(".bundle_form .bundle_data").each(function(){l(this).on("woocommerce-product-bundle-initializing",function(_,a){a.is_composited()||i(a)})})}(jQuery,(window,document));
var wc_pb_bundle_scripts={};function wc_pb_price_format(t,e){return e=void 0!==e&&e,wc_pb_woocommerce_number_format(wc_pb_number_format(t),e)}function wc_pb_woocommerce_number_format(t,e){var i=wc_bundle_params.currency_format_decimal_sep,_=wc_bundle_params.currency_position,a=wc_bundle_params.currency_symbol,n=wc_bundle_params.currency_format_trim_zeros,s=wc_bundle_params.currency_format_num_decimals;if(e=void 0!==e&&e,"yes"==n&&0<s){for(var d=0;d<s;d++)i+="0";t=t.replace(i,"")}n=String(t),t=e?a:'<span class="woocommerce-Price-currencySymbol">'+a+"</span>";return"left"===_?n=t+n:"right"===_?n+=t:"left_space"===_?n=t+" "+n:"right_space"===_&&(n=n+" "+t),n=e?n:'<span class="woocommerce-Price-amount amount">'+n+"</span>"}function wc_pb_number_format(t){var e=wc_bundle_params.currency_format_num_decimals,i=wc_bundle_params.currency_format_decimal_sep,_=wc_bundle_params.currency_format_thousand_sep,e=isNaN(e=Math.abs(e))?2:e,i=null==i?",":i,_=null==_?".":_,a=t<0?"-":"",n=parseInt(t=Math.abs(+t||0).toFixed(e),10)+"",s=3<(s=n.length)?s%3:0;return a+(s?n.substring(0,s)+_:"")+n.substring(s).replace(/(\d{3})(?=\d)/g,"$1"+_)+(e?i+Math.abs(t-n).toFixed(e).slice(2):"")}function wc_pb_number_round(t,e){e=void 0===e?wc_bundle_params.currency_format_num_decimals:parseInt(e,10),e=Math.pow(10,e);return Math.round(t*e)/e}function wc_pb_format_list(t,e){var i="",_=t.length,a=e&&e.plain,n=e&&e.plain_sep;if(0<_)for(var s,d=0,r=0;r<_;r++)d++,s=a?t[r]:wc_bundle_params.i18n_string_list_item.replace("%s",t[r]),i=1==_||1==d?s:(d!==_||n?wc_bundle_params.i18n_string_list_sep:wc_bundle_params.i18n_string_list_last_sep).replace("%s",i).replace("%v",s);return i}jQuery.fn.wc_get_bundle_script=function(){var t=jQuery(this);return!!t.hasClass("bundle_form")&&(t=t.data("script_id"),void 0!==wc_pb_bundle_scripts[t])&&wc_pb_bundle_scripts[t]},function(b){function o(t){var m=this;this.bundle_id=t.bundle_id,this.$bundle_form=t.$bundle_form,this.$bundle_data=t.$bundle_data,this.$bundle_wrap=t.$bundle_data.find(".bundle_wrap"),this.$bundled_items=t.$bundle_form.find(".bundled_product"),this.$bundle_availability=t.$bundle_data.find(".bundle_availability"),this.$bundle_price=t.$bundle_data.find(".bundle_price"),this.$bundle_button=t.$bundle_data.find(".bundle_button"),this.$bundle_error=t.$bundle_data.find(".bundle_error"),this.$bundle_error_content=this.$bundle_error.find("ul.msg"),this.$bundle_quantity=this.$bundle_button.find("input.qty"),this.$nyp=this.$bundle_data.find(".nyp"),this.$addons_totals=this.$bundle_data.find("#product-addons-total"),this.show_addons_totals=!1,this.bundled_items={},this.price_data=t.$bundle_data.data("bundle_form_data"),this.$initial_stock_status=!1,this.update_bundle_timer=!1,this.update_price_timer=!1,this.validation_messages=[],this.is_initialized=!1,this.composite_data=t.composite_data,this.dirty_subtotals=!1,this.filters=!1,this.api={get_bundle_totals:function(){return m.price_data.totals},get_bundled_item_totals:function(t){return m.price_data["bundled_item_"+t+"_totals"]},get_bundled_item_recurring_totals:function(t){return m.price_data["bundled_item_"+t+"_recurring_totals"]},get_bundle_validation_status:function(){return m.passes_validation()?"pass":"fail"},get_bundle_validation_messages:function(){return m.get_validation_messages()},get_bundle_stock_status:function(){return 0<m.$bundle_wrap.find("p.out-of-stock").not(".inactive").length?"out-of-stock":"in-stock"},get_bundle_availability:function(){var t=m.$bundle_wrap.find("p.stock");return t=t.hasClass("inactive")?!1!==m.$initial_stock_status?m.$initial_stock_status.clone().wrap("<div></div>").parent().html():"":t.clone().removeAttr("style").wrap("<div></div>").parent().html()},get_bundle_configuration:function(){var _={};return 0!==m.bundled_items.length&&(b.each(m.bundled_items,function(t,e){var i={title:e.get_title(),product_title:e.get_product_title(),product_id:e.get_product_id(),variation_id:e.get_variation_id(),quantity:m.price_data.quantities[e.bundled_item_id],product_type:e.get_product_type()};_[e.bundled_item_id]=i}),_)}},this.initialize=function(){this.filters=new i,this.has_addons()?(1==this.$addons_totals.data("show-sub-total")||this.is_composited()&&this.composite_data.component.show_addons_totals)&&(this.$addons_totals.data("show-sub-total",0),this.$bundle_price.after(this.$addons_totals),this.show_addons_totals=!0,m.$bundle_data.trigger("woocommerce-product-addons-update")):this.$addons_totals=!1,0<this.$bundle_wrap.find("p.stock").length&&(this.$initial_stock_status=this.$bundle_wrap.find("p.stock").clone()),this.price_data?this.$bundle_data.data("bundle_price_data")||this.$bundle_data.data("bundle_price_data",this.price_data):this.price_data=t.$bundle_data.data("bundle_price_data"),this.price_data.suffix_exists=""!==wc_bundle_params.price_display_suffix,this.price_data.suffix=""!==wc_bundle_params.price_display_suffix?' <small class="woocommerce-price-suffix">'+wc_bundle_params.price_display_suffix+"</small>":"",this.price_data.suffix_contains_price_incl=-1<wc_bundle_params.price_display_suffix.indexOf("{price_including_tax}"),this.price_data.suffix_contains_price_excl=-1<wc_bundle_params.price_display_suffix.indexOf("{price_excluding_tax}"),this.$bundle_button.find('input[name*="bundle_variation"], input[name*="bundle_attribute"]').remove(),this.bind_event_handlers(),this.viewport_resized(),this.init_bundled_items(),this.is_composited()&&this.init_composite(),"yes"===wc_bundle_params.is_pao_installed&&void 0!==window.WC_PAO&&this.match_bundled_items_addons_forms(),this.$bundle_data.trigger("woocommerce-product-bundle-initializing",[this]),b.each(this.bundled_items,function(t,e){e.init_scripts()}),this.update_bundle_task(),this.is_initialized=!0,this.$bundle_form.addClass("initialized"),this.$bundle_data.trigger("woocommerce-product-bundle-initialized",[this])},this.shutdown=function(){this.$bundle_form.find("*").off(),!1!==this.composite_data&&this.remove_composite_hooks()},this.init_composite=function(){this.composite_data.composite.actions.add_action("component_scripts_initialized_"+this.composite_data.component.step_id,this.component_scripts_initialized_action,10,this)},this.component_scripts_initialized_action=function(){(void 0!==this.composite_data.component.component_selection_model.selected_product?parseInt(this.composite_data.component.component_selection_model.selected_product,10)===parseInt(this.bundle_id,10):parseInt(this.composite_data.component.component_selection_model.get("selected_product"),10)===parseInt(this.bundle_id,10))?this.add_composite_hooks():this.remove_composite_hooks()},this.add_composite_hooks=function(){this.composite_data.composite.filters.add_filter("component_is_valid",this.cp_component_is_valid_filter,10,this),this.composite_data.composite.filters.add_filter("component_selection_formatted_title",this.cp_component_selection_formatted_title_filter,10,this),this.composite_data.composite.filters.add_filter("component_selection_meta",this.cp_component_selection_meta_filter,10,this),this.composite_data.composite.filters.add_filter("component_totals",this.cp_component_totals_filter,10,this),this.composite_data.composite.filters.add_filter("component_configuration",this.cp_component_configuration_filter,10,this),this.composite_data.composite.actions.add_action("validate_step",this.cp_validation_messages_action,10,this)},this.remove_composite_hooks=function(){this.composite_data.composite.filters.remove_filter("component_is_valid",this.cp_component_is_valid_filter),this.composite_data.composite.filters.remove_filter("component_selection_formatted_title",this.cp_component_selection_formatted_title_filter),this.composite_data.composite.filters.remove_filter("component_selection_meta",this.cp_component_selection_meta_filter),this.composite_data.composite.filters.remove_filter("component_totals",this.cp_component_totals_filter),this.composite_data.composite.filters.remove_filter("component_configuration",this.cp_component_configuration_filter),this.composite_data.composite.actions.remove_action("component_scripts_initialized_"+this.composite_data.component.step_id,this.component_scripts_initialized_action),this.composite_data.composite.actions.remove_action("validate_step",this.cp_validation_messages_action)},this.cp_component_configuration_filter=function(t,e){return e.step_id===this.composite_data.component.step_id&&parseInt(e.get_selected_product(),10)===parseInt(m.bundle_id,10)&&(t.bundled_items=m.api.get_bundle_configuration()),t},this.cp_component_totals_filter=function(t,e,i){var _,a;return e.step_id===this.composite_data.component.step_id&&parseInt(e.get_selected_product(),10)===parseInt(m.bundle_id,10)?(_=b.extend(!0,{},m.price_data),a=m.has_addons()?m.get_addons_raw_price():0,i=void 0===i?e.get_selected_quantity():i,0<a&&(_.base_price=Number(_.base_price)+Number(a)),_=m.calculate_subtotals(!1,_,i),(_=m.calculate_totals(_)).totals):t},this.cp_component_selection_formatted_title_filter=function(t,e,i,_,a){var n;return a.step_id===this.composite_data.component.step_id&&parseInt(a.get_selected_product(),10)===parseInt(this.bundle_id,10)&&(n=0,b.each(this.bundled_items,function(t,e){0<e.$bundled_item_cart.data("quantity")&&n++}),this.group_mode_supports("component_multiselect"))&&(0===n?t=wc_composite_params.i18n_no_selection:(a=this.cp_get_formatted_contents(a))&&(t=a)),t},this.cp_component_selection_meta_filter=function(t,e){var i;return e.step_id===this.composite_data.component.step_id&&parseInt(e.get_selected_product(),10)===parseInt(this.bundle_id,10)&&(i=0,b.each(this.bundled_items,function(t,e){0<e.$bundled_item_cart.data("quantity")&&i++}),0!==i)&&!1===this.group_mode_supports("component_multiselect")&&""!==(e=this.cp_get_formatted_contents(e))&&t.push({meta_key:wc_bundle_params.i18n_contents,meta_value:e}),t},this.cp_get_formatted_contents=function(t){var i="",s=[],d=t.get_selected_quantity();return b.each(this.bundled_items,function(t,e){if(e.$self.hasClass("bundled_item_hidden"))return!0;var i,_,a,n;0<e.$bundled_item_cart.data("quantity")&&(i=0<(i=e.$bundled_item_image.find("img").first()).length&&i.get(0).outerHTML,a=parseInt(e.$bundled_item_cart.data("quantity")*d,10),_=wc_cp_get_variation_data(e.$bundled_item_cart.find(".variations")),e=e.$bundled_item_cart.data("title"),a=1<a?"<strong>"+wc_composite_params.i18n_qty_string.replace("%s",a)+"</strong>":"",n="",0<_.length&&(b.each(_,function(t,e){n=n+'<span class="bundled_meta_element"><span class="bundled_meta_key">'+e.meta_key+':</span> <span class="bundled_meta_value">'+e.meta_value+"</span>",t!==_.length-1&&(n+='<span class="bundled_meta_value_sep">, </span>'),n+="</span>"}),e=wc_bundle_params.i18n_title_meta_string.replace("%t",e).replace("%m",'<span class="content_bundled_product_meta">'+n+"</span>")),e=wc_composite_params.i18n_title_string.replace("%t",e).replace("%q",a).replace("%p",""),s.push({title:e,image:i}))}),0<s.length&&(i+='<span class="content_bundled_product_details_wrapper">',b.each(s,function(t,e){i=i+'<span class="content_bundled_product_details">'+(e.image?'<span class="content_bundled_product_image">'+e.image+"</span>":"")+'<span class="content_bundled_product_title">'+e.title+"</span></span>"}),i+="</span>"),i},this.cp_component_is_valid_filter=function(t,e,i){return t=i.step_id===this.composite_data.component.step_id&&parseInt(i.get_selected_product(e),10)===parseInt(this.bundle_id,10)&&0<i.get_selected_quantity()&&i.is_visible()?this.passes_validation():t},this.cp_validation_messages_action=function(i,t){i.step_id===this.composite_data.component.step_id&&!1===t&&parseInt(i.get_selected_product(),10)===parseInt(this.bundle_id,10)&&(t=this.get_validation_messages(),b.each(t,function(t,e){i.add_validation_message(e),i.add_validation_message(e,"composite")}))},this.get_ajax_url=function(t){return woocommerce_params.wc_ajax_url.toString().replace("%%endpoint%%",t)},this.viewport_resized=function(){this.is_composited()||(this.$bundle_form.width()<=wc_bundle_params.responsive_breakpoint?this.$bundle_form.addClass("small_width"):this.$bundle_form.removeClass("small_width"))},this.bind_event_handlers=function(){b(window).on("resize",function(){clearTimeout(m.viewport_resize_timer),m.viewport_resize_timer=setTimeout(function(){m.viewport_resized()},50)}),m.has_addons()&&m.$bundle_data.on("updated_addons",m.updated_addons_handler),m.is_composited()&&m.$bundle_quantity.on("input change",function(){m.$bundle_data.trigger("woocommerce-product-bundle-update")}),this.$bundle_data.on("woocommerce-nyp-updated-item",function(t){m.$nyp.is(":visible")&&(m.price_data.base_regular_price=m.$nyp.data("price"),m.price_data.base_price=m.price_data.base_regular_price,m.is_initialized)&&(m.dirty_subtotals=!0,m.update_totals()),t.stopPropagation()}).on("woocommerce-product-bundle-validation-status-changed",function(t,e){e.updated_totals()}).on("click",".bundle_add_to_cart_button",function(t){b(this).hasClass("disabled")&&(t.preventDefault(),window.alert(wc_bundle_params.i18n_validation_alert))}).on("woocommerce-product-bundle-update-totals",function(t,e,i){i=void 0===i?m:i;(e=void 0!==e&&e)&&(i.dirty_subtotals=!0),i.update_totals()}).on("woocommerce-bundled-item-totals-changed",function(t,e){e.has_addons()&&e.render_addons_totals()}).on("woocommerce-product-bundle-update",function(t,e){var i=void 0===e?m:e.get_bundle();e?i.update_bundle(e):i.update_bundle()})},this.init_bundled_items=function(){m.$bundled_items.each(function(t){m.bundled_items[t]=new e(m,b(this),t),m.bind_bundled_item_event_handlers(m.bundled_items[t])})},this.match_bundled_items_addons_forms=function(){var i=window.WC_PAO.initialized_forms;m.$bundled_items.each(function(t){var e=m.bundled_items[t].$bundled_item_cart;b.each(i,function(){if(this.$el[0]===e[0])return m.bundled_items[t].addons_form=this,!1})})},this.bind_bundled_item_event_handlers=function(n){n.$bundled_item_qty.on("input change",function(t){var e=b(this),i=parseFloat(e.val()),_=parseFloat(e.attr("min")),a=parseFloat(e.attr("max"));"yes"===wc_bundle_params.force_min_max_qty_input&&"change"===t.type&&(0<=_&&(i<_||isNaN(i))&&(i=_),e.val(i=0<a&&a<i?a:i)),n.is_nyp()&&!n.is_optional()&&0===_&&n.$nyp.data("optional_status",0<i),n.update_selection_title(),m.$bundle_data.trigger("woocommerce-product-bundle-update",[n])}),n.$self.on("change",".bundled_product_optional_checkbox input",function(t){var e;b(this).is(":checked")?(n.$bundled_item_content.css({height:"",display:"block",position:"absolute"}),void 0===(e=n.$bundled_item_content.get(0).getBoundingClientRect().height)&&(e=n.$bundled_item_content.outerHeight()),n.$bundled_item_content.css({height:"",position:"",display:"none"}),e&&(n.$bundled_item_content.addClass("bundled_item_cart_content--populated"),n.$bundled_item_content.slideDown(200)),n.set_selected(!0),n.$self.find(".bundled_item_qty_col .quantity").removeClass("quantity_hidden"),n.is_nyp()&&n.$nyp.trigger("wc-nyp-update",[{force:!0}]),n.$bundled_item_cart.find("table.variations .attribute_value_configurable:has(abbr.required) select").attr("required",!0),n.$bundled_item_cart.find(".variations select:eq(0)").trigger("change"),n.$bundled_item_cart.find('.wc-pao-addon-field[data-restrictions*="required"]').attr("required",!0)):(n.$bundled_item_content.slideUp(200),n.set_selected(!1),n.$self.find(".bundled_item_qty_col .quantity").addClass("quantity_hidden"),n.reset_variation_image()&&(n.maybe_add_wc_core_gallery_class(),n.$bundled_item_cart.trigger("reset_image"),n.maybe_remove_wc_core_gallery_class()),n.$bundled_item_cart.find("table.variations .attribute_value_configurable select").removeAttr("required"),n.$bundled_item_cart.find(".wc-pao-addon-field").removeAttr("required")),n.update_selection_title(),m.$bundle_data.trigger("woocommerce-product-bundle-update",[n]),t.stopPropagation()}).on("found_variation",function(t,e){n.set_variation_id(e.variation_id);var i=e.price,_=e.regular_price;n.is_nyp()&&e.is_nyp&&n.$nyp.is(":visible")&&(i=_=n.$nyp.data("price")),m.price_data.prices[n.bundled_item_id]=Number(i),m.price_data.regular_prices[n.bundled_item_id]=Number(_),m.price_data.prices_tax[n.bundled_item_id]=e.price_tax,m.price_data.recurring_prices[n.bundled_item_id]=Number(e.recurring_price),m.price_data.regular_recurring_prices[n.bundled_item_id]=Number(e.regular_recurring_price),m.price_data.recurring_html[n.bundled_item_id]=e.recurring_html,m.price_data.recurring_keys[n.bundled_item_id]=e.recurring_key,m.price_data.quantities_available[n.bundled_item_id]=e.avail_qty,m.price_data.is_in_stock[n.bundled_item_id]=e.is_in_stock?"yes":"no",m.price_data.backorders_allowed[n.bundled_item_id]=e.backorders_allowed?"yes":"no",m.price_data.backorders_require_notification[n.bundled_item_id]=e.backorders_require_notification,n.maybe_remove_wc_core_gallery_class(),n.reset_variation_image()&&(n.maybe_add_wc_core_gallery_class(),n.$bundled_item_cart.trigger("reset_image"),n.maybe_remove_wc_core_gallery_class()),n.update_selection_title(),m.$bundle_data.trigger("woocommerce-product-bundle-update",[n]),t.stopPropagation()}).on("reset_image",function(){n.maybe_remove_wc_core_gallery_class()}).on("woocommerce-product-addons-update",function(t){t.stopPropagation()}).on("woocommerce_variation_select_focusin",function(t){t.stopPropagation()}).on("woocommerce_variation_has_changed",function(t){n.$reset_bundled_variations&&(n.variation_id?n.$reset_bundled_variations.slideDown(200):n.$reset_bundled_variations.slideUp(200)),t.stopPropagation()}).on("woocommerce_variation_select_change",function(t){n.set_variation_id(""),m.price_data.quantities_available[n.bundled_item_id]="",m.price_data.is_in_stock[n.bundled_item_id]="",m.price_data.backorders_allowed[n.bundled_item_id]="",m.price_data.backorders_require_notification[n.bundled_item_id]="",n.is_selected()&&n.maybe_add_wc_core_gallery_class(),n.$attribute_select&&n.$attribute_select.each(function(){if(""===b(this).val())return n.$bundled_item_cart.find(".bundled_item_wrap .stock").addClass("disabled"),m.$bundle_data.trigger("woocommerce-product-bundle-update",[n]),!1}),t.stopPropagation()}),n.has_addons()&&n.$bundled_item_cart.on("updated_addons",function(t){n.$addons_totals.html(n.addons_totals_html),m.$bundle_data.trigger("woocommerce-product-bundle-update",[n]),t.stopPropagation()}),n.is_nyp()&&n.$bundled_item_cart.on("woocommerce-nyp-updated-item",function(t){var e;n.$nyp.is(":visible")&&(e=n.$nyp.data("price"),m.price_data.prices[n.bundled_item_id]=e,m.price_data.regular_prices[n.bundled_item_id]=e,m.$bundle_data.trigger("woocommerce-product-bundle-update",[n])),t.stopPropagation()})},this.get_quantity=function(){var t=0<m.$bundle_quantity.length?m.$bundle_quantity.val():1;return isNaN(t)?1:parseInt(t,10)},this.get_bundled_items_availability=function(){var i=[],_=!0,a=[],n=!0;return b.each(m.bundled_items,function(t,e){if(e.has_insufficient_stock()&&(i.push(e.get_title(!0)),!e.is_visible()||!e.get_title(!0)))return _=!1}),0<i.length?_?wc_bundle_params.i18n_insufficient_stock_list.replace("%s",wc_pb_format_list(i,{plain:!0,plain_sep:!0})):wc_bundle_params.i18n_insufficient_stock_status:!m.$bundle_form.hasClass("bundle_out_of_stock")&&!m.$bundle_form.hasClass("bundle_insufficient_stock")&&(b.each(m.bundled_items,function(t,e){if(e.is_backordered()&&(a.push(e.get_title(!0)),!e.is_visible()||!e.get_title(!0)))return n=!1}),0<a.length?n?wc_bundle_params.i18n_on_backorder_list.replace("%s",wc_pb_format_list(a,{plain:!0,plain_sep:!0})):wc_bundle_params.i18n_on_backorder_status:"")},this.update_bundle=function(t){clearTimeout(m.update_bundle_timer),m.update_bundle_timer=setTimeout(function(){m.update_bundle_task(t)},5)},this.update_bundle_task=function(t){var e,i=!1,_=!1,a=!1===m.is_initialized?"":m.api.get_bundle_validation_status(),n=0,s=[],d=0,r=[],o=0,c=0,l=[];m.validation_messages=[],b.each(m.bundled_items,function(t,e){var i=e.is_selected()?e.get_quantity():0;o+=i,e.is_variable_product_type()&&""===e.get_variation_id()&&0<i&&(n++,e.is_visible())&&e.get_title(!0)&&s.push(e.get_title(!0)),e.is_selected()&&e.addons_form&&!e.addons_form.validation.validate()&&(e.has_pending_required_addons()?e.is_visible()&&e.get_title(!0)&&-1===b.inArray(e.get_title(!0),s)&&(n++,s.push(e.get_title(!0))):(d++,e.is_visible()&&e.get_title(!0)&&r.push(e.get_title(!0)))),e.is_nyp()&&!e.is_nyp_valid()&&(c++,e.is_visible())&&e.get_title(!0)&&l.push(e.get_title(!0))}),0<n&&(e="",e=n===s.length&&n<5?wc_bundle_params.i18n_validation_issues_for.replace("%c",wc_pb_format_list(s)).replace("%e",wc_bundle_params.i18n_select_options):wc_bundle_params.i18n_select_options,m.add_validation_message(e)),0<d&&(e="",e=d===r.length&&d<5?wc_bundle_params.i18n_validation_issues_for.replace("%c",wc_pb_format_list(r)).replace("%e",wc_bundle_params.i18n_review_product_addons):wc_bundle_params.i18n_select_options,m.add_validation_message(e)),0<c&&(e="",e=c===l.length&&c<5?wc_bundle_params.i18n_validation_issues_for.replace("%c",wc_pb_format_list(l)).replace("%e",wc_bundle_params.i18n_enter_valid_price_for):wc_bundle_params.i18n_enter_valid_price,m.add_validation_message(e)),0===o&&"no"===m.price_data.zero_items_allowed&&m.add_validation_message(wc_bundle_params.i18n_zero_qty_error),"yes"!==m.price_data.is_purchasable?m.add_validation_message(wc_bundle_params.i18n_unavailable_text):m.$bundle_data.trigger("woocommerce-product-bundle-validate",[m]),a!==m.api.get_bundle_validation_status()&&m.$bundle_data.trigger("woocommerce-product-bundle-validation-status-changed",[m]),"yes"===m.price_data.is_purchasable&&m.update_totals(t),b.each(m.bundled_items,function(t,e){e.has_insufficient_stock()&&(i=!0),e.is_backordered()&&e.backorders_require_notification()&&(_=!0)}),m.passes_validation()?(i?m.$bundle_button.find("button").addClass("disabled"):m.$bundle_button.find("button").removeClass("disabled"),setTimeout(function(){m.$bundle_error.slideUp(200)},1),m.$bundle_wrap.trigger("woocommerce-product-bundle-show")):m.hide_bundle(),(e=m.get_bundled_items_availability())?(m.$bundle_availability.html(e),m.$bundle_availability.slideDown(200)):m.$initial_stock_status?m.$bundle_availability.html(m.$initial_stock_status):(m.is_composited()&&m.$bundle_availability.find("p.stock").addClass("inactive"),m.$bundle_availability.slideUp(200)),m.is_composited()&&("function"==typeof m.composite_data.component.component_selection_model.set_stock_status&&(m.composite_data.component.component_selection_model.set_stock_status(i?"out-of-stock":"in-stock"),"function"==typeof m.composite_data.component.component_selection_model.set_availability)&&(_||this.has_backorder_notification()?m.composite_data.component.component_selection_model.set_availability(wc_bundle_params.i18n_available_on_backorder):m.composite_data.component.component_selection_model.set_availability("")),m.composite_data.composite.actions.do_action("component_selection_content_changed",[m.composite_data.component])),m.$bundle_data.trigger("woocommerce-product-bundle-updated",[m])},this.has_backorder_notification=function(){return"available-on-backorder"===m.price_data.availability_class},this.hide_bundle=function(t){var e,i=b("<ul/>");void 0===t?0<(e=m.get_validation_messages()).length?b.each(e,function(t,e){i.append(b("<li/>").html(e))}):i.append(b("<li/>").html(wc_bundle_params.i18n_unavailable_text)):i.append(b("<li/>").html(t.toString())),m.$bundle_error_content.html(i.html()),setTimeout(function(){m.$bundle_error.slideDown(200)},1),m.$bundle_button.find("button").addClass("disabled"),m.$bundle_wrap.trigger("woocommerce-product-bundle-hide")},this.update_price_data=function(){b.each(m.bundled_items,function(t,e){var i=e.$bundled_item_cart,_=e.bundled_item_id,a=e.get_quantity();m.price_data.quantities[_]=0,e.is_selected()&&0<a&&(m.price_data.quantities[_]=parseInt(a,10)),i.data("quantity",m.price_data.quantities[_]),e.is_variable_product_type()&&""===e.get_variation_id()&&(m.price_data.prices[_]=0,m.price_data.regular_prices[_]=0,m.price_data.recurring_prices[_]=0,m.price_data.regular_recurring_prices[_]=0,m.price_data.prices_tax[_]=!1),m.price_data.prices[_]=Number(m.price_data.prices[_]),m.price_data.regular_prices[_]=Number(m.price_data.regular_prices[_]),m.price_data.recurring_prices[_]=Number(m.price_data.recurring_prices[_]),m.price_data.regular_recurring_prices[_]=Number(m.price_data.regular_recurring_prices[_]),e.has_addons()&&e.update_addons_prices(),m.price_data.addons_prices[_]=Number(m.price_data.addons_prices[_]),m.price_data.regular_addons_prices[_]=Number(m.price_data.regular_addons_prices[_])})},this.update_totals=function(t){this.update_price_data(),this.calculate_subtotals(t),!m.dirty_subtotals&&!1!==m.is_initialized||(m.dirty_subtotals=!1,m.calculate_totals())},this.get_taxed_totals=function(t,e,i,_){_=void 0===_?1:_;var a=!(!i||void 0===i.incl)&&Number(i.incl),i=!(!i||void 0===i.excl)&&Number(i.excl),e={price:_*t,regular_price:_*e,price_incl_tax:_*t,price_excl_tax:_*t};return a&&i&&(e.price_incl_tax=wc_pb_number_round(e.price*a),e.price_excl_tax=wc_pb_number_round(e.price*i),"incl"===wc_bundle_params.tax_display_shop?(e.price=e.price_incl_tax,e.regular_price=wc_pb_number_round(e.regular_price*a)):(e.price=e.price_excl_tax,e.regular_price=wc_pb_number_round(e.regular_price*i))),e},this.calculate_subtotals=function(l,t,u){var e,i,_,p=void 0===t?m.price_data:t;if(u=void 0===u?1:parseInt(u,10),!1===(l=void 0!==l&&l)&&(e=Number(p.base_price),i=Number(p.base_regular_price),_=p.base_price_tax,p.base_price_totals=this.get_taxed_totals(e,i,_,u)),b.each(m.bundled_items,function(t,e){if(!1!==l&&l.bundled_item_id!==e.bundled_item_id)return!0;var i=e.is_sold_individually()&&0<p.quantities[e.bundled_item_id]?1:p.quantities[e.bundled_item_id]*u,_="variable"===e.get_product_type()?e.get_variation_id():e.get_product_id(),a=p.prices_tax[e.bundled_item_id],n=e.is_subscription()?p.regular_prices[e.bundled_item_id]:p.regular_prices[e.bundled_item_id]+p.regular_addons_prices[e.bundled_item_id],s=e.is_subscription()?p.prices[e.bundled_item_id]:p.prices[e.bundled_item_id]+p.addons_prices[e.bundled_item_id],d=p.regular_recurring_prices[e.bundled_item_id]+p.regular_addons_prices[e.bundled_item_id],r=p.recurring_prices[e.bundled_item_id]+p.addons_prices[e.bundled_item_id],o={price:0,regular_price:0,price_incl_tax:0,price_excl_tax:0},c={price:0,regular_price:0,price_incl_tax:0,price_excl_tax:0},_=("yes"===wc_bundle_params.calc_taxes?0<_&&0<i&&((0<s||0<n)&&(o=m.get_taxed_totals(s,n,a,i)),0<r||0<d)&&(c=m.get_taxed_totals(r,d,a,i)):(o.price=i*s,o.regular_price=i*n,o.price_incl_tax=i*s,o.price_excl_tax=i*s,c.price=i*r,c.regular_price=i*d,c.price_incl_tax=i*r,c.price_excl_tax=i*r),o=m.filters.apply_filters("bundled_item_totals",[o,e,u]),c=m.filters.apply_filters("bundled_item_recurring_totals",[c,e,u]),!1);m.totals_changed(p["bundled_item_"+e.bundled_item_id+"_totals"],o)&&(m.dirty_subtotals=_=!0,p["bundled_item_"+e.bundled_item_id+"_totals"]=o),m.totals_changed(p["bundled_item_"+e.bundled_item_id+"_recurring_totals"],c)&&(m.dirty_subtotals=_=!0,p["bundled_item_"+e.bundled_item_id+"_recurring_totals"]=c),_&&m.$bundle_data.trigger("woocommerce-bundled-item-totals-changed",[e])}),void 0!==t)return p},this.calculate_totals=function(t){void 0===t&&m.$bundle_data.trigger("woocommerce-product-bundle-calculate-totals",[m]);var e,a=void 0===t?m.price_data:t,i=!1,_={price:wc_pb_number_round(a.base_price_totals.price),regular_price:wc_pb_number_round(a.base_price_totals.regular_price),price_incl_tax:wc_pb_number_round(a.base_price_totals.price_incl_tax),price_excl_tax:wc_pb_number_round(a.base_price_totals.price_excl_tax)},n=(b.each(m.bundled_items,function(t,e){if(e.is_unavailable())return!0;e=a["bundled_item_"+e.bundled_item_id+"_totals"];void 0!==e&&(_.price+=wc_pb_number_round(e.price),_.regular_price+=wc_pb_number_round(e.regular_price),_.price_incl_tax+=wc_pb_number_round(e.price_incl_tax),_.price_excl_tax+=wc_pb_number_round(e.price_excl_tax))}),m.get_bundled_subscriptions()),s={};return n&&b.each(n,function(t,e){var i,_=e.bundled_item_id;return 0===a.quantities[_]||"variable-subscription"===e.get_product_type()&&""===e.get_variation_id()||(e=a.recurring_keys[_],i=a["bundled_item_"+_+"_recurring_totals"],void(void 0===s[e]?s[e]={html:a.recurring_html[_],price:i.price,regular_price:i.regular_price,price_incl_tax:i.price_incl_tax,price_excl_tax:i.price_excl_tax}:(s[e].price+=i.price,s[e].regular_price+=i.regular_price,s[e].price_incl_tax+=i.price_incl_tax,s[e].price_excl_tax+=i.price_excl_tax)))}),e=_,_=m.filters.apply_filters("bundle_totals",[_,a,m]),!(i=!(i=m.totals_changed(a.totals,_))&&n&&JSON.stringify(a.recurring_totals)!==JSON.stringify(s)?!0:i)&&!1!==m.is_initialized||(a.subtotals=e,a.totals=_,a.recurring_totals=s,void 0!==t)||this.updated_totals(),a},this.updated_totals=function(){clearTimeout(m.update_price_timer),m.update_price_timer=setTimeout(function(){m.updated_totals_task()},5)},this.get_price_html=function(t){var t=void 0===t?m.price_data:t,e=!1,i=m.is_composited()?m.composite_data.component.get_selected_quantity():1,_="p",a=(m.has_addons()&&(a=(t=b.extend(e=!0,{},t)).addons_price||m.get_addons_raw_price(),n=t.addons_regular_price||a,0<a&&(t.base_price=Number(t.base_price)+Number(a)),0<n)&&(t.base_regular_price=Number(t.base_regular_price)+Number(n)),(e=m.is_composited()&&(_="span","yes"===t.composited_totals_incl_qty)?!0:e)&&(t=m.calculate_subtotals(!1,t,i),t=m.calculate_totals(t)),""),n="yes"===t.show_total_string&&wc_bundle_params.i18n_total?'<span class="total">'+wc_bundle_params.i18n_total+"</span>":"",e=0===t.totals.price&&"yes"===t.show_free_string?wc_bundle_params.i18n_free:wc_pb_price_format(t.totals.price),i=wc_pb_price_format(t.totals.regular_price),s=m.get_formatted_price_suffix(t),i=(t.totals.regular_price>t.totals.price&&(e=wc_bundle_params.i18n_strikeout_price_string.replace("%f",i).replace("%t",e)),a=wc_bundle_params.i18n_price_format.replace("%t",n).replace("%p",e).replace("%s",s),m.get_recurring_price_html());return a=i?0<t.totals.regular_price?"<"+_+' class="price">'+t.price_string_recurring_up_front.replace("%s",a).replace("%r",i)+"</"+_+">":"<"+_+' class="price">'+t.price_string_recurring.replace("%r",i)+"</"+_+">":"<"+_+' class="price">'+a+"</"+_+">"},this.get_recurring_price_html=function(t){var n=void 0===t?m.price_data:t,s="";if(m.get_bundled_subscriptions()){var e,d=0<n.totals.regular_price,r=[];for(e in n.recurring_totals)n.recurring_totals.hasOwnProperty(e)&&r.push(n.recurring_totals[e]);b.each(r,function(t,e){var i=0==e.price?wc_bundle_params.i18n_free:wc_pb_price_format(e.price),_=wc_pb_price_format(e.regular_price),a=m.get_formatted_price_suffix(n,{price_incl_tax:e.price_incl_tax,price_excl_tax:e.price_excl_tax});e.regular_price>e.price&&(i=wc_bundle_params.i18n_strikeout_price_string.replace("%f",_).replace("%t",i)),_=wc_bundle_params.i18n_price_format.replace("%t","").replace("%p",i).replace("%s",a),_='<span class="bundled_sub_price_html">'+e.html.replace("%s",_)+"</span>",s=t===r.length-1||0===t&&!d?0<t||d?wc_bundle_params.i18n_recurring_price_join_last.replace("%r",s).replace("%c",_):_:wc_bundle_params.i18n_recurring_price_join.replace("%r",s).replace("%c",_)})}return s},this.show_price_html=function(){var i;return!!m.showing_price_html||(i=wc_pb_number_round(m.price_data.totals.price)!==wc_pb_number_round(m.price_data.raw_bundle_price_min)||m.price_data.raw_bundle_price_min!==m.price_data.raw_bundle_price_max,m.get_bundled_subscriptions()&&b.each(m.bundled_items,function(t,e){if(0<m.price_data.recurring_prices[e.bundled_item_id]&&0<m.price_data.quantities[e.bundled_item_id]&&(e.is_subscription("variable")||e.is_optional()||e.$self.find(".quantity input[type!=hidden]").length))return!(i=!0)}),i&&b.each(m.bundled_items,function(t,e){if(e.is_unavailable()&&e.is_required())return i=!1}),i||b.each(m.bundled_items,function(t,e){"yes"===m.price_data.has_variable_quantity[e.bundled_item_id]&&0<m.price_data["bundled_item_"+e.bundled_item_id+"_totals"].price&&(i=!0)}),m.is_composited()&&(i||m.composite_data.composite.api.is_component_priced_individually(this.composite_data.component.step_id)&&(i=!0),!i||!1!==this.composite_data.component.is_selected_product_price_visible()&&!1!==m.composite_data.composite.api.is_component_priced_individually(this.composite_data.component.step_id)||(i=!1)),i&&(m.showing_price_html=!0),i)},this.updated_totals_task=function(){var t=m.show_price_html();(m.passes_validation()||"no"===m.price_data.hide_total_on_validation_fail)&&t?(t=m.get_price_html(),t=m.filters.apply_filters("bundle_total_price_html",[t,m]),m.$bundle_price.html(t),m.$bundle_price.slideDown(200)):m.$bundle_price.slideUp(200),m.$bundle_data.trigger("woocommerce-product-bundle-updated-totals",[m])},this.updated_addons_handler=function(){m.updated_totals_task()},this.has_addons=function(){return this.$addons_totals&&0<this.$addons_totals.length},this.has_pct_addons=function(t){var t=void 0!==t?t:this,i=!1;return t.has_addons&&(t=t.$addons_totals.data("price_data"),b.each(t,function(t,e){if("percentage_based"===e.price_type)return!(i=!0)})),i},this.get_addons_raw_price=function(n,t){var s=void 0!==n,d="regular"===t?"regular":"",t=s?n:this,r=s?n.get_quantity():1,o=s?m.price_data.prices_tax[n.bundled_item_id]:m.price_data.base_price_tax,c=0;if(!t.has_addons())return 0;if(!r)return 0;if(s&&n.is_variable_product_type()&&""===n.get_variation_id())return 0;if(s&&!n.is_priced_individually())return 0;m.is_composited()&&(r=m.composite_data.component.get_selected_quantity());t=t.$addons_totals.data("price_data");return b.each(t,function(t,e){var i,_,a;e.is_custom_price?(_=0,a=!(!o||void 0===o.incl)&&Number(o.incl),i=!(!o||void 0===o.excl)&&Number(o.excl),_="incl"===wc_bundle_params.tax_display_shop&&"no"===wc_bundle_params.prices_include_tax?e.cost_raw/(a||1):"excl"===wc_bundle_params.tax_display_shop&&"yes"===wc_bundle_params.prices_include_tax?e.cost_raw/(i||1):e.cost_raw,c+=_/r):"quantity_based"===e.price_type?c+=e.cost_raw_pu:"flat_fee"===e.price_type?c+=e.cost_raw/r:"percentage_based"===e.price_type&&(a="regular"==d?s?m.price_data.regular_prices[n.bundled_item_id]:m.price_data.base_regular_price:s?m.price_data.prices[n.bundled_item_id]:m.price_data.base_price,c+=e.cost_raw_pct*a)}),c},this.totals_changed=function(t,e){return void 0===t||t.price!==e.price||t.regular_price!==e.regular_price||t.price_incl_tax!==e.price_incl_tax||t.price_excl_tax!==e.price_excl_tax},this.is_composited=function(){return!1!==this.composite_data},this.get_formatted_price_suffix=function(t,e){var t=void 0===t?m.price_data:t,i="";return e=void 0===e?t.totals:e,i=t.suffix_exists&&(i=t.suffix,t.suffix_contains_price_incl&&(i=i.replace("{price_including_tax}",wc_pb_price_format(e.price_incl_tax))),t.suffix_contains_price_excl)?i.replace("{price_excluding_tax}",wc_pb_price_format(e.price_excl_tax)):i},this.get_bundled_subscriptions=function(i){var _={},a=!1;return b.each(m.bundled_items,function(t,e){e.is_subscription(i)&&e.is_priced_individually()&&(_[t]=e,a=!0)}),!!a&&_},this.add_validation_message=function(t){this.validation_messages.push(t.toString())},this.get_validation_messages=function(){return this.validation_messages},this.passes_validation=function(){return!(0<this.validation_messages.length)},this.group_mode_supports=function(t){return-1<b.inArray(t,this.price_data.group_mode_features)}}function e(n,t,e){this.initialize=function(){this.$self=t,this.$bundled_item_cart=t.find(".cart"),this.$bundled_item_content=t.find(".bundled_item_optional_content, .bundled_item_cart_content"),this.$bundled_item_image=t.find(".bundled_product_images"),this.$bundled_item_title=t.find(".bundled_product_title_inner"),this.$bundled_item_qty=t.find("input.bundled_qty"),this.$addons_totals=t.find("#product-addons-total"),this.$nyp=t.find(".nyp"),this.$attribute_select=!1,this.$attribute_select_config=!1,this.$reset_bundled_variations=!1,this.render_addons_totals_timer=!1,this.show_addons_totals=!1,this.addons_totals_html="",this.bundled_item_index=e,this.bundled_item_id=this.$bundled_item_cart.data("bundled_item_id"),this.bundled_item_title=this.$bundled_item_cart.data("title"),this.bundled_item_title_raw=this.bundled_item_title?b("<div/>").html(this.bundled_item_title).text():"",this.bundled_item_product_title=this.$bundled_item_cart.data("product_title"),this.bundled_item_product_title_raw=this.bundled_item_title?b("<div/>").html(this.bundled_item_title).text():"",this.bundled_item_optional_suffix=void 0===this.$bundled_item_cart.data("optional_suffix")?wc_bundle_params.i18n_optional:this.$bundled_item_cart.data("optional_suffix"),this.product_type=this.$bundled_item_cart.data("type"),this.product_id=void 0===n.price_data.product_ids[this.bundled_item_id]?"":n.price_data.product_ids[this.bundled_item_id].toString(),this.nyp=void 0!==n.price_data.product_ids[this.bundled_item_id]&&"yes"===n.price_data.is_nyp[this.bundled_item_id],this.sold_individually=void 0!==n.price_data.product_ids[this.bundled_item_id]&&"yes"===n.price_data.is_sold_individually[this.bundled_item_id],this.priced_individually=void 0!==n.price_data.product_ids[this.bundled_item_id]&&"yes"===n.price_data.is_priced_individually[this.bundled_item_id],this.variation_id="",this.has_wc_core_gallery_class=this.$bundled_item_image.hasClass("images"),void 0===this.bundled_item_id&&(this.bundled_item_id=this.$bundled_item_cart.attr("data-bundled-item-id")),this.initialize_addons()},this.initialize_addons=function(){this.has_addons()?1==this.$addons_totals.data("show-sub-total")&&(this.$addons_totals.data("show-sub-total",0),this.show_addons_totals=!0,this.$bundled_item_cart.trigger("woocommerce-product-addons-update")):this.$addons_totals=!1},this.get_bundle=function(){return n},this.get_title=function(t){return(t=void 0!==t&&t)?this.bundled_item_title_raw:this.bundled_item_title},this.get_product_title=function(t){return(t=void 0!==t&&t)?this.bundled_item_product_title_raw:this.bundled_item_product_title},this.get_optional_suffix=function(){return this.bundled_item_optional_suffix},this.get_product_id=function(){return this.product_id},this.get_variation_id=function(){return this.variation_id},this.set_variation_id=function(t){this.variation_id=t.toString()},this.get_variation_data=function(){return this.$bundled_item_cart.data("product_variations")},this.get_product_type=function(){return this.product_type},this.is_variable_product_type=function(){return"variable"===this.product_type||"variable-subscription"===this.product_type},this.get_quantity=function(){var t=this.$bundled_item_qty.val();return isNaN(t)?0:parseInt(t,10)},this.get_selected_quantity=function(){return n.price_data.quantities[this.bundled_item_id]},this.get_available_quantity=function(){return n.price_data.quantities_available[this.bundled_item_id]},this.is_in_stock=function(){return"no"!==n.price_data.is_in_stock[this.bundled_item_id]},this.has_insufficient_stock=function(){return!(!this.is_selected()||0===this.get_selected_quantity()||this.is_variable_product_type()&&""===this.get_variation_id()||this.is_in_stock()&&!(""!==this.get_available_quantity()&&this.get_selected_quantity()>this.get_available_quantity())||this.backorders_allowed())},this.is_backordered=function(){return!(!this.is_selected()||0===this.get_selected_quantity()||this.is_variable_product_type()&&""===this.get_variation_id()||!((""===this.get_available_quantity()||this.get_selected_quantity()>this.get_available_quantity())&&this.backorders_allowed()&&this.backorders_require_notification()))},this.backorders_allowed=function(){return"yes"===n.price_data.backorders_allowed[this.bundled_item_id]},this.backorders_require_notification=function(){return"yes"===n.price_data.backorders_require_notification[this.bundled_item_id]},this.is_optional=function(){return"yes"===this.$bundled_item_cart.data("optional")||1===this.$bundled_item_cart.data("optional")},this.is_unavailable=function(){return"yes"===this.$bundled_item_cart.data("custom_data").is_unavailable},this.is_required=function(){return!this.is_optional()&&"no"!==this.$bundled_item_cart.data("custom_data").is_required},this.is_visible=function(){return"yes"===this.$bundled_item_cart.data("visible")||1===this.$bundled_item_cart.data("visible")},this.is_selected=function(){var t=!0;return t=this.is_optional()&&!1===this.$bundled_item_cart.data("optional_status")?!1:t},this.set_selected=function(t){this.is_optional()&&(this.$bundled_item_cart.data("optional_status",t),this.is_nyp())&&this.$nyp.data("optional_status",t)},this.init_scripts=function(){"undefined"!=typeof PhotoSwipe&&"yes"===wc_bundle_params.photoswipe_enabled&&this.init_photoswipe(),this.$self.find(".bundled_product_optional_checkbox input").trigger("change"),this.$self.find("input.bundled_qty").trigger("change"),this.is_optional()&&!this.is_selected()&&this.$bundled_item_cart.find(".wc-pao-addon-field").removeAttr("required"),this.is_variable_product_type()&&!this.$bundled_item_cart.hasClass("variations_form")&&(this.$reset_bundled_variations=this.$bundled_item_cart.find(".reset_bundled_variations"),0===this.$reset_bundled_variations.length&&(this.$reset_bundled_variations=!1),this.$bundled_item_cart.addClass("variations_form").wc_variation_form(),this.$attribute_select=this.$bundled_item_cart.find(".variations .attribute_options select"),this.$attribute_select_config=this.$attribute_select.filter(function(){return!1===b(this).parent().hasClass("bundled_variation_attribute_options_wrapper")}),0<this.$attribute_select.length)&&this.$attribute_select.first().trigger("change"),this.$self.find("div").stop(!0,!0),this.update_selection_title()},this.init_photoswipe=function(){b.fn.wc_product_gallery?this.$bundled_item_image.wc_product_gallery({zoom_enabled:"yes"===wc_bundle_params.zoom_enabled,flexslider_enabled:!1}):window.console.warn("Failed to initialize PhotoSwipe for bundled item images. Your theme declares PhotoSwipe support, but function '$.fn.wc_product_gallery' is undefined.");var t=this.$bundled_item_image.find("a.placeholder_image");0<t.length&&t.on("click",function(){return!1})},this.update_selection_title=function(t){var e,i,_,a;return 0!==this.$bundled_item_title.length&&(e=parseInt(this.get_quantity(),10),!isNaN(e))&&(i="hidden"===(a=this.$bundled_item_qty.attr("type"))?e:parseInt(this.$bundled_item_qty.attr("min"),10),_="hidden"===a?e:parseInt(this.$bundled_item_qty.attr("max"),10),i=isNaN(i)?-9999:i,_=isNaN(_)?9999:_,t=void 0!==t&&t,(t=this.is_selected()?t:!0)&&(e="hidden"===a?e:parseInt(this.$bundled_item_qty.attr("min"),10)),"tabular"===n.price_data.layout&&(i=_=""),a=!1,t?a=i===_&&1<e:0<e&&(a=i!==_||1<e||"yes"===wc_bundle_params.force_selection_qty),t=this.bundled_item_title,i=a?wc_bundle_params.i18n_qty_string.replace("%s",e):"",_=this.is_optional()&&""!==this.get_optional_suffix()?wc_bundle_params.i18n_optional_string.replace("%s",this.get_optional_suffix()):"",a=wc_bundle_params.i18n_title_string.replace("%t",t).replace("%q",i).replace("%o",_),void this.$bundled_item_title.html(a))},this.reset_selection_title=function(){this.update_selection_title(!0)},this.is_subscription=function(t){return"simple"===t?"subscription"===this.product_type:"variable"!==t&&"subscription"===this.product_type||"variable-subscription"===this.product_type},this.has_addons=function(){return this.$addons_totals&&0<this.$addons_totals.length},this.has_pending_required_addons=function(){var t=!1,e=this.addons_form;return e&&(e=e.validation.getValidationState(),b.each(e,function(){if(!this.validation&&"required"===this.reason)return!(t=!0)})),t},this.update_addons_prices=function(){var t=n.get_addons_raw_price(this),e=n.has_pct_addons(this)?n.get_addons_raw_price(this,"regular"):t;n.price_data.addons_prices[this.bundled_item_id]===t&&n.price_data.regular_addons_prices[this.bundled_item_id]===e||(n.price_data.addons_prices[this.bundled_item_id]=t,n.price_data.regular_addons_prices[this.bundled_item_id]=e)},this.render_addons_totals=function(){var t=this;clearTimeout(this.render_addons_totals_timer),this.render_addons_totals_timer=setTimeout(function(){t.render_addons_totals_task()},10)},this.render_addons_totals_task=function(){var t,e,i;this.has_addons&&(i=n.price_data.addons_prices[this.bundled_item_id],this.show_addons_totals)&&((!this.is_variable_product_type()||""!==this.get_variation_id())&&(e=this.get_quantity(),t=n.price_data.prices_tax[this.bundled_item_id],0<n.get_taxed_totals(i,i,t,e).price)?(i=Number(n.price_data.prices[this.bundled_item_id])+Number(i),t=wc_pb_price_format((i=n.get_taxed_totals(i,i,t,e)).price),e=n.get_formatted_price_suffix(n.price_data,i),i='<span class="price"><span class="subtotal">'+wc_bundle_params.i18n_subtotal+"</span>"+t+e+"</span>",this.addons_totals_html=i,this.$addons_totals.html(i).slideDown(200)):this.$addons_totals.slideUp(200))},this.has_single_variation=function(){return void 0!==this.get_variation_data()&&1===this.get_variation_data().length},this.has_configurable_attributes=function(){return 0<this.$attribute_select_config.length},this.reset_variation_image=function(){return n.filters.apply_filters("bundled_item_reset_variation_image",[this.is_optional()&&!this.is_selected()&&this.has_configurable_attributes(),this])},this.is_nyp=function(){return this.nyp},this.is_nyp_valid=function(){var t,e=!0;return e=b.fn.wc_nyp_get_script_object&&(t=this.$nyp.wc_nyp_get_script_object())&&!1===t.isValid()?!1:e},this.is_sold_individually=function(){return this.sold_individually},this.is_priced_individually=function(){return this.priced_individually},this.maybe_add_wc_core_gallery_class=function(){this.has_wc_core_gallery_class||this.$bundled_item_image.addClass("images")},this.maybe_remove_wc_core_gallery_class=function(){this.has_wc_core_gallery_class||this.$bundled_item_image.removeClass("images")},this.initialize()}function i(){var a=this,s={},n={add_filter:function(t,e,i,_){e={callback:e,priority:i,context:_},i=(i=s[t])?(i.push(e),this.sort_filters(i)):[e];s[t]=i},remove_filter:function(t,e,i){var _,a,n;if(s[t])if(e)if(_=s[t],i)for(n=_.length;n--;)(a=_[n]).callback===e&&a.context===i&&_.splice(n,1);else for(n=_.length;n--;)_[n].callback===e&&_.splice(n,1);else s[t]=[]},sort_filters:function(t){for(var e,i,_,a=1,n=t.length;a<n;a++){for(e=t[a],i=a;(_=t[i-1])&&_.priority>e.priority;)t[i]=t[i-1],--i;t[i]=e}return t},apply_filters:function(t,e){var i,_,a=s[t];if(a)for(_=a.length,i=0;i<_;i++)e[0]=a[i].callback.apply(a[i].context,e);return e[0]}};this.add_filter=function(t,e,i,_){return"string"==typeof t&&"function"==typeof e&&(i=parseInt(i||10,10),n.add_filter(t,e,i,_)),a},this.apply_filters=function(t,e){if("string"==typeof t)return n.apply_filters(t,e)},this.remove_filter=function(t,e){return"string"==typeof t&&n.remove_filter(t,e),a}}jQuery(function(r){r("body").on("quick-view-displayed",function(){r(".quick-view .bundle_form .bundle_data").each(function(){var t=r(this);0===t.closest(".composite_form").length&&t.wc_pb_bundle_form()})}),r.fn.wc_pb_bundle_form=function(){if(!r(this).hasClass("bundle_data"))return!0;var t=r(this),e=t.data("bundle_id");if(void 0===e){if(!(e=t.attr("data-bundle-id")))return!1;t.data("bundle_id",e)}var i,_,a=t.closest(".bundle_form"),n=a.closest(".composite_form"),s=!1,d=e;(is_part_of_composite=0<n.length)&&0<(i=a.closest(".component").data("item_id"))&&r.fn.wc_get_composite_script&&!1!==(n=n.wc_get_composite_script())&&!1!==(_=n.api.get_step(i))&&(s={composite:n,component:_},d=i),void 0!==wc_pb_bundle_scripts[d]&&(is_part_of_composite?wc_pb_bundle_scripts[d].shutdown():d=d+"_"+Object.keys(wc_pb_bundle_scripts).length),wc_pb_bundle_scripts[d]=new o({$bundle_form:a,$bundle_data:t,bundle_id:e,composite_data:s}),a.data("script_id",d),wc_pb_bundle_scripts[d].initialize()},r(".bundle_form .bundle_data").each(function(){var t=r(this);0===t.closest(".composite_form").length&&t.wc_pb_bundle_form()})})}(jQuery);
var WOF;!function(s){var t=function(){function s(t,a){function i(){r.forEach(function(t){return s.updateFetti(t,p/o,n.decay)}),p+=1,p<o?requestAnimationFrame(i):r.forEach(function(s){s.e.remove()})}void 0===a&&(a={}),this.colors=["#a864fd","#29cdff","#78ff44","#ff718d","#fdff6a"];var n={};jQuery.extend(n,{amt:120,angle:55,spread:295,sv:65,decay:.82},a);for(var r=[],e=0;e<n.amt;e++){var c=Math.round(10*(Math.random()+.5))+"px",h=jQuery("<div>").css({"background-color":this.colors[e%this.colors.length],position:"absolute","z-index":999999999,width:c,height:c});Math.random()>.5&&h.css("border-radius","50%"),r.push({e:h,physics:s.physics(n.angle,n.spread,n.sv,Math.random)}),t.append(h)}var o=200,p=0;requestAnimationFrame(i)}return s.physics=function(s,t,a,i){var n=s*(Math.PI/180),r=t*(Math.PI/180);return{x:0,y:0,w:10*i(),v:.5*a+i()*a,angle2D:-n+(.5*r-i()*r),angle3D:-Math.PI/4+i()*(Math.PI/2),tilt:i()*Math.PI}},s.updateFetti=function(s,t,a){s.physics.x+=Math.cos(s.physics.angle2D)*s.physics.v,s.physics.y+=Math.sin(s.physics.angle2D)*s.physics.v,s.physics.z+=Math.sin(s.physics.angle3D)*s.physics.v,s.physics.w+=.1,s.physics.v*=a,s.physics.y+=3,s.physics.tilt+=.1;var i=s.physics,n=i.x+10*Math.cos(i.w),r=i.y+10*Math.sin(i.w);s.e.css({transform:"translate3d("+n+"px, "+r+"px, 0) rotate3d(1, 1, 1, "+i.tilt+"rad)",opacity:1-t})},s}();s.Fetti=t}(WOF||(WOF={}));
!function(e){var n=function(){function e(){}return e.set=function(e,n,t){if(!e||/^(?:expires|max\-age|path|domain|secure)$/i.test(e))return!1;var o="";if(t){var i=new Date;i.setTime(i.getTime()+24*t*60*60*1e3),o=";expires="+i.toUTCString()}return document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(n)+o+";samesite=lax;path=/",!0},e.has=function(e){return new RegExp("(?:^|;\\s*)"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(document.cookie)},e.remove=function(e){return!!this.has(e)&&(document.cookie=encodeURIComponent(e)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/",!0)},e}();e.Cookie=n}(WOF||(WOF={}));
!function(t){var e=function(){function e(t,e,i){var s=this;if(this.element=t,this.duration=e,this.period=i,this.wheelId=this.element.data("id"),this.element&&this.element.find(".wof-bar-close").on("click",function(t){t.preventDefault(),s.hide()}),null!==sessionStorage.getItem("wof-cb-"+this.wheelId)){var n=sessionStorage.getItem("wof-cb-"+this.wheelId).split("--");this.show(n[0],parseInt(n[1]))}}return e.prototype.show=function(e,i){if(t.Dispatcher.applyFilter("wof-show-couponbar",!0)){var s=i||(new Date).getTime()/1e3;this.element.find(".wof-bar-code").text(e),sessionStorage.setItem("wof-cb-"+this.wheelId,e+"--"+s),this.startTicking(s),this.element.show()}},e.prototype.hide=function(){sessionStorage.removeItem("wof-cb-"+this.wheelId),this.element.remove(),clearInterval(this.interval)},e.prototype.startTicking=function(t){var e=this,i=".wof-bar-",s=this.element.find(i+"d"),n=this.element.find(i+"h"),o=this.element.find(i+"m"),h=this.element.find(i+"s"),a=t,r=a,d=(new Date).getTime()/1e3;switch(this.period){case"minutes":r=a+60*this.duration;break;case"hours":r=a+3600*this.duration;break;case"days":r=a+86400*this.duration}var l=r-d,f=function(){l--;var t={days:Math.floor(l/86400),hours:Math.floor(l%86400/3600),minutes:Math.floor(l%86400%3600/60),seconds:Math.floor(l%86400%3600%60%60)};s.html(t.days+s.data("text")),n.html(t.hours+n.data("text")),o.html(t.minutes+o.data("text")),h.html(t.seconds+h.data("text")),0==t.days&&s.hide(),0==t.hours&&n.hide(),0==t.minutes&&o.hide(),l<=0&&e.hide()};f(),this.interval=setInterval(function(){f()},1e3)},e}();t.CouponBar=e}(WOF||(WOF={}));
!function(t){var i=function(){function t(){}return t.addFilter=function(t,i){this.f[t]||(this.f[t]=[]),this.f[t].push(i)},t.hasFilter=function(t){return!!this.f[t]},t.applyFilter=function(i,n){if(!t.hasFilter(i))return n;var h=n;return this.f[i].forEach(function(t){h=t(h)}),h},t.subscribe=function(t,i){this.hOP.call(this.t,t)||(this.t[t]=[]),this.t[t].push(i)},t.publish=function(t,i){this.hOP.call(this.t,t)&&this.t[t].forEach(function(t){t(void 0!=i?i:{})})},t.f=[],t.t=[],t.hOP=[].hasOwnProperty,t}();t.Dispatcher=i}(WOF||(WOF={}));
!function(e){var a=function(){function a(){}return a.getFormFieldValues=function(e){var a=[],t=e.find(".wof-input");return jQuery.each(t,function(e,t){var o=jQuery(t),r=o.data("type");"primary_email"!=r&&a.push({id:o.data("field-id"),value:"consent_checkbox"==r?o.is(":checked"):o.val(),type:r})}),a},a.buildForm=function(a){var t=[];return a.length?(a.forEach(function(a){a.options&&"string"==typeof a.options&&(a.options=JSON.parse(a.options)),t.push(e.FormBuilder.createField(a))}),t):[]},a.createField=function(a){a.type=a.type.toLowerCase();var t=jQuery("<div>"),o=null;switch(a.type){case"textarea":o=jQuery("<textarea>");break;case"dropdown":o=jQuery("<select>");break;case"consent_checkbox":o=jQuery('<input type="checkbox">');break;default:o=jQuery('<input type="'+("number"===a.type?"number":"primary_email"===a.type?"email":"text")+'">')}o.attr("placeholder",a.placeholder?a.placeholder:"primary_email"===a.type?"E-mail":"").attr("aria-label",a.placeholder).data("type",a.type).data("fieldId",a.id?a.id:"").attr("data-wof-field",a.id?a.id:"").addClass("wof-input");var r=function(e,a,t){t.data("mask").getRegexMask().test(e)?t.data("mask-validated",!0):t.data("mask-validated",!1)};switch(a.type){case"primary_email":o.attr("name","wof-email");break;case"date_ml":o.wpmask("0000/00/00",{placeholder:a.placeholder,onChange:r});break;case"date":o.wpmask("00/00/0000",{placeholder:a.placeholder+" ("+(a.options.date_format?a.options.date_format:"__/__/____")+")",onChange:r});break;case"birthday":o.wpmask("00/00",{placeholder:a.placeholder+" ("+(a.options.date_format?a.options.date_format:"__/__")+")",onChange:r});break;case"zip":o.wpmask("00000X9999",{placeholder:"",onChange:r,translation:{X:{pattern:/-/,optional:!0}}});break;case"sms":o.wpmask("+# #",{placeholder:a.placeholder+" (+_ _____)",onChange:r});case"phone":a.options.phone_format&&"US"==a.options.phone_format?o.wpmask("(999) 999-9999",{placeholder:"",onChange:r}):o.wpmask("Z0#",{translation:{Z:{pattern:/[\-\+]/,optional:!0}}});break;case"dropdown":a.placeholder&&o.append(jQuery('<option value="">'+a.placeholder+"</option>")),a.options&&a.options.choices&&a.options.choices.forEach(function(e){o.append(jQuery('<option value="'+e+'">'+e+"</option>"))})}return a.required&&o.data("wof-required","primary_email"===a.type||"email"===a.type?"email":"consent_checkbox"===a.type?"checked":"text"),t.append(e.Dispatcher.applyFilter("wof-form-element",o)),"consent_checkbox"===a.type&&(o.attr("id","ckb-"+a.id),t.append('<label class="wof-fgcolor" for="ckb-'+a.id+'">'+a.placeholder+"</label>")),t},a}();e.FormBuilder=a}(WOF||(WOF={}));
!function(e){var n=function(){function n(){this.bars=[],this.init()}return n.prototype.init=function(){var n=this;jQuery(".wof-coupon-bar").each(function(t,o){var i=jQuery(o);n.bars.push(new e.CouponBar(i,i.data("duration"),i.data("timeframe")))}),jQuery(".wof-wheel").each(function(t,o){for(var i=jQuery(o),r=i.data("id"),a=null,t=0;t<n.bars.length;t++)if(n.bars[t].wheelId==r){a=n.bars[t];break}var s=i.data("standalone"),l=new e.Wheel(i,r,i.data("options"),i.data("seq"),s,a);l.widgets=jQuery(".wof-widget[data-id="+l.id+"]"),e.Frontend.wheels.push(l);var c=e.FormBuilder.buildForm(i.data("fields"));jQuery.each(c,function(e,n){l.element.find(".wof-form-fields").append(n)}),l.element.find(".wof-bg").css("height",s?"100%":l.element.find(".wof-wrapper").outerHeight(!0)),l.canShowWidgets()&&l.widgets.show().addClass("wof-visible")}),jQuery(window).resize(function(){e.Frontend.wheels.forEach(function(e){e.standalone||e.element.find(".wof-bg").css("height",e.element.find(".wof-wrapper").outerHeight(!0))})}),this.initFormSubmit(),this.initWheelEvents(),this.initShowWheels(),jQuery(document).trigger("wof:init")},n.prototype.getScrollPercentage=function(){var e=pageYOffset/(jQuery(document).height()-jQuery(window).height());return Math.round(100*e)},n.prototype.initShowWheels=function(){function n(e,n){var o=function(){t.getScrollPercentage()>=n&&(e.show("scroll"),jQuery(window).off("scroll",o))};jQuery(window).on("scroll",o)}var t=this;e.Frontend.wheels.forEach(function(o){if(o.standalone)return void o.show("standalone");if(o.widgets.on("click",function(e){o.show("widget")}),jQuery.inArray("immediately",o.options.appear)>-1&&o.show("immediately"),jQuery.inArray("click",o.options.appear)>-1&&o.options.selector){var i=0===o.options.selector.lastIndexOf("#",0)?"#":".";jQuery("body").on("click",i+o.options.selector.replace(/[#\.]/g,""),function(e){e.preventDefault(),o.show("click")})}if(jQuery.inArray("delay",o.options.appear)>-1&&setTimeout(function(){o.show("delay")},1e3*o.options.delay),jQuery.inArray("exit",o.options.appear)>-1)if(e.Helpers.isDevice("mobile")){var r=0,a=function(){var e=jQuery(this).scrollTop();if(e<r){if(t.getScrollPercentage()<25)return;if(r-e<60)return;o.show("exit-mobile"),jQuery(window).off("scroll",a)}else r=e};jQuery(window).on("scroll",a)}else{var s;document.documentElement.addEventListener("mouseleave",function(e){e.clientY>20||(s=setTimeout(function(){o.show("exit")},100))}),document.documentElement.addEventListener("mouseenter",function(e){s&&clearTimeout(s)})}jQuery.inArray("scroll",o.options.appear)>-1&&n(o,o.options.scroll)})},n.prototype.initWheelEvents=function(){e.Frontend.wheels.forEach(function(e){e.element.on("click",".wof-close",function(n){n.preventDefault(),e.hide()}),e.element.find(".wof-response").on("click",".wof-btn-again",function(n){n.preventDefault(),e.element.find(".wof-spinning").removeClass("wof-spinning").css("animationName","unset").addClass("wof-spinning"),e.element.removeClass("wof-played wof-won"),e.game.start()}),e.element.on("keypress change","input,input[type=checkbox],select",function(e){jQuery(e.currentTarget).removeClass("wof-form-error")})})},n.prototype.initFormSubmit=function(){e.Frontend.wheels.forEach(function(n){n.element.find(".wof-btn-submit").off("click").on("click",function(t){t.preventDefault(),e.Dispatcher.publish("wof-submit-clicked",n);var o=!e.Dispatcher.hasFilter("wof-can-optin")||e.Dispatcher.applyFilter("wof-can-optin",n);if(e.Helpers.validateForm(n)&&o){e.Helpers.triggerLoading(jQuery(t.currentTarget));var i=n.element.find('input[name="wof-email"]').val(),r=e.FormBuilder.getFormFieldValues(n.element);e.Helpers.optIn(n.id,i,n.game.sequence,n.game.sequence,r).then(function(t){if(n.game.mail=i,!1===t.success)return e.Helpers.triggerError(n.element,t.data),void e.Helpers.triggerLoading(n.element.find(".wof-btn-submit"));jQuery(document).trigger("wof:optin",{wheel:n.id,email:i,fields:r}),e.Dispatcher.applyFilter("wof-set-browser-data",!0)&&!n.standalone&&e.Cookie.set("wof-"+n.id,"1",365),n.game.start(t.data,r),e.Dispatcher.publish("wof-after-game-start",n)})}})})},n.wheels=[],n}();e.Frontend=n}(WOF||(WOF={})),jQuery(window).on("load",function(){new WOF.Frontend}),WOF=WOF;
!function(e){var t=function(){function t(e,t,i,n,o,s){void 0===s&&(s=null);var a=this;if(this.game=0,this.audio=null,this.audioContext=null,this.$wheelElement=e,this.wheelId=t,this.sequence=o,this.previousSequence=o,this.maxPlays=i+1,this.status="idle",this.onGameCompleted=s,n){this.audioContext=new(AudioContext||webkitAudioContext);!function(e){fetch(e).then(function(e){return e.arrayBuffer()}).then(function(e){return a.audioContext.decodeAudioData(e)}).then(function(e){a.audio=e}).catch(function(e){return console.error("Error loading audio:",e)})}(wofVars.baseUrl+"public/tick.mp3")}}return t.prototype.start=function(t,i){var n=this;void 0===t&&(t=null),void 0===i&&(i=[]),this.canStartNewGame()&&(this.status="playing",this.game++,t?this.doPlay(t):(e.Helpers.triggerLoading(this.$wheelElement.find(".wof-btn-submit,.wof-btn-again")),e.Helpers.getSegment(this.wheelId,this.sequence,this.previousSequence,this.mail,i).then(function(e){if(!1===e.success)return n.triggerGameError(e.data);n.doPlay(e.data)})))},t.prototype.end=function(t){e.Helpers.setResultText(this.$wheelElement,t),this.status="idle","function"==typeof this.onGameCompleted&&(t.winning||this.game>=this.maxPlays)&&this.onGameCompleted(t)},t.prototype.triggerGameError=function(t){this.status="idle",e.Helpers.triggerError(this.$wheelElement,t),e.Helpers.triggerLoading(this.$wheelElement.find(".wof-btn-submit,.wof-btn-again"))},t.prototype.doPlay=function(e){var t=this;this.previousSequence=this.sequence?this.sequence:e.seq,this.sequence=e.seq,this.doAnimation(e.segment,function(){t.end(e),jQuery(document).trigger("wof:play",{wheel:t.wheelId,email:t.mail,winning:e.winning,segment:e.segment,segment_text:e.text,segment_prize:e.value})})},t.prototype.canStartNewGame=function(){return this.game<=this.maxPlays&&"playing"!==this.status},t.prototype.doAnimation=function(t,i){var n=this,o=this.$wheelElement.data("time"),s=this.$wheelElement.data("speed"),a=this.$wheelElement.data("pointer"),r=1e3*o,u=e.Helpers.getRounds(s,o),h=360/this.$wheelElement.data("slice-count"),l=h/2,d=this.$wheelElement.find(".wof-spinning"),m=this.$wheelElement.find(".wof-pointer"),f={1:{5:150,6:150,7:150,8:150,9:150,10:150,11:150,12:160,13:160,14:160,15:170,16:170,17:170,18:200,19:200,20:200},2:{5:100,6:100,7:100,8:100,9:120,10:120,11:120,12:120,13:120,14:140,15:140,16:140,17:140,18:140,19:140,20:150},3:{5:50,6:50,7:60,8:60,9:60,10:70,11:70,12:80,13:90,14:90,15:90,16:90,17:90,18:110,19:110,20:110},4:{5:30,6:30,7:40,8:40,9:40,10:40,11:40,12:40,13:40,14:50,15:50,16:50,17:60,18:70,19:70,20:70},5:{5:20,6:20,7:20,8:20,9:30,10:30,11:30,12:30,13:40,14:40,15:40,16:40,17:50,18:60,19:60,20:60},6:{5:20,6:20,7:20,8:20,9:20,10:20,11:20,12:20,13:25,14:25,15:25,16:25,17:25,18:25,19:25,20:25}}[s][o];jQuery("#wof-"+this.wheelId+"-anim").remove();var c=(t-1)*h,w="@keyframes wof-spin-"+this.wheelId+"{ from { transform: rotate(0deg); } to { transform: rotate("+(360*(u+1)-c)+"deg); }}";jQuery("head").append('<style id="wof-'+this.wheelId+'-anim">'+w+"</style>");var p,g=d.first(),v=0,y=0,x=performance.now();d.css("animationName","wof-spin-"+this.wheelId).css("animationDuration",r+"ms");var E=function(){var t=performance.now();if(t-x>=r)return void("function"==typeof i&&setTimeout(function(){i()},25));var u=Math.max(1,e.Helpers.getRotationDegrees(g,l));if(u===y)return void requestAnimationFrame(E);var d=e.Helpers.getAnimDelta(u,v);if(d>=h-2.5&&d<200){if(n.audio){var c=n.audioContext.createBufferSource();c.buffer=n.audio,c.connect(n.audioContext.destination),n.audioContext.resume().then(function(){c.start(0)})}a&&(clearTimeout(p),p=setTimeout(function(){m.removeClass("do-nudge")},e.Helpers.calcAnimTimeOut(f,s,o,r,t-x)),m.addClass("do-nudge")),v=Math.round(u/h)*h}y=u,requestAnimationFrame(E)};requestAnimationFrame(E)},t}();e.Game=t}(WOF||(WOF={}));
!function(e){var t=function(){function t(){}return t.validateForm=function(t){var i=t.element.find("input,select"),r=!0;return jQuery.each(i,function(t,i){var a=jQuery(i),n=a.data("fieldId"),o=a.data("wof-required"),s=a.val(),f=!0;switch(o){case"email":-1!==s.indexOf("@")&&-1!==s.indexOf(".")||(f=!1);break;case"text":s.length||(f=!1);break;case"checked":a.is(":checked")||(f=!1)}a.data("mask")&&!1===a.data("mask-validated")&&(f=!1),e.Dispatcher.hasFilter("wof-validate-"+n)&&(f=e.Dispatcher.applyFilter("wof-validate-"+n,{id:n,value:s,$input:a})),f||(r=!1,a.addClass("wof-form-error do-form-nudge"),setTimeout(function(){a.removeClass("do-form-nudge")},300))}),r},t.isDevice=function(e){return jQuery(".wof-"+e+"-check").is(":visible")},t.registerView=function(t){if(wofVars){var i=!0;i=e.Dispatcher.applyFilter("wof-register-view",i),i&&jQuery.post(wofVars.ajaxurl,{action:"wof-register-view",nonce:e.Helpers.nonce(),id:t})}},t.getSegment=function(t,i,r,a,n){var o=e.Dispatcher.applyFilter("wof-play-data",{action:"wof-play",id:t,mail:a,seq:i,pseq:r,nonce:e.Helpers.nonce(),fields:JSON.stringify(n)});return jQuery.post(wofVars.ajaxurl,o).then(function(e){return e})},t.optIn=function(t,i,r,a,n){var o=e.Dispatcher.applyFilter("wof-optin-request-data",{action:"wof-email-optin",id:t,mail:i,seq:r,pseq:a,nonce:e.Helpers.nonce(),fields:JSON.stringify(n)});return jQuery.post(wofVars.ajaxurl,o).then(function(e){return e})},t.setOccurance=function(t,i,r){void 0===r&&(r=null);var a="wof-"+i;if(localStorage.removeItem(a),sessionStorage.removeItem(a),e.Cookie.remove(a),e.Dispatcher.applyFilter("wof-set-browser-data",!0))switch(t){case"session":sessionStorage.setItem(a,"1");break;case"storage":e.Cookie.set(a,"1",500),localStorage.setItem(a,"1");break;case"time":e.Cookie.set(a,"1",r)}},t.nonce=function(){return jQuery("[data-wof-nonce]").data("wof-nonce")},t.triggerError=function(e,t){e.find(".wof-error").html(t).fadeIn("fast"),setTimeout(function(){e.find(".wof-error").fadeOut("fast")},7e3)},t.triggerLoading=function(e){var t=e.find("span");t.is(":visible")?(e.attr("disabled",!0).find(".wof-loader").show(),t.hide()):(t.show(),e.attr("disabled",!1).find(".wof-loader").hide())},t.getAnimDelta=function(e,t){var i=e-t+(e<t?360:0);return i<1&&(i=1),i>360&&(i=360),i},t.calcAnimTimeOut=function(e,t,i,r,a){var n=a/r*100,o=Math.pow(n/100,2),s=0,f=90;return t<3&&i>15?f=70:t<4&&i>12&&(f=80),n>f&&(s=e*o),e+.65*s},t.getRounds=function(e,t){var i=1,r=1;switch(e){case 1:i=.35;break;case 2:i=.55;break;case 3:i=.75;break;case 4:i=.95;break;case 5:i=1.3;break;case 6:i=1.6}t>8&&t<13&&(r=.7),t>13&&t<16&&(r=.6),t>16&&(r=.45);var a=Math.ceil(e*i*(t*r*i));return a<1&&(a=1),a>200&&(a=200),a},t.setResultText=function(t,i){var r=t.find(".wof-right-inner");r.fadeOut(150,function(){var a=".wof-";if(t.find(a+"form-fields").remove(),t.find(a+"title").html(i.title),t.find(a+"explainer").html(i.text),t.find(a+"btn-submit").hide(),t.find(a+"disclaimer").hide(),t.find(a+"fb-checkbox").hide(),3==i.type){var n=e.Dispatcher.applyFilter("wof-redirect-time",800);setTimeout(function(){location.href=e.Dispatcher.applyFilter("wof-redirect-link",i.value)},n)}else if(i.value){var o=jQuery('<input type="text">');4!=i.type&&5!=i.type||(o=jQuery('<div class="wof-winnings">')),4==i.type||5==i.type?o.html(i.value):o.val(i.value),t.find(".wof-form-wrapper").prepend(o)}i.html&&t.find(a+"response").html(i.html),r.fadeIn(150)})},t.getRotationDegrees=function(e,t){void 0===t&&(t=0);var i=e.css("transform");if("none"!==i)var r=i.split("(")[1].split(")")[0].split(","),a=r[0],n=r[1],o=Math.round(Math.atan2(n,a)*(180/Math.PI));else var o=0;return o+=t,o<0&&(o+=360),o>360&&(o-=360),o},t}();e.Helpers=t}(WOF||(WOF={}));
!function(a){var t=function(t,e,n){var s={invalid:[],getCaret:function(){try{var a,e=0,n=t.get(0),r=document.selection,o=n.selectionStart;return r&&-1===navigator.appVersion.indexOf("MSIE 10")?(a=r.createRange(),a.moveStart("character",-s.val().length),e=a.text.length):(o||"0"===o)&&(e=o),e}catch(a){}},setCaret:function(a){try{if(t.is(":focus")){var e,n=t.get(0);n.setSelectionRange?n.setSelectionRange(a,a):(e=n.createTextRange(),e.collapse(!0),e.moveEnd("character",a),e.moveStart("character",a),e.select())}}catch(a){}},events:function(){t.on("keydown.mask",function(a){t.data("mask-keycode",a.keyCode||a.which),t.data("mask-previus-value",t.val()),t.data("mask-previus-caret-pos",s.getCaret()),s.maskDigitPosMapOld=s.maskDigitPosMap}).on(a.jMaskGlobals.useInput?"input.mask":"keyup.mask",s.behaviour).on("paste.mask drop.mask",function(){setTimeout(function(){t.keydown().keyup()},100)}).on("change.mask",function(){t.data("changed",!0)}).on("blur.mask",function(){i===s.val()||t.data("changed")||t.trigger("change"),t.data("changed",!1)}).on("blur.mask",function(){i=s.val()}).on("focus.mask",function(t){!0===n.selectOnFocus&&a(t.target).select()}).on("focusout.mask",function(){n.clearIfNotMatch&&!r.test(s.val())&&s.val("")})},getRegexMask:function(){for(var a,t,n,s,r,i,l=[],c=0;c<e.length;c++)a=o.translation[e.charAt(c)],a?(t=a.pattern.toString().replace(/.{1}$|^.{1}/g,""),n=a.optional,s=a.recursive,s?(l.push(e.charAt(c)),r={digit:e.charAt(c),pattern:t}):l.push(n||s?t+"?":t)):l.push(e.charAt(c).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"));return i=l.join(""),r&&(i=i.replace(new RegExp("("+r.digit+"(.*"+r.digit+")?)"),"($1)?").replace(new RegExp(r.digit,"g"),r.pattern)),new RegExp(i)},destroyEvents:function(){t.off(["input","keydown","keyup","paste","drop","blur","focusout",""].join(".mask "))},val:function(a){var e,n=t.is("input"),s=n?"val":"text";return arguments.length>0?(t[s]()!==a&&t[s](a),e=t):e=t[s](),e},calculateCaretPosition:function(){var a=t.data("mask-previus-value")||"",e=s.getMasked(),n=s.getCaret();if(a!==e){var r=t.data("mask-previus-caret-pos")||0,o=e.length,i=a.length,l=0,c=0,u=0,k=0,v=0;for(v=n;v<o&&s.maskDigitPosMap[v];v++)c++;for(v=n-1;v>=0&&s.maskDigitPosMap[v];v--)l++;for(v=n-1;v>=0;v--)s.maskDigitPosMap[v]&&u++;for(v=r-1;v>=0;v--)s.maskDigitPosMapOld[v]&&k++;if(n>i)n=10*o;else if(r>=n&&r!==i){if(!s.maskDigitPosMapOld[n]){var h=n;n-=k-u,n-=l,s.maskDigitPosMap[n]&&(n=h)}}else n>r&&(n+=u-k,n+=c)}return n},behaviour:function(e){e=e||event,s.invalid=[];var n=t.data("mask-keycode");if(-1===a.inArray(n,o.byPassKeys)){var r=s.getMasked(),i=s.getCaret();return setTimeout(function(){s.setCaret(s.calculateCaretPosition())},a.jMaskGlobals.keyStrokeCompensation),s.val(r),s.setCaret(i),s.callbacks(e)}},getMasked:function(a,t){var r,i,l=[],c=void 0===t?s.val():t+"",u=0,k=e.length,v=0,h=c.length,p=1,f="push",d=-1,g=0,m=[];n.reverse?(f="unshift",p=-1,r=0,u=k-1,v=h-1,i=function(){return u>-1&&v>-1}):(r=k-1,i=function(){return u<k&&v<h});for(var M;i();){var y=e.charAt(u),b=c.charAt(v),C=o.translation[y];C?(b.match(C.pattern)?(l[f](b),C.recursive&&(-1===d?d=u:u===r&&u!==d&&(u=d-p),r===d&&(u-=p)),u+=p):b===M?(g--,M=void 0):C.optional?(u+=p,v-=p):C.fallback?(l[f](C.fallback),u+=p,v-=p):s.invalid.push({p:v,v:b,e:C.pattern}),v+=p):(a||l[f](y),b===y?(m.push(v),v+=p):(M=y,m.push(v+g),g++),u+=p)}var w=e.charAt(r);k!==h+1||o.translation[w]||l.push(w);var x=l.join("");return s.mapMaskdigitPositions(x,m,h),x},mapMaskdigitPositions:function(a,t,e){var r=n.reverse?a.length-e:0;s.maskDigitPosMap={};for(var o=0;o<t.length;o++)s.maskDigitPosMap[t[o]+r]=1},callbacks:function(a){var r=s.val(),o=r!==i,l=[r,a,t,n],c=function(a,t,e){"function"==typeof n[a]&&t&&n[a].apply(this,e)};c("onChange",!0===o,l),c("onKeyPress",!0===o,l),c("onComplete",r.length===e.length,l),c("onInvalid",s.invalid.length>0,[r,a,t,s.invalid,n])}};t=a(t);var r,o=this,i=s.val();e="function"==typeof e?e(s.val(),void 0,t,n):e,o.mask=e,o.options=n,o.remove=function(){var a=s.getCaret();return o.options.placeholder&&t.removeAttr("placeholder"),t.data("mask-maxlength")&&t.removeAttr("maxlength"),s.destroyEvents(),s.val(o.getCleanVal()),s.setCaret(a),t},o.getCleanVal=function(){return s.getMasked(!0)},o.getMaskedVal=function(a){return s.getMasked(!1,a)},o.getRegexMask=function(){return s.getRegexMask()},o.init=function(i){if(i=i||!1,n=n||{},o.clearIfNotMatch=a.jMaskGlobals.clearIfNotMatch,o.byPassKeys=a.jMaskGlobals.byPassKeys,o.translation=a.extend({},a.jMaskGlobals.translation,n.translation),o=a.extend(!0,{},o,n),r=s.getRegexMask(),i)s.events(),s.val(s.getMasked());else{n.placeholder&&t.attr("placeholder",n.placeholder),t.data("mask")&&t.attr("autocomplete","off");for(var l=0,c=!0;l<e.length;l++){var u=o.translation[e.charAt(l)];if(u&&u.recursive){c=!1;break}}c&&t.attr("maxlength",e.length).data("mask-maxlength",!0),s.destroyEvents(),s.events();var k=s.getCaret();s.val(s.getMasked()),s.setCaret(k)}},o.init(!t.is("input"))};a.maskWatchers={};var e=function(){var e=a(this),s={},r=e.attr("data-mask");if(e.attr("data-mask-reverse")&&(s.reverse=!0),e.attr("data-mask-clearifnotmatch")&&(s.clearIfNotMatch=!0),"true"===e.attr("data-mask-selectonfocus")&&(s.selectOnFocus=!0),n(e,r,s))return e.data("mask",new t(this,r,s))},n=function(t,e,n){n=n||{};var s=a(t).data("mask"),r=JSON.stringify,o=a(t).val()||a(t).text();try{return"function"==typeof e&&(e=e(o)),"object"!=typeof s||r(s.options)!==r(n)||s.mask!==e}catch(a){}};a.fn.wpmask=function(e,s){s=s||{};var r=this.selector,o=a.jMaskGlobals,i=o.watchInterval,l=s.watchInputs||o.watchInputs,c=function(){if(n(this,e,s))return a(this).data("mask",new t(this,e,s))};return a(this).each(c),r&&""!==r&&l&&(clearInterval(a.maskWatchers[r]),a.maskWatchers[r]=setInterval(function(){a(document).find(r).each(c)},i)),this},a.fn.masked=function(a){return this.data("mask").getMaskedVal(a)},a.fn.unmask=function(){return clearInterval(a.maskWatchers[this.selector]),delete a.maskWatchers[this.selector],this.each(function(){var t=a(this).data("mask");t&&t.remove().removeData("mask")})},a.fn.cleanVal=function(){return this.data("mask").getCleanVal()},a.applyDataMask=function(t){t=t||a.jMaskGlobals.maskElements,(t instanceof a?t:a(t)).filter(a.jMaskGlobals.dataMaskAttr).each(e)};var s={maskElements:"input,td,span,div",dataMaskAttr:"*[data-mask]",dataMask:!0,watchInterval:300,watchInputs:!0,keyStrokeCompensation:10,useInput:!0,watchDataMask:!1,byPassKeys:[9,16,17,18,36,37,38,39,40,91],translation:{0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}}};a.jMaskGlobals=a.jMaskGlobals||{},s=a.jMaskGlobals=a.extend(!0,{},s,a.jMaskGlobals),s.dataMask&&a.applyDataMask(),setInterval(function(){a.jMaskGlobals.watchDataMask&&a.applyDataMask()},s.watchInterval)}(jQuery);
!function(e){var t=function(){function t(t,i,s,o,n,a){void 0===n&&(n=!1);var r=this;this.couponBar=null,this.element=t,this.id=i,this.options=s,this.options.appear=s.appear.split(";"),this.status="hidden",this.standalone=n,this.couponBar=a,this.game=new e.Game(t,i,s.plays,s.sound,o,function(i){if(r.standalone||(r.options.retry?e.Helpers.setOccurance(r.options.retryOccurance,r.id,r.options.retryOccuranceData):e.Helpers.setOccurance("storage",r.id)),r.couponBar&&i.winning&&1==i.type&&r.couponBar.show(i.value),r.options.confetti&&i.winning){var s=t.find(".wof-pointer");new e.Fetti(s),setTimeout(function(){new e.Fetti(s,{angle:-90,amt:110,spread:200})},300),setTimeout(function(){new e.Fetti(s,{angle:-30,decay:.86})},600)}r.element.addClass("wof-played"),i.winning&&r.element.addClass("wof-won")})}return t.prototype.canShowWidgets=function(){return"hidden"===this.status&&((!this.options.hideMobile||!e.Helpers.isDevice("mobile"))&&((!this.options.hideTablet||!e.Helpers.isDevice("tablet"))&&((!this.options.hideDesktop||!e.Helpers.isDevice("desktop"))&&(!this.standalone&&this.canShow()))))},t.prototype.show=function(t){"hidden"===this.status&&(this.options.hideMobile&&e.Helpers.isDevice("mobile")&&"click"!==t||this.options.hideDesktop&&e.Helpers.isDevice("desktop")&&"click"!==t||this.options.hideTablet&&e.Helpers.isDevice("tablet")&&"click"!==t||(this.standalone||this.canShow()||"click"===t)&&(this.element.addClass("wof-visible").attr("aria-hidden","false"),this.widgets.removeClass("wof-visible").attr("aria-hidden","true"),this.standalone||(jQuery(".wof-overlay").fadeIn(170),setTimeout(function(){jQuery(document.body).addClass("wof-is-open")},170),"click"!==t&&e.Helpers.setOccurance(this.options.occurance,this.id,this.options.occuranceData)),this.status="visible",e.Helpers.registerView(this.id)))},t.prototype.hide=function(e){void 0===e&&(e=!1),"hidden"!==this.status&&(this.element.attr("aria-hidden","true").removeClass("wof-visible"),this.status="hidden",this.standalone||-1!==jQuery.inArray("click",this.options.appear)||(this.element.remove(),this.status="removed"),this.standalone||jQuery(".wof-wheel.wof-visible").not('[data-standalone="1"]').length||(jQuery(".wof-overlay").fadeOut(170),setTimeout(function(){jQuery(document.body).removeClass("wof-is-open")},170)))},t.prototype.canShow=function(){var t="wof-"+this.id;return!(sessionStorage.getItem(t)||localStorage.getItem(t)||e.Cookie.has(t))},t}();e.Wheel=t}(WOF||(WOF={}));