!function(i){i(document).scroll(function(){var t=i(".woocommerce div.product .woocommerce-tabs"),a=t.offset().top,e=i(".owp-floating-bar"),o=0,r=i("#wpadminbar"),d=i("#top-bar-sticky-wrapper"),n=i("#top-bar-wrap"),c=i("#site-header");t.length&&(r.length&&600a?e.addClass("show"):e.removeClass("show")}),i(".owp-floating-bar button.button.top").on("click",function(t){t.preventDefault();var a,e=i(".woocommerce div.product .cart");e.length&&(a=e.offset().top-o,i("html, body").stop().animate({scrollTop:Math.round(a)},1e3))}))});function t(){i(document.body).on("click",".owp-floating-bar .floating_add_to_cart_button",this.onAddToCart).on("added_to_cart",this.updateButton)}t.prototype.onAddToCart=function(t){t.preventDefault();var a=i(this),e=i(this).val(),o=i('input[name="quantity"]').val();a.removeClass("added"),a.addClass("loading"),i.ajax({url:oceanwpLocalize.ajax_url,type:"POST",data:"action=oceanwp_add_cart_floating_bar&product_id="+e+"&quantity="+o,success:function(t){i(document.body).trigger("wc_fragment_refresh"),i(document.body).trigger("added_to_cart",[t.fragments,t.cart_hash,a]),"yes"!==oceanwpLocalize.cart_redirect_after_add||(window.location=oceanwpLocalize.cart_url)}})},t.prototype.updateButton=function(t,a,e,o){(o=void 0!==o&&o)&&(o.removeClass("loading"),o.addClass("added"),oceanwpLocalize.is_cart||0!==o.parent().find(".added_to_cart").length||o.after(' '+oceanwpLocalize.view_cart+""))},new t}(jQuery);