1import{j as e,r as a}from"./vendor-react-D0h46m16.js";import{d as s,c as t,L as r}from"./legacy-article-redirect-fp3isHR7.js";import{ad as l,n as i,ae as n,f as o,P as c,a as d,af as m,d as x,y as u,H as h,X as g}from"./use-profile-CuRxmWYi.js";import{F as p}from"./Footer-C-QL4pp4.js";import{s as j,u as f,S as b}from"./DonationThankYou-D9g4qmKo.js";import{S as N}from"./ScrollToTop-BbnbJAtN.js";import{b as v,c as y}from"./vendor-query-Dr68jqlw.js";import{s as w}from"./use-search-history-Boqjf0_n.js";import{A as _}from"./index-DqZvI2U2.js";import{p as k}from"./sitemap-index-Cq_Imzq3.js";import{u as A}from"./use-hybrid-infinite-scroll-BjVFsJs4.js";import{c as C,B as S}from"./button-CykUDgWQ.js";import{A as P,a as z,b as T}from"./CommentLevelBadge-CBkACBOy.js";import{O as $}from"./OptimizedImage-CuwU3LWg.js";import{c as I,M as L,aS as O,j as F,H as M,i as D,F as K,d as R,a7 as q,f as B,ab as U,z as E,y as H,ad as W}from"./vendor-icons-BbYfpdOz.js";import{A as X}from"./AdSlot-BAFJFece.js";import{t as Y}from"./use-section-tracking-D1IaNRxi.js";import{S as G,a as V,b as J,c as Q,d as Z}from"./use-forum-posts-DIWRjETo.js";import"./vendor-radix-D7CZeoLk.js";import"./vendor-radix-core-BVUYVtAx.js";import"./vendor-api-B4hs_cPm.js";import"./weatherTime-Y9ihW93L.js";import"./whatsNew--tlXZLzZ.js";import"./index.esm-B2IzwMux.js";import"./exports-cWTammwm.js";import"./AdReservation-Cs-_-fRT.js";const ee=20;async function ae(e){const a=await fetch(`/api/feeds/author/${encodeURIComponent(e)}.json`);return a.ok?a.json():null}const se=({article:a,commentCount:s,showSubline:t=!0})=>{const r=`/${a.category?.toLowerCase()||"politik"}/${a.slug}/`,l=a.published_at?o(new Date(a.published_at),{addSuffix:!0,locale:x}):"";return e.jsxs(c,{to:r,articleSlug:a.slug,className:"flex gap-4 group py-4 border-b border-border last:border-b-0 hover:bg-muted/30 transition-colors -mx-2 px-2 rounded-lg",children:[e.jsx("div",{className:"flex-shrink-0 w-[120px] h-[68px] sm:w-[140px] sm:h-[79px] rounded-lg overflow-hidden bg-muted",children:a.storage_image||a.image_url?e.jsx($,{src:a.storage_image?.original||a.image_url||"",storageImage:a.storage_image,alt:a.headline,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",sizes:"(max-width: 640px) 120px, 140px",aspectRatio:"16/9",width:140,height:79,loading:"lazy"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-muted-foreground text-xs",children:"Kein Bild"})}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:C("text-xs font-medium px-2 py-0.5 rounded",m(a.category),"text-white"),children:d(a.category)}),e.jsx("span",{className:"text-xs text-muted-foreground",children:l})]}),e.jsx("h3",{className:"text-sm sm:text-base font-semibold whitespace-pre-line line-clamp-2 group-hover:text-primary transition-colors leading-tight",children:a.headline}),t&&a.subline&&e.jsx("p",{className:"hidden sm:block text-sm text-muted-foreground line-clamp-1 mt-1",children:a.subline}),e.jsxs("div",{className:"flex items-center gap-3 mt-auto pt-1 text-xs text-muted-foreground",children:[a.reading_time_minutes&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(I,{className:"h-3 w-3"}),a.reading_time_minutes," Min"]}),"number"==typeof s&&s>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(L,{className:"h-3 w-3"}),s]})]})]})]})},te=({categories:a,selectedCategory:s,onCategoryChange:t,sortOrder:r,onSortChange:l,totalCount:i})=>e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4 py-4 border-b border-border mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(O,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Filter:"})]}),e.jsxs(G,{value:s,onValueChange:t,children:[e.jsx(V,{className:"w-full sm:w-[180px] h-9",children:e.jsx(J,{placeholder:"Alle Kategorien"})}),e.jsxs(Q,{children:[e.jsx(Z,{value:"all",children:"Alle Kategorien"}),a.map(a=>e.jsx(Z,{value:a,children:d(a)},a))]})]}),e.jsxs(G,{value:r,onValueChange:e=>l(e),children:[e.jsx(V,{className:"w-full sm:w-[160px] h-9",children:e.jsx(J,{})}),e.jsxs(Q,{children:[e.jsx(Z,{value:"newest",children:"Neueste zuerst"}),e.jsx(Z,{value:"oldest",children:"Ãlteste zuerst"})]})]}),"number"==typeof i&&e.jsxs("span",{className:"text-sm text-muted-foreground ml-auto",children:[i," ","Artikel"]})]}),re="undefined"!=typeof window&&window.matchMedia("(min-width: 1024px)").matches,le={x:{Icon:g,label:"auf X"},instagram:{Icon:W,label:"auf Instagram"},facebook:{Icon:H,label:"auf Facebook"},linkedin:{Icon:E,label:"auf LinkedIn"},website:{Icon:U,label:"Website"},email:{Icon:B,label:"per E-Mail kontaktieren"}},ie=({links:a,authorName:s})=>0===a.length?null:e.jsx("div",{className:"flex items-center gap-1 mt-2","aria-label":`Social-Media-Profile von ${s}`,children:a.map(({platform:a,url:t})=>{const{Icon:r,label:l}=le[a],i="email"!==a||t.startsWith("mailto:")?t:`mailto:${t}`;return e.jsx("a",{href:i,target:"email"===a?void 0:"_blank",rel:"email"===a?void 0:"noopener noreferrer","aria-label":`${s} ${l}`,className:"text-muted-foreground hover:text-primary transition-colors min-h-10 min-w-10 flex items-center justify-center",children:e.jsx(r,{className:"h-4 w-4"})},`${a}-${t}`)})}
1),ne=({serverAuthor:o=null,serverArticles:c=null}={})=>{const{slug:d}=s(),m=d||"",x=u(),[g,C]=a.useState("all"),[$,I]=a.useState("newest"),[L,O]=a.useState(!1),{data:B,isLoading:U}=function(e,a=!0,s){return v({queryKey:["author-info",e],...s?{initialData:s}:{},queryFn:async()=>{const a=await ae(e);return a?.author?{name:a.author.name||"Unbekannter Autor",slug:a.author.slug||e,avatar_url:a.author.avatar_url,article_count:a.author.article_count||0,bio:"string"==typeof a.author.bio&&a.author.bio.trim()?a.author.bio.trim():null,job_title:"string"==typeof a.author.job_title&&a.author.job_title.trim()?a.author.job_title.trim():null,social_links:k(a.author.social_links),has_profile:"boolean"==typeof a.author.has_profile?a.author.has_profile:Boolean(a.author.bio||a.author.job_title)}:null},enabled:a&&!!e,staleTime:3e5})}(m,x.authorPages,o),{data:E=[]}=function(e,a=!0){return v({queryKey:["author-categories",e],queryFn:async()=>{const a=await ae(e);return a?.author?.categories?a.author.categories.map(e=>i(e)).filter(e=>n.includes(e)).sort():[]},enabled:a&&!!e,staleTime:3e5})}(m,x.authorPages);B?.name&&j({title:`${B.name} â Autor`,category:"Autoren",author:B.name});const{data:H,fetchNextPage:W,hasNextPage:G,isFetchingNextPage:V,isLoading:J}=function(e){const{authorSlug:a,enabled:s=!0,category:t,sortOrder:r="newest",initialArticles:i}=e;return y({queryKey:["author-articles",a,t,r],queryFn:async({pageParam:e=0})=>{if(e<200){const s=await ae(a);let i=s?.articles||[];t&&"all"!==t&&(i=i.filter(e=>e.category===t)),"oldest"===r&&(i=[...i].reverse());const n=i.slice(e,e+ee).map(e=>l({...e,headline:e.headline||"",subline:e.subline||"",content:"",category:e.category||_.DEFAULT_CATEGORY,author:e.author||_.AUTHOR,published_at:e.published_at||(new Date).toISOString(),reading_time_minutes:e.reading_time_minutes||0,slug:e.slug||`article-${e.id}`})),o=s?.author?.article_count||i.length,c=e+ee<i.length,d=o>i.length;return{articles:n,nextCursor:c||d?e+ee:void 0,pagesLoaded:Math.floor(e/ee)+1}}const{data:s,error:i}=await w.functions.invoke("app-category",{body:{category:t&&"all"!==t?t:"all",author_slug:a,limit:ee,offset:e}});if(i)throw i;return{articles:(s?.data||[]).map(e=>l({...e,headline:e.headline||"",subline:e.subline||"",content:"",category:e.category||_.DEFAULT_CATEGORY,author:e.author||_.AUTHOR,published_at:e.published_at||(new Date).toISOString(),reading_time_minutes:e.reading_time_minutes||0,slug:e.slug||`article-${e.id}`})),nextCursor:s?.meta?.has_more?e+ee:void 0,pagesLoaded:Math.floor(e/ee)+1}},getNextPageParam:e=>e.nextCursor,initialPageParam:0,initialData:i&&i.length>0?{pages:[{articles:i,nextCursor:i.length>=ee?ee:void 0,pagesLoaded:1}],pageParams:[0]}:void 0,enabled:s&&!!a,staleTime:3e5,gcTime:6e5})}({authorSlug:m,enabled:!!m&&x.authorPages,category:g,sortOrder:$,initialArticles:"all"===g&&"newest"===$?c??void 0:void 0}),Q=H?.pages.length||0,{triggerRef:Z}=A({hasNextPage:G,isFetchingNextPage:V,fetchNextPage:W,autoLoadCount:0,currentPage:Q}),le=a.useMemo(()=>H?.pages.flatMap(e=>e.articles)||[],[H]),{data:ne}=f(le),oe=U||J,ce=B?.name||"Autor";return x.authorPages?oe?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(h,{}),e.jsx("div",{className:"container mx-auto xl:mx-0 xl:ml-4 px-4 py-20 flex items-center justify-center max-w-[1600px]",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"inline-block h-12 w-12 animate-spin rounded-full border-4 border-solid border-primary border-r-transparent mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"Autor wird geladen..."})]})})]}):B||oe?e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(b,{title:`${ce} - Alle Artikel`,description:B?.bio||`Alle Artikel von ${ce} auf exxpress. ${B?.article_count||0} Beiträge zu aktuellen Themen.`,canonical:`/autor/${m}/`,ogType:"website",alternateLanguages:[]}),e.jsx(h,{}),e.jsx("main",{className:"container mx-auto xl:mx-0 xl:ml-4 px-4 py-8 max-w-[1600px]",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8",children:[e.jsxs("div",{className:"lg:col-span-9",children:[re&&e.jsx("div",{className:"mb-6 md:mb-8",children:e.jsx(X,{slot:"adnz_wideboard_1",format:"wideboard",eager:!0})}),e.jsx("nav",{"aria-label":"Breadcrumb",className:"mb-8",children:e.jsxs("ol",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("li",{children:e.jsxs(r,{to:"/",className:"hover:text-foreground transition-colors flex items-center gap-1",children:[e.jsx(M,{className:"h-4 w-4"}),"Home"]})}),e.jsx(D,{className:"h-4 w-4"}),e.jsx("li",{children:e.jsx(r,{to:"/autoren/",className:"hover:text-foreground transition-colors",children:"Autoren"})}),e.jsx(D,{className:"h-4 w-4"}),e.jsx("li",{className:"text-foreground font-medium",children:ce})]})}),e.jsxs("header",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-start gap-6",children:[e.jsxs(P,{className:"h-20 w-20 sm:h-24 sm:w-24 border-2 border-primary/20",children:[e.jsx(z,{src:B?.avatar_url?Y(B.avatar_url):void 0,alt:ce,className:"object-cover"}),e.jsx(T,{className:"bg-primary/10 text-primary text-xl sm:text-2xl",children:ce.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2)})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-bold mb-1",children:ce}),e.jsx("p",{className:"text-muted-foreground mb-2",children:B?.job_title||"Journalist bei exxpress"}),e.jsx("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(K,{className:"h-4 w-4"}
1),B?.article_count||0," Artikel"]})}),e.jsx(ie,{links:B?.social_links??[],authorName:ce})]})]}),B?.bio&&e.jsxs("div",{className:"mt-5 max-w-3xl rounded-lg border border-border border-l-4 border-l-primary/50 bg-muted/30 p-4 sm:p-5",children:[e.jsx("p",{className:"text-sm sm:text-[0.95rem] leading-relaxed text-muted-foreground whitespace-pre-line "+(B.bio.length>350&&!L?"line-clamp-4":""),children:B.bio}),B.bio.length>350&&e.jsx("button",{type:"button",onClick:()=>O(e=>!e),className:"mt-2 text-sm font-medium text-primary hover:underline",children:L?"Weniger anzeigen":"Mehr anzeigen"})]})]}),e.jsx(te,{categories:E,selectedCategory:g,onCategoryChange:C,sortOrder:$,onSortChange:I,totalCount:B?.article_count}),!re&&e.jsx("div",{className:"my-4",children:e.jsx(X,{slot:"adnz_wideboard_1",format:"wideboard",eager:!0})}),le.length>0?e.jsxs("div",{className:"bg-card rounded-lg border border-border p-4 sm:p-6",children:[e.jsxs("h2",{className:"sr-only",children:["Alle Artikel von ",ce]}),le.map(a=>e.jsx("div",{children:e.jsx(se,{article:a,commentCount:ne?.[a.id.toString()]})},a.id)),e.jsx("div",{ref:Z,className:"py-4",children:V&&e.jsxs("div",{className:"flex items-center justify-center gap-2 text-muted-foreground",children:[e.jsx(R,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:"Weitere Artikel werden geladen..."})]})}),G&&!V&&Q>=0&&e.jsx("div",{className:"py-4 flex justify-center",children:e.jsxs(S,{onClick:()=>W(),variant:"outline",size:"lg",className:"gap-2",children:[e.jsx(q,{className:"h-4 w-4"}),"Mehr Artikel laden"]})}),!G&&le.length>12&&e.jsx("div",{className:"py-4 flex justify-center",children:e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Alle ",le.length," Artikel geladen"]})})]}):e.jsxs("div",{className:"text-center py-20 bg-card rounded-lg border border-border",children:[e.jsx("p",{className:"text-xl text-muted-foreground",children:"all"!==g?"Keine Artikel in dieser Kategorie.":"Noch keine Artikel von diesem Autor."}),"all"!==g&&e.jsx(S,{variant:"link",onClick:()=>C("all"),className:"mt-2",children:"Alle Kategorien anzeigen"})]})]}),e.jsx("aside",{className:"lg:col-span-3 hidden lg:block","aria-label":"Seitenleiste",role:"complementary",children:e.jsx("div",{className:"sticky z-10",style:{to
1p:"calc(var(--header-h, 120px) + 8px)"},children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-[300px] flex-shrink-0",children:e.jsx(X,{slot:"adnz_halfpage_1",format:"halfpage",eager:!0})}),e.jsx("div",{className:"hidden min-[1920px]:block w-[300px] flex-shrink-0",children:e.jsx(X,{slot:"adnz_halfpage_2",format:"halfpage",eager:!0})})]})})})]})}),e.jsx(N,{}),e.jsx(p,{})]}):e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(b,{title:"Autor nicht gefunden",description:"Der gesuchte Autor wurde nicht gefunden."}),e.jsx(h,{}),e.jsx("main",{className:"container mx-auto px-4 py-20 max-w-[1600px]",children:e.jsxs("div",{className:"text-center",children:[e.jsx(F,{className:"h-16 w-16 mx-auto text-muted-foreground mb-4"}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Autor nicht gefunden"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Der gesuchte Autor existiert nicht oder hat noch keine Artikel veröffentlicht."}),e.jsx(r,{to:"/",className:"text-primary hover:underline",children:"Zurück zur Startseite"})]})}),e.jsx(p,{})]}):e.jsx(t,{to:"/404/",replace:!0})};export{ne 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.