import{l as _,J as k,I as B,r as l,c as b,o as C,w as g,q as o,y as x,j as r,x as u,v as m,M as c,A as V,O as L,B as f,ae as q,U as M}from"./index-e9211ef1.js";import{L as N,s as O}from"./ListviewItem-b7a4258b.js";/* empty css                             */import{C as P}from"./Container-349a0ac0.js";import{l as T,k as D}from"./VBtn-68784d55.js";import"./MediaItemThumb.vue_vue_type_style_index_0_lang-278977b5.js";import"./VMenu-bc0cce60.js";import"./VDivider-336c24cd.js";import"./VListItem-230d1393.js";import"./VDialog-5f240a62.js";import"./VCard-138864fc.js";import"./VToolbar-daf2b89f.js";import"./VSelect-04a129eb.js";/* empty css              */const S=_({__name:"BrowseView",props:{path:{}},setup(d){const t=d,{t:h}=k(),i=B(),a=l(),s=l(!1),w=b(()=>{if(t.path){const e=t.path.substring(0,t.path.lastIndexOf("/")+1);return e.endsWith("://")?"":e}return""}),n=async function(){s.value=!0,a.value=await L.browse(t.path),!a.value||!t.path?f.topBarTitle=void 0:f.topBarTitle=q(a.value,h),s.value=!1};C(()=>{n()}),g(()=>t.path,()=>{n()});const v=function(e){e.media_type===M.FOLDER?i.push({name:"browse",query:{path:e.path}}):i.push({name:e.media_type,params:{itemId:e.item_id,provider:e.provider}})};return(e,E)=>(o(),x("section",null,[r(P,null,{default:u(()=>{var p;return[s.value?(o(),m(D,{key:0,indeterminate:""})):c("",!0),t.path?(o(),m(T,{key:1,variant:"plain",icon:"mdi-arrow-left",to:{name:"browse",query:{path:w.value}}},null,8,["to"])):c("",!0),r(V(O),{items:((p=a.value)==null?void 0:p.items)||[],"item-size":66,"key-field":"uri","page-mode":""},{default:u(({item:y})=>[r(N,{item:y,"show-library":!1,"show-menu":!1,"show-provider":!1,"is-selected":!1,onClick:v},null,8,["item"])]),_:1},8,["items"])]}),_:1})]))}});export{S as default};
