import{n as e}from"../chunks/BNTlsKDJ.js";import{$ as t,Ct as n,L as r,M as i,Nt as a,Pt as o,R as s,X as c,pt as l,st as u}from"../chunks/BT3KAag_.js";import"../chunks/t62M88qj.js";import{i as d,t as f}from"../chunks/Brnt5OaR.js";import{t as p}from"../chunks/CWJVikgc.js";import{t as m}from"../chunks/xTCGZyVl2.js";import{t as h}from"../chunks/CJ6d6ePw2.js";var g=e({load:()=>_});function _({params:e}){let t=(e.path??``).replace(/^\/+|\/+$/g,``);return{folderName:e.name,subPath:t}}function v(e,g){o(g,!0);let _=n(()=>g.data.folderName),v=n(()=>g.data.subPath),y=n(()=>()=>{let e=d.repos.find(e=>e.name===c(_)),t=e?.displayName??c(_),n=c(v).split(`/`).filter(Boolean).join(`/`);if(!n)return t;let r=f(e?.subfolders??[],n);return r[r.length-1]??t});u(()=>{p.showView(-1)}),u(()=>{let e=c(_),n=c(v);t(()=>p.selectRepo(e,n))}),u(()=>{let e=c(_);return m.enter(e,`_folder`,`_chat`),()=>m.leave()});var b=s();i(l(b),()=>`${c(_)}/${c(v)}`,e=>{{let t=n(()=>c(y)()),r=n(()=>`folder-${c(_)}`);h(e,{get name(){return c(t)},get storageId(){return c(r)},get lockedFolder(){return c(_)},get lockedFolderPath(){return c(v)},defaultSortKey:`name`,defaultSortAsc:!0})}}),r(e,b),a()}export{v as component,g as universal};