import{l as _,Q as b,a9 as k,r as f,c as g,o as B,w as C,y as o,I as d,j as s,A as p,R as x,N as h,x as v,H as n,z as u,L,M as N,ah as D}from"./index-ebe4cd91.js";import{L as q,s as M}from"./ListviewItem-5151f17f.js";/* empty css                             */import{C as P}from"./Container-1375a850.js";import{V as R}from"./VBadge-0ad57746.js";import{V as T}from"./VToolbar-76e5fae8.js";import{V as $}from"./index-bda4e7b4.js";import{V as z,q as E}from"./VImg-b5692565.js";import"./MediaItemThumb.vue_vue_type_style_index_0_lang-bf2386aa.js";import"./ListItem-a20c73ec.js";import"./VMenu-86ca5efe.js";import"./VListItem-0df8c60b.js";import"./VCheckboxBtn-fcc73f36.js";import"./VCard-46ebf6a3.js";/* empty css              */const F={key:0},te=_({__name:"BrowseView",props:{path:{}},setup(w){const a=w;b();const m=k(),t=f(),l=f(!1),y=g(()=>{if(a.path){const e=a.path.substring(0,a.path.lastIndexOf("/")+1);return e.endsWith("://")?"":e}return""}),c=async function(){l.value=!0,t.value=await L.browse(a.path),l.value=!1};B(()=>{c()}),C(()=>a.path,()=>{c()});const V=function(e){e.media_type===N.FOLDER?m.push({name:"browse",query:{path:e.path}}):m.push({name:e.media_type,params:{itemId:e.item_id,provider:e.provider}})};return(e,I)=>(o(),d("section",null,[s(T,{variant:"flat",color:"transparent",style:{height:"50px"}},{title:p(()=>{var r,i;return[x(h(e.$t("browse"))+" ",1),t.value&&t.value.provider!="library"?(o(),d("span",F," | "+h(v(D)(t.value,e.$t)),1)):n("",!0),(r=t.value)!=null&&r.items?(o(),u(R,{key:1,color:"grey",content:(i=t.value)==null?void 0:i.items.length,inline:""},null,8,["content"])):n("",!0)]}),_:1}),s($),s(P,null,{default:p(()=>{var r;return[l.value?(o(),u(E,{key:0,indeterminate:""})):n("",!0),a.path?(o(),u(z,{key:1,variant:"plain",icon:"mdi-arrow-left",to:{name:"browse",query:{path:y.value}}},null,8,["to"])):n("",!0),s(v(M),{items:((r=t.value)==null?void 0:r.items)||[],"item-size":66,"key-field":"uri","page-mode":""},{default:p(({item:i})=>[s(q,{item:i,"show-library":!1,"show-menu":!1,"show-provider":!1,"is-selected":!1,onClick:V},null,8,["item"])]),_:1},8,["items"])]}),_:1})]))}});export{te as default};
