1"use strict";(self.webpackChunkb2c_checkout=self.webpackChunkb2c_checkout||[]).push([[890],{31100:function(e,t,n){n.d(t,{i:function(){return l}});var r=n(1413),i=n(44925),o=n(34578),s=n(46417),a=["visible","onClick","color"],l=function(e){var t=e.visible,n=e.onClick,l=e.color,c=(0,i.Z)(e,a);return(0,s.jsx)(o.hU,(0,r.Z)((0,r.Z)({},c),{},{variant:"unstyled",onClick:n,"aria-label":t?"Hide Password":"Show Password",icon:t?(0,s.jsx)(o.Jib,{color:l}):(0,s.jsx)(o.I5h,{color:l})}))}},23890:function(e,t,n){n.r(t),n.d(t,{TemplateIdentification:function(){return H},default:function(){return R}});var r=n(74165),i=n(15861),o=n(29439),s=n(99259),a=n(44925),l=n(1413),c=n(31100),u=n(97158),p=(n(92842),n(26689)),d=n(42199),f=n(56573),m=n(84656),g=n(63980),h=function(e){if(Array.isArray(e))return"string"===typeof e[0]?e[0]:void 0},v=function(e,t,n){return d.Tb(e,{level:"warning",tags:{escopo:"login",reason:t,fluxo:"login"},extra:{status:n}})},x=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t){var n,i,o,s,a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m.M.post("/canais/login",(0,g.D2)(t),{headers:t.captchaToken?{"captcha-token":t.captchaToken}:void 0});case 3:return n=e.sent,(0,p.Ue)((0,g.yw)(n.data)),e.abrupt("return",[!0,null]);case 8:if(e.prev=8,e.t0=e.catch(0),f.Z.isAxiosError(e.t0)){e.next=13;break}return v(e.t0,"falha_apos_resposta"),e.abrupt("return",[null,{message:void 0,status:void 0}]);case 13:return s=null===(i=e.t0.response)||void 0===i?void 0:i.status,(a=h(null===(o=e.t0.response)||void 0===o?void 0:o.data))||v(e.t0,"sem_resposta_da_api",s),e.abrupt("return",[null,{message:a,status:s}]);case 17:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(t){return e.apply(this,arguments)}}(),b=n(85115),w=n(34578),k=n(30831),j=n(49517),y=n(47397),Z=n.n(y),C=n(47313),I=n(75627),S=n(75590),A=n(71570),F=n(46417),T=["ref"],_=function(e){var t,n,s=e.onLogin,p=(0,S.$G)().t,f=(0,w.l0L)(),m=Z().object({identity:Z().string().required().messages({"string.empty":p("components.loginForm.requiredData")}),password:Z().string().required().messages({"string.empty":p("components.loginForm.requiredPassword")})}),g=(0,C.useState)(!1),h=(0,o.Z)(g,2),v=h[0],y=h[1],_=(0,I.cI)({resolver:(0,k.L)(m)}),O=_.register,P=_.handleSubmit,E=_.formState,V=E.errors,L=E.isSubmitting,W=(0,w.qY0)(),U=W.isOpen,q=W.onClose,z=W.onOpen,B=(0,u.d)().isEnableFeatureFlag,J=(0,C.useRef)(null),M=(0,C.useState)(null),D=(0,o.Z)(M,2),N=D[0],H=D[1],R=(0,C.useState)(null),X=(0,o.Z)(R,2),G=X[0],K=X[1],$=(0,C.useState)(!1),Y=(0,o.Z)($,2),Q=Y[0],ee=Y[1],te=(0,C.useState)(!1),ne=(0,o.Z)(te,2),re=ne[0],ie=ne[1];(0,C.useEffect)((function(){var e=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B(b.Nr.CLOUDFLARE_TURNSTILE);case 2:t=e.sent,K(!t||t.situacao===b.Bv.ATIVO);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]);var oe=!re&&(null===G||!0===G&&!N&&!Q),se=function(){var e;null===(e=J.current)||void 0===e||e.reset(),H(null),ee(!1)},ae=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(t){var n,i,a,c;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!G||N){e.next=3;break}return f({status:"error",description:p(re?"components.loginForm.captchaUnavailable":"components.loginForm.captchaRequired")}),e.abrupt("return");case 3:return e.next=5,x((0,l.Z)((0,l.Z)({},t),{},{captchaToken:G?N:void 0}));case 5:if(n=e.sent,i=(0,o.Z)(n,2),a=i[0],c=i[1],!a){e.next=11;break}return e.abrupt("return",s());case 11:if(G&&se(),429!==c.status){e.next=15;break}return f({status:"error",description:"Tente novamente mais tarde."}),e.abrupt("return");case 15:f({status:"error",description:c.message||p("components.loginForm.genericError")});case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),le=O("password"),ce=le.ref,ue=(0,a.Z)(le,T);return(0,F.jsxs)(w.kCb,{flexDirection:"column",alignItems:"flex-start",color:"neutral.600",w:"full",children:[(0,F.jsx)(A.q,{isOpen:U,onClose:q}),(0,F.jsxs)(w.gCW,{as:"form",spacing:"6",w:"full",onSubmit:P(ae),children:[(0,F.jsx)(w.Icd,(0,l.Z)((0,l.Z)({},O("identity")),{},{name:"identity",type:"text",label:p("components.loginForm.emailOrDocument"),placeholder:p("components.loginForm.typeEmailOrDocument"),inputProps:{height:14},formLabelProps:{fontSize:"sm",fontWeight:"normal",mb:1},errorMessage:null===V||void 0===V||null===(t=V.identity)||void 0===t?void 0:t.message,isInvalid:Boolean(null===V||void 0===V?void 0:V.identity),isDisabled:L,"data-testid":"login-identity-input"})),(0,F.jsxs)(w.gCW,{w:"full",spacing:"2",children:[(0,F.jsx)(w.Icd,(0,l.Z)((0,l.Z)({},ue),{},{ref:function(e){ce(e),e&&e.setAttribute("autoComplete","new-password")},name:"password",type:v?"text":"password",label:p("components.loginForm.password"),placeholder:p("components.loginForm.typePassword"),inputProps:{height:14},formLabelProps:{fontSize:"sm",fontWeight:"normal",mb:1},errorMessage:null===V||void 0===V||null===(n=V.password)||void 0===n?void 0:n.message,isInvalid:Boolean(null===V||void 0===V?void 0:V.password),isDisabled:L,rightElement:(0,F.jsx)(c.i,{onClick:function(){return y(!v)},visible:v,color:"neutral.500"}),"data-testid":"login-password-input"})),(0,F.jsx)(w.kCb,{w:"full",justifyContent:"flex-end",children:(0,F.jsx)(w.rUS,{color:"primary.500",fontSize:"sm",onClick:z,"data-testid":"forgot-password-link",children:p("components.loginForm.forgotPassword")})})]}),G&&(0,F.jsx)(w.kCb,{w:"full",mt:Q?"6":"0 !important",justifyContent:"center",children:(0,F.jsx)(j.Nc,{ref:J,siteKey:"0x4AAAAAAEBDGagnGRTP0hOt",options:{action:"login",appearance:"interaction-only"},onBeforeInteractive:function(){return ee(!0)},onSuccess:function(e){H(e),ie(!1)},onExpire:function(){return H(null)},onError:function(){H(null),ie(!0),d.uT("Turnstile: falha ao carregar o widget",{level:"error",tags:{escopo:"captcha",reason:"widget_error",fluxo:"login"}})}})}),(0,F.jsx)(w.Jiv,{label:p("components.loginForm.login"),isLoading:L||oe,loadingText:p("components.loginForm.logingIn"),variant:"success",color:"white",type:"submit",h:"54px",w:"full","data-testid":"login-submit-button"})]})]})},O=function(e){var t=e.visible,n=e.onAccept,r=e.isSubmitting,i=(0,S.$G)().t;return(0,F.jsxs)(w.u_l,{isOpen:t,onClose:n,closeOnOverlayClick:!1,isCentered:!0,children:[(0,F.jsx)(w.ZAr,{blur:!0}),(0,F.jsxs)(w.hzk,{p:"2rem",w:["19rem","22rem"],textAlign:"center",h:"25rem",children:[(0,F.jsx)(w.xBx,{p:"0",mb:"1.25rem",children:(0,F.jsx)(w.xvT,{color:"neutral.700",children:i("components.modalPrivacyPolicy.updateOurPrivacy")})}),(0,F.jsxs)(w.fef,{p:"0",color:"neutral.600",children:[(0,F.jsx)(w.xvT,{mb:"1rem",children:i("components.modalPrivacyPolicy.ourCompromise")}),(0,F.jsxs)(w.xvT,{children:[i("components.modalPrivacyPolicy.weInform")," ",(0,F.jsx)(w.rUS,{href:"https://www.gazin.com.br/pagina/privacidade",color:"primary.500",textDecoration:"underline",target:"_blank",rel:"noreferrer",children:i("components.modalPrivacyPolicy.policyPrivacy")})]})]}),(0,F.jsx)(w.mzw,{p:"0",mt:"0.5rem",children:(0,F.jsx)(w.Jiv,{label:"Ok, ciente",w:"100%",h:"3.375rem",onClick:n,isLoading:r})})]})]})},P=function(){return(0,F.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,F.jsx)("path",{d:"M17.64 9.205c0-.639-.057-1.252-.164-1.841H9v3.481h4.844a4.14 4.14 0 0 1-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615Z",fill:"#4285F4"}),(0,F.jsx)("path",{d:"M9 18c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H.957v2.332A8.997 8.997 0 0 0 9 18Z",fill:"#34A853"}),(0,F.jsx)("path",{d:"M3.964 10.71A5.41 5.41 0 0 1 3.682 9c0-.593.102-1.17.282-1.71V4.958H.957A8.99
16 8.996 0 0 0 0 9c0 1.452.348 2.827.957 4.042l3.007-2.332Z",fill:"#FBBC05"}),(0,F.jsx)("path",{d:"M9 3.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C13.463.891 11.426 0 9 0A8.997 8.997 0 0 0 .957 4.958L3.964 7.29C4.672 5.163 6.656 3.58 9 3.58Z",fill:"#EA4335"})]})},E=function(){return(0,F.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,F.jsx)("path",{d:"M18 9a9 9 0 1 0-10.406 8.892V11.59H5.311V9h2.283V7.017c0-2.252 1.342-3.498 3.398-3.498.984 0 2.014.176 2.014.176v2.21h-1.134c-1.118 0-1.467.693-1.467 1.404V9h2.496l-.399 2.59h-2.097v6.302A9.003 9.003 0 0 0 18 9Z",fill:"#1877F2"}),(0,F.jsx)("path",{d:"M12.502 11.59 12.9 9h-2.496V7.309c0-.711.349-1.404 1.467-1.404h1.134v-2.21s-1.03-.176-2.014-.176c-2.056 0-3.398 1.246-3.398 3.498V9H5.311v2.59h2.282v6.302a9.064 9.064 0 0 0 2.813 0V11.59h2.096Z",fill:"#fff"})]})},V=n(99797),L=n(72818),W=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,m.K.put("canais/consumidores/data-aceite-politica-privacidade");case 3:return e.abrupt("return",[!0,null]);case 6:return e.prev=6,e.t0=e.catch(0),e.abrupt("return",[null,e.t0]);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),U=n(39307),q=n(46978),z=n(25567),B=n(41813),J=n(64081),M=n(59353),D=n(58467),N=n(2135),H=function(){var e=(0,w.qY0)(),t=e.isOpen,n=e.onOpen,a=e.onClose,l=(0,C.useState)(!1),c=(0,o.Z)(l,2),d=c[0],f=c[1],m=(0,D.s0)(),g=(0,S.$G)().t,h=(0,w.l0L)(),v=(0,V.i)(),x=v.fetchCart,k=v.clearShipping,j=(0,p.cq)(),y=(0,L.x)().eventAnalyticOnCheckoutOption,Z=(0,N.lr)(),I=(0,o.Z)(Z,1)[0],A=(0,D.TH)().state,T=(0,C.useState)((function(){return(0,M.S)(I,null===A||void 0===A?void 0:A.returnUrl)})),H=(0,o.Z)(T,1)[0],R=(0,u.y)().isEnableFeatureFlag;document.title=g("templates.identification.title");var X="cart"===I.get("from"),G="true"===I.get("isCompra"),K=!!X||!!G||!0===(null===A||void 0===A?void 0:A.isCheckoutFlow),$=function(e){return h({status:"error",description:e.message||e}),m(J.X.identification)},Y=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,i,s,a,l,c;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(0,p.cq)(),!(i=(0,z.WJ)(B.b.cart))){e.next=11;break}return e.next=5,(0,U.Ii)(i);case 5:if(s=e.sent,a=(0,o.Z)(s,2),a[0],!(l=a[1])){e.next=11;break}return e.abrupt("return",$(l));case 11:return e.next=13,R(b.Nr.EMAIL_VERIFICATION);case 13:if(c=e.sent,!((null===c||void 0===c?void 0:c.situacao)===b.Bv.ATIVO)||!t||t.emailVerified){e.next=19;break}return sessionStorage.setItem("pending_credential",JSON.stringify(t)),(0,z.xf)(B.b.user),e.abrupt("return",m(J.X.emailVerification,{state:{isCheckoutFlow:K,returnUrl:H,origin:"login"}}));case 19:if(K){e.next=22;break}return window.location.href=H,e.abrupt("return");case 22:if(null===t||void 0===t||!t.privacyPolicyAcceptance){e.next=24;break}return e.abrupt("return",m(J.X.shipping,{state:{isCheckoutFlow:K}}));case 24:n();case 25:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Q=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,n,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a(),f(!0),e.next=4,W();case 4:if(t=e.sent,n=(0,o.Z)(t,2),n[0],i=n[1],f(!1),!i){e.next=11;break}return e.abrupt("return",$(i));case 11:if((0,z.WJ)(B.b.cart)){e.next=14;break}return window.location.href=H,e.abrupt("return");case 14:return e.abrupt("return",m(J.X.shipping,{state:{isCheckoutFlow:K}}));case 15:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var t,n,i;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=(0,p.cq)(),e.next=3,x();case 3:return y("login","Logado"),e.next=6,R(b.Nr.EMAIL_VERIFICATION);case 6:if(n=e.sent,!((null===n||void 0===n?void 0:n.situacao)===b.Bv.ATIVO)||!t||t.emailVerified){e.next=12;break}return sessionStorage.setItem("pending_credential",JSON.stringify(t)),(0,z.xf)(B.b.user),e.abrupt("return",m(J.X.emailVerification,{state:{isCheckoutFlow:K,returnUrl:H,origin:"login"}}));case 12:if(i=sessionStorage.getItem("social_return_url"),sessionStorage.removeItem("social_return_url"),K){e.next=17;break}return window.location.href=null!==i&&void 0!==i?i:H,e.abrupt("return");case 17:m(J.X.shipping,{state:{isCheckoutFlow:K}});case 18:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,C.useEffect)((function(){k(),j&&ee()}),[]),d?(0,F.jsx)(s.a,{}):(0,F.jsxs)(w.W20,{maxW:"container.sm",px:{base:4,md:8},children:[(0,F.jsx)(O,{visible:t,onAccept:Q,isSubmitting:d}),(0,F.jsxs)(w.gCW,{spacing:"8",alignItems:"center",py:{base:8,md:16},maxW:"468px",mx:"auto",children:[(0,F.jsxs)(w.gCW,{spacing:"2",alignItems:"center",textAlign:"center",children:[(0,F.jsx)(w.xvT,{fontSize:"20px",fontWeight:"700",lineHeight:"24px",color:"neutral.800",children:g("templates.identification.loginTitle")}),(0,F.jsx)(w.xvT,{fontSize:"16px",fontWeight:"400",lineHeight:"1.2",color:"neutral.600",children:g("templates.identification.loginSubtitle")})]}),(0,F.jsx)(_,{onLogin:Y}),(0,F.jsxs)(w.xvT,{textAlign:"center",fontSize:"sm",children:[(0,F.jsxs)(w.xvT,{as:"span",color:"neutral.700",children:[g("templates.identification.noAccount")," "]}),(0,F.jsx)(w.rUS,{color:"primary.500",fontWeight:"700",onClick:function(){return m(J.X.signUp,{state:{isCheckoutFlow:K,returnUrl:H}})},"data-testid":"register-link",children:g("templates.identification.registerNow")})]}),(0,F.jsxs)(w.Kqy,{direction:"row",alignItems:"center",w:"full",spacing:"4",children:[(0,F.jsx)(w.izJ,{}),(0,F.jsx)(w.xvT,{fontSize:"md",color:"neutral.600",whiteSpace:"nowrap",children:"ou"}),(0,F.jsx)(w.izJ,{})]}),(0,F.jsxs)(w.gCW,{w:"full",spacing:"4",children:[(0,F.jsx)(w.Jiv,{label:"Iniciar sess\xe3o com Google",variantType:"solid",bg:"neutral.50",color:"neutral.600",_hover:{bg:"#e8e8ed"},leftIcon:(0,F.jsx)(P,{}),h:"12",w:"full",onClick:function(){sessionStorage.setItem("social_return_url",H),(0,q.fI)("google",K?"cart":"navigation")}}),(0,F.jsx)(w.Jiv,{label:"Iniciar sess\xe3o com Facebook",variantType:"solid",bg:"neutral.50",color:"neutral.600",_hover:{bg:"#e8e8ed"},leftIcon:(0,F.jsx)(E,{}),h:"12",w:"full",onClick:function(){sessionStorage.setItem("social_return_url",H),(0,q.fI)("facebook",K?"cart":"navigation")}})]})]})]})},R=H}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.