PageSourceSearch

https://www.tabacariatrevo.com.br/_next/static/chunks/pages/AuthRegister-c2fef2d07bb5dae8.js

js tabacariatrevo.com.br collected 2026-09-29 01:31:40 UTC 32,115 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[641],{54793:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.useCreateUserCustomer=void 0;var r=t(97582),o=t(67294),i=t(88767),a=t(19973),s=t(86335),l=t(44458);n.useCreateUserCustomer=function(e){var n=(0,l.useSiteContext)(),t=(0,s.iamManagerRegistrationApi)(n.account.id),u=t.endpoint,c=t.createCustomer,d=(0,i.useQueryClient)(),m=(0,o.useMemo)((function(){return[a.IAM_MANAGER_SERVICE,u]}),[u]),v=(0,o.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[4,c(r.__assign(r.__assign({},e),{account:{id:n.account.id}}))];case 1:return[2,t.sent()]}}))}))}),[c,n.account.id]),p=(0,i.useMutation)(m,v,r.__assign(r.__assign({},e),{onSuccess:function(n,t,r){var o;d.invalidateQueries(m),null===(o=null===e||void 0===e?void 0:e.onSuccess)||void 0===o||o.call(e,n,t,r)}}));return p}},74500:function(e,n,t){"use strict";n.w=void 0;var r=t(97582),o=t(67294),i=t(88767),a=t(19973),s=t(54793),l=t(62164);n.w=function(e,n){var t=(0,i.useQueryClient)(),u=(0,o.useMemo)((function(){return[a.IAM_MANAGER_SERVICE,"saveCustomer"]}),[]),c=(0,s.useCreateUserCustomer)().mutateAsync,d=(0,l.useUpdateCustomer)().mutateAsync,m=(0,o.useCallback)((function(n){return r.__awaiter(void 0,void 0,void 0,(function(){var t;return r.__generator(this,(function(o){switch(o.label){case 0:return 8===(null===(t=n.dob)||void 0===t?void 0:t.length)&&(t=[t.substring(0,2),t.substring(2,4),t.substring(4,8)].reverse().join("-")),e?[4,d(n)]:[3,2];case 1:return o.sent(),[2];case 2:return[4,c(r.__assign(r.__assign({},n),{dob:t}))];case 3:return[2,o.sent()]}}))}))}),[c,d,e]);return(0,i.useMutation)(u,m,r.__assign(r.__assign({},n),{onSuccess:function(e,r,o){var i;t.invalidateQueries(u),null===(i=null===n||void 0===n?void 0:n.onSuccess)||void 0===i||i.call(n,e,r,o)}}))}},62164:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.useUpdateCustomer=void 0;var r=t(97582),o=t(67294),i=t(88767),a=t(45394),s=t(51760),l=t(19973),u=t(53087),c=t(40925),d=t(44458);n.useUpdateCustomer=function(e){var n=(0,d.useSiteContext)(),t=(0,s.crmCustomerManagerCustomerApi)(n.account.id),m=t.endpoint,v=t.updateCustomer,p=(0,c.useGetCustomer)().data,f=(0,i.useQueryClient)(),h=(0,o.useMemo)((function(){return[a.CRM_CUSTOMER_MANAGER_SERVICE,m]}),[m]),g=(0,o.useCallback)((function(e){return r.__awaiter(void 0,void 0,void 0,(function(){var n;return r.__generator(this,(function(t){switch(t.label){case 0:return p?(8===(null===(n=e.dob)||void 0===n?void 0:n.length)&&(n=[n.substring(0,2),n.substring(2,4),n.substring(4,8)].reverse().join("-")),[4,v(p.id,r.__assign(r.__assign({},e),{dob:n}))]):[2];case 1:return t.sent(),[2]}}))}))}),[v,p]),_=(0,i.useMutation)(h,g,r.__assign(r.__assign({},e),{onSuccess:function(t,r,o){var i,a=(0,u.iamManagerMeApi)(n.account.id).endpoint;f.invalidateQueries(h),f.invalidateQueries([l.IAM_MANAGER_SERVICE,a]),null===(i=null===e||void 0===e?void 0:e.onSuccess)||void 0===i||i.call(e,t,r,o)}}));return _}},1823:function(e,n,t){"use strict";var r=t(97582),o=t(85893),i=t(72371),a=t(87753),s=t(2909),l=r.__importDefault(t(49586)),u=t(91013);n.ZP=function(e){return(0,o.jsx)(o.Fragment,{children:e.children})}},70299:function(e,n){"use strict";n.N=void 0,function(e){e.MALE_AND_FEMALE="MALE_AND_FEMALE",e.ALL="ALL",e.NOT_DISPLAY="NOT_DISPLAY"}(n.N||(n.N={}))},26610:function(e,n){"use strict";n.g=void 0,function(e){e.INDIVIDUAL="INDIVIDUAL",e.ENTERPRISE="ENTERPRISE",e.BOTH="BOTH"}(n.g||(n.g={}))},32545:function(e,n){"use strict";n.dn=n.VX=void 0,function(e){e.MALE="MALE",e.FEMALE="FEMALE",e.OTHER="OTHER",e.NOT_INFORM="NOT_INFORM"}(n.VX||(n.VX={})),n.dn={MALE:"Masculino",FEMALE:"Feminino",OTHER:"Outros",NOT_INFORM:"Prefiro n\xe3o informar"}},70917:function(e,n,t){"use strict";t.d(n,{F4:function(){return d},iv:function(){return c},tZ:function(){return l},xB:function(){return u}});var r=t(87685),o=t(67294),i=t(70444),a=t(27278),s=t(85662),l=(t(48711),t(8679),function(e,n){var t=arguments;if(null==n||!r.h.call(n,"css"))return o.createElement.apply(void 0,t);var i=t.length,a=new Array(i);a[0]=r.E,a[1]=(0,r.c)(e,n);for(var s=2;s<i;s++)a[s]=t[s];return o.createElement.apply(null,a)});!function(e){var n;n||(n=e.JSX||(e.JSX={}))}(l||(l={}));var u=(0,r.w)((function(e,n){var t=e.styles,l=(0,s.O)([t],void 0,o.useContext(r.T)),u=o.useRef();return(0,a.j)((function(){var e=n.key+"-global",t=new n.sheet.constructor({key:e,nonce:n.sheet.nonce,container:n.sheet.container,speedy:n.sheet.isSpeedy}),r=!1,o=document.querySelector('style[data-emotion="'+e+" "+l.name+'"]');return n.sheet.tags.length&&(t.before=n.sheet.tags[0]),null!==o&&(r=!0,o.setAttribute("data-emotion",e),t.hydrate([o])),u.current=[t,r],function(){t.flush()}}),[n]),(0,a.j)((function(){var e=u.current,t=e[0];if(e[1])e[1]=!1;else{if(void 0!==l.next&&(0,i.My)(n,l.next,!0),t.tags.length){var r=t.tags[t.tags.length-1].nextElementSibling;t.before=r,t.flush()}n.insert("",l,t,!1)}}),[n,l.name]),null}));function c(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return(0,s.O)(n)}function d(){var e=c.apply(void 0,arguments),n="animation-"+e.name;return{name:n,styles:"@keyframes "+n+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}},47142:function(e,n,t){"use strict";var r,o=t(67294);function i(){return i=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},i.apply(null,arguments)}n.Z=function(e){return o.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:20.25,height:20.25},e),r||(r=o.createElement("path",{"data-name":"Icon ionic-ios-checkmark-circle",d:"M10.125 0A10.125 10.125 0 1020.25 10.125 10.123 10.123 0 0010.125 0zm5.184 7.325l-6.508 6.537a.879.879 0 01-.565.268.852.852 0 01-.57-.277l-2.73-2.728a.194.194 0 010-.277l.866-.866a.188.188 0 01.273 0l2.161 2.161 5.939-5.98a.192.192 0 01.136-.058.177.177 0 01.136.058l.852.881a.192.192 0 01.01.281z",fill:"
1currentColor"})))}},97087:function(e,n,t){"use strict";var r,o=t(67294);function i(){return i=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},i.apply(null,arguments)}n.Z=function(e){return o.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:8.323,height:8.323},e),r||(r=o.createElement("path",{d:"M1.334 4.97L3.322 7.05l3.629-3.8",fill:"none",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.8})))}},61830:function(e,n,t){"use strict";var r,o=t(67294);function i(){return i=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},i.apply(null,arguments)}n.Z=function(e){return o.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:17.816,height:11.878},e),r||(r=o.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,o=t(67294);function i(){return i=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},i.apply(null,arguments)}n.Z=function(e){return o.createElement("svg",i({xmlns:"http://www.w3.org/2000/svg",width:18.816,height:15.053},e),r||(r=o.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)"})))}},36400:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/AuthRegister",function(){return t(77750)}])},68819:function(e,n,t){"use strict";t.d(n,{k:function(){return p}});var r=t(26042),o=t(99534),i=t(85893),a=t(93967),s=t.n(a),l=t(57398),u=t.n(l),c=t(97087),d=function(e){return(0,i.jsxs)("div",{className:u().checkbox,children:[(0,i.jsx)("input",{checked:e.checked,onChange:function(n){return e.onChange(n.target.checked)},type:"checkbox"}),(0,i.jsx)("span",{className:u().checkbox__checkmark,children:(0,i.jsx)(c.Z,{})})]})},m=t(68897),v=t.n(m),p=function(e){var n=e.label,t=e.className,a=(0,o.Z)(e,["label","className"]);return(0,i.jsx)("div",{className:s()(v()["checkbox-label"],t),children:(0,i.jsxs)("label",{className:v()["checkbox-label__label"],children:[(0,i.jsx)(d,(0,r.Z)({},a)),(0,i.jsx)("span",{children:n})]})})}},23981:function(e,n,t){"use strict";t.d(n,{C:function(){return m}});
1var r=t(26042),o=t(69396),i=t(85893),a=t(67294),s=t(61830),l=t(17338),u=t(94862),c=t(13852),d=t.n(c),m=function(e){var n=(0,a.useState)(!1),t=n[0],c=n[1],m=(0,a.useMemo)((function(){return t?"text":"password"}),[t]);return(0,i.jsx)("div",{className:d()["input-password"],children:(0,i.jsx)(u.q,(0,o.Z)((0,r.Z)({},e),{type:m,rightContent:(0,i.jsx)("div",{className:d()["input-password__icon"],onClick:function(){return c(!t)},children:t?(0,i.jsx)(s.Z,{}):(0,i.jsx)(l.Z,{})})}))})}},17681:function(e,n,t){"use strict";t.d(n,{Y:function(){return u}});var r=t(14924),o=t(85893),i=t(93967),a=t.n(i),s=t(3939),l=t.n(s),u=function(e){var n=e.value,t=e.name,i=e.onChange,s=e.label,u=e.isChecked;return(0,o.jsxs)("label",{className:a()(l().radio,(0,r.Z)({},l()["radio--selected"],u)),children:[(0,o.jsx)("span",{className:l().radio__label,children:s}),(0,o.jsx)("input",{type:"radio",value:n,onChange:function(e){return null===i||void 0===i?void 0:i(e.target.value)},name:t,id:"".concat(t,"-").concat(n),checked:u}),(0,o.jsx)("span",{className:l().radio__checkmark})]})}},68349:function(e,n,t){"use strict";t.d(n,{e:function(){return d}});var r=t(26042),o=t(69396),i=t(85893),a=t(44458),s=t(70299),l=t(32545),u=t(67294),c=t(44737),d=function(e){var n=(0,a.useSiteContext)().site.configs.store.allowedCustomerGender,t=(0,u.useMemo)((function(){var e=[{value:l.VX.MALE,label:l.dn.MALE},{value:l.VX.FEMALE,label:l.dn.FEMALE}];return n===s.N.ALL?e.concat([{value:l.VX.OTHER,label:l.dn.OTHER},{value:l.VX.NOT_INFORM,label:l.dn.NOT_INFORM}]):e}),[n]);return n===s.N.NOT_DISPLAY?null:(0,i.jsx)(c.P,(0,o.Z)((0,r.Z)({},e),{id:"gender",placeholder:"G\xeanero",options:t,value:t.find((function(n){var t;return n.value===(e.value||(null===(t=e.controller)||void 0===t?void 0:t.field.value))})),onChange:function(n){var t,r;null===(t=e.onChange)||void 0===t||t.call(e,null===n||void 0===n?void 0:n.value),null===(r=e.controller)||void 0===r||r.field.onChange(null===n||void 0===n?void 0:n.value)},controller:e.controller}))}},44737:function(e,n,t){"use strict";t.d(n,{P:function(){return p}});var r=t(26042),o=t(69396),i=t(85893),a=t(67294),s=t(45350),l=t(19154),u=t(76905),c=t(48091),d=t(2053),m=t(43383),v=t.n(m),p=function(e){var n,t,m,p,f,h,g,_,b,C=(0,c.c)().showErrorMessage,x=(0,d.t)().formActions;(0,a.useEffect)((function(){return function(){e.id&&x.resetFieldError(e.id)}}),[]);var E=(0,a.useMemo)((function(){var n,t;return e.showValid&&(null===(n=e.controller)||void 0===n?void 0:n.fieldState.isDirty)&&!(null===(t=e.controller)||void 0===t?void 0:t.fieldState.invalid)}),[e.showValid,null===(n=e.controller)||void 0===n?void 0:n.fieldState]),w=(0,a.useMemo)((function(){var n,t;return E?"#4eb65a":e.id&&(C(e.id)||(null===(t=null===(n=e.controller)||void 0===n?void 0:n.fieldState.error)||void 0===t?void 0:t.message))?"#e60014":e.value?"#8A8A8A":e.borderColor||"#d5d5d5"}),[E,e.id,e.controller,e.borderColor]),N=(0,a.useCallback)((function(n){return(0,i.jsxs)(i.Fragment,{children:[!!n.selectProps.value&&(0,i.jsx)("label",{className:v().select__title,children:e.placeholder}),(0,i.jsx)(s.c.Control,(0,r.Z)({},n))]})}),[e]);return(0,i.jsxs)("div",{className:v().select,children:[(0,i.jsx)(l.ZP,(0,o.Z)((0,r.Z)({},e),{instanceId:e.id,styles:{control:function(n,t){var i,a;return(0,o.Z)((0,r.Z)({},n),{height:"47px",paddingLeft:"10px",fontSize:"14px",borderColor:w,outline:"unset !important",outlineColor:"#F00",boxShadow:"unset","&:hover":e.id&&(C(e.id)||(null===(a=null===(i=e.controller)||void 0===i?void 0:i.fieldState.error)||void 0===a?void 0:a.message)||e.customError)?"#e60014":e.borderColor||"#d5d5d5"})},dropdownIndicator:function(e,n){return(0,o.Z)((0,r.Z)({},e),{color:"#3C3C3C",right:0,top:"10%"})},valueContainer:function(e,n){return(0,o.Z)((0,r.Z)({},e),{paddingTop:n.selectProps.value?"15px":"initial"})},placeholder:function(n,t){return(0,o.Z)((0,r.Z)({},n),{color:e.id&&C(e.id)?"#e6001450":"#3c3c3c50"})}},classNamePrefix:"Select",options:e.options,value:e.value||(null===(t=e.controller)||void 0===t?void 0:t.field.value)||null,onChange:e.onChange||(null===(m=e.controller)||void 0===m?void 0:m.field.onChange),placeholder:"".concat(e.placeholder).concat(e.isRequired?" *":""),components:{IndicatorSeparator:null,Control:N}})),E&&(0,i.jsx)("div",{className:v()["select__valid-icon"],children:(0,i.jsx)(u.Z,{color:"#26A534"})}),!e.isDisabled&&(e.id&&C(e.id)||(null===(f=null===(p=e.controller)||void 0===p?void 0:p.fieldState.error)||void 0===f?void 0:f.message)||(null===(h=e.customError)||void 0===h?void 0:h.message))&&(0,i.jsx)("span",{className:v()["select__error-message"],children:e.id&&C(e.id)||(null===(_=null===(g=e.controller)||void 0===g?void 0:g.fieldState.error)||void 0===_?void 0:_.message)||(null===(b=e.customError)||void 0===b?void 0:b.message)})]})}}
1,77750:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return ie},default:function(){return ae}});var r=t(26042),o=t(69396),i=t(85893),a=t(1823),s=t(16829),l=t(1246),u=t(14924),c=t(41243),d=t.n(c),m=t(47142),v=t(93967),p=t.n(v),f=t(5442),h=function(e){var n=e.title,t=e.isOpen,r=e.isDone,o=e.isLoading,a=e.hideDoneIcon,s=e.children;return(0,i.jsxs)("div",{className:p()(d()["process-step"],(0,u.Z)({},d()["process-step--opened"],t)),children:[(0,i.jsxs)("div",{className:d()["process-step__title"],children:[n," ",!a&&(0,i.jsx)(m.Z,{color:r?"#26A534":"#00000033"})]}),(r||t)&&(0,i.jsx)("div",{className:d()["process-step__body"],children:o?(0,i.jsx)("div",{className:d()["process-step__loader"],children:(0,i.jsx)(f.$,{customColor:"white"})}):s})]})},g=t(47568),_=t(34051),b=t.n(_),C=t(74500),x=t(20270),E=t(69775),w=t(40925),N=t(44458),k=t(21914),y=t(26610),j=t(40771),S=t(68819),I=t(23981),A=t(94862),R=t(17681),L=t(18431),M=t(68349),O=t(47041),D=t(69697),Z=t(67294);var P=t(41664),V=t.n(P),T=t(11163),F=t(87536),q=t(30251),U=t(93293),Q=t(42681),$=(0,s.Z)("div",{label:"Inputs"})({display:"grid",gridTemplateColumns:"1fr 1fr",gap:20,"@media (max-width: 767px)":{gridTemplateColumns:"1fr"}}),z=(0,s.Z)("div",{label:"RegisterFormRoot"})({display:"flex",flexDirection:"column",gap:20,padding:20}),X=(0,s.Z)("div",{label:"ButtonContent"})({alignSelf:"flex-end"}),G=(0,s.Z)("div",{label:"DocumentType"})({display:"flex",alignItems:"center",gap:50}),J=(0,s.Z)("div",{label:"DocumentComplement"})({display:"flex",alignItems:"center",gap:20});function H(e){var n=e.onSignInSuccess,t=e.buttonText,a=e.onSaveCustomerSuccess,s=(0,w.useGetCustomer)().data,l=(0,T.useRouter)().asPath,u=(0,Z.useMemo)((function(){return"/checkout/process"===l?"/auth/login?redirect=/checkout/process":"/auth/login"}
1),[l]),c=(0,F.Gc)(),d=c.watch,m=c.clearErrors,v=c.control,p=c.setError,f=c.setValue,h=c.handleSubmit,_=(0,E.Z)(),P=_.mutateAsync,H=_.data,B=_.isLoading,Y=(0,N.useSiteContext)().site.configs.store.allowedCustomerType,W=(0,q.n)().alertActions,K=(0,Z.useCallback)((function(e){var n={documentNumber:e.documentNumber,email:e.email,name:e.name,phone:e.phone,type:e.type,password:e.password?e.password:null};return e.type===y.g.INDIVIDUAL?(0,o.Z)((0,r.Z)({},n),{dob:e.dob,gender:e.gender}):(0,o.Z)((0,r.Z)({},n),{businessContact:e.businessContact,documentComplement:e.isFree?"Isento":e.documentComplement})}),[]),ee=(0,T.useRouter)().push,ne=(0,x.z)({onError:function(){W.createOrUpdateOne("Ops! Infelizmente, algo deu errado. Tente novamente mais tarde.","error")},onSuccess:n}),te=ne.mutateAsync,re=ne.isLoading,oe=(0,C.w)(null===s||void 0===s?void 0:s.id,{onError:function(e){var n;"409.userAlreadyExistsException"===(null===(n=e.response)||void 0===n?void 0:n.data.code)?W.createOrUpdateOne("Usu\xe1rio j\xe1 cadastrado!","error"):W.createOrUpdateOne("Ops! Infelizmente, algo deu errado. Tente novamente mais tarde.","error")},onSuccess:function(){if(!s)return te({userData:ve.email,password:ve.password});null===a||void 0===a||a()}}),ie=oe.mutateAsync,ae=oe.isLoading,se=(0,Z.useState)("documentNumber"),le=se[0],ue=se[1],ce=(0,Z.useState)("cellphone"),de=ce[0],me=ce[1],ve=d(),pe=(0,Z.useMemo)((function(){return ve.type===y.g.INDIVIDUAL}),[ve.type]),fe=(0,Z.useMemo)((function(){return"phone"===de?"(99) 9999-9999":"(99) 99999-9999"}),[de]),he=(0,Z.useCallback)((function(e){var n=(null===e||void 0===e?void 0:e.split(" "))||[];return!((null===n||void 0===n?void 0:n.length)<=1||(null===n||void 0===n?void 0:n[1].length)<2||e&&/[0-9]/.test(e))}),[]),ge=(0,Z.useCallback)((function(e){return pe&&11===e.length||!pe&&14===e.length}),[pe]),_e=(0,Z.useCallback)((function(e){var n=pe?"CPF":"CNPJ";return"email"===e&&(n="e-mail"),(0,i.jsxs)(i.Fragment,{children:["Esse ",n," j\xe1 tem cadastro, clique"," ",(0,i.jsx)(V(),{href:"/auth/login",children:(0,i.jsx)("a",{children:"aqui"})})," ","e fa\xe7a login"]})}),[pe]),be=(0,Z.useCallback)(function(){var e=(0,g.Z)(b().mark((function e(n,t){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ve.email!==n){e.next=2;break}return e.abrupt("return",null);case 2:if(t(n),(0,Q.V)("email").validate(n)){e.next=5;break}return e.abrupt("return",null);case 5:return e.prev=5,e.next=8,P({query:n},{onSuccess:function(){return ue("email")},onError:function(){return ue("default")}});case 8:e.next=12;break;case 10:e.prev=10,e.t0=e.catch(5);case 12:case"end":return e.stop()}}),e,null,[[5,10]])})));return function(n,t){return e.apply(this,arguments)}}(),[ve.email,P,Q.V]),Ce=(0,Z.useCallback)(function(){var e=(0,g.Z)(b().mark((function e(n,t){return b().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ve.documentNumber!==n){e.next=2;break}return e.abrupt("return",null);case 2:if(t(n),ge(n)){e.next=5;break}return e.abrupt("return",null);case 5:return e.prev=5,e.next=8,P({query:n},{onSuccess:function(){return ue("documentNumber")},onError:function(){return((0,O.getCookie)("email")||ve.email)&&(0,U.u8)(n)?(ue("default"),void m("documentNumber")):(0,U.u8)(n)||ve.type!==y.g.INDIVIDUAL?D.s3.isValid(n)||ve.type!==y.g.ENTERPRISE?(m("documentNumber"),ve.email||(0,O.getCookie)("email")?ue("default"):void ue("email")):p("documentNumber",{message:"Preencha um CNPJ v\xe1lido",type:"error"}):p("documentNumber",{message:"Preencha um CPF v\xe1lido",type:"error"})}});case 8:e.next=12;break;case 10:e.prev=10,e.t0=e.catch(5);case 12:case"end":return e.stop()}}),e,null,[[5,10]])})));return function(n,t){return e.apply(this,arguments)}}(),[ve.documentNumber,ve.type,P,pe,ge,O.getCookie,p,m]),xe=(0,Z.useMemo)((function(){return h((function(){return ie(K(ve))}),(function(e){return console.info(e)}))}),[h,ie,ve]),Ee=(0,Z.useMemo)((function(){return re||ae}),[re,ae]);return(0,Z.useEffect)((function(){s?ue("default"):(0,O.getCookie)("documentNumber")?ue("email"):ue("documentNumber")}),[O.getCookie,s,ue]),(0,Z.useEffect)((function(){((0,O.getCookie)("email")||(0,O.getCookie)("documentNumber"))&&((0,O.getCookie)("email")?f("email",(0,O.getCookie)("email")):f("documentNumber",(0,O.getCookie)("documentNumber")))}),[O.getCookie,f]),(0,Z.useEffect)((function(){if(s){var e,n,t,r,o;if(s.type===y.g.ENTERPRISE)return f("documentNumber",null===s||void 0===s?void 0:s.documentNumber),f("email",null===s||void 0===s?void 0:s.email),f("name",null===s||void 0===s?void 0:s.name),f("phone",null===s||void 0===s||null===(r=s.contacts)||void 0===r||null===(o=r[0])||void 0===o?void 0:o.value.replace(/[^\d]/g,"")),f("password",""),f("type",null===s||void 0===s?void 0:s.type),f("isEdit",!0),f("isFree","Isento"===s.documentComplement),f("businessContact",null===s||void 0===s?void 0:s.businessContact),void f("documentComplement",null===s||void 0===s?void 0:s.documentComplement);f("documentNumber",null===s||void 0===s?void 0:s.documentNumber),f("email",null===s||void 0===s?void 0:s.email),f("name",null===s||void 0===s?void 0:s.name),f("phone",null===s||void 0===s||null===(e=s.contacts)||void 0===e||null===(n=e[0])||void 0===n?void 0:n.value.replace(/[^\d]/g,"")),f("password",""),f("type",null===s||void 0===s?void 0:s.type),f("gender",null===s||void 0===s?void 0:s.gender),f("isEdit",!0),f("dob",(null===s||void 0===s||null===(t=s.dob)||void 0===t?void 0:t.toLocaleStr
1ing().split("T")[0].split("-").reverse().join(""))||"")}}),[s,f]),(0,Z.useEffect)((function(){if(null===s||void 0===s?void 0:s.type)return f("type",s.type);f("type",(0,O.getCookie)("documentNumber")&&D.s3.isValid((0,O.getCookie)("documentNumber"))?y.g.ENTERPRISE:y.g.INDIVIDUAL)}),[f,null===s||void 0===s?void 0:s.type]),(0,i.jsxs)(z,{children:[!s&&Y===k.L.BOTH&&(0,i.jsx)(F.Qr,{control:v,name:"type",render:function(e){var n=e.field.onChange;return(0,i.jsxs)(G,{children:[(0,i.jsx)(R.Y,{name:"document-type",label:"Pessoa F\xedsica",value:y.g.INDIVIDUAL,onChange:n,isChecked:pe}),(0,i.jsx)(R.Y,{name:"document-type",label:"Pessoa Jur\xeddica",value:y.g.ENTERPRISE,onChange:n,isChecked:!pe})]})}}),(0,i.jsxs)($,{children:[(0,i.jsx)(F.Qr,{control:v,name:"documentNumber",render:function(e){var n=e.field,t=n.value,r=n.onChange,o=e.fieldState.error;return(0,i.jsx)(A.q,{id:"document-number",disabled:!!s||!!(0,O.getCookie)("documentNumber"),value:t,onChange:function(e){return Ce(e,r)},placeholder:pe?"CPF":"CNPJ",isRequired:!0,showValid:!B&&pe?(0,U.u8)(t):D.s3.isValid(t),rightContent:!!(0,O.getCookie)("documentNumber")&&!s&&(0,i.jsx)(L.Z,{title:"N\xe3o \xe9 voc\xea",underlined:!0,onClick:function(){(0,O.removeCookies)("documentNumber"),ee(u)}}),mask:pe?"999.999.999-99":"99.999.999/9999-99",isLoading:B&&"documentNumber"===le,customError:H&&"documentNumber"===le?{type:"error",message:_e()}:o||void 0})}}),(0,i.jsx)(F.Qr,{control:v,name:"email",render:function(e){var n=e.field,t=n.value,r=n.onChange,o=n.name,a=e.fieldState.error;return(0,i.jsx)(A.q,{id:"email",type:"email",autoComplete:"username",value:t,onChange:function(e){return be(e,r)},placeholder:"Email",isRequired:!0,showValid:(0,Q.V)("email").validate(t)&&!B,disabled:!!s||"documentNumber"===le||!!(0,O.getCookie)("email"),rightContent:!!(0,O.getCookie)("email")&&!s&&(0,i.jsx)(L.Z,{title:"N\xe3o \xe9 voc\xea",underlined:!0,onClick:function(){(0,O.removeCookies)("email"),ee(u)}}),customError:H&&"email"===le?{type:"error",message:_e(o)}:a||void 0})}}),(0,i.jsx)(F.Qr,{control:v,name:"name",render:function(e){var n=e.field,t=n.value,r=n.onChange,o=e.fieldState.error;return(0,i.jsx)(A.q,{id:"name",value:t,onChange:r,placeholder:pe?"Nome e sobrenome":"Raz\xe3o social",customError:o,isRequired:!0,showValid:pe?he(t):!!t,disabled:"default"!==le})}}),!pe&&(0,i.jsxs)(Z.Fragment,{children:[(0,i.jsxs)(J,{children:[(0,i.jsx)(F.Qr,{control:v,name:"documentComplement",render:function(e){var n=e.field,t=n.value,r=n.onChange,o=e.fieldState.error;return(0,i.jsx)(A.q,{id:"name",value:t,onChange:function(e){return r(e.replace(/\D/g,""))},maxLength:14,placeholder:"Inscri\xe7\xe3o estadual",customError:o,isRequired:!0,showValid:t.length>=9&&t.length<=14,disabled:"default"!==le||ve.isFree})}}),(0,i.jsx)(F.Qr,{control:v,name:"isFree",render:function(e){var n=e.field,t=n.value,r=n.onChange;return(0,i.jsx)(S.k,{checked:t,onChange:r,label:"Isento?"})}})]}),(0,i.jsx)(F.Qr,{control:v,name:"businessContact",render:function(e){var n=e.field,t=n.value,r=n.onChange,o=e.fieldState.error;return(0,i.jsx)(A.q,{id:"businessContact",value:t,onChange:r,placeholder:"Respons\xe1vel pela compra",customError:o,isRequired:!0,showValid:he(t),disabled:"default"!==le})}})]}),(0,i.jsx)(F.Qr,{control:v,name:"phone",render:function(e){var n=e.field,t=n.value,r=n.onChange,o=e.fieldState.error;return(0,i.jsx)(A.q,{id:"phone",type:"tel",value:t,onChange:r,customError:o,placeholder:"Telefone",isRequired:!0,onBlur:function(){return me(t.length>10?"cellphone":"phone")},onFocus:function(){return me("cellphone")},mask:fe,showValid:(null===t||void 0===t?void 0:t.length)>=10,disabled:"default"!==le})}}),pe&&(0,i.jsx)(F.Qr,{control:v,name:"gender",render:function(e){var n=e.field,t=n.value,r=n.onChange,o=e.fieldState.error;return(0,i.jsx)(M.e,{placeholder:"G\xeanero",value:t,onChange:r,customError:o,isRequired:!0,isDisabled:"default"!==le})}}),pe&&(0,i.jsx)(F.Qr,{control:v,name:"dob",render:function(e){var n=e.field,t=n.value,r=n.onChange,o=e.fieldState.error;return(0,i.jsx)(A.q,{id:"dob",type:"tel",value:t,onChange:r,customError:o,placeholder:"Data de nascimento",isRequired:!0,mask:"99/99/9999",showValid:8===t.length,disabled:"default"!==le})}}),!s&&(0,i.jsx)(F.Qr,{control:v,name:"password",render:function(e){var n=e.field,t=n.value,r=n.onChange,o=e.fieldState.error;return(0,i.jsx)(I.C,{id:"password",value:t||"",onChange:r,customError:o,placeholder:"Crie sua senha",isRequired:!0,showValid:!!t&&t.length>=6,disabled:"default"!==le})}})]}),(0,i.jsx)(X,{children:(0,i.jsx)(j.J,{rounded:!0,onClick:xe,isLoading:Ee,children:t})})]})}var B=t(29815),Y=t(32545),W=t(46848),K=t(42705),ee=t.n(K);function ne(e){var n,t,a=e.children,s=(0,N.useSiteContext)().site.configs.store.allowedCustomerType,l=(0,F.cI)({defaultValues:{dob:"",documentNumber:"",email:"",name:"",password:"",phone:"",type:y.g.INDIVIDUAL,businessContact:"",documentComplement:"",isFree:!1,isEdit:!1},resolver:(0,W.L)(ee().object({documentNumber:ee().when("type",{is:y.g.INDIVIDUAL,then:ee().string().custom((function(e,n){if(!(0,U.u8)(e))return n.message({custom:"Preencha um CPF v\xe1lido"})})).required(),otherwise:ee().string().regex(/^[0-9]{14}$/).min(14).max(14).messages({"string.pattern.base":"Preencha um CNPJ v\xe1lido"}).required()}),dob:ee().when("type",{is:y.g.INDIVIDUAL,then:ee().string().regex(/^([0]?[1-9]|[1|2][0-9]|[3][0|1])([0][1-9]|[1][0-2])([0-9]{4})$/).messages({"string.pattern.base":"Preencha uma data v\xe1lida"}).required(),otherwise:ee().string().allow("")}),email:ee().string().regex(/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,})+$/).messages({"string.pattern.base":"Preencha um e-mail v\xe1lido"}).required(),name:ee().string().required().when("type",{is:y.g.INDIVIDUAL,then:ee().custom((function(e,n){var t=null===e||void 0===e?void 0:e.split(" ");if(t.length<=1||(null===t||void 0===t?void 0:t[1].length)<2||/[0-9]/.test(t))return n.message({custom:"Preencha nome e sobrenome v\xe1lidos"})}))}),phone:ee().string().min(10).max(11).messages({"string.min":"Preencha um telefone v\xe1lido"}).required(),gender:(n=ee().string().optional().allow("")).valid.apply(n,(0,B.Z)(Object.keys(Y.VX))),type:(t=ee()).valid.apply(t,(0,B.Z)(Object.keys(y.g))).required(),password:ee().when("isEdit",{is:!1,then:ee().string().min(6).messages({"string.min":"M\xednimo de 6 caracteres"}).required(),otherwise:ee().string().optional().allow("")}),businessContact:ee().when("type",{is:y.g.INDIVIDUAL,then:ee().string().allow(""),otherwise:ee().string().required()}),documentComplement:ee().when("type",{is:y.g.INDIVIDUAL,then:ee().string().allow(""),otherwise:ee().when("isFree",{is:!0,then:ee().string().optional().allow(""),otherwise:ee().string().required().min(9).max(14)})}).messages({"string.min":"Digite uma inscri\xe7\xe3o estadual v\xe1lida","string.max":"Digite uma inscri\xe7\xe3o estadual v\xe1lida"}),isFree:ee().boolean().optional(),isEdit:ee().boolean().optional()}
1).messages({"string.empty":"Campo de preenchimento obrigat\xf3rio","any.required":"Campo de preenchimento obrigat\xf3rio"}))});return(0,Z.useEffect)((function(){s&&s!==k.L.BOTH&&l.setValue("type",s===k.L.ENTERPRISE?y.g.ENTERPRISE:y.g.INDIVIDUAL)}),[s,l]),(0,i.jsx)(F.RV,(0,o.Z)((0,r.Z)({},l),{children:a}))}var te=t(39434),re=t(31799),oe=(0,s.Z)("div",{label:"Container"})({maxWidth:762,margin:"55px auto 70px",padding:"0 15px",display:"flex",flexDirection:"column",gap:27}),ie=!0,ae=function(e){var n=(0,T.useRouter)().push;return(0,i.jsx)(a.ZP,(0,o.Z)((0,r.Z)({},e),{children:(0,i.jsxs)(ne,{children:[(0,i.jsx)(re.Z,{title:"Cadastro"}),(0,i.jsx)(te.Z,{}),(0,i.jsxs)(oe,{children:[(0,i.jsx)(l.F,{}),(0,i.jsx)(h,{isOpen:!0,title:"Dados pessoais",isDone:!1,children:(0,i.jsx)(H,{buttonText:"CADASTRAR",onSignInSuccess:function(){return n("/customer/area")}})})]})]})}))}},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,o){return n+"."+t+(r&&"."+r||"")+(o&&"-"+o||"")}))},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,o,i){return n+"."+t+(r&&"."+r||"")+(o&&"/"+o||"")+(i&&"-"+i||"")}))},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)}}}}},57398:function(e){e.exports={checkbox:"Checkbox_checkbox__xRftJ",checkbox__checkmark:"Checkbox_checkbox__checkmark__ztl1c",pulse:"Checkbox_pulse__LKg_J","image-pulse":"Checkbox_image-pulse__GkvTn",shine:"Checkbox_shine__5Yutl"}},68897:function(e){e.exports={"checkbox-label":"CheckboxLabel_checkbox-label__ywE28","checkbox-label__label":"CheckboxLabel_checkbox-label__label__JhD3P",pulse:"CheckboxLabel_pulse__Lgv4W","image-pulse":"CheckboxLabel_image-pulse__sBez2",shine:"CheckboxLabel_shine__HXAM0"}},13852:function(e){e.exports={"input-password__icon":"InputPassword_input-password__icon__3bDt1"}},3939:function(e){e.exports={radio:"Radio_radio__Mvc4i","radio--selected":"Radio_radio--selected__6V0fe",radio__checkmark:"Radio_radio__checkmark__tYyR8",radio__label:"Radio_radio__label__sz1o4",pulse:"Radio_pulse__aRNxQ","image-pulse":"Radio_image-pulse__su1ye",shine:"Radio_shine__Sd018"}},43383:function(e){e.exports={select:"Select_select__3i0vX",select__title:"Select_select__title__61s5G","select__error-message":"Select_select__error-message__a9VO8","select__valid-icon":"Select_select__valid-icon__dtRL8",pulse:"Select_pulse__33Iou","image-pulse":"Select_image-pulse__G_JL6",shine:"Select_shine___rh4r"}},41243:function(e){e.exports={"process-step":"Step_process-step__Ahpun","process-step--opened":"Step_process-step--opened__PFCLT","process-step__title":"Step_process-step__title__x4DXh","process-step__body":"Step_process-step__body__wEec7","process-step__loader":"Step_process-step__loader__Sw_dm",pulse:"Step_pulse__v1Zsx","image-pulse":"Step_image-pulse__OlFfW",shine:"Step_shine__J_XWx"}}},function(e){e.O(0,[714,800,178,623,536,805,10,766,949,774,888,179],(function(){return n=36400,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.