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-eojr4v24.js";import"./ready-dadbdj5i.js";import{N as m}from"./utils-jupbrzo6.js";import"./client-nwyjxodt.js";import"./vendor/shiki-lqo1hg2n.js";import"./storage-options-nzog3hhp.js";import"./nuxt-link-bumooa9d.js";import{t as h}from"./_plugin-vue_export-helper-n58akrbk.js";import"./nicon-m1crov2l.js";import"./nbutton-gygn07c2.js";import{t as g}from"./ncard-ludmyw2u.js";import{i as _}from"./state-routes-jownks2o.js";import{t as v}from"./npanel-grids-onrho735.js";import"./ntext-input-e8iut2en.js";import{c as y,s as b}from"#entry";import"./client-im47u3kz.js";import{t as x}from"./ncode-block-figzf35k.js";import{t as S}from"./composables-b2ccklz4.js";import{t as C}from"./help-fab-oeo4c53s.js";import{t as w}from"./nnavbar-n7gfocyu.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){S({icon:`i-carbon-border-none`,title:`Virtual Files`,layout:`full`,category:`advanced`});let h=e(``),T=m(),E=_(),D=e();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=u(()=>T.value?T.value.entries.filter(e=>!e.id.startsWith(`${T.value?.rootDir||``}/.nuxt/`)).sort((e,t)=>e.id.localeCompare(t.id)):[]),P=u(()=>new b(N.value,{keys:[`id`,`path`]})),F=u(()=>h.value?P.value.search(h.value).map(e=>e.item):N.value);return(e,t)=>{let l=w,u=x,m=g,_=v,b=y,S=O,T=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(F.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===D.value?.id?`text-primary n-bg-active`:`text-secondary hover:n-bg-hover`),onClick:t=>E.value=e.id},d(M(e.id)),11,k),t[1]||=c(`div`,{"x-divider":``},null,-1)],64))),128))]),right:o(()=>[D.value?.content?(r(),f(`div`,A,[c(`div`,j,[c(`code`,null,d(D.value.id),1)]),p(u,{"h-full":``,"of-auto":``,"text-sm":``,code:D.value.content,lang:`typescript`},null,8,[`code`])])):(r(),s(_,{key:1},{default:o(()=>[p(m,{px6:``,py2:``},{default:o(()=>[...t[2]||=[c(`span`,{op75:``},`Select a file to start`,-1)]]),_:1})]),_:1}))]),_:1}),p(T,null,{default:o(()=>[p(S)]),_:1})],64)}}});export{M as default};