PageSourceSearch

https://contat.eu/_nuxt/b1ncYrzr.js

js contat.eu collected 2026-10-07 06:52:42 UTC 5,863 bytes, 1 lines download raw bytes

1import{s as B,a2 as H,af as D,a5 as j,l as r,i as a,V as t,p as S,S as u,k as q,z as F,L as m,h as k,y as O,W as U,a4 as W,R as I,H as l,x as G,f as K}from"./mxtZ0u3n.js";const Q={class:"quote-page"},J={key:0,class:"quote-card quote-card--message"},X={key:1,class:"quote-card"},Y={class:"quote-head"},Z={class:"quote-client"},ee={key:0,class:"quote-description"},te={class:"quote-total__label"},ae={class:"quote-total__value"},oe={key:1,class:"quote-notice quote-notice--success"},se={key:2,class:"quote-notice"},ne={key:3,class:"quote-actions"},ie=["disabled"],re={key:1,class:"quote-inline"},le=["disabled"],ue=["disabled"],ce={key:4,class:"quote-error",role:"alert"},de={class:"quote-foot"},pe=["href"],me=B({__name:"[token]",async setup(fe){let f,P;const C=H(),v=String(C.params.token||""),{data:s,error:R}=([f,P]=D(()=>U(`quote-${v}`,()=>$fetch(`/api/quotes/${v}`))),f=await f,P(),f),n=m(!1),i=m(""),p=m(!1),b=m(!1),x=m(!1),h=I(null),_=I(null),$=W(),E=k(()=>String(C.query.checkout||"")),w=k(()=>new Intl.NumberFormat("it-IT",{style:"currency",currency:"EUR"}).format((s.value?.amountCents||0)/100)),y=k(()=>E.value==="success"||s.value?.status==="paid"||x.value),T=k(()=>{const o=["Ciao! Ho una domanda sul preventivo"];return s.value?.title&&o.push(`"${s.value.title}"`),`https://wa.me/393293340083?text=${encodeURIComponent(o.join(" "))}`});j({title:"Preventivo riservato",robots:"noindex, nofollow"});async function M(){if(!(!s.value||s.value.status!=="open"||n.value)){n.value=!0,i.value="";try{const o=await $fetch("/api/stripe/quote-checkout",{method:"POST",body:{token:v}});await G(o.url,{external:!0})}catch(o){i.value=o?.data?.statusMessage||"Il pagamento non è disponibile in questo momento. Riprova più tardi."}finally{n.value=!1}}}function A(){const o=getComputedStyle(document.documentElement),e=(g,d)=>o.getPropertyValue(g).trim()||d,c=matchMedia("(prefers-color-scheme: light)").matches||document.documentElement.dataset.colorMode==="light";return{theme:c?"flat":"night",variables:{colorPrimary:e("--primary","#17b0f4"),colorBackground:c?"#ffffff":"#0a0f1a",colorText:c?"#102033":"#f8fafc",colorDanger:"#ef4444",fontFamily:e("--font-sans","Mulish, system-ui, sans-serif"),borderRadius:"12px"}}}function L(o){return new Promise((e,c)=>{if(window.Stripe)return e(window.Stripe(o));const g=document.querySelector('script[src="https://js.stripe.com/v3/"]'),d=g||document.createElement("script"),z=()=>window.Stripe?e(window.Stripe(o)):c(new Error("Stripe non disponibile"));d.addEventListener("load",z,{once:!0}),d.addEventListener("error",()=>c(new Error("Stripe non disponibile")),{once:!0}),g||(d.src="https://js.stripe.com/v3/",document.head.appendChild(d))})}async function V(){if(!s.value||b.value||p.value)return;const o=$.public.stripePublishableKey;if(!o){i.value="Il pagamento integrato non è ancora configurato. Puoi usare la pagina sicura Stripe.";return}p.value=!0,i.value="";try{const{clientSecret:e}=await $fetch("/api/stripe/quote-intent",{method:"POST",body:{token:v}});h.value=await L(o),_.value=h.value.elements({clientSecret:e,appearance:A()}),b.value=!0,await O(),_.value.create("payment").mount("#stripe-payment-element")}catch(e){i.value=e?.data?.statusMessage||"Impossibile preparare il pagamento integrato. Riprova o usa la pagina Stripe."}finally{p.value=!1}}async function N(){if(!(!h.value||!_.value||n.value)){n.value=!0,i.value="";try{const o=await h.value.confirmPayment({elements:_.value,confirmParams:{return_url:window.location.href},redirect:"if_required"});if(o.error){i.value=o.error.message||"Pagamento non riuscito. Riprova.";return}o.paymentIntent?.status==="succeeded"&&(x.value=!0)}catch{i.value="Pagamento non riuscito. Riprova."}finally{n.value=!1}}}return(o,e)=>(l(),r("main",Q,[e[7]||(e[7]=a("div",{class:"quote-glow","aria-hidden":"true"},null,-1)),t(R)||!t(s)?(l(),r("section",J,[...e[0]||(e[0]=[a("p",{class:"quote-kicker"},"Contat",-1),a("h1",null,"Preventivo non disponibile",-1),a("p",{class:"quote-lede"},"Questo link non è valido o il preventivo è stato ritirato.",-1),a("a",{class:"quote-chat",href:"https://wa.me/393293340083",target:"_blank",rel:"noopener"},[a("span",{class:"quote-chat__dot","aria-hidden":"true"}),S(" Scrivici e ti rimandiamo il link ")],-1)])])):(l(),r("section",X,[a("header",Y,[e[2]||(e[2]=a("p",{class:"quote-kicker"},"Preventivo riservato",-1)),a("h1",null,u(t(s).title),1),a("p",Z,[e[1]||(e[1]=S("Preparato per ",-1)),a("strong",null,u(t(s).clientName),1)])]),t(s).description?(l(),r("p",ee,u(t(s).description),1)):q("",!0),a("div",{class:F(["quote-total",{"is-settled":t(y)}])},[a("span",te,u(t(y)?"Importo saldato":"Totale da pagare"),1),a("strong",ae,u(t(w)),1),e[3]||(e[3]=a("span",{class:"quote-total__meta"},"IVA inclusa · pagamento unico",-1))],2),t(y)?(l(),r("p",oe," Pagamento ricevuto. Grazie — ti contattiamo a breve. ")):t(E)==="cancelled"?(l(),r("p",se," Pagamento annullato. Puoi riprovare quando vuoi. ")):q("",!0),t(s).status==="open"&&!t(y)?(l(),r("div",ne,[t(b)?(l(),r("div",re,[e[4]||(e[4]=a("div",{id:"stripe-payment-element"},null,-1)),a("button",{class:"quote-pay",disabled:t(n),onClick:N},u(t(n)?"Elaborazione…":`Conferma ${t(w)}`),9,le)])):(l(),r("button",{key:0,class:"quote-pay",disabled:t(p),onClick:V},u(t(p)?"Preparo il pagamento…":`Paga ${t(w)}`),9,ie)),a("button",{class:"quote-hosted",disabled:t(n),onClick:M},u(t(n)?"Apro Stripe…":"Paga sulla pagina sicura Stripe"),9,ue)])):q("",!0),t(i)?(l(),r("p",ce,u(t(i)),1)):q("",!0),a("footer",de,[a("a",{class:"quote-chat",href:t(T),target:"_blank",rel:"noopener"},[...e[5]||(e[5]=[a("span",{class:"quote-chat__dot","aria-hidden":"true"},null,-1),S(" Hai una domanda? Scrivici su WhatsApp ",-1)])],8,pe),e[6]||(e[6]=a("p",{class:"quote-footnote"},"Pagamento gestito in modo sicuro da Stripe.",-1))])]))]))}}),he=K(me,[["__scopeId","data-v-5f4d7e11"]]);export{he 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.