import{I as x}from"./ItemsListing-Cnfrbqt8.js";import{az as B,b8 as E,J as F,i as b,bc as d,aP as l,aG as r,o as I,aH as P,E as V,ah as C,b5 as N,aE as S,aF as L,aK as j,aW as f,bp as z,bK as k,bd as D,_ as K}from"./index-D2rF_80D.js";import{F as O}from"./folder-BWSuatVc.js";import"./Container-C7yRkeCv.js";import"./index-kQIztB-E.js";import"./Toolbar-C66D0zTJ.js";import"./VToolbar-Db4qfa2C.js";import"./Button-CrfR8Gdt.js";import"./ListItem-CU9QYmiw.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-cf4_7ViH.js";import"./MediaItemThumb-A-03axGx.js";import"./VCheckbox-DccbdgFZ.js";import"./VCheckboxBtn-Dik76WyM.js";import"./VSelectionControl-BHjDOTFl.js";import"./PanelviewItemCompact-BWonx8dk.js";import"./userPreferences-DWdlmlmR.js";import"./VInfiniteScroll-CfzetGUD.js";import"./VVirtualScroll-CG155sfU.js";import"./createLucideIcon-Bb8oGlVw.js";const T={class:"breadcrumb-container"},q=["onClick"],G={key:1,class:"breadcrumb-text"},H=B({__name:"BrowseView",props:{path:{}},setup(i){const s=i,{t:w}=E(),m=F(!1),g=b(()=>""),h=b(()=>{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=d.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 d.browse(s.path);return m.value=a.every(t=>t.media_type===D.FOLDER),a},y=e=>{e===null?k.push({name:"browse"}):k.push({name:"browse",query:{path:e}})};return(e,a)=>(r(),l("section",null,[I(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"&&!m.value),"load-items":v,"sort-keys":["original","name","name_desc"],path:i.path,"allow-key-hooks":!0,icon:S(O),title:g.value},{title:P(()=>[V("div",T,[(r(!0),l(C,null,N(h.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,q)):(r(),l("span",G,f(t.text),1)),o<h.value.length-1?(r(),L(z,{key:2,icon:"mdi-chevron-right",size:"small",class:"breadcrumb-separator"})):j("",!0)]))),128))])]),_:1},8,["show-select-button","path","icon","title"])]))}}),nt=K(H,[["__scopeId","data-v-e24b2804"]]);export{nt as default};
