text: (window.webpackJsonp=window.webpackJsonp||[]).push([[121],{160:function(e,t,n){var s=n(12),i=/"/g;e.exports=function(e,t,n,r){var o=String(s(e)),a="<"+t;return""!==n&&(a+=" "+n+'="'+String(r).replace(i,"&quot;")+'"'),a+">"+o+"</"+t+">"}},161:function(e,t,n){var s=n(2);e.exports=function(e){return s(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3})}},269:function(e,t,n){"use strict";function s(e,t,n,s,i,r,o,a){var c,l="function"==typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=n,l._compiled=!0),s&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),o?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},l._ssrRegister=c):i&&(c=a?function(){i.call(this,this.$root.$options.shadowRoot)}:i),c)if(l.functional){l._injectStyles=c;var d=l.render;l.render=function(e,t){return c.call(t),d(e,t)}}else{var u=l.beforeCreate;l.beforeCreate=u?[].concat(u,c):[c]}return{exports:e,options:l}}n.d(t,"a",function(){return s})},272:function(e,t,n){"use strict";n(153),n(15),n(16),n(99);var s=n(282),i=n(274),r=n(276),o=n(76),a=n(271),c=n(275),l=n(124);n.d(t,"a",function(){return d}),n.d(t,"b",function(){return u}),n.d(t,"d",function(){return p}),n.d(t,"c",function(){return m}),n.d(t,"e",function(){return g});var d="https://www.facebook.com";window.fbAsyncInit=function(){FB.init({appId:"211265535746847",xfbml:!0,version:"v4.0"}),FB.AppEvents.logPageView()};var u=function(){"complete"===window.document.readyState?(Object(s.a)(),Object(i.d)(i.c)):window.addEventListener("load",function(){Object(s.a)(),Object(i.d)(i.c)})},p=function(e){var t={email:e.id,source:e.provider===d?"facebook":"google_api",token:e.token};return h("/session/social",e,t)},m=function(e){var t={email:e.id,password:e.password};return h("/session/auth",e,t)},h=function(e,t,n){var s=window.callbackLogin||"",i=""!==s||window.location.href.search("entrar")>0||window.location.href.search("carrinho/email")>0;return Object(l.c)(e,n).then(function(e){return new Promise(function(n,r){f(t,e),v(i,s),n(e)})}).catch(function(e){return new Promise(function(t,n){n(e.json())})})},f=function(e,t){navigator.credentials&&localStorage.setItem("credential",JSON.stringify(e))},v=function(e,t){e?function(e,t){var n=document.createElement("form");for(var s in n.setAttribute("method","post"),n.setAttribute("action",e),t)if(t.hasOwnProperty(s)){var i=document.createElement("input");i.setAttribute("type","hidden"),i.setAttribute("name",s),i.setAttribute("value",t[s]),n.appendChild(i)}document.body.appendChild(n),n.submit()}("/session/redirect",{sp:t}):(function(){if(navigator.credentials){var e=localStorage.getItem("credential");if(e){var t=JSON.parse(e);if(t.password&&window.PasswordCredential)(n=new PasswordCredential({id:t.id,password:t.password})).name=t.name,navigator.credentials.store(n);else if(t.id&&t.name&&t.iconURL&&t.provider&&window.FederatedCredential){var n=new FederatedCredential({id:t.id,name:t.name,iconURL:t.iconURL,provider:t.provider});navigator.credentials.store(n)}localStorage.removeItem("credential"),Object(a.f)(t.provider)}}}(),Object(r.a)())},w=function(){o.q.delete("PL_sid"),window.location.assign("/session/logout")},b=function(){c.a.disable().then(w).catch(w)},g=function(){"undefined"==typeof smartlock?c.a.initialize(!1).then(function(){b()}):b()}},274:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"d",function(){return c}),n.d(t,"b",function(){return l}),n.d(t,"c",function(){return u}),n(15),n(16);var s=n(272),i=n(62),r=n(271),o=n(76),a="https://accounts.google.com",c=function(e){if(!document.getElementById("google-js")){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.id="google-js",t.onload=(e||function(){}).bind(void 0),t.src="https://apis.google.com/js/api:client.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)}},l=function(e,t){return new Promise(function(t,n){var i=function(e){if(e){var i={id:e.getBasicProfile().getEmail(),name:e.getBasicProfile().getName(),iconURL:e.getBasicProfile().getImageUrl(),token:e.getAuthResponse().id_token,provider:a};Object(s.d)(i).then(function(e){Object(r.d)("google","success");var n=e.json?e.json().email:e.email;o.q.set("PL_email",n),t(e)}).catch(function(e){Object(r.d)("google","error"),n(e)})}};gapi&&gapi.auth2&&gapi.auth2.getAuthInstance&&function(){var s=gapi.auth2.getAuthInstance();if(s.isSignedIn.get()){var r=s.currentUser.get();if(r.getBasicProfile().getEmail()===e)return t(r)}return s.signIn({login_hint:e||""}).then(i).catch(function(e){return n(e)})}().then(i).catch(function(e){return n(e)})})},d=function(){return gapi.load("auth2",function(){gapi.auth2.init({client_id:"447418113095-p03nqdsrukba19jan6hfuc69qd170ne8.apps.googleusercontent.com",cookiepolicy:"single_host_origin"})})},u=function(){document.getElementById("google-js")?Object(i.g)(function(){d()}):d()}},275:function(e,t,n){"use strict";n.d(t,"a",function(){return c}),n(15),n(16),n(121),n(284);var s=n(76),i=n(272),r=n(271),o=n(274),a="userCanceled",c={data:null,credentialOptions:{supportedAuthMethods:["smartlock://id-and-password","https://accounts.google.com"],supportedIdTokenProviders:[{uri:"https://accounts.google.com",clientId:"447418113095-p03nqdsrukba19jan6hfuc69qd170ne8.apps.googleusercontent.com"}]},useIdTokenForAuth:function(e){if(e)return this.data={id:e.id,name:e.displayName,iconURL:e.profilePicture,token:e.idToken,provider:o.a},e.password?this.sendToLogin():this.sendToSocialLogin()},sendToLogin:function(){Object(i.c)(this.data)},sendToSocialLogin:function(){Object(i.d)(this.data)},handleRetrieveError:function(e){if(e&&e.type&&e.type!==a)return smartlock.hint(this.credentialOptions).then(this.useIdTokenForAuth.bind(this)).catch(this.handleCredentialError.bind(this));this.handleCredentialError({type:a})},handleCredentialError:function(e){var t="error";switch(e.type){case a:this.setCookie(),this.disable(),t="error-user-canceled";break;case"noCredentialsAvailable":this.setCookie(),this.disable(),t="error-no-credentials";break;case"requestFailed":t="error-request-failed";break;case"operationCanceled":t="error-operation-canceled";break;case"illegalConcurrentRequest":t="error-ilegal-concurrent-request";break;case"initializationError":t="error-initialization";break;case"configurationError":t="error-cofiguration"}Object(r.d)("smartlock",t)},handleSmartLockResult:function(e){return e.password?(this.data=e,this.sendToLogin()):!!e&&(this.data=JSON.parse(atob(e.idToken.split(".")[1])),s.q.set("PL_sid",this.data.sub),this.useIdTokenForAuth(e),Object(r.d)("smartlock","success"),!0)},shouldTrySmartLock:function(){return!s.q.get("PL_sid")||"userCanceledSm"!==s.q.get("PL_sid")},onload:function(){this.increaseGoogleYoloTimeout(),this.shouldTrySmartLock()&&smartlock.retrieve(this.credentialOptions).then(this.handleSmartLockResult.bind(this)).catch(this.handleRetrieveError.bind(this))},setCookie:function(){s.q.set("PL_sid","userCanceledSm",7)},increaseGoogleYoloTimeout:function(){try{googleyolo.setTimeouts(5e3)}catch(e){console.log(e)}},initialize:function(e){var t=this;return new Promise(function(n){var s=function(){var s=document.createElement("script");s.src="https://smartlock.google.com/client",s.async=!0,s.onload=e?t.onload.bind(t):function(){t.increaseGoogleYoloTimeout(),n()},document.querySelector("head").appendChild(s)};"complete"===window.document.readyState?s():window.addEventListener("load",function(){s()})})},disable:function(){return smartlock.disableAutoSignIn()}}},276:function(e,t,n){"use strict";n.d(t,"c",function(){return l}),n.d(t,"b",function(){return d}),n.d(t,"a",function(){return u}),n(97),n(153),n(102);var s=n(76),i=n(112),r=n(275),o=n(272),a=n(62),c=n(124),l=function(e){s.q.set("PL_email",e)},d=function(e){var t="".concat(Object(a.c)(),"/api/v2/users/").concat(e,"/public");return Object(c.b)(t).then(function(e){return i.a.publish(i.a.events.user_public,e,!0),s.q.set(s.i,e.public_id),e})},u=function(){return Object(c.b)("/service/user/current").then(function(t){if(e(t),i.a.publish(i.a.events.user_loaded,t,!0),!t.logged)return r.a.initialize(!0),Object(o.b)(),void i.a.publish(i.a.events.user_zipcode,n);r.a.initialize(!1),isMobileAccess||OneSignal.push(["sendTags",{firstName:t.name}]),s.q.get(s.c)||s.q.set(s.c,t.email);try{s.q.set(s.d,t.new_client)}catch(e){}window.infoPetlove.client=t;var n=t.last_address?t.last_address.zipcode:"";return function(e){e&&(e=e.replace(/(\d{5})(\d{3})/,"$1-$2"),s.q.set(s.o,e))}(n),i.a.publish(i.a.events.user_zipcode,n),t}).catch(function(t){r.a.initialize(!0);return Object(o.b)(),i.a.publish(i.a.events.user_loaded,{logged:!1,new_client:!0},!0),e(t),t});function e(e,t){try{e=e.data||e,e=JSON.parse(e)}catch(t){e={message:""}}e.message&&(t=e.message.success?"success":"error",e.message[t]&&i.a.publish(i.a.events.flash_message,{text:e.message[t],type:t,ctx:body}))}}},282:function(e,t,n){"use strict";n.d(t,"a",function(){return o}),n.d(t,"b",function(){return a}),n(153),n(15),n(16);var s=n(272),i=n(271),r=n(76),o=function(){return document.getElementById("facebook-jssdk")?Promise.resolve(window.FB):new Promise(function(e){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.id="facebook-jssdk",t.src="https://connect.facebook.net/pt_BR/sdk.js",t.addEventListener("load",function(){e(window.FB)});var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)})},a=function(){var e;return new Promise(function(t,n){FB.login(function(o){o.authResponse?(e=o.authResponse.accessToken,FB.api("/me",{fields:"email,name,picture"},function(o){var a={id:o.email,name:o.name,iconURL:o.picture.data.url||DEFAULT_IMG,provider:s.a,token:e};Object(s.d)(a).then(function(e){Object(i.d)("facebook","success");var n=e.json?e.json().email:e.email;r.q.set("PL_email",n),t(e)}).catch(function(e){Object(i.d)("facebook","error"),n(e)})})):n(null)},{scope:"email"})})}},284:function(e,t,n){"use strict";var s=n(17),i=n(160);s({target:"String",proto:!0,forced:n(161)("sub")},{sub:function(){return i(this,"sub","","")}})},298:function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"b",function(){return c}),n(110);var s=n(276),i=n(76),r=n(62),o=n(124),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=[],i=e.pet&&e.pet.species;function a(e){var t={species:e};n.push(t)}i=JSON.parse(JSON.stringify(i)),Object(s.c)(e.email),Array.isArray(i)&&i.length?i.forEach(a):a(i);var c={source:t,page:window.location.pathname,channel:"website",subchannel:Object(r.b)()},l={email:e.email,optin:e.option,pet:n,lead:c},d="".concat(Object(r.c)(),"/api/v2/users/optin");return Object(o.c)(d,l).then(function(e){if(e.error)throw new Error(e.error)})},c=function(){i.q.set("PL_pendingCoupon","BOASVINDAS")}},355:function(e,t,n){"use strict";n.r(t),n(15),n(16);var s=n(298),i={name:"newsletter-modal",props:["show","onClose"],components:{modal:function(){return n.e(117).then(n.bind(null,371))}},data:function(){return{submitCompleted:!1,submitButton:{text:"cadastrar",default:"cadastrar",loading:"enviando..."},newsletter:{email:"",option:!0,pet:{species:[]}},isLoading:!1,addCoupon:!1}},methods:{close:function(){this.onClose&&this.onClose()},submitNewsletter:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";Object(s.a)(e,t).then(this.onSuccessSubmitNewsletter).catch(this.onErrorSubmitNewsletter)},onClickSubmitNewsletter:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.setLoading(),this.submitNewsletter(this.newsletter,e)},setLoading:function(){this.loadingNewsletter=!0,this.submitButton.text=this.submitButton.loading},applyCoupon:function(){this.addCoupon=!0,Object(s.b)()},onSuccessSubmitNewsletter:function(e){this.submitCompleted=!0},onErrorSubmitNewsletter:function(e){this.submitButton.text=this.submitButton.default,window.alert("OPS! Ocorreu um erro :(")}}},r=n(269),o=Object(r.a)(i,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("modal",{attrs:{show:e.show,"on-close":e.close},on:{"update:show":function(t){e.show=t}}},[n("div",{staticClass:"newsletter-modal-content"},[n("div",{staticClass:"modal-container"},[n("div",{staticClass:"row"},[n("div",{staticClass:"col-7 newsletter-form"},[e.submitCompleted?e._e():n("form",{attrs:{autocomplete:"on"},on:{submit:function(t){return t.preventDefault(),e.onClickSubmitNewsletter("lightbox")}}},[n("div",{staticClass:"newsletter-title"},[e._v("Ganhe 10% OFF")]),e._v(" "),n("div",{staticClass:"newsletter-subtitle"},[e._v("na sua primeira compra")]),e._v(" "),n("div",{staticClass:"newsletter-step1"},[n("label",{attrs:{for:"email"}},[e._v("Qual seu e-mail?")]),e._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.newsletter.email,expression:"newsletter.email"}],staticClass:"white input-sm",attrs:{type:"email",autocomplete:"on",placeholder:"seu@email.com",minlength:"8",maxlength:"70",required:""},domProps:{value:e.newsletter.email},on:{input:function(t){t.target.composing||e.$set(e.newsletter,"email",t.target.value)}}}),e._v(" "),n("label",{attrs:{for:"pets"}},[e._v("Quais pets você tem?")]),e._v(" "),n("div",{staticClass:"radio-button"},[n("label",{staticClass:"radio-button-item",attrs:{for:"cachorro"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.newsletter.pet.species,expression:"newsletter.pet.species"}],attrs:{type:"checkbox",id:"cachorro",value:"cachorro"},domProps:{checked:Array.isArray(e.newsletter.pet.species)?e._i(e.newsletter.pet.species,"cachorro")>-1:e.newsletter.pet.species},on:{change:function(t){var n=e.newsletter.pet.species,s=t.target,i=!!s.checked;if(Array.isArray(n)){var r=e._i(n,"cachorro");s.checked?r<0&&e.$set(e.newsletter.pet,"species",n.concat(["cachorro"])):r>-1&&e.$set(e.newsletter.pet,"species",n.slice(0,r).concat(n.slice(r+1)))}else e.$set(e.newsletter.pet,"species",i)}}}),n("span",{staticClass:"icon-cachorro icon-md"})]),e._v(" "),n("label",{staticClass:"radio-button-item",attrs:{for:"gato"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.newsletter.pet.species,expression:"newsletter.pet.species"}],attrs:{type:"checkbox",id:"gato",value:"gato"},domProps:{checked:Array.isArray(e.newsletter.pet.species)?e._i(e.newsletter.pet.species,"gato")>-1:e.newsletter.pet.species},on:{change:function(t){var n=e.newsletter.pet.species,s=t.target,i=!!s.checked;if(Array.isArray(n)){var r=e._i(n,"gato");s.checked?r<0&&e.$set(e.newsletter.pet,"species",n.concat(["gato"])):r>-1&&e.$set(e.newsletter.pet,"species",n.slice(0,r).concat(n.slice(r+1)))}else e.$set(e.newsletter.pet,"species",i)}}}),n("span",{staticClass:"icon-gatos icon-md"})]),e._v(" "),n("label",{staticClass:"radio-button-item",attrs:{for:"passaro"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.newsletter.pet.species,expression:"newsletter.pet.species"}],attrs:{type:"checkbox",id:"passaro",value:"passaro"},domProps:{checked:Array.isArray(e.newsletter.pet.species)?e._i(e.newsletter.pet.species,"passaro")>-1:e.newsletter.pet.species},on:{change:function(t){var n=e.newsletter.pet.species,s=t.target,i=!!s.checked;if(Array.isArray(n)){var r=e._i(n,"passaro");s.checked?r<0&&e.$set(e.newsletter.pet,"species",n.concat(["passaro"])):r>-1&&e.$set(e.newsletter.pet,"species",n.slice(0,r).concat(n.slice(r+1)))}else e.$set(e.newsletter.pet,"species",i)}}}),n("span",{staticClass:"icon-passaros icon-md"})]),e._v(" "),n("label",{staticClass:"radio-button-item",attrs:{for:"peixe"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.newsletter.pet.species,expression:"newsletter.pet.species"}],attrs:{type:"checkbox",id:"peixe",value:"peixe"},domProps:{checked:Array.isArray(e.newsletter.pet.species)?e._i(e.newsletter.pet.species,"peixe")>-1:e.newsletter.pet.species},on:{change:function(t){var n=e.newsletter.pet.species,s=t.target,i=!!s.checked;if(Array.isArray(n)){var r=e._i(n,"peixe");s.checked?r<0&&e.$set(e.newsletter.pet,"species",n.concat(["peixe"])):r>-1&&e.$set(e.newsletter.pet,"species",n.slice(0,r).concat(n.slice(r+1)))}else e.$set(e.newsletter.pet,"species",i)}}}),n("span",{staticClass:"icon-peixes icon-md"})]),e._v(" "),n("label",{staticClass:"radio-button-item",attrs:{for:"roedor"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.newsletter.pet.species,expression:"newsletter.pet.species"}],attrs:{type:"checkbox",id:"roedor",value:"roedor"},domProps:{checked:Array.isArray(e.newsletter.pet.species)?e._i(e.newsletter.pet.species,"roedor")>-1:e.newsletter.pet.species},on:{change:function(t){var n=e.newsletter.pet.species,s=t.target,i=!!s.checked;if(Array.isArray(n)){var r=e._i(n,"roedor");s.checked?r<0&&e.$set(e.newsletter.pet,"species",n.concat(["roedor"])):r>-1&&e.$set(e.newsletter.pet,"species",n.slice(0,r).concat(n.slice(r+1)))}else e.$set(e.newsletter.pet,"species",i)}}}),n("span",{staticClass:"icon-roedores icon-md"})]),e._v(" "),n("label",{staticClass:"radio-button-item",attrs:{for:"reptil"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.newsletter.pet.species,expression:"newsletter.pet.species"}],attrs:{type:"checkbox",id:"reptil",value:"reptil"},domProps:{checked:Array.isArray(e.newsletter.pet.species)?e._i(e.newsletter.pet.species,"reptil")>-1:e.newsletter.pet.species},on:{change:function(t){var n=e.newsletter.pet.species,s=t.target,i=!!s.checked;if(Array.isArray(n)){var r=e._i(n,"reptil");s.checked?r<0&&e.$set(e.newsletter.pet,"species",n.concat(["reptil"])):r>-1&&e.$set(e.newsletter.pet,"species",n.slice(0,r).concat(n.slice(r+1)))}else e.$set(e.newsletter.pet,"species",i)}}}),n("span",{staticClass:"icon-repteis icon-md last-item"})])]),e._v(" "),n("button",{staticClass:"button btn-pink full-width md",attrs:{type:"submit",disabled:!e.newsletter.email||0==e.newsletter.pet.species.length}},[e._v("\n                "+e._s(e.submitButton.text)+"\n              ")]),e._v(" "),n("label",{staticClass:"newsletter-checkbox",attrs:{for:"option"}},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.newsletter.option,expression:"newsletter.option"}],attrs:{id:"option",type:"checkbox",name:"option",checked:""},domProps:{checked:Array.isArray(e.newsletter.option)?e._i(e.newsletter.option,null)>-1:e.newsletter.option},on:{change:function(t){var n=e.newsletter.option,s=t.target,i=!!s.checked;if(Array.isArray(n)){var r=e._i(n,null);s.checked?r<0&&e.$set(e.newsletter,"option",n.concat([null])):r>-1&&e.$set(e.newsletter,"option",n.slice(0,r).concat(n.slice(r+1)))}else e.$set(e.newsletter,"option",i)}}}),e._v(" "),n("div",{staticClass:"text-option"},[e._v("Quero receber dicas e ofertas exclusivas. Respeitamos sua privacidade, "),n("a",{attrs:{href:"/empresa/politica-privacidade",target:"_blank",rel:"noopener"}},[e._v(" confira nossa política.")])])])])]),e._v(" "),e.submitCompleted?n("div",[n("div",{staticClass:"newsletter-title"},[e._v("Bem vindos")]),e._v(" "),n("div",{staticClass:"newsletter-subtitle"},[e._v("à matilha petlove")]),e._v(" "),n("div",{staticClass:"newsletter-text"},[e._v(" Use o cupom no carrinho e ganhe 10% OFF na sua primeira compra\n            ")]),e._v(" "),n("div",{staticClass:"box-dashed full-width"},[e._v("\n              BOASVINDAS\n            ")]),e._v(" "),e.addCoupon?e._e():n("div",[n("button",{staticClass:"button btn-pink full-width md",attrs:{type:"button"},on:{click:e.applyCoupon}},[e._v("aplicar cupom")])]),e._v(" "),e.addCoupon?n("div",{staticClass:"text-center"},[n("div",{staticClass:"title"},[e._v("\n                Desconto aplicado com sucesso!\n              ")]),e._v(" "),n("div",[e._v("\n                seu desconto será calculado no carrinho\n              ")])]):e._e()]):e._e()]),e._v(" "),n("div",{staticClass:"col-5 newsletter-banner"},[n("img",{attrs:{src:"https://www.petlove.com.br/static/uploads/banner_image/image/2356/display_lightbox_newsletter.png",alt:"Newsletter Banner"}})])])])])])},[],!1,null,null,null);t.default=o.exports}}]);