jQuery(document).ready(function(){function t(t){var e,a,r;if(t instanceof jQuery.Event)(r=jQuery(t.target).closest("select")).length&&r.closest(".avada-select-wrapper").length&&c(r);else for(e=0;e<t.length;e++)a=jQuery(t[e].target),r="","childList"===t[e].type&&(a.parent().hasClass("fusion-post-cards")?(r=a.find(".fusion-post-card-cart").find(".avada-select-wrapper select"),"undefined"!=typeof wc_add_to_cart_variation_params&&a.find(".variations_form").each(function(){jQuery(this).wc_variation_form()})):a.is("select")&&a.closest(".avada-select-wrapper").length&&(r=a),r&&c(r));function c(t){t.closest("td.value").find(".avada-color-select, .avada-button-select, .avada-image-select").each(function(){var e=jQuery(this),a=e.attr("data-value");t.find('[value="'+a+'"]').length?e.removeAttr("data-disabled"):e.attr("data-disabled",!0)})}}jQuery(".avada-select-wrapper").each(function(){var t=jQuery(this).find("select").val(),e=jQuery(this).find('[data-value="'+t+'"]'),a=jQuery(this).find("[data-checked]");e.length&&!e.is("[data-checked]")&&(a.removeAttr("data-checked"),e.attr("data-checked",!0))}),jQuery("body").on("click",".avada-color-select, .avada-image-select, .avada-button-select",function(t){var e=jQuery(this).closest(".avada-select-wrapper"),a=e.find("select"),r=jQuery(this).attr("data-value");if(e.length&&t.preventDefault(),!jQuery(this).attr("data-disabled")){if(jQuery(this).is("[data-checked]"))return e.find("[data-checked]").removeAttr("data-checked"),void a.val("").trigger("change.wc-variation-form");e.find("[data-checked]").removeAttr("data-checked"),jQuery(this).attr("data-checked",!0),a.val(r).trigger("change.wc-variation-form")}}),window.MutationObserver?new MutationObserver(t).observe(document.querySelector("body"),{attributes:!1,childList:!0,characterData:!0,subtree:!0}):jQuery("body").on("DOMNodeInserted DOMNodeRemoved",t),jQuery("body").on("check_variations",".variations_form",function(t){var e=jQuery(t.currentTarget).closest(".product").find(".product_meta").find(".sku");1<e.length&&e.each(function(){void 0===jQuery(this).attr("data-o-content-set")?(jQuery(this).attr("data-o_content",jQuery(this).text()),jQuery(this).attr("data-o-content-set",!0)):jQuery(this).closest(".fusion-layout-column").hasClass("post-card")&&jQuery(this).text(jQuery(this).attr("data-o_content"))})}),jQuery("body").on("reset_data",".variations_form",function(t){var e=jQuery(t.currentTarget).closest(".product").find(".product_meta").find(".sku");1<e.length&&jQuery(e).each(function(){jQuery(this).closest(".fusion-layout-column").hasClass("post-card")&&void 0!==jQuery(this).attr("data-o_content")&&jQuery(this).text(jQuery(this).attr("data-o_content"))})}),jQuery("body").on("click",".reset_variations",function(){jQuery(".product").find(".product_meta").find(".sku").each(function(){void 0!==jQuery(this).attr("data-o_content")&&jQuery(this).text(jQuery(this).attr("data-o_content"))}),jQuery(this).closest(".variations_form").find("[data-checked]").removeAttr("data-checked")})});