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