1import{r as i,j as e}from"./react-vendor-DL_jcNr5.js";import{j as m,b as u,L as d}from"./index-ClFcW42D.js";import{supabase as s}from"./client-CuOizFn0.js";import{t as g}from"./tracking-DO_W2PNK.js";import{B as f}from"./button-2kgo6WVR.js";import{C as k}from"./circle-alert-DpdfW0PM.js";import{L as h}from"./loader-circle-Cgj7qkRR.js";import"./react-query-D7GX_s2z.js";import"./helmet-_v06W0yj.js";import"./legacy-redirects-jyAQCFZG.js";import"./supabase-CinlZVtB.js";import"./radix-dialog-C-yGpOR4.js";import"./radix-core-H7r5-llK.js";import"./floating-ui-Cvfw4c_J.js";import"./tracking-2Am02YXX.js";import"./ui-utils--X5BZniO.js";import"./utils-BGkA_7jJ.js";import"./createLucideIcon-C621SLsM.js";const c={es:{preparing:"Preparando enlace de pago seguroâ¦",error:"No se ha podido generar el enlace de pago.",back:"Ver presupuesto"},en:{preparing:"Preparing secure payment linkâ¦",error:"Could not generate the payment link.",back:"View quote"},fr:{preparing:"Préparation du lien de paiement sécuriséâ¦",error:"Impossible de générer le lien de paiement.",back:"Voir le devis"},it:{preparing:"Preparazione del link di pagamento sicuroâ¦",error:"Impossibile generare il link di pagamento.",back:"Visualizza preventivo"},pt:{preparing:"Preparando link de pagamento seguroâ¦",error:"Não foi possÃvel gerar o link de pagamento.",back:"Ver orçamento"},de:{preparing:"Sicherer Zahlungslink wird vorbereitetâ¦",error:"Der Zahlungslink konnte nicht erstellt werden.",back:"Angebot ansehen"}},T=()=>{const{accessToken:r}=m(),{language:p}=u(),[l,a]=i.useState(!1),o=c[p]||c.es;return i.useEffect(()=>{if(!r){a(!0);return}s.functions.invoke("track-quote-view",{body:{access_token:r}}).catch(()=>{}),g("view_quotation",{access_token:r}),(async()=>{try{const{data:t,error:n}=await s.functions.invoke("create-quote-payment",{body:{access_token:r}});if(n)throw n;if(t?.error)throw new Error(t.error);if(t?.url){window.location.replace(t.url);return}throw new Error("No payment URL returned")}catch{a(!0)}})()},[r]),l?e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-background gap-4 px-6",children:[e.jsx(k,{className:"h-10 w-10 text-destructive"}),e.jsx("p",{className:"text-muted-foreground text-center",children:o.error}),r&&e.jsx(d,{to:`/quote/${r}`,children:e.jsx(f,{variant:"outline",children:o.back})})]}):e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-background gap-4",children:[e.jsx(h,{className:"h-8 w-8 animate-spin text-muted-foreground"}),e.jsx("p",{className:"text-muted-foreground",children:o.preparing})]})};export{T 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.