PageSourceSearch

https://app.usezapay.com.br/assets/index-CluCyJgf.js

js usezapay.com.br collected 2026-10-01 14:46:08 UTC 3,625 bytes, 1 lines download raw bytes

1import{i as S,k as u,x as T,V as k,y,g as V,z as M,a as w,h as A,n as $,A as q,l as x,j as i,C as f,p as R}from"./index-B8wCcbOu.js";import{s as _,r as C,x as v,v as N}from"./@zapay-pagamentos-BCOTJ_hq.js";import{I as E}from"./checkout-routes-_IK_6uON.js";import{F as U}from"./index-DSsPvhiE.js";import"./styles--09bB6Jw.js";const G=11,H=s=>{if(s.length<G)return"CPF incompleto.";if(!y.isValid(s))return"CPF inválido."},L=S().shape({fullName:u().required("Nome completo é obrigatório").matches(/^.*\s.*$/,"Nome completo é obrigatório"),document:u().required("Insira o CPF").test("is-valid-document","CPF inválido",s=>{const m=H(s.replace(/[^\d]/g,""));return m?new k(m,"","document"):!0}),phone:u().required("Telefone é obrigatório").test("phone-verification","Telefone inválido",s=>T(s)),email:u().email("E-mail inválido").required("E-mail é obrigatório")}),O=V.div.withConfig({displayName:"styles__Container",componentId:"sc-1y6j1u-0"})(["display:flex;flex-direction:column;width:600px;max-width:100%;margin:0 auto;gap:",";form{display:flex;flex-direction:column;gap:",";}label{font-family:Inter,sans-serif;margin-bottom:0;}"],_[8],_[8]),J=()=>{const m=!!M(),b=w(),{checkoutData:t,setPayerInfo:P}=A(),e=t==null?void 0:t.payerInfo,{handleSubmit:j,control:r,setValue:c,formState:{errors:a}}=$({resolver:R(L),defaultValues:{...e}}),d=!(e!=null&&e.fullName)||!(e!=null&&e.document)||!(e!=null&&e.phone)||!(e!=null&&e.email),F=o=>{const{name:n,cpf:l,phone:g,email:h}=o??{};!(e!=null&&e.fullName)&&n&&c("fullName",n),!(e!=null&&e.document)&&l&&c("document",l),!(e!=null&&e.phone)&&g&&c("phone",g),!(e!=null&&e.email)&&h&&c("email",h)},{refetch:p}=q({enabled:m&&d,onSuccess(o){o&&F(o)}});C.useEffect(()=>{var o;x("ecomm_insurance_payer_info_view",{has_token:m,has_existing_data:!d,plan_id:(o=t==null?void 0:t.selectedPlan)==null?void 0:o.planId})},[]),C.useEffect(()=>{m&&d&&p()},[m,d,p]);const B=o=>{var n;x("ecomm_insurance_payer_info_completed",{has_full_name:!!o.fullName,has_document:!!o.document,has_phone:!!o.phone,has_email:!!o.email,plan_id:(n=t==null?void 0:t.selectedPlan)==null?void 0:n.planId}),P(o),b(`${E.BASE}/${E.ADDRESS}`)};return i.jsx(O,{children:i.jsxs("form",{onSubmit:j(B),children:[i.jsx(f,{name:"document",control:r,render:({field:o})=>{var n,l;return i.jsx(v,{...o,label:"CPF",type:"tel",placeholder:"Digite o CPF",variant:"lg",error:!!((n=a==null?void 0:a.document)!=null&&n.message),errorMessage:(l=a==null?void 0:a.document)==null?void 0:l.message,mask:"999.999.999-99",maskChar:"","data-cy":"payer-info-document-input"})}}),i.jsx(f,{name:"fullName",control:r,render:({field:o})=>{var n,l;return i.jsx(N,{...o,label:"Nome completo",placeholder:"Informe o nome do pagador",variant:"lg",error:!!((n=a==null?void 0:a.fullName)!=null&&n.message),errorMessage:(l=a==null?void 0:a.fullName)==null?void 0:l.message,"data-cy":"payer-info-fullname-input"})}}),i.jsx(f,{name:"phone",control:r,render:({field:o})=>{var n,l;return i.jsx(v,{...o,label:"Telefone",type:"tel",mask:"(99) 99999-9999",placeholder:"Digite o telefone",variant:"lg",error:!!((n=a==null?void 0:a.phone)!=null&&n.message),errorMessage:(l=a==null?void 0:a.phone)==null?void 0:l.message,maskChar:"",containerClassNames:"phone","data-cy":"payer-info-phone-input"})}}),i.jsx(f,{name:"email",control:r,render:({field:o})=>{var n,l;return i.jsx(N,{...o,label:"E-mail",placeholder:"Digite o e-mail",type:"email",variant:"lg",error:!!((n=a==null?void 0:a.email)!=null&&n.message),errorMessage:(l=a==null?void 0:a.email)==null?void 0:l.message,"data-cy":"payer-info-email-input"})}}),i.jsx(U,{type:"submit"})]})})};export{J as default};

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.