import{b as Ye,j as e,e as At,u as Rs,L as Is,r as u,a as Ln,f as Js,k as $n}from"./vendor-react-CVHocMAO.js";import{P as _s,s as Wt,o as Yt,i as Cs,b as nt,u as Zs,S as Bn,V as On,E as Xs,v as en,L as tn,a as cs,c as sn,D as Hn,d as Un,e as qn,f as Ss,g as zn,h as Dn,j as os,k as Vn,l as Wn,C as Yn}from"./listingBookingMode-CYE7fK7p.js";import{g as Gt,r as We,a as Gn,c as ks}from"./feeRates-DFYxRksI.js";import{b as Kn}from"./buildVenueDisplayBreakdown-DldcR8er.js";import{j as Qn,bu as As,Y as ds,bv as Jn,F as Y,bw as Ie,y as Kt,z as Qt,bx as Jt,C as Zt,k as Ts,U as nn,by as Zn,N as ss,bz as Xn,B as le,J as rn,K as an,bA as Ps,bB as er,$ as Es,bC as tr,bD as ee,bE as sr,T as nr,bF as rr,bG as ar,bH as us,I as on,R as Fs,bI as Ls,a2 as ms,bJ as xs,O as or,bK as ln,bL as cn,bM as dn,bN as un,bn as mn,bO as xn,bP as hs,E as ir,w as lr,bQ as cr,bR as Ge,bS as dr,bT as hn,x as ur,a4 as zt,G as V}from"./index-DXdAv5n3.js";import{Z as pn,c as mr,S as xr}from"./utils-m29NAvmr.js";import"./vendor-maps-BX5dXCaZ.js";import{i as $s}from"./listing-Dh6xmhdV.js";import{g as hr}from"./wishlists-mdsVtVG_.js";import{f as pr}from"./vendor-amplify-BttVyssp.js";import{g as fr,a as gr,i as fn}from"./claimRequests-LbP6AkmD.js";import{B as xt}from"./badge-Ce5c8tpv.js";import{D as gn}from"./date-picker-BM-CR-Ne.js";import{T as ps}from"./time-picker-htHEl7t7.js";import{I as Xt}from"./ImageWithFallback-BEJkpOin.js";import{g as br,h as yr}from"./cancellationPolicy-n77Qv4xo.js";import{f as fs,g as bn,a as yn,M as ht,r as Bs,i as es,b as gs,v as Os,c as bs,t as rt,m as jn,d as Hs,e as Us}from"./availability-D3RguKHT.js";import{g as Nn,a as vn}from"./listingFeeInput-BVaxVJEf.js";import{L as St}from"./loader-circle-CBzAjQAw.js";import{C as ys}from"./circle-check-CJi34ijI.js";import{C as jr}from"./clock-3-n-4u9h1n.js";import{b as Nr}from"./timelineDisplayUtils-D9E_h4yD.js";import{B as wn}from"./badge-check-CabiHZCA.js";import{S as js}from"./star-WZhRtBdg.js";import{g as _t}from"./vendor-motion-CP2nHqR4.js";import"./confetti.module-B5JVzsfH.js";import{u as vr,B as wr}from"./usePendingBooking-De9PPcaJ.js";import{b as Rr,c as Tr}from"./listings-C5R8R0UD.js";import{b as Mr}from"./venues-B2299m8F.js";import{g as Ir}from"./listing-utils-DWgPJQzT.js";import{p as is}from"./timeUtils-J6UVSYhu.js";import{p as Rn}from"./parseISO-BeqhIhSi.js";import{u as _r}from"./useSeo-BXYcILQx.js";import"./link-2-DaUeWpKB.js";import"./twitter-BCfeMkxW.js";import"./QuantityStepper-Dhv2rSZr.js";import"./minus-C_OHdqnb.js";import"./plus-gZD8KbAO.js";import"./copy--gtFY43f.js";import"./message-circle-IHAKsyw5.js";import"./send-sS4rooCm.js";import"./parse-BXhUshbw.js";import"./calendar-days-BZ6ScuUG.js";import"./vendor-radix-Boyzn9qx.js";import"./differenceInDays-st7ugZrd.js";import"./savedVenues-CqTNNALH.js";import"./calendar-check-gNY_7O9f.js";/**
* @license lucide-react v0.462.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Cr=Qn("Share",[["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["polyline",{points:"16 6 12 2 8 6",key:"m901s6"}],["line",{x1:"12",x2:"12",y1:"2",y2:"15",key:"1p0rca"}]]),Tn=({amenityValues:t,isMobile:s})=>{const[n,a]=Ye.useState(!1),{availableItems:o,unavailableItems:i,byGroup:r}=Ye.useMemo(()=>{const c=[],m=[];for(const[R,_]of Object.entries(As)){const g={key:R,label:_.label,icon:_.icon,group:_.group};t.includes(R)?c.push(g):m.push(g)}for(const R of t)As[R]||c.push({key:R,label:R.replace(/[_-]/g," ").replace(/\b\w/g,_=>_.toUpperCase()),icon:ds,group:"Other"});const b=Jn.map(({id:R,title:_})=>({id:R,title:_,items:c.filter(g=>g.group===R)})).filter(R=>R.items.length>0);return{availableItems:c,unavailableItems:m,byGroup:b}},[t]);if(o.length===0&&i.length===0)return null;const d=o.slice(0,10),l=o.length+i.length,x=c=>{const m=c.icon;return e.jsxs("div",{className:"flex items-center gap-3 text-sm text-gray-700",children:[e.jsx(m,{className:"h-5 w-5 flex-shrink-0"}),e.jsx("span",{children:c.label})]},c.key)},h=c=>{const m=c.icon;return e.jsxs("div",{className:"flex items-center gap-3 text-sm text-gray-400 line-through",children:[e.jsx(m,{className:"h-5 w-5 flex-shrink-0"}),e.jsx("span",{children:c.label})]},c.key)},f=e.jsxs("div",{className:Y("space-y-8",s?"pt-2":"pt-4"),children:[r.map(c=>e.jsxs("div",{children:[e.jsx("h3",{className:Y("font-semibold text-gray-900 mb-4",s?"text-sm":"text-base"),children:c.title}),e.jsx("div",{children:c.items.map((m,b)=>e.jsxs(Ye.Fragment,{children:[e.jsx("div",{className:"py-4",children:x(m)}),b<c.items.length-1&&e.jsx(Ie,{})]},m.key))})]},c.id)),i.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:Y("font-semibold text-gray-900 mb-4",s?"text-sm":"text-base"),children:"Not included"}),e.jsx("div",{children:i.map((c,m)=>e.jsxs(Ye.Fragment,{children:[e.jsx("div",{className:"py-4",children:h(c)}),m<i.length-1&&e.jsx(Ie,{})]},c.key))})]})]});return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"space-y-5",children:[e.jsx("h2",{className:Y("font-semibold text-gray-900",s?"text-lg":"text-xl"),children:"What this venue offers"}),e.jsx("div",{className:Y("grid grid-cols-2",s?"gap-x-4 gap-y-3":"gap-x-8 gap-y-4"),children:d.map(c=>x(c))}),e.jsxs("button",{onClick:()=>a(!0),className:Y("rounded-lg border border-gray-900 font-semibold text-gray-900 hover:bg-gray-50 transition-colors",s?"px-5 py-2.5 text-sm":"px-6 py-3 text-sm"),children:["Show all ",l," amenities"]})]}),e.jsx(Kt,{open:n,onOpenChange:a,children:e.jsxs(Qt,{className:Y(!s&&"max-w-2xl max-h-[90vh] overflow-y-auto"),hideCloseButton:s,mobileBottomSheet:s,children:[e.jsx(Jt,{children:e.jsx(Zt,{className:Y("font-semibold text-gray-900",s?"text-lg":"text-xl"),children:"What this venue offers"})}),f]})})]})};function Sr(t,s=!0){const{user:n}=Ts();return nn({queryKey:["claim-request","me",t,n==null?void 0:n.id],queryFn:()=>fr(t),enabled:!!t&&!!n&&s,staleTime:6e4,retry:!1})}function kr(t){if(!Array.isArray(t))return;const s=t.map(n=>{if(!n||typeof n!="object")return null;const a=n,o=typeof a.platform=="string"?a.platform.trim():"",i=typeof a.url=="string"?a.url.trim():"";if(!o||!i)return null;const r=typeof a.label=="string"?a.label.trim():void 0;return{platform:o,url:i,...r?{label:r}:{}}}).filter(Boolean);return s.length>0?s:void 0}function Ar(t){const s=new Set,n=[];for(const a of t){const o=a.url.trim().toLowerCase();s.has(o)||(s.add(o),n.push(a))}return n}const Mn=({hostProfile:t,listing:s,isMobile:n,onMessageHost:a})=>{var T,k;const o=At(),i=Rs(),{user:r}=Ts(),d=Zn(),l=()=>{if(a){a();return}if(s!=null&&s.listingId){if(!r){const v=`/send_message?listing=${s.listingId}`;Wt(i.pathname)?Yt(v):o("/auth?returnTo="+encodeURIComponent(v));return}d.mutate({listingId:s.listingId,initialMessage:""},{onSuccess:v=>{o(`/messages/${v.conversation.conversationId}`)}})}},x=Ye.useMemo(()=>{const v=typeof t.firstName=="string"?t.firstName.trim():"",w=typeof t.lastName=="string"?t.lastName.trim():"";return v||w?`${v} ${w}`.trim():typeof t.name=="string"&&t.name.trim().length>0?t.name.trim():"Your host"},[t.firstName,t.lastName,t.name]),h=Ye.useMemo(()=>{if(typeof t.hostingSince=="string"&&t.hostingSince.trim())return t.hostingSince.trim();if(s!=null&&s.createdAt)try{return ss(new Date(s.createdAt),"MMMM yyyy")}catch{return"2024"}return"2024"},[t.hostingSince,s==null?void 0:s.createdAt]),f=typeof t.bio=="string"&&t.bio.trim().length>0?t.bio.trim():"We love helping planners create memorable experiences in our space. Reach out with your ideas—we're here to help.",c=typeof t.responseTime=="string"&&t.responseTime.trim().length>0?t.responseTime.trim():"Responds within a few hours",m=typeof t.publicId=="string"&&t.publicId.trim()?t.publicId.trim():null,b=typeof t.avatar=="string"&&t.avatar?t.avatar:void 0,R=Ye.useMemo(()=>{var p,y;const v=((p=s==null?void 0:s.publishedData)==null?void 0:p.onlineProfiles)??((y=s==null?void 0:s.draftData)==null?void 0:y.onlineProfiles),w=kr(v);return w!=null&&w.length?{onlineProfiles:Ar(w)}:{}},[(T=s==null?void 0:s.publishedData)==null?void 0:T.onlineProfiles,(k=s==null?void 0:s.draftData)==null?void 0:k.onlineProfiles]),_=d.isPending?e.jsxs(e.Fragment,{children:[e.jsx(St,{className:"mr-2 h-4 w-4 animate-spin"}),"Opening..."]}):`Message ${x.split(" ")[0]||"Host"}`,g=gr(s),{data:M}=Sr(s==null?void 0:s.listingId,g),N=!!M;if(g&&(s!=null&&s.listingId)){const v=`/venue/${s.listingId}/claim`,w=N?e.jsxs(le,{variant:"outline",size:"sm",className:"rounded-full",disabled:!0,children:[e.jsx(jr,{className:"mr-2 h-4 w-4"}),"Request pending"]}):e.jsx(le,{variant:"outline",size:"sm",className:"rounded-full border-brand bg-white text-brand hover:bg-brand/5 hover:text-brand",asChild:!0,children:e.jsx(Is,{to:v,children:"Claim venue"})});return e.jsxs("section",{id:"host",className:n?"rounded-2xl border border-border/70 bg-white p-4 shadow-sm":"rounded-2xl border border-border/70 bg-white p-6 shadow-sm",children:[e.jsx("h3",{className:n?"text-sm font-semibold text-gray-900":"text-lg font-semibold text-gray-900",children:"Is this your venue?"}),e.jsxs("div",{className:"mt-2 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("p",{className:"text-xs leading-relaxed text-gray-600 sm:flex-1 sm:text-sm",children:"If you own or manage this venue, you can claim it to take control, fix details, or request its removal."}),e.jsx("div",{className:"shrink-0",children:w})]}),e.jsxs(Is,{to:"/listing-disclosure",className:"mt-3 inline-flex items-center gap-1.5 text-xs text-muted-foreground underline-offset-2 hover:underline",children:[e.jsx(Xn,{className:"h-3.5 w-3.5"}),"This venue was listed by PLEC"]})]})}return n?e.jsxs("section",{id:"host",className:"rounded-2xl border border-border/70 bg-white p-4 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Xt,{src:b,alt:x,className:"h-10 w-10 rounded-full object-cover ring-2 ring-border",fallback:"/default-profile-icon.png"}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h3",{className:"text-sm font-semibold text-gray-900",children:["Hosted by ",x]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Hosting on PLEC since ",h]})]})]}),e.jsx(_s,{social:R,className:"mt-2 justify-center"}),e.jsx("p",{className:"mt-3 text-xs text-gray-700 whitespace-pre-line min-w-0 break-words",children:f}),e.jsxs("div",{className:"mt-3 flex flex-col gap-1.5 text-[10px] text-muted-foreground",children:[e.jsxs("span",{children:["• ",c]}),e.jsx("span",{children:"• Verified PLEC partner"})]}),e.jsxs("div",{className:"mt-3 flex flex-col gap-2",children:[m&&e.jsx(le,{variant:"outline",size:"sm",className:"w-full rounded-full text-xs",asChild:!0,children:e.jsx("a",{href:`/u/${m}`,target:"_blank",rel:"noopener noreferrer",children:"View profile"})}),e.jsx(le,{variant:"outline",size:"sm",className:"w-full rounded-full text-xs",onClick:l,disabled:d.isPending||!(s!=null&&s.listingId),children:_})]})]}):e.jsxs("section",{id:"host",className:"space-y-6 min-w-0",children:[e.jsx("h2",{className:"text-2xl font-semibold text-gray-900",children:"Meet your host"}),e.jsxs("div",{className:"rounded-2xl border border-border/70 bg-white p-6 shadow-sm min-w-0 overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4 sm:gap-6",children:[e.jsxs("div",{className:"flex items-center gap-4 min-w-0 flex-1",children:[e.jsx(Xt,{src:b,alt:x,className:"h-16 w-16 shrink-0 rounded-full object-cover ring-2 ring-border",fallback:"/default-profile-icon.png"}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:x}),e.jsx(_s,{social:R})]}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hosting on PLEC since ",h]}),e.jsxs(xt,{className:"mt-1.5 rounded-full bg-brand/10 text-brand border-brand/20 px-2.5 py-0.5 text-xs",children:[e.jsx(ys,{className:"mr-1 h-3 w-3"}),"Verified"]})]})]}),e.jsxs("div",{className:"flex shrink-0 gap-2 sm:flex-row",children:[m&&e.jsx(le,{variant:"outline",size:"sm",className:"rounded-full",asChild:!0,children:e.jsx("a",{href:`/u/${m}`,target:"_blank",rel:"noopener noreferrer",children:"View profile"})}),e.jsx(le,{variant:"outline",size:"sm",className:"rounded-full",onClick:l,disabled:d.isPending||!(s!=null&&s.listingId),children:_})]})]}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-border/60",children:[e.jsx("p",{className:"text-sm text-gray-700 whitespace-pre-line leading-relaxed",children:f}),e.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:[c," · Verified PLEC partner"]})]})]})]})},Pr=6,Er=5;function Fr(t){const s=Date.now()-new Date(t).getTime(),n=Math.floor(s/864e5);if(n<1)return"Today";if(n===1)return"1 day ago";if(n<7)return`${n} days ago`;if(n<14)return"1 week ago";if(n<30)return`${Math.floor(n/7)} weeks ago`;if(n<60)return"1 month ago";if(n<365)return`${Math.floor(n/30)} months ago`;const a=Math.floor(n/365);return`${a} year${a>1?"s":""} ago`}function Lr({rating:t}){return e.jsx("span",{className:"flex items-center gap-px leading-none",children:Array.from({length:5}).map((s,n)=>e.jsx("span",{className:n<t?"text-gray-900":"text-gray-300",children:"★"},n))})}function $r({r:t}){var r,d,l,x;const[s,n]=u.useState(!1),a=180,o=t.comment.length>a,i=!s&&o?t.comment.slice(0,a).trimEnd()+"...":t.comment;return e.jsxs("div",{children:[e.jsxs("div",{className:"mb-3",children:[e.jsx("p",{className:"font-medium text-gray-900 leading-tight",children:t.author}),((r=t.reviewerOrganization)==null?void 0:r.trim())&&e.jsx("p",{className:"text-sm text-muted-foreground leading-tight",children:t.reviewerOrganization.trim()})]}),e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(Lr,{rating:t.rating}),e.jsxs("span",{className:"text-sm text-gray-500",children:["· ",Fr(t.date)]})]}),e.jsx("p",{className:"text-sm leading-relaxed text-gray-700",children:i}),o&&e.jsx("button",{type:"button",onClick:()=>n(h=>!h),className:"mt-1 text-sm font-semibold text-gray-900 underline hover:no-underline",children:s?"Show less":"Show more"}),((l=(d=t.reply)==null?void 0:d.comment)==null?void 0:l.trim())&&e.jsxs("div",{className:"mt-3 ml-3 border-l-2 border-gray-200 pl-4",children:[e.jsxs("p",{className:"text-xs font-medium text-muted-foreground",children:["Host response",(x=t.reply.authorName)!=null&&x.trim()?` · ${t.reply.authorName.trim()}`:""]}),e.jsx("p",{className:"mt-1 text-sm leading-relaxed text-gray-800",children:t.reply.comment.trim()})]})]})}const In=({reviews:t,listingId:s,isMobile:n=!1})=>{const a=u.useMemo(()=>(t==null?void 0:t.slice(0,4))??t,[t]),[o,i]=u.useState(1),r=a&&a.length>0,d=(a??[]).map(c=>c.id).join("|"),l=n?Er:Pr;u.useEffect(()=>{i(1)},[s,d]);const x=u.useMemo(()=>Math.ceil(((a==null?void 0:a.length)||0)/l),[a==null?void 0:a.length,l]),h=u.useMemo(()=>{if(!a||a.length<=l)return a;const c=(o-1)*l;return a.slice(c,c+l)},[a,o,l]),f=()=>{if(x<=1)return[];if(x<=7)return Array.from({length:x},(m,b)=>b+1);const c=[];return o<=3?c.push(1,2,3,"...",x):o>=x-2?c.push(1,"...",x-2,x-1,x):c.push(1,"...",o-1,o,o+1,"...",x),c};return n?e.jsxs("section",{className:"rounded-[32px] border border-border/70 bg-white p-6 shadow-sm","aria-labelledby":"venue-reviews-heading",children:[!r&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Reviews are coming soon. Be one of the first to host your event here."}),e.jsx("div",{className:"mt-5 grid gap-4 md:grid-cols-3",children:["Impeccable staff & seamless planning support","Space looked exactly like the photos – even better","Guests loved the ambiance and amenities"].map(c=>e.jsxs("div",{className:"rounded-2xl border border-border/70 bg-muted/30 p-4 text-sm text-gray-700",children:['"',c,'"']},c))})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-6 space-y-6",children:h.map(c=>{var m,b;return e.jsxs("div",{className:"rounded-2xl border border-border/70 bg-muted/20 p-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-gray-900",children:c.author}),e.jsx("p",{className:"text-xs text-muted-foreground",children:new Date(c.date).toLocaleDateString()})]}),e.jsx("div",{className:"mt-2 flex items-center",children:Array.from({length:5}).map((R,_)=>e.jsx("span",{className:_<c.rating?"text-yellow-500":"text-gray-300",children:"★"},_))}),e.jsx("p",{className:"mt-3 text-sm text-gray-700",children:c.comment}),((b=(m=c.reply)==null?void 0:m.comment)==null?void 0:b.trim())&&e.jsxs("div",{className:"mt-4 ml-3 border-l-2 border-border/80 pl-4",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:"Host response"}),e.jsx("p",{className:"mt-2 text-sm leading-relaxed text-gray-800",children:c.reply.comment.trim()})]})]},c.id)})}),a.length>l&&e.jsx(Br,{currentPage:o,totalPages:x,pages:f(),onPrev:()=>i(c=>Math.max(1,c-1)),onNext:()=>i(c=>Math.min(x,c+1)),onPage:i})]})]}):e.jsxs("section",{"aria-labelledby":"venue-reviews-heading-desktop",children:[!r&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Reviews are coming soon. Be one of the first to host your event here and we'll highlight your experience."}),e.jsx("div",{className:"mt-5 grid gap-4 md:grid-cols-3",children:["Impeccable staff & seamless planning support","Space looked exactly like the photos – even better","Guests loved the ambiance and amenities"].map(c=>e.jsxs("div",{className:"rounded-2xl border border-border/70 bg-muted/30 p-4 text-sm text-gray-700",children:['"',c,'"']},c))})]}),r&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 gap-x-12 gap-y-8",children:h.map(c=>e.jsx($r,{r:c},c.id))}),a.length>l&&e.jsxs("div",{className:"mt-8 flex items-center justify-center gap-2",children:[e.jsx("button",{onClick:()=>i(c=>Math.max(1,c-1)),disabled:o===1,className:"flex h-9 w-9 items-center justify-center rounded-md border border-border/70 bg-white text-gray-700 transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Previous page",children:e.jsx(rn,{className:"h-4 w-4"})}),f().map((c,m)=>c==="..."?e.jsx("span",{className:"px-2 text-gray-500",children:"..."},`e-${m}`):e.jsx("button",{onClick:()=>i(c),className:`flex h-9 w-9 items-center justify-center rounded-md border transition-colors ${o===c?"border-gray-900 bg-gray-900 text-white":"border-border/70 bg-white text-gray-700 hover:bg-gray-50"}`,"aria-label":`Page ${c}`,"aria-current":o===c?"page":void 0,children:c},c)),e.jsx("button",{onClick:()=>i(c=>Math.min(x,c+1)),disabled:o===x,className:"flex h-9 w-9 items-center justify-center rounded-md border border-border/70 bg-white text-gray-700 transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Next page",children:e.jsx(an,{className:"h-4 w-4"})})]})]})]})};function Br({currentPage:t,totalPages:s,pages:n,onPrev:a,onNext:o,onPage:i}){return e.jsxs("div",{className:"mt-8 flex items-center justify-center gap-2",children:[e.jsx("button",{onClick:a,disabled:t===1,className:"flex h-9 w-9 items-center justify-center rounded-md border border-border/70 bg-white text-gray-700 transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Previous page",children:e.jsx(rn,{className:"h-4 w-4"})}),n.map((r,d)=>r==="..."?e.jsx("span",{className:"px-2 text-gray-500",children:"..."},`e-${d}`):e.jsx("button",{onClick:()=>i(r),className:`flex h-9 w-9 items-center justify-center rounded-md border transition-colors ${t===r?"border-gray-900 bg-gray-900 text-white":"border-border/70 bg-white text-gray-700 hover:bg-gray-50"}`,"aria-label":`Page ${r}`,"aria-current":t===r?"page":void 0,children:r},r)),e.jsx("button",{onClick:o,disabled:t===s,className:"flex h-9 w-9 items-center justify-center rounded-md border border-border/70 bg-white text-gray-700 transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50","aria-label":"Next page",children:e.jsx(an,{className:"h-4 w-4"})})]})}const Rt=t=>typeof t=="string"?t:"",Or=t=>Array.isArray(t)?t.filter(s=>typeof s=="string"):[],Ct=({icon:t,title:s,children:n,isMobile:a})=>e.jsxs("div",{className:Y("flex gap-4",a?"py-4":"py-5"),children:[e.jsx(t,{className:"h-5 w-5 flex-shrink-0 text-gray-700 mt-0.5"}),e.jsxs("div",{className:"min-w-0 space-y-1.5",children:[e.jsx("p",{className:Y("font-semibold text-gray-900","text-sm"),children:s}),n]})]}),_n=({policies:t,isMobile:s})=>{const n=Or(t.presetRules),a=Rt(t.customHouseRules)||(t.presetRules==null?Rt(t.houseRules):""),o=Rt(t.cancellationPolicy),i=Rt(t.securityNotes),r=Rt(t.noiseNotes),d=Rt(t.additionalPolicies),l=n.length>0,x=a.trim().length>0,h=l||x,f=[];h&&f.push(e.jsxs(Ct,{icon:Ps,title:"House rules",isMobile:s,children:[l&&e.jsx("div",{className:Y("grid grid-cols-2 gap-x-6 gap-y-2",s?"mt-1":"mt-2"),children:n.map(m=>{const b=er[m];if(!b)return null;const R=b.icon;return e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-700",children:[e.jsx(R,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{children:b.label})]},m)})}),x&&e.jsx("p",{className:Y("text-gray-600 whitespace-pre-line min-w-0 break-words",s?"text-xs":"text-sm",l&&"mt-3"),children:a})]},"house-rules"));const c=br(o);return f.push(e.jsxs(Ct,{icon:Es,title:c.shortLabel,isMobile:s,children:[e.jsx("p",{className:Y("text-gray-600",s?"text-xs":"text-sm"),children:c.description}),t.requiresInsurance&&e.jsx("p",{className:Y("text-gray-600",s?"text-xs":"text-sm"),children:"Certificate of insurance required for all bookings."})]},"cancellation")),i&&f.push(e.jsx(Ct,{icon:Es,title:"Security & insurance",isMobile:s,children:e.jsx("p",{className:Y("text-gray-600 whitespace-pre-line min-w-0 break-words",s?"text-xs":"text-sm"),children:i})},"security")),r&&f.push(e.jsx(Ct,{icon:tr,title:"Noise guidelines",isMobile:s,children:e.jsx("p",{className:Y("text-gray-600 whitespace-pre-line min-w-0 break-words",s?"text-xs":"text-sm"),children:r})},"noise")),d&&f.push(e.jsx(Ct,{icon:Ps,title:"Additional policies",isMobile:s,children:e.jsx("p",{className:Y("text-gray-600 whitespace-pre-line min-w-0 break-words",s?"text-xs":"text-sm"),children:d})},"additional")),e.jsxs("section",{className:"space-y-0",children:[e.jsx("h2",{className:Y("font-semibold text-gray-900",s?"text-lg":"text-xl"),children:"House rules & policies"}),e.jsx("div",{children:f.map((m,b)=>e.jsxs(Ye.Fragment,{children:[m,b<f.length-1&&e.jsx(Ie,{})]},b))})]})};function Ns(t,s,n,a){if(!a||a<=0)return Math.max(s,Math.min(n,t));const o=Math.floor((n-s)/a),i=Math.round((t-s)/a);return s+Math.min(i,o)*a}function vs(t,s){const n=s.find(a=>a.sliderId===t.id);return Ns((n==null?void 0:n.value)??t.min,t.min,t.max,t.stepSize)}function Cn(t){return typeof t.perUnitPrice=="number"&&Number.isFinite(t.perUnitPrice)}function Hr(t,s){const n=t.map(i=>({slider:i,value:vs(i,s)})),a=n.filter(({slider:i})=>Cn(i));if(a.length>=2)return a.reduce((i,{slider:r,value:d})=>i+d*(r.perUnitPrice??0),0);if(a.length===1){const i=a[0].slider.perUnitPrice??1;return n.filter(({slider:d})=>d.dimension!=="price").reduce((d,{value:l})=>d*l,1)*i}const o=n.filter(({slider:i})=>i.dimension==="price").reduce((i,{value:r})=>i+r,0);return o>0?o:n.reduce((i,{value:r})=>i*r,1)}function Ur(t){return st(t,t.map(s=>({sliderId:s.id,value:s.min})))}function st(t,s){return t.length===0?0:t.length===1&&t[0].dimension==="price"?vs(t[0],s):t.length===1&&Cn(t[0])?vs(t[0],s)*(t[0].perUnitPrice??0):Hr(t,s)}function qr(t,s){const n=typeof t=="number"?t:null,a=typeof s=="number"?s:null;return n!==null&&a!==null?`${n}–${a}`:n!==null?`${n}+`:a!==null?`Up to ${a}`:null}function zr(t,s){const n=Gt(t.minPrice,s),a=t.maxPrice&&t.maxPrice!==t.minPrice?Gt(t.maxPrice,s):null;return a!==null?`${ee(n)}–${ee(a)}`:ee(n)}function Dr({pkg:t,isSelected:s,sliderExpanded:n,onSelect:a,feeInput:o}){const i=t.priceType==="per_person"?"/person":t.priceType==="per_hour"?"/hr":t.priceType==="per_person_per_hour"?"/person/hr":"/event",r=zr(t,o),d=qr(t.minAttendees,t.maxAttendees);return e.jsx("button",{type:"button",onClick:a,className:Y("relative border p-4 text-left transition-all w-full",n?"rounded-t-2xl rounded-b-none":"rounded-2xl",s?"border-brand bg-brand/5 shadow-sm":"border-border/70 bg-white hover:border-brand/50 hover:shadow-sm"),children:e.jsx("div",{className:"flex items-start justify-between min-w-0 gap-2",children:e.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h4",{className:"font-semibold text-gray-900 min-w-0 break-words",children:t.name}),t.includesVenueRental&&e.jsx(xt,{variant:"secondary",className:"rounded-full text-[10px]",children:"Includes venue rental"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[d&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{children:["Attendees: ",d]}),e.jsx("span",{children:"•"})]}),t.pricingMode==="self_service_range"?e.jsxs("span",{className:"font-medium text-gray-900",children:["Starting at ",t.sliders&&t.sliders.length>0?ee(Ur(t.sliders)):ee(t.minPrice)]}):e.jsxs("span",{className:"font-medium text-gray-900",children:[r,i]})]}),t.description&&e.jsx("p",{className:"text-xs text-gray-600 min-w-0 break-words break-all whitespace-pre-line",children:t.description})]})})})}function Vr({sliders:t,selections:s,onChange:n}){const a=(r,d)=>{const l=s.find(x=>x.sliderId===r);return(l==null?void 0:l.value)??d.min},o=(r,d,l)=>{const x=Ns(d,l.min,l.max,l.stepSize),h=s.filter(f=>f.sliderId!==r).concat({sliderId:r,value:x});n(h)},i=st(t,s);return e.jsxs("div",{className:"space-y-4 rounded-b-2xl border border-t-0 border-brand bg-brand/5 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Customize your package"}),e.jsx("p",{className:"text-base font-semibold text-gray-900",children:ee(i)})]}),t.map(r=>{const d=a(r.id,r),l=Ns(d,r.min,r.max,r.stepSize),x=r.label||(r.dimension==="price"?"Amount":r.dimension==="quantity"?"Quantity":"Hours"),h=r.unit||(r.dimension==="price"||r.dimension==="quantity"?"":"hr"),f=r.dimension==="price"?ee(l):`${l}${h?" "+h:""}`;if(r.inputMode==="steps"&&r.stepSize&&r.stepSize>0){const c=Math.floor((r.max-r.min)/r.stepSize),m=Array.from({length:c+1},(b,R)=>r.min+R*r.stepSize).filter(b=>b>0);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:x}),e.jsx("span",{className:"font-medium text-gray-900",children:f})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.map(b=>e.jsx("button",{type:"button",onClick:()=>o(r.id,b,r),className:Y("rounded-lg border px-2.5 py-1 text-xs font-medium transition-all",Math.abs(l-b)<.001?"border-brand bg-brand text-white":"border-border/70 text-gray-700 hover:border-brand/50"),children:r.dimension==="price"?ee(b):`${b}${h?" "+h:""}`},b))})]},r.id)}return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:x}),e.jsx("span",{className:"font-medium text-gray-900",children:f})]}),e.jsx("input",{type:"range",min:r.min,max:r.max,step:r.stepSize??1,value:l,onChange:c=>o(r.id,Number(c.target.value),r),className:"w-full accent-brand"}),e.jsxs("div",{className:"flex justify-between text-[10px] text-muted-foreground",children:[e.jsx("span",{children:r.dimension==="price"?ee(r.min):`${r.min}${h?" "+h:""}`}),e.jsx("span",{children:r.dimension==="price"?ee(r.max):`${r.max}${h?" "+h:""}`})]})]},r.id)})]})}const Sn=({packages:t,selectedPackageIds:s,onTogglePackage:n,isMobile:a,sliderSelections:o,onSliderSelectionsChange:i,feeInput:r,optional:d=!1})=>{if(t.length===0)return null;const l=t.filter(m=>s.includes(m.id)),x=l.find(m=>m.includesVenueRental)??null,h=l.some(m=>m.pricingMode==="self_service_range"),f=l.some(m=>m.priceType==="per_hour"||m.priceType==="per_person_per_hour"),c=l.some(m=>m.priceType==="per_person_per_hour");return e.jsxs("div",{className:Y("space-y-3",!a&&"min-w-0"),children:[e.jsxs("h3",{className:"text-sm font-semibold text-gray-900",children:["Select a package",d&&e.jsx("span",{className:"font-normal text-muted-foreground",children:" (optional)"})]}),e.jsx("div",{className:Y("space-y-3",!a&&"grid min-w-0 gap-3"),children:t.map(m=>{var g;const b=s.includes(m.id),R=m.pricingMode==="self_service_range"&&(((g=m.sliders)==null?void 0:g.length)??0)>0,_=b&&R;return e.jsxs("div",{children:[e.jsx(Dr,{pkg:m,isSelected:b,sliderExpanded:_,onSelect:()=>n(m.id),feeInput:r}),_&&e.jsx(Vr,{sliders:m.sliders,selections:o??[],onChange:i??(()=>{})})]},m.id)})}),l.length>0?e.jsxs("div",{className:"rounded-2xl border border-border/70 bg-brand/10 p-3 text-xs text-brand space-y-1",children:[x&&e.jsxs("p",{children:[e.jsx("strong",{children:x.name})," includes venue rental and replaces hourly pricing."]}),h&&e.jsx("p",{children:"Adjust the sliders above to pick your amount. You'll check out at the selected price."}),f&&e.jsxs("p",{children:["Hourly package totals update with duration",c?" and guest count":"","."]})]}):null]})};function Wr({rateLabel:t}){return e.jsx("div",{className:"rounded-2xl border border-amber-200 bg-amber-50/80 p-3",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(sr,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-amber-600"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-amber-900",children:"Overtime Is Post-Booking Only"}),e.jsx("p",{className:"text-xs leading-5 text-amber-800",children:"The booking total shown here only covers the scheduled time you book now. Overtime is never included upfront and can only be requested by the host after the booking if the event runs longer than scheduled."}),t&&e.jsxs("p",{className:"text-xs font-medium text-amber-900",children:["Posted overtime rate: ",t]})]})]})})}function Yr(t,s,n){const a=ee(t.unitPrice);switch(t.priceModel){case"fixed_per_guest":case"per_person":return`${a}/person × ${s} guest${s===1?"":"s"}`;case"fixed_per_hour":case"per_hour":return`${a}/hr × ${fs(n)}`;case"fixed_per_guest_hour":case"per_person_per_hour":return`${a}/person/hr × ${s} guest${s===1?"":"s"} × ${fs(n)}`;case"fixed_per_event":case"per_event":return"flat rate";case"fixed_per_quantity":return t.quantity?`${a} × ${t.quantity}`:null;default:return null}}const ws=({pricing:t,authoritativeDisplayBreakdown:s,selectedPackage:n,guestCount:a,transformedVenue:o,metadata:i,isMobile:r,variant:d="default",previewState:l,sliderSelections:x,taxStatus:h="calculated_at_checkout",taxJurisdictionCollected:f=!1})=>{var P,W,U,q,K,Z;const c=n!=null&&n.includesVenueRental?n:null,m=n?[n]:[],b=(n==null?void 0:n.pricingMode)==="self_service_range"&&((P=n.sliders)!=null&&P.length)?st(n.sliders,x??[]):null,R=b===null||b>0,_=d==="compact",g=d==="dialog",M="text-sm",N=r||g?"space-y-3":"rounded-2xl border border-border/70 bg-white p-6 shadow-sm",T=new Map(((s==null?void 0:s.packages)??[]).map(F=>[F.packageId,F.amount])),k=(s==null?void 0:s.cleaningFee)??t.cleaningFee,v=((s==null?void 0:s.packages)??[]).reduce((F,te)=>F+te.amount,0),w=c?null:t.hourlyRentalCost,p=(s==null?void 0:s.baseRateTotal)??w,y=(s==null?void 0:s.baseRateHourly)??(w!==null&&t.actualHours>0?Math.round(w/t.actualHours*100)/100:null),I=(s==null?void 0:s.total)??t.pricingBreakdown.total,E=s?Math.round(((p??0)+(k??0)+v)*100)/100:null,B=t.pricingBreakdown.subtotal??t.estimatedSubtotal,z=E??B,O=((W=t.advanceBookingModifier)==null?void 0:W.type)==="early_bird"?t.advanceBookingModifier:null,$=(O==null?void 0:O.displayDiscountAmount)??0,S=(s==null?void 0:s.serviceFee)??t.pricingBreakdown.serviceFee;if((n==null?void 0:n.pricingMode)==="self_service_range"&&(((U=n.sliders)==null?void 0:U.length)??0)>0&&!R){const F=e.jsxs("div",{className:Y("min-w-0",r||g?"space-y-3":"space-y-3 text-sm"),children:[e.jsxs("div",{className:"flex flex-col items-center gap-2 rounded-2xl border border-dashed border-border/70 py-6 px-4 text-center text-muted-foreground",children:[e.jsx(nr,{className:"h-5 w-5 text-muted-foreground/50"}),e.jsx("p",{className:"text-sm",children:"Select a package amount above $0 to see your price breakdown."})]}),((q=i.pricing)==null?void 0:q.pricingNotes)&&e.jsx("div",{className:"mt-4 rounded-2xl bg-brand/10 p-3 text-xs text-brand min-w-0 break-words",children:i.pricing.pricingNotes})]});return _||g?F:e.jsx("div",{className:N,children:F})}const H=e.jsxs("div",{className:Y("min-w-0",r||g?"space-y-3":"space-y-3 text-sm"),children:[y!==null&&p!==null&&p>0&&!c?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{children:["Hourly Rate (",fs(t.actualHours)," × ",ee(y),")"]}),e.jsx("span",{className:`font-medium text-gray-900 ${M}`,children:ee(p)})]})}):null,((s==null?void 0:s.packages.length)??0)>0&&e.jsx(e.Fragment,{children:s==null?void 0:s.packages.map(F=>{const te=F.timelineAdjustment&&F.guestBaseAmount!==void 0?Nr(F.timelineAdjustment,F.guestBaseAmount,F.amount):null,Q=F.guestBaseAmount??F.amount;return e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("span",{className:"min-w-0",children:F.isAddon?`+ ${F.packageName}`:F.packageName}),e.jsx("span",{className:`font-medium text-gray-900 shrink-0 ${M}`,children:ee(Q)})]}),te&&e.jsxs("div",{className:"flex justify-between text-xs text-green-700",children:[e.jsxs("span",{children:[te.label," (",te.pct>0?"+":"",te.pct,"%)"]}),e.jsx("span",{children:ee(te.delta)})]})]},F.packageId)})}),k!=null&&k>0&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Cleaning fee"}),e.jsx("span",{className:`font-medium text-gray-900 ${M}`,children:ee(k)})]}),O&&$>0&&e.jsxs("div",{className:"flex items-center justify-between text-emerald-700",children:[e.jsxs("span",{children:["Early-bird discount",e.jsxs("span",{className:"ml-1 text-xs text-emerald-600/80",children:["(",O.discountPercent,"% · booked ",O.daysAheadActual," days ahead)"]})]}),e.jsxs("span",{className:`font-medium ${M}`,children:["−",ee($)]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:"Venue booking subtotal"}),e.jsx("span",{className:`font-medium text-gray-900 ${M}`,children:z!==null?ee(z):"—"})]}),!(m.length>0&&!c&&t.hourlyRentalCost!==null)&&((K=l==null?void 0:l.selectionSnapshots)==null?void 0:K.filter(F=>F.selectionType==="add_on").map(F=>{const te=T.get(F.sourceEntityId)??F.finalAmount,Q=Yr(F,a,t.actualHours);return e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:`font-medium text-gray-900 ${M}`,children:[F.name,e.jsx(xt,{variant:"outline",className:"ml-2 rounded-full text-xs",children:"Add-on"})]}),e.jsx("span",{className:`font-medium text-gray-900 ${M}`,children:ee(te)})]}),Q&&e.jsx("p",{className:"text-xs text-muted-foreground",children:Q})]},F.sourceEntityId)})),e.jsx(Ie,{}),t.overtimeRate!==void 0&&t.overtimeRate>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between text-muted-foreground",children:[e.jsx("span",{children:"Overtime rate (post-booking only)"}),e.jsx("span",{children:ee(t.overtimeRate)??"—"})]}),e.jsx(Wr,{rateLabel:ee(t.overtimeRate)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"If the event goes longer than the scheduled time, the host may submit a separate post-booking overtime request using this rate."})]}),e.jsx(rr,{taxStatus:h,taxJurisdictionCollected:f,className:"text-muted-foreground text-sm"}),e.jsx(ar,{serviceFeeCents:S!==null?Math.round(S*100):null,pendingLabel:"Calculated at checkout",className:"text-muted-foreground text-sm"}),e.jsx(Ie,{}),e.jsxs("div",{className:"flex items-center justify-between text-base font-semibold text-gray-900",children:[e.jsx("span",{children:(l==null?void 0:l.status)==="loading"?"Calculating...":t.pricingBreakdown.isAuthoritative?"Total":"Estimated total"}),e.jsx("span",{children:(l==null?void 0:l.status)==="loading"?e.jsx(St,{className:"h-4 w-4 animate-spin text-muted-foreground"}):I!==null?ee(I):"Request quote"})]}),(n==null?void 0:n.pricingMode)==="self_service_range"&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"Price based on your slider selection — locked in at checkout."}),(l==null?void 0:l.status)==="error"&&e.jsx("p",{className:"text-xs text-amber-700",children:"Live pricing unavailable — showing an estimate. Your exact total is confirmed at checkout."}),(l==null?void 0:l.status)!=="error"&&!t.pricingBreakdown.isAuthoritative&&t.pricingBreakdown.notes&&e.jsx("p",{className:"text-xs text-muted-foreground min-w-0 break-words",children:t.pricingBreakdown.notes}),((Z=i.pricing)==null?void 0:Z.pricingNotes)&&e.jsx("div",{className:"mt-4 rounded-2xl bg-brand/10 p-3 text-xs text-brand min-w-0 break-words",children:i.pricing.pricingNotes})]});return _||g?H:e.jsx("div",{className:N,children:H})};function kt({guestCount:t,venueCapacityMin:s,venueCapacityMax:n,packageGuestMin:a,packageGuestMax:o}){return typeof s=="number"&&s>0&&t<s?{title:"Guest count too low",description:`This venue requires a minimum of ${s} guests.`}:typeof n=="number"&&n>0&&t>n?{title:"Guest count too high",description:`This venue has a maximum capacity of ${n} guests.`}:typeof a=="number"&&a>0&&t<a?{title:"Guest count too low for selected package",description:`The selected package requires a minimum of ${a} guests.`}:typeof o=="number"&&o>0&&t>o?{title:"Guest count too high for selected package",description:`The selected package allows a maximum of ${o} guests.`}:null}const kn=({venueCapacityMax:t,packageGuestMax:s,defaultMax:n=500})=>{const a=[n];return Cs(t)&&a.push(t),Cs(s)&&a.push(s),Math.min(...a)},An=(t,s)=>Math.max(1,Math.min(s,t)),Pn=t=>{const{enteredValue:s,adjustedValue:n,upperBound:a,limitLabel:o}=t;return s===n?null:s>a?`Adjusted to ${n} guests to match ${o}.`:s<1?"Guest count must be at least 1.":null};function qs({onClick:t,loading:s=!1,acceptsInstantBookings:n=!0,text:a,loadingText:o,className:i="",disabled:r=!1,canAnimate:d=!0,validate:l,iconPath:x}){const h=u.useRef(null),f=u.useRef(null),c=u.useRef(null),m=u.useRef(null),b=u.useRef(null),R=u.useRef(null),_=u.useRef(null),g=u.useRef(null),M=u.useRef(null),N=u.useRef(null),T=u.useRef(!1),k=s?o??(n?"Adding...":"Submitting..."):a??(n?"Book now":"Request Venue");u.useEffect(()=>(m.current&&_t.set(m.current,{y:-24,opacity:0}),R.current&&_t.set(R.current,{opacity:0,scale:1}),c.current&&_t.set(c.current,{force3D:!0}),f.current&&_t.set(f.current,{force3D:!0}),()=>{var p;(p=N.current)==null||p.kill(),N.current=null,T.current=!1}),[]);const v=u.useCallback(()=>{if(T.current||s||r)return;if(l&&!l()){t();return}if(!d){t();return}T.current=!0;const p=h.current;p&&(p.dataset.adding="true");const y=b.current,I=c.current;if(!y||!I){t(),T.current=!1;return}const E=y.getBoundingClientRect(),B=I.getBoundingClientRect(),z={x:E.left-B.left},O=m.current,$=f.current,A=g.current,S=_.current,H=M.current,P=R.current;if(!O||!$||!A||!S||!H||!P){t(),T.current=!1,p&&(p.dataset.adding="false");return}const W=_t.timeline({defaults:{duration:.2,ease:"power2.out"},onComplete:()=>{T.current=!1,p&&(p.dataset.adding="false"),N.current=null,requestAnimationFrame(()=>{t()})}});N.current=W,W.to(I,{x:z.x,duration:.18}).to(I,{rotate:-20,yoyo:!0,repeat:1,duration:.09},0).to($,{opacity:0,x:z.x,duration:.15,filter:"blur(8px)"},0).to(O,{y:0,duration:.12,delay:.08}).to(A,{opacity:1,duration:.12},"<").set(S,{opacity:0}).to(I,{x:z.x*4,duration:.4,delay:.08}).to(I,{rotate:-30,duration:.12},"<").to(H,{opacity:1,duration:.18},"<").to(P,{opacity:1,scale:1.3,duration:.2},"<").set($,{x:0,xPercent:0}).set(I,{opacity:0,x:0,rotate:0}).set(O,{y:-24}).set(P,{opacity:0,scale:1}).to([A,H],{opacity:0,duration:.3,delay:.1}).to($,{xPercent:0,opacity:1,duration:.15}).set($,{filter:"blur(0px)"}).set(I,{opacity:1,x:0},"<").to(S,{opacity:1,duration:.5,ease:"power2.in"})},[s,r,t,d,l]),w=s||r;return e.jsx("div",{className:`atc-wrapper ${i}`.trim(),children:e.jsxs("button",{ref:h,className:"atc","aria-label":k,onClick:v,disabled:w,"data-adding":"false",children:[e.jsxs("span",{className:"atc__content",children:[e.jsx("span",{ref:c,className:"atc__cart",children:e.jsx("svg",{className:"atc__icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"#ffffff",d:x??"M2.25 2.25a.75.75 0 0 0 0 1.5h1.386c.17 0 .318.114.362.278l2.558 9.592a3.752 3.752 0 0 0-2.806 3.63c0 .414.336.75.75.75h15.75a.75.75 0 0 0 0-1.5H5.378A2.25 2.25 0 0 1 7.5 15h11.218a.75.75 0 0 0 .674-.421 60.358 60.358 0 0 0 2.96-7.228.75.75 0 0 0-.525-.965A60.864 60.864 0 0 0 5.68 4.509l-.232-.867A1.875 1.875 0 0 0 3.636 2.25H2.25ZM3.75 20.25a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM16.5 20.25a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z"})})}),e.jsx("span",{ref:b,className:"atc__cart--dummy",children:e.jsx("svg",{className:"atc__icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:e.jsx("path",{fill:"#ffffff",d:x??"M2.25 2.25a.75.75 0 0 0 0 1.5h1.386c.17 0 .318.114.362.278l2.558 9.592a3.752 3.752 0 0 0-2.806 3.63c0 .414.336.75.75.75h15.75a.75.75 0 0 0 0-1.5H5.378A2.25 2.25 0 0 1 7.5 15h11.218a.75.75 0 0 0 .674-.421 60.358 60.358 0 0 0 2.96-7.228.75.75 0 0 0-.525-.965A60.864 60.864 0 0 0 5.68 4.509l-.232-.867A1.875 1.875 0 0 0 3.636 2.25H2.25ZM3.75 20.25a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM16.5 20.25a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0Z"})})}),e.jsx("span",{ref:R,className:"atc__check",children:e.jsx("svg",{className:"atc__icon",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"#ffffff",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}),e.jsx("span",{ref:f,className:"atc__text",children:k})]}),e.jsx("span",{ref:_,className:"atc__border atc__border--animated"}),e.jsx("span",{ref:g,className:"atc__border atc__border--static"}),e.jsx("span",{ref:M,className:"atc__border atc__border--complete"}),e.jsx("svg",{ref:m,className:"atc__item",style:{position:"absolute",left:"50%",top:"50%",width:"16px",height:"16px",transform:"translate(-50%, -50%)",opacity:0,pointerEvents:"none",zIndex:10},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:e.jsx("rect",{width:"16",height:"16",rx:"2",fill:"#ffffff",x:"4",y:"4"})})]})})}const Gr=({pricing:t,selectedPackage:s,selectedPackages:n,transformedVenue:a,eventDate:o,setEventDate:i,startTime:r,setStartTime:d,endTime:l,setEndTime:x,guestCount:h,setGuestCount:f,durationHours:c,durationMinutes:m,setDurationMinutes:b,schedule:R,blockedDates:_=[],bookingWindowDays:g,minimumLeadTimeHours:M,startTimeOptions:N=[],endTimeOptions:T=[],startTimeMinTime:k,startTimeMaxTime:v,endTimeMinTime:w,endTimeMaxTime:p,onAddToCart:y,onClearPackages:I,cartLoading:E,acceptsInstantBookings:B=!0,validateBeforeAnimate:z,specialRequests:O,setSpecialRequests:$,bookingDisabled:A=!1,bookingDisabledMessage:S,venueCapacityMin:H,venueCapacityMax:P,packageGuestMin:W,packageGuestMax:U,previewState:q,plannerHighlights:K,sliderSelections:Z,avgRating:F,totalReviews:te,breakdownProps:Q})=>{var we;const oe=u.useMemo(()=>{var L;return(s==null?void 0:s.pricingMode)!=="self_service_range"||!((L=s.sliders)!=null&&L.length)?!0:st(s.sliders,Z??[])>0},[s,Z]),_e=n??(s?[s]:[]),ue=_e.some(L=>L.priceType==="per_hour"||L.priceType==="per_person_per_hour"),ce=_e.some(L=>L.priceType==="per_person"||L.priceType==="per_person_per_hour"),he=_e.some(L=>L.priceType==="per_person_per_hour"),Ce=u.useMemo(()=>!!(o&&r&&l&&h>=1),[o,r,l,h]),ye=u.useMemo(()=>kt({guestCount:h,venueCapacityMin:H??void 0,venueCapacityMax:P??void 0,packageGuestMin:W??void 0,packageGuestMax:U??void 0}),[h,H,P,W,U]),Se=u.useMemo(()=>{if(!r||!l||!o)return null;try{const{startDateTime:L,endDateTime:re}=nt(o,r,l),me=new Date(L),Ae=new Date(re);if(isNaN(me.getTime())||isNaN(Ae.getTime()))return null;if(Ae<=me)return{title:"Invalid time range",description:"End time must be after start time."}}catch{return null}return null},[r,l,o]),He=u.useMemo(()=>!o||!r||!l?!1:nt(o,r,l).spansNextDay,[o,r,l]),at=u.useMemo(()=>bn(),[]),pe=u.useMemo(()=>kn({venueCapacityMax:P,packageGuestMax:U}),[P,U]),ot=u.useMemo(()=>{const L=typeof P=="number"&&Number.isFinite(P)&&P>0,re=typeof U=="number"&&Number.isFinite(U)&&U>0;return L&&re?"venue and selected package guest limits":re?"selected package guest limit":L?"venue guest limit":"guest limits"},[P,U]),Ue=u.useMemo(()=>yn({schedule:R,blockedDates:_??[],bookingWindowDays:g,minimumLeadTimeHours:M}),[R,_,g,M]),{minDate:ft,maxDate:Ke,disabledDates:Fe}=Ue,fe=Zs({eventDate:o,startTime:r,durationMinutes:m,guestCount:h,guestMin:H??1,guestMax:P??9999,requiresEventLocation:!1,hasVerifiedEventLocation:!1,requiresPackageSelection:!1,packageSelected:!1}),[ke,ve]=u.useState(h.toString()),[de,qe]=u.useState(()=>h===20),[ze,Le]=u.useState(null);u.useEffect(()=>{ve(h.toString())},[h]);const $e=L=>{qe(!1),ve(L.target.value)},Be=()=>{const L=parseInt(ke,10);if(!isNaN(L)&&L>0){qe(!1);const re=An(L,pe);f(re),ve(re.toString()),Le(Pn({enteredValue:L,adjustedValue:re,upperBound:pe,limitLabel:ot}))}else ve(h.toString()),Le("Guest count must be at least 1.")},Qe=L=>{L.key==="Enter"&&(L.currentTarget.blur(),Be())},Oe=()=>e.jsxs("div",{className:"mt-5",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] font-bold uppercase tracking-wide text-gray-900",children:"DATE"}),e.jsx(gn,{value:o?(()=>{const[L,re,me]=o.split("-").map(Number);return new Date(L,re-1,me)})():null,onChange:L=>{i(L?ss(L,"yyyy-MM-dd"):"")},placeholder:"Select date",minDate:ft,maxDate:Ke,disabledDates:Fe,plannerHighlights:K})]}),e.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-[10px] font-bold uppercase tracking-wide text-gray-900",children:"START TIME"}),e.jsx(ps,{value:r,onChange:d,placeholder:"Add time",options:N,minTime:k,maxTime:v,disabled:!o})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"mb-1 text-[10px] font-bold uppercase tracking-wide text-gray-900",children:["END TIME",He&&e.jsx("span",{className:"ml-1 font-normal normal-case text-muted-foreground",children:"(next day)"})]}),e.jsx(ps,{value:l,onChange:x,placeholder:"Add time",options:T,minTime:w,maxTime:p,disabled:!r})]})]}),e.jsxs("p",{className:"pt-1 text-[11px] text-muted-foreground",children:["All times in ",at]}),e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"mb-1 text-[10px] font-bold uppercase tracking-wide text-gray-900",children:"GUESTS"}),e.jsx("div",{className:"relative",children:e.jsx(on,{type:"number",min:1,max:pe,value:ke,onChange:$e,onBlur:Be,onKeyDown:Qe,onInvalid:L=>{L.preventDefault()},className:Y("h-11 rounded-lg [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none [-moz-appearance:textfield]",de&&"text-gray-400")})}),pe<500&&e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Up to ",pe," guests for this booking."]}),ze&&e.jsx("p",{className:"mt-1 text-xs text-amber-700",children:ze}),ye&&e.jsx("p",{className:"mt-1 text-sm font-medium text-destructive",children:ye.description})]})]}),ge=Q&&Ce?e.jsxs("div",{className:"mt-5",children:[e.jsx(Ie,{className:"mb-4"}),e.jsx(ws,{pricing:Q.fullPricing,authoritativeDisplayBreakdown:Q.authoritativeDisplayBreakdown,selectedPackage:s,guestCount:h,transformedVenue:{priceUnit:a.priceUnit},listingCategory:Q.listingCategory,metadata:Q.metadata,isMobile:!1,variant:"compact",previewState:q,sliderSelections:Z,taxJurisdictionCollected:Q.taxJurisdictionCollected})]}):null;return e.jsx("div",{className:"rounded-2xl border border-border/70 bg-white p-6 shadow-sm",children:s!==null?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-2xl font-semibold text-gray-900",children:(q==null?void 0:q.status)==="loading"?e.jsx(St,{className:"h-5 w-5 animate-spin text-muted-foreground"}):t.estimatedTotal!==null?ee(t.estimatedTotal):"Request quote"}),e.jsx("span",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Package"})]}),e.jsx("div",{className:"mt-2",children:n&&n.length>1?e.jsx("ul",{className:"space-y-1",children:n.map(L=>e.jsx("li",{className:"text-sm font-medium text-gray-900",children:L.name},L.id))}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"font-medium text-gray-900",children:s.name}),s.description&&e.jsx("p",{className:"min-w-0 break-words text-xs text-muted-foreground",children:s.description})]})}),Oe(),(ue||ce)&&e.jsxs("div",{className:"mt-3 rounded-2xl bg-brand/10 p-3 text-xs text-brand",children:[e.jsx("p",{className:"font-medium",children:"Package pricing"}),e.jsx("p",{className:"mt-1",children:he?"This package is priced per person per hour. The total updates with duration and guest count.":ue?"This package is priced per hour. The total updates with duration.":"This package is priced per person. The total updates with guest count."})]}),!B&&$&&e.jsxs("div",{className:"mt-4 grid gap-2",children:[e.jsx("label",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Message to host (optional)"}),e.jsx(us,{value:O??"",onChange:L=>$(L.target.value),placeholder:"Tell the host about your event, purpose, or any special requests...",className:"min-h-[80px] resize-none rounded-lg",maxLength:500})]}),ge,e.jsx(qs,{className:"mt-6",onClick:y,loading:E,acceptsInstantBookings:B,canAnimate:!!(o&&r&&m>0),validate:z,text:B?"Reserve":"Request booking",loadingText:B?"Reserving...":"Submitting...",iconPath:B?void 0:"M3.478 2.405a.75.75 0 0 0-.926.94l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.405Z",disabled:A||!fe.isValid||!!ye||!!Se||!oe}),B&&e.jsx("p",{className:"mt-2 text-center text-xs text-muted-foreground",children:"You won't be charged yet."}),!oe&&e.jsx("p",{className:"mt-2 text-center text-xs text-amber-700",children:"Set your package amount above $0 to continue."}),oe&&!fe.isValid&&fe.nextMissingRequirement?!B&&fe.nextMissingRequirement==="Pick a date for your event."?e.jsx("p",{className:"mt-2 text-center text-xs text-muted-foreground",children:"This is a booking request, you won't be charged yet."}):e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:fe.nextMissingRequirement}):null,A&&S&&e.jsx("p",{className:"mt-2 text-center text-xs text-muted-foreground",children:S})," ",I&&e.jsx("button",{type:"button",onClick:I,className:"mt-3 w-full text-center text-xs text-muted-foreground hover:text-gray-900 hover:underline",children:"Clear package selection"})]}):e.jsxs(e.Fragment,{children:[Ce?e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-2xl font-semibold text-gray-900",children:(q==null?void 0:q.status)==="loading"?e.jsx(St,{className:"h-6 w-6 animate-spin text-muted-foreground"}):t.estimatedTotal!==null?ee(t.estimatedTotal):t.baseRate?ee(t.baseRate):"Request quote"}),e.jsx("span",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:t.estimatedTotal!==null&&(q==null?void 0:q.status)!=="loading"?"estimated total":((we=a.priceUnit)==null?void 0:we.replace(/per_/,"per "))??"per hour"})]})}):e.jsx("p",{className:"text-xl font-semibold text-gray-900",children:"Add your event details"}),Oe(),(ue||ce)&&e.jsxs("div",{className:"mt-3 rounded-2xl bg-brand/10 p-3 text-xs text-brand",children:[e.jsx("p",{className:"font-medium",children:"Package pricing"}),e.jsx("p",{className:"mt-1",children:he?"This package is priced per person per hour. The total updates with duration and guest count.":ue?"This package is priced per hour. The total updates with duration.":"This package is priced per person. The total updates with guest count."})]}),!B&&$&&e.jsxs("div",{className:"mt-4 grid gap-2",children:[e.jsx("label",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Message to host (optional)"}),e.jsx(us,{value:O??"",onChange:L=>$(L.target.value),placeholder:"Tell the host about your event, purpose, or any special requests...",className:"min-h-[80px] resize-none rounded-lg",maxLength:500})]}),ge,e.jsx(qs,{className:"mt-6",onClick:y,loading:E,acceptsInstantBookings:B,canAnimate:!!(o&&r&&m>0),validate:z,text:B?"Reserve":"Request booking",loadingText:B?"Reserving...":"Submitting...",iconPath:B?void 0:"M3.478 2.405a.75.75 0 0 0-.926.94l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.405Z",disabled:A||!fe.isValid||!!ye||!!Se||!oe}),B&&e.jsx("p",{className:"mt-2 text-center text-xs text-muted-foreground",children:"You won't be charged yet."}),!oe&&e.jsx("p",{className:"mt-2 text-center text-xs text-amber-700",children:"Set your package amount above $0 to continue."}),oe&&!fe.isValid&&fe.nextMissingRequirement?!B&&fe.nextMissingRequirement==="Pick a date for your event."?e.jsx("p",{className:"mt-2 text-center text-xs text-muted-foreground",children:"This is a booking request, you won't be charged yet."}):e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:fe.nextMissingRequirement}):null,A&&S&&e.jsx("p",{className:"mt-2 text-center text-xs text-muted-foreground",children:S})]})})},Kr=({listing:t,transformedVenue:s,metadata:n,address:a,description:o,galleryImages:i,galleryVideos:r=[],amenityValues:d,subTypes:l,highlights:x,capacityLabel:h,availability:f,schedule:c,blockedDates:m=[],bookingWindowDays:b,minimumLeadTimeHours:R,packages:_,selectedPackageId:g,selectedPackageIds:M,selectedPackage:N,selectedPackages:T,onSelectPackage:k,onTogglePackage:v,addOns:w,selectedAddOns:p,onToggleAddOn:y,onSetAddOnQuantity:I,pricing:E,authoritativeVenueDisplayBreakdown:B,reviews:z,listingId:O,avgRating:$,totalReviews:A,hostProfile:S,hostPhoto:H,isSaved:P,savingVenue:W,onSaveVenue:U,eventDate:q,setEventDate:K,startTime:Z,setStartTime:F,endTime:te,setEndTime:Q,guestCount:oe,setGuestCount:_e,durationHours:ue,durationMinutes:ce,setDurationMinutes:he,startTimeOptions:Ce=[],endTimeOptions:ye=[],startTimeMinTime:Se,startTimeMaxTime:He,endTimeMinTime:at,endTimeMaxTime:pe,onAddToCart:ot,cartLoading:Ue,validateBeforeAnimate:ft,isPricingBreakdownOpen:Ke,setIsPricingBreakdownOpen:Fe,isBookingDetailsOpen:fe,setIsBookingDetailsOpen:ke,onShareClick:ve,acceptsInstantBookings:de=!0,onMessageHost:qe,onRequestCustomQuote:ze,specialRequests:Le,setSpecialRequests:$e,bookingDisabled:Be=!1,bookingDisabledMessage:Qe,venueCapacityMin:Oe,venueCapacityMax:ge,packageGuestMin:we,packageGuestMax:L,previewState:re,plannerCalendarHighlights:me,sliderSelections:Ae,onSliderSelectionsChange:gt})=>{var Et,Ft,Lt,$t,Nt,Bt,vt,Ot,Mt,Ht,Ut,dt;const Pe=At(),Je=Nn(t,vn(t)),Ze=fn(t),[it,ie]=u.useState(!1),Re=u.useRef(null),je=u.useRef(null),lt=u.useMemo(()=>yn({schedule:c,blockedDates:m,bookingWindowDays:b,minimumLeadTimeHours:R}),[c,m,b,R]),{minDate:Xe,maxDate:bt,disabledDates:yt}=lt,jt=u.useMemo(()=>bn(),[]),Te=$!=null?$.toFixed(1):null,De=A??z.length;u.useEffect(()=>{const C=je.current;if(!C)return;const D=X=>{X.stopPropagation()};return C.addEventListener("click",D,!0),C.addEventListener("mousedown",D,!0),C.addEventListener("touchstart",D,!0),()=>{C.removeEventListener("click",D,!0),C.removeEventListener("mousedown",D,!0),C.removeEventListener("touchstart",D,!0)}},[Te]);const Ve=q&&Z&&te&&oe>0,et=T??(N?[N]:[]),se=et.some(C=>C.priceType==="per_hour"||C.priceType==="per_person_per_hour"),ne=et.some(C=>C.priceType==="per_person"||C.priceType==="per_person_per_hour"),Me=et.some(C=>C.priceType==="per_person_per_hour"),tt=u.useMemo(()=>kt({guestCount:oe,venueCapacityMin:Oe??void 0,venueCapacityMax:ge??void 0,packageGuestMin:we??void 0,packageGuestMax:L??void 0}),[oe,Oe,ge,we,L]),ct=u.useMemo(()=>kn({venueCapacityMax:ge,packageGuestMax:L}),[ge,L]),ns=u.useMemo(()=>{const C=typeof ge=="number"&&Number.isFinite(ge)&&ge>0,D=typeof L=="number"&&Number.isFinite(L)&&L>0;return C&&D?"venue and selected package guest limits":D?"selected package guest limit":C?"venue guest limit":"guest limits"},[ge,L]),[Pt,rs]=u.useState(null),as=Zs({eventDate:q,startTime:Z,durationMinutes:ce,guestCount:oe,guestMin:Oe??1,guestMax:ge??9999,requiresEventLocation:!1,hasVerifiedEventLocation:!1,requiresPackageSelection:!1,packageSelected:!1});u.useMemo(()=>{if(!Z||!te||!q)return null;try{const{startDateTime:C,endDateTime:D}=nt(q,Z,te),X=new Date(C),xe=new Date(D);if(isNaN(X.getTime())||isNaN(xe.getTime()))return null;if(xe<=X)return{title:"Invalid time range",description:"End time must be after start time."}}catch{return null}return null},[Z,te,q]),u.useMemo(()=>!q||!Z||!te?!1:nt(q,Z,te).spansNextDay,[q,Z,te]);const J=(Et=n==null?void 0:n.policies)==null?void 0:Et.cancellationPolicy,Tt=J?yr(J):!1;return u.useEffect(()=>{let C,D;const X=()=>{const xe=Re.current;if(!xe){D=setTimeout(X,100);return}const Ne=()=>{ie(xe.scrollTop>100)};Ne(),xe.addEventListener("scroll",Ne,{passive:!0}),C=()=>xe.removeEventListener("scroll",Ne)};return X(),()=>{D&&clearTimeout(D),C&&C()}},[]),e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsx("div",{className:Y("fixed top-0 left-0 right-0 z-[100] bg-white border-b transition-all duration-300",it?"translate-y-0 opacity-100 shadow-sm pointer-events-auto":"-translate-y-full opacity-0 pointer-events-none"),children:e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsx(le,{variant:"ghost",size:"icon",className:"h-9 w-9 hover:bg-gray-100",onClick:()=>typeof window<"u"&&window.history.length>1?Pe(-1):Pe("/venues"),children:e.jsx(Fs,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[(S==null?void 0:S.publicId)&&e.jsx(le,{variant:"ghost",size:"icon",className:"h-9 w-9 hover:bg-gray-100 p-0",asChild:!0,children:e.jsx("a",{href:`/u/${S.publicId}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center","aria-label":"View host profile",children:e.jsx(Xt,{src:H||void 0,alt:"Host avatar",className:"h-8 w-8 rounded-full object-cover border border-gray-200",fallback:"/default-profile-icon.png"})})}),e.jsx(le,{variant:"ghost",size:"icon",className:"h-9 w-9 hover:bg-gray-100",onClick:ve,children:e.jsx(Ls,{className:"h-5 w-5"})}),U!=null&&e.jsx(le,{variant:"ghost",size:"icon",className:Y("h-9 w-9 hover:bg-gray-100",P&&"text-brand"),onClick:U,disabled:W,children:e.jsx(ms,{className:Y("h-5 w-5",P&&"fill-current")})})]})]})}),e.jsxs("div",{className:"fixed top-0 left-0 right-0 z-30 px-4 pt-4 pb-2 flex items-center justify-between",children:[e.jsx(le,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-sm hover:bg-gray-100 hover:text-gray-900",onClick:()=>typeof window<"u"&&window.history.length>1?Pe(-1):Pe("/venues"),children:e.jsx(Fs,{className:"h-5 w-5"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[(S==null?void 0:S.publicId)&&e.jsx(le,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-sm hover:bg-gray-100 p-0",asChild:!0,children:e.jsx("a",{href:`/u/${S.publicId}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center","aria-label":"View host profile",children:e.jsx(Xt,{src:H||void 0,alt:"Host avatar",className:"h-9 w-9 rounded-full object-cover border border-gray-200",fallback:"/default-profile-icon.png"})})}),e.jsx(le,{variant:"ghost",size:"icon",className:"h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-sm hover:bg-brand/10 hover:text-brand",onClick:ve,children:e.jsx(Ls,{className:"h-5 w-5"})}),U!=null&&e.jsx(le,{variant:"ghost",size:"icon",className:Y("h-10 w-10 rounded-full bg-white/90 backdrop-blur-sm shadow-sm hover:bg-red-50 hover:text-red-500",P&&"text-brand"),onClick:U,disabled:W,children:e.jsx(ms,{className:Y("h-5 w-5",P&&"fill-current")})})]})]}),e.jsx("div",{className:"fixed top-0 left-0 right-0 h-[360px] z-0",children:e.jsx("img",{src:i[0]??xs,alt:s.name,className:"w-full h-full object-cover",loading:"eager"})}),e.jsxs("div",{ref:Re,className:"flex-1 overflow-y-auto pb-32 relative z-10",style:{background:"linear-gradient(to bottom, transparent 0, transparent 360px, white 360px)"},children:[e.jsx("div",{className:"h-[360px] relative z-0"}),e.jsxs("div",{className:"bg-white -mt-8 relative z-20 rounded-t-[32px] pt-8",children:[e.jsxs("div",{className:"px-6 pb-6 space-y-3 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 text-xs text-muted-foreground",children:[e.jsx(or,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:a})]}),e.jsxs("h1",{className:"flex items-center justify-center gap-1.5 text-2xl font-semibold tracking-tight text-gray-900",children:[e.jsx("span",{children:s.name}),Ze&&e.jsxs(ln,{children:[e.jsx(cn,{asChild:!0,children:e.jsx("span",{className:"inline-flex",children:e.jsx(wn,{className:"h-5 w-5 flex-shrink-0 text-blue-500","aria-label":"Verified"})})}),e.jsx(dn,{side:"top",sideOffset:4,children:e.jsx("p",{className:"text-xs",children:"Venue provider registered on PLEC"})})]})]}),e.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:x.map(C=>e.jsx(xt,{variant:"secondary",className:"rounded-full px-2.5 py-0.5 text-[10px] bg-gray-100 text-gray-700 border-0",children:C},C))}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center justify-center gap-3 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(un,{className:"h-3.5 w-3.5"}),h??"Capacity details coming soon"]}),de&&e.jsxs(e.Fragment,{children:[e.jsx(Ie,{orientation:"vertical",className:"h-3"}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(pn,{className:"h-3.5 w-3.5"}),"Instant booking"]})]}),(((Ft=n.pricing)==null?void 0:Ft.minimumHours)??0)>1&&e.jsxs(e.Fragment,{children:[e.jsx(Ie,{orientation:"vertical",className:"h-3"}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(mn,{className:"h-3.5 w-3.5"}),n.pricing.minimumHours,"+ hour minimum"]})]}),Te&&e.jsxs(e.Fragment,{children:[e.jsx(Ie,{orientation:"vertical",className:"h-3"}),e.jsxs("button",{type:"button",onClick:C=>{C.preventDefault(),C.stopPropagation(),Pe(`${window.location.pathname}${window.location.search}#reviews`,{state:{scrollToReviews:Date.now()}})},className:"flex items-center gap-1 rounded-full bg-amber-50 px-1.5 py-0.5 text-[10px] font-semibold text-amber-700 cursor-pointer hover:bg-amber-100","aria-label":`View reviews - ${Te} stars`,children:[e.jsx(js,{className:"h-3 w-3 fill-current"}),e.jsx("span",{children:Te}),De>0&&e.jsxs("span",{className:"text-[10px]",children:["(",De,")"]})]})]})]})]}),e.jsx(Ie,{}),e.jsxs("div",{className:"px-6 py-6 space-y-8",children:[e.jsx("section",{className:"space-y-3 text-center min-w-0 max-w-full",children:e.jsx("p",{className:"text-sm leading-6 text-gray-700 whitespace-pre-line min-w-0 break-words",children:o})}),e.jsx(Ie,{}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Photos"}),e.jsx(Bn,{images:i,videos:r,serviceName:s.name,isMobile:!0,onShareClick:ve,onSaveClick:U,isSaved:P})]}),e.jsx(Ie,{}),e.jsxs("div",{className:"space-y-12",children:[l.length>0&&e.jsxs("section",{className:"rounded-2xl border border-border/60 bg-muted/40 p-4 shadow-sm",children:[e.jsx("h2",{className:"text-base font-semibold text-gray-900",children:"Ideal for"}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:l.map(C=>e.jsx(xt,{variant:"outline",className:"rounded-full border-brand/40 bg-white px-2.5 py-0.5 text-xs text-brand",children:C.replace(/[_-]/g," ").replace(/\b\w/g,D=>D.toUpperCase())},C))})]}),e.jsx(Tn,{amenityValues:d,isMobile:!0}),e.jsx("section",{id:"availability",className:"scroll-mt-24",children:e.jsx(On,{schedule:c,blockedDates:m,selectedDate:q||null,onDateSelect:K,bookingWindowDays:b,minimumLeadTimeHours:R,onTimeSlotSelect:C=>{F(C)},plannerHighlights:me})}),e.jsxs("section",{className:"min-w-0 space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Pricing breakdown"}),e.jsx(Xs,{slots:en(n)}),_.length>0&&e.jsx(Sn,{packages:_,selectedPackageIds:M,onTogglePackage:v,isMobile:!0,sliderSelections:Ae,onSliderSelectionsChange:gt,feeInput:Je}),w.length>0&&e.jsx(tn,{addOns:w,feeInput:Je,selectedAddOns:p,onToggle:y,onSetQuantity:I}),e.jsx(ws,{pricing:E,authoritativeDisplayBreakdown:B,selectedPackage:N,guestCount:oe,transformedVenue:s,listingCategory:t.category,metadata:n,isMobile:!0,variant:"default",previewState:re,sliderSelections:Ae,taxJurisdictionCollected:cs(($t=(Lt=t.publishedData)==null?void 0:Lt.location)==null?void 0:$t.country,(Bt=(Nt=t.publishedData)==null?void 0:Nt.location)==null?void 0:Bt.state)}),_.length>0&&ze&&e.jsxs("div",{className:"pt-2",children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Don't see a package that fits? Request a custom quote from the host."}),e.jsx(le,{variant:"outline",size:"sm",onClick:ze,children:"Request Custom Quote"})]}),e.jsx(sn,{metadata:n,feeInput:Je})]}),e.jsx(_n,{policies:n.policies??{},isMobile:!0}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Location"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Exact address is shared once a reservation is confirmed."}),e.jsx(xn,{address:a,venueName:s.name})]}),e.jsx(Mn,{hostProfile:S,listing:t,isMobile:!0,onMessageHost:qe}),e.jsx("section",{id:"reviews",className:"scroll-mt-24",children:e.jsx(In,{reviews:z,listingId:O})})]})]})]})]}),Ln.createPortal(e.jsxs("div",{className:"fixed bottom-0 left-0 right-0 z-[9999] bg-white border-t border-border/70 p-6 shadow-lg safe-area-inset-bottom",children:[e.jsx("div",{className:"space-y-2 mb-3",children:Ve&&E.estimatedTotal!==null?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("button",{onClick:()=>Fe(!0),className:"text-left hover:opacity-80 transition-opacity",children:e.jsx("div",{className:"text-lg font-semibold text-gray-900 underline",children:ee(E.estimatedTotal)})}),((vt=n.pricing)==null?void 0:vt.minimumBooking)&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Minimum ",ee(n.pricing.minimumBooking)," to book"]})]}),Tt&&e.jsxs(xt,{variant:"secondary",className:"rounded-full px-2.5 py-1 text-[10px] bg-green-50 text-green-700 border-green-200 font-semibold",children:[e.jsx(ys,{className:"h-3 w-3 mr-1"}),"Free cancellation"]})]}):e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("button",{type:"button",onClick:()=>Fe(!0),className:Y("text-left hover:opacity-80 transition-opacity",Ve&&"underline"),children:e.jsx("div",{className:"text-lg font-semibold text-gray-900",children:Ve?(re==null?void 0:re.status)==="loading"?e.jsxs("span",{className:"flex items-center gap-2 text-base font-medium no-underline",children:[e.jsx(St,{className:"h-5 w-5 shrink-0 animate-spin text-muted-foreground"}),"Updating estimate…"]}):e.jsxs(e.Fragment,{children:[E.baseRate?`From ${ee(E.baseRate)}`:"Request quote",E.baseRate?e.jsx("span",{className:"text-sm font-normal text-muted-foreground ml-1",children:((Ot=s.priceUnit)==null?void 0:Ot.replace(/per_/,"per "))??"per hour"}):null]}):e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"Add date, time & guests"}),e.jsx("div",{className:"text-xs font-normal text-muted-foreground mt-1",children:"Your estimate appears here once details are set."})]})})}),Te&&e.jsxs("div",{ref:je,onClick:C=>{var D,X;return C.preventDefault(),C.stopPropagation(),(X=(D=C.nativeEvent)==null?void 0:D.stopImmediatePropagation)==null||X.call(D),requestAnimationFrame(()=>{const xe=document.getElementById("reviews"),Ne=Re.current;if(xe&&Ne){const ut=Ne.getBoundingClientRect(),mt=xe.getBoundingClientRect(),wt=Ne.scrollTop,qt=mt.top-ut.top+wt-20;Ne.scrollTo({top:qt,behavior:"smooth"})}else if(xe){const wt=xe.getBoundingClientRect().top+window.scrollY-80;window.scrollTo({top:wt,behavior:"smooth"})}}),!1},onMouseDown:C=>{var D,X;C.preventDefault(),C.stopPropagation(),(X=(D=C.nativeEvent)==null?void 0:D.stopImmediatePropagation)==null||X.call(D)},onTouchStart:C=>{var D,X;C.preventDefault(),C.stopPropagation(),(X=(D=C.nativeEvent)==null?void 0:D.stopImmediatePropagation)==null||X.call(D)},onPointerDown:C=>{C.preventDefault(),C.stopPropagation()},className:"flex items-center gap-1 mt-0.5 cursor-pointer hover:opacity-80 active:opacity-60 transition-opacity rounded px-2 py-1 -ml-2 -mr-2 touch-manipulation relative z-50",style:{minHeight:"44px",minWidth:"44px",pointerEvents:"auto"},role:"button",tabIndex:0,"aria-label":`View reviews - ${Te} stars`,onKeyDown:C=>{if(C.key==="Enter"||C.key===" "){C.preventDefault(),C.stopPropagation();const D=document.getElementById("reviews"),X=Re.current;if(D&&X){const xe=X.getBoundingClientRect(),Ne=D.getBoundingClientRect(),ut=X.scrollTop,mt=Ne.top-xe.top+ut-20;X.scrollTo({top:mt,behavior:"smooth"})}}},children:[e.jsx(js,{className:"h-3.5 w-3.5 fill-amber-400 text-amber-400 pointer-events-none flex-shrink-0"}),e.jsx("span",{className:"text-sm font-medium text-gray-900 pointer-events-none",children:Te}),De>0&&e.jsxs("span",{className:"text-xs text-muted-foreground pointer-events-none",children:["(",De,")"]})]})]}),Tt&&e.jsxs(xt,{variant:"secondary",className:"rounded-full px-2.5 py-1 text-[10px] bg-green-50 text-green-700 border-green-200 font-semibold",children:[e.jsx(ys,{className:"h-3 w-3 mr-1"}),"Free cancellation"]})]})}),e.jsx(le,{className:"w-full bg-brand hover:bg-brand-600 text-white rounded-full py-6 text-base font-semibold",onClick:()=>ke(!0),disabled:Be,children:Ue?de?"Adding...":"Submitting...":Ve?"Show dates":"Select date"}),Be&&Qe&&e.jsx("p",{className:"mt-2 text-center text-xs text-muted-foreground",children:Qe})]}),document.body),e.jsx(Kt,{open:Ke,onOpenChange:Fe,children:e.jsxs(Qt,{hideCloseButton:!1,children:[e.jsxs(Jt,{children:[e.jsx(Zt,{className:"text-xl font-semibold",children:"Pricing breakdown"}),e.jsx(hs,{children:"See how your estimated total was calculated"})]}),e.jsx("div",{className:"overflow-y-auto",children:e.jsx(ws,{pricing:E,authoritativeDisplayBreakdown:B,selectedPackage:N,guestCount:oe,transformedVenue:s,listingCategory:t.category,metadata:n,isMobile:!0,variant:"dialog",previewState:re,sliderSelections:Ae,taxJurisdictionCollected:cs((Ht=(Mt=t.publishedData)==null?void 0:Mt.location)==null?void 0:Ht.country,(dt=(Ut=t.publishedData)==null?void 0:Ut.location)==null?void 0:dt.state)})})]})}),e.jsx(Kt,{open:fe,onOpenChange:ke,children:e.jsxs(Qt,{hideCloseButton:!1,children:[e.jsxs(Jt,{children:[e.jsx(Zt,{className:"text-xl font-semibold",children:"Booking details"}),e.jsx(hs,{children:"Customize your event date, time, and guest count"})]}),e.jsxs("div",{className:"space-y-4 pb-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:de?"Instant booking: you'll be charged at checkout once you confirm.":"You won't be charged yet. Share your event details and get a customized proposal from the host."}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Date"}),e.jsx(gn,{value:q?(()=>{const[C,D,X]=q.split("-").map(Number);return new Date(C,D-1,X)})():null,onChange:C=>{K(C?ss(C,"yyyy-MM-dd"):"")},placeholder:"Select date",minDate:Xe,maxDate:bt,disabledDates:yt,plannerHighlights:me})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Start"}),e.jsx(ps,{value:Z,onChange:F,placeholder:"Add time",options:Ce,minTime:Se,maxTime:He,disabled:!q})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Duration"}),e.jsx(Hn,{valueMinutes:ce,minMinutes:ht*60,maxMinutes:12*60,stepMinutes:30,onChange:he})]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["All times shown in ",jt]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Guests"}),e.jsx(on,{type:"number",min:1,max:ct,value:oe,onChange:C=>{const D=Number(C.target.value)||1,X=An(D,ct);_e(X),rs(Pn({enteredValue:D,adjustedValue:X,upperBound:ct,limitLabel:ns}))},className:"h-12 rounded-2xl"}),ct<500&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Up to ",ct," guests for this booking."]}),Pt&&e.jsx("p",{className:"text-xs text-amber-700",children:Pt})]}),tt&&e.jsx("p",{className:"text-sm text-destructive font-medium",children:tt.description}),(se||ne)&&e.jsxs("div",{className:"rounded-2xl bg-brand/10 p-3 text-xs text-brand",children:[e.jsx("p",{className:"font-medium",children:"Package pricing"}),e.jsx("p",{className:"mt-1",children:Me?"This package is priced per person per hour. The total updates with duration and guest count.":se?"This package is priced per hour. The total updates with duration.":"This package is priced per person. The total updates with guest count."})]}),!de&&$e&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx("label",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Message to host (optional)"}),e.jsx(us,{value:Le??"",onChange:C=>$e(C.target.value),placeholder:"Tell the host about your event, purpose, or any special requests...",className:"min-h-[80px] rounded-2xl resize-none",maxLength:500})]})]})]}),e.jsx(ir,{className:"w-full flex-col gap-0 border-0 p-0 sm:flex-col sm:space-x-0",children:e.jsx(le,{className:"w-full bg-brand hover:bg-brand-600 text-white rounded-full py-6 text-base font-semibold",onClick:()=>{ke(!1),ot()},disabled:Be||Ue||!as.isValid||!!tt,children:Ue?de?"Adding...":"Submitting...":de?((T==null?void 0:T.length)??(N!==null?1:0))>0?"Add package to cart":"Add to cart":"Request Venue"})})]})})]})},Qr=({listing:t,transformedVenue:s,metadata:n,address:a,description:o,galleryImages:i,galleryVideos:r=[],amenityValues:d,subTypes:l,highlights:x,capacityLabel:h,availability:f,schedule:c,blockedDates:m,bookingWindowDays:b,minimumLeadTimeHours:R,packages:_,selectedPackageId:g,selectedPackageIds:M,selectedPackage:N,selectedPackages:T,onSelectPackage:k,onTogglePackage:v,addOns:w,selectedAddOns:p,onToggleAddOn:y,onSetAddOnQuantity:I,pricing:E,authoritativeVenueDisplayBreakdown:B,reviews:z,listingId:O,avgRating:$,totalReviews:A,hostProfile:S,hostPhoto:H,isSaved:P,savingVenue:W,onSaveVenue:U,eventDate:q,setEventDate:K,startTime:Z,setStartTime:F,endTime:te,setEndTime:Q,guestCount:oe,setGuestCount:_e,durationHours:ue,durationMinutes:ce,setDurationMinutes:he,startTimeOptions:Ce,endTimeOptions:ye,startTimeMinTime:Se,startTimeMaxTime:He,endTimeMinTime:at,endTimeMaxTime:pe,onAddToCart:ot,cartLoading:Ue,validateBeforeAnimate:ft,onShareClick:Ke,acceptsInstantBookings:Fe=!0,onMessageHost:fe,onRequestCustomQuote:ke,stickyCardRef:ve,stickyCardPosition:de,specialRequests:qe,setSpecialRequests:ze,bookingDisabled:Le,bookingDisabledMessage:$e,venueCapacityMin:Be,venueCapacityMax:Qe,packageGuestMin:Oe,packageGuestMax:ge,previewState:we,plannerCalendarHighlights:L,sliderSelections:re,onSliderSelectionsChange:me})=>{var yt,jt,Te,De,Ve,et;const Ae=At(),gt=u.useRef(null),Pe=Nn(t,vn(t)),[Je,Ze]=u.useState(!1),it=$!=null?$.toFixed(1):null,ie=A??z.length,Re=(()=>{const se=s.venue_type;if(!se)return null;const ne=lr().find(Me=>Me.value===se);return ne?ne.label:se.replace(/_/g," ").replace(/\b\w/g,Me=>Me.toUpperCase())})(),je=mr(t).find(se=>se.type==="hosting_since"),lt=fn(t),Xe=(()=>{var ne;if(!(je!=null&&je.label))return null;const se=(ne=je.metadata)==null?void 0:ne.sinceDate;return se&&Date.now()-new Date(se).getTime()<90*24*60*60*1e3?null:je.label.replace(/^Hosting with /,"With ")})();(()=>{var tt;const se=(tt=je==null?void 0:je.metadata)==null?void 0:tt.sinceDate;if(!se)return null;const ne=Math.floor((Date.now()-new Date(se).getTime())/(30.44*24*60*60*1e3));if(ne<1)return null;if(ne<12)return`${ne} ${ne===1?"month":"months"} hosting`;const Me=Math.floor(ne/12);return`${Me} ${Me===1?"year":"years"} hosting`})(),S!=null&&S.firstName||S!=null&&S.fullName;const bt=[h?{icon:un,text:h}:null,Fe?{icon:pn,text:"Instant booking"}:null,(((yt=n.pricing)==null?void 0:yt.minimumHours)??0)>1?{icon:mn,text:`${n.pricing.minimumHours}+ hour minimum`}:null].filter(Boolean);return e.jsx("div",{className:"mx-auto w-full max-w-7xl px-6 pb-24 pt-8 md:px-8",children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("h1",{className:"flex items-center gap-1.5 break-words text-2xl font-semibold tracking-tight text-gray-900",children:[e.jsx("span",{className:"break-words",children:s.name}),lt&&e.jsxs(ln,{children:[e.jsx(cn,{asChild:!0,children:e.jsx("span",{className:"inline-flex",children:e.jsx(wn,{className:"h-5 w-5 flex-shrink-0 text-blue-500","aria-label":"Verified"})})}),e.jsx(dn,{side:"top",sideOffset:4,children:e.jsx("p",{className:"text-xs",children:"Venue provider registered on PLEC"})})]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[e.jsxs("button",{type:"button",onClick:Ke,className:"flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium text-gray-700 underline hover:bg-gray-100 hover:no-underline",children:[e.jsx(Cr,{className:"h-4 w-4"}),"Share"]}),U!=null&&e.jsxs("button",{type:"button",onClick:U,disabled:W,className:"flex items-center gap-1.5 rounded-lg px-3 py-2 text-sm font-medium text-gray-700 underline hover:bg-gray-100 hover:no-underline disabled:opacity-50",children:[e.jsx(ms,{className:Y("h-4 w-4",P&&"fill-current text-brand")}),W?"Saving...":P?"Saved":"Save"]})]})]}),e.jsx(cr,{ref:gt,images:i,videos:r,venueName:s.name,isMobile:!1,onShareClick:Ke,onSaveClick:U,isSaved:P,onBackClick:()=>Ae(-1)}),e.jsx(Jr,{imageGalleryRef:gt}),e.jsxs("div",{children:[(Re||s.city)&&e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:[Re,s.city].filter(Boolean).join(" in ")}),bt.length>0&&e.jsx("div",{className:"mt-1 flex flex-wrap gap-x-1.5 gap-y-0.5 text-sm text-gray-600",children:bt.map(({text:se},ne)=>e.jsxs(Ye.Fragment,{children:[ne>0&&e.jsx("span",{className:"text-gray-300",children:"·"}),e.jsx("span",{children:se})]},se))}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-sm",children:[it&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:se=>{se.preventDefault(),se.stopPropagation(),Ae(`${window.location.pathname}${window.location.search}#reviews`,{state:{scrollToReviews:Date.now()}})},className:"flex items-center gap-1 hover:underline","aria-label":`View reviews - ${it} stars`,children:[e.jsx(js,{className:"h-3.5 w-3.5 fill-gray-900 text-gray-900"}),e.jsx("span",{className:"font-semibold text-gray-900",children:it}),ie>0&&e.jsxs("span",{className:"text-gray-500",children:["· ",ie," reviews"]})]}),e.jsx("span",{className:"text-gray-300",children:"·"})]}),e.jsx("span",{className:"text-gray-600",children:a}),Xe&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-300",children:"·"}),e.jsx("span",{className:"text-gray-500",children:Xe})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-12 pb-10 border-b border-gray-200 lg:flex-row",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-10",children:[e.jsxs("section",{className:"border-b border-gray-200 pb-8",children:[e.jsx("div",{className:Y(!Je&&"line-clamp-4"),children:e.jsx("p",{className:"min-w-0 break-words text-base leading-7 text-gray-700 whitespace-pre-line",children:o})}),o.length>300&&e.jsx("button",{type:"button",onClick:()=>Ze(se=>!se),className:"mt-3 flex items-center gap-1 text-sm font-semibold text-gray-900 underline hover:no-underline",children:Je?"Show less":"Show more"})]}),e.jsxs("section",{id:"packages",className:"scroll-mt-24 min-w-0 space-y-4 border-b border-gray-200 pb-8",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Packages & Pricing"}),E.baseRate!=null&&e.jsxs("p",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-2xl font-bold text-gray-900",children:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(E.baseRate)}),e.jsx("span",{className:"text-base text-gray-500",children:((jt=s.priceUnit)==null?void 0:jt.replace(/_/g," "))??"per hour"})]}),e.jsx(Xs,{slots:en(n)}),_.length>0&&e.jsx(Sn,{packages:_,selectedPackageIds:M,onTogglePackage:v,isMobile:!1,sliderSelections:re,onSliderSelectionsChange:me,feeInput:Pe,optional:!0}),w.length>0&&e.jsx(tn,{addOns:w,feeInput:Pe,selectedAddOns:p,onToggle:y,onSetQuantity:I}),_.length>0&&ke&&e.jsxs("div",{className:"pt-2",children:[e.jsx("p",{className:"mb-2 text-sm text-muted-foreground",children:"Don't see a package that fits? Request a custom quote from the host."}),e.jsx(le,{variant:"outline",size:"sm",onClick:ke,children:"Request Custom Quote"})]}),e.jsx(sn,{metadata:n,feeInput:Pe})]}),e.jsx("section",{id:"amenities",className:"scroll-mt-24",children:e.jsx(Tn,{amenityValues:d,isMobile:!1})})]}),e.jsx("aside",{className:"w-full lg:w-[360px] xl:w-[400px]",children:e.jsx("div",{ref:ve,className:Y("sticky top-28",de&&"!fixed"),style:de?{top:`${de.top}px`,left:`${de.left}px`,width:`${de.width}px`,zIndex:40}:void 0,children:e.jsx(Gr,{pricing:{baseRate:E.baseRate,estimatedTotal:E.estimatedTotal},selectedPackage:N,selectedPackages:T,transformedVenue:s,eventDate:q,setEventDate:K,startTime:Z,setStartTime:F,endTime:te,setEndTime:Q,guestCount:oe,setGuestCount:_e,durationHours:ue,durationMinutes:ce,setDurationMinutes:he,schedule:c,blockedDates:m,bookingWindowDays:b,minimumLeadTimeHours:R,startTimeOptions:Ce,endTimeOptions:ye,startTimeMinTime:Se,startTimeMaxTime:He,endTimeMinTime:at,endTimeMaxTime:pe,onAddToCart:ot,cartLoading:Ue,acceptsInstantBookings:Fe,validateBeforeAnimate:ft,specialRequests:qe,setSpecialRequests:ze,bookingDisabled:Le,bookingDisabledMessage:$e,venueCapacityMin:Be,venueCapacityMax:Qe,packageGuestMin:Oe,packageGuestMax:ge,previewState:we,plannerHighlights:L,sliderSelections:re,avgRating:$,totalReviews:A,breakdownProps:{fullPricing:E,authoritativeDisplayBreakdown:B,listingCategory:t.category,metadata:n,taxJurisdictionCollected:cs((De=(Te=t.publishedData)==null?void 0:Te.location)==null?void 0:De.country,(et=(Ve=t.publishedData)==null?void 0:Ve.location)==null?void 0:et.state)}})})})]}),e.jsx("section",{id:"reviews",className:"mt-10 scroll-mt-24 border-b border-gray-200 pb-8",children:e.jsx(In,{reviews:z,listingId:O,isMobile:!1})}),e.jsxs("div",{className:"mt-10 space-y-10",children:[e.jsxs("section",{id:"location",className:"scroll-mt-24 space-y-2 border-b border-gray-200 pb-8",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Address Information"}),a&&e.jsx("p",{className:"text-sm text-gray-700",children:a}),e.jsx(xn,{address:a,venueName:s.name})]}),e.jsx("section",{id:"host",className:"scroll-mt-24 border-b border-gray-200 pb-8",children:e.jsx(Mn,{hostProfile:S,listing:t,isMobile:!1,onMessageHost:fe})}),e.jsx("section",{id:"policies",className:"scroll-mt-24",children:e.jsx(_n,{policies:n.policies??{},isMobile:!1})})]})]})})},Dt=[{id:"packages",label:"Packages"},{id:"amenities",label:"Amenities"},{id:"availability",label:"Availability"},{id:"reviews",label:"Reviews"},{id:"location",label:"Location"},{id:"host",label:"Host"},{id:"policies",label:"Rules & Policies"}],Jr=({imageGalleryRef:t})=>{const[s,n]=u.useState(!1),[a,o]=u.useState(null),i=u.useRef(null);u.useEffect(()=>{const d=()=>{if(!t.current)return;if(t.current.getBoundingClientRect().bottom<=100)n(!0);else{n(!1),o(null);return}const h=window.scrollY,f=100;for(let c=Dt.length-1;c>=0;c--){const m=document.getElementById(Dt[c].id);if(m){const b=m.getBoundingClientRect(),R=h+b.top-f;if(h>=R-150){o(Dt[c].id);break}}}};return window.addEventListener("scroll",d,{passive:!0}),d(),()=>{window.removeEventListener("scroll",d)}},[t]);const r=d=>{var x;const l=document.getElementById(d);if(l){const h=((x=i.current)==null?void 0:x.offsetHeight)||0,f=l.offsetTop-h-12;window.scrollTo({top:Math.max(0,f),behavior:"smooth"})}};return e.jsx("div",{ref:i,className:Y("fixed top-0 left-0 right-0 z-40 w-full bg-card border-b-2 border-gray-200","transition-transform duration-300 ease-in-out",s?"translate-y-0":"-translate-y-full pointer-events-none"),children:e.jsx("div",{className:"mx-auto w-full max-w-7xl px-6 md:px-8",children:e.jsx("nav",{className:"flex items-center gap-6 overflow-x-auto scrollbar-hide py-3",children:Dt.map(d=>e.jsx("button",{onClick:()=>r(d.id),className:Y("shrink-0 text-sm font-medium transition-colors whitespace-nowrap pb-1 border-b-2 border-transparent",a===d.id?"text-brand border-brand":"text-gray-600 hover:text-gray-900 hover:border-gray-300"),children:d.label},d.id))})})})},Zr=1,Xr=25,ea=7,ta=365;function sa(t){if(!t||!t.enabled)return!1;const{daysAhead:s,discountPercent:n}=t;return!(!Number.isFinite(s)||s<ea||s>ta||!Number.isFinite(n)||n<Zr||n>Xr)}function na(t){if(!t||typeof t!="object")return null;const s=t.advancePricing;return!s||typeof s!="object"?null:s}function ra(t,s,n,a=new Date){if(!Number.isFinite(t)||t<=0||!s||!n)return{adjustedSubtotal:t,modifier:null};if(!sa(n.earlyBird))return{adjustedSubtotal:t,modifier:null};const o=Un(s,a);if(o===null||o<n.earlyBird.daysAhead)return{adjustedSubtotal:t,modifier:null};const i=We(t*(n.earlyBird.discountPercent/100)),r=We(t-i);return{adjustedSubtotal:r,modifier:{type:"early_bird",discountPercent:n.earlyBird.discountPercent,daysAheadThreshold:n.earlyBird.daysAhead,daysAheadActual:o,discountAmount:i,adjustedSubtotal:r}}}function zs(t,s,n=0){return t.priceType==="per_event"?t.maxPrice&&t.maxPrice!==t.minPrice?((t.minPrice??0)+t.maxPrice)/2:t.minPrice||0:t.priceType==="per_hour"?(t.maxPrice&&t.maxPrice!==t.minPrice?((t.minPrice??0)+t.maxPrice)/2:t.minPrice||0)*Math.max(n,0):t.priceType==="per_person_per_hour"?(t.maxPrice&&t.maxPrice!==t.minPrice?((t.minPrice??0)+t.maxPrice)/2:t.minPrice||0)*Math.max(s,1)*Math.max(n,0):(t.maxPrice&&t.maxPrice!==t.minPrice?((t.minPrice??0)+t.maxPrice)/2:t.minPrice||0)*s}function aa(t){var q,K;const{transformedVenue:s,metadata:n,calculatedHours:a,selectedVenueRentalPackage:o,selectedAddOnPackages:i,guestCount:r,authoritativePricing:d,eventDate:l}=t,x=n.pricing??{},h=x.baseRate??(s==null?void 0:s.baseRate),f={listingKind:"venue",category:(s==null?void 0:s.category)??(typeof n.category=="string"?n.category:void 0),feeOverrides:typeof n.pricing=="object"&&n.pricing!==null&&"feeOverrides"in n.pricing?n.pricing.feeOverrides??null:((q=s==null?void 0:s.feeInput)==null?void 0:q.feeOverrides)??null,effectiveFeeRates:((K=s==null?void 0:s.feeInput)==null?void 0:K.effectiveFeeRates)??null},c=typeof h=="number"&&Number.isFinite(h)?Gt(h,f):h,m=x.minimumHours??void 0,b=x.cleaningFee??void 0,R=void 0,_=x.overtimeRate??void 0,g=a,M=typeof h=="number"&&Number.isFinite(h)?Math.max(h,0)*Math.max(g,1):null,N=o?zs(o,r,g):null,T=i.reduce((Z,F)=>Z+zs(F,r,g),0),k=typeof x.baseRate=="number"&&Number.isFinite(x.baseRate)?Math.max(x.baseRate,0):0,v=b&&b>0?b:0,w=o?0:k*Math.max(g,1),p=(N??0)+T,y=We(w+v+p),I=(d==null?void 0:d.total)!=null?{adjustedSubtotal:y,modifier:null}:ra(y,l??null,na(n.pricing)),E=I.adjustedSubtotal,B=b&&b>0?b:0,z=Gn(f),O=y>0?We(y+ks(y,z.bakedInPercent)):0,$=E>0?We(E+ks(E,z.bakedInPercent)):0,A=I.modifier?We(O-$):0,S=E>0?We($*z.serviceFeePercent):0,H=E>0?We($+S):typeof h=="number"&&Number.isFinite(h)?We(Gt(Math.max(h,0)*Math.max(g,1)+B,f)):null,P=E>0?$:null,W=qn({authoritative:d,derivedSubtotal:P,derivedServiceFee:E>0?S:null,derivedTotal:H,notes:"Final total and applicable sales tax are confirmed in cart and checkout."}),U=d!=null&&d.advanceBookingModifier?d.advanceBookingModifier:I.modifier?{...I.modifier,displayDiscountAmount:A}:null;return{baseRate:c,minimumHours:m,cleaningFee:b,securityDeposit:R,overtimeRate:_,estimatedSubtotal:P,estimatedCleaning:B,serviceFee:W.serviceFee,estimatedTotal:W.total,pricingBreakdown:W,hourlyRentalCost:M,venueRentalPackageCost:N,addOnPackagesCost:T,actualHours:g,providerSubtotal:E,derivedDisplaySubtotal:$,derivedServiceFee:S,derivedTotal:H,advanceBookingModifier:U}}const oa=({transformedVenue:t,metadata:s,calculatedHours:n,selectedVenueRentalPackage:a,selectedAddOnPackages:o,guestCount:i,authoritativePricing:r,eventDate:d})=>u.useMemo(()=>{const l=aa({transformedVenue:t,metadata:s,calculatedHours:n,selectedVenueRentalPackage:a,selectedAddOnPackages:o,guestCount:i,authoritativePricing:r,eventDate:d});return{baseRate:l.baseRate,minimumHours:l.minimumHours,cleaningFee:l.cleaningFee,securityDeposit:l.securityDeposit,overtimeRate:l.overtimeRate,estimatedSubtotal:l.estimatedSubtotal,estimatedCleaning:l.estimatedCleaning,serviceFee:l.serviceFee,estimatedTotal:l.estimatedTotal,pricingBreakdown:l.pricingBreakdown,hourlyRentalCost:l.hourlyRentalCost,venueRentalPackageCost:l.venueRentalPackageCost,addOnPackagesCost:l.addOnPackagesCost,actualHours:l.actualHours,advanceBookingModifier:l.advanceBookingModifier}},[n,s.category,s.pricing,t==null?void 0:t.category,t==null?void 0:t.baseRate,a,o,i,r,d]);function ia(t){const s=typeof t.total=="number"?t.total:0,n=typeof t.serviceFee=="number"?t.serviceFee:0,a=Math.max(0,s-n);return{subtotalCents:Math.round(a*100),stripeProcessingFeeCents:0,taxAmountCents:0,serviceFeeCents:Math.round(n*100),taxStatus:"calculated_at_checkout",taxJurisdictionCollected:!1,totalCents:Math.round(s*100)}}function la({listing:t,transformedVenue:s,metadata:n,calculatedHours:a,selectedPackages:o,guestCount:i,eventDate:r,startTime:d,endTime:l,previewState:x,sliderSelections:h}){const f=u.useMemo(()=>{var M;const g=o.find(N=>N.includesVenueRental);if(!g)return null;if(g.pricingMode==="self_service_range"&&((M=g.sliders)!=null&&M.length)){const N=st(g.sliders,h??[]);return{...g,minPrice:N,maxPrice:N}}return g},[o,h]),c=u.useMemo(()=>o.filter(g=>!g.includesVenueRental).map(g=>{var M;if(g.pricingMode==="self_service_range"&&((M=g.sliders)!=null&&M.length)){const N=st(g.sliders,h??[]);return{...g,minPrice:N,maxPrice:N}}return g}),[o,h]),m=u.useMemo(()=>x.status==="success"&&typeof x.total=="number"?{subtotal:x.subtotal,serviceFee:x.serviceFee,total:x.total,advanceBookingModifier:x.advanceBookingModifier??null}:null,[x]),b=oa({transformedVenue:s,metadata:n,calculatedHours:a,selectedVenueRentalPackage:f,selectedAddOnPackages:c,guestCount:i,authoritativePricing:m,eventDate:r}),R=u.useMemo(()=>o.map(g=>{var T;const M=g.pricingMode==="self_service_range"&&((T=g.sliders)!=null&&T.length)?st(g.sliders,h??[]):g.maxPrice!==g.minPrice?(g.minPrice+g.maxPrice)/2:g.minPrice,N=g.priceType==="per_event"?M:g.priceType==="per_hour"?M*Math.max(a,0):g.priceType==="per_person_per_hour"?M*Math.max(i,1)*Math.max(a,0):M*Math.max(i,1);return{packageId:g.id,packageName:g.name,price:N}}),[o,i,a,h]),_=u.useMemo(()=>{if(b.pricingBreakdown.total==null||!(t!=null&&t.listingId)||!s)return null;const g=n.pricing??{},{startDateTime:M,endDateTime:N}=nt(r,d,l),T=x.status==="success"&&x.selectionSnapshots?x.selectionSnapshots:void 0,k=typeof b.pricingBreakdown.total=="number"?b.pricingBreakdown.total:void 0;return typeof b.pricingBreakdown.serviceFee=="number"&&b.pricingBreakdown.serviceFee,Kn({listingId:t.listingId,listingTitle:s.name,hours:a,baseRate:typeof g.baseRate=="number"?g.baseRate:0,minimumHours:typeof g.minimumHours=="number"?g.minimumHours:1,cleaningFee:typeof g.cleaningFee=="number"?g.cleaningFee:0,overtimeRate:typeof g.overtimeRate=="number"?g.overtimeRate:0,selectedPackages:R,selectionSnapshots:T,skipBaseRate:!!f,total:k},ia(b.pricingBreakdown))},[b.pricingBreakdown,t==null?void 0:t.listingId,s,n.pricing,r,d,l,i,a,R,f,x]);return{pricing:b,authoritativeVenueDisplayBreakdown:_}}const Ds="/default-profile-icon.png",ca=t=>String(t??"").toLowerCase()==="plec",G=t=>typeof t=="string"&&t.trim().length>0?t.trim():void 0,da=t=>[G(t.profilePhoto),G(t.profilePhotoUrl),G(t.profile_photo_url),G(t.reviewerPhoto),G(t.reviewer_photo),G(t.photoURL),G(t.photoUrl)].find(Boolean),ua=t=>G(t.reviewerPublicId)??G(t.reviewer_public_id),ma=t=>G(t.bookingId)??G(t.booking_id),xa=t=>G(t.reviewerOrganization)??G(t.reviewer_organization)??G(t.organization);function Vs(t){const s=t.reply??t.hostReply??t.host_reply;if(!s||typeof s!="object")return;const n=s,a=G(n.comment);if(a)return{replyId:G(n.replyId)??G(n.reply_id),comment:a,createdAt:G(n.createdAt)??G(n.created_at),updatedAt:G(n.updatedAt)??G(n.updated_at),authorName:G(n.authorName)??G(n.author_name),authorPublicId:G(n.authorPublicId)??G(n.author_public_id)}}const En=t=>G(t==null?void 0:t.organization)??G(t==null?void 0:t.organisation)??G(t==null?void 0:t.company);async function ha(t){const s=new AbortController,n=setTimeout(()=>s.abort(),12e3);try{const a=await fetch(Ge(`/bookings/${encodeURIComponent(t)}`),{credentials:"include",signal:s.signal});if(!a.ok)return{photo:null};if(!(a.headers.get("content-type")||"").includes("application/json"))return{photo:null};const i=await a.json(),r=G(i.guestAvatar)??G(i.guest_avatar)??G(i.guestProfilePhoto)??G(i.guest_profile_photo);if(r)return{photo:await ts(r)};const d=G(i.guestPublicId)??G(i.guest_public_id);if(!d)return{photo:null};const l=await fetch(Ge(`/users/profile/by-id/${encodeURIComponent(d)}`),{credentials:"include"});if(!l.ok)return{photo:null};if(!(l.headers.get("content-type")||"").includes("application/json"))return{photo:null};const h=await l.json(),f=h.profile??h,c=await ts(Fn(f)),m=En(f);return{photo:c,...m?{organization:m}:{}}}catch{return{photo:null}}finally{clearTimeout(n)}}const Fn=t=>[t==null?void 0:t.photoURL,t==null?void 0:t.photoUrl,t==null?void 0:t.profilePhoto,t==null?void 0:t.profilePhotoUrl,t==null?void 0:t.avatar,t==null?void 0:t.image].find(n=>typeof n=="string"&&n.trim().length>0)||null,ts=async t=>{if(!t)return null;if(!dr(t))return t;try{const s=await fetch(Ge(`/users/photo/presigned-url?photoURL=${encodeURIComponent(t)}`),{credentials:"include"});if(!s.ok||!(s.headers.get("content-type")||"").includes("application/json"))return t;const a=await s.json();return a.readURL||a.readUrl||t}catch(s){return console.error("Failed to resolve presigned profile photo URL",s),t}};function Ws(t){if(!t)return null;if(typeof window>"u")return t;try{const s=new URL(t,window.location.href);return s.pathname.includes("/reviews/google-photo")?`${window.location.origin}${s.pathname}${s.search}`:t}catch{return t}}const pa=(t,s)=>{var N,T,k,v;const[n,a]=u.useState(null),[o,i]=u.useState(!0),[r,d]=u.useState(null),[l,x]=u.useState([]),[h,f]=u.useState(null),[c,m]=u.useState(null),[b,R]=u.useState(null);u.useEffect(()=>{let w=!0;return(async()=>{if(!t){d("Missing venue id"),i(!1);return}try{const y=s?await Rr(t):await Tr(t);if(!w)return;if(y.listingKind!=="venue"){console.error(`Listing ${t} is a ${y.listingKind}, not a venue. Route mismatch.`),w&&(d("This listing is not a venue. Please use the correct link."),i(!1));return}a(y);try{const I=await fetch(Ge(`/reviews/listing/${t}`)),E=I.headers.get("content-type")||"";if(I.ok&&E.includes("application/json")){const B=await I.json(),z=B.reviews||[],O=await Promise.all(z.map(async $=>{const A=$,S=da(A)??null,H=await ts(S);if(!ca($.type))return{...$,profilePhoto:Ws(H)||Ds,reply:Vs(A)};let P=H,W=xa(A);const U=ua(A);if(U)try{const q=await fetch(Ge(`/users/profile/by-id/${encodeURIComponent(U)}`),{credentials:"include"});if(q.ok&&(q.headers.get("content-type")||"").includes("application/json")){const Z=await q.json(),F=Z.profile??Z;P||(P=await ts(Fn(F))||P),W=W??En(F)}}catch(q){console.error("Failed to load reviewer profile",q)}if(!P){const q=ma(A);if(q){const K=await ha(q);P=K.photo,W=W??K.organization}}return{...$,profilePhoto:Ws(P)||Ds,...W?{reviewerOrganization:W}:{},reply:Vs(A)}}));x(O),f(B.avgRating??null),m(B.totalReviews??null)}else console.warn(`Reviews endpoint returned ${I.status} or non-JSON response, skipping`),x([]),f(null),m(null)}catch(I){console.error("Failed to load reviews:",I),x([]),f(null),m(null)}i(!1)}catch(y){if(console.error("Failed to load listing",y),w){const I=y instanceof Error?y.message:String(y);I.includes("not found")||I.includes("404")?d("We couldn't find that venue. It may be unpublished or was removed."):d(`Failed to load venue: ${I}`),i(!1)}}})(),()=>{w=!1}},[t,s]),u.useEffect(()=>{async function w(){var y,I,E,B;const p=n==null?void 0:n.ownerPublicId;if(!p){n!=null&&n.ownerInternalId&&console.warn("Listing has ownerInternalId but no ownerPublicId - profile fetch skipped. This may indicate incomplete migration.");return}try{const z=((I=(y=n.draftData)==null?void 0:y.onboardingMetadata)==null?void 0:I.claimed)===!1;let O;if(z){const P=(B=(E=n.draftData)==null?void 0:E.onboardingMetadata)==null?void 0:B.ownerEmail;if(!P){console.warn("Listing has unclaimed account but no ownerEmail in onboardingMetadata");return}O=Ge(`/users/profile?email=${encodeURIComponent(P)}&checkOnly=true`)}else O=Ge(`/users/profile/by-id/${p}`);const $=await fetch(O,{credentials:"include"});if(!$.ok)return;if(!($.headers.get("content-type")||"").includes("application/json")){console.warn("Host profile response is not JSON, skipping avatar load");return}const S=await $.json(),H=S.profile??S;R(H)}catch(z){console.error("Failed to load host profile",z)}}w()},[n==null?void 0:n.ownerPublicId,n==null?void 0:n.userId,(T=(N=n==null?void 0:n.draftData)==null?void 0:N.onboardingMetadata)==null?void 0:T.ownerEmail,(v=(k=n==null?void 0:n.draftData)==null?void 0:k.onboardingMetadata)==null?void 0:v.claimed]);const _=u.useMemo(()=>n?Mr(n):null,[n]),g=u.useMemo(()=>Ir(n??void 0),[n]),M=u.useMemo(()=>(g==null?void 0:g.metadata)??{},[g==null?void 0:g.metadata]);return{listing:n,effectiveData:g??void 0,isLoading:o,error:r,transformedVenue:_,metadata:M,reviews:l,avgRating:h,totalReviews:c,hostProfileData:b}},Ys=(t,s)=>{const[n,a]=t.split(":").map(Number),[o,i]=s.split(":").map(Number);if([n,a,o,i].some(d=>!Number.isFinite(d)))return null;let r=o*60+(i||0)-(n*60+(a||0));return r<0&&(r+=24*60),r<=0?null:r/60},fa=({schedule:t})=>{const[s]=Js(),[n,a]=u.useState(()=>{const N=s.get("guests");if(N){const T=Number(N);if(Number.isFinite(T)&&T>1)return T}return 20}),[o,i]=u.useState(()=>{const N=s.get("duration");if(N&&N!=="All day"&&N.toLowerCase()!=="all day"){const{startTime:k,endTime:v}=is(N);if(k&&v)try{const[w,p]=k.split(":").map(Number),[y,I]=v.split(":").map(Number),E=w*60+(p||0);let z=y*60+(I||0)-E;z<0&&(z+=24*60);const O=z/60;if(O>0)return O}catch{}}const T=N?Number(N):NaN;return Number.isFinite(T)&&T>0&&T!==4?T:3}),[r,d]=u.useState(()=>{const N=s.get("check_in")||s.get("date");if(N)try{return ss(Rn(N),"yyyy-MM-dd")}catch{}return""}),{startTime:l,endTime:x}=is(s.get("duration")),[h,f]=u.useState(()=>l||""),[c,m]=u.useState(()=>x||""),b=u.useMemo(()=>{if(!h||!c)return o;try{const[N,T]=h.split(":").map(Number),[k,v]=c.split(":").map(Number),w=N*60+(T||0);let y=k*60+(v||0)-w;y<0&&(y+=24*60);const I=y/60;return I>0?I:o}catch{return o}},[h,c,o]),R=u.useMemo(()=>Math.max(ht*60,Math.round(o*60)),[o]),_=u.useCallback(N=>{if(f(N),!N){m("");return}const T=Ss(N,R);T&&m(T)},[R]),g=u.useCallback(N=>{if(m(N),!N||!h)return;const T=Ys(h,N);T!=null&&i(Math.max(ht,Bs(T)))},[h]),M=u.useCallback(N=>{const T=Math.max(ht*60,N);if(i(T/60),h){const k=Ss(h,T);k&&m(k)}},[h]);return u.useEffect(()=>{const N=s.get("duration");if(N){const{startTime:T,endTime:k}=is(N);if(T&&k){f(T),m(k);const v=Ys(T,k);v!=null&&i(Math.max(ht,Bs(v)))}else N.toLowerCase()==="all day"&&(f(""),m(""))}},[s]),{eventDate:r,setEventDate:d,startTime:h,setStartTime:_,endTime:c,setEndTime:g,guestCount:n,setGuestCount:a,durationHours:o,durationMinutes:R,setDurationMinutes:M,calculatedHours:b}},ga=()=>{const[t,s]=u.useState(!1),[n,a]=u.useState(!1),[o,i]=u.useState(!1),[r,d]=u.useState(!1),[l,x]=u.useState(!1),[h,f]=u.useState(!1),[c,m]=u.useState(null),[b,R]=u.useState(null),[_,g]=u.useState(null),[M,N]=u.useState(null);return{isShareOpen:t,setIsShareOpen:s,isPricingBreakdownOpen:n,setIsPricingBreakdownOpen:a,isBookingDetailsOpen:o,setIsBookingDetailsOpen:i,showReplaceModal:r,setShowReplaceModal:d,showReplaceVenueModal:l,setShowReplaceVenueModal:x,showTimeConflictModal:h,setShowTimeConflictModal:f,pendingVenue:c,setPendingVenue:m,compatibilityResult:b,setCompatibilityResult:R,existingVenueInfo:_,setExistingVenueInfo:g,timeConflictData:M,setTimeConflictData:N}},ba=({listing:t,transformedVenue:s,venueAddress:n,eventDate:a,startTime:o,endTime:i,guestCount:r,calculatedHours:d,selectedPackageIds:l,selectedPackageNames:x,skipBaseRate:h,selectedAddOns:f,sliderSelections:c,schedule:m,blockedDates:b=[],bookingWindowDays:R,minimumLeadTimeHours:_,venueCapacityMin:g,venueCapacityMax:M,packageGuestMin:N,packageGuestMax:T,authoritativePricing:k,venueDisplayBreakdown:v,selectedPackagesPriced:w,venuePricing:p})=>{const{toast:y}=hn(),{startCheckout:I}=vr(),E=u.useCallback(async()=>{if(!t||!s){y({title:"Error",description:"Listing information is not available",variant:"destructive"});return}if(t.listingKind!=="venue"){console.error(`Cannot book ${t.listingKind} as venue. Listing ID: ${t.listingId}`),y({title:"Error",description:"Invalid listing type. This listing cannot be booked as a venue.",variant:"destructive"});return}if(!a){y({title:"Missing information",description:"Please select an event date",variant:"destructive"});return}try{const[A,S,H]=a.split("-").map(Number),P=new Date(A,S-1,H);if(b.includes(a)){y({title:"Date not available",description:"The selected date is blocked. Please choose a different date.",variant:"destructive"});return}if(!es(a,R,_)){y({title:"Date not available",description:"The selected date is outside this venue's booking window.",variant:"destructive"});return}if(!gs(P,m)){y({title:"Date not available",description:"The selected date is not available. Please choose a different date.",variant:"destructive"});return}}catch{y({title:"Invalid date",description:"Please select a valid date",variant:"destructive"});return}if(!o||!i){y({title:"Missing information",description:"Please select both start and end times",variant:"destructive"});return}const O=bs(d);if(O){y({title:"Invalid duration",description:O,variant:"destructive"});return}if(!r||r<1){y({title:"Missing information",description:"Please enter the number of guests (minimum 1)",variant:"destructive"});return}const $=kt({guestCount:r,venueCapacityMin:g,venueCapacityMax:M,packageGuestMin:N,packageGuestMax:T});if($){y({...$,variant:"destructive"});return}try{const A=ue=>{if(!ue)return"00:00";if(/^\d{1,2}:\d{2}$/.test(ue))return ue;const ce=ue.match(/(\d{1,2}):(\d{2})\s*(AM|PM)/i);if(ce){let he=parseInt(ce[1],10);const Ce=parseInt(ce[2],10),ye=ce[3].toUpperCase();return ye==="PM"&&he!==12&&(he+=12),ye==="AM"&&he===12&&(he=0),`${he.toString().padStart(2,"0")}:${Ce.toString().padStart(2,"0")}`}return"00:00"},S=A(o),H=A(i),{startDateTime:P,endDateTime:W}=nt(a,S,H),[U,q,K]=a.split("-").map(Number),Z=new Date(U,q-1,K),F=Os(S,H,Z,m);if(F){y({title:"Time not available",description:F,variant:"destructive"});return}try{const ue=await fetch(Ge(`/public/venues/${t.listingId}/conflict?start=${encodeURIComponent(P)}&end=${encodeURIComponent(W)}`));if(ue.ok){const ce=await ue.json();if(ce!=null&&ce.hasConflict){y({title:"Time not available",description:"This date and time are no longer available. Please select a different time.",variant:"destructive"});return}}}catch{}const te=typeof(k==null?void 0:k.total)=="number"?k.total:typeof(v==null?void 0:v.total)=="number"?v.total??void 0:void 0,Q=typeof(k==null?void 0:k.serviceFee)=="number"?k.serviceFee:typeof(v==null?void 0:v.serviceFee)=="number"?v.serviceFee??void 0:void 0,oe=typeof(k==null?void 0:k.subtotal)=="number"?k.subtotal:typeof te=="number"&&typeof Q=="number"?te-Q:void 0,_e={listingId:t.listingId,listingTitle:s.name,listingKind:"venue",startTime:P,endTime:W,hours:d,guestCount:r,imageUrl:s.main_image||void 0,location:(n==null?void 0:n.trim())||s.location||(s.city&&s.state?`${s.city}, ${s.state}`:s.city||s.state||void 0),city:s.city,state:s.state,latitude:s.latitude,longitude:s.longitude,selectedPackageId:l[0]??void 0,selectedPackageName:(x==null?void 0:x[0])??void 0,selectedAddOns:f.length>0?f:void 0,sliderSelections:c!=null&&c.length?c:void 0,skipBaseRate:h,price:s.baseRate,total:te,subtotal:oe,serviceFee:Q,taxStatus:"calculated_at_checkout",baseRate:(p==null?void 0:p.baseRate)??s.baseRate,cleaningFee:p==null?void 0:p.cleaningFee,minimumHours:p==null?void 0:p.minimumHours,overtimeRate:p==null?void 0:p.overtimeRate,selectedPackages:w&&w.length>0?w:void 0,selectionMode:"package"};I(_e)}catch(A){console.error("Error starting checkout:",A),y({title:"Error",description:"An error occurred while starting checkout",variant:"destructive"})}},[t,s,n,a,o,i,r,d,l,x,h,f,c,m,b,R,_,g,M,N,T,k,v,w,p,I,y]),B=u.useCallback(()=>{if(!a||!o||!i||!r||r<1||kt({guestCount:r,venueCapacityMin:g,venueCapacityMax:M,packageGuestMin:N,packageGuestMax:T}))return!1;try{const[S,H,P]=a.split("-").map(Number),W=new Date(S,H-1,P);if(b.includes(a)||!es(a,R,_)||!gs(W,m))return!1}catch{return!1}const O=S=>{if(!S)return"";if(/^\d{1,2}:\d{2}$/.test(S))return S;const H=S.match(/(\d{1,2}):(\d{2})\s*(AM|PM)/i);if(H){let P=parseInt(H[1],10);const W=parseInt(H[2],10),U=H[3].toUpperCase();return U==="PM"&&P!==12&&(P+=12),U==="AM"&&P===12&&(P=0),`${P.toString().padStart(2,"0")}:${W.toString().padStart(2,"0")}`}return""},$=O(o),A=O(i);if(!$||!A)return!1;try{const[S,H,P]=a.split("-").map(Number),W=new Date(S,H-1,P);if(Os($,A,W,m))return!1}catch{return!0}return!bs(d)},[a,o,i,r,d,m,b,R,_,g,M,N,T]);return{handleAddToCart:E,cartLoading:!1,validateBeforeAnimate:B}},Ee=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){const s=Number(t);if(Number.isFinite(s))return s}},ya=t=>{const s=Ee(t.minAttendees);if(typeof s=="number"&&s>0)return s;const n=t.guestLimit&&typeof t.guestLimit=="object"?t.guestLimit:null,a=n?Ee(n.min):void 0;if(typeof a=="number"&&a>0)return a;const o=Ee(t.minGuests??t.minGuest);return typeof o=="number"&&o>0?o:null},ja=t=>{const s=Ee(t.maxAttendees);if(typeof s=="number"&&s>0)return s;const n=t.guestLimit&&typeof t.guestLimit=="object"?t.guestLimit:null,a=n?Ee(n.max):void 0;if(typeof a=="number"&&a>0)return a;const o=Ee(t.maxGuests??t.maxGuest);return typeof o=="number"&&o>0?o:null},Na=t=>{const s=Ee(t.durationHours??t.hours);if(typeof s=="number"&&s>0)return s;const n=t.duration&&typeof t.duration=="object"?t.duration:null;if(!n)return null;const a=Ee(n.hours)??0,o=Ee(n.minutes)??0,i=a+o/60;return i>0?i:null},va=t=>t==="per_event"||t==="per_hour"||t==="per_person_per_hour"?t:"per_person",wa=t=>{if(t.includesVenueRental===!0||t.skipBaseRate===!0||t.includesRental===!0)return!0;const s=String(t.packageType??t.type??"").trim().toLowerCase();if(s==="venue_rental"||s==="rental_buyout"||s==="full_buyout"||s==="buyout")return!0;const n=`${String(t.name??"")} ${String(t.description??"")} ${String(t.restrictions??"")}`.trim().toLowerCase();return/(buyout|full[\s-]?buyout|includes?\s+venue\s+rental|venue\s+rental\s+included)/.test(n)},Ra=t=>{const s=t&&typeof t=="object"?t:void 0;return(Array.isArray(s==null?void 0:s.packages)?s.packages:[]).filter(a=>!!(a&&typeof a=="object")).map(a=>{const o=Ee(a.minPrice)??0,i=Ee(a.maxPrice),r=typeof i=="number"&&i!==o?i:o,d=va(a.priceType);return{id:typeof a.id=="string"?a.id:crypto.randomUUID(),name:typeof a.name=="string"?a.name:"Package",description:typeof a.description=="string"?a.description:void 0,priceType:d,minPrice:o,maxPrice:r,durationHours:Na(a),minAttendees:ya(a),maxAttendees:ja(a),includesVenueRental:wa(a),pricingMode:a.pricingMode==="self_service_range"?"self_service_range":"fixed",sliders:Array.isArray(a.sliders)?a.sliders.filter(l=>typeof l.id=="string"&&typeof l.min=="number"&&typeof l.max=="number"):void 0}}).filter(a=>a.name.length>0)};function Ta(t){const s=u.useMemo(()=>Ra(t),[t]),n=u.useMemo(()=>a=>s.find(o=>o.id===a)??null,[s]);return{packages:s,getPackageById:n}}const Gs=[];function Ma({listingId:t,startTime:s,endTime:n,guestCount:a,initialState:o,venueHourlyOnlyPreview:i=!1,packages:r,previewEnabled:d=!0}){var w;const[l,x]=u.useState({selectedPackageIds:(o==null?void 0:o.selectedPackageIds)??[],selectedAddOns:(o==null?void 0:o.selectedAddOns)??Gs,sliderSelections:(o==null?void 0:o.sliderSelections)??[]}),h=(r??[]).filter(p=>{var y;return l.selectedPackageIds.includes(p.id)&&p.pricingMode==="self_service_range"&&(((y=p.sliders)==null?void 0:y.length)??0)>0}),f=h.length===0||h.every(p=>st(p.sliders,l.sliderSelections??[])>0),c=!!(d&&s&&n&&a&&f&&(l.selectedPackageIds.length>0||l.selectedAddOns.length>0||i)),{data:m,status:b,error:R}=nn({queryKey:["pricing-preview",t,s,n,a,l.selectedPackageIds,l.selectedAddOns,l.sliderSelections],queryFn:({signal:p})=>{if(!s||!n||!a)throw new Error("Pricing preview requires booking time and guest count.");return zn({listingId:t,startTime:s,endTime:n,guestCount:a,selectedPackageIds:l.selectedPackageIds.length>0?l.selectedPackageIds:void 0,selectedPackageId:l.selectedPackageIds[0]??void 0,selectedAddOns:l.selectedAddOns,sliderSelections:l.sliderSelections,signal:p})},enabled:c,staleTime:3e4}),_=c?b==="pending"?{status:"loading"}:b==="error"?{status:"error",error:R instanceof Error?R.message:"Failed to fetch pricing preview"}:{status:"success",subtotal:m==null?void 0:m.subtotal,serviceFee:m==null?void 0:m.serviceFee,total:m==null?void 0:m.total,advanceBookingModifier:(m==null?void 0:m.advanceBookingModifier)??null,selectionSnapshots:(w=m==null?void 0:m.selectionSnapshots)==null?void 0:w.map(p=>({selectionType:p.selectionType,sourceEntityId:p.sourceEntityId,name:p.name,priceModel:p.priceModel,quantity:p.quantity,unitPrice:p.unitPrice,baseAmount:p.baseAmount,finalAmount:p.finalAmount,includesVenueRental:p.includesVenueRental}))}:{status:"idle"},g=u.useCallback(p=>{const y=r==null?void 0:r.find(I=>I.id===p);x(I=>{var z;const E=I.selectedPackageIds??[];if(E.includes(p)){const O=E.filter(S=>S!==p),$=new Set(((z=y==null?void 0:y.sliders)==null?void 0:z.map(S=>S.id))??[]),A=$.size>0?I.sliderSelections.filter(S=>!$.has(S.sliderId)):I.sliderSelections;return{...I,selectedPackageIds:O,sliderSelections:A}}let B;return y!=null&&y.includesVenueRental?B=[...E.filter($=>{var A;return!((A=r==null?void 0:r.find(S=>S.id===$))!=null&&A.includesVenueRental)}),p]:B=[...E,p],{...I,selectedPackageIds:B}})},[r]),M=u.useCallback(p=>{x(p===null?y=>({...y,selectedPackageIds:[],sliderSelections:[]}):y=>({...y,selectedPackageIds:[p],sliderSelections:[]}))},[]),N=u.useCallback((p,y=1)=>{x(I=>{const B=I.selectedAddOns.find(z=>z.addOnId===p)?I.selectedAddOns.filter(z=>z.addOnId!==p):[...I.selectedAddOns,{addOnId:p,quantity:y}];return{...I,selectedAddOns:B}})},[]),T=u.useCallback((p,y)=>{x(I=>({...I,selectedAddOns:I.selectedAddOns.map(E=>E.addOnId===p?{...E,quantity:y}:E)}))},[]),k=u.useCallback(()=>{x({selectedPackageIds:[],selectedAddOns:Gs,sliderSelections:[]})},[]),v=u.useCallback(p=>{x(y=>({...y,sliderSelections:p}))},[]);return{selectedPackageIds:l.selectedPackageIds,selectedPackageId:l.selectedPackageIds[0]??null,selectedAddOns:l.selectedAddOns,sliderSelections:l.sliderSelections??[],previewState:_,togglePackage:g,setSelectedPackage:M,toggleAddOn:N,setAddOnQuantity:T,clearSelection:k,setSliderSelections:v}}function Ia({isMobile:t,isShareOpen:s,isPricingBreakdownOpen:n,isBookingDetailsOpen:a,showReplaceModal:o,showReplaceVenueModal:i,showTimeConflictModal:r}){return{stickyBookingCardRef:u.useRef(null),stickyCardPosition:null}}function _a({hash:t,listingId:s,reviewsLength:n,scrollToReviewsToken:a}){u.useEffect(()=>{if((t||window.location.hash)!=="#reviews"||!s)return;const i=(d=0)=>{const l=document.getElementById("reviews");if(!l)return!1;const x=l.getBoundingClientRect();if(x.top>=0&&x.top<window.innerHeight&&x.top<150&&d>0)return!0;const f=document.querySelector('div[class*="overflow-y-auto"][class*="flex-1"]');if(f&&f.scrollHeight>f.clientHeight){const c=f.getBoundingClientRect(),m=l.getBoundingClientRect(),b=f.scrollTop,R=m.top-c.top+b-20;f.scrollTo({top:Math.max(0,R),behavior:d===0?"auto":"smooth"})}else{const b=l.getBoundingClientRect().top+window.pageYOffset-100;window.scrollTo({top:Math.max(0,b),behavior:d===0?"auto":"smooth"})}return!0},r=[];return requestAnimationFrame(()=>{i(0)||(r.push(window.setTimeout(()=>i(1),100)),r.push(window.setTimeout(()=>i(2),300)),r.push(window.setTimeout(()=>i(3),600)),r.push(window.setTimeout(()=>i(4),1e3)),r.push(window.setTimeout(()=>i(5),1500)))}),()=>{r.forEach(d=>window.clearTimeout(d))}},[t,s,n,a])}const Vt=15,pt=24*60,Ca=t=>{if(t.length===0)return[];const s=[...t].sort((a,o)=>a.start-o.start),n=[];for(const a of s){const o=n[n.length-1];if(!o){n.push({...a});continue}a.start<=o.end?o.end=Math.max(o.end,a.end):n.push({...a})}return n},Sa=t=>{const s=t.map(a=>{const o=rt(a.from),i=rt(a.to);return i<=o?null:{start:o,end:i}}).filter(a=>a!=null).sort((a,o)=>a.start-o.start);let n=0;for(const a of s){if(a.start>n)break;n=Math.max(n,a.end)}return n},ka=(t,s)=>{var m,b;const[n,a,o]=t.split("-").map(Number),i=new Date(n,a-1,o);if(Number.isNaN(i.getTime()))return[];const r=Hs(i),d=new Date(i);d.setDate(d.getDate()+1);const l=Hs(d),x=((m=Us(r,s))==null?void 0:m.windows)??[],h=((b=Us(l,s))==null?void 0:b.windows)??[],f=Sa(h),c=[];for(const R of x){const _=rt(R.from),g=rt(R.to);if(g===_)continue;if(g>_){c.push({start:_,end:g});continue}c.push({start:_,end:pt});const M=Math.min(g,f);M>0&&c.push({start:pt,end:pt+M})}return Ca(c)},Ks=(t,s)=>{if(s.length===0)return null;const n=s.findIndex(o=>t>=o.start&&t<o.end);if(n<0)return null;let a=s[n].end;for(let o=n+1;o<s.length;o+=1){const i=s[o];if(i.start>a)break;a=Math.max(a,i.end)}return a},ls=(t,{minAbs:s=0,maxAbs:n=Number.POSITIVE_INFINITY,includeEnd:a=!1}={})=>{const o=[];for(const i of t){const r=Math.max(i.start,s),d=Math.min(i.end,n);if(d<=r)continue;const l=Math.ceil(r/Vt)*Vt,x=a?d:d-Vt;for(let h=l;h<=x;h+=Vt)o.push({value:jn(h),isNextDay:h>=pt})}return o},Qs=t=>[...t].sort((s,n)=>{const a=rt(s.value),o=rt(n.value);return a-o});function Aa({eventDate:t,setEventDate:s,startTime:n,setStartTime:a,endTime:o,setEndTime:i,schedule:r,availability:d,blockedDates:l,fixedDurationHours:x}){var M,N,T,k;const h=u.useCallback(v=>{s(v),a(""),i("")},[s,a,i]),f=u.useMemo(()=>t?ka(t,r):[],[t,r]),c=u.useMemo(()=>f.length===0?[]:ls(f,{maxAbs:pt-1,includeEnd:!1}).filter(w=>{const p=rt(w.value),y=Ks(p,f);return y!=null&&p+ht*60<=y}),[f]),m=u.useMemo(()=>{if(f.length===0)return[];if(!n)return Qs(ls(f,{maxAbs:pt-1,includeEnd:!0}));const v=rt(n),w=Ks(v,f);if(w==null)return[];if(typeof x=="number"&&Number.isFinite(x)&&x>0){const p=v+x*60;return p>w?[]:[{value:jn(p),isNextDay:p>=pt}]}return Qs(ls(f,{minAbs:v+ht*60,maxAbs:w,includeEnd:!0}))},[f,n,x]),b=(M=c[0])==null?void 0:M.value,R=(N=c[c.length-1])==null?void 0:N.value,_=(T=m[0])==null?void 0:T.value,g=(k=m[m.length-1])==null?void 0:k.value;return u.useEffect(()=>{if(t)try{const v=Rn(`${t}T12:00:00`);(l.includes(t)||!es(t,typeof d.bookingWindowDays=="number"?d.bookingWindowDays:void 0,typeof d.minimumLeadTimeHours=="number"?d.minimumLeadTimeHours:void 0)||!gs(v,r))&&(s(""),a(""),i(""))}catch{}},[t,l,r,d.bookingWindowDays,d.minimumLeadTimeHours,s,a,i]),u.useEffect(()=>{if(!t)return;const v=new Set(c.map(p=>p.value)),w=new Set(m.map(p=>p.value));if(n&&!v.has(n)){a(""),i("");return}o&&(w.has(o)||i(""))},[t,n,o,c,m,a,i]),u.useEffect(()=>{var w;if(!n||!o)return;new Set(m.map(p=>p.value)).has(o)||i(((w=m[0])==null?void 0:w.value)??"")},[n,o,m,i]),{handleDateSelect:h,startTimeOptions:c,endTimeOptions:m,startTimeMinTime:b,startTimeMaxTime:R,endTimeMinTime:_,endTimeMaxTime:g}}function Pa({transformedVenue:t,effectiveData:s,metadata:n,listing:a,hostProfileData:o,locationPathname:i,locationSearch:r}){var M,N,T,k;const d=((N=(M=s==null?void 0:s.basics)==null?void 0:M.description)==null?void 0:N.trim())||((k=(T=n.basics)==null?void 0:T.description)==null?void 0:k.trim())||"Host has not added a description yet.",l=(t==null?void 0:t.location)||(a==null?void 0:a.locationLabel)||"Exact location shared after booking is confirmed.",x=u.useMemo(()=>{if(!t)return[xs];const v=[t.main_image,...t.galleryImages??[]].filter(w=>!!(w&&w.trim()));return v.length===0?[xs]:Array.from(new Set(v))},[t]),h=u.useMemo(()=>(t==null?void 0:t.galleryVideos)??[],[t==null?void 0:t.galleryVideos]),f=u.useMemo(()=>{const v=(s==null?void 0:s.amenities)??[],w=n.amenities??[],p=[...v,...w];return Array.from(new Set(p.map(y=>typeof y=="string"?y.trim().toLowerCase():null).filter(y=>!!y)))},[s==null?void 0:s.amenities,n.amenities]),c=(t==null?void 0:t.capacityLabel)||(()=>{var y,I;const v=(y=s==null?void 0:s.capacity)==null?void 0:y.min,w=(I=s==null?void 0:s.capacity)==null?void 0:I.max,p=typeof v=="number"&&v>1?v:void 0;return typeof p=="number"&&typeof w=="number"?`${p}–${w} guests`:typeof w=="number"?`Up to ${w} guests`:typeof p=="number"?`${p}+ guests`:null})(),m=u.useMemo(()=>{const v=n==null?void 0:n.venueDetails,w=v==null?void 0:v.subTypes;return Array.isArray(w)?w.map(p=>typeof p=="string"?p:p&&typeof p=="object"&&"label"in p?String(p.label):"").filter(p=>p.length>0):[]},[n==null?void 0:n.venueDetails]),b=u.useMemo(()=>{var w;const v=[];return(w=t==null?void 0:t.eventStyles)!=null&&w.length&&v.push(t.eventStyles[0].replace(/[_-]/g," ").replace(/\b\w/g,p=>p.toUpperCase())),f.includes("wifi")&&v.push("Fast Wi-Fi"),f.includes("parking")&&v.push("Onsite parking"),f.includes("event_staff")&&v.push("On-site team"),f.includes("bar_service")&&v.push("Bar service"),v.slice(0,4)},[f,t==null?void 0:t.eventStyles]),R=u.useMemo(()=>{const v=n.hostProfile??n.host??{},w=(o==null?void 0:o.photoURL)||(o==null?void 0:o.photoUrl)||(o==null?void 0:o.avatar)||(o==null?void 0:o.image)||void 0;return{...v,...o||{},avatar:w,userId:(o==null?void 0:o.userId)||(a==null?void 0:a.userId)}},[n.hostProfile,n.host,o,a==null?void 0:a.userId]),_=(o==null?void 0:o.photoURL)||(o==null?void 0:o.photoUrl)||(o==null?void 0:o.avatar)||(o==null?void 0:o.image)||"/default-profile-icon.png",g=u.useMemo(()=>typeof window<"u"?`${window.location.origin}${i}${r}`:`${i}${r}`,[i,r]);return{description:d,address:l,galleryImages:x,galleryVideos:h,amenityValues:f,capacityLabel:c,subTypes:m,highlights:b,hostProfile:R,hostPhoto:_,shareUrl:g}}function Ea({listing:t,transformedVenue:s,eventDate:n,startTime:a,endTime:o,guestCount:i,calculatedHours:r,selectedPackages:d,specialRequests:l,sliderSelections:x,providerBaseRate:h}){var R;const{startDateTime:f,endDateTime:c}=nt(n,a,o),m=h??s.baseRate??0;return{items:[{listingId:t.listingId,type:"venue",listingTitle:s.name,startTime:f,endTime:c,guestCount:i,hours:r,imageUrl:s.main_image||void 0,pricePerHour:m,price:m*r,selectedPackageIds:d.length>0?d.map(_=>_.id):void 0,selectedPackageId:(R=d[0])==null?void 0:R.id,skipBaseRate:d.some(_=>_.includesVenueRental),sliderSelections:x!=null&&x.length?x:void 0}],date:n,time:a,duration:r,startTime:f,endTime:c,specialRequests:(l==null?void 0:l.trim())||void 0}}function Fa({listing:t,transformedVenue:s,eventDate:n,startTime:a,endTime:o,guestCount:i,calculatedHours:r,selectedPackages:d,specialRequests:l,blockedDates:x,availability:h,providerBaseRate:f,venueCapacityMin:c,venueCapacityMax:m,packageGuestMin:b,packageGuestMax:R,sliderSelections:_,user:g,toast:M}){const N=At(),T=Rs(),[k,v]=u.useState(!1),[w,p]=u.useState(!1);return{handleRequestBooking:u.useCallback(async()=>{var B,z;if(k)return;if(!g){const O=`${T.pathname}${T.search}`;Wt(T.pathname)?Yt(O):N("/auth?returnTo="+encodeURIComponent(O));return}if(!t||!s){M({title:"Error",description:"Listing information is not available",variant:"destructive"});return}if(t.listingKind!=="venue"){M({title:"Error",description:"Invalid listing type.",variant:"destructive"});return}if(!n){M({title:"Missing information",description:"Please select an event date",variant:"destructive"});return}if(!a||!o){M({title:"Missing information",description:"Please select both start and end times",variant:"destructive"});return}if(x.includes(n)){M({title:"Date not available",description:"The selected date is blocked. Please choose a different date.",variant:"destructive"});return}if(!es(n,typeof h.bookingWindowDays=="number"?h.bookingWindowDays:void 0,typeof h.minimumLeadTimeHours=="number"?h.minimumLeadTimeHours:void 0)){M({title:"Date not available",description:"The selected date is outside this venue's booking window.",variant:"destructive"});return}const I=bs(r);if(I){M({title:"Invalid duration",description:I,variant:"destructive"});return}if(!i||i<1){M({title:"Missing information",description:"Please enter the number of guests (minimum 1)",variant:"destructive"});return}const E=kt({guestCount:i,venueCapacityMin:c,venueCapacityMax:m,packageGuestMin:b,packageGuestMax:R});if(E){M({...E,variant:"destructive"});return}try{v(!0);const O=Ea({listing:t,transformedVenue:s,eventDate:n,startTime:a,endTime:o,guestCount:i,calculatedHours:r,selectedPackages:d,specialRequests:l,sliderSelections:_,providerBaseRate:f}),A=((z=(B=(await pr()).tokens)==null?void 0:B.idToken)==null?void 0:z.toString())||"",H=await(await fetch(Ge("/bookings/create"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:A?`Bearer ${A}`:""},credentials:"include",body:JSON.stringify(O)})).json();if(H.mode==="instant_booking"){M({title:"Continue to checkout",description:"This listing uses instant booking. Complete your booking and payment at checkout.",variant:"destructive"});return}if(H.mode==="approval_required"){if(H.isIdempotent){M({title:"Request already submitted",description:"You already have a pending request for this date and time. Manage it from your bookings."}),N("/bookings");return}p(!0)}else console.error("Unexpected booking response:",H),M({title:"Error",description:H.message||H.error||"Unexpected response from server.",variant:"destructive"})}catch(O){console.error("Error requesting booking:",O),M({title:"Error",description:"Failed to submit booking request. Please try again.",variant:"destructive"})}finally{v(!1)}},[k,g,t,s,n,a,o,i,r,d,l,f,x,h,c,m,b,R,_,M,N,T.pathname,T.search]),isRequestingBooking:k,showRequestSubmitted:w,setShowRequestSubmitted:p}}const Ao=()=>{var Ne,ut,mt,wt,qt,Ms;const{id:t}=$n(),s=Rs(),n=At(),[a]=Js(),o=ur(),i=a.get("preview")==="true",{listing:r,effectiveData:d,isLoading:l,error:x,transformedVenue:h,metadata:f,reviews:c,avgRating:m,totalReviews:b,hostProfileData:R}=pa(t,i),[_,g]=u.useState(!1),[M,N]=u.useState(!1),[T,k]=u.useState(""),[v,w]=u.useState(!1),{isShareOpen:p,setIsShareOpen:y,isPricingBreakdownOpen:I,setIsPricingBreakdownOpen:E,isBookingDetailsOpen:B,setIsBookingDetailsOpen:z}=ga(),{stickyBookingCardRef:O,stickyCardPosition:$}=Ia({isMobile:o,isShareOpen:p,isPricingBreakdownOpen:I,isBookingDetailsOpen:B,showReplaceModal:!1,showReplaceVenueModal:!1,showTimeConflictModal:!1}),A=f.availability??{},S=Array.isArray(A.blockedDates)?A.blockedDates.filter(j=>typeof j=="string"):[],{unavailableDates:H}=Dn(r==null?void 0:r.listingId,{enabled:!!(r!=null&&r.listingId)&&!i}),P=H.length>0?H:S,W=u.useMemo(()=>Array.isArray(A.weeklySchedule)?[...A.weeklySchedule].sort((j,ae)=>{const be=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"];return be.indexOf(j==null?void 0:j.day)-be.indexOf(ae==null?void 0:ae.day)}):[],[A.weeklySchedule]),{eventDate:U,setEventDate:q,startTime:K,setStartTime:Z,endTime:F,setEndTime:te,guestCount:Q,setGuestCount:oe,durationHours:_e,durationMinutes:ue,setDurationMinutes:ce,calculatedHours:he}=fa({schedule:W}),Ce=(f==null?void 0:f.availability)??{},ye=(f==null?void 0:f.publishing)??{},Se=u.useMemo(()=>{var It;const j=os((It=d==null?void 0:d.availability)==null?void 0:It.acceptsInstantBookings);if(typeof j=="boolean")return j;const ae=os(Ce.acceptsInstantBookings);if(typeof ae=="boolean")return ae;const be=os(ye.acceptsInstantBookings);return typeof be=="boolean"?be:!0},[(Ne=d==null?void 0:d.availability)==null?void 0:Ne.acceptsInstantBookings,Ce.acceptsInstantBookings,ye.acceptsInstantBookings]),{description:He,address:at,galleryImages:pe,galleryVideos:ot,amenityValues:Ue,capacityLabel:ft,subTypes:Ke,highlights:Fe,hostProfile:fe,hostPhoto:ke,shareUrl:ve}=Pa({transformedVenue:h,effectiveData:d,metadata:f,listing:r,hostProfileData:R,locationPathname:s.pathname,locationSearch:s.search}),{packages:de,getPackageById:qe}=Ta(f.pricing),ze=null,Le=typeof((ut=d==null?void 0:d.capacity)==null?void 0:ut.min)=="number"?d.capacity.min:null,$e=typeof((mt=d==null?void 0:d.capacity)==null?void 0:mt.max)=="number"?d.capacity.max:null,{startDateTime:Be,endDateTime:Qe}=u.useMemo(()=>{if(!U||!K||!F)return{startDateTime:"",endDateTime:""};try{return nt(U,K,F)}catch{return{startDateTime:"",endDateTime:""}}},[U,K,F]),Oe=Vn(f.pricing),ge=u.useMemo(()=>{const j=f.pricing;return(r==null?void 0:r.listingKind)==="venue"&&typeof(j==null?void 0:j.baseRate)=="number"&&j.baseRate>0},[f,r==null?void 0:r.listingKind]),{selectedPackageIds:we,selectedPackageId:L,selectedAddOns:re,previewState:me,togglePackage:Ae,setSelectedPackage:gt,toggleAddOn:Pe,setAddOnQuantity:Je,sliderSelections:Ze,setSliderSelections:it}=Ma({listingId:(r==null?void 0:r.listingId)??"",startTime:Be||void 0,endTime:Qe||void 0,guestCount:Q>0?Q:void 0,venueHourlyOnlyPreview:ge,packages:de}),ie=u.useMemo(()=>we.map(j=>qe(j)).filter(j=>j!=null),[we,qe]),Re=u.useMemo(()=>ie.find(j=>j.includesVenueRental)??ie.find(j=>j.pricingMode==="self_service_range")??ie[0]??null,[ie]),je=ie.some(j=>j.includesVenueRental),lt=u.useMemo(()=>{const j=ie.map(ae=>ae.minAttendees).filter(ae=>typeof ae=="number");return j.length>0?Math.max(...j):null},[ie]),Xe=u.useMemo(()=>{const j=ie.map(ae=>ae.maxAttendees).filter(ae=>typeof ae=="number");return j.length>0?Math.min(...j):null},[ie]),{handleDateSelect:bt,startTimeOptions:yt,endTimeOptions:jt,startTimeMinTime:Te,startTimeMaxTime:De,endTimeMinTime:Ve,endTimeMaxTime:et}=Aa({eventDate:U,setEventDate:q,startTime:K,setStartTime:Z,endTime:F,setEndTime:te,schedule:W,availability:A,blockedDates:P,fixedDurationHours:Re==null?void 0:Re.durationHours}),se=u.useMemo(()=>{var ae;const j=(ae=f.pricing)==null?void 0:ae.baseRate;if(typeof j=="number"&&Number.isFinite(j))return j;if(typeof j=="string"){const be=Number(j);return Number.isFinite(be)?be:void 0}},[f.pricing]),{pricing:ne,authoritativeVenueDisplayBreakdown:Me}=la({listing:r,transformedVenue:h,metadata:f,calculatedHours:he,selectedPackages:ie,guestCount:Q,eventDate:U,startTime:K,endTime:F,previewState:me,sliderSelections:Ze}),tt=u.useMemo(()=>{if(me.status==="success")return{subtotal:me.subtotal,serviceFee:me.serviceFee,total:me.total};const j=ne==null?void 0:ne.pricingBreakdown;return{subtotal:(j==null?void 0:j.subtotal)??void 0,serviceFee:(j==null?void 0:j.serviceFee)??void 0,total:(j==null?void 0:j.total)??void 0}},[me,ne==null?void 0:ne.pricingBreakdown]),ct=u.useMemo(()=>ie.map(j=>({packageId:j.id,packageName:j.name,price:j.minPrice})),[ie]),ns=u.useMemo(()=>{const j=f.pricing,ae=be=>{if(typeof be=="number"&&Number.isFinite(be))return be;if(typeof be=="string"){const It=Number(be);return Number.isFinite(It)?It:void 0}};return{baseRate:ae(j==null?void 0:j.baseRate),cleaningFee:ae(j==null?void 0:j.cleaningFee),minimumHours:ae(j==null?void 0:j.minimumHours),overtimeRate:ae(j==null?void 0:j.overtimeRate)}},[f.pricing]),{handleAddToCart:Pt,cartLoading:rs,validateBeforeAnimate:as}=ba({listing:r,transformedVenue:h,venueAddress:at,eventDate:U,startTime:K,endTime:F,guestCount:Q,calculatedHours:he,selectedPackageIds:we,selectedPackageNames:ie.map(j=>j.name),skipBaseRate:je,selectedAddOns:re,sliderSelections:Ze,schedule:W,blockedDates:P,bookingWindowDays:typeof A.bookingWindowDays=="number"?A.bookingWindowDays:void 0,minimumLeadTimeHours:typeof A.minimumLeadTimeHours=="number"?A.minimumLeadTimeHours:void 0,venueCapacityMin:Le,venueCapacityMax:$e,packageGuestMin:lt,packageGuestMax:Xe,authoritativePricing:tt,venueDisplayBreakdown:Me,selectedPackagesPriced:ct,venuePricing:ns}),{user:J}=Ts(),{toast:Tt}=hn(),{handleRequestBooking:Et,isRequestingBooking:Ft,showRequestSubmitted:Lt,setShowRequestSubmitted:$t}=Fa({listing:r,transformedVenue:h,eventDate:U,startTime:K,endTime:F,guestCount:Q,calculatedHours:he,selectedPackages:ie,specialRequests:T,blockedDates:P,availability:A,venueCapacityMin:Le,venueCapacityMax:$e,packageGuestMin:lt,packageGuestMax:Xe,sliderSelections:Ze,providerBaseRate:se,user:J,toast:Tt}),Nt=u.useCallback(async()=>{if(!(r!=null&&r.listingId)||!J){g(!1);return}try{const j=await hr(r.listingId);g(j.length>0)}catch(j){console.warn("Failed to check saved status:",j),g(!1)}},[r==null?void 0:r.listingId,J]);u.useEffect(()=>{Nt()},[Nt]);const Bt=()=>{if(r!=null&&r.listingId){if(!J){const j=`${s.pathname}${s.search}`;Wt(s.pathname)?Yt(j):(typeof window<"u"&&sessionStorage.setItem("postAuthRedirect",j),n(`/auth?redirect=${encodeURIComponent(j)}`));return}N(!0)}},vt=s.state,Ot=vt==null?void 0:vt.scrollToReviews,Mt=()=>{if(!r)return;const j=new URLSearchParams({listing:r.listingId});U&&j.set("date",U),K&&j.set("start",K),F&&j.set("end",F),Q!=null&&Q>0&&j.set("guests",String(Q)),n(`/send_message?${j.toString()}`)},Ht=()=>{if(r){if(!J){const j=`${s.pathname}${s.search}`;Wt(s.pathname)?Yt(j):(typeof window<"u"&&sessionStorage.setItem("postAuthRedirect",j),n(`/auth?redirect=${encodeURIComponent(j)}`));return}w(!0)}},Ut=de.length>0&&!i&&!(J!=null&&J.publicId&&(r==null?void 0:r.ownerPublicId)===J.publicId)&&((qt=(wt=d==null?void 0:d.metadata)==null?void 0:wt.pricing)==null?void 0:qt.allowCustomQuotes)!==!1;_a({hash:s.hash,listingId:r==null?void 0:r.listingId,reviewsLength:(c==null?void 0:c.length)??0,scrollToReviewsToken:Ot});const dt=h==null?void 0:h.name,C=(Ms=d==null?void 0:d.location)==null?void 0:Ms.city,D=dt?C?`${dt} · ${C} | PLEC`:`${dt} | PLEC`:"PLEC",X=He.slice(0,155).trimEnd()+(He.length>155?"…":"");if(_r({title:dt?D:void 0,description:X,image:pe==null?void 0:pe[0],canonical:`https://plec-it.com${s.pathname}`,type:"website"}),x){const j=x==null?void 0:x.includes("not a venue");return e.jsx(zt,{showSearch:!0,showFooter:!0,children:e.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col items-center gap-6 px-6 py-24 text-center",children:[e.jsx(ds,{className:"h-12 w-12 text-gray-400"}),e.jsx("h1",{className:"text-3xl font-semibold text-gray-900",children:j?"Invalid Listing Type":"We couldn't load that venue"}),e.jsx("p",{className:"text-sm text-gray-600",children:x||"It may have been unpublished, removed, or the link is incorrect. Try searching again or reach out to our concierge team for help."}),e.jsx(le,{asChild:!0,className:"rounded-full px-6",children:e.jsx("a",{href:j?"/services":"/venues",children:j?"Browse Services":"Back to search"})})]})})}if(l)return e.jsx(zt,{showSearch:!0,showFooter:!0,children:o?e.jsx(La,{}):e.jsx($a,{})});if(!r||!h){const j=x==null?void 0:x.includes("not a venue");return e.jsx(zt,{showSearch:!0,showFooter:!0,children:e.jsxs("div",{className:"mx-auto flex max-w-3xl flex-col items-center gap-6 px-6 py-24 text-center",children:[e.jsx(ds,{className:"h-12 w-12 text-gray-400"}),e.jsx("h1",{className:"text-3xl font-semibold text-gray-900",children:j?"Invalid Listing Type":"We couldn't load that venue"}),e.jsx("p",{className:"text-sm text-gray-600",children:x||"It may have been unpublished, removed, or the link is incorrect. Try searching again or reach out to our concierge team for help."}),e.jsx(le,{asChild:!0,className:"rounded-full px-6",children:e.jsx("a",{href:j?"/services":"/venues",children:j?"Browse Services":"Back to search"})})]})})}const xe={listing:r,transformedVenue:h,metadata:f,address:at,description:He,galleryImages:pe,galleryVideos:ot,amenityValues:Ue,subTypes:Ke,highlights:Fe,capacityLabel:ft,availability:A,schedule:W,blockedDates:P,bookingWindowDays:typeof A.bookingWindowDays=="number"?A.bookingWindowDays:void 0,minimumLeadTimeHours:typeof A.minimumLeadTimeHours=="number"?A.minimumLeadTimeHours:void 0,packages:de,selectedPackageId:L,selectedPackageIds:we,selectedPackage:Re,selectedPackages:ie,onSelectPackage:gt,onTogglePackage:Ae,addOns:Oe,selectedAddOns:re,onToggleAddOn:Pe,onSetAddOnQuantity:Je,pricing:ne,authoritativeVenueDisplayBreakdown:Me,reviews:c,listingId:r==null?void 0:r.listingId,avgRating:m,totalReviews:b,hostProfile:fe,hostPhoto:ke,isSaved:_,savingVenue:!1,onSaveVenue:(r==null?void 0:r.status)==="published"?Bt:void 0,eventDate:U,setEventDate:bt,startTime:K,setStartTime:Z,endTime:F,setEndTime:te,guestCount:Q,setGuestCount:oe,durationHours:_e,durationMinutes:ue,setDurationMinutes:ce,startTimeMinTime:Te,startTimeMaxTime:De,endTimeMinTime:Ve,endTimeMaxTime:et,startTimeOptions:yt,endTimeOptions:jt,onAddToCart:i||!$s(r==null?void 0:r.status)||J!=null&&J.publicId&&(r==null?void 0:r.ownerPublicId)===J.publicId?()=>{Tt({title:"Not available",description:J!=null&&J.publicId&&(r==null?void 0:r.ownerPublicId)===J.publicId?"You cannot book your own listing.":"Publish this listing to accept bookings.",variant:"destructive"})}:Se?Pt:Et,cartLoading:Se?rs:Ft,validateBeforeAnimate:Se?as:void 0,isPricingBreakdownOpen:I,setIsPricingBreakdownOpen:E,isBookingDetailsOpen:B,setIsBookingDetailsOpen:z,onShareClick:()=>y(!0),acceptsInstantBookings:Se,specialRequests:T,setSpecialRequests:k,onRequestCustomQuote:Ut?Ht:void 0,bookingDisabled:i||!$s(r==null?void 0:r.status)||!!(J!=null&&J.publicId&&(r==null?void 0:r.ownerPublicId)===J.publicId),bookingDisabledMessage:J!=null&&J.publicId&&(r==null?void 0:r.ownerPublicId)===J.publicId?"You cannot book your own listing.":"Publish this listing to accept bookings.",venueCapacityMin:Le,venueCapacityMax:$e,packageGuestMin:lt,packageGuestMax:Xe,previewState:me,plannerCalendarHighlights:ze,sliderSelections:Ze,onSliderSelectionsChange:it};return e.jsxs(zt,{showSearch:!0,showFooter:!0,children:[i&&e.jsx("div",{className:"bg-amber-50 border-b border-amber-200 px-4 py-3 text-center",children:e.jsxs("p",{className:"text-sm text-amber-800",children:[e.jsx("span",{className:"font-semibold",children:"Preview Mode:"})," This is a draft listing preview. The listing is not yet published."]})}),J&&(r==null?void 0:r.hostCancellationWarning)&&e.jsx("div",{className:"bg-yellow-50 border-b border-yellow-200 px-4 py-3 text-center",children:e.jsx("p",{className:"text-sm text-yellow-800",children:"âš ï¸ This host has a history of last-minute cancellations."})}),o?e.jsx(Kr,{...xe,onMessageHost:Mt}):e.jsx(Qr,{...xe,onMessageHost:Mt,stickyCardRef:O,stickyCardPosition:$}),e.jsx(Kt,{open:p,onOpenChange:y,children:e.jsxs(Qt,{className:o?"":"max-w-lg rounded-3xl p-6",mobileBottomSheet:o,elevated:!0,children:[e.jsxs(Jt,{children:[e.jsx(Zt,{className:"text-xl font-semibold",children:"Share this venue"}),e.jsx(hs,{children:"Invite your planning team or clients to tour the space."})]}),e.jsx("div",{className:o?"space-y-3 text-sm":"mt-4 space-y-3 text-sm",children:e.jsx(Wn,{shareUrl:ve,context:"venue"})})]})}),e.jsx(xr,{open:M,onOpenChange:N,listingId:(r==null?void 0:r.listingId)??"",listingTitle:h==null?void 0:h.name,listingImageUrl:pe==null?void 0:pe[0],onSavedChange:()=>{Nt(),window.dispatchEvent(new CustomEvent("savedVenuesChanged"))}}),e.jsx(wr,{isOpen:Lt,onClose:()=>{$t(!1),n("/")}}),r&&e.jsx(Yn,{open:v,onClose:()=>w(!1),listingId:r.listingId,defaultEventDate:U||void 0,defaultGuestCount:Q>0?Q:void 0,defaultStartTime:K||void 0,defaultEndTime:F||void 0})]})},La=()=>e.jsxs("div",{className:"flex flex-col min-h-screen",children:[e.jsx(V,{className:"h-[360px] w-full rounded-none shrink-0"}),e.jsxs("div",{className:"bg-card -mt-8 relative z-10 rounded-t-[32px] pt-8 flex-1",children:[e.jsxs("div",{className:"px-6 pb-6 space-y-3 text-center",children:[e.jsx(V,{className:"h-8 w-3/4 mx-auto"}),e.jsx(V,{className:"h-4 w-32 mx-auto"}),e.jsxs("div",{className:"flex justify-center gap-2",children:[e.jsx(V,{className:"h-6 w-16 rounded-full"}),e.jsx(V,{className:"h-6 w-20 rounded-full"}),e.jsx(V,{className:"h-6 w-12 rounded-full"})]})]}),e.jsxs("div",{className:"px-6 pb-8 space-y-6",children:[e.jsx(V,{className:"h-4 w-full"}),e.jsx(V,{className:"h-4 w-full"}),e.jsx(V,{className:"h-7 w-28"}),e.jsx("div",{className:"space-y-3",children:[1,2].map(t=>e.jsx(V,{className:"h-20 w-full rounded-2xl"},t))}),e.jsx(V,{className:"h-7 w-36"}),e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(V,{className:"h-14 w-14 rounded-full shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(V,{className:"h-5 w-28"}),e.jsx(V,{className:"h-4 w-full"})]})]})]})]}),e.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-40 bg-card border-t p-4",children:e.jsx(V,{className:"h-12 w-full rounded-full"})})]}),$a=()=>e.jsx("div",{className:"mx-auto w-full max-w-7xl px-6 pb-24 pt-10 md:px-8",children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(V,{className:"h-4 w-28 mb-2"}),e.jsx(V,{className:"h-10 w-2/5 mt-2"}),e.jsxs("div",{className:"flex gap-2 mt-3",children:[e.jsx(V,{className:"h-7 w-24 rounded-full"}),e.jsx(V,{className:"h-7 w-28 rounded-full"}),e.jsx(V,{className:"h-7 w-16 rounded-full"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(V,{className:"h-10 w-28 rounded-full"}),e.jsx(V,{className:"h-10 w-24 rounded-full"})]})]}),e.jsx(V,{className:"h-[24rem] w-full rounded-[32px] md:rounded-r-none"}),e.jsxs("div",{className:"flex flex-col gap-10 lg:flex-row",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-10",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx(V,{className:"h-4 w-full"}),e.jsx(V,{className:"h-4 w-full max-w-[85%]"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(V,{className:"h-7 w-48"}),[1,2,3].map(t=>e.jsx(V,{className:"h-28 w-full rounded-2xl"},t))]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(V,{className:"h-7 w-44"}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(V,{className:"h-20 w-20 rounded-full shrink-0"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(V,{className:"h-5 w-32"}),e.jsx(V,{className:"h-4 w-full"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(V,{className:"h-7 w-36"}),e.jsx(V,{className:"h-[280px] w-full rounded-2xl"})]})]}),e.jsx("aside",{className:"w-full lg:w-[360px] xl:w-[400px] lg:flex-shrink-0",children:e.jsx("div",{className:"sticky top-24 space-y-6",children:e.jsxs("div",{className:"rounded-[32px] border border-border/70 p-6 shadow-xl space-y-4",children:[e.jsx(V,{className:"h-16 w-16 rounded-full mx-auto"}),e.jsx(V,{className:"h-5 w-28 mx-auto"}),e.jsx(V,{className:"h-4 w-40 mx-auto"}),e.jsxs("div",{className:"flex justify-center gap-2 pt-2",children:[e.jsx(V,{className:"h-8 w-8 rounded-full"}),e.jsx(V,{className:"h-8 w-8 rounded-full"}),e.jsx(V,{className:"h-8 w-8 rounded-full"})]}),e.jsx(V,{className:"h-px w-full"}),e.jsx(V,{className:"h-12 w-full rounded-full"}),e.jsx(V,{className:"h-10 w-full rounded-full"})]})})})]})]})});export{Ao as default};