function e(e){return e.filter(e=>e.name&&e.name!==`.`&&e.name!==`..`).map(e=>{let t=e.type===`directory`||!!e.is_dir,n=e.type===`symlink`||!!e.is_link,r=0;if(!t&&!n&&e.size!=null){let t=typeof e.size==`number`?e.size:parseInt(String(e.size),10);r=Number.isFinite(t)?t:0}let i=`file`;return t?i=`directory`:n&&(i=`symlink`),{name:e.name,type:i,size:r,modified:e.modified??``,permissions:e.permissions??e.perms??``,owner:e.owner??``,group:e.group??``,mode_octal:e.mode_octal??``,link_target:e.link_target??null}})}function t(t){if(Array.isArray(t))return{items:t};let n=t;return Array.isArray(n.items)?{items:n.items,error:n.error}:n.entries?.length?{items:e(n.entries),error:n.error}:{items:n.items??[],error:n.error}}var n=`/www/wwwroot`;function r(e){let t=(e??``).trim().replace(/\\/g,`/`);if(!t||t===`.`)return`/`;let n=t.startsWith(`/`)?t:`/${t}`;return n=n.replace(/\/+/g,`/`),n.length>1&&n.endsWith(`/`)&&(n=n.slice(0,-1)),n}function i(e){return r(e).split(`/`).filter(Boolean)}function a(e,t){let n=r(e),a=t.replace(/\/+/g,``).trim();if(!a||a===`.`)return n;if(a===`..`){let e=i(n);return e.pop(),e.length?`/${e.join(`/`)}`:`/`}return n===`/`?`/${a}`:`${n}/${a}`}function o(e){let t=i(e);return t.length?(t.pop(),t.length?`/${t.join(`/`)}`:`/`):null}function s(e){let t=e.trim();return t?t.includes(`/`)||t.includes(`\\`)||t.includes(`\0`)?`名称不能包含路径分隔符`:t===`.`||t===`..`?`非法名称`:!0:`名称不能为空`}function c(e){let t=i(r(e)),n=[{title:`/`,path:`/`,disabled:t.length===0}],o=``;for(let e=0;e<t.length;e++)o=a(o||`/`,t[e]),n.push({title:t[e],path:o,disabled:e===t.length-1});return n}function l(e){return new Worker(`/app/assets/editor.worker-Cn2oRESe.js`,{name:e?.name})}function u(e){return new Worker(`/app/assets/css.worker-CvXBzhp8.js`,{name:e?.name})}function d(e){return new Worker(`/app/assets/html.worker-BO6WuOEO.js`,{name:e?.name})}function f(e){return new Worker(`/app/assets/json.worker-BkJRGcCJ.js`,{name:e?.name})}function p(e){return new Worker(`/app/assets/ts.worker-B6r0Skfj.js`,{name:e?.name})}var m=!1,h=!1;function g(){if(!h){h=!0;try{let e=new l;setTimeout(()=>e.terminate(),0)}catch{}}}function _(){m||(m=!0,self.MonacoEnvironment={getWorker(e,t){switch(t){case`json`:return new f;case`css`:case`scss`:case`less`:return new u;case`html`:case`handlebars`:case`razor`:return new d;case`typescript`:case`javascript`:return new p;default:return new l}}})}export{a,s as c,c as i,t as l,g as n,r as o,n as r,o as s,_ as t};