import{l as V,Q as _,a3 as b,r as f,c as g,o as k,w as B,y as o,I as h,j as s,A as p,R as C,N as d,x,H as n,z as u,L,M as N}from"./index-0b85ac09.js";import{L as D}from"./ListviewItem-8ca5221f.js";import{m as M}from"./utils-6da9b08b.js";import{C as P}from"./Container-f51d504d.js";import{V as R}from"./VBadge-0d62eaa1.js";import{V as T}from"./VToolbar-7dc49a97.js";import{V as j,j as q,r as E}from"./VImg-0b02a672.js";import{V as F}from"./VVirtualScroll-3bbd56c5.js";import"./ListItem-13203a50.js";import"./VMenu-17c39295.js";import"./VTooltip-98b8e750.js";import"./VCheckboxBtn-f7c239ad.js";import"./VCard-49371ce3.js";/* empty css              */const I={key:0},ee=V({__name:"BrowseView",props:{path:{}},setup(v){const a=v;_();const m=b(),t=f(),l=f(!1),w=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};k(()=>{c()}),B(()=>a.path,()=>{c()});const y=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,O)=>(o(),h("section",null,[s(T,{variant:"flat",color:"transparent",style:{height:"50px"}},{title:p(()=>{var r,i;return[C(d(e.$t("browse"))+" ",1),t.value&&t.value.provider!="library"?(o(),h("span",I," | "+d(x(M)(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(j),s(P,null,{default:p(()=>{var r;return[l.value?(o(),u(E,{key:0,indeterminate:""})):n("",!0),a.path?(o(),u(q,{key:1,variant:"plain",icon:"mdi-arrow-left",to:{name:"browse",query:{path:w.value}}},null,8,["to"])):n("",!0),s(F,{height:66,items:((r=t.value)==null?void 0:r.items)||[],style:{height:"100%"}},{default:p(({item:i})=>[s(D,{item:i,"show-library":!1,"show-menu":!1,"show-provider":!1,"is-selected":!1,onClick:y},null,8,["item"])]),_:1},8,["items"])]}),_:1})]))}});export{ee as default};
