1import{d as P,n as T,o as i,c as l,b as p,e as a,F as A,t as u,B as h,k as f,X as N,f as S,l as o,m as z,_ as F}from"./CIlsd43Y.js";import{f as I,r as M,_ as V}from"./BtQzc0FJ.js";import D from"./uV0Fadd9.js";import{P as R}from"./C13fJ2oO.js";import{g as j,i as G,h as O}from"./BQ6wUm6E.js";import{s as Q,a as q}from"./BDSvxepI.js";const E={class:"flex items-start justify-between gap-3"},H={class:"min-w-0"},U={"data-test":"brand-mini",class:"text-muted mt-1 text-xs"},X={key:1,class:"line-clamp-2 font-semibold break-words text-foreground"},Z={class:"mt-1.5 flex flex-wrap items-center gap-1.5"},J={key:1,class:"inline-flex items-center gap-1 rounded bg-primary px-2 py-0.5 text-xs font-semibold text-primary-foreground"},K=["href","aria-label"],W={class:"shrink-0 text-right"},Y={class:"mt-2 space-y-0.5"},tt={key:0,class:"text-xs leading-tight"},et={class:"text-muted"},st={key:1,class:"text-muted text-xs"},nt=P({__name:"StationCard",props:{station:{},fuel:{},cheapest:{type:Boolean}},emits:["hover"],setup(n){const t=n,v=o(()=>t.station[t.fuel]??null),r=o(()=>Q(t.station)),m=o(()=>q(t.station)),c=o(()=>!!I(t.station.brand)),b=o(()=>t.station.dist!=null?`${t.station.dist.toFixed(1).replace(".",",")} km`:null),y=o(()=>Array.isArray(t.station.openingTimes)&&t.station.openingTimes.length===0),x=o(()=>{const s=t.station;if(s.isOpen===!1)return{text:"Geschlossen",muted:!0};if(y.value)return{text:"24 h",muted:!1};const e=j(s.closesAt);return e?{text:`bis ${e}`,muted:!1}:null}),_=z(!1);T(()=>{_.value=/iPhone|iPad|iPod|Macintosh/.test(navigator.userAgent)});const k=o(()=>M(t.station.lat,t.station.lng,_.value)),$=Date.now(),d=o(()=>{const s=t.station.lastChange?.[t.fuel];return s?{delta:O(s.amount),time:G(s.at,$)}:null});return(s,e)=>{const w=F,L=V,B=D,C=R;return i(),l("div",{"data-test":"station-card",class:"relative rounded-lg border border-border bg-surface p-4 hover:bg-surface-muted",onMouseenter:e[0]||(e[0]=g=>s.$emit("hover",n.station.id)),onMouseleave:e[1]||(e[1]=g=>s.$emit("hover",null)),onFocusin:e[2]||(e[2]=g=>s.$emit("hover",n.station.id)),onFocusout:e[3]||(e[3]=g=>s.$emit("hover",null))},[p(w,{to:{path:`/tankstelle/${n.station.id}`,query:{kraftstoff:n.fuel}},class:"absolute inset-0 rounded-lg","aria-label":`Spritpreise und Details: ${r.value}`},null,8,["to","aria-label"]),a("div",E,[a("div",H,[c.value?(i(),l(A,{key:0},[p(L,{brand:n.station.brand},null,8,["brand"]),a("p",U,u(r.value),1)],64)):(i(),l("p",X,u(r.value),1)),a("p",{"data-test":"card-adresse",class:h(["text-sm text-foreground",c.value?"mt-2.5":"mt-0.5"])},u(m.value),3),a("div",Z,[x.value?(i(),l("span",{key:0,class:h(["rounded-full bg-surface-muted px-2 py-0.5 text-xs font-semibold",x.value.muted?"text-muted":"text-foreground"])},u(x.value.text),3)):f("",!0),n.cheapest?(i(),l("span",J,[...e[4]||(e[4]=[N('<svg viewBox="0 0 28 22" class="h-3 w-auto" aria-hidden="true" fill="currentColor"><path d="M3 16 L4 8 L9 13 L14 4 L19 13 L24 8 L25 16 L25 19 Q25 20.8 23.2 20.8 L4.8 20.8 Q3 20.8 3 19 Z"></path><circle cx="4" cy="7" r="2"></circle><circle cx="14" cy="2.8" r="2.4"></circle><circle cx="24" cy="7" r="2"></circle></svg> Günstigste ',2)])])):f("",!0),a("a",{"data-test":"card-route",href:k.value,target:"_blank",rel:"noopener noreferrer",class:"relative z-10 inline-flex min-h-11 items-center gap-1 rounded-md border border-border px-3 py-1 text-xs font-semibold text-foreground hover:bg-surface-muted","aria-label":`Route zu ${r.value} anzeigen`},[p(B,{name:"lucide:navigation",size:"14","aria-hidden":"true"}),e[5]||(e[5]=S(" Route ",-1))],8,K)])]),a("div",W,[p(C,{price:v.value},null,8,["price"]),a("div",Y,[d.value?(i(),l("p",tt,[d.value.delta?(i(),l("span",{key:0,class:h(["font-semibold whitespace-nowrap",d.value.delta.dir==="down"?"text-trend-down-ink":"text-trend-up-ink"])},u((d.value.delta.dir==="down"?"⼠":"Ⲡ")+d.value.delta.text),3)):f("",!0),a("span",et,u((d.value.delta?" · ":"")+d.value.time),1)])):f("",!0),b.value?(i(),l("p",st,u(b.value),1)):f("",!0)])])])],32)}}}),ut=Object.assign(nt,{__name:"StationCard"});function ct(n,t,v){const r=[...n];return v==="entfernung"?r.sort((m,c)=>(m.dist??1/0)-(c.dist??1/0)):r.sort((m,c)=>(m[t]??1/0)-(c[t]??1/0)),r}export{ut as _,ct as s};
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.