PageSourceSearch

https://umbuzeirosaude.com/assets/DocumentItem-CDT4NFly.js

js umbuzeirosaude.com collected 2026-10-09 22:03:58 UTC 3,258 bytes, 1 lines download raw bytes

1import{a as e,n as t,t as n}from"./jsx-runtime-C27Mmbu5.js";import{n as r,y as i}from"./index-BszCxTac.js";import{t as a}from"./button-zY1-TdOv.js";import{a as o,i as s,n as c,t as l}from"./dialog-CjzArlMx.js";import{D as u,F as d,I as f,N as p,P as m,R as h}from"./lucide-react-qdR7d5he.js";import{n as g,r as _,t as v}from"./format-AEvkvf9h.js";var y=e(t(),1);async function b(e,t,n=3600){let{data:r,error:a}=await i.storage.from(e).createSignedUrl(t,n);if(a||!r?.signedUrl)throw a??Error(`Falha ao gerar URL`);return r.signedUrl}var x=n();function S(e){return e?e.includes(`pdf`)?m:e.startsWith(`image/`)?d:p:p}function C(e){let[t,n]=(0,y.useState)(!1),[i,d]=(0,y.useState)(null),[p,m]=(0,y.useState)(null),C=S(e.mime),w=[g(e.mime),_(e.size)].filter(Boolean).join(` · `),T=v(e.mime);async function E(){try{return await b(e.bucket,e.path,3600)}catch(e){throw r.error(e?.message??`Não foi possível abrir o arquivo`),e}}async function D(){m(`view`);try{let e=await E();T?(d(e),n(!0)):window.open(e,`_blank`,`noopener`)}catch{}finally{m(null)}}async function O(){m(`download`);try{let t=await E(),n=document.createElement(`a`);n.href=t,n.download=e.title,n.rel=`noopener`,document.body.appendChild(n),n.click(),n.remove()}catch{}finally{m(null)}}return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3 p-4 rounded-lg border border-border bg-card hover:shadow-md hover:border-brand-500/40 transition-all`,children:[(0,x.jsx)(`div`,{className:`shrink-0 w-11 h-11 rounded-lg bg-brand-sky text-brand-900 flex items-center justify-center`,children:(0,x.jsx)(C,{size:20})}),(0,x.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,x.jsx)(`div`,{className:`font-semibold text-brand-900 truncate`,children:e.title}),e.description&&(0,x.jsx)(`div`,{className:`text-sm text-muted-foreground line-clamp-1`,children:e.description}),w&&(0,x.jsx)(`div`,{className:`text-xs text-muted-foreground mt-0.5 font-mono`,children:w})]}),(0,x.jsxs)(`div`,{className:`flex gap-1 shrink-0`,children:[(0,x.jsxs)(a,{variant:`ghost`,size:`sm`,onClick:D,disabled:p!==null,title:`Pré-visualizar`,children:[p===`view`?(0,x.jsx)(u,{size:16,className:`animate-spin`}):(0,x.jsx)(f,{size:16}),(0,x.jsx)(`span`,{className:`sr-only sm:not-sr-only sm:ml-1`,children:`Ver`})]}),(0,x.jsxs)(a,{variant:`outline`,size:`sm`,onClick:O,disabled:p!==null,title:`Baixar`,children:[p===`download`?(0,x.jsx)(u,{size:16,className:`animate-spin`}):(0,x.jsx)(h,{size:16}),(0,x.jsx)(`span`,{className:`sr-only sm:not-sr-only sm:ml-1`,children:`Baixar`})]})]})]}),(0,x.jsx)(l,{open:t,onOpenChange:n,children:(0,x.jsxs)(c,{className:`max-w-5xl w-[95vw] h-[85vh] p-0 flex flex-col`,children:[(0,x.jsx)(s,{className:`px-6 py-3 border-b`,children:(0,x.jsx)(o,{className:`text-base`,children:e.title})}),(0,x.jsx)(`div`,{className:`flex-1 bg-muted overflow-auto`,children:i&&e.mime?.startsWith(`image/`)?(0,x.jsx)(`img`,{src:i,alt:e.title,className:`mx-auto max-h-full`}):i?(0,x.jsx)(`iframe`,{src:i,title:e.title,className:`w-full h-full`}):null}),(0,x.jsx)(`div`,{className:`px-6 py-3 border-t flex justify-end gap-2`,children:(0,x.jsxs)(a,{variant:`outline`,onClick:O,disabled:p!==null,children:[(0,x.jsx)(h,{size:16,className:`mr-1`}),` Baixar`]})})]})})]})}export{C 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.