import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{ct as t,ki as n,sr as r}from"./lucide-icons-BjbcRgLk.js";import{t as i}from"./jsx-runtime-By8HlURe.js";import{t as a}from"./useAppContext-ZpOJAKgd.js";import{t as o}from"./utils-BFSTDHdM.js";import{t as s}from"./button-PfnADMEc.js";import{t as c}from"./contentWarning-CNDzjeMP.js";var l=e(n(),1),u=i();function d({event:e,children:n,className:i}){let{config:d}=a(),[f,p]=(0,l.useState)(!1),m=c(e);if(m===void 0)return(0,u.jsx)(u.Fragment,{children:n});let h=d.contentWarningPolicy;return h===`show`?(0,u.jsx)(u.Fragment,{children:n}):h===`hide`?null:f?(0,u.jsx)(u.Fragment,{children:n}):(0,u.jsxs)(`div`,{className:o(`relative mt-2 rounded-xl overflow-hidden`,i),children:[(0,u.jsxs)(`div`,{className:`bg-muted/40 blur-lg select-none`,"aria-hidden":!0,children:[(0,u.jsxs)(`div`,{className:`px-4 pt-4 pb-2 space-y-2.5`,children:[(0,u.jsx)(`div`,{className:`h-3.5 w-full rounded bg-muted/60`}),(0,u.jsx)(`div`,{className:`h-3.5 w-4/5 rounded bg-muted/60`}),(0,u.jsx)(`div`,{className:`h-3.5 w-3/5 rounded bg-muted/60`})]}),(0,u.jsx)(`div`,{className:`mx-4 mb-4 mt-1 h-32 rounded-lg bg-muted/60`})]}),(0,u.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center gap-2.5 px-4 text-center`,children:[(0,u.jsx)(`div`,{className:`flex items-center justify-center size-10 rounded-full bg-background/80 shadow-sm backdrop-blur-sm`,children:(0,u.jsx)(t,{className:`size-5 text-muted-foreground`})}),(0,u.jsxs)(`div`,{className:`space-y-1 max-w-xs`,children:[(0,u.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:`Content Warning`}),m?(0,u.jsxs)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:[`“`,m,`”`]}):(0,u.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:`The author flagged this post as sensitive.`})]}),(0,u.jsxs)(s,{variant:`outline`,size:`sm`,className:`gap-1.5 mt-0.5 rounded-full px-5 bg-background/80 backdrop-blur-sm`,onClick:e=>{e.stopPropagation(),p(!0)},children:[(0,u.jsx)(r,{className:`size-3.5`}),`Show Content`]})]})]})}var f=24*3600;function p(e){let t=e.tags.find(([e])=>e===`status`)?.[1]??`ended`;return t===`live`&&Math.floor(Date.now()/1e3)-e.created_at>f?`ended`:t}export{d as n,p as t};