1import{_ as ne}from"./DmIzeC5B.js";import{P as le}from"./C13fJ2oO.js";import{V as oe,d as re,W as ie,Z as de,a1 as ue,a3 as me,n as ce,aH as pe,c as r,e as t,t as l,i as c,b as f,f as p,F as g,k as N,w as B,r as D,B as $,h as fe,j as ge,g as xe,l as b,m as y,G as be,ak as j,_ as he,o as i,aM as ve}from"./CIlsd43Y.js";import{_ as _e}from"./Bh0lds26.js";import{_ as ke}from"./CmBCdLri.js";import{a as Se,F as L,m as W,D as C}from"./CxrwSfTW.js";import{N as ye}from"./rIHos1g9.js";import{b as we}from"./DzSnfrIT.js";import{f as Pe,a as q}from"./BQ6wUm6E.js";import{u as Te}from"./DcN7jlV2.js";import{u as ze,d as Be,a as De}from"./bpSNn1QH.js";import{_ as Le}from"./DlAUqK2U.js";import"./uV0Fadd9.js";import"./Bd1BaL7e.js";import"./BDSvxepI.js";function Ce(w){const m=new Map;for(const n of w.staedte){const d=m.get(n.bundesland)??[];d.push(n),m.set(n.bundesland,d)}return[...m.entries()].map(([n,d])=>({code:n,name:ye[n]??n,staedte:d})).sort((n,d)=>n.name.localeCompare(d.name,"de"))}function H(w,m){let n=null;for(const d of w.staedte){const u=d.ab[m];if(u==null)continue;const h=n?.ab[m];(h==null||u<h||u===h&&d.name.localeCompare(n.name,"de")<0)&&(n=d)}return n}function Ge(){return oe("staedte-index",()=>$fetch("/api/snapshots/staedte-index"))}const Ee={class:"mx-auto max-w-5xl px-6 py-12"},Ne={class:"flex flex-wrap items-start justify-between gap-x-6 gap-y-4"},$e={class:"max-w-2xl"},Fe={class:"text-lead text-foreground mt-3"},Me={class:"mt-2 flex flex-wrap items-center gap-x-3 gap-y-1.5 text-sm"},Ve={key:0,"data-test":"guenstigste-stadt",class:"text-right"},Ae={class:"text-muted mb-1.5 text-xs tabular-nums"},Ue={class:"mt-2 text-sm"},Oe={class:"mt-8","data-test":"fuel-toggle"},Ie={class:"sr-only",role:"status"},Ke={class:"mt-3 grid gap-3 sm:grid-cols-2 lg:grid-cols-4"},Ze={class:"block font-semibold text-foreground"},je={class:"text-muted mt-0.5 block text-xs"},We={class:"tabular-nums"},qe={"data-preis":"",class:"mt-auto block pt-2 text-sm text-foreground"},He={key:0,class:"font-semibold tabular-nums"},Je={class:"mt-3"},Re={"aria-label":"Direkt zu einem Bundesland",class:"mt-2.5 flex flex-wrap gap-x-3 gap-y-1 text-sm"},Ye=["href"],Qe={key:0,"data-test":"filter-leer",class:"text-muted mt-4 text-sm"},Xe={class:"mt-4 gap-6 md:columns-2"},et=["id","aria-labelledby"],tt=["id"],st={class:"border-border divide-border bg-surface mt-2 divide-y rounded-md border"},at={class:"min-w-0"},nt={class:"font-medium text-foreground"},lt={class:"text-muted ml-2 text-xs tabular-nums"},ot={"data-preis":"",class:"shrink-0 text-foreground tabular-nums"},rt={"aria-labelledby":"ort-suche",class:"border-border bg-surface-muted mt-10 rounded-xl border p-4 sm:p-6"},it={class:"min-w-0 grow"},dt={class:"mt-6 text-sm"},ut=re({__name:"index",async setup(w){let m,n;const{data:d}=([m,n]=ie(()=>Ge()),m=await m,n(),m);if(!d.value)throw de({statusCode:404,statusMessage:"Kein Städte-Index (npm run snapshots)"});const u=d.value,h=b(()=>Pe(u.stand)),J=u.staedte.slice(0,8),F=Ce(u),M=new Intl.NumberFormat("de-DE"),o=y(C),R=Se.map(a=>({value:a,label:L[a]}));function Y(a){o.value=a}Te(o);const _=b(()=>H(u,o.value)),V=b(()=>_.value?_.value.ab[o.value]:null),P=H(u,C),A=P?we(P.ab[C]):null,U=`Spritpreise nach Stadt: ${u.staedte.length} GroÃstädte im Vergleich`,O=`Aktuelle Benzin- und Dieselpreise in ${u.staedte.length} deutschen GroÃstädten: je Stadt günstigste Tankstellen, Median und Live-Suche.`+(P&&A?` Günstigster Diesel: ${P.name}, ab ${A}.`:""),I=`${ue().url}/og/spritpreise.png`;me({title:U,description:O,ogTitle:U,ogDescription:O,ogImage:I,twitterImage:I}),ze([Be({"@type":"CollectionPage"}),De({itemListElement:[{name:"Start",item:"/"},{name:"Spritpreise"}]})]);const K=y(""),G=y(0),Z=b(()=>G.value===0?"":G.value%2?"preis-pulse-a":"preis-pulse-b");ce(()=>{pe(o,a=>{K.value=`Preise umgestellt auf ${L[a]}`,G.value++})});const E=a=>W(be(a),o.value),Q=b(()=>W("/regionen",o.value)),x=y(""),k=b(()=>{const a=j(x.value.trim());return a?F.map(e=>({...e,staedte:e.staedte.filter(S=>j(S.name).includes(a))})).filter(e=>e.staedte.length>0):F}),X=b(()=>{if(!x.value.trim())return"";const a=k.value.reduce((e,S)=>e+S.staedte.length,0);return a===1?"1 GroÃstadt gefunden":`${a} GroÃstädte gefunden`}),T=y("");function ee(){const a=/\b\d{5}\b/.exec(T.value)?.[0]??T.value.trim();if(!a){document.getElementById("idx-plz")?.focus();return}const e={plz:a};o.value!==C&&(e.kraftstoff=o.value),ve({path:"/suche",query:e})}return(a,e)=>{const S=ne,te=le,z=he,se=_e,ae=ke;return i(),r("div",Ee,[t("header",Ne,[t("div",$e,[e[2]||(e[2]=t("h1",{class:"text-h1"},"Spritpreise nach Stadt",-1)),t("p",Fe," Aktuelle Benzin- und Dieselpreise in "+l(c(u).staedte.length)+" deutschen GroÃstädten: jede Stadt mit Tagesüberblick, den günstigsten Tankstellen und Live-Suche. ",1),t("p",Me,[f(S,{stand:c(u).stand},null,8,["stand"])]),e[3]||(e[3]=t("p",{class:"text-muted mt-1.5 text-sm"},"ab-Preis = günstigster Stationspreis zum Tagesstand",-1)),e[4]||(e[4]=t("p",{class:"mt-2 text-sm"},[t("a",{href:"#ort-suche","data-test":"ort-suche-sprung",class:"text-link underline underline-offset-2"}," Dein Ort ist keine GroÃstadt? Direkt zur PLZ-/Ortssuche ")],-1))]),_.value&&V.value!=null?(i(),r("div",Ve,[t("p",Ae,[p("Günstigste Station · "+l(c(L)[o.value]),1),h.value?(i(),r(g,{key:0},[p(" · Stand "+l(h.value),1)],64)):N("",!0)]),f(te,{price:V.value,size:"md"},null,8,["price"]),t("p",Ue,[f(z,{to:E(_.value.slug),class:"text-link font-medium underline underline-offset-2"},{default:B(()=>[p(" in "+l(_.value.name),1)]),_:1}
1,8,["to"])])])):N("",!0)]),t("div",Oe,[e[5]||(e[5]=t("span",{class:"text-muted mb-1 block text-sm"},"Kraftstoff",-1)),f(se,{"model-value":o.value,options:c(R),"aria-label":"Kraftstoff",variant:"toggle","onUpdate:modelValue":Y},null,8,["model-value","options"]),e[6]||(e[6]=t("p",{class:"text-muted mt-1.5 text-xs","data-test":"fuel-toggle-hint"}," Wechselt die Sorte für alle Preise auf dieser Seite (Tagesstand: siehe oben). Live-Preise zeigen die Stadtseiten und die Tankstellensuche. ",-1)),t("p",Ie,l(K.value),1),e[7]||(e[7]=t("noscript",null,"Ohne JavaScript zeigt diese Seite fest die Diesel-Ansicht.",-1))]),t("section",{"aria-labelledby":"top-staedte",class:$(["mt-8",Z.value])},[e[11]||(e[11]=t("h2",{id:"top-staedte",class:"text-h2"},"Die gröÃten Städte",-1)),t("ul",Ke,[(i(!0),r(g,null,D(c(J),s=>(i(),r("li",{key:s.slug},[f(z,{to:E(s.slug),"data-test":"top-stadt",class:"border-border bg-surface hover:bg-surface-muted flex h-full flex-col rounded-md border p-4 transition-colors"},{default:B(()=>[t("span",Ze,l(s.name),1),t("span",je,[p(l(s.bundeslandName)+" · ",1),t("span",We,l(c(M).format(s.einwohner)),1),e[8]||(e[8]=p(" Einwohner ",-1))]),t("span",qe,[p(l(c(L)[o.value])+" ab ",1),s.ab[o.value]!=null?(i(),r("span",He,l(c(q)(s.ab[o.value]))+" â¬",1)):(i(),r(g,{key:1},[e[9]||(e[9]=t("span",{"aria-hidden":"true"},"â",-1)),e[10]||(e[10]=t("span",{class:"sr-only"},"kein Preis im Tagesstand",-1))],64))])]),_:2},1032,["to"])]))),128))])],2),t("section",{"aria-labelledby":"alle-staedte",class:$(["mt-10",Z.value])},[e[16]||(e[16]=t("h2",{id:"alle-staedte",class:"text-h2"},"Alle GroÃstädte nach Bundesland",-1)),t("div",Je,[e[12]||(e[12]=t("label",{for:"stadt-filter",class:"sr-only"},"GroÃstadt suchen",-1)),fe(t("input",{id:"stadt-filter","onUpdate:modelValue":e[0]||(e[0]=s=>x.value=s),type:"search","data-test":"stadt-filter",placeholder:"GroÃstadt filtern, z. B. Kiel",autocomplete:"off",class:"border-border bg-surface text-foreground placeholder:text-muted min-h-11 w-full max-w-xs rounded-md border px-3 py-2 text-sm"},null,512),[[ge,x.value]]),t("p",{"data-test":"filter-status",role:"status",class:$(x.value.trim()&&k.value.length?"text-muted mt-2 text-xs":"sr-only")},l(X.value),3)]),t("nav",Re,[(i(!0),r(g,null,D(k.value,s=>(i(),r("a",{key:s.code,href:`#land-${s.code}`,"data-test":"land-sprung",class:"text-link underline underline-offset-2"},l(s.name),9,Ye))),128))]),x.value.trim()&&k.value.length===0?(i(),r("p",Qe,[p(" Keine GroÃstadt mit â"+l(x.value.trim())+'" gefunden. ',1),e[13]||(e[13]=t("a",{href:"#ort-suche",class:"text-link underline underline-offset-2"},"Zur PLZ-/Ortssuche",-1))])):N("",!0),t("div",Xe,[(i(!0),r(g,null,D(k.value,s=>(i(),r("section",{id:`land-${s.code}`,key:s.code,"aria-labelledby":`land-h-${s.code}`,"data-test":"land-gruppe",class:"mb-6 scroll-mt-4 break-inside-avoid"},[t("h3",{id:`land-h-${s.code}`,class:"text-h3"},l(s.name),9,tt),t("ul",st,[(i(!0),r(g,null,D(s.staedte,v=>(i(),r("li",{key:v.slug},[f(z,{to:E(v.slug),"data-test":"stadt-link",class:"hover:bg-surface-muted flex items-baseline justify-between gap-3 px-3 py-2 text-sm transition-colors"},{default:B(()=>[t("span",at,[t("span",nt,l(v.name),1),t("span",lt,l(c(M).format(v.einwohner)),1)]),t("span",ot,[v.ab[o.value]!=null?(i(),r(g,{key:0},[p("ab "+l(c(q)(v.ab[o.value]))+" â¬",1)],64)):(i(),r(g,{key:1},[e[14]||(e[14]=t("span",{"aria-hidden":"true"},"â",-1)),e[15]||(e[15]=t("span",{class:"sr-only"},"kein Preis im Tagesstand",-1))],64))])]),_:2},1032,["to"])]))),128))])],8,et))),128))])],2),t("section",rt,[e[19]||(e[19]=t("h2",{id:"ort-suche",class:"text-h2"},"Deine Stadt ist nicht dabei?",-1)),e[20]||(e[20]=t("p",{class:"text-foreground mt-1 text-sm"}," Die Tankstellensuche findet die aktuellen Preise für jeden Ort in Deutschland. ",-1)),t("form",{action:"/suche",method:"get",class:"mt-3 flex max-w-md flex-wrap items-end gap-2",onSubmit:xe(ee,["prevent"])},[t("div",it,[e[17]||(e[17]=t("label",{for:"idx-plz",class:"text-foreground mb-1 block text-sm"},"PLZ oder Ort",-1)),f(ae,{id:"idx-plz",modelValue:T.value,"onUpdate:modelValue":e[1]||(e[1]=s=>T.value=s),name:"plz",placeholder:"z. B. 89073 oder Ulm"},null,8,["modelValue"])]),e[18]||(e[18]=t("button",{type:"submit",class:"border-border bg-surface text-foreground hover:bg-surface-muted inline-flex min-h-11 items-center rounded-md border px-5 py-2.5 text-sm font-semibold transition-colors"}," Suchen ",-1))],32)]),t("p",dt,[f(z,{to:Q.value,"data-test":"regionen-link",class:"text-link underline underline-offset-2"},{default:B(()=>[...e[21]||(e[21]=[p(" Preise nach Bundesland und Landkreis vergleichen ",-1)])]),_:1},8,["to"])]),e[22]||(e[22]=t("p",{class:"text-muted mt-4 text-xs"}," Preisdaten: Markttransparenzstelle für Kraftstoffe (MTS-K), Bundeskartellamt, CC BY 4.0 · Kennzahlen beziehen sich auf die zum Tagesstand geöffneten Tankstellen. ",-1))])}}}),zt=Le(ut,[["__scopeId","data-v-839c247b"]]);export{zt 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.