import{I as v}from"./ItemsListing-CHZs9N6z.js";import{a7 as _,bp as x,F as B,i as u,a8 as n,a9 as l,o as I,ae as V,E as C,a0 as E,af as S,ai as F,aa as P,an as f,al as L,a_ as b,ap as N,aq as j,_ as q}from"./index-CFcIX8RO.js";import"./Container-iGBsqgnx.js";import"./index-kQIztB-E.js";import"./Toolbar-DambSy-S.js";import"./VToolbar-B_3_MVxk.js";import"./Button-IxLZkOI0.js";import"./ListItem-CWPLlf7K.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-CGTv89Z9.js";import"./VCheckboxBtn-Dy9mjR59.js";import"./MediaItemThumb-oOnMmU-2.js";import"./PanelviewItemCompact-YHP34gKS.js";import"./VInfiniteScroll-DY-7nfIB.js";import"./VVirtualScroll-BRrQ8Y7O.js";import"./VAlert-DZurr_D6.js";const D={class:"breadcrumb-container"},O=["onClick"],T={key:1,class:"breadcrumb-text"},z=_({__name:"BrowseView",props:{path:{}},setup(i){const o=i,{t:d}=x(),p=B(!1),k=u(()=>""),h=u(()=>{const e=[];if(e.push({text:d("browse"),path:null,clickable:o.path&&o.path!=="root"||!1}),o.path&&o.path!=="root")if(o.path.includes("://")){const[a,t]=o.path.split("://"),s=a+"://";if(e.push({text:s,path:s,clickable:t&&t.length>0||!1}),t&&t.length>0){const r=t.split("/").filter(c=>c.length>0);r.forEach((c,m)=>{const y=s+r.slice(0,m+1).join("/");e.push({text:c,path:y,clickable:m<r.length-1})})}}else{const a=o.path.split("/").filter(t=>t.length>0);a.forEach((t,s)=>{const r=a.slice(0,s+1).join("/");e.push({text:t,path:r,clickable:s<a.length-1})})}return e}),w=async function(e){const a=await N.browse(o.path);return p.value=a.every(t=>t.media_type===j.FOLDER),a},g=e=>{e===null?b.push({name:"browse"}):b.push({name:"browse",query:{path:e}})};return(e,a)=>(l(),n("section",null,[I(v,{itemtype:"browse","show-provider":!1,"show-library":!1,"show-favorites-only-filter":!1,"show-track-number":!1,"show-select-button":!!(i.path&&i.path!="root"&&!p.value),"load-items":w,"sort-keys":["original","name","name_desc"],path:i.path,"allow-key-hooks":!0,icon:"mdi-folder-outline",title:k.value},{title:V(()=>[C("div",D,[(l(!0),n(E,null,S(h.value,(t,s)=>(l(),n("span",{key:s,class:"breadcrumb-segment"},[t.clickable?(l(),n("button",{key:0,class:"breadcrumb-link",onClick:r=>g(t.path)},f(t.text),9,O)):(l(),n("span",T,f(t.text),1)),s<h.value.length-1?(l(),F(L,{key:2,icon:"mdi-chevron-right",size:"small",class:"breadcrumb-separator"})):P("",!0)]))),128))])]),_:1},8,["show-select-button","path","title"])]))}}),et=q(z,[["__scopeId","data-v-c0cbe0e2"]]);export{et as default};
