import{_ as a}from"./index.js?v=1763625242172";import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{i as l,a9 as o,bf as s,_ as i}from"./page_layout.js?v=1763625242172";import{a as n,i as t}from"./public.js?v=1763625242172";import{g as r}from"./index39.js?v=1763625242172";import{au as d,dP as p,aC as u}from"./naive.js?v=1763625242172";import{k as c,i as f,r as m,c as h,R as v,a2 as _,a3 as w,U as x,X as y,V as b,j as k,a4 as M,an as g,aj as C}from"./vue.js?v=1763625242172";const j={class:"p-20px"},S=c({__name:"ShareDetail",setup(c,{expose:S}){const{t:D}=l.global,U="".concat(window.location.origin,"/down/"),A=f("fileStore"),q=m(!1),z=m({filename:"",ps:"",token:"",expire:"",total:0,password:"",addtime:0,id:0});async function L(){return n({title:D("file.shareModal.cancelSharing"),content:D("file.shareModal.confirmStopSharing",{filename:z.value.filename}),async onConfirm(){await s.post("/files?action=remove_download_url",{id:z.value.id},{requestOptions:{loading:D("file.shareModal.deletingShare"),successMessage:!0}}),q.value=!1,r(A)}}),!1}S({open(a){z.value={filename:a.filename,ps:a.ps,token:a.token,expire:o(a.expire),total:a.total,password:a.password,addtime:a.addtime,id:a.id},q.value=!0},close(){q.value=!1}});const N=h((()=>"".concat(U).concat(z.value.token)));function O(){t(N.value)}function P(){t(D("file.shareModal.linkAndCode",{link:N.value,code:z.value.password}))}return(l,o)=>{const s=d,n=p,t=i,r=u,c=e,f=a;return v(),_(f,{show:b(q),"onUpdate:show":o[1]||(o[1]=a=>C(q)?q.value=a:null),title:b(D)("file.shareModal.shareDetails",{name:b(z).ps}),width:560,footer:!0,"confirm-type":"error","confirm-text":b(D)("file.shareModal.closeSharingChain"),onConfirm:L},{default:w((()=>[x("div",j,[y(c,null,{default:w((()=>[y(n,{label:b(D)("file.shareModal.shareName")},{default:w((()=>[y(s,{value:b(z).ps,"onUpdate:value":o[0]||(o[0]=a=>b(z).ps=a)},null,8,["value"])])),_:1},8,["label"]),y(n,{label:b(D)("file.shareModal.shareChain")},{default:w((()=>[y(s,{class:"mr-10px",readonly:!0,value:b(N)},null,8,["value"]),y(r,{type:"primary",onClick:O},{icon:w((()=>[y(t,{name:"common-copy",size:"16"})])),_:1})])),_:1},8,["label"]),b(z).password?(v(),_(n,{key:0,label:b(D)("file.shareModal.extractionCode")},{default:w((()=>[y(s,{class:"mr-10px",value:"".concat(b(z).password),readonly:""},null,8,["value"]),y(r,{type:"primary",onClick:P},{default:w((()=>[k(M(b(D)("file.shareModal.copyLinkAndCode")),1)])),_:1})])),_:1},8,["label"])):g("",!0),y(n,{label:b(D)("file.shareModal.expirationDate"),"show-feedback":!1},{default:w((()=>[k(M(b(z).expire),1)])),_:1},8,["label"])])),_:1})])])),_:1},8,["show","title","confirm-text"])}}});export{S as _};
