1import{t as e}from"./i18n-DgzaX46e.js";import{s as t}from"./query-DgpxxY5N.js";import{Lt as n,Q as r,Xr as i,Xt as a,Z as o,gn as s,xt as c}from"./definitives-DUJJrLAk.js";import{vt as l}from"./composites-DOsfYh_d.js";import{i as u}from"./impact-DmxSO0jT.js";import{t as d}from"./FileDoc.es-liYN1nvE.js";import{i as f,r as p,t as m}from"./DocumentThumbnail-CI9wBgE1.js";import{t as h}from"./UnlinkFromProjectItem-CH4xUK1Y.js";import{n as g}from"./LinkToProject-CuKIAuhN.js";import{Xi as _}from"./esm-ECSQk40a.js";import{t as v}from"./useMembershipPermissions-Cmw8Hy_9.js";var y=t(),b={[_.docx]:d,[_.xlsx]:p,[_.pptx]:f},x={sm:{preview:`h-28`,icon:`size-7`,body:`p-2.5`,title:`text-xs`,meta:`text-[11px]`,row:`min-h-6`,action:`top-2 right-2`,actionSize:`sm`},md:{preview:`h-44`,icon:`size-8`,body:`p-4`,title:`text-sm`,meta:`text-xs`,row:`min-h-6`,action:`top-2 right-2`,actionSize:`sm`},lg:{preview:`h-60`,icon:`size-10`,body:`p-5`,title:`text-base`,meta:`text-sm`,row:`min-h-7`,action:`top-3 right-3`,actionSize:`md`}};function S({report:t,inProject:f=null,size:p=`md`,onOpen:_,onDelete:S}){let{t:C}=e(),w=c(),{removalOf:T,isOwner:E}=v(),D=T(t.ownerUserId,`reports`),O=x[p],k=!!f&&t.projectId!==f,A=b[t.contentType]??d;return(0,y.jsxs)(n,{value:t.id,onValueChange:()=>_(t),className:s(`group hover:bg-muted/30 relative gap-0 overflow-hidden py-0 transition-colors`,`focus-visible:bg-muted/30 focus-visible:ring-ring/40 cursor-pointer focus-visible:ring-2 focus-visible:outline-none`),classNames:{content:`p-0`},children:[(0,y.jsx)(`div`,{className:s(`bg-muted/50 flex flex-col items-center justify-center gap-1.5 border-b`,O.preview,t.previewHtml&&`overflow-hidden bg-white`),"aria-hidden":!0,children:t.previewHtml?(0,y.jsx)(m,{html:t.previewHtml}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(A,{className:s(`text-muted-foreground`,O.icon),weight:`thin`}),t.fileName?(0,y.jsx)(`span`,{className:`text-muted-foreground max-w-[80%] truncate text-[11px]`,children:t.fileName}):null,t.sizeBytes?(0,y.jsx)(`span`,{className:`text-muted-foreground text-[10px]`,children:w.fileSize(t.sizeBytes)}):null]})}),(0,y.jsxs)(`div`,{className:s(`bg-muted/30`,O.body),children:[(0,y.jsx)(`h3`,{className:s(`truncate leading-snug font-medium`,O.title),title:t.title,children:t.title}),(0,y.jsxs)(`div`,{className:s(`mt-1 flex items-center justify-between gap-2`,O.row),children:[(0,y.jsx)(`span`,{className:s(`text-muted-foreground truncate`,O.meta),children:w.relativeTime(t.createdAt)||C(`intelligence.project.reportSaved`,`Guardado`)}),(0,y.jsx)(l,{owner:t.ownerUserId})]})]}),(0,y.jsx)(`div`,{className:s(`absolute`,O.action),onClick:e=>e.stopPropagation(),children:(0,y.jsxs)(o,{align:`end`,trigger:(0,y.jsx)(a,{label:C(`common:actions.more`,`Más`),icon:i,variant:`ghost`,size:O.actionSize,showLabel:!1,className:`opacity-0 transition-opacity group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,onClick:e=>e.stopPropagation()}),children:[k||!E(t.ownerUserId)?null:(0,y.jsx)(g,{reference:{kind:`report`,refId:t.id},homeProjectId:t.projectId}),S&&D&&!k?(0,y.jsx)(r,{label:D===`hide`?C(`common:hideForMe.action`,`Ocultar`):C(`common:actions.delete`,`Eliminar`),icon:u,destructive:!0,onSelect:()=>S(t)}):null,(0,y.jsx)(h,{reference:{kind:`report`,refId:t.id},inProject:f,livesThere:!k})]})})]})}export{S as t};
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.