function u(t){function i(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var n=e.done;return Promise.resolve(e.value).then(function(s){return{value:s,done:n}})}return u=function(e){this.s=e,this.n=e.next},u.prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):i(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):i(n.apply(this.s,arguments))}},new u(t)}const p=async(t,i,e=t.name,n)=>{const s=[],f=[];var v,c=!1,d=!1;try{for(var h,y=(function(r){var o,a,l,w=2;for(typeof Symbol<"u"&&(a=Symbol.asyncIterator,l=Symbol.iterator);w--;){if(a&&(o=r[a])!=null)return o.call(r);if(l&&(o=r[l])!=null)return new u(o.call(r));a="@@asyncIterator",l="@@iterator"}throw new TypeError("Object is not async iterable")})(t.values());c=!(h=await y.next()).done;c=!1){const r=h.value,o=`${e}/${r.name}`;r.kind==="file"?f.push(r.getFile().then(a=>(a.directoryHandle=t,a.handle=r,Object.defineProperty(a,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>o})))):r.kind!=="directory"||!i||n&&n(r)||s.push(p(r,i,o,n))}}catch(r){d=!0,v=r}finally{try{c&&y.return!=null&&await y.return()}finally{if(d)throw v}}return[...(await Promise.all(s)).flat(),...await Promise.all(f)]};var m=async(t={})=>{t.recursive=t.recursive||!1;const i=await window.showDirectoryPicker({id:t.id,startIn:t.startIn});return p(i,t.recursive,void 0,t.skipDirectory)};export{m as default};
