1import{_ as C}from"./CIcK5AWm.js";import{Q as N,l as V,cl as f,c as n,b as u,w as d,o as a,a as t,k as s,s as j,t as r,d as y,F as I,r as $,j as x,h as F}from"./Cny-jMUR.js";import{_ as T}from"./CSHkLFmR.js";import{u as U}from"./DgD9rLi7.js";const q={class:"min-h-screen w-full flex flex-col justify-center items-center px-4 bg-gray-50 pb-20"},A={key:0,class:"mt-6 text-neutral-500"},D={key:1,class:"mt-6 text-neutral-600"},L={key:2,class:"mt-6 text-left"},Q={class:"rounded-xl border border-neutral-200 p-4"},R={class:"text-lg font-semibold mt-1 truncate overflow-hidden text-ellipsis"},E={class:"mt-4 space-y-3"},G={class:"min-w-0"},M={class:"font-medium truncate"},O={class:"text-sm text-neutral-500"},S={class:"shrink-0 font-medium"},W={class:"flex items-center justify-between"},z={class:"text-xl font-semibold"},H={class:"mt-3 text-sm text-neutral-600"},J={key:0},K=["href"],st=N({__name:"success",async setup(P){let l,c;const m=V().query.session_id,{data:h,pending:b,error:w,execute:k}=([l,c]=f(()=>U("stripe-session",()=>$fetch("/api/stripe/checkout-session",{params:{id:m}}),{immediate:!1})),l=await l,c(),l);m&&([l,c]=f(()=>k()),await l,c());const o=j(()=>h.value??null);function _(p,e){return new Intl.NumberFormat(void 0,{style:"currency",currency:e}).format((p??0)/100)}return(p,e)=>{const v=C,g=F,B=T;return a(),n("div",q,[u(B,{class:"w-full max-w-2xl text-center"},{default:d(()=>[e[5]||(e[5]=t("h1",{class:"text-2xl font-semibold text-neutral-950 my-8"},"Thank you for your purchase!",-1)),s(b)?(a(),n("p",A,"Loading your order detailsâ¦")):s(w)||!s(o)?(a(),n("div",D,[...e[0]||(e[0]=[t("p",null,"We weren't able to load your order details, but your payment went through.",-1),t("p",{class:"mt-2"},"If you need help, please contact support.",-1)])])):(a(),n("div",L,[t("div",Q,[e[2]||(e[2]=t("p",{class:"text-sm text-neutral-500"},"Order",-1)),t("p",R,r(s(o).id),1),u(v,{variant:"outline",color:s(o).payment_status==="paid"?"success":"neutral",class:"mb-8"},{default:d(()=>[y(r(s(o).payment_status),1)]),_:1},8,["color"]),t("div",E,[(a(!0),n(I,null,$(s(o).lineItems,i=>(a(),n("div",{key:i.id,class:"flex items-start justify-between gap-4"},[t("div",G,[t("p",M,r(i.description),1),t("p",O,"Qty "+r(i.quantity),1)]),t("p",S,r(_(i.amount_total,i.currency)),1)]))),128))]),e[3]||(e[3]=t("hr",{class:"my-4"},null,-1)),t("div",W,[e[1]||(e[1]=t("p",{class:"text-neutral-600"},"Total",-1)),t("p",z,r(_(s(o).amount_total,s(o).currency)),1)]),t("div",H,[s(o).customer_email?(a(),n("p",J,"Receipt sent to "+r(s(o).customer_email),1)):x("",!0),s(o).receipt_url?(a(),n("a",{key:1,href:s(o).receipt_url,target:"_blank",rel:"noopener noreferrer",class:"underline"}," View receipt ",8,K)):x("",!0)])])])),u(g,{to:"/dashboard",class:"mt-8 rounded-full"},{default:d(()=>[...e[4]||(e[4]=[y("Go to dashboard",-1)])]),_:1})]),_:1})])}}});export{st 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.