jQuery(document).ready(function(p){initColorpicker=function(){var r={color:!1,mode:"hsl",controls:{horiz:"s",vert:"l",strip:"h"},hide:!0,target:!1,width:180,palettes:!1,change:function(e,t){var a=p(this).closest(".wp-picker-container"),o=a.find(".wp-picker-input-wrap"),i=a.find(".wp-picker-custom-placeholder"),n=a.find(".wp-picker-default-custom"),d=a.find(".wp-color-picker").data("addon-colorpicker-show"),a=a.find(".wp-color-picker").data("default-color"),r=o.find("input.wp-color-picker"),r=p(r[0]);"placeholder"!==d||""===t.color.toString()&&"undefined"===t.color.toString()||(o.find(".wp-color-picker").show(),i.hide(),n.show(),i.css("line-height","3.0")),n.removeClass("default_color"),a!==t.color.toString()&&n.addClass("default_color"),p(document).trigger("wapo-colorpicker-change",r)},clear:function(e,t){var a=p(this).closest(".wp-picker-container"),o=a.find(".wp-picker-input-wrap"),i=a.find(".wp-picker-custom-placeholder"),n=a.find(".wp-picker-default-custom"),a=a.find(".wp-color-picker").data("addon-colorpicker-show"),d=o.find("input.wp-color-picker"),d=p(d[0]);"placeholder"===a&&(o.find(".wp-color-picker").hide(),i.show(),n.hide(),i.css("line-height","0")),p(document).trigger("wapo-colorpicker-clear",d[0])}};function e(){p(".yith-wapo-block .yith-wapo-addon-type-colorpicker .wp-color-picker").each(function(){p(this).wpColorPicker(r);var e=p(this).closest(".wp-picker-container"),t=e.find("button .wp-color-result-text"),a=e.find(".wp-picker-default"),o=e.find(".wp-picker-input-wrap"),i=p(this).data("addon-colorpicker-show"),n=p(this).data("addon-placeholder"),t=(t.html(""),p(this).parents(".wp-picker-container")),d=t.find(".wp-picker-input-wrap");t.hasClass("yith-wapo-colorpicker-initialized")||t.addClass("yith-wapo-colorpicker-initialized"),d.find(".wp-picker-default-custom").length||(t=p("").attr({"class":"wp-picker-default-custom"}),d.find(".wp-picker-default, .wp-picker-clear").wrap(t)),"placeholder"===i&&(o.find(".wp-color-picker").hide(),o.find(".wp-picker-custom-placeholder").length||((d=p("").attr({"class":"wp-picker-custom-placeholder"})).html(n),o.find(".screen-reader-text").before(d)),t=e.find(".wp-picker-default-custom"),i=e.find(".wp-picker-custom-placeholder"),t.hide(),i.css("line-height","0")),a.trigger("click")})}p(document).on("yith-wapo-after-reload-addons",e),p(document).on("yith-wapo-after-reload-addons",initDatePickers),checkColorPickerOnInput=function(){p(document).on("click",function(e){p(e.target).is(".yith-wapo-colorpicker-container .iris-picker, .yith-wapo-colorpicker-container .iris-picker-inner")||0<(e=p(".yith-wapo-colorpicker-container .yith-wapo-colorpicker-initialized .wp-color-picker")).length&&e.iris("hide")}),p(".yith-wapo-colorpicker-container .yith-wapo-colorpicker-initialized .wp-color-picker").click(function(e){p(this).iris("show")})},e(),checkColorPickerOnInput()},initDatePickers=function(){p(".yith-wapo-block .yith_wapo_date.datepicker").each(function(){var e=p(this);initDatePicker(e)})},initTimePicker=function(t){let e=t.data("params"),i=e.time_data||"",a=e.show_time_selector||"";"object"==typeof i&&null!==i&&(i=Object.values(i)),a&&setTimeout(function(){var a,o,e;p("#wapo-datepicker-time").length||(a="",o=t.closest(".date-container").find(".temp-time").text(),p(i).each(function(e,t){a+=t!==o?"":""}),e='
",p(e).appendTo("#ui-datepicker-div"))},10)},initDatePicker=function(l){var e=l.data("params"),t="",a="",o=e.start_year||"",i=e.end_year||"",n=e.default_date||"",d=e.date_format||"",r=e.additional_opts||"",o={minDate:t=o?new Date(e.start_year,"00","01"):t,maxDate:a=i?new Date(e.end_year,"11","31"):a,defaultDate:n,dateFormat:d,beforeShowDay:function(o){let e=l.data("params"),t=e.selectable_days_opt||"",a=e.selectable_days||"",i=e.selected_items||"",n=e.enable_disable_date_rules||"",d=!0;if((n="enable"===n?1:0)&&(d=!1),"days"===t||"date"===t){var r=o.getDate()+"-"+(o.getMonth()+1)+"-"+o.getFullYear();if(-1===p.inArray(r,a))return d=!1}else if("before"===t){r=o.getTime();let e=new Date;var c=(new Date).getHours();if(e.setHours(0,0,0,0),r<(e=e.getTime())||yith_wapo.disableCurrentDayBasedOnTime&&r<=e&&c>=yith_wapo.datepickerHourToCheck)return!1}0[\d]+)-(?[\d]+)\]$/).groups;return(d=wp.hooks.applyFilters("yith_wapo_addon_datepicker_before_show_day",d,o,r,c))?[!0]:[!1]},beforeShow:function(e){initTimePicker(l)},onSelect:function(e,t){var a,o;0=t&&e.find(".yith-wapo-ajax-uploader-container").hide()},checkAddonsRequirements=function(){var e=checkNumbersTotalValues(),t=checkRequiredMinMax();return!!e&&(t||yith_wapo.disable_scroll_on_required_mix_max||_("html, body, .yith-wapo-content").animate({scrollTop:_(s).offset().top-20},500),t)},checkRequiredFields=function(i){var n=!1;yith_wapo.dom.single_add_to_cart_button;return _("form.cart .yith-wapo-addon:not(.hidden):visible input, form.cart .yith-wapo-addon:not(.hidden):visible select, form.cart .yith-wapo-addon:not(.hidden):visible textarea").each(function(){var e=_(this),t=e.attr("type"),a=(e.closest(".yith-wapo-option"),e.closest(".yith-wapo-addon")),o=e.closest("div.yith-wapo-addon.wapo-toggle").find(".wapo-addon-title.toggle-closed"),a=a.find(".wapo-addon-title");"file"===e.attr("type")||e.hasClass("wapo-product-qty")||(e.attr("required")&&("checkbox"===t||"radio"===t)&&!e.closest(".yith-wapo-option").hasClass("selected")||e.attr("required")&&"checkbox"!==t&&"radio"!==t&&(""==e.val()||"Required"==e.val())?("highlight"===i&&(showRequiredMessage(e),a.addClass("wapo-error"),o)&&o.click(),n=!0):("text"!==t&&"textarea"!==t||""==e.val()||(n=!checkTextInputLimit(e)),restartRequiredElement(e)))}),!n},showRequiredMessage=function(e){e=e.closest(".yith-wapo-option");e.find(".required-error").length<1&&(e.append('
'+yith_wapo.messages.requiredMessage+"
"),e.addClass("required-color"))},restartRequiredElement=function(e){var t=e.closest(".yith-wapo-option");e.closest(".yith-wapo-option").find(".required-error").remove(),t.removeClass("required-color")},conditionalLogicCheck=function(e={}){var r={};_("form.cart .yith-wapo-addon.conditional_logic").each(function(){var e=!1,t=!1,a=_(this).data("conditional_logic_display"),o=_(this).data("conditional_logic_display_if"),i=String(_(this).data("conditional_rule_addon")),n=String(_(this).data("conditional_rule_addon_is")),d=String(_(this).data("conditional_rule_variations")),i=void 0!==i&&"0"!==i&&""!==i&&i.split("|"),n=void 0!==n&&""!==n&&n.split("|");if((d=void 0!==d&&""!==d&&d.split("|"))||i&&n){if(i&&n)switch(o){case"all":e=conditionalLogicAllRules(i,n);break;case"any":e=conditionalLogicAnyRules(i,n)}else e=!0;e&&d&&(o=_(".variation_id").val(),-1===_.inArray(String(o),d))||(t=!0)}else t=e=!0,a="show";switch(a){case"show":r[_(this).attr("id")]=t&&e?"not-hidden":"hidden";break;case"hide":r[_(this).attr("id")]=t&&e?"hidden":"not-hidden"}}),_.each(r,function(e,t){e=_("#"+e);e.hasClass("hidden");"not-hidden"===t?(("slide"===yith_wapo.conditionalDisplayEffect?e.slideDown():e.fadeIn()).removeClass("hidden").find(".yith-wapo-option:not(.out-of-stock) .yith-wapo-option-value").attr("disabled",!1),e.hasClass("yith-wapo-addon-type-select")&&e.find(".yith-wapo-option-value").attr("disabled",!1),checkMinMax(e)):("slide"===yith_wapo.conditionalDisplayEffect?e.slideUp():e.hide()).addClass("hidden").find(".yith-wapo-option-value").attr("disabled",!0)}),JSON.stringify(r)!==JSON.stringify(e)&&conditionalLogicCheck(r),_(document).trigger("wapo_after_conditional_logic_check")},conditionalLogicAllRules=function(e,t){for(var a=!0,o=0;o'+t+"
")},calculateProductPrice=function(n){_(document).trigger("wapo-before-calculate-product-price");var e={action:"update_totals_with_suffix",data:n,security:yith_wapo.addons_nonce};_.ajax({url:yith_wapo.ajaxurl,type:"post",data:e,success:function(e){var t,a,o,i;e&&(t=e.price_html,a=e.options_price_suffix,o=e.order_price_suffix,i=n.total_order_price,_(g.productPrice).html(t),_(g.optionsPrice).html(a),_(g.orderPrice).html(o),_(s).attr("data-order-price",i),replaceProductPrice(i,o),_(document).trigger("wapo-after-calculate-product-price",e))}})},calculateTotalAddonsPrice=function(e=!0){conditionalLogicCheck(),"yes"===yith_wapo.hide_button_required&&(o=yith_wapo.dom.single_add_to_cart_button,_(o).hide(),t=checkRequiredFields("hide"),a=checkRequiredMinMax("hide"),t)&&a&&_(o).fadeIn(),_(y).css("opacity","0.5");var t=parseFloat(_(s).attr("data-product-price")),a=yith_wapo.total_price_box_option,o=_("button.ywgc-amount-buttons.selected_button"),o=(0'+t.currency_symbol+"
":t.currency_symbol;return"left"===t.currency_position?a=e+a:"right"===t.currency_position?a+=e:"left_space"===t.currency_position?a=e+" "+a:"right_space"===t.currency_position&&(a=a+" "+e),a=t.html?''+a+"":a},wcPriceToFloat=function(e){e=e.replace(/(?![\.\,])\D/g,"").replace(yith_wapo.total_thousand_sep,"").replace(yith_wapo.decimal_sep,".");return parseFloat(e)},getDefaultProductPrice=function(){if(yith_wapo.enableGetDefaultVariationPrice){let o=_(".variations_form.cart").data("product_id");var e={action:"get_default_variation_price",product_id:parseInt(o),security:yith_wapo.addons_nonce};_.ajax({url:yith_wapo.ajaxurl,type:"post",data:e,success:function(e){var t,a;e&&(t=e.price_html,(a=_(s)).attr("data-product-price",e.current_price),a.attr("data-product-id",o),"yes"===yith_wapo.replace_product_price)&&a.find(".yith-wapo-block").length&&_(yith_wapo.replace_product_price_class).html(t)},complete:function(){}})}},checkDefaultOptionsOnLoad=function(){var e=_(".yith-wapo-addon:not(.conditional_logic):not(.hidden) .yith-wapo-option.selected");_(e).each(function(){var e=_(this);replaceImageAction(e)})},resetAddons=function(e,t){"yith_wccl"!==t&&(a?(getDefaultProductPrice(),_(document).trigger("yith-wapo-reset-addons")):a=!0)},foundVariation=function(e,t){"variations_form cart in_loop initialized"===e.target.classList.value||_("form.cart.ywcp").length||(updateContainerProductPrice(t),_(document).trigger("yith-wapo-reload-addons"))},reloadAddons=function(e,t=""){var a={action:"live_print_blocks",addons:_(f).serializeArray(),currency:yith_wapo.woocommerce_currency,current_language:yith_wapo.currentLanguage,security:yith_wapo.addons_nonce};""!=t&&(a.price=t),_.ajax({url:yith_wapo.ajaxurl,type:"post",data:a,beforeSend:function(){_(s).css("opacity","0.5")},error:function(e,t,a){console.error("AJAX request failed: ",t,a)},success:function(e){var t=e.html??"",a=e.quantities??"",t=(""!==t&&_(s).html(t),e.addons??"");""!==t&&addonsSelection(t),a&&addonsQuantity(a),_("form.cart #yith-wapo-container select").trigger("change"),_("form.cart").trigger("yith-wapo-after-reload-addons")},complete:function(e){_(s).attr("data-order-price",0),calculateTotalAddonsPrice(),_(s).css("opacity","1")}})},addonsQuantity=function(t){_.each(_(s).find(".qty.wapo-product-qty"),function(){var e=_(this).attr("id").replace("yith_wapo_product_qty","").replace("[","").replace("]","");e in t&&(e=t[e],_(this).val(e).trigger("change"))})},setQuantity=function(e){_("div.quantity input.input-text.qty:not(.wapo-product-qty) ").val(e)},removeUploadedFile=function(e){var e=e.target,t=_(e).closest(".yith-wapo-uploaded-file-element"),a=_(e).closest(".yith-wapo-option").data("max-multiple"),o=_(e).closest(".yith-wapo-ajax-uploader").find(".yith-wapo-uploaded-file-element").length,i=_(e).closest(".yith-wapo-ajax-uploader").find(".yith-wapo-ajax-uploader-container"),n=_(e).closest(".yith-wapo-option").find('input[type="hidden"].upload-parent'),e=_(e).closest(".yith-wapo-option").find('input[type="file"]');t.remove(),e.val(""),(void 0===a||o-1o&&(n=!0,d=yith_wapo.messages.maxErrorMessage+" "+o),n&&(r.addClass("error-message"),t.append(_(''+d+"")),c=!0,_("html, body").animate({scrollTop:t.offset().top-50},500))}),_(document).trigger("yith_wapo_check_number_total_values"),!c},replaceImageAction=function(e,t=!1){var o,a=yith_wapo.replace_image_path,i=".yith_magnifier_zoom_magnifier, .zoomWindowContainer .zoomWindow",n=e.data("replace-image");null===n||!t&&_(a).attr("src")===n||(void 0!==e.data("replace-image")&&""!=e.data("replace-image")&&(void 0===_(a).attr("wapo-original-img")&&(_(a).attr("wapo-original-img",_(a).attr("src")),_(i).length)&&_(i).attr("wapo-original-img",_(i).css("background-image").slice(4,-1).replace(/"/g,"")),_(h).val(n),_(i).css("background-image","url("+n+")"),replaceAddonImage(n)),t&&void 0!==_(a).attr("wapo-original-img")&&(o=_(a).attr("wapo-original-img"),e=_(i).attr("wapo-original-img"),n=_(h).val(),_(h).val(""),_(s).find(".yith-wapo-addon:not(.yith-wapo-addon-type-select):not(.conditional_logic.hidden) .yith-wapo-option.selected, .yith-wapo-addon-type-select:not(.conditional_logic.hidden) .yith-wapo-option-value").each(function(e,t){let a=_(t);(a=a.is("select")?a.find(":selected"):a).data("replace-image")&&(a.hasClass("selected")||a.is("option"))&&(o=a.data("replace-image"),_(h).val(o))}),n!==o)&&(_(i).css("background-image","url("+e+")"),replaceAddonImage(o)))},checkMaxSelected=function(e){var t=e.closest(".yith-wapo-option"),e=e.closest(".yith-wapo-addon"),a=e.data("max"),e=e.find(".yith-wapo-option.selected").length;return""===a||0===a||(t.hasClass("selected")?e--:e++,!(a'),"default"===t.val()||""===i?a.hide():a.fadeIn(),void 0===n?e.empty():e.html(n),t.data("replace-image")||(o=!0),replaceImageAction(t,o)},fileOnChange=function(e){_(this).closest(".yith-wapo-ajax-uploader").css("opacity","1");var t=_(this),a=t.closest(".yith-wapo-option").find(".yith-wapo-ajax-uploader"),t=t[0].files;checkBeforeUploadFiles(a,t)&&uploadFiles(t,a)},toggleElement=function(e){e.preventDefault();var e=_(this).find(".wapo-addon-title"),t=e.closest(".yith-wapo-addon");t.hasClass("toggle-open")?t.removeClass("toggle-open").addClass("toggle-closed"):t.removeClass("toggle-closed").addClass("toggle-open"),e.hasClass("toggle-open")?e.removeClass("toggle-open").addClass("toggle-closed"):e.removeClass("toggle-closed").addClass("toggle-open"),t.find(".options-container").toggle("fast"),_(document).trigger("yith_proteo_inizialize_html_elements")},updateContainerProductPrice=function(a){if(!_(".cart.yith-wcpb-bundle-form").length&&a.variation_id===parseInt(_(".variation_id").val())){let e=_(s),t=0;var o;"undefined"!=typeof a.display_price&&(t=a.display_price,"yes"===yith_wapo.use_price_html_on_variations)&&"undefined"!=typeof a.price_html&&(o=_(a.price_html).find("> .amount bdi").text(),o=wcPriceToFloat(o),isNaN(o)||t===o||(t=o)),e.attr("data-product-price",t),e.attr("data-default-product-price",a.default_variation_price),e.attr("data-product-id",a.variation_id)}},yithWcMeasurementPC_Compatibility=function(){var e=_("#price_calculator.wc-measurement-price-calculator-price-table .product_price .amount").text(),e=wcPriceToFloat(e);isNaN(e)||(_(s).attr("data-product-price",e),_(document).trigger("yith-wapo-reload-addons",[e]))},ajaxUploaderOnDrop=function(e){e.stopPropagation(),e.preventDefault(),_(this).css("opacity","1");_(this).closest(".yith-wapo-option").find("input.file");var t=_(this),e=e.originalEvent.dataTransfer.files;checkBeforeUploadFiles(t,e)&&uploadFiles(e,t)},checkBeforeUploadFiles=function(e,o){var i,t=_(e).find(".yith-wapo-uploaded-file-element").length+o.length,a=_(e).closest(".yith-wapo-option").data("max-multiple");if(!_(e).closest(".yith-wapo-option").hasClass("allow-multiple")&&1=parseFloat(1024*yith_wapo.upload_max_file_size*1024)&&(t=wapoSprintf(yith_wapo.messages.maxFileSize,e.name,yith_wapo.upload_max_file_size),a=!0),a)return alert(t),!1}return!0},wapoSprintf=function(e,...a){return e.replace(/%([sd])/g,function(e,t){return"s"===t?a.shift():"d"===t?(t=a.shift(),Number.isInteger(t)?t.toString():""):e})},uploadFiles=function(a,o){for(var i=0;i
'+i+'
')},uploadSingleFile=function(i,n,d,r=!1,c=0){0===parseInt(c)&&_(d).find(".yith-wapo-uploaded-file-element.completed").length&&(c=_(d).find(".yith-wapo-uploaded-file-element.completed").last().data("index")+1);var l=i.length-1,e=i[n],t=new FormData,a=_(d).closest(".yith-wapo-option"),o=a.data("max-multiple"),p=_(d).find(".yith-wapo-uploaded-file"),s=_(d).find(".yith-wapo-ajax-uploader-container"),u=_(d).find('.yith-wapo-uploaded-file-element[data-index="'+c+'"]'),h=_(d).find(".yith-wapo-uploaded-file-info .remove"),f=_(u).find(".yith-wapo-loader-container .yith-wapo-loader-label"),y=_(u).find(".yith-wapo-loader-container .yith-wapo-loader");t.append("action","yith_wapo_upload_file"),t.append("security",yith_wapo.addons_nonce),t.append("currentFile",e),_.ajax({url:yith_wapo.ajaxurl,type:"POST",contentType:!1,processData:!1,"async":!0,dataType:"json",data:t,xhr:function(){var e=_.ajaxSettings.xhr();return e.upload&&(e.upload.addEventListener("progress",function(e){var t=0;e.lengthComputable&&(t=Math.ceil(e.loaded/e.total*100)),y.progressbar({value:t})},!1),e.addEventListener("progress",function(e){var t;1!=i.length&&!r||(a.hasClass("allow-multiple")&&(t=_(d).find(".yith-wapo-uploaded-file-element").length,void 0===o||void 0!==o&&t').fadeIn(),n'+yith_wapo.i18n.maxOptionsSelectedMessage+"

"),r.addClass("wapo-error")),1}else c=("file"===t?_(a).find(".yith-wapo-uploaded-file").has(".yith-wapo-uploaded-file-element"):a.find("input:checkbox:checked, input:radio:checked")).length;if(0'+yith_wapo.i18n.maxOptionsSelectedMessage+""),r.addClass("wapo-error"))),1;a.removeClass("required-min").find(".max-selected-error").hide()}},checkRequiredSelect=function(n=""){let d=!0;return _(".yith-wapo-addon.yith-wapo-addon-type-select select").each(function(){var e,t,a,o,i=_(this);i.is(":required")&&(t=(e=i.closest(".yith-wapo-addon")).find(".min-error-message"),a=e.find(".wapo-addon-title"),o=i.val(),t.text(""),a.removeClass("wapo-error"),e.removeClass("required-min"),"default"!==o||e.hasClass("hidden")||(d=!1)||"hide"===n||(o=e.find(".min-error"),i=i.closest("div.yith-wapo-addon.wapo-toggle").find(".wapo-addon-title.toggle-closed"),e.addClass("required-min"),i&&i.click(),a.addClass("wapo-error"),t.text(yith_wapo.i18n.selectAnOption.replace("%d",1)),o.show()))}),d},checkTextInputLimit=function(e){let t=!0,a=_(e),o=a.val(),i=a.attr("minlength"),n=a.attr("maxlength"),d=a.closest(".yith-wapo-option").find(".length-error-message");return""!==i&&o.lengthn?(a.addClass("length-error"),d.show(),t=!1):(d.hide(),a.removeClass("length-error")),t},numberOnChange=function(){var e=_(this).val(),t=_(this).closest(".yith-wapo-option");replaceImageAction(t,""==e?!0:!1),checkMultipliedPrice(_(this))},checkMultipliedPrice=function(e){let t=e.attr("data-price");var a=e.attr("data-price-sale"),o=e.attr("data-default-price"),i=e.data("price-type"),n=e.data("price-method");let d="price",r=0;var c=e.val();0 div.quantity input.qty").val()),a=a?t/a:t;_(s).attr("data-product-price",a),calculateTotalAddonsPrice()},setError=function(e,t){e.find(".yith-wapo-error").remove(),e.find(".yith-wapo-addon-label").addClass("wapo-error"),e.append(''+t+"")},cleanError=function(e){var t=e.find(".yith-wapo-addon-label");e.find(".yith-wapo-error").remove(),t.removeClass("wapo-error")},_(document).on("ywgc-amount-changed",function(e,t){t=t.data("price");_(s).attr("data-product-price",t),calculateTotalAddonsPrice()}),_(document).on("yith-wapo-product-price-updated",function(e,t){void 0!==t&&_(s).attr("data-product-price",t),calculateTotalAddonsPrice()}),_(document).on("change",".gift-cards-list .ywgc-manual-amount-container input.ywgc-manual-amount",function(e){var t=_(this).val();_(s).attr("data-product-price",t),calculateTotalAddonsPrice()}),_(document).on("woocommerce-product-bundle-updated-totals",function(e,t){var a=t.price_data.subtotals.price;_(t.$bundle_price).find(".amount").html();_(s).attr("data-product-price",a),calculateTotalAddonsPrice()}),_(document).on("ywdpd_price_html_updated",function(e,t){t=_(t).children(".amount bdi").text(),t=wcPriceToFloat(t);isNaN(t)||(_(s).attr("data-product-price",t),calculateTotalAddonsPrice())}),_(document).on("yith_wcpb_ajax_update_price_request",function(e,t){t=t.price;isNaN(t)||(_(s).attr("data-product-price",t),_(document).trigger("yith-wapo-reload-addons",t))}),_(document).on("change","form.cart div.yith-wapo-addon, form.cart .quantity input[type=number]",function(e){if(_(e.delegateTarget.activeElement).hasClass("yith-wapo-edit-product-cart"))return!1;e=_(e.target);maybeCalculateTotals(e)}),_(document).on("keyup",'form.cart .yith-wapo-addon-type-number input[type="number"], form.cart .yith-wapo-addon-type-text input[type="text"], form.cart .yith-wapo-addon-type-textarea textarea',function(e){if(_(e.delegateTarget.activeElement).hasClass("yith-wapo-edit-product-cart"))return!1;e=_(this);maybeCalculateTotals(e)}),_(document).on("wapo-colorpicker-change wapo-colorpicker-clear",function(e,t){if(_(e.delegateTarget.activeElement).hasClass("yith-wapo-edit-product-cart"))return!1;maybeCalculateTotals(_(t))}),_(document).on("change keyup",".yith-wapo-option .wapo-product-qty",productQuantityChange),_(document).on("reset_data",resetAddons),_(document).on("found_variation",foundVariation),_(document).on("yith-wapo-reload-addons",reloadAddons),_(document).on("click",".yith-wapo-uploaded-file .remove",removeUploadedFile),_("form.cart").on("click","span.checkboxbutton",function(){_(this).find("input").is(":checked")?_(this).addClass("checked"):_(this).removeClass("checked")}),_(document).on("change",".yith-wapo-addon-type-checkbox input",checkboxOnChange),_(document).on("click",".yith-wapo-addon-type-label .yith-wapo-option div.label",function(){_(this).closest(".yith-wapo-option").find(".yith-proteo-standard-checkbox").click()}),_(document).on("change",".yith-wapo-addon-type-label input",labelsOnChange),_(document).on("change keyup",".yith-wapo-addon-type-text input",inputOnChange),_(document).on("change keyup",".yith-wapo-addon-type-textarea textarea",textareaOnChange),_(document).on("click",".yith-wapo-addon-type-color .yith-wapo-option div.label",function(){_(this).closest(".yith-wapo-option").find(".yith-proteo-standard-checkbox").click()}),_(document).on("change",".yith-wapo-addon-type-color input",colorOnChange),_(document).on("click change",".yith-wapo-addon-type-product .quantity input",function(e){e.stopPropagation()}),_(document).on("click",".yith-wapo-addon-type-product .yith-wapo-option .product-container",function(){_(this).closest(".yith-wapo-option").find(".yith-proteo-standard-checkbox").click()}),_(document).on("change",".yith-wapo-addon-type-product .yith-wapo-option input.yith-proteo-standard-checkbox",productOnChange),_(document).on("click",".yith-wapo-option .image-container",addonImageClicked),_("form.cart").on("click","span.radiobutton",function(){_(this).find("input").is(":checked")&&(_(this).closest(".yith-wapo-addon.yith-wapo-addon-type-radio").find("span.radiobutton.checked").removeClass("checked"),_(this).addClass("checked"))}),_(document).on("click",".yith-wapo-addon-type-radio input",radioOnChange),_(document).on("change",".yith-wapo-addon-type-select select",selectOnChange),_(document).on("change",".yith-wapo-addon-type-file input.file",fileOnChange),_(document).on("click",".yith-wapo-ajax-uploader .button, .yith-wapo-ajax-uploader .link",function(){_(this).closest(".yith-wapo-option").find("input.file").click()}),_(document).on("change keyup",".yith-wapo-addon-type-number input",numberOnChange),_(document).on("click","#wapo-datepicker-save button",datepickerSaveButton),_(document).on("change","#wapo-datepicker-time-select",datepickertimeOnChange),_(document).on("click",".yith-wapo-addon.wapo-toggle .addon-header",toggleElement),_(document).on("keyup",".wapo-product-qty",productQtyOnKeyUp),_("form.cart").on("change","#price_calculator.wc-measurement-price-calculator-price-table",yithWcMeasurementPC_Compatibility),_(document).on("yith_wcp_price_updated",function(e,t){_(document).trigger("yith-wapo-reload-addons",t)}),_("html").on("dragover, drop",function(e){e.preventDefault(),e.stopPropagation()}),_(document).on("dragenter",".yith-wapo-ajax-uploader",function(e){e.stopPropagation(),e.preventDefault(),_(this).css("opacity","0.5")}),_(document).on("dragover",".yith-wapo-ajax-uploader",function(e){e.stopPropagation(),e.preventDefault()}),_(document).on("dragleave",".yith-wapo-ajax-uploader",function(e){e.stopPropagation(),e.preventDefault(),_(e.target).hasClass("yith-wapo-ajax-uploader")&&_(this).css("opacity","1")}),_("body").on("drop",".yith-wapo-ajax-uploader",ajaxUploaderOnDrop),_(document).on("change",".yith-wapo-addon-type-checkbox, .yith-wapo-addon-type-color, .yith-wapo-addon-type-label, .yith-wapo-addon-type-product",function(){checkMinMax(_(this))}),_(document).on("click","form.cart button",function(){return checkAddonsRequirements()}),_(document).on("yith_wcp_price_updated",compositePriceUpdated),_(document).on("click",".add-request-quote-button",requestAQuoteButton),initJS()});