-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1439166.modern.js
More file actions
1 lines (1 loc) · 14.7 KB
/
Copy path1439166.modern.js
File metadata and controls
1 lines (1 loc) · 14.7 KB
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[120,153],{194:function(e,t,r){"use strict";function o(e){const t=[],r=[];let o=!1;return Object.values(e.conteudo.personalizacoes).length?(e.conteudo.personalizacoes.forEach(e=>{if("s"===e.obrigatorio){e.valores.some(e=>e.selecionado)?r.push(!0):t.push(e)}else r.push(!0)}),r.length===Object.values(e.conteudo.personalizacoes).length&&(o=!0)):o=!0,{error:!o,personalizacoesInvalida:t}}function l(e){let t=!0;return e.conteudo.atributos.simples&&(t=e.conteudo.atributos.simples.valores.some(e=>e.selecionado)),{error:!t,atributoSimples:e.conteudo.atributos.simples}}function c(e){let t=e.path;if(e.query&&Object.keys(e.query).length>0){t+=`?${Object.entries(e.query).map(e=>{let[t,r]=e;return`${encodeURIComponent(t)}=${encodeURIComponent(r)}`}).join("&")}`}return t}function n(data){const e=data.conteudo.atributos.simples.valores.find(e=>e.selecionado);e&&(data.conteudo.carrinho=e.carrinho)}function d(){}r.r(t),r.d(t,"validaPersonalizacao",function(){return o}),r.d(t,"validaAtributoSimples",function(){return l}),r.d(t,"getFullLink",function(){return c}),r.d(t,"updateCartInfo",function(){return n}),r.d(t,"default",function(){return d})},345:function(e,t,r){var content=r(639);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[e.i,content,""]]),content.locals&&(e.exports=content.locals);(0,r(11).default)("5ff034cc",content,!0,{sourceMap:!1})},638:function(e,t,r){"use strict";r(345)},639:function(e,t,r){var o=r(10)(function(i){return i[1]});o.push([e.i,"#calcFrete[data-v-7f0bef2d]{position:relative}.calcFrete-form[data-v-7f0bef2d]{margin-top:25px}.title_container[data-v-7f0bef2d]{align-items:center;display:flex;justify-content:space-between;width:100%}.calcFrete-t1[data-v-7f0bef2d]{color:var(--text_base);cursor:default;display:block;font-size:var(--font_size_base);font-weight:var(--font_weight_medium);margin-bottom:7px}.calcFrete-cep[data-v-7f0bef2d]{display:flex;margin-top:16px}.calcFrete-cep input[data-v-7f0bef2d]{border-bottom:1px solid var(--text_base);color:var(--text_secondary);font-size:16px;height:32px;margin-right:5px;width:100%}.calcFrete-cep input[data-v-7f0bef2d]::-moz-placeholder{font-size:var(--font_size_small)}.calcFrete-cep input[data-v-7f0bef2d]::placeholder{font-size:var(--font_size_small)}.calcFrete-cep input.error[data-v-7f0bef2d]{border:1px solid var(--text_error_color)}.calcFrete-cep .calcFrete-submit[data-v-7f0bef2d]{background-color:var(--primary_color);border-radius:5px;color:var(--text_invert);font-weight:var(--font_weight_semi_bold);height:32px;padding:8px 12px;position:relative;transition:background-color .4s ease,color .4s ease,border-color .4s ease}.calcFrete-cep .calcFrete-submit.-loading[data-v-7f0bef2d],.calcFrete-cep .calcFrete-submit[data-v-7f0bef2d]:hover{background-color:var(--primary_opacity);border-color:var(--primary_color);color:var(--text_invert)}.calcFrete-cep .calcFrete-submit svg circle[data-v-7f0bef2d]{stroke:var(--text_secondary)}.calcFrete-submit .calcFrete-submit-text[data-v-7f0bef2d]{color:var(--text_invert);font-size:var(--font_size_base);font-weight:var(--font_weight_medium);opacity:1;transition:var(--transition_fade);visibility:visible}.calcFrete-submit.-loading .calcFrete-submit-text[data-v-7f0bef2d]{opacity:0;visibility:hidden}.calcFrete-submit .spin_loading[data-v-7f0bef2d]{color:var(--secondary_color);left:50%;opacity:0;position:absolute;top:55%;transform:translate(-50%,-50%);transition:var(--transition_fade);visibility:hidden}.calcFrete-submit.-loading .spin_loading[data-v-7f0bef2d]{opacity:1;visibility:visible}.spin_loading svg[data-v-7f0bef2d]{animation:spin-7f0bef2d 1s linear infinite;height:100%;width:100%}@keyframes spin-7f0bef2d{0%{transform:rotate(0deg)}45%{transform:rotate(180deg)}to{transform:rotate(1turn)}}.naoSeiCep[data-v-7f0bef2d]{color:var(--text_base);display:inline-block;font-size:var(--font_size_small);font-weight:var(--font_weight_light);-webkit-text-decoration:underline;text-decoration:underline}.calcFrete-resultado[data-v-7f0bef2d]{margin-top:20px;position:relative}.calcFrete-resultado.popupResultado[data-v-7f0bef2d]{align-items:center;background-color:rgba(0,0,0,.5);display:flex;height:100vh;justify-content:center;left:0;margin-top:0;max-width:none;position:fixed;top:0;width:100vw;z-index:10}.popupResultado .calcFrete-resultado-popContainer[data-v-7f0bef2d]{background-color:#fff;max-width:80vw;padding:14px 12px}.calcFrete-resultado-top[data-v-7f0bef2d]{justify-content:space-between;margin-bottom:7px}.calcFrete-resultado-top[data-v-7f0bef2d],.calcFrete-resultado-top-flex[data-v-7f0bef2d]{align-items:center;display:flex}.calcFrete-resultado-top-t1[data-v-7f0bef2d]{color:#666;font-size:12px}.calcFrete-resultado-top-recalc[data-v-7f0bef2d]{color:#666;font-size:12px;-webkit-text-decoration:underline;text-decoration:underline}.popupResultado .calcFrete-resultado-top-t1[data-v-7f0bef2d]{margin-right:26px}.popupResultado .calcFrete-resultado-top-recalc[data-v-7f0bef2d]{margin-right:41px}.calcFrete-table[data-v-7f0bef2d]{background-color:#fff;border:1px solid #eaeaea;border-radius:8px;box-shadow:0 4px 4px rgba(0,0,0,.07);width:100%}.calcFrete-table-row[data-v-7f0bef2d]{padding:12px 16px;width:100%}.calcFrete-table-container[data-v-7f0bef2d]{align-items:center;display:flex;gap:8px;justify-content:space-between;width:100%}.calcFrete-table-row[data-v-7f0bef2d]:not(:last-child){border-bottom:1px solid #f8f8f8}.calcFrete-table-prazo-preco[data-v-7f0bef2d]{display:flex;gap:24px}.calcFrete-table-name[data-v-7f0bef2d],.calcFrete-table-prazo[data-v-7f0bef2d],.calcFrete-table-price[data-v-7f0bef2d]{font-size:var(--font_size_base);font-weight:var(--font_weight_semi_bold)}.colPrazo .calcFrete-table-prazo[data-v-7f0bef2d]{font-weight:var(--font_weight_regular)}.errorMsg[data-v-7f0bef2d]{background-color:var(--bg_error_color);font-size:var(--font_size_small);margin-bottom:7px;width:-moz-fit-content;width:fit-content}.eror_shipping[data-v-7f0bef2d],.errorMsg[data-v-7f0bef2d]{border-radius:4px;color:var(--text_error_color)}.eror_shipping[data-v-7f0bef2d]{background-color:var(--bg_secondary);left:0;padding:4px 12px;position:absolute;top:calc(100% + 4px);z-index:20}.calcFrete-loader[data-v-7f0bef2d]{margin:0 auto;max-width:80px}.calcFrete-error[data-v-7f0bef2d]{color:var(--textErrorColor);margin-top:10px}.popEsqueciMeuCep[data-v-7f0bef2d]{align-items:center;background-color:rgba(0,0,0,.5);display:flex;height:100%;justify-content:center;left:0;position:fixed;top:0;width:100%;z-index:80}.popEsqueciMeuCep-container[data-v-7f0bef2d]{background-color:#fff;height:80vh;position:relative;width:80%}.popEsqueciMeuCep-container iframe[data-v-7f0bef2d]{height:100%;width:100%}.closePop[data-v-7f0bef2d]{position:absolute;right:-40px;top:-40px}.closePop svg[data-v-7f0bef2d]{height:25px;width:25px}@media (max-width:1024px){.calcFrete-form[data-v-7f0bef2d]{margin-top:32px}}@media (min-width:1024px){#calcFrete[data-v-7f0bef2d]{width:85%}}",""]),o.locals={},e.exports=o},855:function(e,t,r){"use strict";r.r(t);var o=r(194),l={filters:{makCep:e=>e.replace(/(\d{5})(\d{1,3})/,"$1-$2")},props:{popupResultado:{type:Boolean,default:!1},colPrazo:{type:Boolean,default:!0},headerTable:{type:Boolean,default:!1}},data:()=>({cep:"",errorMsg:null,frete:null,loadFrete:!1,freteError:null,showNaoSeiCep:!1,errorShipping:!1,errorTimer:0}),computed:{dataProd(){return this.$store.state.detalhe.dataProd.conteudo},prodInfo(){return this.$store.state.detalhe.prodInfo},idAtributoSimples(){var e,t;const r=null===(e=this.prodInfo.conteudo)||void 0===e||null===(t=e.atributos.simples)||void 0===t?void 0:t.valores.find(e=>e.selecionado);return r?r.idAtributoValor:0}},watch:{cep(e){this.freteError=null,this.cep=this.$options.filters.makCep(e),this.removeErrors()}},methods:{onlyNumber(){this.cep=this.cep.replace(/[^0-9.]/g,"")},validaCampos(){let e=!0;return""===this.cep?(e=!1,this.errorMsg="Preencha o campo!"):this.cep.length<9&&(e=!1,this.errorMsg="Valor inválido!"),e},removeErrors(){this.errorMsg=null},calcFrete(){this.frete=null;const e=this.cep.replace(/-/g,""),{error:t,atributoSimples:r}=Object(o.validaAtributoSimples)(this.prodInfo),{error:l,personalizacoesInvalida:c}=Object(o.validaPersonalizacao)(this.prodInfo);t||l?this.emitProductError({error:!0,data:{personalizacoes:c,atributoSimples:r}}):(this.$store.commit("detalhe/setAttributeError",!1),this.validaCampos()&&(this.loadFrete=!0,this.$axios.request({method:"post",url:"/v2/front/shipment/product",data:{cep:e,idProduto:this.dataProd.id,idAtributoValor:0,quantidade:this.$store.state.detalhe.quantidade}}).then(e=>{var t;this.frete=e.data,this.loadFrete=!1,null!==(t=e.data.fretes)&&void 0!==t&&t.length||(this.frete=null,this.showErrorMessage())}).catch(e=>{this.freteError=e.response.data,this.loadFrete=!1})))},emitProductError(e){this.$store.commit("detalhe/setAttributeError",e)},showErrorMessage(){this.errorTimer=0,clearTimeout(this.errorTimer),this.errorShipping=!0,this.errorTimer=setTimeout(()=>{this.errorShipping=!1},3e3)}}},c=(r(638),r(12)),component=Object(c.a)(l,function(){var e,t=this,r=t._self._c;return r("div",{attrs:{id:"calcFrete"}},[r("form",{staticClass:"calcFrete-form",on:{submit:function(e){return e.preventDefault(),t.calcFrete()}}},[t._m(0),t._v(" "),r("p",{directives:[{name:"show",rawName:"v-show",value:t.errorMsg,expression:"errorMsg"}],staticClass:"errorMsg"},[t._v("\n "+t._s(t.errorMsg)+"\n ")]),t._v(" "),r("div",{staticClass:"calcFrete-cep"},[r("input",{directives:[{name:"model",rawName:"v-model",value:t.cep,expression:"cep"}],class:{error:t.errorMsg},attrs:{id:"cep",type:"tel",value:"",maxlength:"9",placeholder:"SEU CEP"},domProps:{value:t.cep},on:{input:[function(e){e.target.composing||(t.cep=e.target.value)},function(e){return t.onlyNumber()}]}}),t._v(" "),r("button",{staticClass:"calcFrete-submit",class:{"-loading":t.loadFrete},attrs:{type:"submit"}},[r("div",{staticClass:"calcFrete-submit-text",attrs:{name:"btLabel"}},[t._v("\n CALCULAR\n ")]),t._v(" "),r("div",{staticClass:"spin_loading"},[r("svg",{attrs:{width:"30",height:"30"}},[r("use",{attrs:{"xlink:href":"#spin-icon"}})])])])])]),t._v(" "),t.frete?r("div",{staticClass:"calcFrete-resultado",class:{popupResultado:t.popupResultado,colPrazo:t.colPrazo}},[r("div",{staticClass:"calcFrete-resultado-popContainer"},[r("div",{staticClass:"calcFrete-resultado-top"},[r("div",{staticClass:"calcFrete-resultado-top-flex"},[r("p",{staticClass:"calcFrete-resultado-top-t1"},[t._t("labelFreteResultado",function(){return[t._v("\n Frete para CEP:\n ")]}),t._v(" "),r("b",[t._v(t._s(t.cep))])],2)]),t._v(" "),t.popupResultado?r("button",{staticClass:"calcFrete-resultado-top-close"},[r("svg",{attrs:{width:"36",height:"33",viewBox:"0 0 36 33",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M22.9606 10.2808L22.9607 10.2807C23.3117 9.92976 23.8783 9.92976 24.2293 10.2807C24.5702 10.6217 24.5702 11.1983 24.2293 11.5393L19.3393 16.4293L19.2686 16.5L19.3393 16.5707L24.2293 21.4607C24.5802 21.8117 24.5802 22.3783 24.2293 22.7293C23.8783 23.0802 23.3117 23.0802 22.9607 22.7293L18.0707 17.8393L18 17.7686L17.9293 17.8393L13.0393 22.7293C12.6883 23.0802 12.1217 23.0802 11.7707 22.7293C11.4198 22.3783 11.4198 21.8117 11.7707 21.4607L16.6607 16.5707L16.7314 16.5L16.6607 16.4293L11.7707 11.5393C11.4198 11.1883 11.4198 10.6217 11.7707 10.2707C12.1217 9.91976 12.6883 9.91976 13.0393 10.2707L17.9293 15.1607L17.9999 15.2314L18.0706 15.1608L22.9606 10.2808Z",fill:"black","fill-opacity":"0.87",stroke:"white","stroke-width":"0.2"}})])]):t._e()]),t._v(" "),null!==(e=t.frete)&&void 0!==e&&e.fretes.length?r("div",{staticClass:"calcFrete-table"},[t.headerTable?r("div",{staticClass:"calcFrete-table-row"},[r("div",{staticClass:"calcFrete-table-container header"},[r("div",{staticClass:"calcFrete-table-name"},[t._v("\n "+t._s(t.labelTableCol1)+"\n ")]),t._v(" "),t.colPrazo?r("div",{staticClass:"calcFrete-table-prazo"},[t._v("\n "+t._s(t.labelTableCol2)+"\n ")]):t._e(),t._v(" "),r("div",{staticClass:"calcFrete-table-price"},[t._v("\n "+t._s(t.labelTableCol3)+"\n ")])])]):t._e(),t._v(" "),t._l(t.frete.fretes,function(e,o){return r("div",{key:`frete-${e.id}-${o}`,staticClass:"calcFrete-table-row"},[r("div",{staticClass:"calcFrete-table-container"},[r("div",{staticClass:"calcFrete-table-name"},[t._v("\n "+t._s(e.label)+"\n ")]),t._v(" "),r("div",{staticClass:"calcFrete-table-prazo-preco"},[t.colPrazo?r("div",{staticClass:"calcFrete-table-prazo"},[t._v("\n "+t._s(e.prazo)+"\n ")]):t._e(),t._v(" "),r("div",{staticClass:"calcFrete-table-price"},[t._v("\n "+t._s(t._f("formatPrice")(e.valor))+"\n ")])])])])})],2):t._e()])]):t._e(),t._v(" "),r("div",{staticClass:"eror_shipping fade",class:{"-show":t.errorShipping}},[t._v("\n Não foi possível calcular o frete\n ")]),t._v(" "),t.freteError?[t.freteError.details?t._l(t.freteError.details,function(e,i){return r("p",{key:i,staticClass:"calcFrete-error"},[t._v("\n "+t._s(e)+"\n ")])}):t.freteError.error?[r("p",{staticClass:"calcFrete-error"},[t._v("\n "+t._s(t.freteError.error)+"\n ")])]:t._e()]:t._e(),t._v(" "),t.showNaoSeiCep?r("div",{staticClass:"popEsqueciMeuCep",on:{click:function(e){t.showNaoSeiCep=!1}}},[r("div",{staticClass:"popEsqueciMeuCep-container"},[r("button",{staticClass:"closePop",on:{click:function(e){t.showNaoSeiCep=!1}}},[r("svg",{attrs:{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"}},[r("path",{attrs:{d:"M11.5531 0.373283L11.5532 0.373211C11.9042 0.0222633 12.4708 0.0222633 12.8218 0.373211C13.1627 0.714158 13.1627 1.29084 12.8218 1.63179L7.93179 6.52179L7.86108 6.5925L7.93179 6.66321L12.8218 11.5532C13.1727 11.9042 13.1727 12.4708 12.8218 12.8218C12.4708 13.1727 11.9042 13.1727 11.5532 12.8218L6.66321 7.93179L6.5925 7.86108L6.52179 7.93179L1.63179 12.8218C1.28084 13.1727 0.714158 13.1727 0.363211 12.8218C0.0122631 12.4708 0.0122631 11.9042 0.363211 11.5532L5.25321 6.66321L5.32392 6.5925L5.25321 6.52179L0.363211 1.63179C0.0122631 1.28084 0.0122631 0.714158 0.363211 0.363211C0.714158 0.0122631 1.28084 0.0122631 1.63179 0.363211L6.52179 5.25321L6.59243 5.32385L6.66314 5.25328L11.5531 0.373283Z",fill:"#fff",stroke:"white","stroke-width":"0.2"}})])]),t._v(" "),r("iframe",{attrs:{src:"https://buscacepinter.correios.com.br/app/endereco/index.php",frameborder:"0"},on:{click:function(e){e.stopPropagation()}}})])]):t._e()],2)},[function(){var e=this,t=e._self._c;return t("div",{staticClass:"title_container"},[t("label",{staticClass:"calcFrete-t1",attrs:{for:"cep"}},[t("span",{attrs:{name:"titulo"}},[e._v("CALCULAR FRETE")])]),e._v(" "),t("a",{staticClass:"naoSeiCep",attrs:{href:"https://buscacepinter.correios.com.br/app/endereco/index.php",target:"_blank"}},[e._v("\n NÃO SEI MEU CEP\n ")])])}],!1,null,"7f0bef2d",null);t.default=component.exports}}]);