1import{j as e}from"./vendor-ui-RLVjjRbR.js";import{u as _}from"./vendor-data-BroOEKFd.js";import{u as k,L as y,N as h,B as n,A as p,D as E,g as b,h as u,i as C,M as $,j as q,k as L,l as B,F as D,m as j,n as F,s as f}from"./index-c2K-vwfN.js";import{k as A,u as P,r as T}from"./vendor-react-BjT3qoi-.js";import"./vendor-charts-BX1bV7np.js";import"./vendor-editor-Qa771eO-.js";import"./vendor-dnd-goOuDNTF.js";const R=()=>{const{id:t}=A(),c=P(),{data:a}=k(),[d,m]=T.useState(!1),{data:s,isLoading:N}=_({queryKey:["exhibitor",t],queryFn:async()=>{if(!t)throw new Error("No ID provided");if(F(t)){const{data:r,error:x}=await f.from("exhibitors").select("*").eq("id",t).or("approval_status.eq.approved,approval_status.is.null").eq("is_active",!0).maybeSingle();if(x)throw x;if(r)return r}const{data:i,error:o}=await f.from("exhibitors").select("*").or("approval_status.eq.approved,approval_status.is.null").eq("is_active",!0);if(o)throw o;const l=i==null?void 0:i.find(r=>j(r.name)===t);if(!l)throw new Error("Exhibitor not found");return l}}),g=async()=>{var r;if(!s)return;const i=((r=a==null?void 0:a.event_domain)==null?void 0:r.replace(/^https?:\/\//,""))||window.location.host,o=j(s.name),l=`https://${i}/exhibitors/${o}`;await navigator.clipboard.writeText(l),m(!0),setTimeout(()=>m(!1),2e3)};if(N)return e.jsx("div",{className:"min-h-screen bg-white flex items-center justify-center",children:e.jsx(y,{className:"h-12 w-12 animate-spin text-primary"})});if(!s)return e.jsxs("div",{className:"min-h-screen bg-white pt-page",children:[e.jsx(h,{}),e.jsxs("div",{className:"container mx-auto px-4 py-20 text-center",children:[e.jsx("h1",{className:"text-4xl font-bold text-black mb-4",children:"Exhibitor Not Found"}),e.jsxs(n,{onClick:()=>c("/exhibitors"),children:[e.jsx(p,{className:"mr-2 h-4 w-4"}),"Back to Exhibitors"]})]})]});const w=s.seo_title||`${s.name} - Exhibitor Profile`,v=s.seo_description||`Learn more about ${s.name}, exhibiting at {eventName}. ${(a==null?void 0:a.event_date)||""} at ${(a==null?void 0:a.location)||""}.`;return e.jsxs(e.Fragment,{children:[e.jsx(E,{titlePrefix:w,description:v,keywords:`${s.name}, {eventName}, exhibitor, ${(a==null?void 0:a.location)||""}`}),e.jsxs("div",{className:"min-h-screen flex flex-col bg-white pt-page",children:[e.jsx(h,{}),e.jsx("main",{className:"flex-1",children:e.jsxs("section",{className:"py-12 container mx-auto px-4",children:[e.jsxs(n,{variant:"outline",onClick:()=>c("/exhibitors"),className:"mb-8",children:[e.jsx(p,{className:"mr-2 h-4 w-4"}),"Back to Exhibitors"]}),e.jsxs("div",{className:"grid lg:grid-cols-3 gap-8",children:[e.jsx(b,{className:"lg:col-span-1 bg-white border-border shadow-lg",children:e.jsxs(u,{className:"pt-8",children:[s.logo_url&&e.jsx("div",{className:"w-48 h-48 mx-auto mb-8 rounded-lg overflow-hidden bg-muted p-4 flex items-center justify-center",children:e.jsx("img",{src:s.logo_url,alt:`${s.name} logo`,className:"max-w-full max-h-full object-contain"})}),e.jsx("h1",{className:"text-3xl font-bold text-center text-black mb-6",children:s.name}),e.jsx("div",{className:"flex flex-wrap justify-center gap-2 mt-6",children:s.booth_number&&e.jsxs(C,{variant:"outline",className:"flex items-center gap-1",children:[e.jsx($,{className:"h-3 w-3"}),"Booth ",s.booth_number]})}),s.website&&e.jsx("div",{className:"flex justify-center mt-6 pt-6 border-t border-border",children:e.jsxs("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-primary hover:text-primary/80 transition-colors",children:[e.jsx(q,{className:"h-6 w-6"}),e.jsx("span",{className:"text-sm",children:"Visit Website"})]})})]})}),e.jsx(b,{className:"lg:col-span-2 bg-white border-border shadow-lg",children:e.jsxs(u,{className:"pt-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-black mb-6",children:"About"}),s.description?e.jsx("div",{className:"prose prose-invert max-w-none",children:e.jsx("p",{className:"text-muted-foreground leading-relaxed whitespace-pre-wrap",children:s.description})}):e.jsx("p",{className:"text-muted-foreground italic",children:"No description available yet."}),s.speaking_session&&s.speaking_session_details&&e.jsxs("div",{className:"mt-8 pt-8 border-t border-border",children:[e.jsx("h3",{className:"text-xl font-bold text-black mb-4",children:"Speaking Session"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed whitespace-pre-wrap",children:s.speaking_session_details})]}),s.advertisement&&s.advertisement_details&&e.jsxs("div",{className:"mt-8 pt-8 border-t border-border",children:[e.jsx("h3",{className:"text-xl font-bold text-black mb-4",children:"Advertisement"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed whitespace-pre-wrap",children:s.advertisement_details})]}),e.jsx("div",{className:"mt-8 pt-6 border-t border-border",children:e.jsxs(n,{onClick:g,className:"gap-2",children:[d?e.jsx(L,{className:"h-4 w-4"}):e.jsx(B,{className:"h-4 w-4"}),d?"Link copied!":"Share exhibitor profile"]})})]})})]})]})}),e.jsx(D,{})]})]})};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.