jQuery(document).ready(function(a){a.fn.init_addon_totals=function(){var b=a(this);a(this).on("click",".reset_variations",function(){a.each(b.find(".product-addon"),function(){var b=a(this).find(".addon");(b.is(":checkbox")||b.is(":radio"))&&b.prop("checked",!1),b.is("select")&&b.prop("selectedIndex",0),(b.is(":text")||b.is("textarea")||b.is('input[type="number"]')||b.is('input[type="file"]'))&&b.val("")}),b.trigger("woocommerce-product-addons-update")}),a(this).on("keyup change",".product-addon input, .product-addon textarea",function(){if(a(this).attr("maxlength")>0){var b=a(this).val(),c=a(this).attr("maxlength")-b.length;a(this).next(".chars_remaining").find("span").text(c)}}),a(this).find(" .addon-custom, .addon-custom-textarea").each(function(){a(this).attr("maxlength")>0&&a(this).after(''+a(this).attr("maxlength")+" "+woocommerce_addons_params.i18n_remaining+"")}),a(this).on("change",".product-addon input, .product-addon textarea, .product-addon select, input.qty",function(){a(this).trigger("woocommerce-product-addons-update")}),a(this).on("found_variation",function(b,c){var d=a(this),e=d.find("#product-addons-total");"undefined"!=typeof c.display_price?e.data("price",c.display_price):a(c.price_html).find(".amount:last").size()&&(product_price=a(c.price_html).find(".amount:last").text(),product_price=product_price.replace(woocommerce_addons_params.currency_format_symbol,""),product_price=product_price.replace(woocommerce_addons_params.currency_format_thousand_sep,""),product_price=product_price.replace(woocommerce_addons_params.currency_format_decimal_sep,"."),product_price=product_price.replace(/[^0-9\.]/g,""),product_price=parseFloat(product_price),e.data("price",product_price)),d.trigger("woocommerce-product-addons-update")}),a(this).on("woocommerce-product-addons-update",function(){var c=0,d=b.find("#product-addons-total"),e=d.data("price"),f=d.data("type"),g=d.data("product-id"),h=d.data("raw-price"),i=d.data("tax-mode"),j=d.data("tax-display-mode"),k=0;if(("variable"==f||"variable-subscription"==f)&&b.find(".single_variation").after(d),b.find(".addon").each(function(){var b=0,d=0;a(this).is(".addon-custom-price")?b=a(this).val():a(this).is(".addon-input_multiplier")?(isNaN(a(this).val())||""==a(this).val()?(a(this).val(""),a(this).closest("p").find(".addon-alert").show()):(""!=a(this).val()&&a(this).val(Math.ceil(a(this).val())),a(this).closest("p").find(".addon-alert").hide()),b=a(this).data("price")*a(this).val(),d=a(this).data("raw-price")*a(this).val()):a(this).is(".addon-checkbox, .addon-radio")?a(this).is(":checked")&&(b=a(this).data("price"),d=a(this).data("raw-price")):a(this).is(".addon-select")?a(this).val()&&(b=a(this).find("option:selected").data("price"),d=a(this).find("option:selected").data("raw-price")):a(this).val()&&(b=a(this).data("price"),d=a(this).data("raw-price")),b||(b=0),d||(d=0),c=parseFloat(c)+parseFloat(b),k=parseFloat(k)+parseFloat(d)}),d.data("addons-price",c),d.data("addons-raw-price",k),b.find("input.qty").size())var l=parseFloat(b.find("input.qty").val());else var l=1;if(c>0&&l>0){var m,n;c=parseFloat(c*l),k=parseFloat(k*l);var o=accounting.formatMoney(c,{symbol:woocommerce_addons_params.currency_format_symbol,decimal:woocommerce_addons_params.currency_format_decimal_sep,thousand:woocommerce_addons_params.currency_format_thousand_sep,precision:woocommerce_addons_params.currency_format_num_decimals,format:woocommerce_addons_params.currency_format});if("undefined"!=typeof e){m=parseFloat(e*l);var p=accounting.formatMoney(m+c,{symbol:woocommerce_addons_params.currency_format_symbol,decimal:woocommerce_addons_params.currency_format_decimal_sep,thousand:woocommerce_addons_params.currency_format_thousand_sep,precision:woocommerce_addons_params.currency_format_num_decimals,format:woocommerce_addons_params.currency_format})}n=parseFloat(h*l);var q=accounting.formatMoney(n+k,{symbol:woocommerce_addons_params.currency_format_symbol,decimal:woocommerce_addons_params.currency_format_decimal_sep,thousand:woocommerce_addons_params.currency_format_thousand_sep,precision:woocommerce_addons_params.currency_format_num_decimals,format:woocommerce_addons_params.currency_format}),r=!1;a(".entry-summary .subscription-details").length&&(r=a(".entry-summary .subscription-details").clone().wrap("
").parent().html()),r&&(o+=r,p&&(p+=r));var s='