!function(t){"use strict";function e(t,e){let n=e.parent().parent().parent().find(".wopb-backorder-field-group");"onbackorder"==e.val()&&0==t.prop("checked")?(n.show(400),n.find(".wopb-required").prop("required",!0)):(n.hide(400),n.find(".wopb-required").prop("required",!1))}e(t("#_manage_stock"),t("#_stock_status")),t(document).on("woocommerce_variations_loaded",(function(){t("select[id^=variable_stock_status").each((function(){e(t(this).parent().parent().parent().find("input[name^=variable_manage_stock]"),t(this))}))})),t("#_stock_status, #_manage_stock").change((function(){e(t(this).parent().parent().parent().find("#_manage_stock"),t(this).parent().parent().parent().find("#_stock_status"))})),t(document).on("change","select[id^=variable_stock_status], input[name^=variable_manage_stock]",(function(){e(t(this).parent().parent().parent().find("input[name^=variable_manage_stock]"),t(this).parent().parent().parent().find("select[id^=variable_stock_status]"))})),t("form.variations_form").each((function(){let e=t(this),n=e.find(".single_add_to_cart_button").text();t(e).on("show_variation",(function(e,a){let i=t(this).find(".wopb-singlepage-backorder-message").find(".wopb-single-variation-backorder-text").val();t(".single_add_to_cart_button").text(i||n)})).on("hide_variation",(function(e){t(".single_add_to_cart_button").text(n)}))}))}(jQuery);