"use strict";
! function(t) {
function e() {
// t.ajax({
// url: "//api.vtexcrm.com.br/" + jsnomeLoja + "/dataentities/TG/search?_fields=color,colecao",
// type: "GET",
// async: !1,
// headers: {
// Accept: "application/vnd.vtex.ds.v10+json",
// "Content-Type": "application/json"
// },
// success: function(e) {
// var n;
// for (n = 0; n < e.length; n++) {
// var i = e[n].colecao,
// o = e[n].color;
// t(".promo.product__promo .flag:contains(" + i + ")").each(function() {
// t(this).addClass("flag-style").attr("style", "--color:" + o)
// })
// }
// },
// error: function(t) {
// console.log(t)
// }
// })
}
window.util = {
removeCP: function() {
t("body").removeClass("cp-loading")
},
loadingContentShow: function() {
t(".cssload-bg").show()
},
loadingContentHide: function() {
setTimeout(function() {
t(".cssload-bg").hide()
}, 1e3)
},
loadingShow: function(e) {
e && t(e).addClass("loading")
},
loadingHide: function(e) {
e && setTimeout(function() {
t(e).removeClass("loading")
}, 1e3)
},
scrollingTo: function(e) {
e && t("body, html").animate({
scrollTop: t(e).offset().top
}, 500)
}
};
var n = function() {
this.shelfControl = function() {
var e;
e = t(t("body").hasClass("catalogo") ? ".prateleira.vitrine > .prateleira.vitrine > ul" : ".prateleira.vitrine:not(.load) > ul");
return {
vueForceRenderComponentsBuyButtons: function(t) {
Vue.component("buybutton-component", BuyButtonComponent), t.attr("rel") && new Vue({
store: store,
el: t.attr("rel")
})
},
setNameList: function(t, e, n) {
t.hasClass("load") || (t.addClass("load product-list-" + e).attr("rel", "ul.product-list-" + e), n || t.parent().hasClass("load") || t.parent().addClass("load"))
},
getListToVue: function(n) {
var i, o = this,
r = "function" == typeof n;
e.each(function() {
i = t(this), i.parent().hasClass("load") || o.vueForceRenderComponentsBuyButtons(i)
}), r && n(!0)
},
getListsToSetClass: function(n, i) {
t("li.helperComplement").remove();
var o, r = this,
a = 0,
s = "function" == typeof i;
e.each(function() {
o = t(this), r.setNameList(o, a++, s), n && !o.parent().hasClass("load") && o.parent().addClass("load")
}), s && i(!0)
},
init: function(n) {
var i, o = this;
t("body").hasClass("catalogo") && (n = n || !1, o.getListsToSetClass(n));
var r;
e.find("li:not(.loaded)").each(function() {
i = t(this), i.addClass("loaded"), r = i.find(".info-nao-mostrar-na-vitrine .product-field ul li").text(), "Sim" === r && i.find(".info-nao-mostrar-na-vitrine").text() && ("UL" == i.parent().prop("tagName") ? i.remove() : i.parent().remove()), i.addClass("loaded")
});
var a = !1;
t(".section-slider").each(function() {
a = t(this).find(".section-body .prateleira ul li"), a.length || t(this).css("visibility", "hidden")
})
},
forceVue: function() {
var t = this;
this.getListsToSetClass(!1, function() {
t.getListToVue(function() {
_self.shelfs().init()
})
})
}
}
}, this.verifiySeeMoreCatalogos = function() {
if (t(".vitrine.resultItemsWrapper").length) {
var e = parseInt(t(".searchResultsTime:eq(0) .resultado-busca-numero .value").text());
parseInt(t(".resultItemsWrapper .prateleira.vitrine ul > li").length) >= e ? t(".vejamais-vtexresearch").hide() : t(".vejamais-vtexresearch").show()
}
}, this.shelfs = function() {
return {
removeLiHelperComplement: function() {
t("li.helperComplement").remove()
},
flags: function() {
t(".flag.mais-por-menos").html("+
por
-"), t(".flag.oferta").html("O
fer
ta")
},
init: function() {
this.removeLiHelperComplement(), this.flags()
}
}
}, this.shelfTitles = function() {
var e = "",
n = "",
i = "",
o = [];
t(".prateleira.vitrine").each(function() {
i = t(this), o = i.children("h2").text().split("-"), o.length && (e = t.trim(o[0]), n = t.trim(o[1]), i.children("h2").text(e), t("
" + n + "
").insertAfter(i.children("h2"))) }) }, this.bannersMenu = function() { return { getBanners: function(t) { new CorebizVtexContentPlaceholder({ lid_placeholder: "", lid_placeholder_mobile: "", origin: "/banners-menu" }).getImages(function(e) { t(e) }) }, buildImage: function(t, e) { var n = e[t]; if (n) return '