import{C as e,Ct as t,Qt as n,T as r,W as i,Y as a,_ as o,dt as s,h as c,lt as l,m as u,p as d,s as f,tn as p}from"./vendor/json-editor-vue-9tyg6b65.js";import{N as m}from"./utils-ivfwadyv.js";import{t as h}from"./_plugin-vue_export-helper-d9irwgla.js";import{t as g}from"./ncard-d0lyv7bx.js";import{i as _}from"./state-routes-pcpgumo2.js";import{t as v}from"./npanel-grids-es6yvxa6.js";import{c as y,s as b}from"#entry";import{t as x}from"./ncode-block-cfw508sn.js";import{t as S}from"./pages-dm1j9w83.js";import{t as C}from"./help-fab-myoje00l.js";import{t as w}from"./nnavbar-eonyi8yr.js";var T={},E={class:`markdown-body`};function D(e,t){return i(),o(`div`,E,[...t[0]||=[u(`template`,null,[u(`div`,{class:`markdown-body`},[u(`h1`,null,`Virtual Files`),u(`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=r({__name:`virtual-files`,setup(r){S({icon:`i-carbon-border-none`,title:`Virtual Files`,layout:`full`,category:`advanced`});let h=t(``),T=m(),E=_(),D=t();l(()=>{if(!E.value)return;let e=`/_vfs.json/${encodeURIComponent(E.value)}`;fetch(e,{headers:{accept:`application/json`}}).then(e=>e.json()).then(e=>D.value=e.current)});function M(e){if(T.value?.rootDir)return e.startsWith(T.value?.rootDir)?e.slice(T.value.rootDir.length):e}let N=d(()=>T.value?T.value.entries.filter(e=>!e.id.startsWith(`${T.value?.rootDir||``}/.nuxt/`)).sort((e,t)=>e.id.localeCompare(t.id)):[]),P=d(()=>new b(N.value,{keys:[`id`,`path`]})),F=d(()=>h.value?P.value.search(h.value).map(e=>e.item):N.value);return(t,r)=>{let l=w,d=x,m=g,_=v,b=y,S=O,T=C;return i(),o(f,null,[e(b,{class:`virtual-files`,"storage-key":`tab-virtual-files`},{left:s(()=>[e(l,{search:h.value,"onUpdate:search":r[0]||=e=>h.value=e,"no-padding":``,p3:``},null,8,[`search`]),(i(!0),o(f,null,a(F.value,e=>(i(),o(f,{key:e.id},[u(`button`,{block:``,"w-full":``,"select-none":``,truncate:``,px2:``,py1:``,"text-start":``,"text-sm":``,"font-mono":``,class:n(e.id===D.value?.id?`text-primary n-bg-active`:`text-secondary hover:n-bg-hover`),onClick:t=>E.value=e.id},p(M(e.id)),11,k),r[1]||=u(`div`,{"x-divider":``},null,-1)],64))),128))]),right:s(()=>[D.value?.content?(i(),o(`div`,A,[u(`div`,j,[u(`code`,null,p(D.value.id),1)]),e(d,{"h-full":``,"of-auto":``,"text-sm":``,code:D.value.content,lang:`typescript`},null,8,[`code`])])):(i(),c(_,{key:1},{default:s(()=>[e(m,{px6:``,py2:``},{default:s(()=>[...r[2]||=[u(`span`,{op75:``},`Select a file to start`,-1)]]),_:1})]),_:1}))]),_:1}),e(T,null,{default:s(()=>[e(S)]),_:1})],64)}}});export{M as default};