import{f as S}from"./file-5139c625.js";import{c as f}from"./path-8ad564a3.js";import{g as u}from"./qrcode-fcd8dde4.js";import{r as i,M as T,D as q,G as D,S as c}from"./index-25eb6331.js";import{v as w,w as x}from"./useSetting-bf1f702c.js";import{t as z}from"./vue3-clipboard.esm-f774ce6a.js";import{E as A}from"./request-14d7fed5.js";const K=i(!1),p=i(!1),v=T({expireTime:null}),s=i("");let{storageKey:b}=q();const h=i([]);let P=D(()=>h.value.length>0?h.value[0]:null),k=i(!1),m=i(!1);const V=D(()=>p.value&&k.value);function O(){const G=a=>{s.value=a,a==="pathLink"?L():p.value=!0},g=()=>{p.value=!1},R=()=>{g(),L()},L=()=>{k.value=!0};let y=a=>{z(a).then(()=>{A.success("复制成功")})};const E=async a=>{m.value=!0;let t=[],r=[];(s.value==="pathLink"||s.value==="all")&&(t=await d(a)),(s.value==="shortLink"||s.value==="all")&&(r=await F(a)),a.forEach((o,e)=>{let n={name:o.name,size:S(o.size),time:o.time,pathLink:t[e],shortLink:r[e]};if(a.length===1){const l={text:s.value==="pathLink"?t[e]:r[e],correctLevel:2,isSpace:!1};n.qrcode={a1:u(l,c.rendererRect),a2:u(l,c.rendererRound),sp1:u(l,c.rendererDSJ),aa1:u(l,c.rendererLine),ab2:u(l,c.rendererFuncB)},n.currentImg=n.qrcode.a1}h.value.push(n)}),m.value=!1},d=async a=>{let t=[],r={storageKey:b.value,paths:[],expireTime:0};return a.forEach(e=>{let n=f(e.path,e.name);r.paths.push(n)}),(await w(r)).data.forEach(e=>{t.push(e.address)}),t},F=async a=>{let t=[],r={storageKey:b.value,paths:[],expireTime:v.expireTime};return a.forEach(e=>{let n=f(e.path,e.name);r.paths.push(n)}),(await x(r)).data.forEach(e=>{t.push(e.address)}),t};return{currentLinkDialogType:s,generateLinkDialogVisible:p,openGenerateLinkDialog:G,closeGenerateLinkDialog:g,generateLinkFormData:v,generateLinkLoading:K,submitGenerateLinkForm:R,linkDialogVisible:V,generateLinkResultDialogVisible:k,generateLinkResultLoading:m,openGenerateLinkResultDialog:L,copyText:y,data:P,dataList:h,generateALlLink:E,batchGetFilePathLink:d}}export{O as u};
