import{I as l}from"./ItemsListing-keNBrjpI.js";import{s as a,c as i,E as p}from"./index-BLv_cVPe.js";import{d as m,r as s,o as c,a2 as f,D as b,e as v,B as _,au as y}from"./lucide-HyGez5Zv.js";import"./Container-DySRWSfy.js";import"./index-kQIztB-E.js";import"./vuetify-yEPBoF3Y.js";import"./utils-CDN07tui.js";import"./Toolbar-Cs3Ri6QA.js";import"./userPreferences-Czh8uxxY.js";import"./vue-router-C7O20l--.js";import"./Button-Dz5MD8ug.js";import"./ListItem-16B2OtPJ.js";import"./NowPlayingBadge.vue_vue_type_style_index_0_lang-DB17GpIJ.js";import"./MediaItemThumb-Cr2zMcYO.js";import"./ProviderIcon.vue_vue_type_style_index_0_lang-OH5dLZPC.js";import"./vue-i18n-DNkvfXep.js";import"./PanelviewItemCompact-DoaNBmSV.js";import"./qrcode-KkxXbdQY.js";import"./marked-C0Rlrcoy.js";import"./color-BTziYnFN.js";import"./vueuse-BNomjQ9q.js";/* empty css            */import"./swiper-tkTn_dS7.js";const H=m({name:"Audiobooks",__name:"LibraryAudiobooks",setup(k){const e=s(!1),t=s(a.libraryAudiobooksCount),n=["name","name_desc","sort_name","sort_name_desc","timestamp_added","timestamp_added_desc","timestamp_modified","timestamp_modified_desc","last_played","last_played_desc","play_count","play_count_desc"],d=async function(o){return e.value=!1,u(o),await i.getLibraryAudiobooks(o.favoritesOnly||void 0,o.search,o.limit,o.offset,o.sortBy,o.provider&&o.provider.length>0?o.provider:void 0)},u=async function(o){if(!o.favoritesOnly&&!o.provider){t.value=a.libraryAudiobooksCount;return}if(o.provider&&o.provider.length>0){t.value=void 0;return}t.value=await i.getLibraryAudiobooksCount(o.favoritesOnly||!1)};return c(()=>{const o=i.subscribe(p.MEDIA_ITEM_ADDED,r=>{r.object_id?.startsWith("library://audiobook")&&(e.value=!0)});f(o)}),(o,r)=>(v(),b(l,{itemtype:"audiobooks",path:"libraryaudiobooks","show-duration":!1,"show-provider":!0,"show-favorites-only-filter":!0,"load-paged-data":d,"show-library":!0,"sort-keys":n,"update-available":e.value,title:o.$t("audiobooks"),"allow-key-hooks":!0,"show-search-button":!0,icon:_(y),"restore-state":!0,total:t.value,"show-provider-filter":!0},null,8,["update-available","title","icon","total"]))}});export{H as default};
