1import{ag as f,r as n,s as p,j as e,J as j,N as g,C as N,d as k,m as y,B as b,z as w,i as v,U as d,f as C,Y as I}from"./index-DaxYHL_c.js";import{C as B}from"./circle-alert-BSao5Pkh.js";import{T as E}from"./ticket-JL1qSaR5.js";const R=()=>{const{ref:s}=f(),[r,o]=n.useState(!0),[t,m]=n.useState(null),[x,u]=n.useState(null);return n.useEffect(()=>{s&&(async()=>{try{const{data:i,error:L}=await p.functions.invoke("lookup-ticket",{body:null,method:"GET"}),h=`https://rskchedjhiqcqaqgefpi.supabase.co/functions/v1/lookup-ticket?ref=${encodeURIComponent(s)}`,c=await fetch(h,{headers:{apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InJza2NoZWRqaGlxY3FhcWdlZnBpIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjU5NjUxMDEsImV4cCI6MjA4MTU0MTEwMX0.HZndNro1_LqBFF-0Vs41h_kD-QZeBNCAptHDqi6EVuA"}}),l=await c.json();if(!c.ok)throw new Error(l.error||"Booking not found");m(l)}catch(i){u(i instanceof Error?i.message:"Booking not found")}finally{o(!1)}})()},[s]),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs(j,{children:[e.jsx("title",{children:"Ticket Lookup | Elite Weddings & Events"}),e.jsx("meta",{name:"description",content:"Look up your wedding show ticket booking by reference number to view your booking details and confirmation."}),e.jsx("meta",{name:"robots",content:"noindex,follow"})]}),e.jsx(g,{}),e.jsx("main",{className:"container mx-auto px-4 py-12 md:py-20",children:e.jsx(N,{className:"max-w-xl mx-auto border-primary/20",children:e.jsx(k,{className:"py-10",children:r?e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx(y,{className:"w-8 h-8 animate-spin text-primary mx-auto"}),e.jsx("p",{className:"text-muted-foreground",children:"Looking up your bookingâ¦"})]}):x||!t?e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-destructive/10 flex items-center justify-center mx-auto",children:e.jsx(B,{className:"w-7 h-7 text-destructive"})}),e.jsx("h1",{className:"text-xl font-serif text-foreground",children:"Booking not found"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["We couldn't find a booking for reference ",e.jsx("span",{className:"font-mono",children:s}),"."]}),e.jsx(b,{asChild:!0,variant:"outline",children:e.jsx(w,{to:"/events",children:"Browse events"})})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-center space-y-2",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-primary/10 flex items-center justify-center mx-auto",children:e.jsx(v,{className:"w-7 h-7 text-primary"})}),e.jsx("p",{className:"text-xs tracking-[0.3em] uppercase text-muted-foreground",children:"Verified Booking"}),e.jsx("h1",{className:"text-2xl font-serif text-foreground",children:t.eventName})]}),e.jsxs("div",{className:"rounded-lg border bg-muted/30 p-5 space-y-4",children:[e.jsx(a,{icon:e.jsx(E,{className:"w-4 h-4"}),label:"Reference",value:e.jsx("span",{className:"font-mono tracking-widest",children:t.bookingRef})}),e.jsx(a,{icon:e.jsx(d,{className:"w-4 h-4"}),label:"Attendee",value:t.customerName}),e.jsx(a,{icon:e.jsx(d,{className:"w-4 h-4"}),label:"Guests",value:String(t.guestCount)}),e.jsx(a,{icon:e.jsx(C,{className:"w-4 h-4"}),label:"Booked",value:new Date(t.bookedAt).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})})]}),e.jsx("p",{className:"text-xs text-center text-muted-foreground",children:"Please present this screen on arrival. Free entry â no payment required."})]})})})}),e.jsx(I,{})]})},a=({icon:s,label:r,value:o})=>e.jsxs("div",{className:"flex items-center justify-between gap-4 text-sm",children:[e.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[s,r]}),e.jsx("span",{className:"text-foreground font-medium text-right",children:o})]});export{R 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.