jQuery(document).ready(function(t){t(".xpro_swatches_in_loop").on("click",".swatch",function(s){s.preventDefault();let e=t(this).closest(".xpro_swatches_in_loop").attr("data-attribute");t(this).closest(".xpro_swatches_in_loop").find(".swatch").removeClass("selected"),t(this).toggleClass("selected"),e=JSON.parse(e);let a=t(this).attr("data-value"),r=t(this).closest(".product ").find("img"),c=r.attr("src");r.removeAttr("srcset"),void 0!==e[a]?r.attr("src",e[a].src):r.attr("src",c)})});