window.admin.removeSubmitButtonOffsetOn(["#logo","#footer","#newsletter","#product_page","#slider_banners","#three_column_full_width_banners","#brands","#two_column_banners","#three_column_banners","#one_column_banner"]);$("#storefront_theme_color").on("change",e=>{e.currentTarget.value==="custom_color"?$("#custom-theme-color").removeClass("hide"):$("#custom-theme-color").addClass("hide")});$("#storefront_mail_theme_color").on("change",e=>{e.currentTarget.value==="custom_color"?$("#custom-mail-theme-color").removeClass("hide"):$("#custom-mail-theme-color").addClass("hide")});$("#storefront-settings-edit-form").on("click",".panel-image",e=>{new MediaPicker({type:"image"}).on("select",o=>{const r=$(e.currentTarget);r.find("i").remove(),r.find("img").attr("src",o.path).removeClass("hide"),r.find(".banner-file-id").val(o.id),r.find("button.remove-image").length===0&&r.append(`<button type="button" class="btn remove-image">
                    <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
                        <path d="M6.00098 17.9995L17.9999 6.00053" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
                        <path d="M17.9999 17.9995L6.00098 6.00055" stroke="#292D32" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
                    </svg>
                </button>`)})});$("#storefront-settings-edit-form").on("click",".remove-image",e=>{e.stopPropagation();const t=$(e.currentTarget);t.parent().prepend('<i class="fa fa-picture-o"></i>'),t.parent().find("img").removeAttr("src").addClass("hide"),t.parent().find("input").attr("value",""),t.remove()});$(".product-type").on("change",e=>{let t=$(e.currentTarget).parents(".form-group").siblings(".category-products"),o=$(e.currentTarget).parents(".form-group").siblings(".products-limit"),r=$(e.currentTarget).parents(".form-group").siblings(".custom-products");t.addClass("hide"),o.addClass("hide"),r.addClass("hide"),e.currentTarget.value==="category_products"&&t.removeClass("hide"),(e.currentTarget.value==="latest_products"||e.currentTarget.value==="recently_viewed_products"||e.currentTarget.value==="category_products")&&o.removeClass("hide"),e.currentTarget.value==="custom_products"&&r.removeClass("hide")});$(function(){$("#logo").hasClass("active")&&$("#logo").parent().find('button[type="submit"]').parent().removeClass("col-md-offset-2")});
