!function(a){"use strict";function e(a,n){var a=a.find(".tm-product-bundle"),c=n(".woosb-products",a),s=a.find(".single_add_to_cart_button .price"),i=a.data("bundled_price"),d=a.data("bundled_price_from"),r=a.data("price_format"),t=a.data("price_decimals"),p=a.data("price_thousand_separator"),l=a.data("price_decimal_separator"),u=a.data("currency_symbol"),o=a.data("save_text"),m=a.data("discount_amount"),b=c.data("discount");function w(a,e=0){a-=e;return a<=0?"":'<div class="woosb-price-saved">'+o+" "+_(a)+"</div>"}function _(a){var e='<span class="woocommerce-Price-amount amount">',o=function(a,e,o,r,t){a=a||0,e=isNaN(e=Math.abs(e))?2:e,o=void 0!==o?o:"$",r=r||",",t=t||".";var s=a<0?"-":"",c=parseInt(a=f(Math.abs(+a||0),e).toFixed(e),10)+"",n=0;3<c.length&&(n=c.length%3);return o+s+(n?c.substr(0,n)+r:"")+c.substr(n).replace(/(\d{3})(?=\d)/g,"$1"+r)+(e?t+f(Math.abs(a-c),e).toFixed(e).slice(2):"")}(a,t,"",p,l);switch(r){case"%1$s%2$s":e+='<span class="woocommerce-Price-currencySymbol">'+u+"</span>"+o;break;case"%1$s %2$s":e+='<span class="woocommerce-Price-currencySymbol">'+u+"</span> "+o;break;case"%2$s%1$s":e+=o+'<span class="woocommerce-Price-currencySymbol">'+u+"</span>";break;case"%2$s %1$s":e+=o+' <span class="woocommerce-Price-currencySymbol">'+u+"</span>";break;default:e+='<span class="woocommerce-Price-currencySymbol">'+u+"</span> "+o}return e+="</span>"}function f(a,e){return Number(Math.round(a+"e"+e)+"e-"+e)}n(document).on("woosb_calc_price",function(a,e,o,r,t){0<parseFloat(m)&&_(m),s.html(_(e))}),n(document).on("woosb_check_qty",function(a,e,o){var r,t,s,o=o.closest(".woosb-product");"subtotal"===i&&(r=o.attr("data-price-suffix"),e=parseFloat(o.attr("data-price"))*parseFloat(e),(0<parseFloat(b)&&"no"===c.attr("data-fixed-price")?(s=e-(t=e*(100-parseFloat(b))/100),o.find(".woosb-price-new").html(_(t)+r).append(w(s))):o.find(".woosb-price-new").html(_(e)+r)).show())}),n(document).on("found_variation",function(a,e){var o,r,t,s,c,a=n(a.target).closest(".woosb-product");void 0!==e.price_html&&""!==e.price_html&&void 0!==e.display_price&&""!==e.display_price&&(a=a,o=e.display_price,r=e.display_regular_price,e=e.price_html,t=a.attr("data-price-suffix"),a.find(".woosb-price-ori").hide(),"subtotal"===i?(s=parseFloat(o)*parseFloat(a.attr("data-qty")),c=s="regular_price"===d&&void 0!==r?parseFloat(r)*parseFloat(a.attr("data-qty")):s,0<parseFloat(b)&&(c=s*(100-b)/100),a.find(".woosb-price-new").html(_(c)+t).append(w(s,c)).show()):0<parseFloat(b)?(s=parseFloat(o),c=(s="regular_price"===d&&void 0!==r?parseFloat(r):s)*(100-parseFloat(b))/100,a.find(".woosb-price-new").html(_(c)+t).append(w(s,c)).show()):"regular_price"===d&&void 0!==r?a.find(".woosb-price-new").html(_(r)+t).show():""!==e&&a.find(".woosb-price-new").html(e).show())})}a(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/tm-product-bundle.default",e)})}(jQuery);