import{_ as V}from"./nnavbar.vue-g6z7o7a7.js";import{_ as D}from"./ncode-block.vue-h2q9yyre.js";import{bl as S,bm as B,S as P,i as j,n as W,a8 as E}from"./cbulnwf4.js";import{O as c,a0 as i,P as a,q as I,k as f,w as R,u as d,a2 as l,a1 as u,R as U,a7 as v,F as _,ad as q,W as z}from"./vendor/json-editor-vue-huf8dypo.js";import{_ as G}from"./help-fab.vue-oku0yt66.js";import"./client-bqg1k5yt.js";import"./vendor/unocss-e7oqigho.js";import"./vendor/shiki-jv02kgzv.js";const H={class:"markdown-body"},L={__name:"virtual-files",setup(h,{expose:r}){return r({frontmatter:{}}),(p,o)=>(i(),c("div",H,o[0]||(o[0]=[a("h1",null,"Virtual Files",-1),a("p",null,"Virtual files are generated on the fly to support the conventions of the framework, and to provide a better developer experience.",-1)])))}},O=["onClick"],A={key:0,"h-full":"","of-hidden":"",flex:"~ col"},J={border:"b base","flex-none":"",px4:"",py2:"","text-sm":"",op75:""},oe=I({__name:"virtual-files",setup(h){const r=f(""),n=S(),p=B(),o=f();R(()=>{if(!p.value)return;const e=`/_vfs.json/${encodeURIComponent(p.value)}`;fetch(e,{headers:{accept:"application/json"}}).then(t=>t.json()).then(t=>o.value=t.current)});function x(e){if(n.value?.rootDir)return e.startsWith(n.value?.rootDir)?e.slice(n.value.rootDir.length):e}const m=d(()=>n.value?n.value.entries.filter(e=>!e.id.startsWith(`${n.value?.rootDir||""}/.nuxt/`)).sort((e,t)=>e.id.localeCompare(t.id)):[]),k=d(()=>new P(m.value,{keys:["id","path"]})),b=d(()=>r.value?k.value.search(r.value).map(e=>e.item):m.value);return(e,t)=>{const y=V,g=D,C=W,F=j,$=E,N=L,w=G;return i(),c(_,null,[l($,{class:"virtual-files","storage-key":"tab-virtual-files"},{left:u(()=>[l(y,{search:r.value,"onUpdate:search":t[0]||(t[0]=s=>r.value=s),"no-padding":"",p3:""},null,8,["search"]),(i(!0),c(_,null,q(b.value,s=>(i(),c(_,{key:s.id},[a("button",{block:"","w-full":"","select-none":"",truncate:"",px2:"",py1:"","text-start":"","text-sm":"","font-mono":"",class:z(s.id===o.value?.id?"text-primary n-bg-active":"text-secondary hover:n-bg-hover"),onClick:K=>p.value=s.id},v(x(s.id)),11,O),t[1]||(t[1]=a("div",{"x-divider":""},null,-1))],64))),128))]),right:u(()=>[o.value?.content?(i(),c("div",A,[a("div",J,[a("code",null,v(o.value.id),1)]),l(g,{"h-full":"","of-auto":"","text-sm":"",code:o.value.content,lang:"typescript"},null,8,["code"])])):(i(),U(F,{key:1},{default:u(()=>[l(C,{px6:"",py2:""},{default:u(()=>t[2]||(t[2]=[a("span",{op75:""},"Select a file to start",-1)])),_:1})]),_:1}))]),_:1}),l(w,null,{default:u(()=>[l(N)]),_:1})],64)}}});export{oe as default};
