import{X as k}from"./MkDrive-gvY187II.js";import{i as s,a3 as y}from"./app-JmgyQoR0.js";import{n as g}from"./number-rE36t967.js";import{b,a as d,h as p,i as C,j as m,z as o,E as f,K as $,t as w,H as B,l as D}from"./vue-y3KLWBaS.js";import"./bytes-7YLXyrly.js";const F={key:0,style:{"margin-left":"8px",opacity:"0.5"}},M=b({__name:"MkDriveSelectDialog",props:{type:{default:"file"},multiple:{type:Boolean}},emits:["done","closed"],setup(S,{emit:v}){const i=v,a=d(),l=d([]);function r(){var e;i("done",l.value),(e=a.value)==null||e.close()}function u(){var e;i("done"),(e=a.value)==null||e.close()}function c(e){l.value=e}return(e,t)=>(p(),C(y,{ref_key:"dialog",ref:a,width:800,height:500,"with-ok-button":!0,"ok-button-disabled":e.type==="file"&&l.value.length===0,onClick:t[1]||(t[1]=n=>u()),onClose:t[2]||(t[2]=n=>u()),onOk:t[3]||(t[3]=n=>r()),onClosed:t[4]||(t[4]=n=>i("closed"))},{header:m(()=>[$(f(e.multiple?e.type==="file"?o(s).ts.selectFiles:o(s).ts.selectFolders:e.type==="file"?o(s).ts.selectFile:o(s).ts.selectFolder)+" ",1),l.value.length>0?(p(),w("span",F,"("+f(o(g)(l.value.length))+")",1)):B("",!0)]),default:m(()=>[D(k,{multiple:e.multiple,select:e.type,onChangeSelection:c,onSelected:t[0]||(t[0]=n=>r())},null,8,["multiple","select"])]),_:1},8,["ok-button-disabled"]))}});export{M as default};
