import{r as g,o as f,a as e,f as i,b as a,n as c,u as d,l as n,t as s,g as y,h as k,i as m}from"#entry";import{f as u}from"./DFUzfs-C.js";const v={key:0},x=["href","title"],w={key:0,class:"banner position-absolute p-2 bg-light text-dark text-center font-weight-bold rounded-right"},S={key:1,class:"overlay p-3 position-absolute w-100 h-100 text-light d-flex flex-column justify-content-start align-items-center"},j={key:0,class:"title text-center"},I={key:1,class:"subtitle text-center"},C={key:1},N={key:0,class:"banner position-absolute p-2 bg-light text-dark text-center font-weight-bold rounded-right"},$={key:1,class:"overlay p-3 position-absolute w-100 h-100 text-light d-flex flex-column justify-content-start align-items-center"},B={key:0,class:"title text-center"},V={key:1,class:"subtitle text-center"},z={key:2},D={key:0,class:"banner position-absolute p-2 bg-light text-dark text-center font-weight-bold rounded-right"},E={key:1,class:"overlay p-3 position-absolute w-100 h-100 text-light d-flex flex-column justify-content-start align-items-center"},L={key:0,class:"title text-center"},M={key:1,class:"subtitle text-center"},A={__name:"Cover",props:{release:Object,href:String,imgSrc:String,ohref:String,title:String,subtitle:String,banner:String},setup(t){let l=g(u);const h=t;return f(async()=>{const o=h.release;if(o.cover&&o.cover.url)l.value=o.cover.url;else if(o.spotify_id){const r=await(await fetch(`/api/spotifyCover?spotify_id=${o.spotify_id}`)).json();l.value=r.thumbnail_url||u}else console.error("spotify_id is missing"),l.value=u}),(o,b)=>{const r=m;return t.ohref?(i(),e("div",v,[a("a",{href:t.ohref||"#",target:"_blank",title:"link to "+t.title||"link to the product"},[a("div",{class:"cover border border-light shadow rounded",style:c({backgroundImage:`url(${d(l)})`})},[t.banner?(i(),e("div",w,s(t.banner),1)):n("",!0),t.title||t.subtitle?(i(),e("div",S,[t.title?(i(),e("span",j,s(t.title),1)):n("",!0),t.subtitle?(i(),e("span",I,s(t.subtitle),1)):n("",!0)])):n("",!0)],4)],8,x)])):t.href?(i(),e("div",C,[y(r,{to:t.href||"#",title:"link to "+t.title||"link to the product"},{default:k(()=>[a("div",{class:"cover border border-light shadow rounded",style:c({backgroundImage:`url(${d(l)})`})},[t.banner?(i(),e("div",N,s(t.banner),1)):n("",!0),t.title||t.subtitle?(i(),e("div",,ドル[t.title?(i(),e("span",B,s(t.title),1)):n("",!0),t.subtitle?(i(),e("span",V,s(t.subtitle),1)):n("",!0)])):n("",!0)],4)]),_:1},8,["to","title"])])):(i(),e("div",z,[a("div",{class:"cover border border-light shadow rounded",style:c({backgroundImage:`url(${d(l)})`})},[t.banner?(i(),e("div",D,s(t.banner),1)):n("",!0),t.title||t.subtitle?(i(),e("div",E,[t.title?(i(),e("span",L,s(t.title),1)):n("",!0),t.subtitle?(i(),e("span",M,s(t.subtitle),1)):n("",!0)])):n("",!0)],4)]))}}};export{A as _};