1import{j as e}from"./vendor-ui-y7gWrFj_.js";import{n as x,p as u,D as p,N as g,L as h,I as v,B as c,ca as w,F as f,g as d,u as j}from"./index-BQEiBH1l.js";import{r as a}from"./vendor-react-B-LUs8MM.js";import"./vendor-data-BnvdHUK4.js";import"./vendor-charts-cFGvS3Ww.js";import"./vendor-editor-DotdaXd8.js";import"./vendor-dnd-D9eei3Si.js";const F=()=>{x();const{isEditMode:o}=u(),[n,l]=a.useState(""),[s,i]=a.useState("");a.useEffect(()=>{(async()=>{const{data:t}=await d.from("page_content").select("content_value").eq("page_name","view-floorplan").eq("section_name","settings").eq("content_key","viewer-url").maybeSingle();t!=null&&t.content_value&&(l(t.content_value),i(t.content_value))})()},[]);const m=async()=>{if(!s.trim())return;const{error:r}=await d.from("page_content").upsert({page_name:"view-floorplan",section_name:"settings",content_key:"viewer-url",content_value:s,content_type:"text"},{onConflict:"page_name,section_name,content_key"});r||(l(s),j.success("URL saved"))};return e.jsxs(e.Fragment,{children:[e.jsx(p,{titlePrefix:"View Floorplan",description:"View the interactive floorplan for {eventName}."}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(g,{}),e.jsxs("main",{className:"pt-page",children:[e.jsx("section",{className:"pt-page pb-5 bg-white",children:e.jsxs("div",{className:"container mx-auto px-4 text-center",children:[e.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4 text-gradient-title",children:"Event Floorplan"}),e.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Explore our interactive floorplan below"})]})}),e.jsxs("section",{className:"py-8",children:[o&&e.jsx("div",{className:"container mx-auto px-4 mb-4",children:e.jsxs("div",{className:"p-4 bg-muted rounded-lg border border-border",children:[e.jsx(h,{children:"Viewer URL"}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx(v,{value:s,onChange:r=>i(r.target.value),placeholder:"Enter URL",className:"flex-1"}),e.jsx(c,{onClick:m,size:"sm",children:"Save URL"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Supports PDFs, interactive viewers, images, etc."})]})}),n?e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("div",{className:"relative w-full bg-white rounded-lg border border-border shadow-lg overflow-hidden",style:{paddingBottom:"56.25%"},children:e.jsx("iframe",{src:`https://docs.google.com/gview?url=${encodeURIComponent(n)}&embedded=true`,className:"absolute inset-0 w-full h-full border-0",allowFullScreen:!0,title:"Document Viewer"})}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(c,{asChild:!0,children:e.jsxs("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(w,{className:"w-4 h-4 mr-2"}),"Download / Open in new tab"]})})})]}):e.jsx("div",{className:"container mx-auto px-4",children:e.jsx("div",{className:"bg-muted rounded-lg border p-12 text-center",children:e.jsx("p",{className:"text-muted-foreground",children:o?"Enter a URL above":"Coming soon"})})})]})]}),e.jsx(f,{})]})]})};export{F 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.