import{Ct as e,E as t,Qt as n,W as r,Y as i,c as a,dt as o,g as s,h as c,lt as l,m as u,tn as d,v as f,w as p}from"./vendor/json-editor-vue-ddj4xtqm.js";import"./vendor/shiki-kunkft64.js";import{E as m,N as h,f as g,ht as _,l as v,s as y,w as b}from"#entry";import"./client-cbmkjf3j.js";import{t as x}from"./ncode-block-j2hcqwrp.js";import{t as S}from"./composables-g8w9dpc0.js";import{t as C}from"./help-fab-bhtk9hzf.js";import{t as w}from"./nnavbar-fdsyxwr6.js";var T={},E={class:`markdown-body`};function D(e,t){return r(),f(`div`,E,[...t[0]||=[c(`template`,null,[c(`div`,{class:`markdown-body`},[c(`h1`,null,`Virtual Files`),c(`p`,null,`Virtual files are generated on the fly to support the conventions of the framework, and to provide a better developer experience.`)])],-1)]])}var O=h(T,[[`render`,D]]),k=[`onClick`],A={key:0,"h-full":``,"of-hidden":``,flex:`~ col`},j={border:`b base`,"flex-none":``,px4:``,py2:``,"text-sm":``,op75:``},M=t({__name:`virtual-files`,setup(t){let h=e(``),S=_(),T=b(),E=e();l(()=>{if(!T.value)return;let e=`/_vfs.json/${encodeURIComponent(T.value)}`;fetch(e,{headers:{accept:`application/json`}}).then(e=>e.json()).then(e=>E.value=e.current)});function D(e){if(S.value?.rootDir)return e.startsWith(S.value?.rootDir)?e.slice(S.value.rootDir.length):e}let M=u(()=>S.value?S.value.entries.filter(e=>!e.id.startsWith(`${S.value?.rootDir||``}/.nuxt/`)).sort((e,t)=>e.id.localeCompare(t.id)):[]),N=u(()=>new y(M.value,{keys:[`id`,`path`]})),P=u(()=>h.value?N.value.search(h.value).map(e=>e.item):M.value);return(e,t)=>{let l=w,u=x,_=m,y=g,b=v,S=O,M=C;return r(),f(a,null,[p(b,{class:`virtual-files`,"storage-key":`tab-virtual-files`},{left:o(()=>[p(l,{search:h.value,"onUpdate:search":t[0]||=e=>h.value=e,"no-padding":``,p3:``},null,8,[`search`]),(r(!0),f(a,null,i(P.value,e=>(r(),f(a,{key:e.id},[c(`button`,{block:``,"w-full":``,"select-none":``,truncate:``,px2:``,py1:``,"text-start":``,"text-sm":``,"font-mono":``,class:n(e.id===E.value?.id?`text-primary n-bg-active`:`text-secondary hover:n-bg-hover`),onClick:t=>T.value=e.id},d(D(e.id)),11,k),t[1]||=c(`div`,{"x-divider":``},null,-1)],64))),128))]),right:o(()=>[E.value?.content?(r(),f(`div`,A,[c(`div`,j,[c(`code`,null,d(E.value.id),1)]),p(u,{"h-full":``,"of-auto":``,"text-sm":``,code:E.value.content,lang:`typescript`},null,8,[`code`])])):(r(),s(y,{key:1},{default:o(()=>[p(_,{px6:``,py2:``},{default:o(()=>[...t[2]||=[c(`span`,{op75:``},`Select a file to start`,-1)]]),_:1})]),_:1}))]),_:1}),p(M,null,{default:o(()=>[p(S)]),_:1})],64)}}});export{M as default};