const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./memory.DS-ZPlZ9.js","./config.Mbx-WYSj.js","./FileSystemDirectoryHandle.Dd5S4jVZ.js","./preload-helper.HclGiUj8.js","./FileSystemHandle.CFTLjada.js","./FileSystemFileHandle.4sVW5ZPT.js"])))=>i.map(i=>d[i]);
import{r as e}from"./rolldown-runtime.C0FnF6B9.js";import{t}from"./preload-helper.HclGiUj8.js";var n=e({config:()=>i,errors:()=>r,fromDataTransfer:()=>a,getDirHandlesFromInput:()=>o,getFileHandlesFromInput:()=>s}),r={INVALID:[`seeking position failed.`,`InvalidStateError`],GONE:[`A requested file or directory could not be found at the time an operation was processed.`,`NotFoundError`],MISMATCH:[`The path supplied exists, but was not an entry of requested type.`,`TypeMismatchError`],MOD_ERR:[`The object can not be modified in this way.`,`InvalidModificationError`],SYNTAX:e=>[`Failed to execute 'write' on 'UnderlyingSinkBase': Invalid params passed. ${e}`,`SyntaxError`],SECURITY:[`It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.`,`SecurityError`],DISALLOWED:[`The request is not allowed by the user agent or the platform in the current context.`,`NotAllowedError`]},i={writable:globalThis.WritableStream};async function a(e){console.warn("deprecated fromDataTransfer - use `dt.items[0].getAsFileSystemHandle()` instead");let[n,r,i]=await Promise.all([t(()=>import(`./memory.DS-ZPlZ9.js`),__vite__mapDeps([0,1]),import.meta.url),t(()=>import(`./sandbox.BKQb5R92.js`),[],import.meta.url),t(()=>import(`./FileSystemDirectoryHandle.Dd5S4jVZ.js`),__vite__mapDeps([2,3,4]),import.meta.url)]),a=new n.FolderHandle(``,!1);return a._entries=e.map(e=>e.isFile?new r.FileHandle(e,!1):new r.FolderHandle(e,!1)),new i.FileSystemDirectoryHandle(a)}async function o(e){let{FolderHandle:n,FileHandle:r}=await t(async()=>{let{FolderHandle:e,FileHandle:t}=await import(`./memory.DS-ZPlZ9.js`);return{FolderHandle:e,FileHandle:t}},__vite__mapDeps([0,1]),import.meta.url),{FileSystemDirectoryHandle:i}=await t(async()=>{let{FileSystemDirectoryHandle:e}=await import(`./FileSystemDirectoryHandle.Dd5S4jVZ.js`);return{FileSystemDirectoryHandle:e}},__vite__mapDeps([2,3,4]),import.meta.url),a=Array.from(e.files),o=a[0].webkitRelativePath.split(`/`,1)[0],s=new n(o,!1);return a.forEach(e=>{let t=e.webkitRelativePath.split(`/`);t.shift();let i=t.pop(),a=t.reduce((e,t)=>(e._entries[t]||(e._entries[t]=new n(t,!1)),e._entries[t]),s);a._entries[i]=new r(e.name,e,!1)}),new i(s)}async function s(e){let{FileHandle:n}=await t(async()=>{let{FileHandle:e}=await import(`./memory.DS-ZPlZ9.js`);return{FileHandle:e}},__vite__mapDeps([0,1]),import.meta.url),{FileSystemFileHandle:r}=await t(async()=>{let{FileSystemFileHandle:e}=await import(`./FileSystemFileHandle.4sVW5ZPT.js`);return{FileSystemFileHandle:e}},__vite__mapDeps([5,4,1]),import.meta.url);return Array.from(e.files).map(e=>new r(new n(e.name,e,!1)))}export{n,r as t};