import{o as F}from"./primevue-DzEvNUDa.js";import{u as N}from"./useUtils-I9N-miEY.js";import{a0 as C,h as i,f as t,j as a,s as I,d as x,v as A,e as n,t as s,F as D,a1 as o,x as d,A as f,B as b,C as M}from"./vendor-BRmrKG53.js";const P={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Y(e,r){return t(),i("svg",P,[...r[0]||(r[0]=[a("path",{fill:"currentColor",d:"M15 13h1.5v2.82l2.44 1.41l-.75 1.3L15 16.69zm4-5H5v11h4.67c-.43-.91-.67-1.93-.67-3a7 7 0 0 1 7-7c1.07 0 2.09.24 3 .67zM5 21a2 2 0 0 1-2-2V5c0-1.11.89-2 2-2h1V1h2v2h8V1h2v2h1a2 2 0 0 1 2 2v6.1c1.24 1.26 2 2.99 2 4.9a7 7 0 0 1-7 7c-1.91 0-3.64-.76-4.9-2zm11-9.85A4.85 4.85 0 0 0 11.15 16c0 2.68 2.17 4.85 4.85 4.85A4.85 4.85 0 0 0 20.85 16c0-2.68-2.17-4.85-4.85-4.85"},null,-1)])])}const V=C({name:"mdi-calendar-clock",render:Y}),T={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function U(e,r){return t(),i("svg",T,[...r[0]||(r[0]=[a("path",{fill:"currentColor",d:"M12 16a3 3 0 0 1-3-3c0-1.12.61-2.1 1.5-2.61l9.71-5.62l-5.53 9.58c-.5.98-1.51 1.65-2.68 1.65m0-13c1.81 0 3.5.5 4.97 1.32l-2.1 1.21C14 5.19 13 5 12 5a8 8 0 0 0-8 8c0 2.21.89 4.21 2.34 5.65h.01c.39.39.39 1.02 0 1.41s-1.03.39-1.42.01A9.97 9.97 0 0 1 2 13A10 10 0 0 1 12 3m10 10c0 2.76-1.12 5.26-2.93 7.07c-.39.38-1.02.38-1.41-.01a.996.996 0 0 1 0-1.41A7.95 7.95 0 0 0 20 13c0-1-.19-2-.54-2.9L20.67 8C21.5 9.5 22 11.18 22 13"},null,-1)])])}const E=C({name:"mdi-speedometer",render:U}),O={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function H(e,r){return t(),i("svg",O,[...r[0]||(r[0]=[a("path",{fill:"currentColor",d:"M12 11.5A2.5 2.5 0 0 1 9.5 9A2.5 2.5 0 0 1 12 6.5A2.5 2.5 0 0 1 14.5 9a2.5 2.5 0 0 1-2.5 2.5M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7"},null,-1)])])}const R=C({name:"mdi-map-marker",render:H}),q={class:"bg-white rounded-2xl overflow-hidden shadow-sm hover:shadow-lg transition-all h-full flex flex-col"},G={class:"relative"},J={key:0,class:"absolute top-3 left-3 bg-red-600 text-white px-2 py-1 text-xs font-bold rounded z-10"},K={class:"aspect-[4/3] relative overflow-hidden bg-gray-100"},Q=["src","alt","loading","fetchpriority"],W=["src","alt","loading","fetchpriority"],X=["alt"],Z={key:2,class:"absolute bottom-3 right-3 w-10 h-10 rounded-full overflow-hidden border-2 border-white shadow-md"},p=["src","alt"],_={class:"p-4 pb-5 grow flex flex-col"},ee={class:"flex items-start justify-between gap-2 mb-2"},te={class:"font-bold text-gray-900 line-clamp-2 group-hover:text-primary transition-colors"},ie={class:"shrink-0 text-xs text-gray-500 bg-gray-100 px-2 py-0.5 rounded font-mono"},ae={class:"flex items-center flex-wrap gap-2 text-xs text-gray-500 mb-2"},oe={key:0,class:"inline-flex items-center gap-1 bg-gray-100 px-2 py-0.5 rounded"},se={key:1,class:"bg-gray-100 px-2 py-0.5 rounded"},ne={key:2,class:"inline-flex items-center gap-1 bg-gray-100 px-2 py-0.5 rounded"},le={key:1,class:"mb-2"},re={class:"mt-auto"},de={key:0,class:"pt-3 border-t border-gray-100"},me={class:"text-xs text-gray-500 uppercase mb-1"},ce={key:1,class:"pt-3 border-t border-gray-100"},he={class:"font-medium"},ge={class:"ml-1"},ue={key:3,class:"mt-3"},Ge={__name:"Box",props:{item:{type:[Object,Number],default:()=>({id:0})},isLoading:Boolean,hideCurrentBid:{type:Boolean,default:!1},eager:{type:Boolean,default:!1}},setup(e){const r=e,{mediaPathResized:y,errorImage:c,getAgentImageUrl:w,categoriesProps:h,getFormattedDateTime:v,formatNumber:k,generateItemSlug:$}=N(),B=M(()=>$(r.item.id,r.item.title));return(l,g)=>{const m=F,L=R,S=E,j=V,z=I("router-link");return t(),x(z,{to:e.isLoading?"#":{name:"Item",params:{item:B.value}},class:"block text-inherit hover:no-underline group","aria-label":e.item.title?`Se auksjon ${e.item.id}: ${e.item.title}`:void 0},{default:A(()=>[a("article",q,[a("div",G,[e.item.readyForSaleDate>0?(t(),i("div",J,s(l.$t("home.widget.box.readyForSale")),1)):n("",!0),a("div",K,[e.isLoading?(t(),x(m,{key:1,width:"100%",height:"100%",class:"absolute inset-0"})):(t(),i(D,{key:0},[e.item.thumbnail?.url?(t(),i("img",{key:0,onError:g[0]||(g[0]=(...u)=>o(c)&&o(c)(...u)),src:o(y)(e.item.thumbnail.url,"listBox"),alt:e.item.title||l.$t("home.widget.box.noName"),class:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",width:"400",height:"300",loading:e.eager?"eager":"lazy",fetchpriority:e.eager?"high":"auto"},null,40,Q)):e.item.images?.[0]?(t(),i("img",{key:1,onError:g[1]||(g[1]=(...u)=>o(c)&&o(c)(...u)),src:o(y)(e.item.images[0].url,"listBox"),alt:e.item.title||l.$t("home.widget.box.noName"),class:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",width:"400",height:"300",loading:e.eager?"eager":"lazy",fetchpriority:e.eager?"high":"auto"},null,40,W)):(t(),i("img",{key:2,src:"https://media.stadssalg.no/404.png",alt:l.$t("home.widget.box.noImage"),class:"w-full h-full object-cover",width:"400",height:"300",loading:"lazy"},null,8,X))],64)),e.item.exclusive&&e.item.agent?(t(),i("div",Z,[a("img",{src:o(w)(e.item.agent),alt:e.item.agent,class:"w-full h-full object-cover",width:"40",height:"40",loading:"lazy"},null,8,p)])):n("",!0)])]),a("div",_,[e.isLoading?(t(),i("div",le,[d(m,{width:"90%",height:"1.25rem",class:"mb-2"}),d(m,{width:"40%",height:"1rem"})])):(t(),i(D,{key:0},[a("div",ee,[a("h3",te,s(e.item.title||l.$t("home.widget.box.noName")),1),a("span",ie,s(e.item.id),1)]),a("div",ae,[e.item.location?(t(),i("span",oe,[d(L,{class:"text-gray-500 text-sm","aria-hidden":"true"}),f(" "+s(e.item.location),1)])):n("",!0),o(h)(e.item,1)?(t(),i("span",se,s(o(h)(e.item,1)),1)):n("",!0),o(h)(e.item,2)?(t(),i("span",ne,[e.item.mileage?(t(),x(S,{key:0,class:"text-gray-500 text-sm","aria-hidden":"true"})):n("",!0),f(" "+s(o(h)(e.item,2)),1)])):n("",!0)])],64)),a("div",re,[!e.isLoading&&!e.hideCurrentBid?(t(),i("div",de,[a("div",me,s(l.$t("home.widget.box.highestBid")),1),a("div",{class:b(["text-lg font-bold",e.item.currentBid>0?"text-primary":"text-gray-300"])},s(e.item.currentBid>0?o(k)(e.item.currentBid)+" kr":"—"),3)])):e.isLoading?(t(),i("div",ce,[d(m,{width:"100%",height:"2.5rem"})])):n("",!0),e.isLoading?e.isLoading?(t(),i("div",ue,[d(m,{width:"100%",height:"2rem",borderRadius:"8px"})])):n("",!0):(t(),i("div",{key:2,class:b(["mt-3 p-2 rounded-lg text-xs flex items-center gap-2",e.item.readyForSaleDate>0?"bg-red-50 text-red-700":"bg-gray-50 text-gray-500"])},[d(j,{class:"text-sm shrink-0","aria-hidden":"true"}),a("div",null,[a("span",he,s(l.$t("home.widget.box.auctionDay"))+":",1),a("span",ge,s(e.item.readyForSaleDate>0?o(v)(e.item.readyForSaleDate,"LL"):"Ikke fastsatt"),1)])],2))])])])]),_:1},8,["to","aria-label"])}}},xe={class:"bg-white rounded-2xl overflow-hidden shadow-sm hover:shadow-lg transition-all flex h-[145px] sm:h-[165px]"},ye={class:"relative shrink-0 w-32 sm:w-44 lg:w-48 h-full overflow-hidden bg-gray-100"},fe={key:0,class:"absolute top-3 left-3 bg-red-600 text-white px-2 py-1 text-xs font-bold rounded z-10"},be=["src","alt","loading","fetchpriority"],we=["src","alt","loading","fetchpriority"],ve=["alt"],ke={key:3,class:"absolute bottom-3 right-3 w-10 h-10 rounded-full overflow-hidden border-2 border-white shadow-md"},$e=["src","alt"],Be={class:"grow min-w-0 p-3 sm:p-4 flex flex-col justify-between overflow-hidden"},Le={key:0},Se={class:"flex items-start justify-between gap-2 mb-1"},je={class:"font-bold text-gray-900 text-xs sm:text-base truncate group-hover:text-primary transition-colors leading-tight"},ze={class:"hidden md:block shrink-0 text-[10px] text-gray-500 bg-gray-100 px-1.5 py-0.5 rounded font-mono"},De={class:"flex items-center flex-wrap gap-1 sm:gap-2 text-[10px] sm:text-xs text-gray-500 mb-2"},Ce={key:0,class:"inline-flex items-center gap-1 bg-gray-100 px-1.5 py-0.5 rounded whitespace-nowrap"},Fe={key:1,class:"bg-gray-100 px-1.5 py-0.5 rounded whitespace-nowrap"},Ne={key:2,class:"inline-flex items-center gap-1 bg-gray-100 px-1.5 py-0.5 rounded whitespace-nowrap"},Ie={key:1},Ae={class:"space-y-2"},Me={key:0,class:"pt-2 border-t border-gray-100"},Ve={class:"flex flex-col items-start"},Ee={class:"text-[9px] sm:text-[10px] text-gray-500 uppercase font-bold tracking-wider"},Re={key:1,class:"pt-2 border-t border-gray-100"},Pe={class:"truncate"},Ye={class:"font-bold"},Te={class:"font-semibold ml-1"},Ue={key:3},Je={__name:"List",props:{item:{type:[Object,Number],default:()=>({id:0})},isLoading:Boolean,hideCurrentBid:{type:Boolean,default:!1},eager:{type:Boolean,default:!1}},setup(e){const r=e,{mediaPathResized:y,errorImage:c,getAgentImageUrl:w,categoriesProps:h,getFormattedDateTime:v,formatNumber:k,generateItemSlug:$}=N(),B=M(()=>$(r.item.id,r.item.title));return(l,g)=>{const m=F,L=R,S=E,j=V,z=I("router-link");return t(),x(z,{to:e.isLoading?"#":{name:"Item",params:{item:B.value}},class:"block text-inherit hover:no-underline group","aria-label":e.item.title?`Se auksjon ${e.item.id}: ${e.item.title}`:void 0},{default:A(()=>[a("article",xe,[a("div",ye,[e.item.readyForSaleDate>0?(t(),i("div",fe,s(l.$t("home.widget.box.readyForSale")),1)):n("",!0),e.isLoading?(t(),x(m,{key:2,width:"100%",height:"100%",class:"absolute inset-0"})):(t(),i(D,{key:1},[e.item.thumbnail?.url?(t(),i("img",{key:0,onError:g[0]||(g[0]=(...u)=>o(c)&&o(c)(...u)),src:o(y)(e.item.thumbnail.url,"listBox"),alt:e.item.title||l.$t("home.widget.box.noName"),class:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",width:"400",height:"300",loading:e.eager?"eager":"lazy",fetchpriority:e.eager?"high":"auto"},null,40,be)):e.item.images?.[0]?(t(),i("img",{key:1,onError:g[1]||(g[1]=(...u)=>o(c)&&o(c)(...u)),src:o(y)(e.item.images[0].url,"listBox"),alt:e.item.title||l.$t("home.widget.box.noName"),class:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",width:"400",height:"300",loading:e.eager?"eager":"lazy",fetchpriority:e.eager?"high":"auto"},null,40,we)):(t(),i("img",{key:2,src:"https://media.stadssalg.no/404.png",alt:l.$t("home.widget.box.noImage"),class:"w-full h-full object-cover",width:"400",height:"300",loading:"lazy"},null,8,ve))],64)),e.item.exclusive&&e.item.agent?(t(),i("div",ke,[a("img",{src:o(w)(e.item.agent),alt:e.item.agent,class:"w-full h-full object-cover",width:"40",height:"40",loading:"lazy"},null,8,$e)])):n("",!0)]),a("div",Be,[e.isLoading?(t(),i("div",Ie,[d(m,{width:"80%",height:"1.25rem",class:"mb-2"}),d(m,{width:"30%",height:"0.75rem"})])):(t(),i("div",Le,[a("div",Se,[a("h3",je,s(e.item.title||l.$t("home.widget.box.noName")),1),a("span",ze,s(e.item.id),1)]),a("div",De,[e.item.location?(t(),i("span",Ce,[d(L,{class:"text-gray-500 text-sm","aria-hidden":"true"}),f(" "+s(e.item.location),1)])):n("",!0),o(h)(e.item,1)?(t(),i("span",Fe,s(o(h)(e.item,1)),1)):n("",!0),o(h)(e.item,2)?(t(),i("span",Ne,[e.item.mileage?(t(),x(S,{key:0,class:"text-gray-500 text-sm","aria-hidden":"true"})):n("",!0),f(" "+s(o(h)(e.item,2)),1)])):n("",!0)])])),a("div",Ae,[!e.isLoading&&!e.hideCurrentBid?(t(),i("div",Me,[a("div",Ve,[a("span",Ee,s(l.$t("home.widget.box.highestBid")),1),a("span",{class:b(["text-base sm:text-xl font-black leading-tight",e.item.currentBid>0?"text-primary":"text-gray-300"])},s(e.item.currentBid>0?o(k)(e.item.currentBid)+" kr":"—"),3)])])):e.isLoading?(t(),i("div",Re,[d(m,{width:"100%",height:"2rem"})])):n("",!0),e.isLoading?e.isLoading?(t(),i("div",Ue,[d(m,{width:"100%",height:"1.5rem",borderRadius:"8px"})])):n("",!0):(t(),i("div",{key:2,class:b(["p-1.5 sm:p-2 rounded-lg sm:rounded-xl text-[9px] sm:text-[10px] flex items-center gap-1.5 sm:gap-2",e.item.readyForSaleDate>0?"bg-red-50 text-red-700":"bg-gray-50 text-gray-500"])},[d(j,{class:"text-xs sm:text-sm shrink-0","aria-hidden":"true"}),a("div",Pe,[a("span",Ye,s(l.$t("home.widget.box.auctionDay"))+":",1),a("span",Te,s(e.item.readyForSaleDate>0?o(v)(e.item.readyForSaleDate,"DD.MM.YYYY"):"Ikke fastsatt"),1)])],2))])])])]),_:1},8,["to","aria-label"])}}};export{Ge as _,Je as a};