PageSourceSearch

https://radreport.com.br/assets/BlogPost-BTbS0L6v.js

js radreport.com.br collected 2026-09-24 14:35:28 UTC 30,394 bytes, 1 lines download raw bytes

1import{a as ce,u as xe,b as X,j as e}from"./vendor-query-skQMsM6X.js";import{r as F,d as ue,L as V}from"./vendor-react-DyYvSSk1.js";import{u as Y,b as $,b4 as U,p as E,aU as ge,bL as he,aV as je,ab as M,ai as H,H as be,ah as W,bU as fe}from"./index-BGwtrXIa.js";import{B as ye}from"./appConfig-Ba44p7fe.js";import{u as _e,B as ve}from"./BlogPageLayout-B3h0t0e-.js";import{C as Ne,a as we,b as Ce}from"./collapsible-CSslgSh4.js";import{u as ke,g as Se,C as Ae,A as Fe,B as ae}from"./blogSectionIcons-ClfI08sH.js";import{e as Ee}from"./useBlogPosts-JkifSc8P.js";import{r as ne}from"./markdownRenderer-Cd4_jKV_.js";import{S as Re}from"./SocialShareMenu-C_v-z9-f.js";import{T as De}from"./textarea-ChvLdc2s.js";import{m as Le,d8 as $e,bt as de,u as Te,aC as Be,o as Me,bg as re,aa as Ie,ab as ie,a as qe,ac as oe,ae as Oe,af as le,ck as Ue}from"./vendor-ui-CCmu0bzQ.js";import{f as ze}from"./formatDistanceToNow-BkZWDsIJ.js";import{p as He}from"./pt-BR-0bEujIJO.js";import{R as Ke}from"./RevealHeadline-M-6fVdvF.js";import"./vendor-supabase-BfoV2C50.js";import"./portal-B_595Tc2.js";import"./imageCompression-DJQX-S_h.js";import"./edgeFunctionClient-4dcAKx2Z.js";import"./errorTranslations-lTGRyFpS.js";import"./sessionTelemetry-X-Vnv8Qs.js";function Qe(r){const{user:t}=Y(),p=ce(),[u,y]=F.useState("popular"),g=["blog-comments",r,u],{data:j=[],isLoading:w}=xe({queryKey:g,queryFn:async()=>{if(!r)return[];const{data:m,error:l}=await $.from("blog_comments").select("*").eq("post_id",r).eq("is_hidden",!1).order(u==="popular"?"upvotes_count":"created_at",{ascending:!1});if(l)throw l;if(!(m!=null&&m.length))return[];const _=[...new Set(m.map(d=>
1d.user_id))],{data:k}=await $.from("profiles").select("id, full_name, crm, public_id, avatar_url, visibility_settings").in("id",_),I=new Map((k==null?void 0:k.map(d=>[d.id,d]))||[]);let K=new Set;if(t!=null&&t.id){const{data:d}=await $.from("blog_comment_upvotes").select("comment_id").eq("user_id",t.id).in("comment_id",m.map(o=>o.id));K=new Set((d==null?void 0:d.map(o=>o.comment_id))||[])}const G=m.map(d=>{const o=I.get(d.user_id),S=o==null?void 0:o.visibility_settings,B=(S==null?void 0:S.show_crm)!==!1,Q=(S==null?void 0:S.show_avatar_in_comments)!==!1;return{...d,author_name:(o==null?void 0:o.full_name)||"Usuário",author_crm:B&&(o==null?void 0:o.crm)||null,author_public_id:(o==null?void 0:o.public_id)||null,author_avatar:Q&&(o==null?void 0:o.avatar_url)||null,user_has_upvoted:K.has(d.id),replies:[]}}),L=[],T=new Map;for(const d of G)if(d.parent_id){const o=T.get(d.parent_id)||[];o.push(d),T.set(d.parent_id,o)}else L.push(d);u==="popular"?L.sort((d,o)=>o.upvotes_count-d.upvotes_count||new Date(o.created_at).getTime()-new Date(d.created_at).getTime()):L.sort((d,o)=>new Date(o.created_at).getTime()-new Date(d.created_at).getTime());for(const d of L){const o=T.get(d.id)||[];o.sort((S,B)=>new Date(S.created_at).getTime()-new Date(B.created_at).getTime()),d.replies=o}return L},enabled:!!r,staleTime:15e3}),C=X({mutationFn:async({content:m,parentId:l})=>{if(!(t!=null&&t.id))throw new Error("Not authenticated");const{error:_}=await $.from("blog_comments").insert({post_id:r,user_id:t.id,parent_id:l||null,content:m});if(_)throw _},onSuccess:()=>{p.invalidateQueries({queryKey:["blog-comments",r]}),p.invalidateQueries({queryKey:["blog-post"]}),U({title:"Comentário publicado!"})},onError:()=>U({title:"Erro ao publicar comentário",variant:"destructive"})}),h=X({mutationFn:async m=>{const{error:l}=await $.from("blog_comments").delete().eq("id",m);if(l)throw l},onSuccess:()=>{p.invalidateQueries({queryKey:["blog-comments",r]}),p.invalidateQueries({queryKey:["blog-post"]}),U({title:"Comentário removido"})},onError:()=>U({title:"Erro ao remover comentário",variant:"destructive"})}),b=X({mutationFn:async m=>{const{data:l,error:_}=await $.rpc("toggle_comment_upvote",{p_comment_id:m});if(_)throw _;const k=l;if((k==null?void 0:k.error)==="cannot_upvote_own_comment")throw new Error("Você não pode dar upvote no próprio comentário");return l},onSuccess:()=>{p.invalidateQueries({queryKey:["blog-comments",r]})},onError:m=>U({title:m.message||"Erro ao votar",variant:"destructive"})}),v=j.reduce((m,l)=>m+1+l.replies.length,0);return{comments:j,isLoading:w,sortMode:u,setSortMode:y,createComment:C,deleteComment:h,toggleUpvote:b,totalCount:v}}const z=2e3;function me({onSubmit:r,isLoading:t,placeholder:p="Adicione seu comentário...",autoFocus:u,onCancel:y}){const[g,j]=F.useState(""),w=()=>{const h=g.trim();!h||h.length>z||(r(h),j(""))},C=h=>{h.key==="Enter"&&(h.ctrlKey||h.metaKey)&&(h.preventDefault(),w())};return e.jsxs("div",{className:"space-y-2",children:[e.jsx(De,{value:g,onChange:h=>j(h.target.value),onKeyDown:C,placeholder:p,autoFocus:u,className:"min-h-[80px] resize-none",maxLength:z}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:`text-xs ${g.length>z*.9?"text-destructive":"text-muted-foreground"}`,children:[g.length,"/",z]}),e.jsxs("div",{className:"flex gap-2",children:[y&&e.jsx(E,{variant:"ghost",size:"sm",onClick:y,children:"Cancelar"}),e.jsxs(E,{size:"sm",onClick:w,disabled:!g.trim()||g.length>z||t,children:[e.jsx(Le,{className:"h-3.5 w-3.5 mr-1.5"}),"Enviar"]})]})]})]})}function pe({comment:r,onUpvote:t,onReply:p,onDelete:u,isReplyLoading:y,isNested:g}){var m;const{user:j}=Y(),[w,C]=F.useState(!1),h=(r.author_name||"U").split(" ").map(l=>l[0]).slice(0,2).join("").toUpperCase(),b=(j==null?void 0:j.id)===r.user_id,v=ze(new Date(r.created_at),{addSuffix:!0,locale:He});return e.jsx("div",{className:`${g?"ml-8 border-l-2 border-muted pl-4":""}`,children:e.jsxs("div",{className:"flex gap-3 py-3",children:[e.jsxs(ge,{className:"h-8 w-8 flex-shrink-0",children:[e.jsx(he,{src:r.author_avatar||void 0}),e.jsx(je,{className:"text-xs",children:h})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-medium text-sm",children:r.author_name}),r.author_public_id&&e.jsx(M,{variant:"outline",className:"text-[10px] px-1.5 py-0 font-mono",title:"Identificador público anônimo do autor",children:r.author_public_id}),e.jsx("span",{className:"text-xs text-muted-foreground",children:v})]}),e.jsx("p",{className:"text-sm mt-1 whitespace-pre-wrap break-words",children:r.content}),e.jsxs("div",{className:"flex items-center gap-1 mt-2",children:[e.jsxs(E,{variant:"ghost",size:"sm",className:`h-7 px-2 gap-1 ${r.user_has_upvoted?"text-primary":"text-muted-foreground"}`,onClick:()=>t(r.id),disabled:!j||b,title:b?"Não é possível votar no próprio comentário":"",children:[e.jsx($e,{className:`h-4 w-4 ${r.user_has_upvoted?"fill-current":""}`}),e.jsx("span",{className:"text-xs font-medium",children:r.upvotes_count})]}),!g&&j&&e.jsxs(E,{variant:"ghost",size:"sm",className:"h-7 px-2 gap-1 text-muted-foreground",onClick:()=>C(!w),children:[e.jsx(de,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"text-xs",children:"Responder"})]}),b&&e.jsx(E,{variant:"ghost",size:"sm",className:"h-7 px-2 text-muted-foreground hover:text-destructive",onClick:()=>u(r.id),children:e.jsx(Te,{className:"h-3.5 w-3.5"})})]}),w&&e.jsx("div",{className:"mt-2",children:e.jsx(me,{placeholder:"Escreva sua resposta...",autoFocus:!0,isLoading:y,onSubmit:l=>{p(l,r.id),C(!1)},onCancel:()=>C(!1)})}),(m=r.replies)==null?void 0:m.map(l=>
1e.jsx(pe,{comment:l,onUpvote:t,onReply:p,onDelete:u,isNested:!0},l.id))]})]})})}function Ve({postId:r}){const{user:t}=Y(),{comments:p,isLoading:u,sortMode:y,setSortMode:g,createComment:j,deleteComment:w,toggleUpvote:C,totalCount:h}=Qe(r);return e.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-8 print:hidden",children:[e.jsx(H,{className:"mb-6"}),e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{className:"h-5 w-5 text-primary"}),e.jsxs("h3",{className:"text-lg font-semibold",children:["Comentários ",h>0&&e.jsxs("span",{className:"text-muted-foreground font-normal",children:["(",h,")"]})]})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsxs(E,{variant:y==="popular"?"secondary":"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>g("popular"),children:[e.jsx(Be,{className:"h-3.5 w-3.5 mr-1"}),"Populares"]}),e.jsxs(E,{variant:y==="recent"?"secondary":"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>g("recent"),children:[e.jsx(Me,{className:"h-3.5 w-3.5 mr-1"}),"Recentes"]})]})]}),t?e.jsx("div",{className:"mb-6",children:e.jsx(me,{onSubmit:b=>j.mutate({content:b}),isLoading:j.isPending})}):e.jsx("div",{className:"mb-6 p-4 rounded-lg bg-muted/50 text-center text-sm text-muted-foreground",children:"Faça login para participar da discussão."}),u?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(b=>e.jsxs("div",{className:"animate-pulse flex gap-3 py-3",children:[e.jsx("div",{className:"h-8 w-8 rounded-full bg-muted"}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx("div",{className:"h-3 w-32 bg-muted rounded"}),e.jsx("div",{className:"h-4 w-full bg-muted rounded"})]})]},b))}):p.length===0?e.jsx("p",{className:"text-center text-muted-foreground text-sm py-8",children:"Nenhum comentário ainda. Seja o primeiro a comentar!"}):e.jsx("div",{className:"divide-y divide-border",children:p.map(b=>e.jsx(pe,{comment:b,onUpvote:v=>C.mutate(v),onReply:(v,m)=>j.mutate({content:v,parentId:m}),onDelete:v=>w.mutate(v),isReplyLoading:j.isPending},b.id))})]})}function Ye(r){const t=new Set(["de","da","do","dos","das","e"]),p=r.trim().split(/\s+/);if(p.length===0)return"";if(p.length===1)return p[0];const u=p[p.length-1],y=p.slice(0,-1).filter(g=>!t.has(g.toLowerCase())).map(g=>g.charAt(0).toUpperCase()).join("");return`${u} ${y}`}const gt=()=>{var B,Q,Z,P,ee;const{slug:r}=ue(),{data:t,isLoading:p}=Ee(r||""),{data:u=[]}=ke((t==null?void 0:t.id)||""),{liked:y,toggleLike:g,isLoading:j}=_e((t==null?void 0:t.id)||"");Y();const w=ce(),[C,h]=F.useState(""),b=F.useRef(null);F.useEffect(()=>{if(t!=null&&t.id&&(t==null?void 0:t.status)==="published"){const s=`viewed-post-${t.id}`;sessionStorage.getItem(s)||$.rpc("increment_blog_post_views",{post_id:t.id}).then(()=>{sessionStorage.setItem(s,"1"),w.invalidateQueries({queryKey:["blog-post",r]})})}},[t==null?void 0:t.id,t==null?void 0:t.status,r,w]);const v=Array.isArray(t==null?void 0:t.content_sections)?t.content_sections:[],m=v.length===1&&((B=v[0])==null?void 0:B.type)==="rich_body",l=v.filter(s=>s.content),_=(t==null?void 0:t.type)==="caso",k=F.useCallback(()=>(b.current&&b.current.disconnect(),b.current=new IntersectionObserver(s=>{for(const i of s)i.isIntersecting&&h(i.target.id)},{rootMargin:"-80px 0px -60% 0px",threshold:0}),l.forEach(s=>{const i=document.getElementById(`section-${s.type}`);i&&b.current.observe(i)}),()=>{var s;return(s=b.current)==null?void 0:s.disconnect()}),[l]);F.useEffect(()=>{if(l.length>0)return k()},[k,l.length]);const I=`${ye}/${r}`,K=["RadReport","Radiologia",...t!=null&&t.modality?[t.modality]:[]],G=s=>{var i;(i=document.getElementById(`section-${s}`))==null||i.scrollIntoView({behavior:"smooth",block:"start"})};if(p)return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background",children:e.jsx("div",{className:"animate-pulse text-muted-foreground",children:"Carregando..."})});if(!t)return e.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-background gap-4",children:[e.jsx("p",{className:"text-muted-foreground",children:"Publicação não encontrada."}),e.jsx(E,{asChild:!0,children:e.jsx(V,{to:"/diario",children:"← Voltar ao Diário"})})]});const L=t.published_at?new Date(t.published_at).toLocaleDateString("pt-BR",{day:"numeric",month:"long",year:"numeric"}):"",T=l.reduce((s,i)=>{var f;const a=m?((f=i.content)==null?void 0:f.replace(/<[^>]*>/g,""))||"":i.content||"";
1return s+a.split(/\s+/).filter(Boolean).length},0),d=Math.max(1,Math.ceil(T/200)),o=Se(t.type,l),S={"@context":"https://schema.org","@type":_?"MedicalScholarlyArticle":"Article",headline:t.title,description:t.summary||"",image:t.cover_image_url||void 0,datePublished:t.published_at||void 0,dateModified:t.updated_at||void 0,wordCount:T,timeRequired:`PT${d}M`,articleSection:t.modality||void 0,author:{"@type":"Person",name:t.author_name||"Anônimo"},publisher:{"@type":"Organization",name:"RadReport",url:"https://radreport.com.br"},mainEntityOfPage:`https://radreport.com.br/diario/${t.slug}`,keywords:((Q=t.tags)==null?void 0:Q.join(", "))||void 0};return e.jsxs(e.Fragment,{children:[e.jsxs(be,{children:[e.jsxs("title",{children:[t.title," | RadReport Diário"]}),e.jsx("meta",{name:"description",content:t.summary||`${t.title} - Publicação de radiologia`}),e.jsx("link",{rel:"canonical",href:I}),e.jsx("meta",{name:"robots",content:"index, follow, max-image-preview:large, max-snippet:-1"}),t.tags&&t.tags.length>0&&e.jsx("meta",{name:"keywords",content:t.tags.join(", ")}),e.jsx("meta",{property:"og:type",content:"article"}),e.jsx("meta",{property:"og:title",content:t.title}),e.jsx("meta",{property:"og:description",content:t.summary||""}),e.jsx("meta",{property:"og:url",content:I}),e.jsx("meta",{property:"og:locale",content:"pt_BR"}),e.jsx("meta",{property:"og:site_name",content:"RadReport"}),t.cover_image_url&&e.jsx("meta",{property:"og:image",content:t.cover_image_url}),t.cover_image_url&&e.jsx("meta",{property:"og:image:width",content:"1200"}),t.cover_image_url&&e.jsx("meta",{property:"og:image:height",content:"630"}),t.published_at&&e.jsx("meta",{property:"article:published_time",content:t.published_at}),t.updated_at&&e.jsx("meta",{property:"article:modified_time",content:t.updated_at}),e.jsx("meta",{property:"article:author",content:t.author_name||"RadReport"}),t.modality&&e.jsx("meta",{property:"article:section",content:t.modality}),(Z=t.tags)==null?void 0:Z.map(s=>e.jsx("meta",{property:"article:tag",content:s},s)),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:t.title}),e.jsx("meta",{name:"twitter:description",content:t.summary||""}),t.cover_image_url&&e.jsx("meta",{name:"twitter:image",content:t.cover_image_url}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify(S)})]}),e.jsx(ve,{children:e.jsxs("article",{className:"bg-background blog-post-print",children:[e.jsx("nav",{className:"max-w-4xl mx-auto px-4 pt-6 pb-2 print:hidden","aria-label":"Breadcrumb",children:e.jsxs("ol",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx("li",{children:e.jsx(V,{to:"/",className:"hover:text-foreground transition-colors",children:"Home"})}),e.jsx("li",{children:e.jsx(re,{className:"h-3 w-3"})}),e.jsx("li",{children:e.jsx(V,{to:"/diario",className:"hover:text-foreground transition-colors",children:"Diário"})}),e.jsx("li",{children:e.jsx(re,{className:"h-3 w-3"})}),e.jsx("li",{className:"text-foreground font-medium truncate max-w-[200px]",children:t.title})]})}),e.jsxs("header",{className:"max-w-4xl mx-auto px-4 pt-4 pb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4 blog-badges-line flex-wrap",children:[e.jsx(M,{className:`uppercase text-[10px] font-bold tracking-wider rounded-sm ${_?"bg-amber-500/90 text-white":"bg-slate-600 text-white"}`,children:_?"Caso Clínico":"Artigo"}),t.modality&&e.jsx(M,{variant:"outline",className:"uppercase text-[10px] font-bold tracking-wider rounded-sm",children:t.modality}),t.body_region&&e.jsx(M,{variant:"outline",className:"text-[10px] rounded-sm",children:t.body_region})]}),e.jsx(Ke,{as:"h1",className:"text-3xl md:text-5xl font-bold leading-[1.1] tracking-tight text-foreground mb-4 text-center",startDelay:80,wordDelay:32,children:t.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground mb-4 blog-metadata-line",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(Ie,{className:"h-4 w-4"}),L]}),e.jsxs("span",{className:"flex items-center gap-1.5 font-medium",children:[e.jsx(ie,{className:"h-4 w-4"}),t.author_name||"Anônimo",(t.author_public_id||((P=t.profiles)==null?void 0:P.public_id))&&e.jsxs("span",{className:"opacity-70 font-mono",title:"Identificador público anônimo do autor",children:["• ",t.author_public_id||((ee=t.profiles)==null?void 0:ee.public_id)]})]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(qe,{className:"h-4 w-4"}),t.views_count," visualizações"]}),e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(oe,{className:"h-4 w-4"}
1),t.likes_count||0," curtidas"]})]}),_&&(t.patient_gender||t.patient_age)&&e.jsxs("p",{className:"text-sm font-medium text-foreground mb-4 print:hidden blog-patient-demographics",children:["🏥 Paciente: ",t.patient_gender==="M"?"Masculino":t.patient_gender==="F"?"Feminino":t.patient_gender==="NI"?"Não informado":"",t.patient_gender&&t.patient_age?", ":"",t.patient_age||""]}),(()=>{var R,q,A,J;const s=Array.isArray(t.coauthors)?t.coauthors:[],i=t.corresponding_author_email,a=t.profiles,f=[{name:t.author_name||"Anônimo",institution:a==null?void 0:a.institution,department:a==null?void 0:a.department,city:a==null?void 0:a.city,state:a==null?void 0:a.state},...s.map(n=>({name:n.name,institution:n.institution,department:n.department,city:n.city,state:n.state}))],N=new Map,D=[],x=[];return f.forEach(n=>{const c=[n.institution,n.department,n.city,n.state].filter(Boolean).join(" | ");c&&!N.has(c)&&(N.set(c,D.length+1),D.push(c)),x.push(c?[N.get(c)]:[])}),e.jsxs(e.Fragment,{children:[(()=>{const n=f.map(O=>Ye(O.name)),c=n.length>3?`${n.slice(0,3).join("; ")} et al.`:n.join("; ");return e.jsxs("div",{className:"print-only print-running-header hidden print:block",children:[e.jsx("span",{className:"print-running-journal",children:"Diário de Radiologia"}),e.jsx("span",{className:"print-running-authors",children:c})]})})(),e.jsxs("div",{className:"print-only print-page-footer hidden print:block",children:[e.jsx("span",{className:"print-footer-license",children:"© CC BY-NC 4.0"}),e.jsxs("span",{className:"print-footer-copyright",children:["© ",new Date(t.published_at||Date.now()).getFullYear()," Diário de Radiologia"]}),e.jsx("span",{className:"print-footer-page"})]}),e.jsxs(Ne,{className:"border border-border rounded-lg bg-muted/20 mb-4 print:hidden",children:[e.jsxs(we,{className:"flex items-center justify-between w-full p-4 cursor-pointer hover:bg-muted/40 transition-colors rounded-lg",children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Dados da Publicação"}),e.jsx(Oe,{className:"h-4 w-4 text-muted-foreground transition-transform duration-200 [[data-state=open]>svg&]:rotate-180"})]}),e.jsxs(Ce,{className:"px-4 pb-4 space-y-2",children:[e.jsxs("div",{className:"text-sm space-y-1",children:[e.jsxs("p",{className:"text-foreground",children:[e.jsx("span",{className:"font-medium",children:t.author_name||"Anônimo"}),(a==null?void 0:a.institution)&&((R=a==null?void 0:a.visibility_settings)==null?void 0:R.show_institution)!==!1&&e.jsxs(e.Fragment,{children:[" — ",a.institution]}),(a==null?void 0:a.department)&&((q=a==null?void 0:a.visibility_settings)==null?void 0:q.show_department)!==!1&&e.jsxs(e.Fragment,{children:[", ",a.department]}),(a==null?void 0:a.city)&&((A=a==null?void 0:a.visibility_settings)==null?void 0:A.show_city)!==!1&&e.jsxs(e.Fragment,{children:[" — ",a.city]}),(a==null?void 0:a.state)&&((J=a==null?void 0:a.visibility_settings)==null?void 0:J.show_state)!==!1&&e.jsxs(e.Fragment,{children:[" (",a.state,")"]}),(t.author_public_id||(a==null?void 0:a.public_id))&&e.jsxs("span",{className:"text-muted-foreground font-mono",children:[" • ",t.author_public_id||(a==null?void 0:a.public_id)]})]}),s.map((n,c)=>e.jsxs("p",{className:"text-foreground",children:[e.jsx("span",{className:"font-medium",children:n.name}),n.institution&&e.jsxs(e.Fragment,{children:[" — ",n.institution]}),n.department&&e.jsxs(e.Fragment,{children:[", ",n.department]}),n.city&&e.jsxs(e.Fragment,{children:[" — ",n.city]}),n.state&&e.jsxs(e.Fragment,{children:[" (",n.state,")"]}),n.email&&e.jsxs("span",{className:"text-muted-foreground",children:[" • ",n.email]})]},c)),i&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[e.jsx("span",{className:"font-medium",children:"Autor correspondente:"})," ",i]})]}),t.tags&&t.tags.length>0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-semibold",children:"Palavras-Chave:"})," ",t.tags.join(", ")]})]})]}),e.jsxs("div",{className:"print-only print-authors-academic hidden print:block mb-4",children:[e.jsx("h3",{className:"print-dados-titulo",children:_?"DADOS DO CASO":"DADOS DA PUBLICAÇÃO"}),e.jsxs("div",{className:"print-dados-content",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Autores: "}),f.map((n,c)=>{var O;return e.jsxs(F.Fragment,{children:[c>0&&e.jsx("br",{}),c===0&&e.jsx(e.Fragment,{children:n.name}),c>0&&e.jsx(e.Fragment,{children:n.name}),n.institution&&e.jsxs(e.Fragment,{children:[" — ",n.institution]}),n.department&&e.jsxs(e.Fragment,{children:[", ",n.department]}),n.city&&e.jsxs(e.Fragment,{children:[" — ",n.city]}),n.state&&e.jsxs(e.Fragment,{children:[" (",n.state,")"]}),c===0&&i&&e.jsxs(e.Fragment,{children:[" — Email: ",i]}),c>0&&((O=s[c-1])==null?void 0:O.email)&&e.jsxs(e.Fragment,{children:[" — Email: ",s[c-1].email]})]},c)})]}),(()=>{const c=(i?f.find((O,te)=>{var se;return te===0||((se=s[te-1])==null?void 0:se.is_corresponding)}):null)||f[0];return i?e.jsxs("p",{className:"mt-1",children:[e.jsx("strong",{children:"Autor correspondente: "}),c.name,c.institution&&e.jsxs(e.Fragment,{children:[" — ",c.institution]}),c.department&&e.jsxs(e.Fragment,{children:[", ",c.department]}),c.city&&e.jsxs(e.Fragment,{children:[" — ",c.city]}),c.state&&e.jsxs(e.Fragment,{children:[" (",c.state,")"]}),i&&e.jsxs(e.Fragment,{children:[" — Email: ",i]})]}):null})(),t.tags&&t.tags.length>0&&e.jsxs("p",{className:"mt-1",children:[e.jsx("strong",{children:"Palavras-Chave: "}),t.tags.join(", "),"."]}),e.jsxs("p",{className:"mt-1",children:[e.jsx("strong",{children:"URL: "}),"https://radreport.com.br/diario/",t.slug]})]})]}),t.body_region&&e.jsx("div",{className:"print-only print-body-region hidden print:block",children:t.body_region})]})})(),t.summary&&e.jsxs("div",{className:"mb-4",children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground mb-2",children:"Resumo"}),e.jsx("div",{className:"text-base md:text-lg leading-relaxed text-muted-foreground italic max-w-3xl [&_p]:m-0 [&_strong]:font-semibold [&_strong]:text-foreground [&_em]:italic",dangerouslySetInnerHTML:{__html:W(ne(t.summary))}})]}),e.jsx(H,{}),t.cover_image_url&&e.jsx("div",{className:"mt-6 blog-cover-image",children:e.jsx("img",{src:t.cover_image_url,alt:t.title,className:"w-full rounded-lg object-cover max-h-[480px]"})})]}),!m&&l.length>1&&e.jsx("nav",{className:"max-w-4xl mx-auto px-4 print:hidden",children:e.jsx("div",{className:"flex flex-nowrap items-center gap-1.5 py-3 overflow-x-auto scrollbar-hide",children:l.map((s,i)=>{const a=(s.customTitle||s.title).split(":")[0].split("–")[0].trim().slice(0,20);return e.jsxs(F.Fragment,{children:[i>
10&&e.jsx("span",{className:"text-muted-foreground/30 shrink-0",children:"·"}),e.jsx("button",{onClick:()=>G(s.type),className:`shrink-0 px-2.5 py-0.5 rounded-full text-xs transition-colors ${C===`section-${s.type}`?"text-primary font-semibold bg-primary/10":"text-muted-foreground hover:text-foreground hover:bg-muted/60"}`,children:a})]},s.type)})})}),e.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-6 space-y-0 blog-print-sections",children:[m?e.jsx("div",{className:"blog-rich-body prose dark:prose-invert max-w-none leading-relaxed prose-base text-foreground prose-headings:text-foreground prose-h2:text-2xl prose-h2:font-bold prose-h2:tracking-tight prose-h2:mt-8 prose-h2:mb-3 prose-h3:text-xl prose-h3:font-semibold prose-table:border-collapse prose-td:border prose-td:border-border prose-td:px-3 prose-td:py-2 prose-th:border prose-th:border-border prose-th:px-3 prose-th:py-2 prose-th:bg-muted/50",dangerouslySetInnerHTML:{__html:W(l[0].content)}}):e.jsxs(e.Fragment,{children:[l.map((s,i)=>{var D;const a=_&&s.type==="diagnosis",f=s.type==="references",N=_?Ae[s.type]:Fe[s.type];return e.jsxs("div",{children:[i>0&&e.jsx(H,{className:"my-8"}),e.jsxs("section",{id:`section-${s.type}`,className:`scroll-mt-20 ${a?"bg-primary/5 border-l-4 border-primary rounded-r-lg p-5":""}`,children:[e.jsxs("h2",{className:"flex items-center gap-2 font-bold text-foreground tracking-wider mb-3 text-2xl uppercase",children:[N&&e.jsx("span",{className:"text-primary",children:N}),s.type==="references"?s.title:s.customTitle||s.title,a&&t.diagnostic_certainty&&e.jsx(M,{variant:"outline",className:`text-[10px] font-semibold ml-2 ${t.diagnostic_certainty==="confirmed"?"bg-green-500/20 text-green-700 dark:text-green-400 border-green-500/30":t.diagnostic_certainty==="almost_certain"?"bg-blue-500/20 text-blue-700 dark:text-blue-400 border-blue-500/30":"bg-amber-500/20 text-amber-700 dark:text-amber-400 border-amber-500/30"}`,children:t.diagnostic_certainty==="confirmed"?"Confirmado":t.diagnostic_certainty==="almost_certain"?"Quase certo":"Provável"})]}),f&&((D=s.references_structured)==null?void 0:D.length)>0?e.jsx("ol",{className:"list-decimal list-inside space-y-3 text-sm text-muted-foreground",children:s.references_structured.map((x,R)=>e.jsxs("li",{className:"leading-relaxed",children:[e.jsxs("span",{className:"text-foreground",children:[x.authors,". ",x.title,". ",e.jsx("em",{children:x.journal}),". ",x.year,x.volume&&`;${x.volume}`,x.issue&&`(${x.issue})`,x.pages&&`:${x.pages}`,"."]}),x.doi&&e.jsxs("a",{href:`https://doi.org/${x.doi}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 ml-2 text-primary hover:underline text-xs",children:["DOI ",e.jsx(le,{className:"h-3 w-3"})]}),x.pmid&&e.jsxs("a",{href:`https://pubmed.ncbi.nlm.nih.gov/${x.pmid}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 ml-2 text-primary hover:underline text-xs",children:["PMID: ",x.pmid," ",e.jsx(le,{className:"h-3 w-3"})]})]},R))}):e.jsx("div",{className:`prose dark:prose-invert max-w-none leading-relaxed ${a?"prose-base font-medium text-foreground":f?"prose-sm text-xs text-muted-foreground pl-4":"prose-base text-foreground"}`,dangerouslySetInnerHTML:{__html:W(ne(s.content))}})]}),i===o&&u.length>0&&e.jsx("div",{id:"images-carousel",className:"scroll-mt-20 mt-6",children:e.jsx(ae,{images:u})})]},s.type)}),o<0&&u.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"my-8"}),e.jsx("div",{id:"images-carousel",className:"scroll-mt-20",children:e.jsx(ae,{images:u})})]})]}),e.jsx(H,{className:"my-8"}),(()=>{var i,a,f,N;const s=t.profiles;return e.jsxs("div",{className:"flex items-center gap-3 py-2 print:hidden blog-author-card",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center",children:e.jsx(ie,{className:"h-5 w-5 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm text-foreground",children:t.author_name||"Anônimo"}),(t.author_public_id||(s==null?void 0:s.public_id))&&e.jsx("p",{className:"text-xs text-muted-foreground font-mono",title:"Identificador público anônimo do autor",children:t.author_public_id||(s==null?void 0:s.public_id)}),(s==null?void 0:s.institution)&&((i=s==null?void 0:s.visibility_settings)==null?void 0:i.show_institution)!==!1&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.institution,s!=null&&s.department&&((a=s==null?void 0:s.visibility_settings)==null?void 0:a.show_department)!==!1?`, ${s.department}`:""]}),(s==null?void 0:s.city)&&((f=s==null?void 0:s.visibility_settings)==null?void 0:f.show_city)!==!1&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.city,s!=null&&s.state&&((N=s==null?void 0:s.visibility_settings)==null?void 0:N.show_state)!==!1?` (${s.state})`:""]})]})]})})(),t.tags&&t.tags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 pt-4 print:hidden blog-post-tags",children:t.tags.map(s=>e.jsx(V,{to:`/diario?tag=${encodeURIComponent(s)}`,children:e.jsx(M,{variant:"outline",className:"cursor-pointer hover:bg-primary/10 hover:text-primary transition-colors text-xs",children:s})}
1,s))}),u.length>0&&e.jsx("div",{className:"print-only print-figures-grid hidden print:grid grid-cols-2 gap-4 mt-6",children:u.map((s,i)=>e.jsxs("figure",{className:"break-inside-avoid",children:[e.jsx("img",{src:s.image_url,alt:s.caption||`Figura ${i+1}`,className:"w-full object-contain"}),e.jsxs("figcaption",{className:"text-xs text-center mt-1",children:["Figura ",i+1,s.caption?`: ${s.caption}`:""]})]},s.id))})]}),e.jsxs("div",{className:"max-w-6xl mx-auto px-4 pb-6 flex justify-end gap-2 print:hidden",children:[e.jsxs(E,{variant:y?"default":"outline",size:"sm",onClick:()=>g(),disabled:j,className:y?"bg-red-500 hover:bg-red-600 text-white border-red-500":"",children:[e.jsx(oe,{className:`h-4 w-4 mr-1.5 ${y?"fill-current":""}`}),t.likes_count||0]}),e.jsx(Re,{title:t.title,description:t.summary||void 0,url:I,hashtags:K}),e.jsxs(E,{variant:"outline",size:"sm",onClick:()=>{var q;const s=document.title,i=t.title.replace(/[^\w\s\-àáâãéêíóôõúüçÀÁÂÃÉÊÍÓÔÕÚÜÇ]/g,"").trim(),a=A=>{document.title=A;try{window.top&&(window.top.document.title=A)}catch{}},f="blog-print-page-style";(q=document.getElementById(f))==null||q.remove();const N=document.createElement("style");N.id=f,N.textContent="@page { margin: 0; }";let D=!1,x;const R=()=>{var A;D||(D=!0,x!==void 0&&window.clearTimeout(x),a(s),(A=document.getElementById(f))==null||A.remove(),window.removeEventListener("afterprint",R))};window.addEventListener("afterprint",R),x=window.setTimeout(R,6e4),a(i),document.head.appendChild(N),requestAnimationFrame(()=>{a(i);try{window.print()}catch(A){console.error("[BlogPost] window.print falhou:",A),R()}})},children:[e.jsx(Ue,{className:"h-4 w-4 mr-1.5"})," Imprimir"]})]}),e.jsx("div",{className:"print:hidden blog-comments-section",children:e.jsx(fe,{fallback:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Não foi possível carregar os comentários agora."}),children:e.jsx(Ve,{postId:t.id})})})]})})]})};export{gt 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.