import"./rolldown-runtime-BM3Ffeng.js";import{i as e}from"./element-plus-vendor-BF9PNysW.js";import{Tt as t}from"./vue-vendor-DMUmTARL.js";import{C as n,y as r}from"./index-y6crcKNt.js";import{t as i}from"./admin-setting-DI6F8jmk.js";var a=e=>e instanceof Error?e.message:`未知错误`,o=(e,t)=>{let{data:n,headers:r}=e,i=new Blob([n],{type:r[`content-type`]?.toString()||`application/octet-stream`}),a=document.createElement(`a`),o=window.URL.createObjectURL(i);a.href=o,a.download=decodeURI(t),a.style.display=`none`,document.body.appendChild(a),a.click(),a.parentNode?.removeChild(a),window.URL.revokeObjectURL(o)};function s(s={}){let c=r(),l=t(!1),u=`[${s.source||`SystemLogDownload`}]`;return{downloading:l,downloadSystemLogs:async()=>{if(l.value)return;l.value=!0;let t=e.service({fullscreen:!0,lock:!0,text:`日志打包下载中...`,background:`rgba(0, 0, 0, 0.7)`});try{let e=await i(),t=`ZFile 诊断日志 - ${n(new Date)}.zip`;console.info(`${u} 开始下载系统诊断日志:`,t),o(e,t),console.info(`${u} 系统诊断日志下载完成:`,t),c.success(`下载成功`)}catch(e){console.error(`${u} 系统诊断日志下载失败:`,e),c.error(`下载日志失败: `+a(e))}finally{l.value=!1,t.close()}}}}export{s as t};