import{I as h,_ as x}from"./ProviderDetails.vue_vue_type_style_index_0_lang-IDW8d92N.js";import{C as g}from"./Container-LvH0QRIT.js";import{T as w}from"./Toolbar-BVGuuXVD.js";import{G as b,j as E,c as v,E as V}from"./index-HFEfURXv.js";import{e as A,b as T,c as B,g as M}from"./vuetify-ffr1lJCG.js";import{d as y,r as _,c as N,b as u,e as t,H as m,D as d,I as p,E as l,F as C,M as $,B as k,_ as f,f as I,Z as L,w as F,o as H,a1 as S}from"./lucide-sS6c3snl.js";import"./marquee_text_sync-BgCfvceK.js";import"./vue-router-CDtPtBGv.js";import"./MediaItemThumb-D4l-2_B4.js";import"./ListItem-C-8fkaRP.js";import"./Button-Dcdmvtuy.js";import"./index-kQIztB-E.js";import"./vue-i18n-h4EBIvPF.js";import"./qrcode-Dq-byqKu.js";import"./marked-C0Rlrcoy.js";import"./color-BTziYnFN.js";import"./vueuse-B-HgI0gk.js";/* empty css            */import"./swiper-BtP4dEja.js";const U={style:{"margin-bottom":"10px"}},j={style:{width:"50px"}},G={key:0,class:"text-caption"},P=y({__name:"Chapters",props:{itemDetails:{}},setup(r){const a=r,o=_(!0),e=function(){o.value=!o.value},c=N(()=>[{label:"tooltip.collapse_expand",icon:o.value?"mdi-chevron-up":"mdi-chevron-down",action:e,overflowAllowed:!1}]),s=function(n){!a.itemDetails||!b(a.itemDetails)||v.playMedia(a.itemDetails.uri,void 0,void 0,n.position.toString())};return(n,D)=>(t(),u("section",U,[m(w,{title:n.$t("chapters"),"menu-items":c.value,onTitleClicked:e},null,8,["title","menu-items"]),m(A),o.value?(t(),d(g,{key:0},{default:l(()=>[m(T,null,{default:l(()=>[(t(!0),u(C,null,$(r.itemDetails?.metadata?.chapters,i=>(t(),d(B,{key:i.position,disabled:!k(b)(r.itemDetails),onClick:Z=>s(i)},{prepend:l(()=>[I("div",j,[m(M,null,{default:l(()=>[L(f(i.position),1)]),_:2},1024)])]),title:l(()=>[I("div",null,f(i.name),1)]),append:l(()=>[i.end?(t(),u("span",G,f(k(E)(i.end-i.start)),1)):p("",!0)]),_:2},1032,["disabled","onClick"]))),128))]),_:1})]),_:1})):p("",!0)]))}}),me=y({__name:"AudiobookDetails",props:{itemId:{},provider:{}},setup(r){const a=r,o=_(!1),e=_(),c=async function(){e.value=await v.getAudiobook(a.itemId,a.provider)};return F(()=>a.itemId,s=>{s&&c()},{immediate:!0}),H(()=>{const s=v.subscribe(V.MEDIA_ITEM_UPDATED,n=>{const D=n.data;e.value?.uri==D.uri&&(o.value=!0)});S(s)}),(s,n)=>(t(),u(C,null,[m(h,{item:e.value},null,8,["item"]),e.value&&e.value.metadata?.chapters?(t(),d(P,{key:0,"item-details":e.value},null,8,["item-details"])):p("",!0),e.value?(t(),d(x,{key:1,"item-details":e.value},null,8,["item-details"])):p("",!0)],64))}});export{me as default};
