PageSourceSearch

https://visiontradeia.lovable.app/assets/PaymentSuccess-Gg1VyzFO.js

js visiontradeia.lovable.app collected 2026-10-03 05:37:24 UTC 3,426 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-bLiWEUVZ.js","assets/index-HmIOE8X4.css"])))=>i.map(i=>d[i]);
2import{h,F as g,f as y,r as l,j as e,C as u,B as p,_ as b}from"./index-bLiWEUVZ.js";import{C as j}from"./circle-check-big-DLg_atOo.js";import{C as v}from"./camera-CgEqlgJI.js";import{H as N}from"./house-VnZm0rIS.js";const A=()=>{const r=h(),[i]=g(),o=i.get("billing_id")||i.get("session_id"),{toast:t}=y(),[x,f]=l.useState(!0);return l.useEffect(()=>{(async()=>{var c,m;if(o)try{const{supabase:s}=await b(async()=>{const{supabase:d}=await import("./index-bLiWEUVZ.js").then(n=>n.W);return{supabase:d}},__vite__mapDeps([0,1])),{data:{session:a}}=await s.auth.getSession();if(a!=null&&a.access_token)if(((m=(c=(await s.functions.invoke("check-abacate-payment",{body:{billingId:o},headers:{Authorization:`Bearer ${a.access_token}`}})).data)==null?void 0:c.data)==null?void 0:m.status)==="PAID"){t({title:"Pagamento confirmado com sucesso!",description:"Seus créditos foram liberados automaticamente."});const{data:n}=await s.from("user_credits").select("individual_analyses, premium_analyses, enterprise_analyses").eq("user_id",a.user.id).single();console.log("User credits after payment:",n),setTimeout(()=>{r("/dashboard")},1500)}else t({title:"Processando pagamento...",description:"Aguarde a confirmação do pagamento PIX.",variant:"default"});localStorage.removeItem("freeAnalysesLeft")}catch(s){console.error("Error processing payment:",s),t({title:"Erro ao processar pagamento",description:"Tente novamente em alguns instantes.",variant:"destructive"})}f(!1)})()},[o,t]),x?e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs(u,{className:"p-8 text-center max-w-md mx-auto",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"Processando pagamento..."}),e.jsx("p",{className:"text-muted-foreground",children:"Aguarde enquanto confirmamos sua compra."})]})}):e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsxs(u,{className:"p-8 text-center max-w-md mx-auto space-y-6",children:[e.jsx("div",{className:"w-16 h-16 bg-success/10 rounded-full flex items-center justify-center mx-auto",children:e.jsx(j,{className:"h-10 w-10 text-success"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold text-success",children:"Pagamento PIX Confirmado!"}),e.jsx("p",{className:"text-muted-foreground",children:"Sua análise individual foi adicionada com sucesso à sua conta via AbacatePay."})]}),e.jsx("div",{className:"bg-gradient-to-r from-primary/5 to-primary/10 p-4 rounded-lg border border-primary/20",children:e.jsx("p",{className:"text-sm font-medium text-primary",children:"✨ 1 análise disponível para uso imediato"})}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs(p,{className:"w-full bg-gradient-primary hover:opacity-90",onClick:()=>r("/capture"),children:[e.jsx(v,{className:"mr-2 h-4 w-4"}),"Usar Análise Agora"]}),e.jsxs(p,{variant:"outline",className:"w-full",onClick:()=>r("/dashboard"),children:[e.jsx(N,{className:"mr-2 h-4 w-4"}),"Voltar ao Painel"]})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:e.jsx("p",{children:"Dúvidas? Entre em contato conosco."})})]})})};export{A 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.