import{I as x}from"./ItemsListing-p3UDrkaz.js";import{ay as B,b_ as I,J as N,i as d,aP as b,az as l,aA as r,o as P,aG as V,E as C,ah as E,aH as S,aI as L,aB as F,aN as f,aL as j,bn as k,aQ as z,_ as D}from"./index-D-FY8Yx2.js";import"./Container-C7DumkgJ.js";import"./index-kQIztB-E.js";import"./Toolbar-CxAnowGj.js";import"./VToolbar-BGzu4h11.js";import"./Button-B57MCuAc.js";import"./ListItem-CX5q61ih.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-B1j6uBGW.js";import"./MediaItemThumb-CzEoSAF3.js";import"./VCheckbox-W6o6QHjE.js";import"./VCheckboxBtn-DpMGI-si.js";import"./VSelectionControl-CyrHFsUF.js";import"./PanelviewItemCompact-BY3CNldl.js";import"./userPreferences-7uBq50Yx.js";import"./VInfiniteScroll-CRxNfWga.js";import"./VVirtualScroll-cGuYysLa.js";const O={class:"breadcrumb-container"},T=["onClick"],q={key:1,class:"breadcrumb-text"},A=B({__name:"BrowseView",props:{path:{}},setup(i){const s=i,{t:w}=I(),h=N(!1),g=d(()=>""),m=d(()=>{const e=[];if(e.push({text:w("browse"),path:null,clickable:s.path&&s.path!=="root"||!1}),s.path&&s.path!=="root")if(s.path.includes("://")){const[a,t]=s.path.split("://"),o=a+"://",n=b.getProviderName(a);if(e.push({text:n,path:o,clickable:t&&t.length>0||!1}),t&&t.length>0){const c=t.split("/").filter(p=>p.length>0);c.forEach((p,u)=>{const _=o+c.slice(0,u+1).join("/");e.push({text:p,path:_,clickable:u<c.length-1})})}}else{const a=s.path.split("/").filter(t=>t.length>0);a.forEach((t,o)=>{const n=a.slice(0,o+1).join("/");e.push({text:t,path:n,clickable:o<a.length-1})})}return e}),v=async function(e){const a=await b.browse(s.path);return h.value=a.every(t=>t.media_type===z.FOLDER),a},y=e=>{e===null?k.push({name:"browse"}):k.push({name:"browse",query:{path:e}})};return(e,a)=>(r(),l("section",null,[P(x,{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"&&!h.value),"load-items":v,"sort-keys":["original","name","name_desc"],path:i.path,"allow-key-hooks":!0,icon:"mdi-folder-outline",title:g.value},{title:V(()=>[C("div",O,[(r(!0),l(E,null,S(m.value,(t,o)=>(r(),l("span",{key:o,class:"breadcrumb-segment"},[t.clickable?(r(),l("button",{key:0,class:"breadcrumb-link",onClick:n=>y(t.path)},f(t.text),9,T)):(r(),l("span",q,f(t.text),1)),o<m.value.length-1?(r(),L(j,{key:2,icon:"mdi-chevron-right",size:"small",class:"breadcrumb-separator"})):F("",!0)]))),128))])]),_:1},8,["show-select-button","path","title"])]))}}),ot=D(A,[["__scopeId","data-v-15caa508"]]);export{ot as default};
