1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[749],{78567:function(e,n,t){"use strict";n.g=void 0;var r=t(97582),a=t(67294),o=t(88767),i=t(19973),s=t(76001),c=t(44458);n.g=function(e){var n=(0,c.useSiteContext)(),t=(0,s.iamManagerPasswordApi)(n.account.id),u=t.endpoint,d=t.createVerify,l=(0,o.useQueryClient)(),p=(0,a.useMemo)((function(){return[i.IAM_MANAGER_SERVICE,u]}),[u]),f=(0,a.useCallback)((function(e){return d(e)}),[d]),h=(0,o.useMutation)(p,f,r.__assign(r.__assign({},e),{onSuccess:function(n,t,r){var a;l.invalidateQueries(p),null===(a=null===e||void 0===e?void 0:e.onSuccess)||void 0===a||a.call(e,n,t,r)}}));return h}},17996:function(e,n,t){"use strict";n.N=void 0;var r=t(97582),a=t(67294),o=t(88767),i=t(19973),s=t(76001),c=t(44458);n.N=function(e){var n=(0,c.useSiteContext)(),t=(0,s.iamManagerPasswordApi)(n.account.id),u=t.endpoint,d=t.createRequest,l=(0,o.useQueryClient)(),p=(0,a.useMemo)((function(){return[i.IAM_MANAGER_SERVICE,u]}),[u]),f=(0,a.useCallback)((function(e){return r.__awaiter(void 0,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,d(r.__assign(r.__assign({},e),{account:{id:n.account.id}}))];case 1:return t.sent(),[2,!0];case 2:return t.sent(),[2,!1];case 3:return[2]}}
1))}))}),[d,n.account.id]),h=(0,o.useMutation)(p,f,r.__assign(r.__assign({},e),{onSuccess:function(n,t,r){var a;l.invalidateQueries(p),null===(a=null===e||void 0===e?void 0:e.onSuccess)||void 0===a||a.call(e,n,t,r)}}));return h}},66081:function(e,n,t){"use strict";n.H=void 0;var r=t(97582),a=t(67294),o=t(88767),i=t(19973),s=t(76001),c=t(44458);n.H=function(e){var n=(0,c.useSiteContext)(),t=(0,s.iamManagerPasswordApi)(n.account.id),u=t.endpoint,d=t.createResend,l=(0,o.useQueryClient)(),p=(0,a.useMemo)((function(){return[i.IAM_MANAGER_SERVICE,u]}),[u]),f=(0,a.useCallback)((function(e){return r.__awaiter(void 0,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,d(r.__assign(r.__assign({},e),{account:{id:n.account.id}}))];case 1:return t.sent(),[2,!0];case 2:return t.sent(),[2,!1];case 3:return[2]}}))}))}),[d,n.account.id]),h=(0,o.useMutation)(p,f,r.__assign(r.__assign({},e),{onSuccess:function(n,t,r){var a;l.invalidateQueries(p),null===(a=null===e||void 0===e?void 0:e.onSuccess)||void 0===a||a.call(e,n,t,r)}}));return h}},11285:function(e,n,t){"use strict";n.H=void 0;var r=t(97582),a=t(67294),o=t(88767),i=t(44458),s=t(47041),c=t(18513),u={email:"EMAIL",documentNumber:"DOCUMENT_NUMBER"};n.H=function(e,n){var t,d=void 0===e?{}:e,l=d.keyProp,p=d.valueProp,f=(0,i.useSiteContext)(),h=(0,a.useMemo)((function(){var e,n;return null!==(n=null===(e=(0,s.getCookie)("email"))||void 0===e?void 0:e.toString().trim())&&void 0!==n?n:""}),[]),v=(0,a.useMemo)((function(){var e,n;return null!==(n=null===(e=(0,s.getCookie)("documentNumber"))||void 0===e?void 0:e.toString().trim())&&void 0!==n?n:""}),[]),_=l||(v?"documentNumber":"email"),m=u[_],g=p||v||h,w=(0,c.iamManagerUserApi)(f.account.id),x=w.endpoint,b=w.getHasPassword,C=(0,a.useMemo)((function(){return[x,"has-password",_,g]}),[x,_,g]),k=(0,a.useCallback)((function(){return b(m,g)}),[b,m,g]),E=!!(null===(t=null===f||void 0===f?void 0:f.account)||void 0===t?void 0:t.id)&&!!g&&!!m,j=!p;return(0,o.useQuery)(C,k,r.__assign(r.__assign({},n),{enabled:E,onError:function(e){var t,r;j&&404===(null===(t=null===e||void 0===e?void 0:e.response)||void 0===t?void 0:t.status)&&((0,s.removeCookies)("email"),(0,s.removeCookies)("documentNumber")),null===(r=null===n||void 0===n?void 0:n.onError)||void 0===r||r.call(n,e)}}))}},50878:function(e,n,t){"use strict";var r=t(97582),a=t(85893),o=t(72371),i=t(87753),s=t(2909),c=r.__importDefault(t(49586)),u=t(91013);n.ZP=function(e){return(0,a.jsx)(a.Fragment,{children:e.children})}},76001:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.iamManagerPasswordApi=void 0;var r=t(97582),a=t(19973);n.iamManagerPasswordApi=function(e,n,t){var o="password",i=(0,a.iamManagerApi)(e,n,t);return{endpoint:o,createRequest:function(n){return r.__awaiter(void 0,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return[4,i.post("".concat(o,"/request"),n,{headers:{"1eg-Account-id":e,"1eg-User-RoleType":"CUSTOMER"}})];case 1:return[2,t.sent().data]}}))}))},createVerify:function(e){return r.__awaiter(void 0,void 0,void 0,(function(){return r.__generator(this,(function(n){switch(n.label){case 0:return[4,i.post("".concat(o,"/verify"),e,{headers:{"1eg-User-RoleType":"CUSTOMER"}})];case 1:return[2,n.sent().data]}}))}))},createResend:function(e){return r.__awaiter(void 0,void 0,void 0,(function(){return r.__generator(this,(function(n){switch(n.label){case 0:return[4,i.post("".concat(o,"/resend"),e)];case 1:return[2,n.sent().data]}}))}))}}}},18513:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.iamManagerUserApi=void 0;var r=t(97582),a=t(19973);n.iamManagerUserApi=function(e,n,t){var o="user",i=(0,a.iamManagerApi)(e,n,t);return{endpoint:o,getStatus:function(e){return r.__awaiter(void 0,void 0,void 0,(function(){return r.__generator(this,(function(n){switch(n.label){case 0:return[4,i.get("/".concat(o,"/status"),{params:e})];case 1:return[2,n.sent().data]}}))}))},getHasPassword:function(e,n){return r.__awaiter(void 0,void 0,void 0,(function(){return r.__generator(this,(function(t){switch(t.label){case 0:return[4,i.get("/".concat(o,"/").concat(e,"/").concat(n,"/has-password"))];case 1:return[2,t.sent().data]}}))}))}}}},37662:function(e,n){"use strict";n.J=void 0,n.J="403.passwordResetRequiredException"},24079:function(e,n){"use strict";n.Y=void 0,function(e){e.MANAGER="MANAGER",e.CUSTOMER="CUSTOMER"}(n.Y||(n.Y={}))},61830:function(e,n,t){"use strict";var r,a=t(67294);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o.apply(null,arguments)}n.Z=function(e){return a.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:17.816,height:11.878},e),r||(r=a.createElement("path",{"data-name":"Icon awesome-eye",d:"M17.709 5.487A9.921 9.921 0 008.908 0a9.922 9.922 0 00-8.8 5.488 1 1 0 000 .9 9.921 9.921 0 008.8 5.487 9.922 9.922 0 008.8-5.488 1 1 0 00.001-.9zm-8.8 4.906a4.454 4.454 0 114.454-4.454 4.454 4.454 0 01-4.455 4.454zm0-7.424a2.948 2.948 0 00-.783.117 1.48 1.48 0 01-2.07 2.07 2.963 2.963 0 102.852-2.187z"})))}},17338:function(e,n,t){"use strict";var r,a=t(67294);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o.apply(null,arguments)}n.Z=function(e){return a.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:18.816,height:15.053},e),r||(r=a.createElement("path",{"data-name":"Icon awesome-eye-slash",d:"M9.408 11.76a4.218 4.218 0 01-4.2-3.913L2.123 5.463A9.8 9.8 0 001.043 7.1a.951.951 0 000 .858 9.43 9.43 0 008.365 5.216 9.132 9.132 0 002.29-.308l-1.526-1.18a4.237 4.237 0 01-.764.077zm9.226 1.708l-3.25-2.512a9.739 9.739 0 002.389-3 .951.951 0 000-.858 9.43 9.43 0 00-8.365-5.217A9.06 9.06 0 005.077 2.99L1.337.1a.47.47 0 00-.66.083L.1.925a.47.47 0 00.083.66l17.3 13.369a.47.47 0 00.66-.083l.577-.743a.47.47 0 00-.083-.66zm-5.4-4.175L12.078 8.4a2.786 2.786 0 00-3.414-3.585 1.4 1.4 0 01.274.829 1.371 1.371 0 01-.045.294L6.728 4.266a4.184 4.184 0 012.68-.973 4.231 4.231 0 014.234 4.234 4.133 4.133 0 01-.409 1.767z",fill:"rgba(0,0,0,0.5)"})))}},10625:function(e,n,t){"use strict";var r,a=t(67294);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o.apply(null,arguments)}n.Z=function(e){return a.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:13.733,height:15.037},e),r||(r=a.createElement("g",{"data-name":"Icon feather-lock",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2},a.createElement("path",{"data-name":"Caminho 411",d:"M2.3 6.867h9.13a1.3 1.3 0 011.3 1.3v4.563a1.3 1.3 0 01-1.3 1.3H2.3a1.3 1.3 0 01-1.3-1.3V8.167a1.3 1.3 0 011.3-1.3z"}),a.createElement("path",{"data-name":"Caminho 412",d:"M3.607 6.867V4.259a3.26 3.26 0 016.519 0v2.608"}))))}},53643:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/AuthLogin",function(){return t(69808)}])},23981:function(e,n,t){"use strict";t.d(n,{C:function(){return p}});var r=t(26042),a=t(69396),o=t(85893),i=t(67294),s=t(61830),c=t(17338),u=t(94862),d=t(13852),l=t.n(d),p=function(e){var n=(0,i.useState)(!1),t=n[0],d=n[1],p=(0,i.useMemo)((function(){return t?"text":"password"}),[t]);return(0,o.jsx)("div",{className:l()["input-password"],children:(0,o.jsx)(u.q,(0,a.Z)((0,r.Z)({},e),{type:p,rightContent:(0,o.jsx)("div",{className:l()["input-password__icon"],onClick:function(){return d(!t)},children:t?(0,o.jsx)(s.Z,{}):(0,o.jsx)(c.Z,{})})}))})}},69808:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return Ae},default:function(){return Ne}});
1var r,a=t(47568),o=t(26042),s=t(69396),c=t(34051),u=t.n(c),d=t(85893),l=t(20270),p=t(69775),f=t(50878),h=t(67294);function v(){return v=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},v.apply(null,arguments)}var _=function(e){return h.createElement("svg",v({xmlns:"http://www.w3.org/2000/svg",width:13,height:13.828},e),r||(r=h.createElement("g",{"data-name":"Icon feather-arrow-left",fill:"none",stroke:"rgba(0,0,0,0.4)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2},h.createElement("path",{"data-name":"Caminho 450",d:"M12 6.914H1"}),h.createElement("path",{"data-name":"Caminho 451",d:"M6.5 12.414L1 6.914l5.5-5.5"}))))},m=t(10625),g=t(40771),w=t(1246),x=t(30251),b=t(23981),C=t(94862),k=t(18431),E=t(99534),j=t(17996),S=t(24079),A=t(10253),N=t(39474),y=t(13375),O=t(53128),P=t(91566);var M=t(29815),L=function(e){var n=(0,A.Z)(e.split("@"),2),t=n[0],r=n[1];t=t.substring(0,1)+Array.from({length:t.length-2}).map((function(){return"*"})).join("")+t.slice(-1);var a,o=(a=r.split("."),(0,N.Z)(a)||(0,y.Z)(a)||(0,P.Z)(a,i)||(0,O.Z)()),s=o[0],c=o.slice(1);return[t,r=[s=s.substring(0,1)+Array.from({length:s.length-2}).map((function(){return"*"})).join("")+s.slice(-1)].concat((0,M.Z)(c)).join(".")].join("@")},Z=t(2053),R=t(43457),T=t.n(R),U=function(e){var n=e.login,t=e.email,r=e.nextStep,o=(0,h.useState)(""),i=o[0],s=o[1],c=(0,h.useState)(""),l=c[0],p=c[1],f=(0,Z.t)().formActions,v=(0,x.n)().alertActions,_=(0,j.N)(),m=_.mutateAsync,w=_.isLoading,C=function(){var e=(0,a.Z)(u().mark((function e(){var a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!f.validate([{id:"password-recovery",value:i,validate:function(e){if(!e)throw new Error("Nova senha obrigat\xf3ria");if(e.length<=5)throw new Error("A senha deve ter no m\xednimo 6 caracteres")}},{id:"password-confirm",value:l,validate:function(e){if(!e)throw new Error("Confirma\xe7\xe3o de senha obrigat\xf3ria");if(e.length<=5)throw new Error("A senha deve ter no m\xednimo 6 caracteres");if(e!==i)throw new Error("As senhas n\xe3o conferem")}}])){e.next=16;break}return e.prev=1,e.next=4,m({email:t,password:i,roleType:S.Y.CUSTOMER});case 4:if(e.sent){e.next=8;break}return v.createOrUpdateOne("Ops! Infelizmente, algo deu errado. Tente novamente mais tarde.","error"),e.abrupt("return");case 8:a=t,t!==n&&(a=L(t)),v.createOrUpdateOne("Enviamos o c\xf3digo para o email cadastrado: ".concat(a,". Siga as instru\xe7\xf5es para alterar a sua senha."),"success"),r(),e.next=16;break;case 14:e.prev=14,e.t0=e.catch(1);case 16:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(){return e.apply(this,arguments)}}(),k=(0,h.useCallback)((function(e){if("Enter"===e.key)return C()}),[C]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:T()["first-step__input"],children:(0,d.jsx)(b.C,{id:"password-recovery",onKeyUp:k,value:i,onChange:function(e){return s(e)},placeholder:"Nova senha"})}),(0,d.jsx)("div",{className:T()["first-step__input"],children:(0,d.jsx)(b.C,{id:"password-confirm",onKeyUp:k,value:l,onChange:function(e){return p(e)},placeholder:"Confirme sua nova senha"})}),(0,d.jsx)("div",{className:T()["first-step__button"],children:(0,d.jsx)(g.J,{isLoading:w,onClick:C,rounded:!0,children:"CADASTRAR MINHA SENHA"})})]})},I=t(40081),F=t.n(I),V=t(78567),D=t(66081),q=t(3199),z=t.n(q),H=function(e){var n=e.backToLogin,t=e.email,r=e.login,o=(0,x.n)().alertActions,i=(0,Z.t)().formActions,s=(0,V.g)(),c=s.mutateAsync,l=s.isLoading,p=(0,D.H)(),f=p.mutateAsync,v=p.isLoading,_=(0,h.useState)(""),m=_[0],w=_[1],b=(0,h.useCallback)((0,a.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!i.validate([{id:"code",value:m,validate:function(e){if(!e)throw new Error("Campo obrigat\xf3rio")}}])){e.next=6;break}return e.next=4,c({email:t,verificationCode:m});case 4:o.createOrUpdateOne("Nova senha alterada com sucesso.","success"),n();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),o.createOrUpdateOne("Erro ao confirmar a senha. Tente novamente!","error");case 11:case"end":return e.stop()}}),e,null,[[0,8]])}))),[m,c,n]),E=(0,h.useCallback)((0,a.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f({email:t,roleType:S.Y.CUSTOMER});case 2:if(e.sent){e.next=6;break}return o.createOrUpdateOne("Erro ao reenviar a notifica\xe7\xe3o de recupera\xe7\xe3o de senha. Tente novamente!","error"),e.abrupt("return");case 6:o.createOrUpdateOne("Notifica\xe7\xe3o de recupera\xe7\xe3o de senha reenviada com sucesso.","success");case 7:case"end":return e.stop()}}),e)}))),[]),j=(0,h.useCallback)((function(e){if("Enter"===e.key)return b()}),[b]);return(0,d.jsxs)("div",{className:z()["second-step"],children:[(0,d.jsx)("div",{className:z()["second-step__input"],children:(0,d.jsx)(C.q,{id:"second-step-email",value:r,placeholder:"Enviamos o c\xf3digo de confirma\xe7\xe3o para:",disabled:!0,rightContent:(0,d.jsx)(k.Z,{underlined:!0,title:"N\xe3o \xe9 voc\xea",onClick:n})})}),(0,d.jsx)("div",{className:z()["second-step__input"],children:(0,d.jsx)(C.q,{id:"code",onKeyUp:j,value:m,onChange:function(e){return w(e)},placeholder:"C\xf3digo de confirma\xe7\xe3o"})}),(0,d.jsx)("div",{className:z()["second-step__button"],children:(0,d.jsx)(g.J,{isLoading:l,onClick:b,rounded:!0,children:"ENTRAR"})}),(0,d.jsx)("div",{className:z()["second-step__button"],children:(0,d.jsx)(g.J,{isLoading:v,customSpinnerColor:"grey",onClick:E,rounded:!0,children:"REENVIAR C\xd3DIGO"})})]})},J=function(e){var n=e.login,t=e.email,r=e.backToEmailStep,a=(0,E.Z)(e,["login","email","backToEmailStep"]),i=(0,h.useState)(!0),s=i[0],c=i[1];return(0,d.jsx)("div",{className:F()["forgot-password"],children:(0,d.jsxs)("div",{className:F()["forgot-password__content"],
1children:[(0,d.jsx)("h2",{className:F()["forgot-password__title"],children:"Cadastro de nova senha"}),s?(0,d.jsx)(U,{login:n,email:t,nextStep:function(){return c(!1)}}):(0,d.jsx)(H,(0,o.Z)({login:n,email:t,backToLogin:r},a))]})})},$=t(47041),G=t(39434),K=t(31799),W=t(48418),Y=t.n(W),Q=t(90387),X=t(41228),B=t.n(X),ee=t(93293),ne=t(42681),te=t(69697),re=t(44458),ae=t(21914),oe=t(16829),ie=t(11163),se=(0,oe.Z)("span")({fontSize:"16px"});function ce(){var e=(0,ie.useRouter)(),n=(0,re.useSiteContext)().site.configs,t=n.store.allowedCustomerType,r=n.checkout.enablePasswordless,a=(0,h.useMemo)((function(){var n=e.query.redirect;if(r&&"/checkout/process"===n){var a=function(){switch(t){case ae.L.INDIVIDUAL:return"Email ou CPF";case ae.L.ENTERPRISE:return"Email ou CNPJ";case ae.L.BOTH:default:return"Email, CPF ou CNPJ"}}();return"Informe seu ".concat(a," para finalizar a compra")}return"Fa\xe7a seu login ou cadastre-se"}),[r,e.query.redirect,t]);return(0,d.jsx)(se,{children:a})}var ue=t(11285),de=t(37662),le=t(7297);function pe(){var e=(0,le.Z)(["\n & > div > div {\n background-color: #ffffff;\n }\n"]);return pe=function(){return e},e}function fe(){var e=(0,le.Z)(["\n & > button {\n width: 100%;\n }\n"]);return fe=function(){return e},e}var he=(0,oe.Z)("div")({width:"100%",marginTop:"20px"}),ve=(0,oe.Z)(he)(pe()),_e=(0,oe.Z)(he)(fe());function me(e){var n=e.login,t=e.email,r=e.nextStep,o=(0,h.useState)(""),i=o[0],s=o[1],c=(0,h.useState)(""),l=c[0],p=c[1],f=(0,Z.t)().formActions,v=(0,x.n)().alertActions,_=(0,j.N)(),m=_.mutateAsync,w=_.isLoading,C=function(){var e=(0,a.Z)(u().mark((function e(){var a;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!f.validate([{id:"password-create",value:i,validate:function(e){if(!e)throw new Error("Senha obrigat\xf3ria");if(e.length<=5)throw new Error("A senha deve ter no m\xednimo 6 caracteres")}},{id:"password-confirm",value:l,validate:function(e){if(!e)throw new Error("Confirma\xe7\xe3o de senha obrigat\xf3ria");if(e.length<=5)throw new Error("A senha deve ter no m\xednimo 6 caracteres");if(e!==i)throw new Error("As senhas n\xe3o conferem")}}])){e.next=16;break}return e.prev=1,e.next=4,m({email:t,password:i,roleType:S.Y.CUSTOMER});case 4:if(e.sent){e.next=8;break}return v.createOrUpdateOne("Ops! Infelizmente, algo deu errado. Tente novamente mais tarde.","error"),e.abrupt("return");case 8:a=t,t!==n&&(a=L(t)),v.createOrUpdateOne("Enviamos o c\xf3digo para o email cadastrado: ".concat(a,"."),"success"),r(),e.next=16;break;case 14:e.prev=14,e.t0=e.catch(1);case 16:case"end":return e.stop()}}),e,null,[[1,14]])})));return function(){return e.apply(this,arguments)}}(),k=(0,h.useCallback)((function(e){if("Enter"===e.key)return C()}),[C]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ve,{children:(0,d.jsx)(b.C,{id:"password-create",onKeyUp:k,value:i,onChange:function(e){return s(e)},placeholder:"Nova senha"})}),(0,d.jsx)(ve,{children:(0,d.jsx)(b.C,{id:"password-confirm",onKeyUp:k,value:l,onChange:function(e){return p(e)},placeholder:"Confirme sua nova senha"})}),(0,d.jsx)(_e,{children:(0,d.jsx)(g.J,{isLoading:w,onClick:C,rounded:!0,children:"CADASTRAR MINHA SENHA"})})]})}var ge=(0,oe.Z)("div")({width:"100%"}),we=(0,oe.Z)("div")({marginTop:20,width:"100%","&:nth-of-type(2) > div > div":{backgroundColor:"#FFFFFF"}}),xe=(0,oe.Z)("div")({marginTop:20,"& > button":{width:"100%"},"&:last-of-type > button":{color:"rgba(0, 0, 0, 0.5)",backgroundColor:"transparent",transition:"0.25s ease","&:hover":{color:"#000000",backgroundColor:"#e9e9e9"}}});function be(e){var n=e.login,t=e.email,r=e.backToLogin,o=(0,x.n)().alertActions,i=(0,Z.t)().formActions,s=(0,V.g)(),c=s.mutateAsync,l=s.isLoading,p=(0,D.H)(),f=p.mutateAsync,v=p.isLoading,_=(0,h.useState)(""),m=_[0],w=_[1],b=(0,h.useCallback)((0,a.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!i.validate([{id:"code",value:m,validate:function(e){if(!e)throw new Error("Campo obrigat\xf3rio")}}])){e.next=6;break}return e.next=4,c({email:t,verificationCode:m});case 4:o.createOrUpdateOne("Senha criada com sucesso.","success"),r();case 6:e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),o.createOrUpdateOne("Erro ao confirmar a senha. Tente novamente!","error");case 11:case"end":return e.stop()}}),e,null,[[0,8]])}))),[m,c,r]),E=(0,h.useCallback)((0,a.Z)(u().mark((function e(){return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f({email:t,roleType:S.Y.CUSTOMER});case 2:if(e.sent){e.next=6;break}return o.createOrUpdateOne("Erro ao reenviar a notifica\xe7\xe3o de criar de senha. Tente novamente!","error"),e.abrupt("return");case 6:o.createOrUpdateOne("Notifica\xe7\xe3o de criar senha reenviada com sucesso.","success");case 7:case"end":return e.stop()}}),e)}))),[]),j=(0,h.useCallback)((function(e){if("Enter"===e.key)return b()}),[b]);return(0,d.jsxs)(ge,{children:[(0,d.jsx)(we,{children:(0,d.jsx)(C.q,{id:"second-step-email",value:n,placeholder:"Enviamos o c\xf3digo de confirma\xe7\xe3o para:",disabled:!0,rightContent:(0,d.jsx)(k.Z,{underlined:!0,title:"N\xe3o \xe9 voc\xea",onClick:r})})}),(0,d.jsx)(we,{children:(0,d.jsx)(C.q,{id:"code",onKeyUp:j,value:m,onChange:function(e){return w(e)},placeholder:"C\xf3digo de confirma\xe7\xe3o"})}),(0,d.jsx)(xe,{children:(0,d.jsx)(g.J,{isLoading:l,onClick:b,rounded:!0,children:"ENTRAR"})}),(0,d.jsx)(xe,{children:(0,d.jsx)(g.J,{isLoading:v,customSpinnerColor:"grey",onClick:E,rounded:!0,children:"REENVIAR C\xd3DIGO"})})]})}var Ce,ke=(0,oe.Z)("div")({}),Ee=(0,oe.Z)("div")({display:"flex",justifyContent:"center",alignItems:"flex-start",flexDirection:"column",padding:"0 30px",margin:"35px auto 140px auto",maxWidth:"519px"}),je=(0,oe.Z)("h2")({margin:"0 0 10px 0",fontSize:"16px",fontWeight:500});function Se(e){var n=e.login,t=e.email,r=e.backToEmailStep,a=(0,h.useState)(Ce.SetPassword),o=a[0],i=a[1];return(0,d.jsx)(ke,{children:(0,d.jsxs)(Ee,{children:[(0,d.jsx)(je,{children:"Cadastro de nova senha"}),o===Ce.SetPassword?(0,d.jsx)(me,{login:n,email:t,nextStep:function(){return i(Ce.ConfirmPassword)}}):(0,d.jsx)(be,{login:n,email:t,backToLogin:r})]})})}!function(e){e[e.SetPassword=0]="SetPassword",e[e.ConfirmPassword=1]="ConfirmPassword"}(Ce||(Ce={}));var Ae=!0,Ne=function(e){var n=(0,Q.useRouter)(),t=(0,Z.t)().formActions,r=(0,x.n)().alertActions,i=(0,re.useSiteContext)().site.configs,c=i.store.allowedCustomerType,v=i.checkout.enablePasswordless,E=(0,h.useState)(""),j=E[0],S=E[1],A=(0,h.useState)(""),N=A[0],y=A[1],O=(0,h.useState)(""),P=O[0],M=O[1],L=(0,h.useState)(),R=L[0],T=L[1],U=(0,h.useState)(),I=U[0],F=U[1],V=(0,h.useState)(!1),D=V[0],q=V[1],z=(0,h.useState)(!1),H=z[0],W=z[1],X=(0,h.useState)(!1),oe=X[0],ie=X[1],se=(0,p.Z)(),le=se.mutateAsync,pe=se.isLoading,fe=(0,l.z)(),he=fe.mutateAsync,ve=fe.isLoading,_e=(0,h.useMemo)((function(){return pe||ve}),[pe,ve]),me=(0,ue.H)({keyProp:R,valueProp:I},{enabled:!1}),ge=(me.data,me.refetch),we=(0,h.useCallback)((function(e){var n;return(0,ne.V)("cpf").validate(e)||(0,ne.V)("cnpj").validate(e)?null===(n=e.match(/\d/g))||void 0===n?void 0:n.join(""):e}),[ne.V]),xe=function(){var e=(0,a.Z)(u().mark((function e(){var r,a,o,i,s,d,l,p;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.validate([{id:"login",value:j,validate:function(e){if(!e)throw new Error("Campo obrigatorio");if(!(0,ne.V)("email").validate(j)&&!(0,ne.V)("cpf").validate(j)&&!(0,ne.V)("cnpj").validate(j))throw new Error("Campo invalido");
1if(c===ae.L.ENTERPRISE&&(0,ne.V)("cpf").validate(j))throw new Error("Preencha um e-mail ou CNPJ v\xe1lido");if(c===ae.L.INDIVIDUAL&&(0,ne.V)("cnpj").validate(j))throw new Error("Preencha um e-mail ou CPF v\xe1lido");if((0,ne.V)("cpf").validate(j)&&!(0,ee.u8)(j))throw new Error("Preencha um CPF v\xe1lido");if((0,ne.V)("cnpj").validate(j)&&!te.s3.isValid(j))throw new Error("Preencha um CNPJ v\xe1lido")}}])){e.next=36;break}if(r=(0,ne.V)("email").validate(j)?"email":"documentNumber",a=we(j),T(r),F(a),!v||"/checkout/process"!==n.query.redirect){e.next=8;break}return(0,$.setCookies)(r,a),e.abrupt("return",n.push("/checkout/process"));case 8:return e.prev=8,e.next=11,le({query:a});case 11:return o=e.sent,e.next=14,ge();case 14:if(i=e.sent,i.data){e.next=19;break}return M(o.email),e.abrupt("return",ie(!0));case 19:M(o.email),q(!0),e.next=36;break;case 23:if(e.prev=23,e.t0=e.catch(8),"404.userDataNotFoundException"!==(null===(s=e.t0.response)||void 0===s||null===(d=s.data)||void 0===d?void 0:d.code)){e.next=35;break}if((0,$.getCookie)("email")&&(0,$.removeCookies)("email"),(0,$.getCookie)("documentNumber")&&(0,$.removeCookies)("documentNumber"),l=(0,ne.V)("email").validate(j)?"email":"documentNumber",p=we(j),(0,$.setCookies)(l,p),"/checkout/process"===n.query.redirect){e.next=34;break}return e.abrupt("return",n.push("/auth/register"));case 34:return e.abrupt("return",n.push("/checkout/process"));case 35:t.setFieldError({id:"login",errorMessage:"Ocorreu um erro, tente novamente!"});case 36:case"end":return e.stop()}}),e,null,[[8,23]])})));return function(){return e.apply(this,arguments)}}(),be=function(){var e=(0,a.Z)(u().mark((function e(){var a,o,i,s;return u().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.validate([{id:"password",value:N,validate:function(e){if(!e)throw new Error("Senha obrigatoria")}}])){e.next=24;break}return e.prev=1,e.next=4,he({userData:P,password:N});case 4:if("/checkout/cart"!==n.query.redirect||!n.query.cartId){e.next=6;break}return e.abrupt("return",n.push("/checkout/cart?cartId=".concat(n.query.cartId)));case 6:if("/checkout/process"===n.query.redirect){e.next=9;break}return n.push("/customer/area"),e.abrupt("return");case 9:n.push("/checkout/process"),e.next=24;break;case 12:if(e.prev=12,e.t0=e.catch(1),(null===(a=e.t0.response)||void 0===a||null===(o=a.data)||void 0===o?void 0:o.code)!==de.J){e.next=20;break}return r.createOrUpdateOne("Redefina sua senha para continuar. Por seguran\xe7a, sua senha precisa ser redefinida antes de acessar sua conta.","error"),q(!1),ie(!0),e.abrupt("return");case 20:if("404.userDataNotFoundException"!==(null===(i=e.t0.response)||void 0===i||null===(s=i.data)||void 0===s?void 0:s.code)){e.next=23;break}return t.setFieldError({id:"password",errorMessage:"Senha informada est\xe1 incorreta"}),e.abrupt("return");case 23:t.setFieldError({id:"password",errorMessage:"Ocorreu um erro, tente novamente!"});case 24:case"end":return e.stop()}}),e,null,[[1,12]])})));return function(){return e.apply(this,arguments)}}(),Ce=function(){S(""),W(!1),ie(!1),q(!1)},ke=(0,h.useCallback)((function(e){if("Enter"===e.key)return D?be():xe()}),[D,be,xe]),Ee=(0,h.useMemo)((function(){return c===ae.L.INDIVIDUAL?"Insira seu E-mail ou CPF":c===ae.L.ENTERPRISE?"Insira seu E-mail ou CNPJ":"Insira seu E-mail, CPF ou CNPJ"}),[c]);return(0,d.jsxs)(f.ZP,(0,s.Z)((0,o.Z)({},e),{children:[(0,d.jsx)(K.Z,{title:"Autentica\xe7\xe3o"}),(0,d.jsx)(G.Z,{activeStep:2}),(0,d.jsxs)("div",{className:B()["auth-login"],children:[(0,d.jsx)("div",{className:B()["auth-login__back-to"],children:H?(0,d.jsxs)("a",{onClick:function(){return W(!1)},children:[(0,d.jsx)(_,{}),"Voltar para o login"]}):(0,d.jsx)(Y(),{href:"/checkout/cart",children:(0,d.jsxs)("a",{children:[(0,d.jsx)(_,{}),"Voltar para o carrinho"]})})}),(0,d.jsx)("div",{className:B()["auth-login__alert"],children:(0,d.jsx)(w.F,{})}),H||oe?H?(0,d.jsx)(J,{backToEmailStep:Ce,email:P,login:j}):(0,d.jsx)(Se,{backToEmailStep:Ce,email:P,login:j}):(0,d.jsxs)("div",{className:B()["auth-login__content"],children:[(0,d.jsx)(ce,{}),(0,d.jsx)("div",{className:B()["auth-login__input"],children:(0,d.jsx)(C.q,{id:"login",onKeyUp:ke,value:j,onChange:function(e){return S(e.trim())},placeholder:Ee,disabled:D,rightContent:D&&(0,d.jsx)(k.Z,{title:"N\xe3o \xe9 voc\xea",underlined:!0,onClick:function(){return q(!1)}})})}),D&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:B()["auth-login__input"],children:(0,d.jsx)(b.C,{id:"password",onKeyUp:ke,value:N,onChange:function(e){return y(e)},placeholder:"Insira sua senha"})}),(0,d.jsx)("span",{className:B()["auth-login__forgot-password"],onClick:function(){return W(!0)},children:"Esqueci minha senha"})]}),(0,d.jsx)("div",{className:B()["auth-login__button"],children:(0,d.jsx)(g.J,{isLoading:_e,rounded:!0,onClick:function(){D?be():xe()},children:"CONTINUAR"})}),(0,d.jsxs)("div",{className:B()["auth-login__safety"],children:[(0,d.jsx)("div",{className:B()["auth-login__lock"],children:(0,d.jsx)(m.Z,{color:"rgba(0,0,0,0.5)"})}),(0,d.jsx)("span",{className:B()["auth-login__safety-text"],children:"Utilizaremos de forma segura seus dados para identificar se voc\xea j\xe1 possui cadastro."})]})]})]})]}))}},42681:function(e,n,t){"use strict";t.d(n,{V:function(){return r}});var r=function(e){switch(e){case"cep":return{transform:function(e){return e.replace(/\D+/g,"").replace(/^(\d{5})(\d{1,3})/,"$1-$2")},validate:function(e){return!!e.match(/^\d{5}-?\d{3}$/g)}};case"cpf":return{transform:function(e){return e.replace(/\D+/g,"").replace(/^(\d{3})(\d{1,3})(\d{0,3})(\d{0,2})/,(function(e,n,t,r,a){return n+"."+t+(r&&"."+r||"")+(a&&"-"+a||"")}))},validate:function(e){return!!e.match(/^\d{3}\.?\d{3}\.?\d{3}-?\d{2}$/g)}};case"cnpj":return{transform:function(e){return e.replace(/\D+/g,"").replace(/^(\d{2})(\d{1,3})(\d{0,3})(\d{0,4})(\d{0,2})/,(function(e,n,t,r,a,o){return n+"."+t+(r&&"."+r||"")+(a&&"/"+a||"")+(o&&"-"+o||"")}))},validate:function(e){return!!e.match(/^\d{2}.?\d{3}.?\d{3}\/?\d{4}-?\d{2}$/g)}};case"phone":return{transform:function(e){return 11===e.length?e.replace(/^(\d\d)(\d{5})(\d{4}).*/,"($1) $2-$3"):e.replace(/^(\d\d)(\d{4})(\d{4}).*/,"($1) $2-$3")},validate:function(e){return!!e.match(/^(\d{2}|\(\d{2}\))\s*(\d{9}|(\d{4}|\d{5})-?\d{4})$/g)}};case"email":return{validate:function(e){return!!e.match(/^([^.\s](\.[^.\s]+)*)+@[^.\s]+\.\S+$/g)}}}}},13852:function(e){e.exports={"input-password__icon":"InputPassword_
1input-password__icon__3bDt1"}},43457:function(e){e.exports={"first-step__input":"FirstStep_first-step__input__2njUh","first-step__button":"FirstStep_first-step__button__A7l18",pulse:"FirstStep_pulse__o_VN5","image-pulse":"FirstStep_image-pulse___NqG0",shine:"FirstStep_shine__tGgs6"}},40081:function(e){e.exports={"forgot-password__back-to-login":"ForgotPassword_forgot-password__back-to-login__eedzd","forgot-password__content":"ForgotPassword_forgot-password__content__Dxc7O","forgot-password__title":"ForgotPassword_forgot-password__title__YDOjX",pulse:"ForgotPassword_pulse__Ey5ZF","image-pulse":"ForgotPassword_image-pulse__2zt_z",shine:"ForgotPassword_shine__3lm9c"}},3199:function(e){e.exports={"second-step":"SecondStep_second-step__Nld0U","second-step__input":"SecondStep_second-step__input__WYhMC","second-step__button":"SecondStep_second-step__button__W7bbo",pulse:"SecondStep_pulse__ZwvFE","image-pulse":"SecondStep_image-pulse__j2os3",shine:"SecondStep_shine__7gczk"}},41228:function(e){e.exports={"auth-login__back-to":"AuthLogin_auth-login__back-to___dOlW","auth-login__content":"AuthLogin_auth-login__content__kFBXV","auth-login__alert":"AuthLogin_auth-login__alert__EyywZ","auth-login__title":"AuthLogin_auth-login__title__cE3dD","auth-login__button":"AuthLogin_auth-login__button__Qo8Ao","auth-login__input":"AuthLogin_auth-login__input__ELTwb","auth-login__forgot-password":"AuthLogin_auth-login__forgot-password__6NiH6","auth-login__safety":"AuthLogin_auth-login__safety__Zh4DR","auth-login__lock":"AuthLogin_auth-login__lock__AKmMX",pulse:"AuthLogin_pulse__g6sIu","image-pulse":"AuthLogin_image-pulse__hMsUf",shine:"AuthLogin_shine__RBW6W"}},47568:function(e,n,t){"use strict";function r(e,n,t,r,a,o,i){try{var s=e[o](i),c=s.value}catch(u){return void t(u)}s.done?n(c):Promise.resolve(c).then(r,a)}function a(e){return function(){var n=this,t=arguments;return new Promise((function(a,o){var i=e.apply(n,t);function s(e){r(i,a,o,s,c,"next",e)}function c(e){r(i,a,o,s,c,"throw",e)}s(void 0)}))}}t.d(n,{Z:function(){return a}})},7297:function(e,n,t){"use strict";function r(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}t.d(n,{Z:function(){return r}})}},function(e){e.O(0,[714,800,178,10,766,949,774,888,179],(function(){return n=53643,e(e.s=n);var n}));var n=e.O();_N_E=n}]);
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.