1import{_ as me}from"./BJ92hHi3.js";import{_ as de}from"./CRn4sde4.js";import pe from"./DW986G9K.js";import _e from"./CVyZ3t-r.js";import{_ as he}from"./BQzIjS2h.js";import{_ as fe}from"./BOoO1DZu.js";import{_ as we}from"./D1sFDe5c.js";import{_ as ve}from"./JUu6CbY3.js";import{d as ye,u as be,p as Se,q as Ve,s as $e,w as B,t as ke,D as xe,E as Pe,a as Ie,v as x,x as G,r as qe,o as c,c as g,g as V,b as s,i as R,n as T,F as I,j as q,C as ne,y as re,h as Ce,e as U,f as P,A,l as Re,z as Te,m as Ne,G as je,H as Fe,I as We}from"./DFwmjKbr.js";import{_ as Be}from"./C-BLaoDW.js";import Ue from"./DoG4jn5g.js";import{_ as Ae}from"./Ro5LZkzX.js";import{u as Ee}from"./DehzsRpK.js";import{u as Ge}from"./Wj2gHbPQ.js";import"./CZiEN_Se.js";import"./BQqR5LTm.js";import"./D771gWv9.js";import"./BXcBClfF.js";import"./BVFjGr3J.js";const Me={class:"nav:pt-[60px]"},Oe={class:"overflow-x-auto max-w-full -lg:pb-[10px]"},He={role:"tablist",class:"flex gap-3xs lg:flex-wrap"},ze={class:"header-5 font-serif"},Le={id:"results"},Xe=["id"],Je={key:0,class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-x-m gap-y-xl"},Ke={key:1,class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-m"},Qe={"data-reveal":""},Ye={key:2,class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-m"},Ze={key:3,class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-m"},De={key:2,class:"py-l px-5p"},yt=ye({__name:"detail",async setup(et){let m,$;const E=be(),d=Se(),le=Ve(),t=$e({currentView:"wines",page:1,totalPages:1});Ee(d.params.slug);const o=([m,$]=B(()=>A(d.params.slug,()=>$fetch(`/api/winery/${d.params.slug}`),"$IpeXrF4ES4")),m=await m,$(),m),i=Ge(o,"brand"),h=([m,$]=B(()=>A(`trade_assets_data_${Object.values(t).join("_")}`,()=>je({brandSlug:d.params.slug,tradeCategorySlug:"assets",page:t.page,perPage:24}),{watch:[t],immediate:!0})),m=await m,$(),m),f=([m,$]=B(()=>A(`trade_review_data_${Object.values(t).join("_")}`,()=>Fe({brandSlug:d.params.slug,wineSlug:"",page:t.page}),{watch:[t],immediate:!0})),m=await m,$(),m),oe=([m,$]=B(()=>A(`trade_news_data_${Object.values(t).join("_")}`,()=>We({brandSlug:"",limit:1}),{watch:[t],immediate:!0})),m=await m,$(),m);ke(()=>{xe(()=>{var a,n,r,l;E.activeNav="Portfolio",t.page=typeof d.query.page=="string"?parseInt(d.query.page):1,(a=i==null?void 0:i.value)!=null&&a.regions&&(E.activeCountry=((l=(r=(n=i==null?void 0:i.value)==null?void 0:n.regions[0])==null?void 0:r.country)==null?void 0:l.slug)??null),d.query.show&&(t.currentView=typeof d.query.show=="string"?d.query.show:"wines"),setTimeout(()=>{f.refresh(),h.refresh(),oe.refresh()},1e3)})}),Pe(()=>{E.activeCountry=null}),Ie({title:i.value.derivedSeoTitle,description:i.value.derivedSeoDescription,ogTitle:i.value.derivedSocialMediaTitle,ogDescription:i.value.derivedSocialMediaDescription,ogFaeImage:i.value.derivedSocialMediaImage});const v=x(()=>{var a,n,r;return(n=(a=o==null?void 0:o.data)==null?void 0:a.value.newsStories)!=null&&n.length?(r=o==null?void 0:o.data)==null?void 0:r.value.newsStories[0]:null}),ie=x(()=>{let a=i.value.regions;if(a){if(a.length>1){let l="",u=a.map(p=>(p.country&&!l&&(l=p.country.name??""),`${p.name}`)),w=[...new Set(u)];return`${l} / ${w.join(", ")}`}let n=a.map(l=>{var u;return`${l.name}, ${(u=l.country)==null?void 0:u.name}`});return[...new Set(n)].join(", ")}return null}),M=x(()=>{var a,n,r;return t.currentView=="wines"&&(t.totalPages=1),(n=(a=i==null?void 0:i.value)==null?void 0:a.wines)!=null&&n.length?(r=i==null?void 0:i.value)==null?void 0:r.wines:null}),O=x(()=>{var a,n,r,l,u,w,p,y,b,S;return t.currentView=="assets"&&(t.totalPages=((r=(n=(a=h==null?void 0:h.data)==null?void 0:a.value)==null?void 0:n.tradeAssetsPage)==null?void 0:r.totalPages)??1),(p=(w=(u=(l=h==null?void 0:h.data)==null?void 0:l.value)==null?void 0:u.tradeAssetsPage)==null?void 0:w.items)!=null&&p.length?(S=(b=(y=h==null?void 0:h.data)==null?void 0:y.value)==null?void 0:b.tradeAssetsPage)==null?void 0:S.items:null}),H=x(()=>{var a,n,r,l,u;return t.currentView=="fact-sheets"&&(t.totalPages=1),(r=(n=(a=o==null?void 0:o.data)==null?void 0:a.value)==null?void 0:n.factsheetWines)!=null&&r.length?(u=(l=o==null?void 0:o.data)==null?void 0:l.value)==null?void 0:u.factsheetWines:null}),z=x(()=>{var a,n,r,l,u;return t.currentView=="sell-sheets"&&(t.totalPages=1),(r=(n=(a=o==null?void 0:o.data)==null?void 0:a.value)==null?void 0:n.sellsheetWines)!=null&&r.length?(u=(l=o==null?void 0:o.data)==null?void 0:l.value)==null?void 0:u.sellsheetWines:null}),N=x(()=>{var a,n,r,l,u,w,p,y,b,S;return t.currentView=="reviews"&&(t.totalPages=((r=(n=(a=f==null?void 0:f.data)==null?void 0:a.value)==null?void 0:n.reviewsPage)==null?void 0:r.totalPages)??1),(p=(w=(u=(l=f==null?void 0:f.data)==null?void 0:l.value)==null?void 0:u.reviewsPage)==null?void 0:w.items)!=null&&p.length?(S=(b=(y=f==null?void 0:f.data)==null?void 0:y.value)==null?void 0:b.reviewsPage)==null?void 0:S.items:null}),ue=x(()=>{var a,n,r,l,u,w,p,y,b,S,C,j,F,W;if(t.currentView=="wines")return`${(n=(a=i==null?void 0:i.value)==null?void 0:a.wines)==null?void 0:n.length} Results`;if(t.currentView=="assets")return`${(u=(l=(r=h==null?void 0:h.data)==null?void 0:r.value)==null?void 0:l.tradeAssetsPage)==null?void 0:u.totalCount} Results`;if(t.currentView=="reviews")return`${(y=(p=(w=f==null?void 0:f.data)==null?void 0:w.value)==null?void 0:p.reviewsPage)==null?void 0:y.totalCount} Results`;if(t.currentView=="fact-sheets")return`${(C=(S=(b=o==null?void 0:o.data)==null?void 0:b.value)==null?void 0:S.factsheetWines)==null?void 0:C.length} Results`;if(t.currentView=="sell-sheets")return`${(W=(F=(j=o==null?void 0:o.data)==null?void 0:j.value)==null?void 0:F.sellsheetWines)==null?void 0:W.length} Results`});function ce(){let a={};parseInt(t.page.toString())>1&&(a.page=t.page),t.currentView!="wines"&&(a.show=t.currentView),le.push({query:a})}return G(()=>t.currentView,async a=>{t.page=1,ce()}),G(()=>t.page,async a=>{let n=document.getElementById("wines");n&&n.scrollIntoView({behavior:"smooth",block:"start"})}),G(()=>d.query.page,async a=>{typeof d.query.page=="string"&&(t.page=parseInt(d.query.page.toString()))}),(a,n)=>{var L,X,J,K,Q,Y;const r=me,l=de,u=pe,w=_e,p=he,y=fe,b=we,S=ve,C=Re,j=Be,F=Ue,W=Ae,ge=qe("reveal-children");return c(),g("div",Me,[V(r,{headline:`${s(i).name}`,location:s(ie),slides:s(i).heroCarouselItems}
1,null,8,["headline","location","slides"]),V(l,{copy:s(i).introduction,"link-url":`/winery/${s(d).params.slug}/story/`,"link-label":"Winery Story"},null,8,["copy","link-url"]),V(w,{id:"wines",class:"scroll-m-[200px]"},{left:R(()=>[T("div",Oe,[T("div",He,[(c(),g(I,null,q([{name:"Wines",slug:"wines"},{name:"Assets",slug:"assets"},{name:"Fact Sheets",slug:"fact-sheets"},{name:"Sell Sheets",slug:"sell-sheets"},{name:"Reviews",slug:"reviews"}],e=>T("div",{key:e.slug},[V(u,{role:"tab","aria-controls":"results",class:re([e.slug=="wines"&&!s(M)?"disabled":null,e.slug=="assets"&&!s(O)?"disabled":null,e.slug=="fact-sheets"&&!s(H)?"disabled":null,e.slug=="sell-sheets"&&!s(z)?"disabled":null,e.slug=="reviews"&&!s(N)?"disabled":null]),onClick:_=>s(t).currentView=e.slug,active:s(t).currentView==e.slug},{default:R(()=>[Te(ne(e.name),1)]),_:2},1032,["class","onClick","active"])])),64))])])]),results:R(()=>[T("h3",ze,ne(s(ue)),1)]),_:1}),T("div",Le,[(c(),g("div",{key:`key-${Object.values(s(t)).join("_")}`,class:re([{"px-5p":s(t).currentView!="reviews"},"pb-75p"]),id:`${s(t).currentView??"wines"}-feed`},[s(t).currentView!="reviews"?Ce((c(),U(C,{key:0},{default:R(()=>[s(t).currentView=="wines"?(c(),g("ul",Je,[(c(!0),g(I,null,q(s(M),e=>{var _;return c(),g("li",{"data-reveal":"",key:e.id},[V(p,{"aspect-ratio":"[3/4]",subtitle:e.appellation,title:`${e.name}`,to:{name:"wine-detail",params:{wineSlug:e.slug,brandSlug:e.brand.slug}},image:(_=e==null?void 0:e.bottleImageUrl)==null?void 0:_.replace("http://","https://")},null,8,["subtitle","title","to","image"])])}),128))])):P("",!0),s(t).currentView=="assets"?(c(),g("ul",Ke,[(c(!0),g(I,null,q(s(O),e=>{var _;return c(),g("li",Qe,[(c(),U(y,{key:e.id,wines:e.wines,href:e.downloadUrl,brands:e==null?void 0:e.brands,category:e.tradeSubcategories,image:(_=e.thumbnailUrl)==null?void 0:_.replace("h_216,w_216","h_500,w_500")},null,8,["wines","href","brands","category","image"]))])}),256))])):P("",!0),s(t).currentView=="fact-sheets"?(c(),g("ul",Ye,[(c(!0),g(I,null,q(s(H),e=>{var _,k;return c(),g("li",{"data-reveal":"",key:e.id},[V(b,{title:e.name,subtitle:(_=e==null?void 0:e.brand)==null?void 0:_.name,image:(k=e==null?void 0:e.bottleImageUrl)==null?void 0:k.replace("http://","https://"),sheets:e.limitedFactsheetVintages},null,8,["title","subtitle","image","sheets"])])}),128))])):P("",!0),s(t).currentView=="sell-sheets"?(c(),g("ul",Ze,[(c(!0),g(I,null,q(s(z),e=>{var _,k;return c(),g("li",{"data-reveal":"",key:e.id},[V(S,{title:e.name,subtitle:(_=e==null?void 0:e.brand)==null?void 0:_.name,image:(k=e==null?void 0:e.bottleImageUrl)==null?void 0:k.replace("http://","https://"),sheets:e.vintages},null,8,["title","subtitle","image","sheets"])])}),128))])):P("",!0)]),_:1})),[[ge,{delay:250,offset:"1rem",duration:750,threshold:.01}]]):s(t).currentView=="reviews"&&s(N)?(c(!0),g(I,{key:1},q(s(N),(e,_)=>{var k,Z,D,ee,te,se,ae;return c(),U(j,{key:e.id,author:e.author,image:(Z=(k=e.wine)==null?void 0:k.bottleImageUrl)==null?void 0:Z.replace("http://","https://"),last:_==((D=s(N))==null?void 0:D.length)-1,brandName:(ee=e.brand)==null?void 0:ee.name,wineName:(te=e==null?void 0:e.wine)==null?void 0:te.name,vintage:(se=e.vintage)==null?void 0:se.year,reviewer:e.sourceName,rating:e.rating,quote:e.quote,quoteAttr:e.date,source:(ae=e.reviewSource)==null?void 0:ae.name},null,8,["author","image","last","brandName","wineName","vintage","reviewer","rating","quote","quoteAttr","source"])}),128)):P("",!0),parseInt(s(t).totalPages.toString())>1?(c(),g("footer",De,[V(C,{class:"flex gap-m justify-center"},{default:R(()=>[V(F,{"current-page":parseInt(s(t).page.toString()),"total-pages":parseInt(s(t).totalPages.toString()),"max-pages":5},null,8,["current-page","total-pages"])]),_:1})])):P("",!0)],10,Xe))]),s(v)?(c(),U(W,{key:0,"has-detail-page":!s(v).linksToExternalStory,"external-link":s(v).linkUrl,heading:(L=s(v))==null?void 0:L.title,image:("useFaeImageValid"in a?a.useFaeImageValid:s(Ne))((X=s(v))==null?void 0:X.tileImage)?(J=s(v))==null?void 0:J.tileImage:(K=s(v))==null?void 0:K.heroImage,"brand-name":(Q=s(v))!=null&&Q.brand?s(v).brand.name:null,"news-slug":(Y=s(v))==null?void 0:Y.slug},null,8,["has-detail-page","external-link","heading","image","brand-name","news-slug"])):P("",!0)])}}});
1export{yt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.