1import{r as h,j as e,aM as M,U as G,B as L,A as O,o as Y}from"./index-D8d0swLk.js";import{A as T}from"./index-BLZslE12.js";import{m as x}from"./proxy-DDYIzmzM.js";import{M as z}from"./map-pin-SvwFaELu.js";import{C as U}from"./calendar-CfIPgoQu.js";import{R as J}from"./ruler-DG2lYg7_.js";import{W as I}from"./wallet-zbCyUPQh.js";import{A as V}from"./arrow-left-DwinG5x_.js";import{C as Z}from"./chart-column-BDJktsHl.js";import{T as P}from"./triangle-alert-DLRVO7OZ.js";const s={navy:"#0B1120",accent:"#2563EB",muted:"#94A3B8",border:"#E2E8F0",white:"#FFFFFF"},A={enter:t=>({x:t>0?80:-80,opacity:0}),center:{x:0,opacity:1},exit:t=>({x:t<0?80:-80,opacity:0})},K={hidden:{},show:{transition:{staggerChildren:.08}}},j={hidden:{opacity:0,y:16},show:{opacity:1,y:0,transition:{duration:.4,ease:"easeOut"}}};function Q(t,c,r,n,l){const m=2026-t,d=c*r,a=[{name:"Dach / Flachdach",costPerM2:120,cycleYears:30},{name:"Fassade / Aussenwärmedämmung",costPerM2:150,cycleYears:35},{name:"Fensterersatz",costPerM2:80,cycleYears:25},{name:"Heizungsersatz",costPerM2:60,cycleYears:20},{name:"Sanitärleitungen",costPerM2:70,cycleYears:40},{name:"Elektroinstallationen",costPerM2:40,cycleYears:35},{name:"Lift (falls vorhanden)",costPerM2:c>6?30:0,cycleYears:25}].filter(o=>o.costPerM2>0).map(o=>{const E=Math.floor(m/o.cycleYears)*o.cycleYears+o.cycleYears,C=Math.max(0,E-m);return{name:o.name,cost:Math.round(o.costPerM2*d),dueIn:C}}).sort((o,f)=>o.dueIn-f.dueIn),u=15,i=a.filter(o=>o.dueIn<=u).reduce((o,f)=>o+f.cost,0),v=n+l*12*u,p=Math.max(0,i-v),y=i>0?Math.round(p/i*100):0,N=i>n?Math.round((i-n)/(u*12)):l;let F="ok";return y>50?F="critical":y>20&&(F="warning"),{status:F,currentBalance:n,expectedNeed:i,gap:p,gapPercent:y,recommendedMonthly:N,renovations:a.slice(0,5)}}function w(t){return"CHF "+t.toLocaleString("de-CH")}const D=["Liegenschaft","Finanzen","Ergebnis"],X=[L,I,Z];function ee({current:t}){return e.jsx("div",{className:"flex items-center justify-center gap-0 mb-6",children:D.map((c,r)=>{const n=r<t,l=r===t,m=X[r];return e.jsxs("div",{className:"flex items-center",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-[12px] font-bold border-2 transition-all duration-500",style:{background:n||l?s.accent:s.white,borderColor:n||l?s.accent:s.border,color:n||l?s.white:s.muted},children:n?e.jsx(Y,{className:"w-3.5 h-3.5"}):e.jsx(m,{className:"w-3.5 h-3.5"})}),e.jsx("span",{className:"text-[10px] font-semibold mt-1 whitespace-nowrap",style:{color:n||l?s.navy:s.muted},children:c})]}),r<D.length-1&&e.jsx("div",{className:"w-10 sm:w-16 h-[2px] mx-1.5 mb-4 relative overflow-hidden rounded-full",style:{background:s.border},children:e.jsx(x.div,{className:"absolute top-0 left-0 h-full rounded-full",style:{background:s.accent},initial:{width:"0%"},animate:{width:n?"100%":"0%"},transition:{duration:.5,ease:"easeInOut"}})})]},r)})})}function b({label:t,hint:c,value:r,onChange:n,suffix:l,placeholder:m,required:d=!1,icon:g,type:a="number"}){return e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-center gap-1.5 text-[13px] font-semibold text-[#0B1120] mb-1.5",children:[g&&e.jsx(g,{className:"w-3.5 h-3.5",style:{color:s.accent}}),t,d&&e.jsx("span",{className:"text-[#DC2626] ml-0.5",children:"*"})]}),c&&e.jsx("p",{className:"text-[12px] text-[#94A3B8] mb-2",children:c}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:a,inputMode:a==="number"?"decimal":void 0,value:r,onChange:u=>n(u.target.value),placeholder:m,className:"w-full h-11 px-4 rounded-xl border border-slate-200 bg-slate-50/50 text-[14px] text-[#0B1120] placeholder:text-[#94A3B8] focus:outline-none focus:border-[#2563EB] focus:ring-2 focus:ring-[#2563EB]/10 focus:bg-white transition-all"}),l&&e.jsx("span",{className:"absolute right-4 top-1/2 -translate-y-1/2 text-[13px] text-[#94A3B8]",children:l})]})]})}const te={ok:{color:"#10B981",bg:"#D1FAE5",border:"#6EE7B7",icon:Y,label:"Auf gutem Weg",desc:"Ihr Erneuerungsfonds reicht voraussichtlich für die anstehenden Sanierungen."},warning:{color:"#F59E0B",bg:"#FEF3C7",border:"#FCD34D",icon:P,label:"Finanzierungslücke möglich",desc:"Ihr Fonds könnte für anstehende Sanierungen nicht ausreichen."},critical:{color:"#EF4444",bg:"#FEE2E2",border:"#FCA5A5",icon:P,label:"Erhebliche Lücke",desc:"Ihr Fonds reicht voraussichtlich nicht. Eine professionelle Analyse lohnt sich."}};function se({result:t,baujahr:c,units:r,adresse:n,ort:l,onReset:m}){const d=te[t.status],g=d.icon;return e.jsxs(x.div,{variants:K,initial:"hidden",animate:"show",className:"space-y-4",children:[e.jsxs(x.div,{variants:j,className:"rounded-xl p-4 flex items-start gap-3",style:{background:d.bg,border:`1px solid ${d.border}`},children:[e.jsx(g,{className:"w-5 h-5 mt-0.5 shrink-0",style:{color:d.color}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-bold",style:{color:s.navy},children:d.label}),e.jsx("p",{className:"text-[12px] text-slate-600 leading-relaxed",children:d.desc})]})]}),e.jsx(x.p,{variants:j,className:"text-[12px] text-slate-400",children:n&&l?`${n}, ${l}`:`Baujahr ${c}, ${r} Einheiten`}),e.jsxs(x.div,{variants:j,className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"rounded-xl p-3",style:{background:"#F8FAFC",border:"1px solid #E2E8F0"},children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-0.5",children:"Aktueller Fonds"}),e.jsx("p",{className:"text-lg font-bold",style:{color:s.navy},children:w(t.currentBalance)})]}),e.jsxs("div",{className:"rounded-xl p-3",style:{background:"#F8FAFC",border:"1px solid #E2E8F0"},children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-0.5",children:"Bedarf (15 J.)"}),e.jsx("p",{className:"text-lg font-bold",style:{color:s.navy},children:w(t.expectedNeed)})]}),t.gap>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-xl p-3",style:{background:"#FEF2F2",border:"1px solid #FECACA"},children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-0.5",children:"Lücke"}),e.jsx("p",{className:"text-lg font-bold text-red-600",children:w(t.gap)})]}),e.jsxs("div",{className:"rounded-xl p-3",style:{background:"rgba(37,99,235,0.04)",border:"1px solid rgba(37,99,235,0.12)"},children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-0.5",children:"Empfohlen"}),e.jsxs("p",{className:"text-lg font-bold",style:{color:s.accent},children:[w(t.recommendedMonthly),"/Mt."]})]})]})]}),e.jsxs(x.div,{variants:j,children:[e.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.1em] text-slate-400 mb-3",children:"Anstehende Sanierungen"}),e.jsx("div",{className:"space-y-2.5",children:t.renovations.map((a,u)=>{const i=Math.max(...t.renovations.map(p=>p.cost)),v=a.cost/i*100;return e.jsxs(x.div,{initial:{opacity:0,x:-10}
1,animate:{opacity:1,x:0},transition:{delay:.1+u*.06,duration:.35},children:[e.jsxs("div",{className:"flex items-center justify-between text-[12px] mb-1",children:[e.jsx("span",{className:"text-slate-700 font-medium",children:a.name}),e.jsx("span",{className:"text-slate-400",children:a.dueIn===0?"Ãberfällig":`in ${a.dueIn} J.`})]}),e.jsx("div",{className:"h-2 rounded-full overflow-hidden",style:{background:"#F1F5F9"},children:e.jsx(x.div,{className:"h-full rounded-full",style:{background:a.dueIn===0?"#EF4444":a.dueIn<=5?"#F59E0B":s.accent},initial:{width:0},animate:{width:`${v}%`},transition:{delay:.2+u*.06,duration:.6}})}),e.jsx("div",{className:"flex justify-end mt-0.5",children:e.jsx("span",{className:"text-[11px] font-semibold text-slate-500",children:w(a.cost)})})]},a.name)})})]}),e.jsxs(x.div,{variants:j,className:"rounded-xl p-5 text-center",style:{background:s.navy},children:[e.jsx("p",{className:"text-[14px] font-bold text-white mb-1",children:"Detaillierten Report erhalten"}),e.jsx("p",{className:"text-[12px] text-white/60 mb-4",children:"Individuelle Analyse Ihres Erneuerungsfonds â kostenlos und unverbindlich."}),e.jsxs("a",{href:"https://calendly.com/fachbriefing/30min?utm_source=valtis&utm_medium=tool&utm_campaign=erneuerungsfonds_check_embed",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl text-[13px] font-semibold text-white transition-all hover:opacity-90 active:scale-[0.98]",style:{background:s.accent},children:["Termin vereinbaren ",e.jsx(O,{className:"w-3.5 h-3.5"})]})]}),e.jsx(x.div,{variants:j,children:e.jsx("button",{type:"button",onClick:m,className:"w-full h-10 rounded-xl border border-[#E2E8F0] text-[#0B1120] font-semibold text-[13px] hover:bg-[#F8F9FB] active:scale-[0.98] transition-all",children:"Neue Berechnung"})})]})}function he(){const[t,c]=h.useState(0),[r,n]=h.useState(1),[l,m]=h.useState(null),[d,g]=h.useState(""),[a,u]=
1h.useState(""),[i,v]=h.useState(""),[p,y]=h.useState(""),[N,F]=h.useState("85"),[o,f]=h.useState(""),[E,C]=h.useState(""),[B,R]=h.useState(""),k=i&&p&&N&&parseInt(i)>=1900&&parseInt(i)<=2025&&parseInt(p)>0,S=k&&E&&B,_=()=>{if(!S)return;const q=Q(parseInt(i),parseInt(p),parseInt(N),parseInt(E),parseInt(B));m(q),n(1),c(2)},H=()=>{m(null),n(-1),c(0)},W=()=>{t===0&&k?(n(1),c(1)):t===1&&_()},$=()=>{t>0&&(n(-1),t===2?(m(null),c(1)):c(t-1))};return e.jsx("div",{className:"my-10 -mx-4 sm:mx-0",children:e.jsxs("div",{className:"rounded-none sm:rounded-2xl border-y sm:border border-[#E2E8F0] bg-white p-5 sm:p-7",style:{boxShadow:"0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03)"},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-5",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{background:"rgba(37,99,235,0.08)"},children:e.jsx(M,{className:"w-4 h-4",style:{color:s.accent}})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[14px] font-bold",style:{color:s.navy},children:"EF-Check"}),e.jsx("p",{className:"text-[11px]",style:{color:s.muted},children:"Ist Ihr Erneuerungsfonds ausreichend?"})]})]}),e.jsx(ee,{current:t}),e.jsx("div",{className:"relative min-h-[320px]",children:e.jsxs(T,{initial:!1,custom:r,mode:"wait",children:[t===0&&e.jsxs(x.div,{custom:r,variants:A,initial:"enter",animate:"center",exit:"exit",transition:{duration:.3,ease:"easeInOut"},children:[e.jsx("h3",{className:"text-[15px] font-bold text-[#0B1120] mb-1",children:"Angaben zur Liegenschaft"}),e.jsx("p",{className:"text-[12px] text-[#94A3B8] mb-5",children:"Grunddaten Ihres Gebäudes."}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsx(b,{label:"Strasse / Nr.",hint:"Optional",value:d,onChange:g,placeholder:"z.B. Bahnhofstrasse 12",icon:z,type:"text"}),e.jsx(b,{label:"PLZ / Ort",hint:"Optional",value:a,onChange:u,placeholder:"z.B. 6003 Luzern",icon:z,type:"text"})]}),e.jsx(b,{label:"Baujahr",value:i,onChange:v,placeholder:"z.B. 1992",required:!0,icon:U}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsx(b,{label:"Anzahl Einheiten",value:p,onChange:y,placeholder:"z.B. 12",required:!0,icon:G}),e.jsx(b,{label:"à Wohnungsgrösse",value:N,onChange:F,suffix:"m²",placeholder:"85",required:!0,icon:J})]}),e.jsx(b,{label:"Gebäudeversicherungswert",hint:"Steht auf Ihrer Police (optional)",value:o,onChange:f,suffix:"CHF",placeholder:"z.B. 4'000'000",icon:L})]})]},"s0"),t===1&&e.jsxs(x.div,{custom:r,variants:A,initial:"enter",animate:"center",exit:"exit",transition:{duration:.3,ease:"easeInOut"},children:[e.jsx("h3",{className:"text-[15px] font-bold text-[#0B1120] mb-1",children:"Erneuerungsfonds"}),e.jsx("p",{className:"text-[12px] text-[#94A3B8] mb-5",children:"Aktuelle Finanzsituation Ihres Fonds."}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(b,{label:"Aktueller Fondsstand",value:E,onChange:C,suffix:"CHF",placeholder:"z.B. 120'000",required:!0,icon:I}
1),e.jsx(b,{label:"Monatliche Einzahlung (gesamt)",value:B,onChange:R,suffix:"CHF/Mt.",placeholder:"z.B. 1'200",required:!0,icon:I})]})]},"s1"),t===2&&l&&e.jsx(x.div,{custom:r,variants:A,initial:"enter",animate:"center",exit:"exit",transition:{duration:.3,ease:"easeInOut"},children:e.jsx(se,{result:l,baujahr:i,units:p,adresse:d,ort:a,onReset:H})},"s2")]})}),t<2&&e.jsxs("div",{className:"flex items-center justify-between mt-6 pt-5 border-t border-[#E2E8F0]",children:[t>0?e.jsxs("button",{type:"button",onClick:$,className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl text-[13px] font-semibold text-[#0B1120] hover:bg-[#F8F9FB] active:scale-[0.98] transition-all border border-[#E2E8F0]",children:[e.jsx(V,{className:"w-3.5 h-3.5"})," Zurück"]}):e.jsx("div",{}),e.jsx("button",{type:"button",onClick:W,disabled:t===0?!k:!S,className:"inline-flex items-center gap-2 px-5 py-2 rounded-xl text-[13px] font-semibold text-white bg-[#2563EB] hover:bg-[#1D4ED8] active:scale-[0.98] transition-all disabled:opacity-40 disabled:cursor-not-allowed",children:t===1?e.jsxs(e.Fragment,{children:[e.jsx(M,{className:"w-3.5 h-3.5"})," Berechnen"]}):e.jsxs(e.Fragment,{children:["Weiter ",e.jsx(O,{className:"w-3.5 h-3.5"})]})})]}),e.jsx("p",{className:"text-center text-[11px] mt-3",style:{color:s.muted},children:"Kostenlos · Anonym · Geschätzte Werte basierend auf Branchenstandards."})]})})}export{he 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.