1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7771],{10635:(e,a,r)=>{r.d(a,{S:()=>C});var s=r(33254),n=r(39238),t=r(98527),i=r.n(t),l=r(70440),c=r(85888),o=r(31420),d=r(70663),u=r(7276),m=r(49513);let f=(0,m.A)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),x=(0,m.A)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var p=r(57912),h=r(85950);let g=(0,m.A)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),v=(0,m.A)("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]),b=e=>(null!=e?e:"").replace(/\D/g,"").slice(-11);function j(e){let{phone:a,onVerified:r}
1=e,t=b(a),[i,l]=(0,n.useState)(t),[c,m]=(0,n.useState)(""),[x,j]=(0,n.useState)(!1),[N,y]=(0,n.useState)(!1),[w,S]=(0,n.useState)(0),C=o.i.useUtils(),{data:z,isLoading:k}=o.i.phone.getStatus.useQuery();(0,n.useEffect)(()=>{(null==z?void 0:z.verifiedPhone)?(j(!0),l(z.verifiedPhone)):(null==z?void 0:z.pendingPhone)&&(y(!0),l(z.pendingPhone))},[z]),(0,n.useEffect)(()=>{t&&l(t)},[t]);let A=()=>{S(60);let e=setInterval(()=>{S(a=>a<=1?(clearInterval(e),0):a-1)},1e3)},P=o.i.phone.sendCode.useMutation({onSuccess:()=>{u.o.success("C\xf3digo enviado via SMS!"),y(!0),A()},onError:e=>{var a;return u.o.error(null!=(a=e.message)?a:"Erro ao enviar SMS. Tente novamente.")}}),L=o.i.phone.verifyCode.useMutation({onSuccess:()=>{u.o.success("Telefone verificado com sucesso!"),j(!0),y(!1),null==r||r(i),C.phone.getStatus.invalidate()},onError:e=>{var a;return u.o.error(null!=(a=e.message)?a:"C\xf3digo inv\xe1lido ou expirado")}}),$=P.isLoading||L.isLoading;return k?(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 rounded-lg border border-border bg-bg-surface p-4 text-sm text-muted-foreground",children:[(0,s.jsx)(p.A,{size:16,className:"animate-spin"}),"Carregando status do telefone..."]}):x?(0,s.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-primary/5 border border-primary/20 rounded-lg",children:[(0,s.jsx)(f,{size:18,className:"text-primary shrink-0"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-fg-primary",children:"Telefone verificado"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:i})]})]}):(0,s.jsxs)("div",{className:"space-y-3 p-4 border border-border rounded-lg bg-bg-surface",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,s.jsx)(h.A,{size:16,className:"text-primary"}),(0,s.jsx)("span",{className:"text-sm font-medium text-fg-primary",children:"Verifica\xe7\xe3o de telefone via SMS"})]}),(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-warning/20 bg-warning-subtle p-3",children:[(0,s.jsx)(g,{size:16,className:"mt-0.5 shrink-0 text-warning"}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-fg-primary",children:"Telefone pendente de valida\xe7\xe3o"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:N?"Se voc\xea j\xe1 recebeu o SMS, digite o c\xf3digo abaixo. Se precisar, reenviamos outro c\xf3digo.":"Seu telefone ainda n\xe3o foi confirmado. Envie ou reenvie o SMS e valide o c\xf3digo abaixo."})]})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(d.JU,{htmlFor:"phone-verify",children:"Telefone com DDD"}),(0,s.jsx)(d.pd,{id:"phone-verify",value:i,onChange:e=>l(e.target.value.replace(/\D/g,"").slice(0,11)),placeholder:"11999998888",maxLength:11})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)(d.JU,{htmlFor:"sms-code",children:"C\xf3digo de verifica\xe7\xe3o"}),(0,s.jsx)(d.pd,{id:"sms-code",value:c,onChange:e=>m(e.target.value.replace(/\D/g,"").slice(0,6)),placeholder:"000000",maxLength:6,className:"text-center tracking-widest text-lg"})]}),(0,s.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,s.jsxs)(d.$n,{onClick:()=>{let e=b(i);if(e.length<10||e.length>11)return void u.o.error("Informe um telefone v\xe1lido com DDD");P.mutate({telefone:e})},disabled:$||N&&w>0,className:"w-full gap-2",size:"sm",variant:"outline",children:[$?(0,s.jsx)(p.A,{size:14,className:"animate-spin"}):(0,s.jsx)(v,{size:14}),N?w>0?"Reenviar em ".concat(w,"s"):"Reenviar c\xf3digo":"Enviar c\xf3digo SMS"]}),(0,s.jsxs)(d.$n,{onClick:()=>{if(!c.trim())return void u.o.error("Informe o c\xf3digo recebido");let e=b(i);if(e.length<10||e.length>11)return void u.o.error("Informe um telefone v\xe1lido com DDD");L.mutate({telefone:e,code:c.replace(/\D/g,"")})},disabled:$||c.trim().length<4,className:"w-full gap-2",size:"sm",children:[$?(0,s.jsx)(p.A,{size:14,className:"animate-spin"}):(0,s.jsx)(h.A,{size:14}),"Validar telefone"]})]})]})}var N=r(17142);let y={basic:{label:"N\xe3o iniciado",className:"bg-bg-subtle text-fg-tertiary"},verified:{label:"Verificado",className:"bg-success-subtle text-success"},bronze:{label:"Bronze",className:"bg-warning-subtle text-warning"},prata:{label:"Prata",className:"bg-bg-subtle text-fg-secondary"},gold:{label:"Gold",className:"bg-success-subtle text-success"}};function w(e,a){return e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:a}function S(e){let{done:a,label:r}=e;return(0,s.jsxs)("div",{className:"flex items-center gap-2 text-[13px]",children:[a?(0,s.jsx)(f,{className:"h-4 w-4 text-success shrink-0"}):(0,s.jsx)(x,{className:"h-4 w-4 text-fg-tertiary shrink-0"}),(0,s.jsx)("span",{className:a?"text-fg-primary":"text-fg-secondary",children:r})]})}function C(){return(0,s.jsx)(n.Suspense,{fallback:(0,s.jsx)("div",{className:"flex justify-center rounded-2xl border border-border bg-bg-surface py-8",children:(0,s.jsx)(p.A,{className:"h-5 w-5 animate-spin"})}),children:(0,s.jsx)(z,{})})}function z(){var e,a;let{data:r,isLoading:t,refetch:m}=o.i.verificationLevel.getStatus.useQuery(),{update:f}
1=(0,l.wV)(),[x,h]=(0,n.useState)(""),g=(0,c.useSearchParams)(),v=null!=(e=g.get("companyId"))?e:void 0,b=(0,N.pq)(g.get("callback")),C=(0,N.GX)({companyId:v,callback:b}),z=o.i.verificationLevel.upgradeToBronze.useMutation(),k=o.i.verificationLevel.sendEmailVerification.useMutation();if(t||!r)return(0,s.jsx)("div",{className:"flex justify-center rounded-2xl border border-border bg-bg-surface py-8",children:(0,s.jsx)(p.A,{className:"h-5 w-5 animate-spin"})});let A=null!=(a=y[r.level])?a:y.basic,P=async()=>{try{if(await z.mutateAsync({cpf:r.bronze.cpfInformado?void 0:x.replace(/\D/g,"")}),u.o.success("N\xedvel Bronze conquistado!"),await f(),b)return void(0,N.d_)(b);m()}catch(e){u.o.error(w(e,"Falha ao avan\xe7ar de n\xedvel"))}},L=async()=>{try{await k.mutateAsync(),u.o.success("E-mail de confirma\xe7\xe3o reenviado")}catch(e){u.o.error(w(e,"Falha ao reenviar e-mail"))}},$=r.bronze.emailVerificado&&r.bronze.telefoneVerificado&&(r.bronze.cpfInformado||x.replace(/\D/g,"").length>=11);return(0,s.jsxs)("div",{className:"overflow-hidden rounded-2xl border border-border bg-bg-surface p-[18px] flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("p",{className:"text-[15px] font-bold text-fg-primary",children:"N\xedvel ID Guardian"}),(0,s.jsx)("span",{className:"inline-flex items-center rounded-pill px-2.5 py-0.5 text-xs font-semibold ".concat(A.className),children:A.label})]}),"basic"===r.level&&(0,s.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,s.jsx)("p",{className:"text-[13px] text-fg-secondary",children:"Complete os passos abaixo pra conquistar o n\xedvel Bronze."}),(0,s.jsx)(S,{done:r.bronze.cpfInformado,label:"CPF informado"}),!r.bronze.cpfInformado&&(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,s.jsx)(d.JU,{children:"CPF"}),(0,s.jsx)(d.pd,{value:x,onChange:e=>h(e.target.value),placeholder:"000.000.000-00"})]}),(0,s.jsx)(S,{done:r.bronze.emailVerificado,label:"E-mail verificado"}),!r.bronze.emailVerificado&&(0,s.jsxs)(d.$n,{variant:"outline",size:"sm",onClick:L,disabled:k.isLoading,className:"w-fit",children:[k.isLoading?(0,s.jsx)(p.A,{className:"h-3.5 w-3.5 animate-spin"}):null,"Reenviar e-mail de confirma\xe7\xe3o"]}),(0,s.jsx)(S,{done:r.bronze.telefoneVerificado,label:"Telefone verificado"}),!r.bronze.telefoneVerificado&&(0,s.jsx)(j,{onVerified:()=>m()}),(0,s.jsxs)(d.$n,{onClick:P,disabled:z.isLoading||!$,className:"flex items-center gap-2",children:[z.isLoading?(0,s.jsx)(p.A,{className:"h-4 w-4 animate-spin"}):null,"Conquistar n\xedvel Bronze"]})]}),"bronze"===r.level&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("p",{className:"text-[13px] text-fg-secondary",children:"N\xedvel Bronze conquistado. Avance pro Prata verificando seu RG/CIN."}),(0,s.jsx)(d.$n,{asChild:!0,className:"w-full",children:(0,s.jsx)(i(),{href:"/verification/prata".concat(C),children:"Avan\xe7ar para Prata"})})]}),"prata"===r.level&&(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("p",{className:"text-[13px] text-fg-secondary",children:"N\xedvel Prata conquistado. Avance pro Gold verificando CNH + CRLV-e."}),(0,s.jsx)(d.$n,{asChild:!0,className:"w-full",children:(0,s.jsx)(i(),{href:"/verification/gold".concat(C),children:"Avan\xe7ar para Gold"})})]}),("gold"===r.level||"verified"===r.level)&&(0,s.jsx)("p",{className:"text-[13px] text-success",children:"N\xedvel m\xe1ximo conquistado."}),b&&(0,s.jsx)(d.$n,{asChild:!0,variant:"outline",className:"w-full",children:(0,s.jsxs)("a",{href:b,children:["Voltar para ",function(e){let a=new URL(e).hostname;return a.startsWith("caixinha.")?"a CaixinhaPix":a}(b)]})})]})}},11445:(e,a,r)=>{async function s(e){try{return await navigator.clipboard.writeText(e),!0}catch(e){return console.error("Erro ao copiar para a \xe1rea de transfer\xeancia:",e),!1}}function n(e){let a=e.replace(/\D/g,"");return 11!==a.length?"":a.replace(/(\d{3})(\d{3})(\d{3})(\d{2})/,"$1.$2.$3-$4")}function t(e){let a=e.replace(/\D/g,"");return a.length<8||a.length>9?"":9===a.length?a.replace(/(\d{2})(\d{3})(\d{3})(\d{1})/,"$1.$2.$3-$4"):a.replace(/(\d{2})(\d{3})(\d{3})/,"$1.$2.$3")}function i(e){let a=e.replace(/\D/g,"");return 11!==a.length?"":a}function l(e){if(!e||!e.match(/^\d{4}-\d{2}-\d{2}$/))return"";let[a,r,s]=e.split("-");return"".concat(s,"/").concat(r,"/").concat(a)}r.d(a,{N:()=>i,XT:()=>t,Yq:()=>l,bb:()=>n,lW:()=>s})},17142:(e,a,r)=>{function s(e){let a;if(!e)return null;try{a=new URL(e)}catch(e){return null}let r=a.hostname.toLowerCase();return"https:"===a.protocol&&("pagcar.com.br"===r||r.endsWith(".pagcar.com.br"))?a.toString():null}function n(e){let a=new URLSearchParams;e.companyId&&a.set("companyId",e.companyId),e.callback&&a.set("callback",e.callback);let r=a.toString();return r?"?".concat(r):""}function t(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1500;setTimeout(()=>{window.location.href=e},a)}r.d(a,{GX:()=>n,d_:()=>t,pq:()=>s})},31420:(e,a,r)=>{let s;r.d(a,{TRPCReactProvider:()=>x,i:()=>f});var n=r(33254),t=r(39238),i=r(81607),l=r(93967),c=r(20836),o=r(53366),d=r(24997);let u=()=>new d.E({defaultOptions:{queries:{staleTime:3e4}}});r(52044);let m=()=>null!=s?s:s=u(),f=(0,c.pY)();function x(e){let a=m(),[r]=(0,t.useState)(()=>(0,l.XT)({transformer:o.Ay,links:[(0,l.$H)({enabled:e=>"down"===e.direction&&e.result instanceof Error}),(0,l.hf)({condition:e=>e.path.startsWith("admin."),true:(0,l.Lb)({url:p()+"/api/trpc",headers:()=>({"x-trpc-source":"nextjs-react"}),fetch:(e,a)=>fetch(e,{...a,credentials:"include"})}),false:(0,l.fu)({url:p()+"/api/trpc",headers:()=>({"x-trpc-source":"nextjs-react"}),fetch:(e,a)=>fetch(e,{...a,credentials:"include"})})})]}));return(0,n.jsx)(i.Ht,{client:a,children:(0,n.jsx)(f.Provider,{client:r,queryClient:a,children:e.children})})}let p=()=>window.location.origin},57912:(e,a,r)=>{r.d(a,{A:()=>s});
1let s=(0,r(49513).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},85888:(e,a,r)=>{var s=r(21520);r.o(s,"useParams")&&r.d(a,{useParams:function(){return s.useParams}}),r.o(s,"usePathname")&&r.d(a,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(a,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(a,{useSearchParams:function(){return s.useSearchParams}})},85950:(e,a,r)=>{r.d(a,{A:()=>s});let s=(0,r(49513).A)("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])}}]);
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.