import{I as y}from"./ItemsListing-ByrUsYKd.js";import{d as _,bx as x,r as B,O as u,c as l,b as I,w as V,o as i,a as C,F as S,g as E,h as F,e as P,t as b,j,bb as d,v as L,M as N}from"./index-CD7iYaFT.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Container-ClW3AMEw.js";import"./index-CBho6rsP.js";import"./VContainer-DFqPxZ0T.js";/* empty css              */import"./Toolbar-B7AWyK9d.js";import"./VToolbar-BQejIjUR.js";import"./VBtn-B0XatuYF.js";import"./Button-BUjpiwEZ.js";import"./ListItem-C-HNqEeC.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-Dl2aFjrE.js";import"./VInput-DDFZ8lhb.js";import"./MediaItemThumb-BVMzVj0K.js";import"./PanelviewItemCompact-DmP5jPAL.js";import"./VSpacer-B8t0Vh55.js";import"./VTextField-CVfOZKc3.js";import"./VInfiniteScroll-DHXPR3PY.js";import"./layout-BCm0QQDS.js";import"./VRow-DFe5cA7D.js";import"./VVirtualScroll-BREm3RjH.js";import"./VAlert-cuze2JsR.js";const D={class:"breadcrumb-container"},M=["onClick"],T={key:1,class:"breadcrumb-text"},q=_({__name:"BrowseView",props:{path:{}},setup(n){const o=n,{t:f}=x(),p=B(!1),k=u(()=>""),m=u(()=>{const e=[];if(e.push({text:f("browse"),path:null,clickable:o.path&&o.path!=="root"||!1}),o.path&&o.path!=="root")if(o.path.includes("://")){const[s,t]=o.path.split("://"),a=s+"://";if(e.push({text:a,path:a,clickable:t&&t.length>0||!1}),t&&t.length>0){const r=t.split("/").filter(c=>c.length>0);r.forEach((c,h)=>{const v=a+r.slice(0,h+1).join("/");e.push({text:c,path:v,clickable:h<r.length-1})})}}else{const s=o.path.split("/").filter(t=>t.length>0);s.forEach((t,a)=>{const r=s.slice(0,a+1).join("/");e.push({text:t,path:r,clickable:a<s.length-1})})}return e}),w=async function(e){const s=await L.browse(o.path);return p.value=s.every(t=>t.media_type===N.FOLDER),s},g=e=>{e===null?d.push({name:"browse"}):d.push({name:"browse",query:{path:e}})};return(e,s)=>(i(),l("section",null,[I(y,{itemtype:"browse","show-provider":!1,"show-library":!1,"show-favorites-only-filter":!1,"show-track-number":!1,"show-select-button":!!(n.path&&n.path!="root"&&!p.value),"load-items":w,"sort-keys":["original","name","name_desc"],path:n.path,"allow-key-hooks":!0,icon:"mdi-folder-outline",title:k.value},{title:V(()=>[C("div",D,[(i(!0),l(S,null,E(m.value,(t,a)=>(i(),l("span",{key:a,class:"breadcrumb-segment"},[t.clickable?(i(),l("button",{key:0,class:"breadcrumb-link",onClick:r=>g(t.path)},b(t.text),9,M)):(i(),l("span",T,b(t.text),1)),a<m.value.length-1?(i(),F(j,{key:2,icon:"mdi-chevron-right",size:"small",class:"breadcrumb-separator"})):P("",!0)]))),128))])]),_:1},8,["show-select-button","path","title"])]))}}),ct=O(q,[["__scopeId","data-v-c0cbe0e2"]]);export{ct as default};
