Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m46s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m49s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m7s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m8s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m51s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m29s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m12s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m11s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m33s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 line
No EOL
16 KiB
JavaScript
1 line
No EOL
16 KiB
JavaScript
import{D as e,E as t,Ht as n,On as r,Yt as i,Zn as a,_ as o,b as s,bt as c,ct as l,er as u,mt as d,o as f,qt as p,tr as m,tt as h,v as g,vn as _,wt as v,y}from"./runtime-core.esm-bundler-B8D2lM98.js";import{C as b,w as x,x as S}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{t as C}from"./createLucideIcon-VlaMqNX_.js";import{t as w}from"./arrow-left-DROE4wuA.js";import{n as T,t as E}from"./message-circle-C0OAlJBT.js";import{t as D}from"./link-2-Cy2KvWtg.js";import{t as ee}from"./loader-circle-Wr6tQn-J.js";import{t as O}from"./pen-line-B1UtLKH3.js";import{t as k}from"./send-B_gp9Kto.js";import{t as te}from"./trash-CONUPzoz.js";import{C as A,I as j,It as M,M as N,Qt as P,dn as F,in as I,k as L,m as R,mn as z,pn as ne,rn as B,rt as V}from"./app-odFgXnck.js";import{t as H}from"./PageContent-DFl6pRYQ.js";var re=C({name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]}),ie=C({name:`reply`,size:24,node:[[`path`,{d:`M20 18v-2a4 4 0 0 0-4-4H4`,key:`5vmcpk`}],[`path`,{d:`m9 17-5-5 5-5`,key:`nvlc11`}]]}),ae={id:`kommentare`,class:`rounded-xl border bg-card p-6 shadow-xs sm:p-8`,"aria-labelledby":`kommentare-titel`},oe={id:`kommentare-titel`,class:`flex items-center gap-2 text-lg font-semibold`},se={key:0,class:`rounded-pill bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground tabular-nums`},U={class:`min-w-0 flex-1`},W=[`maxlength`,`onKeydown`],G={key:0,class:`mt-1 text-[13px] text-destructive`},K={key:1,class:`mt-2 flex items-center justify-end gap-3`},ce={key:1,class:`mt-4 rounded-md bg-muted px-3 py-2 text-[13px] text-muted-foreground`},le={key:2,class:`mt-6 text-sm text-muted-foreground`},ue={class:`mt-6 grid gap-6`},de=[`id`],fe={class:`min-w-0 flex-1`},pe={key:0,class:`py-1 text-sm text-muted-foreground italic`},me={class:`rounded-lg bg-muted/60 px-3.5 py-2.5`},he={class:`flex flex-wrap items-baseline gap-x-2 text-[13px]`},ge={class:`font-semibold`},_e={key:0,class:`text-muted-foreground`},ve={key:0,class:`mt-0.5 flex items-center gap-1 text-xs text-muted-foreground`},ye=[`onSubmit`],be=[`maxlength`],xe={class:`mt-2 flex justify-end gap-2`},Se={key:2,class:`mt-1 text-sm leading-relaxed break-words whitespace-pre-line`},Ce={class:`mt-1 flex flex-wrap items-center gap-x-3 px-1 text-xs text-muted-foreground`},we=[`datetime`,`title`],Te={key:0},Ee=[`onClick`],De=[`onClick`],Oe=[`onClick`],ke={class:`min-w-0 flex-1`},Ae={class:`mb-1 text-xs text-muted-foreground`},je=[`id`,`maxlength`,`onKeydown`],Me={key:0,class:`mt-1 text-[13px] text-destructive`},Ne={class:`mt-2 flex justify-end gap-2`},q={__name:`NewsComments`,props:{postSlug:{type:String,required:!0},comments:{type:Object,required:!0}},setup(n){let u=n,v=ne(),C=v.props.auth?.user,w=_(``),D=_(!1),O=_({}),A=_(null),j=_(``),M=_(null),N=_(``),P=new Intl.RelativeTimeFormat(`de-DE`,{numeric:`auto`}),F=new Intl.DateTimeFormat(`de-DE`,{dateStyle:`medium`,timeStyle:`short`});function I(e){let t=(new Date(e)-new Date)/1e3,n=[[60,`second`],[60,`minute`],[24,`hour`],[7,`day`]],r=t;for(let[e,t]of n){if(Math.abs(r)<e)return P.format(Math.round(r),t);r/=e}return F.format(new Date(e))}function B(e,t){D.value=!0,z.post(`/neuigkeiten/${u.postSlug}/kommentare`,e,{preserveScroll:!0,only:[`comments`,`flash`],onError:e=>O.value=e,onSuccess:()=>{O.value={},t();let e=v.props.flash?.comment;e&&h(()=>Z(e))},onFinish:()=>D.value=!1})}function V(){w.value.trim()&&B({body:w.value},()=>w.value=``)}function H(e){M.value=null,A.value=e,j.value=``,h(()=>document.getElementById(`antwort-${e.id}`)?.focus())}function q(){j.value.trim()&&B({body:j.value,parent_id:A.value.id},()=>{A.value=null,j.value=``})}function J(e){A.value=null,M.value=e.id,N.value=e.body}function Y(e){z.put(`/kommentare/${e.id}`,{body:N.value},{preserveScroll:!0,only:[`comments`,`flash`],onSuccess:()=>M.value=null})}function X(e){window.confirm(`Kommentar löschen?`)&&z.delete(`/kommentare/${e.id}`,{preserveScroll:!0,only:[`comments`,`flash`]})}function Z(e){let t=document.getElementById(`kommentar-${e}`);t&&(t.scrollIntoView({behavior:`smooth`,block:`center`}),t.classList.add(`ring-2`,`ring-brand/40`),setTimeout(()=>t.classList.remove(`ring-2`,`ring-brand/40`),2e3))}l(()=>{let e=window.location.hash.match(/^#kommentar-(\d+)$/);e&&setTimeout(()=>Z(e[1]),300)});let Q=e=>{e.target.style.height=`auto`,e.target.style.height=`${e.target.scrollHeight}px`};return(l,u)=>(d(),s(`section`,ae,[o(`h2`,oe,[e(r(E),{class:`size-5 text-brand-text`}),u[6]||=t(` Kommentare `,-1),n.comments.count?(d(),s(`span`,se,m(n.comments.count),1)):y(``,!0)]),n.comments.enabled?(d(),s(`form`,{key:0,class:`mt-5 flex gap-3`,onSubmit:x(V,[`prevent`])},[r(C)?(d(),g(L,{key:0,person:r(C),class:`size-9 shrink-0`},null,8,[`person`])):y(``,!0),o(`div`,U,[i(o(`textarea`,{"onUpdate:modelValue":u[0]||=e=>w.value=e,rows:`2`,maxlength:n.comments.max,placeholder:`Was meinen Sie dazu?`,"aria-label":`Kommentar schreiben`,class:`w-full resize-none rounded-lg border border-input bg-background px-3 py-2 text-sm leading-relaxed focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`,onInput:Q,onKeydown:[b(x(V,[`ctrl`]),[`enter`]),b(x(V,[`meta`]),[`enter`])]},null,40,W),[[S,w.value]]),O.value.body&&!A.value?(d(),s(`p`,G,m(O.value.body),1)):y(``,!0),w.value.trim()?(d(),s(`div`,K,[u[8]||=o(`span`,{class:`text-xs text-muted-foreground`},`Strg + Enter zum Senden`,-1),e(r(R),{type:`submit`,size:`sm`,disabled:D.value},{default:p(()=>[D.value?(d(),g(r(ee),{key:0,class:`animate-spin`})):(d(),g(r(k),{key:1})),u[7]||=t(` Kommentieren`,-1)]),_:1},8,[`disabled`])])):y(``,!0)])],32)):(d(),s(`p`,ce,`Die Kommentare zu diesem Beitrag sind geschlossen.`)),!n.comments.threads.length&&n.comments.enabled?(d(),s(`p`,le,`Noch keine Kommentare – schreiben Sie den ersten.`)):y(``,!0),o(`ol`,ue,[(d(!0),s(f,null,c(n.comments.threads,l=>(d(),s(`li`,{key:l.id},[(d(!0),s(f,null,c([l,...l.replies],(c,l)=>(d(),s(`article`,{key:c.id,id:`kommentar-${c.id}`,class:a([`flex gap-3 rounded-lg transition-shadow`,l>0?`mt-4 ml-6 sm:ml-12`:``])},[c.author?(d(),g(L,{key:0,person:c.author,class:a([l>0?`size-8`:`size-9`,`shrink-0`])},null,8,[`person`,`class`])):(d(),s(`span`,{key:1,class:a([`grid shrink-0 place-items-center rounded-full bg-muted text-muted-foreground`,l>0?`size-8`:`size-9`])},[e(r(E),{class:`size-4`})],2)),o(`div`,fe,[c.deleted?(d(),s(`p`,pe,`Dieser Kommentar wurde gelöscht.`)):(d(),s(f,{key:1},[o(`div`,me,[o(`p`,he,[o(`span`,ge,m(c.author?.name??`Ehemalige Person`),1),c.author?.department?(d(),s(`span`,_e,m(c.author.department),1)):y(``,!0)]),c.reply_to?(d(),s(`p`,ve,[e(r(T),{class:`size-3`}),t(` Antwort an `+m(c.reply_to),1)])):y(``,!0),M.value===c.id?(d(),s(`form`,{key:1,class:`mt-2`,onSubmit:x(e=>Y(c),[`prevent`])},[i(o(`textarea`,{"onUpdate:modelValue":u[1]||=e=>N.value=e,rows:`3`,maxlength:n.comments.max,class:`w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/30`,"aria-label":`Kommentar bearbeiten`},null,8,be),[[S,N.value]]),o(`div`,xe,[e(r(R),{type:`button`,size:`sm`,variant:`ghost`,onClick:u[2]||=e=>M.value=null},{default:p(()=>[...u[9]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(R),{type:`submit`,size:`sm`,disabled:!N.value.trim()},{default:p(()=>[...u[10]||=[t(`Speichern`,-1)]]),_:1},8,[`disabled`])])],40,ye)):(d(),s(`p`,Se,m(c.body),1))]),o(`div`,Ce,[o(`time`,{datetime:c.created_at,title:r(F).format(new Date(c.created_at))},m(I(c.created_at)),9,we),c.edited?(d(),s(`span`,Te,`bearbeitet`)):y(``,!0),n.comments.enabled?(d(),s(`button`,{key:1,type:`button`,class:`inline-flex items-center gap-1 font-medium hover:text-foreground`,onClick:e=>H(c)},[e(r(ie),{class:`size-3.5`}),u[11]||=t(` Antworten`,-1)],8,Ee)):y(``,!0),c.can.edit?(d(),s(`button`,{key:2,type:`button`,class:`inline-flex items-center gap-1 hover:text-foreground`,onClick:e=>J(c)},[e(r(re),{class:`size-3`}),u[12]||=t(` Bearbeiten`,-1)],8,De)):y(``,!0),c.can.delete?(d(),s(`button`,{key:3,type:`button`,class:`inline-flex items-center gap-1 hover:text-destructive`,onClick:e=>X(c)},[e(r(te),{class:`size-3`}),u[13]||=t(` Löschen`,-1)],8,Oe)):y(``,!0)])],64))])],10,de))),128)),A.value&&[l.id,...l.replies.map(e=>e.id)].includes(A.value.id)?(d(),s(`form`,{key:0,class:`mt-3 ml-6 flex gap-3 sm:ml-12`,onSubmit:x(q,[`prevent`])},[r(C)?(d(),g(L,{key:0,person:r(C),class:`size-8 shrink-0`},null,8,[`person`])):y(``,!0),o(`div`,ke,[o(`p`,Ae,`Antwort an `+m(A.value.author?.name),1),i(o(`textarea`,{id:`antwort-${A.value.id}`,"onUpdate:modelValue":u[3]||=e=>j.value=e,rows:`2`,maxlength:n.comments.max,class:`w-full resize-none rounded-lg border border-input bg-background px-3 py-2 text-sm focus-visible:border-brand-400 focus-visible:ring-3 focus-visible:ring-ring/30 focus-visible:outline-none`,"aria-label":`Antwort schreiben`,onInput:Q,onKeydown:[b(x(q,[`ctrl`]),[`enter`]),b(x(q,[`meta`]),[`enter`]),u[4]||=b(e=>A.value=null,[`esc`])]},null,40,je),[[S,j.value]]),O.value.body?(d(),s(`p`,Me,m(O.value.body),1)):y(``,!0),o(`div`,Ne,[e(r(R),{type:`button`,size:`sm`,variant:`ghost`,onClick:u[5]||=e=>A.value=null},{default:p(()=>[...u[14]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(R),{type:`submit`,size:`sm`,disabled:D.value||!j.value.trim()},{default:p(()=>[e(r(k)),u[15]||=t(` Antworten`,-1)]),_:1},8,[`disabled`])])])],32)):y(``,!0)]))),128))])]))}},J={class:`fixed inset-x-0 top-0 z-50 h-1 bg-transparent`,"aria-hidden":`true`},Y={class:`mb-4 flex items-center justify-between gap-4`},X={class:`relative isolate overflow-hidden rounded-xl bg-brand text-white shadow-sm`},Z=[`src`,`alt`],Q={key:1,class:`absolute inset-0 -z-10 bg-gradient-to-t from-black/85 via-black/45 to-black/5`},Pe={key:2,class:`absolute inset-0 -z-10 opacity-20 [background-image:radial-gradient(circle_at_85%_15%,white_0,transparent_45%),radial-gradient(circle_at_10%_110%,white_0,transparent_40%)]`},Fe={class:`flex min-h-[260px] flex-col justify-end gap-3 p-6 sm:min-h-[360px] sm:p-10 lg:min-h-[420px]`},Ie={key:0,class:`w-fit rounded-pill bg-white/15 px-3 py-1 text-[11px] font-semibold tracking-wider uppercase ring-1 ring-white/30 backdrop-blur`},Le={class:`max-w-4xl text-3xl leading-tight font-semibold tracking-tight text-balance sm:text-4xl lg:text-[44px]`},Re={key:1,class:`max-w-3xl text-base leading-relaxed text-white/85 sm:text-lg`},ze={class:`mt-2 flex flex-wrap items-center gap-x-5 gap-y-2 text-sm text-white/80`},Be={class:`inline-flex items-center gap-1.5`},Ve={class:`inline-flex items-center gap-1.5`},He={key:0,href:`#kommentare`,class:`inline-flex items-center gap-1.5 hover:text-white`},Ue={class:`mt-6 grid gap-6 lg:grid-cols-12`},We={class:`grid min-w-0 grid-cols-1 content-start gap-6 lg:col-span-8`},Ge={key:0,class:`mb-8 flex items-center gap-3 border-b pb-6 lg:hidden`},Ke={class:`min-w-0 text-sm`},qe={key:0,class:`text-muted-foreground`},Je=[`innerHTML`],$={class:`mt-10 flex flex-wrap items-center gap-2 border-t pt-6`},Ye=[`href`],Xe={class:`grid content-start gap-6 lg:col-span-4`},Ze={key:0,class:`rounded-xl border bg-card p-5 shadow-xs`},Qe={class:`min-w-0`},$e={class:`block font-semibold`},et={key:0,class:`block text-[13px] text-muted-foreground`},tt={key:1,class:`rounded-xl border bg-card p-5 shadow-xs lg:sticky lg:top-20`},nt={class:`grid gap-1`},rt=[`src`],it={key:1,class:`grid h-16 w-20 shrink-0 place-items-center rounded-md bg-brand-soft text-brand-text`},at={class:`min-w-0`},ot={key:0,class:`block text-[10px] font-semibold tracking-wider text-accent2-text uppercase`},st={class:`line-clamp-2 text-sm leading-snug font-medium group-hover:underline`},ct={class:`block text-xs text-muted-foreground`},lt={__name:`Show`,props:{post:{type:Object,required:!0},related:{type:Object,required:!0},editUrl:{type:String,default:null},form:{type:Object,default:null},content:{type:Object,default:null},comments:{type:Object,default:null}},setup(i){let a=i,l=_(null),h=_(0),{y:b}=V();n(b,()=>{let e=l.value;if(!e)return;let t=e.getBoundingClientRect(),n=t.height-window.innerHeight*.6;h.value=Math.min(100,Math.max(0,-t.top/Math.max(n,1)*100))});let x=_(!1);async function S(){try{await navigator.clipboard.writeText(window.location.href),x.value=!0,setTimeout(()=>x.value=!1,2e3)}catch{window.prompt(`Link zum Beitrag:`,window.location.href)}}let C=e=>[e?.department,e?.job_title].filter(Boolean).join(` | `),T=()=>`mailto:?subject=${encodeURIComponent(a.post.title)}&body=${encodeURIComponent(window.location.href)}`;return(n,a)=>(d(),g(A,{title:i.post.title},{default:p(()=>[o(`div`,J,[o(`div`,{class:`h-full bg-brand transition-[width] duration-150`,style:u({width:`${h.value}%`})},null,4)]),o(`div`,Y,[e(r(F),{href:`/neuigkeiten`,class:`inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground`},{default:p(()=>[e(r(w),{class:`size-4`}),a[0]||=t(` Alle Neuigkeiten `,-1)]),_:1}),i.editUrl?(d(),g(r(R),{key:0,variant:`outline`,size:`sm`,"as-child":``},{default:p(()=>[e(r(F),{href:i.editUrl},{default:p(()=>[e(r(O)),a[1]||=t(` Bearbeiten`,-1)]),_:1},8,[`href`])]),_:1})):y(``,!0)]),o(`header`,X,[i.post.cover_url?(d(),s(`img`,{key:0,src:i.post.cover_url,alt:i.post.title,class:`absolute inset-0 -z-10 size-full object-cover`},null,8,Z)):y(``,!0),i.post.cover_url?(d(),s(`div`,Q)):(d(),s(`div`,Pe)),o(`div`,Fe,[i.post.category?(d(),s(`span`,Ie,m(i.post.category.name),1)):y(``,!0),o(`h1`,Le,m(i.post.title),1),i.post.teaser?(d(),s(`p`,Re,m(i.post.teaser),1)):y(``,!0),o(`div`,ze,[o(`span`,Be,[e(r(I),{class:`size-4`}),t(` `+m(r(N)(i.post.published_at)),1)]),o(`span`,Ve,[e(r(P),{class:`size-4`}),t(` `+m(i.post.reading_minutes)+` Min. Lesezeit`,1)]),i.comments?.count?(d(),s(`a`,He,[e(r(E),{class:`size-4`}),t(` `+m(i.comments.count)+` `+m(i.comments.count===1?`Kommentar`:`Kommentare`),1)])):y(``,!0)])])]),o(`div`,Ue,[o(`div`,We,[o(`article`,{ref_key:`article`,ref:l,class:`min-w-0 rounded-xl border bg-card p-6 shadow-xs sm:p-10`},[i.post.author?(d(),s(`div`,Ge,[e(L,{person:i.post.author,class:`size-11`},null,8,[`person`]),o(`div`,Ke,[e(r(F),{href:`/personen/${i.post.author.id}`,class:`font-semibold hover:underline`},{default:p(()=>[t(m(i.post.author.name),1)]),_:1},8,[`href`]),C(i.post.author)?(d(),s(`p`,qe,m(C(i.post.author)),1)):y(``,!0)])])):y(``,!0),i.content?(d(),g(H,{key:1,content:i.content},null,8,[`content`])):(d(),s(`div`,{key:2,class:`prose prose-neutral max-w-none prose-headings:tracking-tight prose-h2:mt-10 prose-a:text-brand-text prose-blockquote:border-l-brand prose-blockquote:bg-brand-soft/50 prose-blockquote:py-1 prose-blockquote:not-italic prose-img:rounded-lg dark:prose-invert first-of-type:prose-p:text-lg`,innerHTML:i.post.body_html},null,8,Je)),i.form?(d(),g(H,{key:3,content:i.form,class:`mt-10`},null,8,[`content`])):y(``,!0),o(`footer`,$,[a[3]||=o(`span`,{class:`mr-2 text-sm text-muted-foreground`},`Beitrag teilen:`,-1),e(r(R),{variant:`outline`,size:`sm`,onClick:S},{default:p(()=>[(d(),g(v(x.value?r(B):r(D)))),t(` `+m(x.value?`Link kopiert`:`Link kopieren`),1)]),_:1}),e(r(R),{variant:`outline`,size:`sm`,"as-child":``},{default:p(()=>[o(`a`,{href:T()},[e(r(M)),a[2]||=t(` Per E-Mail`,-1)],8,Ye)]),_:1})])],512),i.comments?(d(),g(q,{key:0,"post-slug":i.post.slug,comments:i.comments},null,8,[`post-slug`,`comments`])):y(``,!0)]),o(`aside`,Xe,[i.post.author?(d(),s(`section`,Ze,[a[4]||=o(`h2`,{class:`mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase`},`Geschrieben von`,-1),e(r(F),{href:`/personen/${i.post.author.id}`,class:`flex items-center gap-3 rounded-lg p-1 hover:bg-accent/50`},{default:p(()=>[e(L,{person:i.post.author,class:`size-14`},null,8,[`person`]),o(`span`,Qe,[o(`span`,$e,m(i.post.author.name),1),C(i.post.author)?(d(),s(`span`,et,m(C(i.post.author)),1)):y(``,!0)])]),_:1},8,[`href`])])):y(``,!0),i.related.data.length?(d(),s(`section`,tt,[a[6]||=o(`h2`,{class:`mb-3 text-xs font-semibold tracking-wider text-muted-foreground uppercase`},`Weitere Beiträge`,-1),o(`ul`,nt,[(d(!0),s(f,null,c(i.related.data,t=>(d(),s(`li`,{key:t.id},[e(r(F),{href:`/neuigkeiten/${t.slug}`,class:`group flex gap-3 rounded-lg p-2 hover:bg-accent/50`},{default:p(()=>[t.thumb_url?(d(),s(`img`,{key:0,src:t.thumb_url,alt:``,loading:`lazy`,class:`h-16 w-20 shrink-0 rounded-md object-cover`},null,8,rt)):(d(),s(`span`,it,[e(r(I),{class:`size-5`})])),o(`span`,at,[t.category?(d(),s(`span`,ot,m(t.category.name),1)):y(``,!0),o(`span`,st,m(t.title),1),o(`span`,ct,m(r(j)(t.published_at)),1)])]),_:2},1032,[`href`])]))),128))]),e(r(F),{href:`/neuigkeiten`,class:`mt-3 block border-t pt-3 text-[13px] font-medium text-brand-text hover:underline`},{default:p(()=>[...a[5]||=[t(`Alle Neuigkeiten`,-1)]]),_:1})])):y(``,!0)])])]),_:1},8,[`title`]))}};export{lt as default}; |