PageSourceSearch

https://arena-fitness.de/assets/EmailAnalytics-CFpZIJYn.js

js arena-fitness.de collected 2026-10-07 05:06:59 UTC 24,254 bytes, 26 lines download raw bytes

1import{a as f,j as e}from"./trpc-vendor-Bta84Nsh.js";import{K as G,cw as K,aj as L,aa as O,C as Z,t as Y}from"./ui-vendor-G1dkncD6.js";import{t as k,C as v,h as w}from"./index-efXNtgb_.js";import"./react-vendor-DpXpH6G7.js";const Q={appointment_confirmation:"Terminbestätigung",appointment_reminder_12h:"Termin-Erinnerung 12h",appointment_reminder_1h:"Termin-Erinnerung 1h",appointment_reschedule:"Termin verschoben",appointment_feedback_request:"Feedback-Anfrage",appointment_feedback_digest:"Feedback-Wochen-Digest",contract_link:"Vertragslink",contract_confirmation:"Vertragsbestätigung",admin_appointment_notification:"Admin: neuer Termin",admin_contract_notification:"Admin: neuer Vertrag",signup_notification:"Studio: Online-Vertrag",sprint_send:"Sprint-Mail",sprint_referral:"Sprint-Empfehlung",newsletter:"Newsletter",lead_flow:"Lead-Flow (Drip / Recovery)",weekly_flow:"Wochen-Mailing (Bulk)",referral_friend_signed:"Werber: Freund hat unterschrieben",test_email:"Test-Mail",other:"Sonstige"};function M(x){return Q[x]??x}const R=new Set(["lead_flow","sprint_send","sprint_referral","weekly_flow","newsletter"]);function J(){const[x,_]=f.useState(void 0),[o,$]=f.useState("30d"),[F,A]=f.useState(new Set),C=t=>{A(a=>{const d=new Set(a);return d.has(t)?d.delete(t):d.add(t),d})},{dateFrom:S,dateTo:T,label:j}=f.useMemo(()=>{const t=new Date,a=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();if(o==="today")return{dateFrom:a,dateTo:t.getTime(),label:"Heute"};if(o==="yesterday")return{dateFrom:a-864e5,dateTo:a-1,label:"Gestern"};if(o==="thismonth")return{dateFrom:new Date(t.getFullYear(),t.getMonth(),1).getTime(),dateTo:t.getTime(),label:"Dieser Monat"};if(o==="lastmonth"){const d=new Date(t.getFullYear(),t.getMonth()-1,1).getTime(),n=new Date(t.getFullYear(),t.getMonth(),1).getTime()-1;return{dateFrom:d,dateTo:n,label:"Letzter Monat"}}return o==="all"?{dateFrom:void 0,dateTo:void 0,label:"Gesamt"}:{dateFrom:t.getTime()-30*864e5,dateTo:t.getTime(),label:"Letzte 30 Tage"}},[o]),[c,E]=f.useState("type"),{data:D=[]}=k.brands.list.useQuery(void 0,{staleTime:30*6e4}),N=t=>{const a=D.find(d=>Number(d.id)===t);return a?.studioName||a?.name||`Studio ${t}`},{data:V,isLoading:B}=k.brands.emailAnalyticsByType.useQuery({brandId:x,dateFrom:S,dateTo:T},{staleTime:6e4,refetchInterval:5*6e4,enabled:c==="type"}),{data:P,isLoading:z}=k.brands.emailAnalyticsByBrand.useQuery({dateFrom:S,dateTo:T},{staleTime:6e4,refetchInterval:5*6e4,enabled:c==="brand"}),m=P?.rows??[],I=()=>{const t=[...m].sort((r,i)=>(i.sent||0)-(r.sent||0));if(!t.length)return;const a=r=>String(r??"").replace(/[&<>]/g,i=>({"&":"&amp;","<":"&lt;",">":"&gt;"})[i]),d=t.reduce((r,i)=>({sent:r.sent+(i.sent||0),opened:r.opened+(i.opened||0),clicked:r.clicked+(i.clicked||0),trackedSent:r.trackedSent+(i.trackedSent||0),appts:r.appts+(i.appts||0),contracts:r.contracts+(i.contracts||0)}),{sent:0,opened:0,clicked:0,trackedSent:0,appts:0,contracts:0}),n=r=>r==null?"n/a":r+"%",g=t.map(r=>`<tr>
2      <td class="l">${a(N(r.brandId))}</td>
3      <td class="r">${(r.sent||0).toLocaleString("de-DE")}</td>
4      <td class="l mono">${a(r.sender)}</td>
5      <td class="r">${r.deliveryRate}%</td>
6      <td class="r">${n(r.openRate)}</td>
7      <td class="r">${n(r.clickRate)}</td>
8      <td class="r">${r.appts||"—"}</td>
9      <td class="r b">${r.contracts||"—"}</td></tr>`).join(""),b=`<!doctype html><html lang="de"><head><meta charset="utf-8"><title>E-Mail-Report – alle Studios</title>
10      <style>
11        *{box-sizing:border-box} body{font-family:-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:#111;margin:32px}
12        h1{font-size:20px;margin:0 0 2px} .sub{color:#666;font-size:12px;margin:0 0 18px}
13        .tot{display:flex;gap:24px;margin:0 0 18px;font-size:13px} .tot b{font-size:18px;display:block}
14        table{width:100%;border-collapse:collapse;font-size:12px} th,td{padding:7px 8px;border-bottom:1px solid #e5e5e5}
15        th{text-align:left;color:#666;font-weight:600;text-transform:uppercase;font-size:10px;letter-spacing:.04em}
16        td.r,th.r{text-align:right} td.l{text-align:left} td.b{font-weight:700;color:#1f7a34} .mono{font-family:ui-monospace,Menlo,monospace;color:#555}
17        @media print{body{margin:12mm}}
18      </style></head><body>
19      <h1>E-Mail-Report — alle Studios</h1>
20      <p class="sub">Zeitraum: ${a(j)} · erstellt ${new Date().toLocaleDateString("de-DE")} ${new Date().toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})}</p>
21      <div class="tot"><span><b>
21${d.sent.toLocaleString("de-DE")}</b>Mails gesamt</span><span><b>${d.appts.toLocaleString("de-DE")}</b>Termine</span><span><b>${d.contracts.toLocaleString("de-DE")}</b>Verträge</span><span><b>${t.length}</b>Studios</span></div>
22      <table><thead><tr>
23        <th>Studio</th><th class="r">Mails</th><th>Absender</th><th class="r">Zustellung</th><th class="r">Öffnung</th><th class="r">Klick</th><th class="r">Termine</th><th class="r">Verträge</th>
24      </tr></thead><tbody>${g}</tbody></table>
25      <script>window.onload=function(){setTimeout(function(){window.print();},250);};<\/script>
26      </body></html>`,s=window.open("","_blank");if(!s){Y.error("Bitte Popups erlauben, um das PDF zu erzeugen.");return}s.document.open(),s.document.write(b),s.document.close()},h=V?.rows??[],l=h.reduce((t,a)=>({sent:t.sent+a.sent,delivered:t.delivered+a.delivered,failed:t.failed+a.failed,opened:t.opened+a.opened,clicked:t.clicked+a.clicked,trackedSent:t.trackedSent+(R.has(a.emailType)?a.sent:0),contracts:t.contracts+(a.contractsAttributed??0),leadsConverted:t.leadsConverted+(a.leadsConverted??0)}),{sent:0,delivered:0,failed:0,opened:0,clicked:0,trackedSent:0,contracts:0,leadsConverted:0}),y=l.sent>0?Math.round(l.delivered/l.sent*1e3)/10:0,p=l.trackedSent>0?Math.round(l.opened/l.trackedSent*1e3)/10:null,u=l.trackedSent>0?Math.round(l.clicked/l.trackedSent*1e3)/10:null;return e.jsxs("div",{className:"p-6 max-w-7xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(G,{className:"w-6 h-6 text-blue-400"}),"Email-Analytics"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Pro Mail-Typ aufgeschluesselt — siehst sofort wo Probleme sind (z.B. 0% Open = Spam, viele Failed = API-Issue)."})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("select",{value:x==null?"":String(x),onChange:t=>_(t.target.value?Number(t.target.value):void 0),className:"h-9 text-sm rounded-md border border-border bg-background px-3",children:[e.jsx("option",{value:"",children:"Alle Marken"}),D.map(t=>e.jsx("option",{value:t.id,children:t.studioName??t.name},t.id))]}),e.jsxs("select",{value:o,onChange:t=>$(t.target.value),className:"h-9 text-sm rounded-md border border-border bg-background px-3",children:[e.jsx("option",{value:"today",children:"Heute"}),e.jsx("option",{value:"yesterday",children:"Gestern"}),e.jsx("option",{value:"thismonth",children:"Dieser Monat"}),e.jsx("option",{value:"lastmonth",children:"Letzter Monat"}),e.jsx("option",{value:"30d",children:"Letzte 30 Tage"}),e.jsx("option",{value:"all",children:"Gesamt"})]}),e.jsxs("div",{className:"inline-flex rounded-md border border-border overflow-hidden",children:[e.jsx("button",{onClick:()=>E("type"),className:`text-xs font-semibold px-3 h-9 ${c==="type"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"}`,children:"Pro Mail-Typ"}),e.jsx("button",{onClick:()=>E("brand"),className:`text-xs font-semibold px-3 h-9 border-l border-border ${c==="brand"?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-muted"}`,children:"Pro Studio"})]})]})]}),c==="brand"&&e.jsx(v,{children:e.jsxs(w,{className:"py-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3 flex-wrap",children:[e.jsxs("div",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:["Pro Studio · ",j]}),m.length>0&&e.jsxs("button",{onClick:I,className:"inline-flex items-center gap-1.5 text-xs font-medium px-3 h-8 rounded-md border border-border hover:bg-muted",children:[e.jsx(K,{className:"w-3.5 h-3.5"})," Als PDF"]})]}),z?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(L,{className:"w-4 h-4 animate-spin"})," Lade…"]}):m.length===0?e.jsx("div",{className:"text-sm text-muted-foreground py-6 text-center",children:"Keine Mails im gewählten Zeitraum."}):(()=>{const t=m.reduce((s,r)=>({sent:s.sent+(r.sent||0),delivered:s.delivered+(r.delivered||0),opened:s.opened+(r.opened||0),clicked:s.clicked+(r.clicked||0),trackedSent:s.trackedSent+(r.trackedSent||0),appts:s.appts+(r.appts||0),contracts:s.contracts+(r.contracts||0)}),{sent:0,delivered:0,opened:0,clicked:0,trackedSent:0,appts:0,contracts:0}),a=(s,r)=>r>0?Math.round(s/r*1e3)/10:0,d=["#e11d48","#0ea5e9","#f59e0b","#16a34a","#7c3aed","#0891b2","#64748b","#9333ea","#db2777","#0d9488"],n=s=>d[Math.abs(Number(s))%d.length],g=s=>s.split(/\s+/).map(r=>r[0]||"").join("").slice(0,3).toUpperCase(),b=(s,r,i)=>s>=r?"bg-emerald-500/15 text-emerald-600":s>=i?"bg-amber-500/15 text-amber-600":"bg-red-500/15 text-red-500";return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-3 mb-5",children:[e.jsxs("div",{className:"rounded-xl border border-border p-3",children:[e.jsx("div",{className:"text-2xl font-black text-blue-500",children:t.sent.toLocaleStr
26ing("de-DE")}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mt-1",children:"Mails gesamt"})]}),e.jsxs("div",{className:"rounded-xl border border-border p-3",children:[e.jsxs("div",{className:"text-2xl font-black text-emerald-500",children:[a(t.delivered,t.sent),"%"]}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mt-1",children:"Zustellung"})]}),e.jsxs("div",{className:"rounded-xl border border-border p-3",children:[e.jsx("div",{className:"text-2xl font-black text-amber-500",children:t.trackedSent>0?a(t.opened,t.trackedSent)+"%":"n/a"}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mt-1",children:"Ø Öffnung*"})]}),e.jsxs("div",{className:"rounded-xl border border-border p-3",children:[e.jsx("div",{className:"text-2xl font-black text-red-500",children:t.trackedSent>0?a(t.clicked,t.trackedSent)+"%":"n/a"}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mt-1",children:"Ø Klick*"})]}),e.jsxs("div",{className:"rounded-xl border border-border p-3",children:[e.jsx("div",{className:"text-2xl font-black text-foreground",children:t.appts.toLocaleString("de-DE")}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mt-1",children:"Termine"})]}),e.jsxs("div",{className:"rounded-xl border border-border p-3",children:[e.jsx("div",{className:"text-2xl font-black text-emerald-600",children:t.contracts.toLocaleString("de-DE")}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mt-1",children:"Verträge"})]})]}),e.jsxs("div",{className:"overflow-x-auto",children:[e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-muted-foreground border-b border-border",children:[e.jsx("th",{className:"text-left py-2",children:"Studio"}),e.jsx("th",{className:"text-right py-2",children:"Mails"}),e.jsx("th",{className:"text-left py-2 pl-4",children:"Absender"}),e.jsx("th",{className:"text-right py-2",children:"Zustellung"}),e.jsx("th",{className:"text-right py-2",children:"Öffnung"}),e.jsx("th",{className:"text-right py-2",children:"Klick"}),e.jsx("th",{className:"text-right py-2",children:"Termine"}),e.jsx("th",{className:"text-right py-2",children:"Verträge"})]})}),e.jsxs("tbody",{children:[m.map(s=>e.jsxs("tr",{className:"border-b border-border/50 text-foreground",children:[e.jsx("td",{className:"py-2.5",children:e.jsxs("span",{className:"inline-flex items-center gap-2.5",children:[e.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-md text-white text-[9px] font-extrabold shrink-0",style:{background:n(s.brandId)},children:g(N(s.brandId))}),e.jsx("span",{className:"font-semibold",children:N(s.brandId)})]})}),e.jsx("td",{className:"py-2.5 text-right tabular-nums",children:s.sent.toLocaleString("de-DE")}),e.jsx("td",{className:"py-2.5 pl-4 font-mono text-muted-foreground",children:s.sender}),e.jsx("td",{className:"py-2.5 text-right",children:e.jsxs("span",{className:`px-2 py-0.5 rounded-full font-semibold ${b(s.deliveryRate,95,80)}`,children:[s.deliveryRate,"%"]})}),e.jsx("td",{className:"py-2.5 text-right",children:s.openRate==null?e.jsx("span",{className:"text-muted-foreground",children:"n/a"}):e.jsxs("span",{className:`px-2 py-0.5 rounded-full font-semibold ${b(s.openRate,25,15)}`,children:[s.openRate,"%"]})}),e.jsx("td",{className:"py-2.5 text-right",children:s.clickRate==null?e.jsx("span",{className:"text-muted-foreground",children:"n/a"}):e.jsxs("span",{className:`px-2 py-0.5 rounded-full font-semibold ${b(s.clickRate,5,2)}`,children:[s.clickRate,"%"]})}),e.jsx("td",{className:"py-2.5 text-right tabular-nums",children:s.appts||"—"}),e.jsx("td",{className:"py-2.5 text-right font-bold text-emerald-600 tabular-nums",children:s.contracts||"—"})]},s.brandId)),e.jsxs("tr",{className:"text-foreground font-bold",style:{borderTop:"2px solid var(--foreground, #111)"},children:[e.jsxs("td",{className:"py-2.5",children:["Gesamt · ",m.length," Studios"]}),e.jsx("td",{className:"py-2.5 text-right tabular-nums",children:t.sent.toLocaleStr
26ing("de-DE")}),e.jsx("td",{className:"py-2.5"}),e.jsxs("td",{className:"py-2.5 text-right",children:[a(t.delivered,t.sent),"%"]}),e.jsx("td",{className:"py-2.5 text-right",children:t.trackedSent>0?a(t.opened,t.trackedSent)+"%":"n/a"}),e.jsx("td",{className:"py-2.5 text-right",children:t.trackedSent>0?a(t.clicked,t.trackedSent)+"%":"n/a"}),e.jsx("td",{className:"py-2.5 text-right tabular-nums",children:t.appts.toLocaleString("de-DE")}),e.jsx("td",{className:"py-2.5 text-right text-emerald-600 tabular-nums",children:t.contracts.toLocaleString("de-DE")})]})]})]}),e.jsxs("p",{className:"text-[10px] text-muted-foreground mt-2",children:["Absender = häufigste Versand-Domain · Termine/Verträge = im Zeitraum (alle Quellen) · ",e.jsx("b",{children:"*Öffnung/Klick nur über getrackte Mails"}),' (Lead-Flow/Newsletter). Transaktionale Mails (Bestätigungen, Erinnerungen …) tragen bewusst keinen Tracking-Pixel → „n/a".']})]})]})})()]})}),c==="type"&&e.jsx(v,{children:e.jsxs(w,{className:"py-4",children:[e.jsxs("div",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-3",children:[j," · Gesamt"]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-6 gap-4",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-3xl font-black text-blue-400",children:l.sent.toLocaleString("de-DE")}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Versendet"})]}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:`text-3xl font-black ${y>=95?"text-emerald-400":y>=80?"text-yellow-400":"text-red-400"}`,children:[y,"%"]}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Auslieferung (",l.delivered.toLocaleString("de-DE"),")"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:`text-3xl font-black ${p==null?"text-muted-foreground":p>=25?"text-emerald-400":p>=15?"text-yellow-400":"text-red-400"}`,children:p==null?"n/a":`${p}%`}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Open-Rate* (",l.opened.toLocaleString("de-DE"),")"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:`text-3xl font-black ${u==null?"text-muted-foreground":u>=5?"text-emerald-400":u>=2?"text-yellow-400":"text-red-400"}`,children:u==null?"n/a":`${u}%`}),e.jsxs("div",{className:"text-xs text-muted-foreground mt-1",children:["Click-Rate* (",l.clicked.toLocaleString("de-DE"),")"]})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:`text-3xl font-black ${l.contracts>0?"text-emerald-400":"text-muted-foreground"}`,title:"Vertraege attribuiert: Lead bekam eine Mail dieses Typs und schloss innerhalb 60 Tagen einen Vertrag ab. Multi-Touch — selber Vertrag zaehlt in jedem Mail-Typ den der Lead bekam.",children:l.contracts.toLocaleString("de-DE")}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Vertraege (60d)"})]}),e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:`text-3xl font-black ${l.failed===0?"text-emerald-400":"text-red-400"}`,children:l.failed.toLocaleString("de-DE")}),e.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Fehler"})]})]})]})}),c==="type"&&e.jsx(v,{children:e.jsxs(w,{className:"py-4",children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider mb-3",children:"Pro Mail-Typ"}),B?e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(L,{className:"w-4 h-4 animate-spin"})," Lade Email-Analytics…"]}):h.length===0?e.jsx("div",{className:"text-sm text-muted-foreground py-6 text-center",children:"Keine Mails im gewaehlten Zeitraum."}):e.jsxs("div",{className:"overflow-x-auto",children:[e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-muted-foreground border-b border-border",children:[e.jsx("th",{className:"text-left py-2",children:"Mail-Typ"}),e.jsx("th",{className:"text-right py-2",children:"Versendet"}),e.jsx("th",{className:"text-right py-2",children:"Ausgeliefert"}),e.jsx("th",{className:"text-right py-2",children:"Auslieferung"}),e.jsx("th",{className:"text-right py-2",children:"Geöffnet"}),e.jsx("th",{className:"text-right py-2",children:"Open-%"}),e.jsx("th",{className:"text-right py-2",children:"Geklickt"}),e.jsx("th",{className:"text-right py-2",children:"Click-%"}),e.jsx("th",{className:"text-right py-2",title:"Distincte Leads die diese Mail bekamen UND innerhalb 60 Tage danach einen Vertrag abschlossen. Multi-Touch — selber Vertrag zaehlt auch bei anderen Mail-T
26ypen die der Lead erhielt.",children:"Vertraege"}),e.jsx("th",{className:"text-right py-2",children:"Fehler"})]})}),e.jsx("tbody",{children:h.map(t=>{const a=F.has(t.emailType),d=t.domains??[];return e.jsxs(e.Fragment,{children:[e.jsxs("tr",{className:"border-b border-border/30 hover:bg-muted/10 cursor-pointer",onClick:()=>C(t.emailType),children:[e.jsx("td",{className:"py-2 font-medium",children:e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(O,{className:`w-3.5 h-3.5 text-muted-foreground transition-transform ${a?"rotate-90":""}`}),e.jsx("span",{children:M(t.emailType)}),d.length>1&&e.jsxs("span",{className:"ml-1 px-1.5 py-0.5 rounded text-[9px] bg-muted text-muted-foreground",children:[d.length," Domains"]})]})}),e.jsx("td",{className:"py-2 text-right",children:t.sent.toLocaleString("de-DE")}),e.jsx("td",{className:"py-2 text-right",children:t.delivered.toLocaleString("de-DE")}),e.jsxs("td",{className:`py-2 text-right font-medium ${t.deliveryRate>=95?"text-emerald-400":t.deliveryRate>=80?"text-yellow-400":"text-red-400"}`,children:[t.deliveryRate,"%"]}),R.has(t.emailType)?e.jsxs(e.Fragment,{children:[e.jsx("td",{className:"py-2 text-right",children:t.opened.toLocaleString("de-DE")}),e.jsxs("td",{className:`py-2 text-right font-medium ${t.openRate>=25?"text-emerald-400":t.openRate>=15?"text-yellow-400":"text-red-400"}`,children:[t.openRate,"%"]}),e.jsx("td",{className:"py-2 text-right",children:t.clicked.toLocaleString("de-DE")}),e.jsxs("td",{className:`py-2 text-right ${t.clickRate>=5?"text-emerald-400":t.clickRate>=2?"text-yellow-400":"text-red-400"}`,children:[t.clickRate,"%"]})]}):e.jsxs(e.Fragment,{children:[e.jsx("td",{className:"py-2 text-right text-muted-foreground",title:"Transaktionale Mail — kein Tracking-Pixel, Öffnung nicht messbar",children:"n/a"}),e.jsx("td",{className:"py-2 text-right text-muted-foreground",children:"n/a"}),e.jsx("td",{className:"py-2 text-right text-muted-foreground",children:"n/a"}),e.jsx("td",{className:"py-2 text-right text-muted-foreground",children:"n/a"})]}),e.jsxs("td",{className:`py-2 text-right font-medium ${(t.contractsAttributed??0)>0?"text-emerald-400":"text-muted-foreground"}`,title:`${t.leadsConverted??0} distincte Leads, ${t.contractsAttributed??0} Vertraege gesamt (Lead kann mehrere Vertraege haben)${t.contractRate!=null?` — ${t.contractRate}% der Versendeten`:""}`,children:[(t.contractsAttributed??0).toLocaleString("de-DE"),(t.contractsAttributed??0)>0&&t.contractRate!=null&&e.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["(",t.contractRate,"%)"]})]}),e.jsx("td",{className:`py-2 text-right ${t.failed===0?"text-emerald-400":"text-red-400"}`,children:t.failed.toLocaleString("de-DE")})]},t.emailType),a&&d.map((n,g)=>e.jsxs("tr",{className:"border-b border-border/20 bg-muted/5 text-[11px]",children:[e.jsx("td",{className:"py-1.5 pl-7 text-muted-foreground",children:e.jsx("span",{className:"font-mono",children:n.fromDomain})}),e.jsx("td",{className:"py-1.5 text-right text-muted-foreground",children:n.sent.toLocaleString("de-DE")}),e.jsx("td",{className:"py-1.5 text-right text-muted-foreground",children:n.delivered.toLocaleString("de-DE")}),e.jsxs("td",{className:`py-1.5 text-right ${n.deliveryRate>=95?"text-emerald-400":n.deliveryRate>=80?"text-yellow-400":"text-red-400"}`,children:[n.deliveryRate,"%"]}),e.jsx("td",{className:"py-1.5 text-right text-muted-foreground",children:n.opened.toLocaleString("de-DE")}),e.jsxs("td",{className:`py-1.5 text-right ${n.openRate>=25?"text-emerald-400":n.openRate>=15?"text-yellow-400":"text-red-400"}`,children:[n.openRate,"%"]}),e.jsx("td",{className:"py-1.5 text-right text-muted-foreground",children:n.clicked.toLocaleString("de-DE")}),e.jsxs("td",{className:`py-1.5 text-right ${n.clickRate>=5?"text-emerald-400":n.clickRate>=2?"text-yellow-400":"text-red-400"}`,children:[n.clickRate,"%"]}),e.jsx("td",{className:"py-1.5 text-right text-muted-foreground",children:"—"}),e.jsx("td",{className:"py-1.5 text-right text-muted-foreground",children:"—"})]},`${t.emailType}-d-${g}`))]})})})]}),h.some(t=>t.failed>0&&t.lastError)&&e.jsxs("div",{className:"mt-4 space-y-2",children:[e.jsx("div",{className:"text-xs text-muted-foreground uppercase tracking-wider",children:"Häufigste Fehler"}),h.filter(t=>t.failed>0&&t.lastError).map(t=>e.jsx("div",{className:"rounded border border-red-500/30 bg-red-500/5 p-2 text-[11px]",children:e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(Z,{className:"w-4 h-4 text-red-400 shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"font-medium text-red-300",children:[M(t.emailType)," ",e.jsxs("span",{className:"text-muted-foreground font-mono text-[10px]",children:["(",t.emailType,")"]})]}),e.jsxs("div",{className:"text-muted-foreground mt-0.5",children:[t.lastErrorCount,"× (",Math.round(t.lastErrorCount/t.failed*100),"% der Fehler):"]}),e.jsx("code",{className:"block mt-1 text-red-300 break-all",children:t.lastError})]})]})},`${t.emailType}-err`))]})]})]})}),c==="type"&&e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[e.jsx("strong",{children:"* Öffnung/Klick nur über getrackte Mails"})," (Lead-Flow, Newsletter, Sprint). Transaktionale Mails (Bestätigungen, Erinnerungen, Admin …) tragen bewusst keinen Tracking-Pixel → ",e.jsx("b",{children:'„n/a"'})," statt 0%. Zustellung wird immer gemessen.",e.jsx("br",{}),e.jsx("br",{}),e.jsx("strong",{children:"Mail-Typen-Glossar:"}
26)," appointment_confirmation/reschedule/reminder = Termin-Mails · contract_confirmation/contract_link = Vertrags-Mails · sprint_email_send/sprint_referral = Sprint-Mailings · magic_link/lead_login_link = Auth-Links · admin_appointment_notification = Admin-BCCs · signup_notification = Online-Signup-Notifications · referral_friend_signed = Empfehlungs-Bonus-Mail an Werber."]})]})}export{J 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.