"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 '' + n.alt + '' }, setBanner: function(e, n) { if (e && t("." + e).length && Object.keys(n).length) { t("." + e).find(".menu-banner img").length || t.trim(t("." + e).find(".menu-banner").html(this.buildImage(e, n))) } }, events: function(e) { var n = this; t("body").on("hover", ".nav > ul > li", function() { n.setBanner(t(this).attr("rel"), e) }) }, init: function() { var t = this; this.getBanners(function(e) { t.events(e) }) } } }, this.message = function() { return { confirmGoToCheckout: function(t, e) { this.confirm(t, e, "success", "Continuar comprando", "Ir para o carrinho") }, confirm: function(t, e, n, i, o) { swal({ title: t, text: e, type: n, showCancelButton: !0, confirmButtonColor: "#3085d6", cancelButtonColor: "#d33", confirmButtonText: i, cancelButtonText: o, confirmButtonClass: "btn btn-default", cancelButtonClass: "btn btn-success", buttonsStyling: !1 }).then(function() { console.log("then") }, function(t) { "cancel" === t && (window.location.href = "/#/checkout/cart") }) }, alert: function(t, e, n) { t && e && n && swal({ title: t, text: e, type: n, confirmButtonColor: "#3085d6", timer: 1e4 }) } } }, this.notify = function() { return { msg: function(e, n) { e && n && (t.notify.defaults({ globalPosition: "bottom right" }), t.notify(e, n)) }, success: function(t) { t && this.msg(t, "success") }, info: function(t) { t && this.msg(t, "info") }, warn: function(t) { t && this.msg(t, "warn") }, error: function(t) { t = t || "Houve um erro, por favor tente novamente!", this.msg(t, "error") } } }, this.homeControl = function() { return { init: function() { t("body").hasClass("home") && console.log("Home") } } }, this.productControl = function() { return { init: function() { t("body").hasClass("produto") && console.log("Produto") } } }, this.catalogoControl = function() { var e = this; return { smartResearch: function() { t(".menu-departamento input[type='checkbox']").vtexSmartResearch({ pageLimit: 1, shelfCallback: function() { e.shelfControl().forceVue(), e.verifiySeeMoreCatalogos() }, ajaxCallback: function() { e.shelfControl().forceVue(), e.verifiySeeMoreCatalogos() } }) }, init: function() { t("body").hasClass("catalogo") && (this.smartResearch(), e.verifiySeeMoreCatalogos()) } } }, this.buscaControl = function() { return { itemBreadcrumb: function() { t(".bread-crumb > ul").append('
  • ' + vtxctx.searchTerm + "
  • ") }, init: function() { t("body").hasClass("resultado-busca") && this.itemBreadcrumb() } } }, this.cmsControl = function() { return { itemBreadcrumb: function() { t(".bread-crumb > ul").append('
  • ' + t(".shell > .section__inner").find("h1").text() + "
  • ") }, init: function() { t("body").hasClass("cms") && this.itemBreadcrumb() } } }, this.hotsiteControl = function() { return { init: function() { t("body").hasClass("hotsite") && console.log("hotsite") } } }, this.loginControl = function() { return { init: function() { t("body").hasClass("login") && console.log("login") } } }, this.initControl = function() { this.homeControl().init(), this.productControl().init(), this.catalogoControl().init(), this.cmsControl().init(), this.hotsiteControl().init(), this.loginControl().init(), this.catalogoControl().init() } }; t(window).load(function() { t(".prateleira.vitrine > ul").addClass("load"), t("body").hasClass("catalogo") && (setTimeout(function() { t("html").css("overflow-y", "visible") }, 1500), t(document).ajaxStop(function() { e() })) }), t(document).ready(function() { t("li.helperComplement").remove(), window.loja = new n, loja.initControl(), t("body").hasClass("catalogo") && t("html").css("overflow-y", "hidden"), e(), t("ul.list-logos.list-logos--alt li a:eq(3)").attr("href", "https://www.ebit.com.br/joiasgold") }) }($), function(t) { t(document).ready(function() { function e() { t(".nav > ul > li").each(function() { t(this).find(".dropdown").length && t(this).addClass("has-dropdown") }) } var n = "current", i = (t(".btn-sizes, .link-cart"), t(".popup--cart"), t(".popup--sizes"), t(".wrapper"), t(".sidebar-trigger")), o = t(".sidebar"); i.on("click", function(t) { t.preventDefault(), i.toggleClass("active"), o.slideToggle() }), t(".nav-selection > a").on("click", function(t) { t.preventDefault() }), t(".accordion__head").on("click", function(e) { e.preventDefault(); var n = t(this); n.closest(".accordion"); n.parent().toggleClass("current"), n.siblings().stop().slideToggle(), n.closest(".accordion").siblings().removeClass("current").find(".accordion__body").slideUp() }), t(".tabs.tabs--alt .tabs__nav").on("hover", "a", function(e) { var n = t(this), i = t(n.attr("href")); n.closest("li").add(i).addClass("current").siblings().removeClass("current"), e.preventDefault() }), t(".header__inner .tabs .tabs__nav").on("hover", "a", function(e) { var i = t(this), o = t(".tabs__body .tab:eq(" + i.parent().index() + ")"); i.parent().addClass(n).siblings().removeClass(n), o.addClass(n).siblings().removeClass(n), e.preventDefault() }), t(".ico-search").on("click", function(e) { t(".overlay--nav").addClass("active"), t(this).parent().addClass("active") }), e(), t(".slider .owl-carousel").length && t(".slider .owl-carousel").owlCarousel({ items: 1, nav: !1, dots: !0, loop: !0, autoplay: !0, autoplayTimeout: 5e3 }), t(".slider-item .owl-carousel").length && t(".slider-item .owl-carousel").owlCarousel({ items: 1, nav: !0, dots: !1, loop: !0 }), t(".mCustomScrollbar").length && t(".mCustomScrollbar").mCustomScrollbar(); t("#video-example"); t(".video__btn").on("click", function(e) { var n = t(this); e.preventDefault(), n.closest(".video").find("video").get(0).play(), n.closest(".video__overlay").remove() }) }), t(window).load(function() { t("body").on("click", ".overlay--nav.active", function() { t(this).removeClass("active"), t(".burger-dropdown.opened").removeClass("opened"), t(".burger-menu-box.active").removeClass("active"), t(".search-holder").removeClass("active") }), t(".burger-menu-box").click(function() { t(this).addClass("active"), t(".overlay--nav").addClass("active"), t(".burger-dropdown").addClass("opened") }) }) }($);