1import{J as w,Z as m,_ as u,an as i,ag as f,ah as v,$ as b,a5 as g,a6 as y,a9 as C,R as k,F as R,C as U}from"./De_JQGIt.js";const D=["href","disabled"],L={key:0,class:"spinner-border text-light spinner-border-sm",role:"status"},$=w({inheritAttrs:!1,__name:"Archivo",props:{data:{}},setup(c){const r=c,h=U(),a=k(!1),_=async()=>{if(!(a.value||!s.value||s.value==="#")){a.value=!0;try{const e=await fetch(s.value);if(!e.ok)throw new Error("Download failed");const n=await e.blob(),t=window.URL.createObjectURL(n),o=document.createElement("a");o.style.display="none",o.href=t;const d=e.headers.get("Content-Disposition");let p=r.data?.file_archive?.original_name||r.data?.name||"documento";if(d){const l=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(d);l!=null&&l[1]&&(p=l[1].replace(/['"]/g,""))}o.download=p,document.body.appendChild(o),o.click(),setTimeout(()=>{window.URL.revokeObjectURL(t),document.body.removeChild(o)},500)}catch{window.open(s.value,"_blank")}finally{a.value=!1}}},s=R(()=>{const e=r.data?.file_archive;if(!e?.path)return"#";const n=h.public.apiBase.replace(/\/$/,""),t=new URLSearchParams;return t.append("path",e.path),e.mime_type&&t.append("mime_type",e.mime_type),e.original_name&&t.append("original_name",e.original_name),`${n}/api/files/view-pdf?${t.toString()}`});return(e,n)=>(m(),u("a",{href:i(s),class:v([e.$attrs.class,{"opacity-75 cursor-wait":i(a)}]),onClick:[f(_,["prevent"]),n[0]||(n[0]=f(()=>{},["stop"]))],disabled:i(a)},[b(e.$slots,"default"),g(" "+y(i(a)?"Descargando...":c.data?.name)+" ",1),i(a)?(m(),u("div",L)):C("",!0)],10,D))}}),B=Object.assign($,{__name:"ButtonsArchivo"});export{B 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.