import{j as e}from"./ui-vendor-CJlQk0Tq.js";import{fW as t,q as r,r as s,t as i,v as a,N as l,$ as o,a1 as n,e3 as c,C as d,d as m,eV as h,cF as x,Q as u,B as g,Y as p,Z as j,_ as f,a0 as v,eg as b,P as N,fS as y,eG as w}from"./index-BzXujQ-F.js";import{U as C}from"./UnifiedHero-BH4GcWsT.js";import{r as k,e as I,L as S}from"./react-vendor-f6QdChhz.js";import{S as T}from"./SectionHeading-BvTtpqtL.js";import{C as $}from"./CTAButton-CfAJjgj1.js";import{A}from"./aspect-ratio-BAn1PH2M.js";import{g as P}from"./bunny-image-VphMgYzL.js";import{I as B}from"./ImageLightbox-CW0m8ZKZ.js";import{S as U}from"./SocialShareButton-mvbNhE3x.js";import{U as D}from"./UnifiedPricingDisclaimer-BvAhNwdv.js";import{a as z}from"./ContactButtonGroup-BDaXPXrD.js";const E=({exteriorImages:o,interiorImages:n,exteriorCaptionPrefix:c="Exterior View",interiorCaptionPrefix:d="Interior View",className:m="",productTitle:h,productUrl:x,showShareButton:u=!0})=>{const[g,p]=k.useState(0),[j,f]=k.useState(0),[v,b]=k.useState(!1),[N,y]=k.useState("exterior"),[w,C]=k.useState("exterior"),I=t("(min-width: 1024px)"),S=k.useMemo(()=>o.map((e,t)=>({...e,optimizedSrc:P(e.src,{width:800,quality:85,format:"webp"}),thumbnailSrc:P(e.src,{width:120,height:90,format:"webp"}),caption:e.caption||`${c} ${t+1}`})),[o,c]),T=k.useMemo(()=>n.map((e,t)=>({...e,optimizedSrc:P(e.src,{width:800,quality:85,format:"webp"}),thumbnailSrc:P(e.src,{width:120,height:90,format:"webp"}),caption:e.caption||`${d} ${t+1}`})),[n,d]),$=e=>{y(e),b(!0)},A=()=>{"exterior"===N?p(e=>0===e?o.length-1:e-1):f(e=>0===e?n.length-1:e-1)},D=()=>{"exterior"===N?p(e=>e===o.length-1?0:e+1):f(e=>e===n.length-1?0:e+1)},z=e=>{var t;return(null==(t=("exterior"===e?S:T)["exterior"===e?g:j])?void 0:t.src)||""},E=(t,r,s,i,a)=>{var o,n,c,d;return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"bg-muted px-4 py-2 border-b flex items-center justify-between",children:[e.jsxs("h3",{className:"font-semibold text-foreground",children:[t," (",r.length,")"]}),u&&h&&e.jsx(U,{title:`${h} - ${t}`,description:`Check out the ${t.toLowerCase()} of this ${h}`,url:x,imageUrl:z(a),variant:"ghost",size:"sm",showText:!1,pageType:"structure",className:"h-8 w-8 p-0"})]}),e.jsxs("div",{className:"relative bg-muted cursor-pointer group flex-grow flex items-center justify-center overflow-hidden",onClick:()=>$(a),role:"img","aria-label":null==(o=r[s])?void 0:o.alt,tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),$(a))},children:[e.jsx("img",{src:null==(n=r[s])?void 0:n.optimizedSrc,alt:null==(c=r[s])?void 0:c.alt,className:"w-full h-full object-contain transition-transform duration-300 group-hover:scale-105",loading:"lazy"}),e.jsxs("div",{className:"absolute top-2 right-2 bg-black/60 text-white px-2 py-1 rounded text-xs",children:[s+1," of ",r.length]}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-300 flex items-center justify-center",children:e.jsx("span",{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity duration-300 text-sm font-medium",children:"Click to enlarge"})})]}),e.jsx("div",{className:"bg-muted border-t px-4 py-3",children:e.jsx("p",{className:"text-sm text-foreground",children:null==(d=r[s])?void 0:d.caption})}),r.length>1&&e.jsx("div",{className:"flex gap-2 p-3 bg-background border-t overflow-x-auto scrollbar-thin",children:r.map((t,a)=>e.jsx("button",{onClick:()=>i(a),className:l("flex-shrink-0 relative aspect-[4/3] w-20 overflow-hidden rounded border-2 transition-all duration-200",s===a?"border-primary ring-2 ring-primary/20 scale-105":"border-border hover:border-primary/50 opacity-70 hover:opacity-100"),"aria-label":`View image ${a+1} of ${r.length}`,"aria-current":s===a?"true":"false",children:e.jsx("img",{src:t.thumbnailSrc,alt:`Thumbnail ${a+1}`,className:"w-full h-full object-cover",loading:"lazy"})},a))})]})},V=(t,r,s,i)=>{var a,o,n,c;return e.jsxs("div",{children:[e.jsxs("div",{className:"relative overflow-hidden bg-muted cursor-pointer group",onClick:()=>$(i),role:"img","aria-label":null==(a=t[r])?void 0:a.alt,tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),$(i))},children:[e.jsx("img",{src:null==(o=t[r])?void 0:o.optimizedSrc,alt:null==(n=t[r])?void 0:n.alt,className:"w-full h-auto object-contain transition-transform duration-300 group-hover:scale-105",loading:"lazy"}),e.jsxs("div",{className:"absolute top-2 right-2 bg-black/60 text-white px-2 py-1 rounded text-xs",children:[r+1," of ",t.length]}),e.jsx("div",{className:"absolute inset-0 bg-black/0 group-hover:bg-black/10 transition-colors duration-300 flex items-center justify-center",children:e.jsx("span",{className:"text-white opacity-0 group-hover:opacity-100 transition-opacity duration-300 text-sm font-medium",children:"Click to enlarge"})})]}),e.jsx("div",{className:"bg-muted px-4 py-3 rounded-b-lg",children:e.jsx("p",{className:"text-sm text-foreground",children:null==(c=t[r])?void 0:c.caption})}),t.length>1&&e.jsx("div",{className:"flex gap-2 mt-3 overflow-x-auto pb-2 px-1 scrollbar-thin",children:t.map((i,a)=>e.jsx("button",{onClick:()=>s(a),className:l("flex-shrink-0 relative aspect-[4/3] w-20 md:w-24 overflow-hidden rounded border-2 transition-all duration-200",r===a?"border-primary ring-2 ring-primary/20 scale-105":"border-border hover:border-primary/50 opacity-70 hover:opacity-100"),"aria-label":`View image ${a+1} of ${t.length}`,"aria-current":r===a?"true":"false",children:e.jsx("img",{src:i.thumbnailSrc,alt:`Thumbnail ${a+1}`,className:"w-full h-full object-cover",loading:"lazy"})},a))})]})};return I?e.jsxs("div",{className:`rounded-lg shadow-md ${m}`,children:[e.jsxs("div",{className:"grid grid-cols-2 gap-0 min-h-[500px]",children:[e.jsx("div",{className:"border-r",children:E("Exterior Views",S,g,p,"exterior")}),e.jsx("div",{children:E("Interior Views",T,j,f,"interior")})]}),v&&e.jsx(B,{selectedImage:"exterior"===N?S[g]:T[j],selectedImageIndex:"exterior"===N?g:j,images:"exterior"===N?S:T,onClose:()=>b(!1),onPrevious:A,onNext:D,highQuality:!0})]}):e.jsxs("div",{className:`rounded-lg overflow-hidden shadow-md ${m}`,children:[e.jsxs(r,{defaultValue:"exterior",className:"w-full",onValueChange:e=>{C(e)},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(s,{className:"flex-1 grid grid-cols-2",children:[e.jsxs(i,{value:"exterior",children:["Exterior (",o.length,")"]}),e.jsxs(i,{value:"interior",children:["Interior (",n.length,")"]})]}),u&&h&&e.jsx(U,{title:`${h} - ${"exterior"===w?"Exterior":"Interior"} Views`,description:`Check out this ${h}`,url:x,imageUrl:z(w),variant:"ghost",size:"sm",showText:!1,pageType:"structure",className:"h-9 w-9 p-0 flex-shrink-0"})]}),e.jsx(a,{value:"exterior",className:"mt-0",children:V(S,g,p,"exterior")}),e.jsx(a,{value:"interior",className:"mt-0",children:V(T,j,f,"interior")})]}),v&&e.jsx(B,{selectedImage:"exterior"===N?S[g]:T[j],selectedImageIndex:"exterior"===N?g:j,images:"exterior"===N?S:T,onClose:()=>b(!1),onPrevious:A,onNext:D,highQuality:!0})]})},V=({models:t,categoryName:r,className:s})=>{const i=I();if(!t||0===t.length)return null;const a=t.findIndex(e=>e.current),c=a>=0?a:0,d=c>0?c-1:t.length-1,m=c<t.length-1?c+1:0;return k.useEffect(()=>{"top"===new URLSearchParams(i.search).get("scrollTo")&&(window.scrollTo({top:0,behavior:"smooth"}),window.history.replaceState({},"",i.pathname))},[i]),e.jsxs("div",{className:l("bg-gray-100 py-3 px-4 rounded-md flex items-center justify-between mt-4 md:mt-8",s),children:[e.jsxs(S,{to:`${t[d].path}?scrollTo=top`,className:"flex items-center gap-1 text-gray-700 hover:text-primary transition-colors",children:[e.jsx(o,{className:"h-5 w-5"}),t[d].name]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("span",{className:"text-sm text-gray-500",children:[r," Models"]}),e.jsx("div",{className:"flex items-center justify-center gap-2 mt-1",children:t.map((t,r)=>e.jsx(S,{to:`${t.path}?scrollTo=top`,className:l("w-2.5 h-2.5 rounded-full",t.current?"bg-primary":"bg-gray-300 hover:bg-gray-400"),"aria-label":`Go to ${t.name}`},r))})]}),e.jsxs(S,{to:`${t[m].path}?scrollTo=top`,className:"flex items-center gap-1 text-gray-700 hover:text-primary transition-colors",children:[t[m].name,e.jsx(n,{className:"h-5 w-5"})]})]})},F=({title:t,subtitle:r,models:s,categoryName:i,children:a,className:o})=>e.jsxs(e.Fragment,{children:[e.jsx(C,{title:t,subtitle:r,icon:c,backgroundStyle:"apple-warm",showPhone:!1,className:l("relative",o),children:a&&e.jsx("div",{className:"mt-4",children:a})}),e.jsx(V,{models:s,categoryName:i})]}),q=({garages:t,subtitle:r})=>e.jsx("section",{className:"py-12 bg-gray-50",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx(T,{title:"Similar Structures",subtitle:r||"Explore other structures that might suit your needs",centered:!0}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mt-8",children:t.map((t,r)=>{const s=P(t.imageSrc,{width:800,height:600,quality:95,format:"webp",sharp:20});return e.jsxs(d,{className:"overflow-hidden border border-gray-200 hover:shadow-lg transition-all duration-300 card-hover",children:[e.jsx("div",{className:"relative",children:e.jsx(A,{ratio:4/3,children:e.jsx("img",{src:s,alt:t.title,className:"w-full h-full object-cover transition-transform duration-500 hover:scale-105"})})}),e.jsxs(m,{className:"p-4",children:[e.jsx("h3",{className:"text-xl font-semibold mb-2",children:t.title}),e.jsx("p",{className:"text-gray-600 mb-4 line-clamp-3",children:t.description}),e.jsx("div",{className:"flex justify-end",children:e.jsx($,{to:t.link,variant:"outline",children:"Learn More"})})]})]},r)})})]})}),L=({exteriorImages:t,interiorImages:r,productTitle:s,productUrl:i,showShareButton:a=!0})=>e.jsx(E,{exteriorImages:t,interiorImages:r,exteriorCaptionPrefix:"Exterior View",interiorCaptionPrefix:"Interior View",className:"mb-6",productTitle:s,productUrl:i,showShareButton:a}),Q=({onQuoteClick:t,viewAllLink:r,viewAllButtonText:s})=>e.jsxs("div",{className:"mt-8 flex flex-col items-center",children:[e.jsx(z,{variant:"centered",className:"mb-4"}),e.jsx($,{to:r,variant:"outline",className:"flex items-center gap-2",children:s})]}),H=({description:t,features:r,galleryImages:s,pricingTable:i,afterPricingContent:a,quoteFormContent:l,additionalContent:o,onQuoteClick:n,viewAllLink:c,viewAllButtonText:d,hidePricingInfo:m=!1,hideDetailCTAButtons:g=!1,hideAdditionalInfoHeading:p=!1,productTitle:j,productUrl:f})=>{const v=r&&r.length>0;return e.jsxs("div",{className:"lg:col-span-2",children:[e.jsx(L,{exteriorImages:s.exterior,interiorImages:s.interior,productTitle:j,productUrl:f}),e.jsx("div",{className:"prose max-w-none mt-8",children:t.map((t,r)=>e.jsx("p",{className:"mb-4 text-left",children:t},r))}),v&&e.jsx(h,{title:"Key Features",icon:e.jsx(x,{className:"h-5 w-5"}),className:"mt-8",children:e.jsxs("div",{id:"key-features",children:[e.jsx("h3",{className:"text-2xl font-semibold mb-4 text-left hidden md:block",children:"Key Features"}),e.jsx("ul",{className:"space-y-3 text-left",children:r.map((t,r)=>e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(u,{className:"h-5 w-5 text-green-600 mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium",children:[t.title,":"]})," ",e.jsx("span",{className:"text-muted-foreground",children:t.description})]})]},r))})]})}),i&&e.jsx("div",{id:"pricing",className:"mt-12",children:i}),a&&e.jsx("div",{className:"mt-12",children:a}),l&&e.jsx("div",{className:"mt-12",children:l}),o&&e.jsxs("div",{className:"mt-8 text-left",children:[!p&&e.jsx(T,{title:"Additional Information",centered:!1,className:"mb-8"}),o]}),!m&&e.jsx("div",{className:"mt-8",children:e.jsx(D,{})}),!g&&e.jsx(Q,{onQuoteClick:n,viewAllLink:c,viewAllButtonText:d})]})},M=({className:t,showTooltip:r=!0,variant:s="default",size:i="default",showIcon:a=!0,to:o="/build-your-structure",onClick:n})=>{const c=e.jsxs(e.Fragment,{children:[a&&e.jsx(b,{className:"h-5 w-5 mr-2"}),"Design & Price Your Building"]}),d=n?e.jsx(g,{onClick:n,variant:s,size:i,className:l("flex items-center justify-center",t),children:c}):e.jsx(g,{asChild:!0,variant:s,size:i,className:l("flex items-center justify-center",t),children:e.jsx(S,{to:o,children:c})});return r?e.jsx(p,{children:e.jsxs(j,{children:[e.jsx(f,{asChild:!0,children:d}),e.jsx(v,{side:"top",className:"bg-white border border-gray-100 shadow-lg max-w-xs",children:e.jsx("p",{className:"text-sm",children:"Design your custom structure and get an instant price estimate with our interactive builder"})})]})}):d},G=({specs:t})=>e.jsxs("div",{className:"bg-gray-50 rounded-lg p-6 shadow-md sticky top-24",children:[e.jsx("h3",{className:"text-xl font-semibold mb-4",children:"Specifications"}),e.jsx("div",{className:"space-y-4",children:t.map((t,r)=>e.jsx("div",{children:e.jsx("ul",{className:"mt-1 list-disc pl-5 space-y-1 text-left",children:t.items.map((t,r)=>e.jsxs("li",{className:"text-left",children:[e.jsxs("span",{className:"font-medium",children:[t.label,":"]})," ",t.value]},r))})},r))}),e.jsx("div",{className:"mt-4 text-center text-sm text-gray-600",children:"Design your perfect garage and receive a detailed quote with all options, delivery, and tax included"}),e.jsxs("div",{className:"mt-6 space-y-4",children:[e.jsx(M,{className:"w-full"}),e.jsxs($,{to:"/contact",variant:"outline",className:"w-full flex items-center justify-center gap-2",children:[e.jsx(N,{className:"h-5 w-5"}),"Contact Us"]})]})]}),K=({description:t,features:r,specs:s,galleryImages:i,pricingTable:a,afterPricingContent:l,quoteFormContent:o,additionalContent:n,onQuoteClick:c,categoryName:d,hidePricingInfo:m=!1,hideDetailCTAButtons:h=!1,hideAdditionalInfoHeading:x=!1,productTitle:u,productUrl:g})=>{const p=s&&s.length>0,j=`View All ${d} Styles`,f="Garage"===d?"/what-we-build/garages":"Greenhouse"===d||"Specialty"===d?"/what-we-build/other":"/what-we-build/sheds";return e.jsx("section",{className:"section-padding",children:e.jsx("div",{className:"container mx-auto",children:e.jsxs("div",{className:`grid grid-cols-1 ${p?"lg:grid-cols-3":""} gap-8`,children:[e.jsx(H,{description:t,features:r,galleryImages:i,pricingTable:a,afterPricingContent:l,quoteFormContent:o,additionalContent:n,onQuoteClick:c,viewAllLink:f,viewAllButtonText:j,hidePricingInfo:m,hideDetailCTAButtons:h,hideAdditionalInfoHeading:x,productTitle:u,productUrl:g}),p&&e.jsx("div",{className:"lg:col-span-1",children:e.jsx(G,{specs:s})})]})})})},Y=({title:t,subtitle:r,description:s,features:i,specs:a,galleryImages:l,similarSheds:o,pricingTable:n,afterPricingContent:c,quoteFormContent:d,additionalContent:m,onQuoteClick:h,hideHero:x=!1,categoryName:u="Shed",models:g=[],hidePricingInfo:p=!1,hideDetailCTAButtons:j=!1,hideAdditionalInfoHeading:f=!1,customSimilarStructuresSubtitle:v})=>{const{openOptionSelector:b}=y();return e.jsxs(e.Fragment,{children:[e.jsx(w,{}),e.jsxs("main",{children:[!x&&e.jsx(F,{title:t,subtitle:r,models:g,categoryName:u}),e.jsx(K,{description:s,features:i,specs:a,galleryImages:l,pricingTable:n,afterPricingContent:c,quoteFormContent:d,additionalContent:m,onQuoteClick:()=>{h?h():b()},categoryName:u,hidePricingInfo:p,hideDetailCTAButtons:j,hideAdditionalInfoHeading:f,productTitle:t,productUrl:"undefined"!=typeof window?window.location.href:void 0}),e.jsx(q,{garages:o,subtitle:(()=>{if(v)return v;switch(u.toLowerCase()){case"garage":return"Explore other garage options that might suit your needs";case"shed":return"Explore other shed styles that might work for your property";case"specialty":return"Explore other specialty structures for your property";default:return"Explore other structures that might suit your needs"}})()})]})]})};export{V as M,F as S,Y as a};