diff --git a/htdocs/assets/index.js b/htdocs/assets/index.js index 2528d6e4..f0a05e45 100644 --- a/htdocs/assets/index.js +++ b/htdocs/assets/index.js @@ -76,7 +76,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins font-size="${t.size/3}" fill="${n}"> ${t.caption} - `;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(s)}`},I$={name:"ControlImage",props:{caption:{default:"",type:String},url:{default:"",type:String}},emits:["click"],data(){return{font:{family:"sans-serif",weight:"bold"},size:600}},computed:{source(){return{lifecycle:{error:t=>{t.src=this.uri}},src:this.url||this.uri}},uri(){return x$({alternate:this.caption,caption:this.caption.substring(0,2),font:this.font,size:this.size})}}},N$={class:"figure has-shadow is-clickable"};function P$(t,e,n,s,i,r){const o=Wh("lazy");return O(),F("figure",N$,[hs(P("img",{onClick:e[0]||(e[0]=a=>t.$emit("click"))},null,512),[[o,r.source]])])}const Hr=nt(I$,[["render",P$],["__scopeId","data-v-e43b98b9"]]),{t:Wl,locale:D$}=Bs.global,mS="NO_INDEX",M$=(t,e)=>t-e,L$=(t,e)=>t.localeCompare(e,D$.value),R$=(t,e)=>{const n=Date.parse(t),s=Date.parse(e),i=isNaN(n),r=isNaN(s);return i&&r?0:i&&1||r&&-1||n-s},$$=t=>t.map(({field:e,type:n,order:s=1})=>{switch(n){case String:return(i,r)=>L$(i[e],r[e])*s;case Number:return(i,r)=>M$(i[e],r[e])*s;case Date:return(i,r)=>R$(i[e],r[e])*s;default:return()=>0}}),F$=(t="")=>{const e=t.charAt(0);return e.match(new RegExp("\\p{Letter}","gu"))?e.toUpperCase():e.match(new RegExp("\\p{Number}","gu"))?"#":"⌘"},V$=t=>{},H$=[{difference:NaN,text:()=>Wl("grouped-list.undefined")},{difference:864e5,text:()=>Wl("grouped-list.today")},{difference:6048e5,text:()=>Wl("grouped-list.last-week")},{difference:2592e6,text:()=>Wl("grouped-list.last-month")},{difference:1/0,text:t=>t.getFullYear()}],U$=t=>{var s;const e=new Date(t),n=new Date-e;return(s=H$.find(i=>isNaN(n)||n{switch(e){case String:return n=>F$(n[t]);case Number:return n=>n[t];case Date:return n=>U$(n[t]);case"Digits":return n=>V$(n[t]);default:return()=>mS}};class Tt{constructor({items:e=[],total:n=0,offset:s=0,limit:i=-1}={},r={}){this.items=e,this.total=n,this.offset=s,this.limit=i,this.count=e.length,this.indices=[],this.group(r)}group({criteria:e=[],filters:n=[],index:s}={}){const i=this.items.filter(l=>n.every(c=>c(l)));this.count=i.length;const r=$$(e),o=i.sort((l,c)=>r.reduce((u,d)=>u||d(l,c),0)),a=j$(s);return this.itemsGrouped=o.reduce((l,c)=>{const u=a(c);return l.set(u,[...l.get(u)||[],c]),l},new Map),this.indices=Array.from(this.itemsGrouped.keys()),this}*generate(){for(const[e,n]of this.itemsGrouped.entries()){e!==mS&&(yield{index:e,isItem:!1,item:{},itemId:e});for(const s of n)yield{index:e,isItem:!0,item:s,itemId:s.id}}}[Symbol.iterator](){return this.generate()}}const sm={name:"ControlProgress",props:{size:{default:36,type:Number},value:{default:0,type:Number}},computed:{offset(){return 1-this.value},progress(){return`${Math.round(this.value*100)}%`}}},yb=()=>{Jh(t=>({"3ce61f74":t.offset}))},bb=sm.setup;sm.setup=bb?(t,e)=>(yb(),bb(t,e)):yb;const B$={class:"is-flex"},W$=["width","height"],G$=["textContent"];function K$(t,e,n,s,i,r){return O(),F("div",B$,[(O(),F("svg",{width:n.size,height:n.size,viewBox:"0 0 200 200"},[e[0]||(e[0]=P("defs",null,[P("circle",{id:"circle",cx:"50%",cy:"50%",pathLength:"1",r:"90"})],-1)),e[1]||(e[1]=P("use",{href:"#circle",class:"progress-base"},null,-1)),e[2]||(e[2]=P("use",{href:"#circle",class:"progress-bar"},null,-1)),P("text",{x:"50%",y:"50%",class:"is-size-1 progress-text",textContent:et(r.progress)},null,8,G$)],8,W$))])}const z$=nt(sm,[["render",K$],["__scopeId","data-v-06c7995f"]]),q$={name:"ListItem",components:{ControlImage:Hr,ControlProgress:z$},props:{icon:{default:null,type:String},image:{default:null,type:Object},index:{default:null,type:[String,Number]},isItem:{default:!0,type:Boolean},isPlayable:{default:!0,type:Boolean},isRead:{default:!1,type:Boolean},lines:{default:null,type:Array},progress:{default:null,type:Number}},emits:["open","openDetails"],methods:{open(){this.$emit("open")},openDetails(){this.$emit("openDetails")}}},X$={key:0,class:"py-5"},Y$={class:"media-content"},Z$=["id","textContent"],J$={class:"media-content"},Q$=["textContent"],t5={key:0,class:"is-size-7 has-text-grey"},e5={key:2,class:"media-right"},n5={class:"media-right"};function s5(t,e,n,s,i,r){const o=w("mdicon"),a=w("control-image"),l=w("control-progress");return n.isItem?(O(),F("div",{key:1,class:Gt(["media is-align-items-center mb-0",{"is-clickable":n.isPlayable,"is-not-allowed":!n.isPlayable}]),onClick:e[1]||(e[1]=(...c)=>r.open&&r.open(...c))},[n.icon?(O(),yt(o,{key:0,class:"media-left icon",name:n.icon},null,8,["name"])):_t("",!0),n.image?(O(),yt(a,{key:1,url:n.image.url,caption:n.image.caption,class:"media-left is-small"},null,8,["url","caption"])):_t("",!0),P("div",J$,[(O(!0),F(it,null,de(n.lines,(c,u)=>(O(),F("div",{key:u,class:Gt({"is-size-6":u===0,"is-size-7":u!==0,"has-text-weight-bold":u!==2,"has-text-grey":(u!==0||n.isRead)&&n.isPlayable,"has-text-grey-light":!n.isPlayable}),textContent:et(c)},null,10,Q$))),128)),n.isPlayable?_t("",!0):(O(),F("div",t5,[le(t.$slots,"reason",{},void 0,!0)]))]),n.progress?(O(),F("div",e5,[E(l,{value:n.progress},null,8,["value"])])):_t("",!0),P("div",n5,[P("a",{onClick:e[0]||(e[0]=jn((...c)=>r.openDetails&&r.openDetails(...c),["prevent","stop"]))},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})])])],2)):(O(),F("div",X$,[P("div",Y$,[P("span",{id:`index_${n.index}`,class:"tag is-small has-text-weight-bold",textContent:et(n.index)},null,8,Z$)])]))}const Ls=nt(q$,[["render",s5],["__scopeId","data-v-8ec36f11"]]),i5={name:"ListProperties",components:{ControlImage:Hr},props:{item:{required:!0,type:Object}}},r5=["textContent"],o5={class:"title is-6"},a5=["onClick","textContent"],l5=["textContent"];function c5(t,e,n,s,i,r){var a;const o=w("control-image");return O(),F(it,null,[n.item.image?(O(),yt(o,{key:0,url:n.item.image,caption:n.item.name,class:"is-normal mb-5"},null,8,["url","caption"])):_t("",!0),t.$slots.buttons?le(t.$slots,"buttons",{key:1}):_t("",!0),(O(!0),F(it,null,de((a=n.item.properties)==null?void 0:a.filter(l=>l.value),l=>(O(),F("div",{key:l.key,class:"mb-3"},[P("div",{class:"is-size-7 is-uppercase",textContent:et(t.$t(l.key))},null,8,r5),P("div",o5,[l.handler?(O(),F("a",{key:0,onClick:l.handler,textContent:et(l.value)},null,8,a5)):(O(),F("span",{key:1,class:"title is-6",textContent:et(l.value)},null,8,l5))])]))),128))],64)}const gS=nt(i5,[["render",c5]]),u5={name:"ModalDialogPlayable",components:{ControlButton:cn,ListProperties:gS,ModalDialog:sr},props:{buttons:{default:()=>[],type:Array},item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{actions(){return[{handler:this.addToQueue,icon:"playlist-plus",key:"actions.add"},{handler:this.addNextToQueue,icon:"playlist-play",key:"actions.add-next"},{handler:this.play,icon:"play",key:"actions.play"}]}},methods:{addNextToQueue(){this.$emit("close"),this.item.expression?ae.addExpression(this.item.expression,!0):ae.addUri(this.item.uris||this.item.uri,!0)},addToQueue(){this.$emit("close"),this.item.expression?ae.addExpression(this.item.expression):ae.addUri(this.item.uris||this.item.uri)},play(){this.$emit("close"),this.item.expression?ae.playExpression(this.item.expression,!1):ae.playUri(this.item.uris||this.item.uri,!1)}}},d5={class:"buttons"};function f5(t,e,n,s,i,r){const o=w("control-button"),a=w("list-properties"),l=w("modal-dialog");return O(),yt(l,{actions:r.actions,show:n.show,title:n.item.name,onClose:e[0]||(e[0]=c=>t.$emit("close"))},{content:R(()=>[E(a,{item:n.item},sl({_:2},[n.buttons.length?{name:"buttons",fn:R(()=>[P("div",d5,[(O(!0),F(it,null,de(n.buttons,c=>(O(),yt(o,{key:c.key,button:c},null,8,["button"]))),128))])]),key:"0"}:void 0]),1032,["item"])]),_:1},8,["actions","show","title"])}const gs=nt(u5,[["render",f5]]),h5={name:"ModalDialogTrack",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close","play-count-changed"],computed:{buttons(){return this.item.media_kind!=="podcast"?[]:this.item.play_count>0?[{handler:this.markAsNew,key:"actions.mark-as-new"}]:[{handler:this.markAsPlayed,key:"actions.mark-as-played"}]},playable(){return{name:this.item.title,properties:[{handler:this.openAlbum,key:"property.album",value:this.item.album},{handler:this.openArtist,key:"property.album-artist",value:this.item.album_artist},{key:"property.composer",value:this.item.composer},{key:"property.release-date",value:this.$formatters.toDate(this.item.date_released)},{key:"property.year",value:this.item.year},{key:"property.genre",value:this.item.genre},{key:"property.position",value:this.item.track_number>0&&[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.item.length_ms>0&&this.$formatters.toTimecode(this.item.length_ms)},{key:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{key:"property.quality",value:this.item.data_kind!=="spotify"&&this.$t("dialog.track.quality-value",{bitrate:this.item.bitrate,count:this.item.channels,format:this.item.type,samplerate:this.item.samplerate})},{key:"property.added-on",value:this.$formatters.toDateTime(this.item.time_added)},{key:"property.rating",value:this.$t("dialog.track.rating-value",{rating:Math.floor(this.item.rating/10)})},{key:"property.comment",value:this.item.comment},{key:"property.path",value:this.item.path}],uri:this.item.uri}}},methods:{markAsNew(){Ct.updateTrack(this.item.id,{play_count:"reset"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},markAsPlayed(){Ct.updateTrack(this.item.id,{play_count:"increment"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},openAlbum(){this.$emit("close"),this.item.media_kind==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.album_id}}):this.item.media_kind==="audiobook"?this.$router.push({name:"audiobook-album",params:{id:this.item.album_id}}):this.item.media_kind==="music"&&this.$router.push({name:"music-album",params:{id:this.item.album_id}})},openArtist(){this.$emit("close"),this.item.media_kind==="music"||this.item.media_kind==="podcast"?this.$router.push({name:"music-artist",params:{id:this.item.album_artist_id}}):this.item.media_kind==="audiobook"&&this.$router.push({name:"audiobook-artist",params:{id:this.item.album_artist_id}})},openGenre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{mediaKind:this.item.media_kind}})}}};function p5(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{buttons:r.buttons,item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["buttons","item","show"])}const m5=nt(h5,[["render",p5]]),g5={name:"ListTracks",components:{ListItem:Ls,ModalDialogTrack:m5},props:{expression:{default:"",type:String},icon:{default:null,type:String},items:{default:null,type:Object},load:{default:null,type:Function},showProgress:{default:!1,type:Boolean},uris:{default:"",type:String}},emits:["play-count-changed"],data(){return{selectedItem:{},showDetailsModal:!1}},methods:{isRead(t){return t.media_kind==="podcast"&&t.play_count>0},open(t){this.uris?ae.playUri(this.uris,!1,this.items.items.indexOf(t)):this.expression?ae.playExpression(this.expression,!1,this.items.items.indexOf(t)):ae.playUri(t.uri,!1)},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0},progress(t){return this.showProgress&&t.seek_ms>0?t.seek_ms/t.length_ms:null}}};function y5(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-track");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,icon:n.icon,"is-item":l.isItem,"is-read":r.isRead(l.item),index:l.index,lines:[l.item.title,l.item.artist,l.item.album],progress:r.progress(l.item),onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["icon","is-item","is-read","index","lines","progress","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1),onPlayCountChanged:e[1]||(e[1]=l=>t.$emit("play-count-changed"))},null,8,["item","show"])],64)}const Jn=nt(g5,[["render",y5]]),b5={name:"ModalDialogAlbum",components:{ModalDialog:sr,ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},mediaKind:{default:"",type:String},show:Boolean},emits:["close","play-count-changed","podcast-deleted"],data(){return{showRemovePodcastModal:!1}},computed:{actions(){return[{handler:this.cancel,icon:"cancel",key:this.$t("actions.cancel")},{handler:this.removePodcast,icon:"delete",key:this.$t("actions.remove")}]},buttons(){return this.computedMediaKind==="podcast"?this.item.data_kind==="url"?[{handler:this.markAsPlayed,key:"actions.mark-as-played"},{handler:this.openRemovePodcastDialog,key:"actions.remove"}]:[{handler:this.markAsPlayed,key:"actions.mark-as-played"}]:[]},computedMediaKind(){return this.mediaKind||this.item.media_kind},playable(){return{image:this.item.artwork_url,name:this.item.name,properties:[{handler:this.openArtist,key:"property.artist",value:this.item.artist},{key:"property.release-date",value:this.$formatters.toDate(this.item.date_released)},{key:"property.year",value:this.item.year},{key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)},{key:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{key:"property.added-on",value:this.$formatters.toDateTime(this.item.time_added)}],uri:this.item.uri}}},methods:{cancel(){this.showRemovePodcastModal=!1},markAsPlayed(){Ct.updateAlbum(this.item.id,{play_count:"played"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},openArtist(){this.$emit("close"),this.$router.push({name:`${this.computedMediaKind}-artist`,params:{id:this.item.artist_id}})},openRemovePodcastDialog(){this.showRemovePodcastModal=!0,this.showDetailsModal=!1},removePodcast(){this.showRemovePodcastModal=!1,Ct.albumTracks(this.item.id,{limit:1}).then(t=>{Ct.trackPlaylists(t.items[0].id).then(e=>{const{id:n}=e.items.find(s=>s.type==="rss");Ct.playlistDelete(n).then(()=>{this.$emit("podcast-deleted"),this.$emit("close")})})})}}},v5=["textContent"];function _5(t,e,n,s,i,r){const o=w("modal-dialog-playable"),a=w("i18n-t"),l=w("modal-dialog");return O(),F(it,null,[E(o,{buttons:r.buttons,item:r.playable,show:n.show,onClose:e[0]||(e[0]=c=>t.$emit("close"))},null,8,["buttons","item","show"]),E(l,{actions:r.actions,show:i.showRemovePodcastModal,title:t.$t("dialog.podcast.remove.title"),onClose:e[1]||(e[1]=c=>i.showRemovePodcastModal=!1),onRemove:r.removePodcast},{content:R(()=>[E(a,{tag:"p",keypath:"dialog.podcast.remove.info",scope:"global"},{separator:R(()=>e[2]||(e[2]=[P("br",null,null,-1)])),name:R(()=>[P("b",{textContent:et(n.item.name)},null,8,v5)]),_:1})]),_:1},8,["actions","show","title","onRemove"])],64)}const ud=nt(b5,[["render",_5]]),S5={name:"PaneHero",components:{ControlButton:cn},props:{content:{required:!0,type:Object}}},E5=["textContent"],w5={class:"subtitle is-6"},k5=["textContent"],T5=["textContent"],C5={class:"buttons is-centered-mobile mt-5"};function A5(t,e,n,s,i,r){const o=w("control-button");return O(),F(it,null,[P("div",{class:"title is-5",textContent:et(n.content.title)},null,8,E5),P("div",w5,[P("a",{onClick:e[0]||(e[0]=(...a)=>n.content.handler&&n.content.handler(...a)),textContent:et(n.content.subtitle)},null,8,k5)]),P("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:et(n.content.count)},null,8,T5),P("div",C5,[(O(!0),F(it,null,de(n.content.actions,(a,l)=>(O(),yt(o,{key:l,button:a},null,8,["button"]))),128))])],64)}const dd=nt(S5,[["render",A5]]),O5={name:"PageAlbum",components:{ContentWithHero:cd,ControlImage:Hr,ListTracks:Jn,ModalDialogAlbum:ud,PaneHero:dd},beforeRouteEnter(t,e,n){Promise.all([Ct.album(t.params.id),Ct.albumTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.album=s,r.tracks=new Tt(i,{criteria:[{field:"disc_number",type:Number}],index:{field:"disc_number",type:Number}}),r.tracks.indices.length<2&&r.tracks.group()})})},data(){return{album:{},showDetailsModal:!1,tracks:new Tt}},computed:{heading(){return{count:this.$t("data.tracks",{count:this.album.track_count}),handler:this.openArtist,subtitle:this.album.artist,title:this.album.name,actions:[{handler:this.play,icon:"shuffle",key:"actions.shuffle"},{handler:this.openDetails,icon:"dots-horizontal"}]}}},methods:{openArtist(){this.showDetailsModal=!1,this.$router.push({name:"music-artist",params:{id:this.album.artist_id}})},openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.album.uri,!0)}}};function x5(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks"),c=w("content-with-hero"),u=w("modal-dialog-album");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),image:R(()=>[E(a,{url:i.album.artwork_url,caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]),content:R(()=>[E(l,{items:i.tracks,uris:i.album.uri},null,8,["items","uris"])]),_:1}),E(u,{item:i.album,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const I5=nt(O5,[["render",x5]]);function N5(t){return t.scrollHeight}function P5(t){return t.scrollWidth}function D5(t,e){t.scrollTop=t.scrollHeight-e+t.scrollTop}function M5(t,e){t.scrollLeft=t.scrollWidth-e+t.scrollLeft}const L5=P("div",{class:"loading"},"Loading...",-1),R5=P("div",{class:"no-more"},"No more.",-1),$5=P("div",{class:"no-results"},"No results.",-1),F5=P("div",{class:"error"},"Error.",-1),V5=ki({__name:"VueEternalLoading",props:{load:{required:!0,type:Function},isInitial:{required:!1,type:Boolean,default:!0},position:{required:!1,type:String,default:"default"},container:{required:!1,type:Object,default:null},margin:{required:!1,type:String,default:void 0}},emits:["update:isInitial"],setup(t,{emit:e}){const n=t,s=os();let i=os("loading"),r=os(n.isInitial),o=0;function a(){$r(()=>{var g,v;n.position==="top"?D5((g=n.container)!=null?g:document.documentElement,o):n.position==="left"&&M5((v=n.container)!=null?v:document.documentElement,o)})}function l(g,v){return g===0?r.value?(u(),"no-results"):(c(),"no-more"):g!==void 0&&v!==void 0&&g{var v,S;g.isIntersecting&&(n.position==="top"?o=N5((v=n.container)!=null?v:document.documentElement):n.position==="left"&&(o=P5((S=n.container)!=null?S:document.documentElement)),m(),n.load({loaded:l,noMore:c,noResults:u,error:d},{isFirstLoad:r.value}))},{root:n.container,threshold:0,rootMargin:n.margin})}let _;return typeof IntersectionObserver<"u"&&s1(()=>{_&&m(),_=y(),b()},{flush:"post"}),Xn(()=>n.isInitial,g=>{g&&f()}),Xn(r,g=>{g||e("update:isInitial",!1)}),(g,v)=>(O(),F("div",{class:"vue-eternal-loading",ref_key:"rootRef",ref:s},[Fn(i)==="loading"?le(g.$slots,"loading",ro(ao({key:0},{isFirstLoad:Fn(r)})),()=>[L5]):Fn(i)==="no-more"?le(g.$slots,"no-more",ro(ao({key:1},{retry:h})),()=>[R5]):Fn(i)==="no-results"?le(g.$slots,"no-results",ro(ao({key:2},{retry:h})),()=>[$5]):Fn(i)==="error"?le(g.$slots,"error",ro(ao({key:3},{retry:h})),()=>[F5]):_t("",!0)],512))}}),H5={name:"LoaderListItem",components:{VueEternalLoading:V5},props:{load:{default:null,type:Function}}},U5={class:"columns is-centered"},j5={class:"column has-text-centered"};function B5(t,e,n,s,i,r){const o=w("mdicon"),a=w("vue-eternal-loading");return n.load?(O(),yt(a,{key:0,load:n.load},{loading:R(()=>[P("div",U5,[P("div",j5,[E(o,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":R(()=>e[0]||(e[0]=[P("br",null,null,-1)])),"no-results":R(()=>e[1]||(e[1]=[P("br",null,null,-1)])),_:1},8,["load"])):_t("",!0)}const fd=nt(H5,[["render",B5]]),W5={name:"ModalDialogTrackSpotify",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t;return this.item.artists?{name:this.item.name,properties:[{handler:this.openAlbum,key:"property.album",value:this.item.album.name},{handler:this.openArtist,key:"property.album-artist",value:(t=this.item.artists[0])==null?void 0:t.name},{key:"property.release-date",value:this.$formatters.toDate(this.item.album.release_date)},{key:"property.position",value:[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.$formatters.toTimecode(this.item.duration_ms)},{key:"property.path",value:this.item.uri}],uri:this.item.uri}:{}}},methods:{openAlbum(){this.$emit("close"),this.$router.push({name:"music-spotify-album",params:{id:this.item.album.id}})},openArtist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function G5(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const K5=nt(W5,[["render",G5]]),z5={name:"ListTracksSpotify",components:{ListItem:Ls,LoaderListItem:fd,ModalDialogTrackSpotify:K5},props:{contextUri:{default:"",type:String},items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){t.is_playable&&ae.playUri(this.contextUri||t.uri,!1,t.position||0)},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}},q5=["textContent"],X5=["textContent"];function Y5(t,e,n,s,i,r){const o=w("list-item"),a=w("loader-list-item"),l=w("modal-dialog-track-spotify");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,c=>(O(),yt(o,{key:c.id,"is-playable":c.is_playable,lines:[c.name,c.artists[0].name,c.album.name],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},sl({_:2},[c.is_playable?void 0:{name:"reason",fn:R(()=>{var u;return[e[1]||(e[1]=qs(" (")),P("span",{textContent:et(t.$t("list.spotify.not-playable-track"))},null,8,q5),(u=c.restrictions)!=null&&u.reason?(O(),F("span",{key:0,textContent:et(t.$t("list.spotify.restriction-reason",{reason:c.restrictions.reason}))},null,8,X5)):_t("",!0),e[2]||(e[2]=qs(") "))]}),key:"0"}]),1032,["is-playable","lines","onOpen","onOpenDetails"]))),128)),E(a,{load:n.load},null,8,["load"]),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const im=nt(z5,[["render",Y5]]),Z5={name:"ModalDialogAlbumSpotify",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e,n,s,i,r;return{image:((n=(e=(t=this.item)==null?void 0:t.images)==null?void 0:e[0])==null?void 0:n.url)||"",name:this.item.name||"",properties:[{handler:this.openArtist,key:"property.artist",value:(r=(i=(s=this.item)==null?void 0:s.artists)==null?void 0:i[0])==null?void 0:r.name},{key:"property.release-date",value:this.$formatters.toDate(this.item.release_date)},{key:"property.type",value:this.item.album_type}],uri:this.item.uri}}},methods:{openArtist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function J5(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const yS=nt(Z5,[["render",J5]]);var nf={exports:{}},vb;function Q5(){return vb||(vb=1,function(t){var e=function(){var n="https://api.spotify.com/v1",s=null,i=null,r=function(f,h){return f.abort=h,f},o=function(f,h){var p;if(i!==null){var m=i.defer();f(function(b){m.resolve(b)},function(b){m.reject(b)}),p=m.promise}else window.Promise&&(p=new window.Promise(f));return p?new r(p,h):null},a=function(){var f=Array.prototype.slice.call(arguments),h=f[0],p=f.slice(1);return h=h||{},p.forEach(function(m){for(var b in m)m.hasOwnProperty(b)&&(h[b]=m[b])}),h},l=function(f,h){var p="";for(var m in h)if(h.hasOwnProperty(m)){var b=h[m];p+=encodeURIComponent(m)+"="+encodeURIComponent(b)+"&"}return p.length>0&&(p=p.substring(0,p.length-1),f=f+"?"+p),f},c=function(f,h){var p=new XMLHttpRequest,m=function(b,y){function _(k){b&&b(k),h&&h(null,k)}function g(){y&&y(p),h&&h(p,null)}var v=f.type||"GET";if(p.open(v,l(f.url,f.params)),s&&p.setRequestHeader("Authorization","Bearer "+s),p.onreadystatechange=function(){if(p.readyState===4){var k=null;try{k=p.responseText?JSON.parse(p.responseText):""}catch(I){console.error(I)}p.status>=200&&p.status<300?_(k):g()}},v==="GET")p.send(null);else{var S=null;f.postData&&(f.contentType==="image/jpeg"?(S=f.postData,p.setRequestHeader("Content-Type",f.contentType)):(S=JSON.stringify(f.postData),p.setRequestHeader("Content-Type","application/json"))),p.send(S)}};return h?(m(),null):o(m,function(){p.abort()})},u=function(f,h,p,m){var b={},y=null;typeof h=="object"?(b=h,y=p):typeof h=="function"&&(y=h);var _=f.type||"GET";return _!=="GET"&&f.postData&&!m?f.postData=a(f.postData,b):f.params=a(f.params,b),c(f,y)},d=function(){};return d.prototype={constructor:e},d.prototype.getGeneric=function(f,h){var p={url:f};return u(p,h)},d.prototype.getMe=function(f,h){var p={url:n+"/me"};return u(p,f,h)},d.prototype.getMySavedTracks=function(f,h){var p={url:n+"/me/tracks"};return u(p,f,h)},d.prototype.addToMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMySavedAlbums=function(f,h){var p={url:n+"/me/albums"};return u(p,f,h)},d.prototype.addToMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMyTopArtists=function(f,h){var p={url:n+"/me/top/artists"};return u(p,f,h)},d.prototype.getMyTopTracks=function(f,h){var p={url:n+"/me/top/tracks"};return u(p,f,h)},d.prototype.getMyRecentlyPlayedTracks=function(f,h){var p={url:n+"/me/player/recently-played"};return u(p,f,h)},d.prototype.followUsers=function(f,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.followArtists=function(f,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.followPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/followers",type:"PUT",postData:{}};return u(m,h,p)},d.prototype.unfollowUsers=function(f,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.unfollowArtists=function(f,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.unfollowPlaylist=function(f,h){var p={url:n+"/playlists/"+f+"/followers",type:"DELETE"};return u(p,h)},d.prototype.isFollowingUsers=function(f,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.isFollowingArtists=function(f,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.areFollowingPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/followers/contains",type:"GET",params:{ids:h.join(",")}};return u(m,p)},d.prototype.getFollowedArtists=function(f,h){var p={url:n+"/me/following",type:"GET",params:{type:"artist"}};return u(p,f,h)},d.prototype.getUser=function(f,h,p){var m={url:n+"/users/"+encodeURIComponent(f)};return u(m,h,p)},d.prototype.getUserPlaylists=function(f,h,p){var m;return typeof f=="string"?m={url:n+"/users/"+encodeURIComponent(f)+"/playlists"}:(m={url:n+"/me/playlists"},p=h,h=f),u(m,h,p)},d.prototype.getPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f};return u(m,h,p)},d.prototype.getPlaylistTracks=function(f,h,p){var m={url:n+"/playlists/"+f+"/tracks"};return u(m,h,p)},d.prototype.getPlaylistCoverImage=function(f,h){var p={url:n+"/playlists/"+f+"/images"};return u(p,h)},d.prototype.createPlaylist=function(f,h,p){var m={url:n+"/users/"+encodeURIComponent(f)+"/playlists",type:"POST",postData:h};return u(m,h,p)},d.prototype.changePlaylistDetails=function(f,h,p){var m={url:n+"/playlists/"+f,type:"PUT",postData:h};return u(m,h,p)},d.prototype.addTracksToPlaylist=function(f,h,p,m){var b={url:n+"/playlists/"+f+"/tracks",type:"POST",postData:{uris:h}};return u(b,p,m,!0)},d.prototype.replaceTracksInPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{uris:h}};return u(m,{},p)},d.prototype.reorderTracksInPlaylist=function(f,h,p,m,b){var y={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{range_start:h,insert_before:p}};return u(y,m,b)},d.prototype.removeTracksFromPlaylist=function(f,h,p){var m=h.map(function(y){return typeof y=="string"?{uri:y}:y}),b={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:m}};return u(b,{},p)},d.prototype.removeTracksFromPlaylistWithSnapshotId=function(f,h,p,m){var b=h.map(function(_){return typeof _=="string"?{uri:_}:_}),y={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:b,snapshot_id:p}};return u(y,{},m)},d.prototype.removeTracksFromPlaylistInPositions=function(f,h,p,m){var b={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{positions:h,snapshot_id:p}};return u(b,{},m)},d.prototype.uploadCustomPlaylistCoverImage=function(f,h,p){var m={url:n+"/playlists/"+f+"/images",type:"PUT",postData:h.replace(/^data:image\/jpeg;base64,/,""),contentType:"image/jpeg"};return u(m,{},p)},d.prototype.getAlbum=function(f,h,p){var m={url:n+"/albums/"+f};return u(m,h,p)},d.prototype.getAlbumTracks=function(f,h,p){var m={url:n+"/albums/"+f+"/tracks"};return u(m,h,p)},d.prototype.getAlbums=function(f,h,p){var m={url:n+"/albums/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getTrack=function(f,h,p){var m={};return m.url=n+"/tracks/"+f,u(m,h,p)},d.prototype.getTracks=function(f,h,p){var m={url:n+"/tracks/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getArtist=function(f,h,p){var m={url:n+"/artists/"+f};return u(m,h,p)},d.prototype.getArtists=function(f,h,p){var m={url:n+"/artists/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getArtistAlbums=function(f,h,p){var m={url:n+"/artists/"+f+"/albums"};return u(m,h,p)},d.prototype.getArtistTopTracks=function(f,h,p,m){var b={url:n+"/artists/"+f+"/top-tracks",params:{country:h}};return u(b,p,m)},d.prototype.getArtistRelatedArtists=function(f,h,p){var m={url:n+"/artists/"+f+"/related-artists"};return u(m,h,p)},d.prototype.getFeaturedPlaylists=function(f,h){var p={url:n+"/browse/featured-playlists"};return u(p,f,h)},d.prototype.getNewReleases=function(f,h){var p={url:n+"/browse/new-releases"};return u(p,f,h)},d.prototype.getCategories=function(f,h){var p={url:n+"/browse/categories"};return u(p,f,h)},d.prototype.getCategory=function(f,h,p){var m={url:n+"/browse/categories/"+f};return u(m,h,p)},d.prototype.getCategoryPlaylists=function(f,h,p){var m={url:n+"/browse/categories/"+f+"/playlists"};return u(m,h,p)},d.prototype.search=function(f,h,p,m){var b={url:n+"/search/",params:{q:f,type:h.join(",")}};return u(b,p,m)},d.prototype.searchAlbums=function(f,h,p){return this.search(f,["album"],h,p)},d.prototype.searchArtists=function(f,h,p){return this.search(f,["artist"],h,p)},d.prototype.searchTracks=function(f,h,p){return this.search(f,["track"],h,p)},d.prototype.searchPlaylists=function(f,h,p){return this.search(f,["playlist"],h,p)},d.prototype.searchShows=function(f,h,p){return this.search(f,["show"],h,p)},d.prototype.searchEpisodes=function(f,h,p){return this.search(f,["episode"],h,p)},d.prototype.getAudioFeaturesForTrack=function(f,h){var p={};return p.url=n+"/audio-features/"+f,u(p,{},h)},d.prototype.getAudioFeaturesForTracks=function(f,h){var p={url:n+"/audio-features",params:{ids:f}};return u(p,{},h)},d.prototype.getAudioAnalysisForTrack=function(f,h){var p={};return p.url=n+"/audio-analysis/"+f,u(p,{},h)},d.prototype.getRecommendations=function(f,h){var p={url:n+"/recommendations"};return u(p,f,h)},d.prototype.getAvailableGenreSeeds=function(f){var h={url:n+"/recommendations/available-genre-seeds"};return u(h,{},f)},d.prototype.getMyDevices=function(f){var h={url:n+"/me/player/devices"};return u(h,{},f)},d.prototype.getMyCurrentPlaybackState=function(f,h){var p={url:n+"/me/player"};return u(p,f,h)},d.prototype.getMyCurrentPlayingTrack=function(f,h){var p={url:n+"/me/player/currently-playing"};return u(p,f,h)},d.prototype.transferMyPlayback=function(f,h,p){var m=h||{};m.device_ids=f;var b={type:"PUT",url:n+"/me/player",postData:m};return u(b,h,p)},d.prototype.play=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={};["context_uri","uris","offset","position_ms"].forEach(function(_){_ in f&&(m[_]=f[_])});var b={type:"PUT",url:n+"/me/player/play",params:p,postData:m},y=typeof f=="function"?f:{};return u(b,y,h)},d.prototype.queue=function(f,h,p){h=h||{};var m="device_id"in h?{uri:f,device_id:h.device_id}:{uri:f},b={type:"POST",url:n+"/me/player/queue",params:m};return u(b,h,p)},d.prototype.pause=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"PUT",url:n+"/me/player/pause",params:p};return u(m,f,h)},d.prototype.skipToNext=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"POST",url:n+"/me/player/next",params:p};return u(m,f,h)},d.prototype.skipToPrevious=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"POST",url:n+"/me/player/previous",params:p};return u(m,f,h)},d.prototype.seek=function(f,h,p){h=h||{};var m={position_ms:f};"device_id"in h&&(m.device_id=h.device_id);var b={type:"PUT",url:n+"/me/player/seek",params:m};return u(b,h,p)},d.prototype.setRepeat=function(f,h,p){h=h||{};var m={state:f};"device_id"in h&&(m.device_id=h.device_id);var b={type:"PUT",url:n+"/me/player/repeat",params:m};return u(b,h,p)},d.prototype.setVolume=function(f,h,p){h=h||{};var m={volume_percent:f};"device_id"in h&&(m.device_id=h.device_id);var b={type:"PUT",url:n+"/me/player/volume",params:m};return u(b,h,p)},d.prototype.setShuffle=function(f,h,p){h=h||{};var m={state:f};"device_id"in h&&(m.device_id=h.device_id);var b={type:"PUT",url:n+"/me/player/shuffle",params:m};return u(b,h,p)},d.prototype.getShow=function(f,h,p){var m={};return m.url=n+"/shows/"+f,u(m,h,p)},d.prototype.getShows=function(f,h,p){var m={url:n+"/shows/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMySavedShows=function(f,h){var p={url:n+"/me/shows"};return u(p,f,h)},d.prototype.addToMySavedShows=function(f,h,p){var m={url:n+"/me/shows",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedShows=function(f,h,p){var m={url:n+"/me/shows",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedShows=function(f,h,p){var m={url:n+"/me/shows/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getShowEpisodes=function(f,h,p){var m={url:n+"/shows/"+f+"/episodes"};return u(m,h,p)},d.prototype.getEpisode=function(f,h,p){var m={};return m.url=n+"/episodes/"+f,u(m,h,p)},d.prototype.getEpisodes=function(f,h,p){var m={url:n+"/episodes/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getAccessToken=function(){return s},d.prototype.setAccessToken=function(f){s=f},d.prototype.setPromiseImplementation=function(f){var h=!1;try{var p=new f(function(m){m()});typeof p.then=="function"&&typeof p.catch=="function"&&(h=!0)}catch(m){console.error(m)}if(h)i=f;else throw new Error("Unsupported implementation of Promises/A+")},d}();t.exports=e}(nf)),nf.exports}var t8=Q5();const Ys=Fu(t8),e8={name:"PageAlbumSpotify",components:{ContentWithHero:cd,ControlImage:Hr,ListTracksSpotify:im,ModalDialogAlbumSpotify:yS,PaneHero:dd},beforeRouteEnter(t,e,n){const s=new Ys;cs.spotify().then(i=>{s.setAccessToken(i.webapi_token),s.getAlbum(t.params.id,{market:Je().spotify.webapi_country}).then(r=>{n(o=>{o.album=r})})})},setup(){return{servicesStore:Je()}},data(){return{album:{artists:[{}],tracks:{}},showDetailsModal:!1}},computed:{heading(){return{actions:[{handler:this.play,icon:"shuffle",key:"actions.shuffle"},{handler:this.openDetails,icon:"dots-horizontal"}],count:this.$t("data.tracks",{count:this.album.tracks.total}),handler:this.openArtist,subtitle:this.album.artists[0].name,title:this.album.name}},tracks(){const{album:t}=this;return t.tracks.total?t.tracks.items.map(e=>({...e,album:t})):[]}},methods:{openArtist(){this.$router.push({name:"music-spotify-artist",params:{id:this.album.artists[0].id}})},openDetails(){this.showDetailsModal=!0},play(){this.showDetailsModal=!1,ae.playUri(this.album.uri,!0)}}};function n8(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks-spotify"),c=w("content-with-hero"),u=w("modal-dialog-album-spotify");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),image:R(()=>{var d,f;return[E(a,{url:((f=(d=i.album.images)==null?void 0:d[0])==null?void 0:f.url)??"",caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]}),content:R(()=>[E(l,{items:r.tracks,"context-uri":i.album.uri},null,8,["items","context-uri"])]),_:1}),E(u,{item:i.album,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const s8=nt(e8,[["render",n8]]),i8={name:"ControlDropdown",props:{options:{required:!0,type:Array},value:{required:!0,type:[String,Number]}},emits:["update:value"],data(){return{active:!1}},computed:{option:{get(){return this.options.find(t=>t.id===this.value)}}},methods:{deactivate(){this.active=!1},select(t){this.active=!1,this.$emit("update:value",t.id)}}},r8={class:"dropdown-trigger"},o8=["textContent"],a8={id:"dropdown",class:"dropdown-menu",role:"menu"},l8={class:"dropdown-content"},c8=["onClick","textContent"];function u8(t,e,n,s,i,r){const o=w("mdicon"),a=Wh("click-away");return hs((O(),F("div",{class:Gt(["dropdown",{"is-active":i.active}])},[P("div",r8,[P("button",{class:"button","aria-haspopup":"true","aria-controls":"dropdown",onClick:e[0]||(e[0]=l=>i.active=!i.active)},[P("span",{textContent:et(r.option.name)},null,8,o8),E(o,{class:"icon",name:"chevron-down",size:"16"})])]),P("div",a8,[P("div",l8,[(O(!0),F(it,null,de(n.options,l=>(O(),F("a",{key:l.id,class:Gt(["dropdown-item",{"is-active":n.value===l.id}]),onClick:c=>r.select(l),textContent:et(l.name)},null,10,c8))),128))])])],2)),[[a,r.deactivate]])}const Ur=nt(i8,[["render",u8]]),d8={name:"ListAlbums",components:{ListItem:Ls,ModalDialogAlbum:ud},props:{items:{required:!0,type:Object},load:{default:null,type:Function},mediaKind:{default:"",type:String}},emits:["play-count-changed","podcast-deleted"],setup(){return{settingsStore:Ei()}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{image(t){return this.settingsStore.showCoverArtworkInAlbumLists?{caption:t.item.name,url:t.item.artwork_url}:null},open(t){const e=this.mediaKind||t.media_kind;e==="podcast"?this.$router.push({name:"podcast",params:{id:t.id}}):this.$router.push({name:`${e}-album`,params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0},playCountChanged(){this.$emit("play-count-changed")},podcastDeleted(){this.$emit("podcast-deleted")}}};function f8(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-album");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,image:r.image(l),index:l.index,lines:[l.item.name,l.item.artist,t.$formatters.toDate(l.item.date_released)],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","image","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,"media-kind":n.mediaKind,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1),onPlayCountChanged:r.playCountChanged,onPodcastDeleted:r.podcastDeleted},null,8,["item","media-kind","show","onPlayCountChanged","onPodcastDeleted"])],64)}const ds=nt(d8,[["render",f8]]),h8={name:"ListIndexButtons",props:{indices:{required:!0,type:Array}}},p8={class:"buttons is-centered mb-4"};function m8(t,e,n,s,i,r){const o=w("router-link");return O(),F("section",null,[P("nav",p8,[(O(!0),F(it,null,de(n.indices,a=>(O(),yt(o,{key:a,class:"button is-small p-2 is-index",to:{hash:`#index_${a}`,query:t.$route.query}},{default:R(()=>[qs(et(a),1)]),_:2},1032,["to"]))),128))])])}const ys=nt(h8,[["render",m8],["__scopeId","data-v-dc002763"]]),g8={name:"ListOptions"},y8={class:"columns"},b8={key:0,class:"column"},v8=["textContent"],_8={key:1,class:"column"},S8=["textContent"];function E8(t,e,n,s,i,r){return O(),F("div",y8,[t.$slots.filter?(O(),F("div",b8,[P("div",{class:"is-size-7 is-uppercase",textContent:et(t.$t("options.filter.title"))},null,8,v8),le(t.$slots,"filter")])):_t("",!0),t.$slots.sort?(O(),F("div",_8,[P("div",{class:"is-size-7 is-uppercase",textContent:et(t.$t("options.sort.title"))},null,8,S8),le(t.$slots,"sort")])):_t("",!0)])}const Go=nt(g8,[["render",E8]]),w8={name:"ControlTabList",props:{links:{required:!0,type:Array}}},k8={class:"section py-0 tabs-section"},T8={class:"container"},C8={class:"columns is-centered my-0"},A8={class:"column is-four-fifths py-0"},O8={class:"tabs is-centered is-small"},x8=["onClick","onKeypress"],I8=["textContent"];function N8(t,e,n,s,i,r){const o=w("mdicon"),a=w("router-link");return O(),F("section",k8,[P("div",T8,[P("div",C8,[P("div",A8,[P("div",O8,[P("ul",null,[(O(!0),F(it,null,de(n.links,l=>(O(),yt(a,{key:l.to.name,to:{name:l.to.name},custom:""},{default:R(({navigate:c,isActive:u})=>[P("li",{class:Gt({"is-active":u})},[P("a",{onClick:c,onKeypress:R1(c,["enter"])},[l.icon?(O(),yt(o,{key:0,class:"icon is-small mx-1",name:l.icon},null,8,["name"])):_t("",!0),P("span",{class:Gt({"is-hidden-mobile":l.icon}),textContent:et(t.$t(l.key))},null,10,I8)],40,x8)],2)]),_:2},1032,["to"]))),128))])])])])])])}const rm=nt(w8,[["render",N8],["__scopeId","data-v-51d61991"]]),P8={name:"TabsMusic",components:{ControlTabList:rm},setup(){return{servicesStore:Je()}},computed:{links(){const t=[{icon:"history",key:"page.music.tabs.history",to:{name:"music-history"}},{icon:"account-music",key:"page.music.tabs.artists",to:{name:"music-artists"}},{icon:"album",key:"page.music.tabs.albums",to:{name:"music-albums"}},{icon:"speaker",key:"page.music.tabs.genres",to:{name:"music-genres"}},{icon:"book-open-page-variant",key:"page.music.tabs.composers",to:{name:"music-composers"}}];return this.servicesStore.isSpotifyActive&&t.push({icon:"spotify",key:"page.music.tabs.spotify",to:{name:"music-spotify"}}),t}}};function D8(t,e,n,s,i,r){const o=w("control-tab-list");return O(),yt(o,{links:r.links},null,8,["links"])}const Js=nt(P8,[["render",D8]]),M8={name:"PageAlbums",components:{ContentWithHeading:ie,ControlDropdown:Ur,ControlSwitch:Fr,ListAlbums:ds,ListIndexButtons:ys,ListOptions:Go,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){Ct.albums("music").then(s=>{n(i=>{i.albumList=new Tt(s)})})},setup(){return{servicesStore:Je(),uiStore:Zn()}},data(){return{albumList:new Tt}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.albumsSort);return t.filters=[e=>!this.uiStore.hideSingles||e.track_count>2,e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.albumList.group(t)},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("options.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}},{id:3,name:this.$t("options.sort.recently-released"),options:{criteria:[{field:"date_released",order:-1,type:Date}],index:{field:"date_released",type:Date}}},{id:4,name:this.$t("options.sort.artist-name"),options:{criteria:[{field:"artist",type:String},{field:"name_sort",type:String}],index:{field:"artist",type:String}}},{id:5,name:this.$t("options.sort.artist-date"),options:{criteria:[{field:"artist",type:String},{field:"date_released",type:Date}],index:{field:"artist",type:String}}}]},heading(){return{subtitle:[{count:this.albums.count,key:"data.albums"}],title:this.$t("page.albums.title")}}}},L8=["textContent"],R8=["textContent"],$8=["textContent"],F8=["textContent"];function V8(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("control-switch"),c=w("control-dropdown"),u=w("list-options"),d=w("pane-title"),f=w("list-albums"),h=w("content-with-heading");return O(),F(it,null,[E(o),E(h,null,{options:R(()=>[E(a,{indices:r.albums.indices},null,8,["indices"]),E(u,null,{filter:R(()=>[E(l,{modelValue:s.uiStore.hideSingles,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hideSingles=p)},{label:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles"))},null,8,L8)]),help:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles-help"))},null,8,R8)]),_:1},8,["modelValue"]),s.servicesStore.isSpotifyActive?(O(),yt(l,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[1]||(e[1]=p=>s.uiStore.hideSpotify=p)},{label:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,$8)]),help:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,F8)]),_:1},8,["modelValue"])):_t("",!0)]),sort:R(()=>[E(c,{value:s.uiStore.albumsSort,"onUpdate:value":e[2]||(e[2]=p=>s.uiStore.albumsSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:R(()=>[E(d,{content:r.heading},null,8,["content"])]),content:R(()=>[E(f,{items:r.albums},null,8,["items"])]),_:1})],64)}const H8=nt(M8,[["render",V8]]),U8={name:"ModalDialogArtist",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,properties:[{key:"property.albums",value:this.item.album_count},{key:"property.tracks",value:this.item.track_count},{key:"property.type",value:this.$t(`data.kind.${this.item.data_kind}`)},{key:"property.added-on",value:this.$formatters.toDateTime(this.item.time_added)}],uri:this.item.uri}}}};function j8(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const hd=nt(U8,[["render",j8]]),B8={name:"PageArtist",components:{ContentWithHeading:ie,ControlButton:cn,ControlDropdown:Ur,ControlSwitch:Fr,ListAlbums:ds,ListOptions:Go,ModalDialogArtist:hd,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.artist(t.params.id),Ct.artistAlbums(t.params.id)]).then(([s,i])=>{n(r=>{r.artist=s,r.albumList=new Tt(i)})})},setup(){return{servicesStore:Je(),uiStore:Zn()}},data(){return{albumList:new Tt,artist:{},showDetailsModal:!1}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artistAlbumsSort);return t.filters=[e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.albumList.group(t)},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{criteria:[{field:"name_sort",type:String}]}},{id:2,name:this.$t("options.sort.release-date"),options:{criteria:[{field:"date_released",type:Date}]}}]},heading(){return{subtitle:[{count:this.albums.count,key:"data.albums"},{count:this.trackCount,handler:this.openTracks,key:"data.tracks"}],title:this.artist.name}},trackCount(){return[...this.albums].reduce((t,e)=>t+((e==null?void 0:e.item.track_count)||0),0)}},methods:{openDetails(){this.showDetailsModal=!0},openTracks(){this.$router.push({name:"music-artist-tracks",params:{id:this.artist.id}})},play(){ae.playUri(this.albums.items.map(t=>t.uri).join(),!0)}}},W8=["textContent"],G8=["textContent"];function K8(t,e,n,s,i,r){const o=w("control-switch"),a=w("control-dropdown"),l=w("list-options"),c=w("pane-title"),u=w("control-button"),d=w("list-albums"),f=w("content-with-heading"),h=w("modal-dialog-artist");return O(),F(it,null,[E(f,null,{options:R(()=>[E(l,null,{filter:R(()=>[s.servicesStore.isSpotifyActive?(O(),yt(o,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hideSpotify=p)},{label:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,W8)]),help:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,G8)]),_:1},8,["modelValue"])):_t("",!0)]),sort:R(()=>[E(a,{value:s.uiStore.artistAlbumsSort,"onUpdate:value":e[1]||(e[1]=p=>s.uiStore.artistAlbumsSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:R(()=>[E(c,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(u,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(d,{items:r.albums},null,8,["items"])]),_:1}),E(h,{item:i.artist,show:i.showDetailsModal,onClose:e[2]||(e[2]=p=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const z8=nt(B8,[["render",K8]]),q8={name:"ListAlbumsSpotify",components:{ListItem:Ls,LoaderListItem:fd,ModalDialogAlbumSpotify:yS},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},setup(){return{settingsStore:Ei()}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{image(t){var e,n;return this.settingsStore.showCoverArtworkInAlbumLists?{caption:t.name,url:((n=(e=t.images)==null?void 0:e[0])==null?void 0:n.url)??""}:null},open(t){this.$router.push({name:"music-spotify-album",params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function X8(t,e,n,s,i,r){const o=w("list-item"),a=w("loader-list-item"),l=w("modal-dialog-album-spotify");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,c=>{var u;return O(),yt(o,{key:c.id,"is-item":c.isItem,image:r.image(c),index:c.index,lines:[c.name,(u=c.artists[0])==null?void 0:u.name,t.$formatters.toDate(c.release_date)],onOpen:d=>r.open(c),onOpenDetails:d=>r.openDetails(c)},null,8,["is-item","image","index","lines","onOpen","onOpenDetails"])}),128)),E(a,{load:n.load},null,8,["load"]),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const pd=nt(q8,[["render",X8]]),Y8={name:"ModalDialogArtistSpotify",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e;return{name:this.item.name,properties:[{key:"property.popularity",value:[this.item.popularity,(t=this.item.followers)==null?void 0:t.total].join(" / ")},{key:"property.genres",value:(e=this.item.genres)==null?void 0:e.join(", ")}],uri:this.item.uri}}}};function Z8(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const bS=nt(Y8,[["render",Z8]]),sf=50,J8={name:"PageArtistSpotify",components:{ContentWithHeading:ie,ControlButton:cn,ListAlbumsSpotify:pd,ModalDialogArtistSpotify:bS,PaneTitle:re},beforeRouteEnter(t,e,n){cs.spotify().then(s=>{const i=new Ys;i.setAccessToken(s.webapi_token),Promise.all([i.getArtist(t.params.id),i.getArtistAlbums(t.params.id,{include_groups:"album,single",limit:sf,market:Je().spotify.webapi_country,offset:0})]).then(([r,o])=>{n(a=>{a.artist=r,a.albums=o.items,a.total=o.total,a.offset=o.limit})})})},setup(){return{servicesStore:Je()}},data(){return{albums:[],artist:{},offset:0,showDetailsModal:!1,total:0}},computed:{heading(){return{subtitle:[{count:this.total,key:"data.albums"}],title:this.artist.name}}},methods:{appendAlbums(t){this.albums=this.albums.concat(t.items),this.total=t.total,this.offset+=t.limit},load({loaded:t}){cs.spotify().then(e=>{const n=new Ys;n.setAccessToken(e.webapi_token),n.getArtistAlbums(this.artist.id,{include_groups:"album,single",limit:sf,offset:this.offset}).then(s=>{this.appendAlbums(s),t(s.items.length,sf)})})},openDetails(){this.showDetailsModal=!0},play(){this.showDetailsModal=!1,ae.playUri(this.artist.uri,!0)}}};function Q8(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-albums-spotify"),c=w("content-with-heading"),u=w("modal-dialog-artist-spotify");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(l,{items:i.albums,load:r.load},null,8,["items","load"])]),_:1}),E(u,{item:i.artist,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const t6=nt(J8,[["render",Q8]]),e6={name:"PageArtistTracks",components:{ContentWithHeading:ie,ControlButton:cn,ControlDropdown:Ur,ControlSwitch:Fr,ListIndexButtons:ys,ListOptions:Go,ListTracks:Jn,ModalDialogArtist:hd,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.artist(t.params.id),Ct.artistTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.artist=s,r.trackList=new Tt(i)})})},setup(){return{servicesStore:Je(),uiStore:Zn()}},data(){return{artist:{},showDetailsModal:!1,trackList:new Tt}},computed:{albumCount(){return new Set([...this.tracks].filter(t=>t.isItem).map(t=>t.item.album_id)).size},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("options.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}]},heading(){return{subtitle:[{count:this.albumCount,handler:this.openArtist,key:"data.albums"},{count:this.tracks.count,key:"data.tracks"}],title:this.artist.name}},trackUris(){return this.trackList.items.map(t=>t.uri).join()},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artistTracksSort);return t.filters=[e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.trackList.group(t)}},methods:{openArtist(){this.showDetailsModal=!1,this.$router.push({name:"music-artist",params:{id:this.artist.id}})},openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.trackList.items.map(t=>t.uri).join(),!0)}}},n6=["textContent"],s6=["textContent"];function i6(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("control-switch"),l=w("control-dropdown"),c=w("list-options"),u=w("pane-title"),d=w("control-button"),f=w("list-tracks"),h=w("content-with-heading"),p=w("modal-dialog-artist");return O(),F(it,null,[E(h,null,{options:R(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),E(c,null,{filter:R(()=>[s.servicesStore.isSpotifyActive?(O(),yt(a,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[0]||(e[0]=m=>s.uiStore.hideSpotify=m)},{label:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,n6)]),help:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,s6)]),_:1},8,["modelValue"])):_t("",!0)]),sort:R(()=>[E(l,{value:s.uiStore.artistTracksSort,"onUpdate:value":e[1]||(e[1]=m=>s.uiStore.artistTracksSort=m),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:R(()=>[E(u,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(d,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(d,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(f,{items:r.tracks,uris:r.trackUris},null,8,["items","uris"])]),_:1}),E(p,{item:i.artist,show:i.showDetailsModal,onClose:e[2]||(e[2]=m=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const r6=nt(e6,[["render",i6]]),o6={name:"ListArtists",components:{ListItem:Ls,ModalDialogArtist:hd},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:`${t.media_kind}-artist`,params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function a6(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-artist");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const om=nt(o6,[["render",a6]]),l6={name:"PageArtists",components:{ContentWithHeading:ie,ControlDropdown:Ur,ControlSwitch:Fr,ListArtists:om,ListIndexButtons:ys,ListOptions:Go,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){Ct.artists("music").then(s=>{n(i=>{i.artistList=new Tt(s)})})},setup(){return{servicesStore:Je(),uiStore:Zn()}},data(){return{artistList:new Tt}},computed:{artists(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artistsSort);return t.filters=[e=>!this.uiStore.hideSingles||e.track_count>e.album_count*2,e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.artistList.group(t)},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("options.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}}]},heading(){return{subtitle:[{count:this.artists.count,key:"data.artists"}],title:this.$t("page.artists.title")}}}},c6=["textContent"],u6=["textContent"],d6=["textContent"],f6=["textContent"];function h6(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("control-switch"),c=w("control-dropdown"),u=w("list-options"),d=w("pane-title"),f=w("list-artists"),h=w("content-with-heading");return O(),F(it,null,[E(o),E(h,null,{options:R(()=>[E(a,{indices:r.artists.indices},null,8,["indices"]),E(u,null,{filter:R(()=>[E(l,{modelValue:s.uiStore.hideSingles,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hideSingles=p)},{label:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles"))},null,8,c6)]),help:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles-help"))},null,8,u6)]),_:1},8,["modelValue"]),s.servicesStore.isSpotifyActive?(O(),yt(l,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[1]||(e[1]=p=>s.uiStore.hideSpotify=p)},{label:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,d6)]),help:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,f6)]),_:1},8,["modelValue"])):_t("",!0)]),sort:R(()=>[E(c,{value:s.uiStore.artistsSort,"onUpdate:value":e[2]||(e[2]=p=>s.uiStore.artistsSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:R(()=>[E(d,{content:r.heading},null,8,["content"])]),content:R(()=>[E(f,{items:r.artists},null,8,["items"])]),_:1})],64)}const p6=nt(l6,[["render",h6]]),m6={name:"PageAudiobookAlbum",components:{ContentWithHero:cd,ControlImage:Hr,ListTracks:Jn,ModalDialogAlbum:ud,PaneHero:dd},beforeRouteEnter(t,e,n){Promise.all([Ct.album(t.params.id),Ct.albumTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.album=s,r.tracks=new Tt(i)})})},data(){return{album:{},showDetailsModal:!1,tracks:new Tt}},computed:{heading(){return{count:this.$t("data.tracks",{count:this.album.track_count}),handler:this.openArtist,subtitle:this.album.artist,title:this.album.name,actions:[{handler:this.play,icon:"play",key:"actions.play"},{handler:this.openDetails,icon:"dots-horizontal"}]}}},methods:{openArtist(){this.showDetailsModal=!1,this.$router.push({name:"audiobook-artist",params:{id:this.album.artist_id}})},openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.album.uri,!1)}}};function g6(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks"),c=w("content-with-hero"),u=w("modal-dialog-album");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),image:R(()=>[E(a,{url:i.album.artwork_url,caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]),content:R(()=>[E(l,{items:i.tracks,"show-progress":!0,uris:i.album.uri},null,8,["items","uris"])]),_:1}),E(u,{item:i.album,show:i.showDetailsModal,"media-kind":"audiobook",onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const y6=nt(m6,[["render",g6]]),b6={name:"TabsAudiobooks",components:{ControlTabList:rm},computed:{links(){return[{icon:"account-music",key:"page.audiobooks.tabs.authors",to:{name:"audiobook-artists"}},{icon:"album",key:"page.audiobooks.tabs.audiobooks",to:{name:"audiobook-albums"}},{icon:"speaker",key:"page.audiobooks.tabs.genres",to:{name:"audiobook-genres"}}]}}};function v6(t,e,n,s,i,r){const o=w("control-tab-list");return O(),yt(o,{links:r.links},null,8,["links"])}const am=nt(b6,[["render",v6]]),_6={name:"PageAudiobookAlbums",components:{ContentWithHeading:ie,ListAlbums:ds,ListIndexButtons:ys,PaneTitle:re,TabsAudiobooks:am},beforeRouteEnter(t,e,n){Ct.albums("audiobook").then(s=>{n(i=>{i.albums=new Tt(s,{index:{field:"name_sort",type:String}})})})},data(){return{albums:new Tt}},computed:{heading(){return{subtitle:[{count:this.albums.count,key:"data.audiobooks"}],title:this.$t("page.audiobooks.albums.title")}}}};function S6(t,e,n,s,i,r){const o=w("tabs-audiobooks"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-albums"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:R(()=>[E(a,{indices:i.albums.indices},null,8,["indices"])]),heading:R(()=>[E(l,{content:r.heading},null,8,["content"])]),content:R(()=>[E(c,{items:i.albums},null,8,["items"])]),_:1})],64)}const E6=nt(_6,[["render",S6]]),w6={name:"PageAudiobookArtist",components:{ContentWithHeading:ie,ControlButton:cn,ListAlbums:ds,ModalDialogArtist:hd,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.artist(t.params.id),Ct.artistAlbums(t.params.id)]).then(([s,i])=>{n(r=>{r.artist=s,r.albums=new Tt(i)})})},data(){return{albums:new Tt,artist:{},showDetailsModal:!1}},computed:{heading(){return this.artist.name?{subtitle:[{count:this.artist.album_count,key:"data.audiobooks"}],title:this.artist.name}:{}}},methods:{openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.albums.items.map(t=>t.uri).join(),!1)}}};function k6(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-albums"),c=w("content-with-heading"),u=w("modal-dialog-artist");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"play",key:"actions.play"}},null,8,["button"])]),content:R(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1}),E(u,{item:i.artist,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const T6=nt(w6,[["render",k6]]),C6={name:"PageAudiobookArtists",components:{ContentWithHeading:ie,ListArtists:om,ListIndexButtons:ys,PaneTitle:re,TabsAudiobooks:am},beforeRouteEnter(t,e,n){Ct.artists("audiobook").then(s=>{n(i=>{i.artists=new Tt(s,{index:{field:"name_sort",type:String}})})})},data(){return{artists:new Tt}},computed:{heading(){return{subtitle:[{count:this.artists.count,key:"data.authors"}],title:this.$t("page.audiobooks.artists.title")}}}};function A6(t,e,n,s,i,r){const o=w("tabs-audiobooks"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-artists"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:R(()=>[E(a,{indices:i.artists.indices},null,8,["indices"])]),heading:R(()=>[E(l,{content:r.heading},null,8,["content"])]),content:R(()=>[E(c,{items:i.artists},null,8,["items"])]),_:1})],64)}const O6=nt(C6,[["render",A6]]),x6={name:"ModalDialogGenre",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},mediaKind:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{expression:`genre is "${this.item.name}" and media_kind is ${this.mediaKind}`,name:this.item.name,properties:[{key:"property.albums",value:this.item.album_count},{key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)}]}}}};function I6(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const lm=nt(x6,[["render",I6]]),N6={name:"ListGenres",components:{ListItem:Ls,ModalDialogGenre:lm},props:{items:{required:!0,type:Object},mediaKind:{required:!0,type:String}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:"genre-albums",params:{name:t.name},query:{mediaKind:this.mediaKind}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function P6(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-genre");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,"media-kind":n.mediaKind,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","media-kind","show"])],64)}const vS=nt(N6,[["render",P6]]),D6={name:"PageAudiobooksGenres",components:{ContentWithHeading:ie,ListGenres:vS,ListIndexButtons:ys,PaneTitle:re,TabsAudiobooks:am},beforeRouteEnter(t,e,n){Ct.genres("audiobook").then(s=>{n(i=>{i.genres=new Tt(s,{index:{field:"name_sort",type:String}})})})},data(){return{genres:new Tt}},computed:{heading(){return{subtitle:[{count:this.genres.total,key:"data.genres"}],title:this.$t("page.genres.title")}}}};function M6(t,e,n,s,i,r){const o=w("tabs-audiobooks"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-genres"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:R(()=>[E(a,{indices:i.genres.indices},null,8,["indices"])]),heading:R(()=>[E(l,{content:r.heading},null,8,["content"])]),content:R(()=>[E(c,{items:i.genres,"media-kind":"audiobook"},null,8,["items"])]),_:1})],64)}const L6=nt(D6,[["render",M6]]),R6={name:"ModalDialogComposer",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{expression:`composer is "${this.item.name}" and media_kind is music`,name:this.item.name,properties:[{handler:this.openAlbums,key:"property.albums",value:this.item.album_count},{handler:this.openTracks,key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)}]}}},methods:{openAlbums(){this.$emit("close"),this.$router.push({name:"music-composer-albums",params:{name:this.item.name}})},openTracks(){this.$emit("close"),this.$router.push({name:"music-composer-tracks",params:{name:this.item.name}})}}};function $6(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const cm=nt(R6,[["render",$6]]),F6={name:"PageComposerAlbums",components:{ContentWithHeading:ie,ControlButton:cn,ListAlbums:ds,ModalDialogComposer:cm,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.composer(t.params.name),Ct.composerAlbums(t.params.name)]).then(([s,i])=>{n(r=>{r.composer=s,r.albums=new Tt(i)})})},data(){return{albums:new Tt,composer:{},showDetailsModal:!1}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},heading(){return this.composer.name?{subtitle:[{count:this.composer.album_count,key:"data.albums"},{count:this.composer.track_count,handler:this.openTracks,key:"data.tracks"}],title:this.composer.name}:{}}},methods:{openDetails(){this.showDetailsModal=!0},openTracks(){this.$router.push({name:"music-composer-tracks",params:{name:this.composer.name}})},play(){ae.playExpression(this.expression,!0)}}};function V6(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-albums"),c=w("content-with-heading"),u=w("modal-dialog-composer");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1}),E(u,{item:i.composer,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const H6=nt(F6,[["render",V6]]),U6={name:"PageComposerTracks",components:{ContentWithHeading:ie,ControlButton:cn,ControlDropdown:Ur,ListIndexButtons:ys,ListOptions:Go,ListTracks:Jn,ModalDialogComposer:cm,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.composer(t.params.name),Ct.composerTracks(t.params.name)]).then(([s,i])=>{n(r=>{r.composer=s,r.trackList=new Tt(i)})})},setup(){return{uiStore:Zn()}},data(){return{composer:{},showDetailsModal:!1,trackList:new Tt}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("options.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}]},heading(){return this.composer.name?{subtitle:[{count:this.composer.album_count,handler:this.openAlbums,key:"data.albums"},{count:this.composer.track_count,key:"data.tracks"}],title:this.composer.name}:{}},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.composerTracksSort);return this.trackList.group(t)}},methods:{openAlbums(){this.$router.push({name:"music-composer-albums",params:{name:this.composer.name}})},openDetails(){this.showDetailsModal=!0},play(){ae.playExpression(this.expression,!0)}}};function j6(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("control-dropdown"),l=w("list-options"),c=w("pane-title"),u=w("control-button"),d=w("list-tracks"),f=w("content-with-heading"),h=w("modal-dialog-composer");return O(),F(it,null,[E(f,null,{options:R(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),E(l,null,{sort:R(()=>[E(a,{value:s.uiStore.composerTracksSort,"onUpdate:value":e[0]||(e[0]=p=>s.uiStore.composerTracksSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:R(()=>[E(c,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(u,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(d,{items:r.tracks,expression:r.expression},null,8,["items","expression"])]),_:1}),E(h,{item:i.composer,show:i.showDetailsModal,onClose:e[1]||(e[1]=p=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const B6=nt(U6,[["render",j6]]),W6={name:"ListComposers",components:{ListItem:Ls,ModalDialogComposer:cm},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:"music-composer-albums",params:{name:t.name}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function G6(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-composer");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const _S=nt(W6,[["render",G6]]),K6={name:"PageComposers",components:{ContentWithHeading:ie,ListComposers:_S,ListIndexButtons:ys,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){Ct.composers("music").then(s=>{n(i=>{i.composers=new Tt(s,{index:{field:"name_sort",type:String}})})})},data(){return{composers:new Tt}},computed:{heading(){return{subtitle:[{count:this.composers.total,key:"data.composers"}],title:this.$t("page.composers.title")}}}};function z6(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-composers"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:R(()=>[E(a,{indices:i.composers.indices},null,8,["indices"])]),heading:R(()=>[E(l,{content:r.heading},null,8,["content"])]),content:R(()=>[E(c,{items:i.composers},null,8,["items"])]),_:1})],64)}const q6=nt(K6,[["render",z6]]),X6={name:"ModalDialogDirectory",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{expression:`path starts with "${this.item}" order by path asc`,name:this.item}}}};function Y6(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const Z6=nt(X6,[["render",Y6]]),J6={name:"ListDirectories",components:{ListItem:Ls,ModalDialogDirectory:Z6},props:{items:{required:!0,type:Array}},data(){return{selectedItem:"",showDetailsModal:!1}},computed:{directories(){var n;const t=[];let e="";return(n=this.$route.query)==null||n.directory.split("/").slice(1,-1).forEach((s,i)=>{e=`${e}/${s}`,t.push({index:i,name:s,path:e})}),t}},methods:{open(t){const e={name:"files"};t.index!==0&&(e.query={directory:t.path}),this.$router.push(e)},openDetails(t){this.selectedItem=t.path,this.showDetailsModal=!0},openParent(){this.open(this.directories.slice(-1).pop())}}},Q6={key:0,class:"media is-align-items-center mb-0"},tF={class:"media-content"},eF={class:"breadcrumb"},nF=["onClick","textContent"],sF={class:"media-right"};function iF(t,e,n,s,i,r){const o=w("mdicon"),a=w("list-item"),l=w("modal-dialog-directory");return O(),F(it,null,[t.$route.query.directory?(O(),F("div",Q6,[E(o,{class:"icon media-left is-clickable",name:"chevron-left",onClick:r.openParent},null,8,["onClick"]),P("div",tF,[P("nav",eF,[P("ul",null,[(O(!0),F(it,null,de(r.directories,c=>(O(),F("li",{key:c.index},[P("a",{onClick:u=>r.open(c),textContent:et(c.name)},null,8,nF)]))),128))])])]),P("div",sF,[le(t.$slots,"actions")])])):_t("",!0),(O(!0),F(it,null,de(n.items,c=>(O(),yt(a,{key:c.path,icon:"folder",lines:[c.name],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},null,8,["lines","onOpen","onOpenDetails"]))),128)),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const rF=nt(J6,[["render",iF]]),oF={name:"ModalDialogPlaylist",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean,uris:{default:"",type:String}},emits:["close"],computed:{playable(){return{name:this.item.name,properties:[{key:"property.tracks",value:this.item.item_count},{key:"property.type",value:this.$t(`playlist.type.${this.item.type}`)},{key:"property.path",value:this.item.path}],uri:this.item.uri,uris:this.uris}}}};function aF(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const SS=nt(oF,[["render",aF]]),lF={name:"ListPlaylists",components:{ListItem:Ls,ModalDialogPlaylist:SS},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{icon(t){return t.type==="folder"?"folder":t.type==="rss"?"rss":"music-box-multiple"},open(t){t.type==="folder"?this.$router.push({name:"playlist-folder",params:{id:t.id}}):this.$router.push({name:"playlist",params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function cF(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-playlist");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,icon:r.icon(l.item),"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["icon","is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const um=nt(lF,[["render",cF]]),uF={name:"PageFiles",components:{ContentWithHeading:ie,ControlButton:cn,ListDirectories:rF,ListPlaylists:um,ListTracks:Jn,ModalDialogPlayable:gs,PaneTitle:re},beforeRouteEnter(t,e,n){n(async s=>{await s.fetchData(t)})},beforeRouteUpdate(t,e,n){this.fetchData(t).then(()=>n())},setup(){return{configurationStore:Fo()}},data(){return{directories:[],playlists:new Tt,showDetailsModal:!1,tracks:new Tt}},computed:{current(){var t;return((t=this.$route.query)==null?void 0:t.directory)||"/"},name(){var t;return this.current!=="/"?(t=this.current)==null?void 0:t.slice(this.current.lastIndexOf("/")+1):this.$t("page.files.title")},playable(){return{expression:`path starts with "${this.current}" order by path asc`,name:this.current,properties:[{key:"property.folders",value:this.directories.length},{key:"property.playlists",value:this.playlists.total},{key:"property.tracks",value:this.tracks.total}]}}},methods:{async fetchData(t){if(t.query.directory){const e=await Ct.files(t.query.directory);e&&(this.directories=e.directories.map(n=>this.transform(n.path)),this.playlists=new Tt(e.playlists),this.tracks=new Tt(e.tracks))}else this.directories=this.configurationStore.directories.map(e=>this.transform(e)),this.playlists=new Tt,this.tracks=new Tt},openDetails(){this.showDetailsModal=!0},play(){ae.playExpression(this.expression,!1)},transform(t){return{name:t.slice(t.lastIndexOf("/")+1),path:t}}}};function dF(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-directories"),c=w("list-playlists"),u=w("list-tracks"),d=w("content-with-heading"),f=w("modal-dialog-playable");return O(),F(it,null,[E(d,null,{heading:R(()=>[E(o,{content:{title:r.name}},null,8,["content"])]),actions:R(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"play",key:"actions.play"}},null,8,["button"])]),content:R(()=>[E(l,{items:i.directories},null,8,["items"]),E(c,{items:i.playlists},null,8,["items"]),E(u,{items:i.tracks,icon:"file-music-outline"},null,8,["items"])]),_:1}),E(f,{item:r.playable,show:i.showDetailsModal,onClose:e[0]||(e[0]=h=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const fF=nt(uF,[["render",dF]]),hF={name:"PageGenreAlbums",components:{ContentWithHeading:ie,ControlButton:cn,ListAlbums:ds,ListIndexButtons:ys,ModalDialogGenre:lm,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.genre(t.params.name,t.query.mediaKind),Ct.genreAlbums(t.params.name,t.query.mediaKind)]).then(([s,i])=>{n(r=>{r.genre=s.items.shift(),r.albums=new Tt(i,{index:{field:"name_sort",type:String}})})})},data(){return{albums:new Tt,genre:{},mediaKind:this.$route.query.mediaKind,showDetailsModal:!1}},computed:{heading(){return this.genre.name?{subtitle:[{count:this.genre.album_count,key:"data.albums"},{count:this.genre.track_count,handler:this.openTracks,key:"data.tracks"}],title:this.genre.name}:{}}},methods:{openDetails(){this.showDetailsModal=!0},openTracks(){this.showDetailsModal=!1,this.$router.push({name:"genre-tracks",params:{name:this.genre.name},query:{mediaKind:this.mediaKind}})},play(){ae.playExpression(`genre is "${this.genre.name}" and media_kind is ${this.mediaKind}`,!0)}}};function pF(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("pane-title"),l=w("control-button"),c=w("list-albums"),u=w("content-with-heading"),d=w("modal-dialog-genre");return O(),F(it,null,[E(u,null,{options:R(()=>[E(o,{indices:i.albums.indices},null,8,["indices"])]),heading:R(()=>[E(a,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(l,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(l,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(c,{items:i.albums},null,8,["items"])]),_:1}),E(d,{item:i.genre,"media-kind":i.mediaKind,show:i.showDetailsModal,onClose:e[0]||(e[0]=f=>i.showDetailsModal=!1)},null,8,["item","media-kind","show"])],64)}const mF=nt(hF,[["render",pF]]),gF={name:"PageGenreTracks",components:{ContentWithHeading:ie,ControlButton:cn,ControlDropdown:Ur,ListIndexButtons:ys,ListOptions:Go,ListTracks:Jn,ModalDialogGenre:lm,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.genre(t.params.name,t.query.mediaKind),Ct.genreTracks(t.params.name,t.query.mediaKind)]).then(([s,i])=>{n(r=>{r.genre=s.items.shift(),r.trackList=new Tt(i)})})},setup(){return{uiStore:Zn()}},data(){return{genre:{},mediaKind:this.$route.query.mediaKind,showDetailsModal:!1,trackList:new Tt}},computed:{expression(){return`genre is "${this.genre.name}" and media_kind is ${this.mediaKind}`},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("options.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}]},heading(){return this.genre.name?{subtitle:[{count:this.genre.album_count,handler:this.openGenre,key:"data.albums"},{count:this.genre.track_count,key:"data.tracks"}],title:this.genre.name}:{}},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.genreTracksSort);return this.trackList.group(t)}},methods:{openDetails(){this.showDetailsModal=!0},openGenre(){this.showDetailsModal=!1,this.$router.push({name:"genre-albums",params:{name:this.genre.name},query:{mediaKind:this.mediaKind}})},play(){ae.playExpression(this.expression,!0)}}};function yF(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("control-dropdown"),l=w("list-options"),c=w("pane-title"),u=w("control-button"),d=w("list-tracks"),f=w("content-with-heading"),h=w("modal-dialog-genre");return O(),F(it,null,[E(f,null,{options:R(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),E(l,null,{sort:R(()=>[E(a,{value:s.uiStore.genreTracksSort,"onUpdate:value":e[0]||(e[0]=p=>s.uiStore.genreTracksSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:R(()=>[E(c,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(u,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(d,{items:r.tracks,expression:r.expression},null,8,["items","expression"])]),_:1}),E(h,{item:i.genre,"media-kind":i.mediaKind,show:i.showDetailsModal,onClose:e[1]||(e[1]=p=>i.showDetailsModal=!1)},null,8,["item","media-kind","show"])],64)}const bF=nt(gF,[["render",yF]]),vF={name:"PageGenres",components:{ContentWithHeading:ie,ListGenres:vS,ListIndexButtons:ys,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){Ct.genres("music").then(s=>{n(i=>{i.genres=new Tt(s,{index:{field:"name_sort",type:String}})})})},data(){return{genres:new Tt}},computed:{heading(){return{subtitle:[{count:this.genres.total,key:"data.genres"}],title:this.$t("page.genres.title")}}}};function _F(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-genres"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:R(()=>[E(a,{indices:i.genres.indices},null,8,["indices"])]),heading:R(()=>[E(l,{content:r.heading},null,8,["content"])]),content:R(()=>[E(c,{items:i.genres,"media-kind":"music"},null,8,["items"])]),_:1})],64)}const SF=nt(vF,[["render",_F]]),EF={name:"PageMusic",components:{ContentWithHeading:ie,ListAlbums:ds,ListTracks:Jn,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){Promise.all([Ct.search({expression:"time_added after 8 weeks ago and media_kind is music having track_count > 3 order by time_added desc",limit:3,type:"album"}),Ct.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:3,type:"track"})]).then(([{albums:s},{tracks:i}])=>{n(r=>{r.albums=new Tt(s),r.tracks=new Tt(i)})})},data(){return{albums:[],tracks:null}}};function wF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums"),c=w("router-link"),u=w("content-with-heading"),d=w("list-tracks");return O(),F(it,null,[E(o),E(u,null,{heading:R(()=>[E(a,{content:{title:t.$t("page.music.recently-added.title")}},null,8,["content"])]),content:R(()=>[E(l,{items:i.albums},null,8,["items"])]),footer:R(()=>[E(c,{class:"button is-small is-rounded",to:{name:"music-recently-added"}},{default:R(()=>[qs(et(t.$t("actions.show-more")),1)]),_:1})]),_:1}),E(u,null,{heading:R(()=>[E(a,{content:{title:t.$t("page.music.recently-played.title")}},null,8,["content"])]),content:R(()=>[E(d,{items:i.tracks},null,8,["items"])]),footer:R(()=>[E(c,{class:"button is-small is-rounded",to:{name:"music-recently-played"}},{default:R(()=>[qs(et(t.$t("actions.show-more")),1)]),_:1})]),_:1})],64)}const kF=nt(EF,[["render",wF]]),TF={name:"PageMusicRecentlyAdded",components:{ContentWithHeading:ie,ListAlbums:ds,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){const s=Ei().recentlyAddedLimit;Ct.search({expression:"media_kind is music having track_count > 3 order by time_added desc",limit:s,type:"album"}).then(i=>{n(r=>{r.albums=new Tt(i.albums,{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}})})})},setup(){return{settingsStore:Ei()}},data(){return{albums:new Tt}}};function CF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:R(()=>[E(a,{content:{title:t.$t("page.music.recently-added.title")}},null,8,["content"])]),content:R(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1})],64)}const AF=nt(TF,[["render",CF]]),OF={name:"PageMusicRecentlyPlayed",components:{ContentWithHeading:ie,ListTracks:Jn,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){Ct.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:50,type:"track"}).then(s=>{n(i=>{i.tracks=new Tt(s.tracks)})})},data(){return{tracks:new Tt}}};function xF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-tracks"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:R(()=>[E(a,{content:{title:t.$t("page.music.recently-played.title")}},null,8,["content"])]),content:R(()=>[E(l,{items:i.tracks},null,8,["items"])]),_:1})],64)}const IF=nt(OF,[["render",xF]]),NF={name:"ModalDialogPlaylistSpotify",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e;return{name:this.item.name,properties:[{key:"property.owner",value:(t=this.item.owner)==null?void 0:t.display_name},{key:"property.tracks",value:(e=this.item.tracks)==null?void 0:e.total},{key:"property.path",value:this.item.uri}],uri:this.item.uri}}}};function PF(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const ES=nt(NF,[["render",PF]]),DF={name:"ListPlaylistsSpotify",components:{ListItem:Ls,LoaderListItem:fd,ModalDialogPlaylistSpotify:ES},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:"playlist-spotify",params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function MF(t,e,n,s,i,r){const o=w("list-item"),a=w("loader-list-item"),l=w("modal-dialog-playlist-spotify");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,c=>(O(),yt(o,{key:c.id,"is-item":c.isItem,index:c.index,lines:[c.name,c.owner.display_name],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{load:n.load},null,8,["load"]),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const dm=nt(DF,[["render",MF]]),LF={name:"PageMusicSpotify",components:{ContentWithHeading:ie,ListAlbumsSpotify:pd,ListPlaylistsSpotify:dm,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){cs.spotify().then(s=>{const i=new Ys;i.setAccessToken(s.webapi_token),Promise.all([i.getNewReleases({country:s.webapi_country,limit:3}),i.getFeaturedPlaylists({country:s.webapi_country,limit:3})]).then(r=>{n(o=>{o.albums=r[0].albums.items,o.playlists=r[1].playlists.items})})})},data(){return{albums:[],playlists:[]}}};function RF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums-spotify"),c=w("router-link"),u=w("content-with-heading"),d=w("list-playlists-spotify");return O(),F(it,null,[E(o),E(u,null,{heading:R(()=>[E(a,{content:{title:t.$t("page.spotify.music.new-releases")}},null,8,["content"])]),content:R(()=>[E(l,{items:i.albums},null,8,["items"])]),footer:R(()=>[E(c,{to:{name:"music-spotify-new-releases"},class:"button is-small is-rounded"},{default:R(()=>[qs(et(t.$t("actions.show-more")),1)]),_:1})]),_:1}),E(u,null,{heading:R(()=>[E(a,{content:{title:t.$t("page.spotify.music.featured-playlists")}},null,8,["content"])]),content:R(()=>[E(d,{items:i.playlists},null,8,["items"])]),footer:R(()=>[E(c,{to:{name:"music-spotify-featured-playlists"},class:"button is-small is-rounded"},{default:R(()=>[qs(et(t.$t("actions.show-more")),1)]),_:1})]),_:1})],64)}const $F=nt(LF,[["render",RF]]),FF={name:"PageMusicSpotifyFeaturedPlaylists",components:{ContentWithHeading:ie,ListPlaylistsSpotify:dm,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){cs.spotify().then(s=>{const i=new Ys;i.setAccessToken(s.webapi_token),i.getFeaturedPlaylists({country:s.webapi_country,limit:50}).then(r=>{n(o=>{o.playlists=r.playlists.items})})})},data(){return{playlists:[]}},computed:{heading(){return{title:this.$t("page.spotify.music.featured-playlists")}}}};function VF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-playlists-spotify"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:R(()=>[E(a,{content:r.heading},null,8,["content"])]),content:R(()=>[E(l,{items:i.playlists},null,8,["items"])]),_:1})],64)}const HF=nt(FF,[["render",VF]]),UF={name:"PageMusicSpotifyNewReleases",components:{ContentWithHeading:ie,ListAlbumsSpotify:pd,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){cs.spotify().then(s=>{const i=new Ys;i.setAccessToken(s.webapi_token),i.getNewReleases({country:s.webapi_country,limit:50}).then(r=>{n(o=>{o.albums=r.albums.items})})})},data(){return{albums:[]}},computed:{heading(){return{title:this.$t("page.spotify.music.new-releases")}}}};function jF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums-spotify"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:R(()=>[E(a,{content:r.heading},null,8,["content"])]),content:R(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1})],64)}const BF=nt(UF,[["render",jF]]),WF={name:"ModalDialogQueueItem",components:{ListProperties:gS,ModalDialog:sr},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],setup(){return{servicesStore:Je()}},data(){return{spotifyTrack:{}}},computed:{actions(){return[{handler:this.remove,icon:"delete",key:"actions.remove"},{handler:this.play,icon:"play",key:"actions.play"}]},playable(){return{name:this.item.title,properties:[{handler:this.openAlbum,key:"property.album",value:this.item.album},{handler:this.openAlbumArtist,key:"property.album-artist",value:this.item.album_artist},{key:"property.composer",value:this.item.composer},{key:"property.year",value:this.item.year},{handler:this.openGenre,key:"property.genre",value:this.item.genre},{key:"property.position",value:[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)},{key:"property.path",value:this.item.path},{key:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{key:"property.quality",value:this.$t("dialog.track.quality-value",{bitrate:this.item.bitrate,count:this.item.channels,format:this.item.type,samplerate:this.item.samplerate})}],uri:this.item.uri}}},watch:{item(){var t;if(((t=this.item)==null?void 0:t.data_kind)==="spotify"){const e=new Ys;e.setAccessToken(this.servicesStore.spotify.webapi_token),e.getTrack(this.item.path.slice(this.item.path.lastIndexOf(":")+1)).then(n=>{this.spotifyTrack=n})}else this.spotifyTrack={}}},methods:{openAlbum(){this.$emit("close"),this.item.data_kind==="spotify"?this.$router.push({name:"music-spotify-album",params:{id:this.spotifyTrack.album.id}}):this.item.media_kind==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.album_id}}):this.$router.push({name:`${this.item.media_kind}-album`,params:{id:this.item.album_id}})},openAlbumArtist(){this.$emit("close"),this.item.data_kind==="spotify"?this.$router.push({name:"music-spotify-artist",params:{id:this.spotifyTrack.artists[0].id}}):this.item.media_kind==="music"||this.item.media_kind==="podcast"?this.$router.push({name:"music-artist",params:{id:this.item.album_artist_id}}):this.item.media_kind==="audiobook"&&this.$router.push({name:"audiobook-artist",params:{id:this.item.album_artist_id}})},openGenre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{mediaKind:this.item.media_kind}})},play(){this.$emit("close"),sn.play({item_id:this.item.id})},remove(){this.$emit("close"),ae.remove(this.item.id)}}};function GF(t,e,n,s,i,r){const o=w("list-properties"),a=w("modal-dialog");return O(),yt(a,{actions:r.actions,show:n.show,title:n.item.title,onClose:e[0]||(e[0]=l=>t.$emit("close"))},{content:R(()=>[E(o,{item:r.playable},null,8,["item"])]),_:1},8,["actions","show","title"])}const wS=nt(WF,[["render",GF]]),KF={name:"PaneLyrics",setup(){return{MIDDLE_POSITION:Math.floor(3.5),VISIBLE_VERSES:7,playerStore:Bn()}},data(){return{lastUpdateTime:0,lyrics:{synchronised:!1,verses:[]},time:0,timerId:null}},computed:{verseIndex(t,e){var i;let n=0,s=e.length-1;for(;n<=s;){const r=Math.floor((n+s)/2),o=e[r].time,a=(i=e[r+1])==null?void 0:i.time;if(o<=t&&(!a||a>t))return r;ot[n+r]??{text:" "})}},watch:{"playerStore.isPlaying"(t){t?(this.lastUpdateTime=Date.now(),this.startTimer()):this.stopTimer()},"playerStore.item_progress_ms"(t){this.lastUpdateTime=Date.now(),this.playerStore.isPlaying||(this.time=t)},"playerStore.lyricsContent"(){this.lyrics=this.parseLyrics()}},mounted(){this.playerStore.initialise(),this.lastUpdateTime=Date.now(),this.lyrics=this.parseLyrics(),this.updateTime()},beforeUnmount(){this.stopTimer()},methods:{isVerseHighlighted(t){return t===this.MIDDLE_POSITION&&this.lyrics.synchronised},isWordHighlighted(t){return this.time>=t.start&&this.time\d+):(?\d+)(?:\.(?\d+))?\])?\s*(?\S.*\S)?\s*/u;return this.playerStore.lyricsContent.split(` + `;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(s)}`},I$={name:"ControlImage",props:{caption:{default:"",type:String},url:{default:"",type:String}},emits:["click"],data(){return{font:{family:"sans-serif",weight:"bold"},size:600}},computed:{source(){return{lifecycle:{error:t=>{t.src=this.uri}},src:this.url||this.uri}},uri(){return x$({alternate:this.caption,caption:this.caption.substring(0,2),font:this.font,size:this.size})}}},N$={class:"figure has-shadow is-clickable"};function P$(t,e,n,s,i,r){const o=Wh("lazy");return O(),F("figure",N$,[hs(P("img",{onClick:e[0]||(e[0]=a=>t.$emit("click"))},null,512),[[o,r.source]])])}const Hr=nt(I$,[["render",P$],["__scopeId","data-v-e43b98b9"]]),{t:Wl,locale:D$}=Bs.global,mS="NO_INDEX",M$=(t,e)=>t-e,L$=(t,e)=>t.localeCompare(e,D$.value),R$=(t,e)=>{const n=Date.parse(t),s=Date.parse(e),i=isNaN(n),r=isNaN(s);return i&&r?0:i&&1||r&&-1||n-s},$$=t=>t.map(({field:e,type:n,order:s=1})=>{switch(n){case String:return(i,r)=>L$(i[e],r[e])*s;case Number:return(i,r)=>M$(i[e],r[e])*s;case Date:return(i,r)=>R$(i[e],r[e])*s;default:return()=>0}}),F$=(t="")=>{const e=t.charAt(0);return e.match(new RegExp("\\p{Letter}","gu"))?e.toUpperCase():e.match(new RegExp("\\p{Number}","gu"))?"#":"⌘"},V$=t=>{},H$=[{difference:NaN,text:()=>Wl("grouped-list.undefined")},{difference:864e5,text:()=>Wl("grouped-list.today")},{difference:6048e5,text:()=>Wl("grouped-list.last-week")},{difference:2592e6,text:()=>Wl("grouped-list.last-month")},{difference:1/0,text:t=>t.getFullYear()}],U$=t=>{var s;const e=new Date(t),n=new Date-e;return(s=H$.find(i=>isNaN(n)||n{switch(e){case String:return n=>F$(n[t]);case Number:return n=>n[t];case Date:return n=>U$(n[t]);case"Digits":return n=>V$(n[t]);default:return()=>mS}};class Tt{constructor({items:e=[],total:n=0,offset:s=0,limit:i=-1}={},r={}){this.items=e,this.total=n,this.offset=s,this.limit=i,this.count=e.length,this.indices=[],this.group(r)}group({criteria:e=[],filters:n=[],index:s}={}){const i=this.items.filter(l=>n.every(c=>c(l)));this.count=i.length;const r=$$(e),o=i.sort((l,c)=>r.reduce((u,d)=>u||d(l,c),0)),a=j$(s);return this.itemsGrouped=o.reduce((l,c)=>{const u=a(c);return l.set(u,[...l.get(u)||[],c]),l},new Map),this.indices=Array.from(this.itemsGrouped.keys()),this}*generate(){for(const[e,n]of this.itemsGrouped.entries()){e!==mS&&(yield{index:e,isItem:!1,item:{},itemId:e});for(const s of n)yield{index:e,isItem:!0,item:s,itemId:s.id}}}[Symbol.iterator](){return this.generate()}}const sm={name:"ControlProgress",props:{size:{default:36,type:Number},value:{default:0,type:Number}},computed:{offset(){return 1-this.value},progress(){return`${Math.round(this.value*100)}%`}}},yb=()=>{Jh(t=>({"3ce61f74":t.offset}))},bb=sm.setup;sm.setup=bb?(t,e)=>(yb(),bb(t,e)):yb;const B$={class:"is-flex"},W$=["width","height"],G$=["textContent"];function K$(t,e,n,s,i,r){return O(),F("div",B$,[(O(),F("svg",{width:n.size,height:n.size,viewBox:"0 0 200 200"},[e[0]||(e[0]=P("defs",null,[P("circle",{id:"circle",cx:"50%",cy:"50%",pathLength:"1",r:"90"})],-1)),e[1]||(e[1]=P("use",{href:"#circle",class:"progress-base"},null,-1)),e[2]||(e[2]=P("use",{href:"#circle",class:"progress-bar"},null,-1)),P("text",{x:"50%",y:"50%",class:"is-size-1 progress-text",textContent:et(r.progress)},null,8,G$)],8,W$))])}const z$=nt(sm,[["render",K$],["__scopeId","data-v-06c7995f"]]),q$={name:"ListItem",components:{ControlImage:Hr,ControlProgress:z$},props:{icon:{default:null,type:String},image:{default:null,type:Object},index:{default:null,type:[String,Number]},isItem:{default:!0,type:Boolean},isPlayable:{default:!0,type:Boolean},isRead:{default:!1,type:Boolean},lines:{default:null,type:Array},progress:{default:null,type:Number}},emits:["open","openDetails"],methods:{open(){this.$emit("open")},openDetails(){this.$emit("openDetails")}}},X$={key:0,class:"py-5"},Y$={class:"media-content"},Z$=["id","textContent"],J$={class:"media-content"},Q$=["textContent"],t5={key:0,class:"is-size-7 has-text-grey"},e5={key:2,class:"media-right"},n5={class:"media-right"};function s5(t,e,n,s,i,r){const o=w("mdicon"),a=w("control-image"),l=w("control-progress");return n.isItem?(O(),F("div",{key:1,class:Gt(["media is-align-items-center mb-0",{"is-clickable":n.isPlayable,"is-not-allowed":!n.isPlayable}]),onClick:e[1]||(e[1]=(...c)=>r.open&&r.open(...c))},[n.icon?(O(),yt(o,{key:0,class:"media-left icon",name:n.icon},null,8,["name"])):_t("",!0),n.image?(O(),yt(a,{key:1,url:n.image.url,caption:n.image.caption,class:"media-left is-small"},null,8,["url","caption"])):_t("",!0),P("div",J$,[(O(!0),F(it,null,de(n.lines,(c,u)=>(O(),F("div",{key:u,class:Gt({"is-size-6":u===0,"is-size-7":u!==0,"has-text-weight-bold":u!==2,"has-text-grey":(u!==0||n.isRead)&&n.isPlayable,"has-text-grey-light":!n.isPlayable}),textContent:et(c)},null,10,Q$))),128)),n.isPlayable?_t("",!0):(O(),F("div",t5,[le(t.$slots,"reason",{},void 0,!0)]))]),n.progress?(O(),F("div",e5,[E(l,{value:n.progress},null,8,["value"])])):_t("",!0),P("div",n5,[P("a",{onClick:e[0]||(e[0]=jn((...c)=>r.openDetails&&r.openDetails(...c),["prevent","stop"]))},[E(o,{class:"icon has-text-grey",name:"dots-vertical",size:"16"})])])],2)):(O(),F("div",X$,[P("div",Y$,[P("span",{id:`index_${n.index}`,class:"tag is-small has-text-weight-bold",textContent:et(n.index)},null,8,Z$)])]))}const Ls=nt(q$,[["render",s5],["__scopeId","data-v-8ec36f11"]]),i5={name:"ListProperties",components:{ControlImage:Hr},props:{item:{required:!0,type:Object}}},r5=["textContent"],o5={class:"title is-6"},a5=["onClick","textContent"],l5=["textContent"];function c5(t,e,n,s,i,r){var a;const o=w("control-image");return O(),F(it,null,[n.item.image?(O(),yt(o,{key:0,url:n.item.image,caption:n.item.name,class:"is-normal mb-5"},null,8,["url","caption"])):_t("",!0),t.$slots.buttons?le(t.$slots,"buttons",{key:1}):_t("",!0),(O(!0),F(it,null,de((a=n.item.properties)==null?void 0:a.filter(l=>l.value),l=>(O(),F("div",{key:l.key,class:"mb-3"},[P("div",{class:"is-size-7 is-uppercase",textContent:et(t.$t(l.key))},null,8,r5),P("div",o5,[l.handler?(O(),F("a",{key:0,onClick:l.handler,textContent:et(l.value)},null,8,a5)):(O(),F("span",{key:1,class:"title is-6",textContent:et(l.value)},null,8,l5))])]))),128))],64)}const gS=nt(i5,[["render",c5]]),u5={name:"ModalDialogPlayable",components:{ControlButton:cn,ListProperties:gS,ModalDialog:sr},props:{buttons:{default:()=>[],type:Array},item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{actions(){return[{handler:this.addToQueue,icon:"playlist-plus",key:"actions.add"},{handler:this.addNextToQueue,icon:"playlist-play",key:"actions.add-next"},{handler:this.play,icon:"play",key:"actions.play"}]}},methods:{addNextToQueue(){this.$emit("close"),this.item.expression?ae.addExpression(this.item.expression,!0):ae.addUri(this.item.uris||this.item.uri,!0)},addToQueue(){this.$emit("close"),this.item.expression?ae.addExpression(this.item.expression):ae.addUri(this.item.uris||this.item.uri)},play(){this.$emit("close"),this.item.expression?ae.playExpression(this.item.expression,!1):ae.playUri(this.item.uris||this.item.uri,!1)}}},d5={class:"buttons"};function f5(t,e,n,s,i,r){const o=w("control-button"),a=w("list-properties"),l=w("modal-dialog");return O(),yt(l,{actions:r.actions,show:n.show,title:n.item.name,onClose:e[0]||(e[0]=c=>t.$emit("close"))},{content:R(()=>[E(a,{item:n.item},sl({_:2},[n.buttons.length?{name:"buttons",fn:R(()=>[P("div",d5,[(O(!0),F(it,null,de(n.buttons,c=>(O(),yt(o,{key:c.key,button:c},null,8,["button"]))),128))])]),key:"0"}:void 0]),1032,["item"])]),_:1},8,["actions","show","title"])}const gs=nt(u5,[["render",f5]]),h5={name:"ModalDialogTrack",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close","play-count-changed"],computed:{buttons(){return this.item.media_kind!=="podcast"?[]:this.item.play_count>0?[{handler:this.markAsNew,key:"actions.mark-as-new"}]:[{handler:this.markAsPlayed,key:"actions.mark-as-played"}]},playable(){return{name:this.item.title,properties:[{handler:this.openAlbum,key:"property.album",value:this.item.album},{handler:this.openArtist,key:"property.album-artist",value:this.item.album_artist},{key:"property.composer",value:this.item.composer},{key:"property.release-date",value:this.$formatters.toDate(this.item.date_released)},{key:"property.year",value:this.item.year},{key:"property.genre",value:this.item.genre},{key:"property.position",value:this.item.track_number>0&&[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.item.length_ms>0&&this.$formatters.toTimecode(this.item.length_ms)},{key:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{key:"property.quality",value:this.item.data_kind!=="spotify"&&this.$t("dialog.track.quality-value",{bitrate:this.item.bitrate,count:this.item.channels,format:this.item.type,samplerate:this.item.samplerate})},{key:"property.added-on",value:this.$formatters.toDateTime(this.item.time_added)},{key:"property.rating",value:this.$t("dialog.track.rating-value",{rating:Math.floor(this.item.rating/10)})},{key:"property.comment",value:this.item.comment},{key:"property.path",value:this.item.path}],uri:this.item.uri}}},methods:{markAsNew(){Ct.updateTrack(this.item.id,{play_count:"reset"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},markAsPlayed(){Ct.updateTrack(this.item.id,{play_count:"increment"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},openAlbum(){this.$emit("close"),this.item.media_kind==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.album_id}}):this.item.media_kind==="audiobook"?this.$router.push({name:"audiobook-album",params:{id:this.item.album_id}}):this.item.media_kind==="music"&&this.$router.push({name:"music-album",params:{id:this.item.album_id}})},openArtist(){this.$emit("close"),this.item.media_kind==="music"||this.item.media_kind==="podcast"?this.$router.push({name:"music-artist",params:{id:this.item.album_artist_id}}):this.item.media_kind==="audiobook"&&this.$router.push({name:"audiobook-artist",params:{id:this.item.album_artist_id}})},openGenre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{mediaKind:this.item.media_kind}})}}};function p5(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{buttons:r.buttons,item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["buttons","item","show"])}const m5=nt(h5,[["render",p5]]),g5={name:"ListTracks",components:{ListItem:Ls,ModalDialogTrack:m5},props:{expression:{default:"",type:String},icon:{default:null,type:String},items:{default:null,type:Object},load:{default:null,type:Function},showProgress:{default:!1,type:Boolean},uris:{default:"",type:String}},emits:["play-count-changed"],data(){return{selectedItem:{},showDetailsModal:!1}},methods:{isRead(t){return t.media_kind==="podcast"&&t.play_count>0},open(t){this.uris?ae.playUri(this.uris,!1,this.items.items.indexOf(t)):this.expression?ae.playExpression(this.expression,!1,this.items.items.indexOf(t)):ae.playUri(t.uri,!1)},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0},progress(t){return this.showProgress&&t.seek_ms>0?t.seek_ms/t.length_ms:null}}};function y5(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-track");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,icon:n.icon,"is-item":l.isItem,"is-read":r.isRead(l.item),index:l.index,lines:[l.item.title,l.item.artist,l.item.album],progress:r.progress(l.item),onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["icon","is-item","is-read","index","lines","progress","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1),onPlayCountChanged:e[1]||(e[1]=l=>t.$emit("play-count-changed"))},null,8,["item","show"])],64)}const Jn=nt(g5,[["render",y5]]),b5={name:"ModalDialogAlbum",components:{ModalDialog:sr,ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},mediaKind:{default:"",type:String},show:Boolean},emits:["close","play-count-changed","podcast-deleted"],data(){return{showRemovePodcastModal:!1}},computed:{actions(){return[{handler:this.cancel,icon:"cancel",key:this.$t("actions.cancel")},{handler:this.removePodcast,icon:"delete",key:this.$t("actions.remove")}]},buttons(){return this.computedMediaKind==="podcast"?this.item.data_kind==="url"?[{handler:this.markAsPlayed,key:"actions.mark-as-played"},{handler:this.openRemovePodcastDialog,key:"actions.remove"}]:[{handler:this.markAsPlayed,key:"actions.mark-as-played"}]:[]},computedMediaKind(){return this.mediaKind||this.item.media_kind},playable(){return{image:this.item.artwork_url,name:this.item.name,properties:[{handler:this.openArtist,key:"property.artist",value:this.item.artist},{key:"property.release-date",value:this.$formatters.toDate(this.item.date_released)},{key:"property.year",value:this.item.year},{key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)},{key:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{key:"property.added-on",value:this.$formatters.toDateTime(this.item.time_added)}],uri:this.item.uri}}},methods:{cancel(){this.showRemovePodcastModal=!1},markAsPlayed(){Ct.updateAlbum(this.item.id,{play_count:"played"}).then(()=>{this.$emit("play-count-changed"),this.$emit("close")})},openArtist(){this.$emit("close"),this.$router.push({name:`${this.computedMediaKind}-artist`,params:{id:this.item.artist_id}})},openRemovePodcastDialog(){this.showRemovePodcastModal=!0,this.showDetailsModal=!1},removePodcast(){this.showRemovePodcastModal=!1,Ct.albumTracks(this.item.id,{limit:1}).then(t=>{Ct.trackPlaylists(t.items[0].id).then(e=>{const{id:n}=e.items.find(s=>s.type==="rss");Ct.playlistDelete(n).then(()=>{this.$emit("podcast-deleted"),this.$emit("close")})})})}}},v5=["textContent"];function _5(t,e,n,s,i,r){const o=w("modal-dialog-playable"),a=w("i18n-t"),l=w("modal-dialog");return O(),F(it,null,[E(o,{buttons:r.buttons,item:r.playable,show:n.show,onClose:e[0]||(e[0]=c=>t.$emit("close"))},null,8,["buttons","item","show"]),E(l,{actions:r.actions,show:i.showRemovePodcastModal,title:t.$t("dialog.podcast.remove.title"),onClose:e[1]||(e[1]=c=>i.showRemovePodcastModal=!1),onRemove:r.removePodcast},{content:R(()=>[E(a,{tag:"p",keypath:"dialog.podcast.remove.info",scope:"global"},{separator:R(()=>e[2]||(e[2]=[P("br",null,null,-1)])),name:R(()=>[P("b",{textContent:et(n.item.name)},null,8,v5)]),_:1})]),_:1},8,["actions","show","title","onRemove"])],64)}const ud=nt(b5,[["render",_5]]),S5={name:"PaneHero",components:{ControlButton:cn},props:{content:{required:!0,type:Object}}},E5=["textContent"],w5={class:"subtitle is-6"},k5=["textContent"],T5=["textContent"],C5={class:"buttons is-centered-mobile mt-5"};function A5(t,e,n,s,i,r){const o=w("control-button");return O(),F(it,null,[P("div",{class:"title is-5",textContent:et(n.content.title)},null,8,E5),P("div",w5,[P("a",{onClick:e[0]||(e[0]=(...a)=>n.content.handler&&n.content.handler(...a)),textContent:et(n.content.subtitle)},null,8,k5)]),P("div",{class:"is-size-7 is-uppercase has-text-centered-mobile",textContent:et(n.content.count)},null,8,T5),P("div",C5,[(O(!0),F(it,null,de(n.content.actions,(a,l)=>(O(),yt(o,{key:l,button:a},null,8,["button"]))),128))])],64)}const dd=nt(S5,[["render",A5]]),O5={name:"PageAlbum",components:{ContentWithHero:cd,ControlImage:Hr,ListTracks:Jn,ModalDialogAlbum:ud,PaneHero:dd},beforeRouteEnter(t,e,n){Promise.all([Ct.album(t.params.id),Ct.albumTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.album=s,r.tracks=new Tt(i,{criteria:[{field:"disc_number",type:Number}],index:{field:"disc_number",type:Number}}),r.tracks.indices.length<2&&r.tracks.group()})})},data(){return{album:{},showDetailsModal:!1,tracks:new Tt}},computed:{heading(){return{count:this.$t("data.tracks",{count:this.album.track_count}),handler:this.openArtist,subtitle:this.album.artist,title:this.album.name,actions:[{handler:this.play,icon:"shuffle",key:"actions.shuffle"},{handler:this.openDetails,icon:"dots-horizontal"}]}}},methods:{openArtist(){this.showDetailsModal=!1,this.$router.push({name:"music-artist",params:{id:this.album.artist_id}})},openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.album.uri,!0)}}};function x5(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks"),c=w("content-with-hero"),u=w("modal-dialog-album");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),image:R(()=>[E(a,{url:i.album.artwork_url,caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]),content:R(()=>[E(l,{items:i.tracks,uris:i.album.uri},null,8,["items","uris"])]),_:1}),E(u,{item:i.album,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const I5=nt(O5,[["render",x5]]);function N5(t){return t.scrollHeight}function P5(t){return t.scrollWidth}function D5(t,e){t.scrollTop=t.scrollHeight-e+t.scrollTop}function M5(t,e){t.scrollLeft=t.scrollWidth-e+t.scrollLeft}const L5=P("div",{class:"loading"},"Loading...",-1),R5=P("div",{class:"no-more"},"No more.",-1),$5=P("div",{class:"no-results"},"No results.",-1),F5=P("div",{class:"error"},"Error.",-1),V5=ki({__name:"VueEternalLoading",props:{load:{required:!0,type:Function},isInitial:{required:!1,type:Boolean,default:!0},position:{required:!1,type:String,default:"default"},container:{required:!1,type:Object,default:null},margin:{required:!1,type:String,default:void 0}},emits:["update:isInitial"],setup(t,{emit:e}){const n=t,s=os();let i=os("loading"),r=os(n.isInitial),o=0;function a(){$r(()=>{var g,v;n.position==="top"?D5((g=n.container)!=null?g:document.documentElement,o):n.position==="left"&&M5((v=n.container)!=null?v:document.documentElement,o)})}function l(g,v){return g===0?r.value?(u(),"no-results"):(c(),"no-more"):g!==void 0&&v!==void 0&&g{var v,S;g.isIntersecting&&(n.position==="top"?o=N5((v=n.container)!=null?v:document.documentElement):n.position==="left"&&(o=P5((S=n.container)!=null?S:document.documentElement)),m(),n.load({loaded:l,noMore:c,noResults:u,error:d},{isFirstLoad:r.value}))},{root:n.container,threshold:0,rootMargin:n.margin})}let _;return typeof IntersectionObserver<"u"&&s1(()=>{_&&m(),_=y(),b()},{flush:"post"}),Xn(()=>n.isInitial,g=>{g&&f()}),Xn(r,g=>{g||e("update:isInitial",!1)}),(g,v)=>(O(),F("div",{class:"vue-eternal-loading",ref_key:"rootRef",ref:s},[Fn(i)==="loading"?le(g.$slots,"loading",ro(ao({key:0},{isFirstLoad:Fn(r)})),()=>[L5]):Fn(i)==="no-more"?le(g.$slots,"no-more",ro(ao({key:1},{retry:h})),()=>[R5]):Fn(i)==="no-results"?le(g.$slots,"no-results",ro(ao({key:2},{retry:h})),()=>[$5]):Fn(i)==="error"?le(g.$slots,"error",ro(ao({key:3},{retry:h})),()=>[F5]):_t("",!0)],512))}}),H5={name:"LoaderListItem",components:{VueEternalLoading:V5},props:{load:{default:null,type:Function}}},U5={class:"columns is-centered"},j5={class:"column has-text-centered"};function B5(t,e,n,s,i,r){const o=w("mdicon"),a=w("vue-eternal-loading");return n.load?(O(),yt(a,{key:0,load:n.load},{loading:R(()=>[P("div",U5,[P("div",j5,[E(o,{class:"icon mdi-spin",name:"loading"})])])]),"no-more":R(()=>e[0]||(e[0]=[P("br",null,null,-1)])),"no-results":R(()=>e[1]||(e[1]=[P("br",null,null,-1)])),_:1},8,["load"])):_t("",!0)}const fd=nt(H5,[["render",B5]]),W5={name:"ModalDialogTrackSpotify",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t;return this.item.artists?{name:this.item.name,properties:[{handler:this.openAlbum,key:"property.album",value:this.item.album.name},{handler:this.openArtist,key:"property.album-artist",value:(t=this.item.artists[0])==null?void 0:t.name},{key:"property.release-date",value:this.$formatters.toDate(this.item.album.release_date)},{key:"property.position",value:[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.$formatters.toTimecode(this.item.duration_ms)},{key:"property.path",value:this.item.uri}],uri:this.item.uri}:{}}},methods:{openAlbum(){this.$emit("close"),this.$router.push({name:"music-spotify-album",params:{id:this.item.album.id}})},openArtist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function G5(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const K5=nt(W5,[["render",G5]]),z5={name:"ListTracksSpotify",components:{ListItem:Ls,LoaderListItem:fd,ModalDialogTrackSpotify:K5},props:{contextUri:{default:"",type:String},items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){t.is_playable&&ae.playUri(this.contextUri||t.uri,!1,t.position||0)},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}},q5=["textContent"],X5=["textContent"];function Y5(t,e,n,s,i,r){const o=w("list-item"),a=w("loader-list-item"),l=w("modal-dialog-track-spotify");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,c=>(O(),yt(o,{key:c.id,"is-playable":c.is_playable,lines:[c.name,c.artists[0].name,c.album.name],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},sl({_:2},[c.is_playable?void 0:{name:"reason",fn:R(()=>{var u;return[e[1]||(e[1]=qs(" (")),P("span",{textContent:et(t.$t("list.spotify.not-playable-track"))},null,8,q5),(u=c.restrictions)!=null&&u.reason?(O(),F("span",{key:0,textContent:et(t.$t("list.spotify.restriction-reason",{reason:c.restrictions.reason}))},null,8,X5)):_t("",!0),e[2]||(e[2]=qs(") "))]}),key:"0"}]),1032,["is-playable","lines","onOpen","onOpenDetails"]))),128)),E(a,{load:n.load},null,8,["load"]),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const im=nt(z5,[["render",Y5]]),Z5={name:"ModalDialogAlbumSpotify",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e,n,s,i,r;return{image:((n=(e=(t=this.item)==null?void 0:t.images)==null?void 0:e[0])==null?void 0:n.url)||"",name:this.item.name||"",properties:[{handler:this.openArtist,key:"property.artist",value:(r=(i=(s=this.item)==null?void 0:s.artists)==null?void 0:i[0])==null?void 0:r.name},{key:"property.release-date",value:this.$formatters.toDate(this.item.release_date)},{key:"property.type",value:this.item.album_type}],uri:this.item.uri}}},methods:{openArtist(){this.$emit("close"),this.$router.push({name:"music-spotify-artist",params:{id:this.item.artists[0].id}})}}};function J5(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const yS=nt(Z5,[["render",J5]]);var nf={exports:{}},vb;function Q5(){return vb||(vb=1,function(t){var e=function(){var n="https://api.spotify.com/v1",s=null,i=null,r=function(f,h){return f.abort=h,f},o=function(f,h){var p;if(i!==null){var m=i.defer();f(function(b){m.resolve(b)},function(b){m.reject(b)}),p=m.promise}else window.Promise&&(p=new window.Promise(f));return p?new r(p,h):null},a=function(){var f=Array.prototype.slice.call(arguments),h=f[0],p=f.slice(1);return h=h||{},p.forEach(function(m){for(var b in m)m.hasOwnProperty(b)&&(h[b]=m[b])}),h},l=function(f,h){var p="";for(var m in h)if(h.hasOwnProperty(m)){var b=h[m];p+=encodeURIComponent(m)+"="+encodeURIComponent(b)+"&"}return p.length>0&&(p=p.substring(0,p.length-1),f=f+"?"+p),f},c=function(f,h){var p=new XMLHttpRequest,m=function(b,y){function _(k){b&&b(k),h&&h(null,k)}function g(){y&&y(p),h&&h(p,null)}var v=f.type||"GET";if(p.open(v,l(f.url,f.params)),s&&p.setRequestHeader("Authorization","Bearer "+s),p.onreadystatechange=function(){if(p.readyState===4){var k=null;try{k=p.responseText?JSON.parse(p.responseText):""}catch(I){console.error(I)}p.status>=200&&p.status<300?_(k):g()}},v==="GET")p.send(null);else{var S=null;f.postData&&(f.contentType==="image/jpeg"?(S=f.postData,p.setRequestHeader("Content-Type",f.contentType)):(S=JSON.stringify(f.postData),p.setRequestHeader("Content-Type","application/json"))),p.send(S)}};return h?(m(),null):o(m,function(){p.abort()})},u=function(f,h,p,m){var b={},y=null;typeof h=="object"?(b=h,y=p):typeof h=="function"&&(y=h);var _=f.type||"GET";return _!=="GET"&&f.postData&&!m?f.postData=a(f.postData,b):f.params=a(f.params,b),c(f,y)},d=function(){};return d.prototype={constructor:e},d.prototype.getGeneric=function(f,h){var p={url:f};return u(p,h)},d.prototype.getMe=function(f,h){var p={url:n+"/me"};return u(p,f,h)},d.prototype.getMySavedTracks=function(f,h){var p={url:n+"/me/tracks"};return u(p,f,h)},d.prototype.addToMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedTracks=function(f,h,p){var m={url:n+"/me/tracks/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMySavedAlbums=function(f,h){var p={url:n+"/me/albums"};return u(p,f,h)},d.prototype.addToMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedAlbums=function(f,h,p){var m={url:n+"/me/albums/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMyTopArtists=function(f,h){var p={url:n+"/me/top/artists"};return u(p,f,h)},d.prototype.getMyTopTracks=function(f,h){var p={url:n+"/me/top/tracks"};return u(p,f,h)},d.prototype.getMyRecentlyPlayedTracks=function(f,h){var p={url:n+"/me/player/recently-played"};return u(p,f,h)},d.prototype.followUsers=function(f,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.followArtists=function(f,h){var p={url:n+"/me/following/",type:"PUT",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.followPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/followers",type:"PUT",postData:{}};return u(m,h,p)},d.prototype.unfollowUsers=function(f,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.unfollowArtists=function(f,h){var p={url:n+"/me/following/",type:"DELETE",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.unfollowPlaylist=function(f,h){var p={url:n+"/playlists/"+f+"/followers",type:"DELETE"};return u(p,h)},d.prototype.isFollowingUsers=function(f,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"user"}};return u(p,h)},d.prototype.isFollowingArtists=function(f,h){var p={url:n+"/me/following/contains",type:"GET",params:{ids:f.join(","),type:"artist"}};return u(p,h)},d.prototype.areFollowingPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/followers/contains",type:"GET",params:{ids:h.join(",")}};return u(m,p)},d.prototype.getFollowedArtists=function(f,h){var p={url:n+"/me/following",type:"GET",params:{type:"artist"}};return u(p,f,h)},d.prototype.getUser=function(f,h,p){var m={url:n+"/users/"+encodeURIComponent(f)};return u(m,h,p)},d.prototype.getUserPlaylists=function(f,h,p){var m;return typeof f=="string"?m={url:n+"/users/"+encodeURIComponent(f)+"/playlists"}:(m={url:n+"/me/playlists"},p=h,h=f),u(m,h,p)},d.prototype.getPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f};return u(m,h,p)},d.prototype.getPlaylistTracks=function(f,h,p){var m={url:n+"/playlists/"+f+"/tracks"};return u(m,h,p)},d.prototype.getPlaylistCoverImage=function(f,h){var p={url:n+"/playlists/"+f+"/images"};return u(p,h)},d.prototype.createPlaylist=function(f,h,p){var m={url:n+"/users/"+encodeURIComponent(f)+"/playlists",type:"POST",postData:h};return u(m,h,p)},d.prototype.changePlaylistDetails=function(f,h,p){var m={url:n+"/playlists/"+f,type:"PUT",postData:h};return u(m,h,p)},d.prototype.addTracksToPlaylist=function(f,h,p,m){var b={url:n+"/playlists/"+f+"/tracks",type:"POST",postData:{uris:h}};return u(b,p,m,!0)},d.prototype.replaceTracksInPlaylist=function(f,h,p){var m={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{uris:h}};return u(m,{},p)},d.prototype.reorderTracksInPlaylist=function(f,h,p,m,b){var y={url:n+"/playlists/"+f+"/tracks",type:"PUT",postData:{range_start:h,insert_before:p}};return u(y,m,b)},d.prototype.removeTracksFromPlaylist=function(f,h,p){var m=h.map(function(y){return typeof y=="string"?{uri:y}:y}),b={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:m}};return u(b,{},p)},d.prototype.removeTracksFromPlaylistWithSnapshotId=function(f,h,p,m){var b=h.map(function(_){return typeof _=="string"?{uri:_}:_}),y={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{tracks:b,snapshot_id:p}};return u(y,{},m)},d.prototype.removeTracksFromPlaylistInPositions=function(f,h,p,m){var b={url:n+"/playlists/"+f+"/tracks",type:"DELETE",postData:{positions:h,snapshot_id:p}};return u(b,{},m)},d.prototype.uploadCustomPlaylistCoverImage=function(f,h,p){var m={url:n+"/playlists/"+f+"/images",type:"PUT",postData:h.replace(/^data:image\/jpeg;base64,/,""),contentType:"image/jpeg"};return u(m,{},p)},d.prototype.getAlbum=function(f,h,p){var m={url:n+"/albums/"+f};return u(m,h,p)},d.prototype.getAlbumTracks=function(f,h,p){var m={url:n+"/albums/"+f+"/tracks"};return u(m,h,p)},d.prototype.getAlbums=function(f,h,p){var m={url:n+"/albums/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getTrack=function(f,h,p){var m={};return m.url=n+"/tracks/"+f,u(m,h,p)},d.prototype.getTracks=function(f,h,p){var m={url:n+"/tracks/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getArtist=function(f,h,p){var m={url:n+"/artists/"+f};return u(m,h,p)},d.prototype.getArtists=function(f,h,p){var m={url:n+"/artists/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getArtistAlbums=function(f,h,p){var m={url:n+"/artists/"+f+"/albums"};return u(m,h,p)},d.prototype.getArtistTopTracks=function(f,h,p,m){var b={url:n+"/artists/"+f+"/top-tracks",params:{country:h}};return u(b,p,m)},d.prototype.getArtistRelatedArtists=function(f,h,p){var m={url:n+"/artists/"+f+"/related-artists"};return u(m,h,p)},d.prototype.getFeaturedPlaylists=function(f,h){var p={url:n+"/browse/featured-playlists"};return u(p,f,h)},d.prototype.getNewReleases=function(f,h){var p={url:n+"/browse/new-releases"};return u(p,f,h)},d.prototype.getCategories=function(f,h){var p={url:n+"/browse/categories"};return u(p,f,h)},d.prototype.getCategory=function(f,h,p){var m={url:n+"/browse/categories/"+f};return u(m,h,p)},d.prototype.getCategoryPlaylists=function(f,h,p){var m={url:n+"/browse/categories/"+f+"/playlists"};return u(m,h,p)},d.prototype.search=function(f,h,p,m){var b={url:n+"/search/",params:{q:f,type:h.join(",")}};return u(b,p,m)},d.prototype.searchAlbums=function(f,h,p){return this.search(f,["album"],h,p)},d.prototype.searchArtists=function(f,h,p){return this.search(f,["artist"],h,p)},d.prototype.searchTracks=function(f,h,p){return this.search(f,["track"],h,p)},d.prototype.searchPlaylists=function(f,h,p){return this.search(f,["playlist"],h,p)},d.prototype.searchShows=function(f,h,p){return this.search(f,["show"],h,p)},d.prototype.searchEpisodes=function(f,h,p){return this.search(f,["episode"],h,p)},d.prototype.getAudioFeaturesForTrack=function(f,h){var p={};return p.url=n+"/audio-features/"+f,u(p,{},h)},d.prototype.getAudioFeaturesForTracks=function(f,h){var p={url:n+"/audio-features",params:{ids:f}};return u(p,{},h)},d.prototype.getAudioAnalysisForTrack=function(f,h){var p={};return p.url=n+"/audio-analysis/"+f,u(p,{},h)},d.prototype.getRecommendations=function(f,h){var p={url:n+"/recommendations"};return u(p,f,h)},d.prototype.getAvailableGenreSeeds=function(f){var h={url:n+"/recommendations/available-genre-seeds"};return u(h,{},f)},d.prototype.getMyDevices=function(f){var h={url:n+"/me/player/devices"};return u(h,{},f)},d.prototype.getMyCurrentPlaybackState=function(f,h){var p={url:n+"/me/player"};return u(p,f,h)},d.prototype.getMyCurrentPlayingTrack=function(f,h){var p={url:n+"/me/player/currently-playing"};return u(p,f,h)},d.prototype.transferMyPlayback=function(f,h,p){var m=h||{};m.device_ids=f;var b={type:"PUT",url:n+"/me/player",postData:m};return u(b,h,p)},d.prototype.play=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={};["context_uri","uris","offset","position_ms"].forEach(function(_){_ in f&&(m[_]=f[_])});var b={type:"PUT",url:n+"/me/player/play",params:p,postData:m},y=typeof f=="function"?f:{};return u(b,y,h)},d.prototype.queue=function(f,h,p){h=h||{};var m="device_id"in h?{uri:f,device_id:h.device_id}:{uri:f},b={type:"POST",url:n+"/me/player/queue",params:m};return u(b,h,p)},d.prototype.pause=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"PUT",url:n+"/me/player/pause",params:p};return u(m,f,h)},d.prototype.skipToNext=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"POST",url:n+"/me/player/next",params:p};return u(m,f,h)},d.prototype.skipToPrevious=function(f,h){f=f||{};var p="device_id"in f?{device_id:f.device_id}:null,m={type:"POST",url:n+"/me/player/previous",params:p};return u(m,f,h)},d.prototype.seek=function(f,h,p){h=h||{};var m={position_ms:f};"device_id"in h&&(m.device_id=h.device_id);var b={type:"PUT",url:n+"/me/player/seek",params:m};return u(b,h,p)},d.prototype.setRepeat=function(f,h,p){h=h||{};var m={state:f};"device_id"in h&&(m.device_id=h.device_id);var b={type:"PUT",url:n+"/me/player/repeat",params:m};return u(b,h,p)},d.prototype.setVolume=function(f,h,p){h=h||{};var m={volume_percent:f};"device_id"in h&&(m.device_id=h.device_id);var b={type:"PUT",url:n+"/me/player/volume",params:m};return u(b,h,p)},d.prototype.setShuffle=function(f,h,p){h=h||{};var m={state:f};"device_id"in h&&(m.device_id=h.device_id);var b={type:"PUT",url:n+"/me/player/shuffle",params:m};return u(b,h,p)},d.prototype.getShow=function(f,h,p){var m={};return m.url=n+"/shows/"+f,u(m,h,p)},d.prototype.getShows=function(f,h,p){var m={url:n+"/shows/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getMySavedShows=function(f,h){var p={url:n+"/me/shows"};return u(p,f,h)},d.prototype.addToMySavedShows=function(f,h,p){var m={url:n+"/me/shows",type:"PUT",postData:f};return u(m,h,p)},d.prototype.removeFromMySavedShows=function(f,h,p){var m={url:n+"/me/shows",type:"DELETE",postData:f};return u(m,h,p)},d.prototype.containsMySavedShows=function(f,h,p){var m={url:n+"/me/shows/contains",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getShowEpisodes=function(f,h,p){var m={url:n+"/shows/"+f+"/episodes"};return u(m,h,p)},d.prototype.getEpisode=function(f,h,p){var m={};return m.url=n+"/episodes/"+f,u(m,h,p)},d.prototype.getEpisodes=function(f,h,p){var m={url:n+"/episodes/",params:{ids:f.join(",")}};return u(m,h,p)},d.prototype.getAccessToken=function(){return s},d.prototype.setAccessToken=function(f){s=f},d.prototype.setPromiseImplementation=function(f){var h=!1;try{var p=new f(function(m){m()});typeof p.then=="function"&&typeof p.catch=="function"&&(h=!0)}catch(m){console.error(m)}if(h)i=f;else throw new Error("Unsupported implementation of Promises/A+")},d}();t.exports=e}(nf)),nf.exports}var t8=Q5();const Ys=Fu(t8),e8={name:"PageAlbumSpotify",components:{ContentWithHero:cd,ControlImage:Hr,ListTracksSpotify:im,ModalDialogAlbumSpotify:yS,PaneHero:dd},beforeRouteEnter(t,e,n){const s=new Ys;cs.spotify().then(i=>{s.setAccessToken(i.webapi_token),s.getAlbum(t.params.id,{market:Je().spotify.webapi_country}).then(r=>{n(o=>{o.album=r})})})},setup(){return{servicesStore:Je()}},data(){return{album:{artists:[{}],tracks:{}},showDetailsModal:!1}},computed:{heading(){return{actions:[{handler:this.play,icon:"shuffle",key:"actions.shuffle"},{handler:this.openDetails,icon:"dots-horizontal"}],count:this.$t("data.tracks",{count:this.album.tracks.total}),handler:this.openArtist,subtitle:this.album.artists[0].name,title:this.album.name}},tracks(){const{album:t}=this;return t.tracks.total?t.tracks.items.map(e=>({...e,album:t})):[]}},methods:{openArtist(){this.$router.push({name:"music-spotify-artist",params:{id:this.album.artists[0].id}})},openDetails(){this.showDetailsModal=!0},play(){this.showDetailsModal=!1,ae.playUri(this.album.uri,!0)}}};function n8(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks-spotify"),c=w("content-with-hero"),u=w("modal-dialog-album-spotify");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),image:R(()=>{var d,f;return[E(a,{url:((f=(d=i.album.images)==null?void 0:d[0])==null?void 0:f.url)??"",caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]}),content:R(()=>[E(l,{items:r.tracks,"context-uri":i.album.uri},null,8,["items","context-uri"])]),_:1}),E(u,{item:i.album,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const s8=nt(e8,[["render",n8]]),i8={name:"ControlDropdown",props:{options:{required:!0,type:Array},value:{required:!0,type:[String,Number]}},emits:["update:value"],data(){return{active:!1}},computed:{option:{get(){return this.options.find(t=>t.id===this.value)}}},methods:{deactivate(){this.active=!1},select(t){this.active=!1,this.$emit("update:value",t.id)}}},r8={class:"dropdown-trigger"},o8=["textContent"],a8={id:"dropdown",class:"dropdown-menu",role:"menu"},l8={class:"dropdown-content"},c8=["onClick","textContent"];function u8(t,e,n,s,i,r){const o=w("mdicon"),a=Wh("click-away");return hs((O(),F("div",{class:Gt(["dropdown",{"is-active":i.active}])},[P("div",r8,[P("button",{class:"button","aria-haspopup":"true","aria-controls":"dropdown",onClick:e[0]||(e[0]=l=>i.active=!i.active)},[P("span",{textContent:et(r.option.name)},null,8,o8),E(o,{class:"icon",name:"chevron-down",size:"16"})])]),P("div",a8,[P("div",l8,[(O(!0),F(it,null,de(n.options,l=>(O(),F("a",{key:l.id,class:Gt(["dropdown-item",{"is-active":n.value===l.id}]),onClick:c=>r.select(l),textContent:et(l.name)},null,10,c8))),128))])])],2)),[[a,r.deactivate]])}const Ur=nt(i8,[["render",u8]]),d8={name:"ListAlbums",components:{ListItem:Ls,ModalDialogAlbum:ud},props:{items:{required:!0,type:Object},load:{default:null,type:Function},mediaKind:{default:"",type:String}},emits:["play-count-changed","podcast-deleted"],setup(){return{settingsStore:Ei()}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{image(t){return this.settingsStore.showCoverArtworkInAlbumLists?{caption:t.item.name,url:t.item.artwork_url}:null},open(t){const e=this.mediaKind||t.media_kind;e==="podcast"?this.$router.push({name:"podcast",params:{id:t.id}}):this.$router.push({name:`${e}-album`,params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0},playCountChanged(){this.$emit("play-count-changed")},podcastDeleted(){this.$emit("podcast-deleted")}}};function f8(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-album");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,image:r.image(l),index:l.index,lines:[l.item.name,l.item.artist,t.$formatters.toDate(l.item.date_released)],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","image","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,"media-kind":n.mediaKind,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1),onPlayCountChanged:r.playCountChanged,onPodcastDeleted:r.podcastDeleted},null,8,["item","media-kind","show","onPlayCountChanged","onPodcastDeleted"])],64)}const ds=nt(d8,[["render",f8]]),h8={name:"ListIndexButtons",props:{indices:{required:!0,type:Array}}},p8={class:"buttons is-centered mb-4"};function m8(t,e,n,s,i,r){const o=w("router-link");return O(),F("section",null,[P("nav",p8,[(O(!0),F(it,null,de(n.indices,a=>(O(),yt(o,{key:a,class:"button is-small p-2 is-index",to:{hash:`#index_${a}`,query:t.$route.query}},{default:R(()=>[qs(et(a),1)]),_:2},1032,["to"]))),128))])])}const ys=nt(h8,[["render",m8],["__scopeId","data-v-dc002763"]]),g8={name:"ListOptions"},y8={class:"columns"},b8={key:0,class:"column"},v8=["textContent"],_8={key:1,class:"column"},S8=["textContent"];function E8(t,e,n,s,i,r){return O(),F("div",y8,[t.$slots.filter?(O(),F("div",b8,[P("div",{class:"is-size-7 is-uppercase",textContent:et(t.$t("options.filter.title"))},null,8,v8),le(t.$slots,"filter")])):_t("",!0),t.$slots.sort?(O(),F("div",_8,[P("div",{class:"is-size-7 is-uppercase",textContent:et(t.$t("options.sort.title"))},null,8,S8),le(t.$slots,"sort")])):_t("",!0)])}const Go=nt(g8,[["render",E8]]),w8={name:"ControlTabList",props:{links:{required:!0,type:Array}}},k8={class:"section py-0 tabs-section"},T8={class:"container"},C8={class:"columns is-centered my-0"},A8={class:"column is-four-fifths py-0"},O8={class:"tabs is-centered is-small"},x8=["onClick","onKeypress"],I8=["textContent"];function N8(t,e,n,s,i,r){const o=w("mdicon"),a=w("router-link");return O(),F("section",k8,[P("div",T8,[P("div",C8,[P("div",A8,[P("div",O8,[P("ul",null,[(O(!0),F(it,null,de(n.links,l=>(O(),yt(a,{key:l.to.name,to:{name:l.to.name},custom:""},{default:R(({navigate:c,isActive:u})=>[P("li",{class:Gt({"is-active":u})},[P("a",{onClick:c,onKeypress:R1(c,["enter"])},[l.icon?(O(),yt(o,{key:0,class:"icon is-small mx-1",name:l.icon},null,8,["name"])):_t("",!0),P("span",{class:Gt({"is-hidden-mobile":l.icon}),textContent:et(t.$t(l.key))},null,10,I8)],40,x8)],2)]),_:2},1032,["to"]))),128))])])])])])])}const rm=nt(w8,[["render",N8],["__scopeId","data-v-51d61991"]]),P8={name:"TabsMusic",components:{ControlTabList:rm},setup(){return{servicesStore:Je()}},computed:{links(){const t=[{icon:"history",key:"page.music.tabs.history",to:{name:"music-history"}},{icon:"account-music",key:"page.music.tabs.artists",to:{name:"music-artists"}},{icon:"album",key:"page.music.tabs.albums",to:{name:"music-albums"}},{icon:"speaker",key:"page.music.tabs.genres",to:{name:"music-genres"}},{icon:"book-open-page-variant",key:"page.music.tabs.composers",to:{name:"music-composers"}}];return this.servicesStore.isSpotifyActive&&t.push({icon:"spotify",key:"page.music.tabs.spotify",to:{name:"music-spotify"}}),t}}};function D8(t,e,n,s,i,r){const o=w("control-tab-list");return O(),yt(o,{links:r.links},null,8,["links"])}const Js=nt(P8,[["render",D8]]),M8={name:"PageAlbums",components:{ContentWithHeading:ie,ControlDropdown:Ur,ControlSwitch:Fr,ListAlbums:ds,ListIndexButtons:ys,ListOptions:Go,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){Ct.albums("music").then(s=>{n(i=>{i.albumList=new Tt(s)})})},setup(){return{servicesStore:Je(),uiStore:Zn()}},data(){return{albumList:new Tt}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.albumsSort);return t.filters=[e=>!this.uiStore.hideSingles||e.track_count>2,e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.albumList.group(t)},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("options.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}},{id:3,name:this.$t("options.sort.recently-released"),options:{criteria:[{field:"date_released",order:-1,type:Date}],index:{field:"date_released",type:Date}}},{id:4,name:this.$t("options.sort.artist-name"),options:{criteria:[{field:"artist",type:String},{field:"name_sort",type:String}],index:{field:"artist",type:String}}},{id:5,name:this.$t("options.sort.artist-date"),options:{criteria:[{field:"artist",type:String},{field:"date_released",type:Date}],index:{field:"artist",type:String}}}]},heading(){return{subtitle:[{count:this.albums.count,key:"data.albums"}],title:this.$t("page.albums.title")}}}},L8=["textContent"],R8=["textContent"],$8=["textContent"],F8=["textContent"];function V8(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("control-switch"),c=w("control-dropdown"),u=w("list-options"),d=w("pane-title"),f=w("list-albums"),h=w("content-with-heading");return O(),F(it,null,[E(o),E(h,null,{options:R(()=>[E(a,{indices:r.albums.indices},null,8,["indices"]),E(u,null,{filter:R(()=>[E(l,{modelValue:s.uiStore.hideSingles,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hideSingles=p)},{label:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles"))},null,8,L8)]),help:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles-help"))},null,8,R8)]),_:1},8,["modelValue"]),s.servicesStore.isSpotifyActive?(O(),yt(l,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[1]||(e[1]=p=>s.uiStore.hideSpotify=p)},{label:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,$8)]),help:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,F8)]),_:1},8,["modelValue"])):_t("",!0)]),sort:R(()=>[E(c,{value:s.uiStore.albumsSort,"onUpdate:value":e[2]||(e[2]=p=>s.uiStore.albumsSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:R(()=>[E(d,{content:r.heading},null,8,["content"])]),content:R(()=>[E(f,{items:r.albums},null,8,["items"])]),_:1})],64)}const H8=nt(M8,[["render",V8]]),U8={name:"ModalDialogArtist",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{name:this.item.name,properties:[{key:"property.albums",value:this.item.album_count},{key:"property.tracks",value:this.item.track_count},{key:"property.type",value:this.$t(`data.kind.${this.item.data_kind}`)},{key:"property.added-on",value:this.$formatters.toDateTime(this.item.time_added)}],uri:this.item.uri}}}};function j8(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const hd=nt(U8,[["render",j8]]),B8={name:"PageArtist",components:{ContentWithHeading:ie,ControlButton:cn,ControlDropdown:Ur,ControlSwitch:Fr,ListAlbums:ds,ListOptions:Go,ModalDialogArtist:hd,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.artist(t.params.id),Ct.artistAlbums(t.params.id)]).then(([s,i])=>{n(r=>{r.artist=s,r.albumList=new Tt(i)})})},setup(){return{servicesStore:Je(),uiStore:Zn()}},data(){return{albumList:new Tt,artist:{},showDetailsModal:!1}},computed:{albums(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artistAlbumsSort);return t.filters=[e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.albumList.group(t)},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{criteria:[{field:"name_sort",type:String}]}},{id:2,name:this.$t("options.sort.release-date"),options:{criteria:[{field:"date_released",type:Date}]}}]},heading(){return{subtitle:[{count:this.albums.count,key:"data.albums"},{count:this.trackCount,handler:this.openTracks,key:"data.tracks"}],title:this.artist.name}},trackCount(){return[...this.albums].reduce((t,e)=>t+((e==null?void 0:e.item.track_count)||0),0)}},methods:{openDetails(){this.showDetailsModal=!0},openTracks(){this.$router.push({name:"music-artist-tracks",params:{id:this.artist.id}})},play(){ae.playUri(this.albums.items.map(t=>t.uri).join(),!0)}}},W8=["textContent"],G8=["textContent"];function K8(t,e,n,s,i,r){const o=w("control-switch"),a=w("control-dropdown"),l=w("list-options"),c=w("pane-title"),u=w("control-button"),d=w("list-albums"),f=w("content-with-heading"),h=w("modal-dialog-artist");return O(),F(it,null,[E(f,null,{options:R(()=>[E(l,null,{filter:R(()=>[s.servicesStore.isSpotifyActive?(O(),yt(o,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hideSpotify=p)},{label:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,W8)]),help:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,G8)]),_:1},8,["modelValue"])):_t("",!0)]),sort:R(()=>[E(a,{value:s.uiStore.artistAlbumsSort,"onUpdate:value":e[1]||(e[1]=p=>s.uiStore.artistAlbumsSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:R(()=>[E(c,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(u,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(d,{items:r.albums},null,8,["items"])]),_:1}),E(h,{item:i.artist,show:i.showDetailsModal,onClose:e[2]||(e[2]=p=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const z8=nt(B8,[["render",K8]]),q8={name:"ListAlbumsSpotify",components:{ListItem:Ls,LoaderListItem:fd,ModalDialogAlbumSpotify:yS},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},setup(){return{settingsStore:Ei()}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{image(t){var e,n;return this.settingsStore.showCoverArtworkInAlbumLists?{caption:t.name,url:((n=(e=t.images)==null?void 0:e[0])==null?void 0:n.url)??""}:null},open(t){this.$router.push({name:"music-spotify-album",params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function X8(t,e,n,s,i,r){const o=w("list-item"),a=w("loader-list-item"),l=w("modal-dialog-album-spotify");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,c=>{var u;return O(),yt(o,{key:c.id,"is-item":c.isItem,image:r.image(c),index:c.index,lines:[c.name,(u=c.artists[0])==null?void 0:u.name,t.$formatters.toDate(c.release_date)],onOpen:d=>r.open(c),onOpenDetails:d=>r.openDetails(c)},null,8,["is-item","image","index","lines","onOpen","onOpenDetails"])}),128)),E(a,{load:n.load},null,8,["load"]),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const pd=nt(q8,[["render",X8]]),Y8={name:"ModalDialogArtistSpotify",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e;return{name:this.item.name,properties:[{key:"property.popularity",value:[this.item.popularity,(t=this.item.followers)==null?void 0:t.total].join(" / ")},{key:"property.genres",value:(e=this.item.genres)==null?void 0:e.join(", ")}],uri:this.item.uri}}}};function Z8(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const bS=nt(Y8,[["render",Z8]]),sf=50,J8={name:"PageArtistSpotify",components:{ContentWithHeading:ie,ControlButton:cn,ListAlbumsSpotify:pd,ModalDialogArtistSpotify:bS,PaneTitle:re},beforeRouteEnter(t,e,n){cs.spotify().then(s=>{const i=new Ys;i.setAccessToken(s.webapi_token),Promise.all([i.getArtist(t.params.id),i.getArtistAlbums(t.params.id,{include_groups:"album,single",limit:sf,market:Je().spotify.webapi_country,offset:0})]).then(([r,o])=>{n(a=>{a.artist=r,a.albums=o.items,a.total=o.total,a.offset=o.limit})})})},setup(){return{servicesStore:Je()}},data(){return{albums:[],artist:{},offset:0,showDetailsModal:!1,total:0}},computed:{heading(){return{subtitle:[{count:this.total,key:"data.albums"}],title:this.artist.name}}},methods:{appendAlbums(t){this.albums=this.albums.concat(t.items),this.total=t.total,this.offset+=t.limit},load({loaded:t}){cs.spotify().then(e=>{const n=new Ys;n.setAccessToken(e.webapi_token),n.getArtistAlbums(this.artist.id,{include_groups:"album,single",limit:sf,offset:this.offset}).then(s=>{this.appendAlbums(s),t(s.items.length,sf)})})},openDetails(){this.showDetailsModal=!0},play(){this.showDetailsModal=!1,ae.playUri(this.artist.uri,!0)}}};function Q8(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-albums-spotify"),c=w("content-with-heading"),u=w("modal-dialog-artist-spotify");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(l,{items:i.albums,load:r.load},null,8,["items","load"])]),_:1}),E(u,{item:i.artist,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const t6=nt(J8,[["render",Q8]]),e6={name:"PageArtistTracks",components:{ContentWithHeading:ie,ControlButton:cn,ControlDropdown:Ur,ControlSwitch:Fr,ListIndexButtons:ys,ListOptions:Go,ListTracks:Jn,ModalDialogArtist:hd,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.artist(t.params.id),Ct.artistTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.artist=s,r.trackList=new Tt(i)})})},setup(){return{servicesStore:Je(),uiStore:Zn()}},data(){return{artist:{},showDetailsModal:!1,trackList:new Tt}},computed:{albumCount(){return new Set([...this.tracks].filter(t=>t.isItem).map(t=>t.item.album_id)).size},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("options.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}]},heading(){return{subtitle:[{count:this.albumCount,handler:this.openArtist,key:"data.albums"},{count:this.tracks.count,key:"data.tracks"}],title:this.artist.name}},trackUris(){return this.trackList.items.map(t=>t.uri).join()},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artistTracksSort);return t.filters=[e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.trackList.group(t)}},methods:{openArtist(){this.showDetailsModal=!1,this.$router.push({name:"music-artist",params:{id:this.artist.id}})},openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.trackList.items.map(t=>t.uri).join(),!0)}}},n6=["textContent"],s6=["textContent"];function i6(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("control-switch"),l=w("control-dropdown"),c=w("list-options"),u=w("pane-title"),d=w("control-button"),f=w("list-tracks"),h=w("content-with-heading"),p=w("modal-dialog-artist");return O(),F(it,null,[E(h,null,{options:R(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),E(c,null,{filter:R(()=>[s.servicesStore.isSpotifyActive?(O(),yt(a,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[0]||(e[0]=m=>s.uiStore.hideSpotify=m)},{label:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,n6)]),help:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,s6)]),_:1},8,["modelValue"])):_t("",!0)]),sort:R(()=>[E(l,{value:s.uiStore.artistTracksSort,"onUpdate:value":e[1]||(e[1]=m=>s.uiStore.artistTracksSort=m),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:R(()=>[E(u,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(d,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(d,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(f,{items:r.tracks,uris:r.trackUris},null,8,["items","uris"])]),_:1}),E(p,{item:i.artist,show:i.showDetailsModal,onClose:e[2]||(e[2]=m=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const r6=nt(e6,[["render",i6]]),o6={name:"ListArtists",components:{ListItem:Ls,ModalDialogArtist:hd},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:`${t.media_kind}-artist`,params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function a6(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-artist");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const om=nt(o6,[["render",a6]]),l6={name:"PageArtists",components:{ContentWithHeading:ie,ControlDropdown:Ur,ControlSwitch:Fr,ListArtists:om,ListIndexButtons:ys,ListOptions:Go,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){Ct.artists("music").then(s=>{n(i=>{i.artistList=new Tt(s)})})},setup(){return{servicesStore:Je(),uiStore:Zn()}},data(){return{artistList:new Tt}},computed:{artists(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.artistsSort);return t.filters=[e=>!this.uiStore.hideSingles||e.track_count>e.album_count*2,e=>!this.uiStore.hideSpotify||e.data_kind!=="spotify"],this.artistList.group(t)},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"name_sort",type:String}}},{id:2,name:this.$t("options.sort.recently-added"),options:{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}}}]},heading(){return{subtitle:[{count:this.artists.count,key:"data.artists"}],title:this.$t("page.artists.title")}}}},c6=["textContent"],u6=["textContent"],d6=["textContent"],f6=["textContent"];function h6(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("control-switch"),c=w("control-dropdown"),u=w("list-options"),d=w("pane-title"),f=w("list-artists"),h=w("content-with-heading");return O(),F(it,null,[E(o),E(h,null,{options:R(()=>[E(a,{indices:r.artists.indices},null,8,["indices"]),E(u,null,{filter:R(()=>[E(l,{modelValue:s.uiStore.hideSingles,"onUpdate:modelValue":e[0]||(e[0]=p=>s.uiStore.hideSingles=p)},{label:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles"))},null,8,c6)]),help:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-singles-help"))},null,8,u6)]),_:1},8,["modelValue"]),s.servicesStore.isSpotifyActive?(O(),yt(l,{key:0,modelValue:s.uiStore.hideSpotify,"onUpdate:modelValue":e[1]||(e[1]=p=>s.uiStore.hideSpotify=p)},{label:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify"))},null,8,d6)]),help:R(()=>[P("span",{textContent:et(t.$t("options.filter.hide-spotify-help"))},null,8,f6)]),_:1},8,["modelValue"])):_t("",!0)]),sort:R(()=>[E(c,{value:s.uiStore.artistsSort,"onUpdate:value":e[2]||(e[2]=p=>s.uiStore.artistsSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:R(()=>[E(d,{content:r.heading},null,8,["content"])]),content:R(()=>[E(f,{items:r.artists},null,8,["items"])]),_:1})],64)}const p6=nt(l6,[["render",h6]]),m6={name:"PageAudiobookAlbum",components:{ContentWithHero:cd,ControlImage:Hr,ListTracks:Jn,ModalDialogAlbum:ud,PaneHero:dd},beforeRouteEnter(t,e,n){Promise.all([Ct.album(t.params.id),Ct.albumTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.album=s,r.tracks=new Tt(i)})})},data(){return{album:{},showDetailsModal:!1,tracks:new Tt}},computed:{heading(){return{count:this.$t("data.tracks",{count:this.album.track_count}),handler:this.openArtist,subtitle:this.album.artist,title:this.album.name,actions:[{handler:this.play,icon:"play",key:"actions.play"},{handler:this.openDetails,icon:"dots-horizontal"}]}}},methods:{openArtist(){this.showDetailsModal=!1,this.$router.push({name:"audiobook-artist",params:{id:this.album.artist_id}})},openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.album.uri,!1)}}};function g6(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks"),c=w("content-with-hero"),u=w("modal-dialog-album");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),image:R(()=>[E(a,{url:i.album.artwork_url,caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]),content:R(()=>[E(l,{items:i.tracks,"show-progress":!0,uris:i.album.uri},null,8,["items","uris"])]),_:1}),E(u,{item:i.album,show:i.showDetailsModal,"media-kind":"audiobook",onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const y6=nt(m6,[["render",g6]]),b6={name:"TabsAudiobooks",components:{ControlTabList:rm},computed:{links(){return[{icon:"account-music",key:"page.audiobooks.tabs.authors",to:{name:"audiobook-artists"}},{icon:"album",key:"page.audiobooks.tabs.audiobooks",to:{name:"audiobook-albums"}},{icon:"speaker",key:"page.audiobooks.tabs.genres",to:{name:"audiobook-genres"}}]}}};function v6(t,e,n,s,i,r){const o=w("control-tab-list");return O(),yt(o,{links:r.links},null,8,["links"])}const am=nt(b6,[["render",v6]]),_6={name:"PageAudiobookAlbums",components:{ContentWithHeading:ie,ListAlbums:ds,ListIndexButtons:ys,PaneTitle:re,TabsAudiobooks:am},beforeRouteEnter(t,e,n){Ct.albums("audiobook").then(s=>{n(i=>{i.albums=new Tt(s,{index:{field:"name_sort",type:String}})})})},data(){return{albums:new Tt}},computed:{heading(){return{subtitle:[{count:this.albums.count,key:"data.audiobooks"}],title:this.$t("page.audiobooks.albums.title")}}}};function S6(t,e,n,s,i,r){const o=w("tabs-audiobooks"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-albums"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:R(()=>[E(a,{indices:i.albums.indices},null,8,["indices"])]),heading:R(()=>[E(l,{content:r.heading},null,8,["content"])]),content:R(()=>[E(c,{items:i.albums},null,8,["items"])]),_:1})],64)}const E6=nt(_6,[["render",S6]]),w6={name:"PageAudiobookArtist",components:{ContentWithHeading:ie,ControlButton:cn,ListAlbums:ds,ModalDialogArtist:hd,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.artist(t.params.id),Ct.artistAlbums(t.params.id)]).then(([s,i])=>{n(r=>{r.artist=s,r.albums=new Tt(i)})})},data(){return{albums:new Tt,artist:{},showDetailsModal:!1}},computed:{heading(){return this.artist.name?{subtitle:[{count:this.artist.album_count,key:"data.audiobooks"}],title:this.artist.name}:{}}},methods:{openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.albums.items.map(t=>t.uri).join(),!1)}}};function k6(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-albums"),c=w("content-with-heading"),u=w("modal-dialog-artist");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"play",key:"actions.play"}},null,8,["button"])]),content:R(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1}),E(u,{item:i.artist,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const T6=nt(w6,[["render",k6]]),C6={name:"PageAudiobookArtists",components:{ContentWithHeading:ie,ListArtists:om,ListIndexButtons:ys,PaneTitle:re,TabsAudiobooks:am},beforeRouteEnter(t,e,n){Ct.artists("audiobook").then(s=>{n(i=>{i.artists=new Tt(s,{index:{field:"name_sort",type:String}})})})},data(){return{artists:new Tt}},computed:{heading(){return{subtitle:[{count:this.artists.count,key:"data.authors"}],title:this.$t("page.audiobooks.artists.title")}}}};function A6(t,e,n,s,i,r){const o=w("tabs-audiobooks"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-artists"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:R(()=>[E(a,{indices:i.artists.indices},null,8,["indices"])]),heading:R(()=>[E(l,{content:r.heading},null,8,["content"])]),content:R(()=>[E(c,{items:i.artists},null,8,["items"])]),_:1})],64)}const O6=nt(C6,[["render",A6]]),x6={name:"ModalDialogGenre",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},mediaKind:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{expression:`genre is "${this.item.name}" and media_kind is ${this.mediaKind}`,name:this.item.name,properties:[{key:"property.albums",value:this.item.album_count},{key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)}]}}}};function I6(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const lm=nt(x6,[["render",I6]]),N6={name:"ListGenres",components:{ListItem:Ls,ModalDialogGenre:lm},props:{items:{required:!0,type:Object},mediaKind:{required:!0,type:String}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:"genre-albums",params:{name:t.name},query:{mediaKind:this.mediaKind}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function P6(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-genre");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,"media-kind":n.mediaKind,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","media-kind","show"])],64)}const vS=nt(N6,[["render",P6]]),D6={name:"PageAudiobooksGenres",components:{ContentWithHeading:ie,ListGenres:vS,ListIndexButtons:ys,PaneTitle:re,TabsAudiobooks:am},beforeRouteEnter(t,e,n){Ct.genres("audiobook").then(s=>{n(i=>{i.genres=new Tt(s,{index:{field:"name_sort",type:String}})})})},data(){return{genres:new Tt}},computed:{heading(){return{subtitle:[{count:this.genres.total,key:"data.genres"}],title:this.$t("page.genres.title")}}}};function M6(t,e,n,s,i,r){const o=w("tabs-audiobooks"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-genres"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:R(()=>[E(a,{indices:i.genres.indices},null,8,["indices"])]),heading:R(()=>[E(l,{content:r.heading},null,8,["content"])]),content:R(()=>[E(c,{items:i.genres,"media-kind":"audiobook"},null,8,["items"])]),_:1})],64)}const L6=nt(D6,[["render",M6]]),R6={name:"ModalDialogComposer",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){return{expression:`composer is "${this.item.name}" and media_kind is music`,name:this.item.name,properties:[{handler:this.openAlbums,key:"property.albums",value:this.item.album_count},{handler:this.openTracks,key:"property.tracks",value:this.item.track_count},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)}]}}},methods:{openAlbums(){this.$emit("close"),this.$router.push({name:"music-composer-albums",params:{name:this.item.name}})},openTracks(){this.$emit("close"),this.$router.push({name:"music-composer-tracks",params:{name:this.item.name}})}}};function $6(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const cm=nt(R6,[["render",$6]]),F6={name:"PageComposerAlbums",components:{ContentWithHeading:ie,ControlButton:cn,ListAlbums:ds,ModalDialogComposer:cm,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.composer(t.params.name),Ct.composerAlbums(t.params.name)]).then(([s,i])=>{n(r=>{r.composer=s,r.albums=new Tt(i)})})},data(){return{albums:new Tt,composer:{},showDetailsModal:!1}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},heading(){return this.composer.name?{subtitle:[{count:this.composer.album_count,key:"data.albums"},{count:this.composer.track_count,handler:this.openTracks,key:"data.tracks"}],title:this.composer.name}:{}}},methods:{openDetails(){this.showDetailsModal=!0},openTracks(){this.$router.push({name:"music-composer-tracks",params:{name:this.composer.name}})},play(){ae.playExpression(this.expression,!0)}}};function V6(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-albums"),c=w("content-with-heading"),u=w("modal-dialog-composer");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1}),E(u,{item:i.composer,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const H6=nt(F6,[["render",V6]]),U6={name:"PageComposerTracks",components:{ContentWithHeading:ie,ControlButton:cn,ControlDropdown:Ur,ListIndexButtons:ys,ListOptions:Go,ListTracks:Jn,ModalDialogComposer:cm,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.composer(t.params.name),Ct.composerTracks(t.params.name)]).then(([s,i])=>{n(r=>{r.composer=s,r.trackList=new Tt(i)})})},setup(){return{uiStore:Zn()}},data(){return{composer:{},showDetailsModal:!1,trackList:new Tt}},computed:{expression(){return`composer is "${this.composer.name}" and media_kind is music`},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("options.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}]},heading(){return this.composer.name?{subtitle:[{count:this.composer.album_count,handler:this.openAlbums,key:"data.albums"},{count:this.composer.track_count,key:"data.tracks"}],title:this.composer.name}:{}},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.composerTracksSort);return this.trackList.group(t)}},methods:{openAlbums(){this.$router.push({name:"music-composer-albums",params:{name:this.composer.name}})},openDetails(){this.showDetailsModal=!0},play(){ae.playExpression(this.expression,!0)}}};function j6(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("control-dropdown"),l=w("list-options"),c=w("pane-title"),u=w("control-button"),d=w("list-tracks"),f=w("content-with-heading"),h=w("modal-dialog-composer");return O(),F(it,null,[E(f,null,{options:R(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),E(l,null,{sort:R(()=>[E(a,{value:s.uiStore.composerTracksSort,"onUpdate:value":e[0]||(e[0]=p=>s.uiStore.composerTracksSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:R(()=>[E(c,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(u,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(d,{items:r.tracks,expression:r.expression},null,8,["items","expression"])]),_:1}),E(h,{item:i.composer,show:i.showDetailsModal,onClose:e[1]||(e[1]=p=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const B6=nt(U6,[["render",j6]]),W6={name:"ListComposers",components:{ListItem:Ls,ModalDialogComposer:cm},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:"music-composer-albums",params:{name:t.name}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function G6(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-composer");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const _S=nt(W6,[["render",G6]]),K6={name:"PageComposers",components:{ContentWithHeading:ie,ListComposers:_S,ListIndexButtons:ys,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){Ct.composers("music").then(s=>{n(i=>{i.composers=new Tt(s,{index:{field:"name_sort",type:String}})})})},data(){return{composers:new Tt}},computed:{heading(){return{subtitle:[{count:this.composers.total,key:"data.composers"}],title:this.$t("page.composers.title")}}}};function z6(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-composers"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:R(()=>[E(a,{indices:i.composers.indices},null,8,["indices"])]),heading:R(()=>[E(l,{content:r.heading},null,8,["content"])]),content:R(()=>[E(c,{items:i.composers},null,8,["items"])]),_:1})],64)}const q6=nt(K6,[["render",z6]]),X6={name:"ModalDialogDirectory",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:String},show:Boolean},emits:["close"],computed:{playable(){return{expression:`path starts with "${this.item}" order by path asc`,name:this.item}}}};function Y6(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const Z6=nt(X6,[["render",Y6]]),J6={name:"ListDirectories",components:{ListItem:Ls,ModalDialogDirectory:Z6},props:{items:{required:!0,type:Array}},data(){return{selectedItem:"",showDetailsModal:!1}},computed:{directories(){var n;const t=[];let e="";return(n=this.$route.query)==null||n.directory.split("/").slice(1,-1).forEach((s,i)=>{e=`${e}/${s}`,t.push({index:i,name:s,path:e})}),t}},methods:{open(t){const e={name:"files"};t.index!==0&&(e.query={directory:t.path}),this.$router.push(e)},openDetails(t){this.selectedItem=t.path,this.showDetailsModal=!0},openParent(){this.open(this.directories.slice(-1).pop())}}},Q6={key:0,class:"media is-align-items-center mb-0"},tF={class:"media-content"},eF={class:"breadcrumb"},nF=["onClick","textContent"],sF={class:"media-right"};function iF(t,e,n,s,i,r){const o=w("mdicon"),a=w("list-item"),l=w("modal-dialog-directory");return O(),F(it,null,[t.$route.query.directory?(O(),F("div",Q6,[E(o,{class:"icon media-left is-clickable",name:"chevron-left",onClick:r.openParent},null,8,["onClick"]),P("div",tF,[P("nav",eF,[P("ul",null,[(O(!0),F(it,null,de(r.directories,c=>(O(),F("li",{key:c.index},[P("a",{onClick:u=>r.open(c),textContent:et(c.name)},null,8,nF)]))),128))])])]),P("div",sF,[le(t.$slots,"actions")])])):_t("",!0),(O(!0),F(it,null,de(n.items,c=>(O(),yt(a,{key:c.path,icon:"folder",lines:[c.name],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},null,8,["lines","onOpen","onOpenDetails"]))),128)),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const rF=nt(J6,[["render",iF]]),oF={name:"ModalDialogPlaylist",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean,uris:{default:"",type:String}},emits:["close"],computed:{playable(){return{name:this.item.name,properties:[{key:"property.tracks",value:this.item.item_count},{key:"property.type",value:this.$t(`playlist.type.${this.item.type}`)},{key:"property.path",value:this.item.path}],uri:this.item.uri,uris:this.uris}}}};function aF(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const SS=nt(oF,[["render",aF]]),lF={name:"ListPlaylists",components:{ListItem:Ls,ModalDialogPlaylist:SS},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{icon(t){return t.type==="folder"?"folder":t.type==="rss"?"rss":"music-box-multiple"},open(t){t.type==="folder"?this.$router.push({name:"playlist-folder",params:{id:t.id}}):this.$router.push({name:"playlist",params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function cF(t,e,n,s,i,r){const o=w("list-item"),a=w("modal-dialog-playlist");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,l=>(O(),yt(o,{key:l.itemId,icon:r.icon(l.item),"is-item":l.isItem,index:l.index,lines:[l.item.name],onOpen:c=>r.open(l.item),onOpenDetails:c=>r.openDetails(l.item)},null,8,["icon","is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=l=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const um=nt(lF,[["render",cF]]),uF={name:"PageFiles",components:{ContentWithHeading:ie,ControlButton:cn,ListDirectories:rF,ListPlaylists:um,ListTracks:Jn,ModalDialogPlayable:gs,PaneTitle:re},beforeRouteEnter(t,e,n){n(async s=>{await s.fetchData(t)})},beforeRouteUpdate(t,e,n){this.fetchData(t).then(()=>n())},setup(){return{configurationStore:Fo()}},data(){return{directories:[],playlists:new Tt,showDetailsModal:!1,tracks:new Tt}},computed:{current(){var t;return((t=this.$route.query)==null?void 0:t.directory)||"/"},name(){var t;return this.current!=="/"?(t=this.current)==null?void 0:t.slice(this.current.lastIndexOf("/")+1):this.$t("page.files.title")},playable(){return{expression:`path starts with "${this.current}" order by path asc`,name:this.current,properties:[{key:"property.folders",value:this.directories.length},{key:"property.playlists",value:this.playlists.total},{key:"property.tracks",value:this.tracks.total}]}}},methods:{async fetchData(t){if(t.query.directory){const e=await Ct.files(t.query.directory);e&&(this.directories=e.directories.map(n=>this.transform(n.path)),this.playlists=new Tt(e.playlists),this.tracks=new Tt(e.tracks))}else this.directories=this.configurationStore.directories.map(e=>this.transform(e)),this.playlists=new Tt,this.tracks=new Tt},openDetails(){this.showDetailsModal=!0},play(){ae.playExpression(this.expression,!1)},transform(t){return{name:t.slice(t.lastIndexOf("/")+1),path:t}}}};function dF(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-directories"),c=w("list-playlists"),u=w("list-tracks"),d=w("content-with-heading"),f=w("modal-dialog-playable");return O(),F(it,null,[E(d,null,{heading:R(()=>[E(o,{content:{title:r.name}},null,8,["content"])]),actions:R(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"play",key:"actions.play"}},null,8,["button"])]),content:R(()=>[E(l,{items:i.directories},null,8,["items"]),E(c,{items:i.playlists},null,8,["items"]),E(u,{items:i.tracks,icon:"file-music-outline"},null,8,["items"])]),_:1}),E(f,{item:r.playable,show:i.showDetailsModal,onClose:e[0]||(e[0]=h=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const fF=nt(uF,[["render",dF]]),hF={name:"PageGenreAlbums",components:{ContentWithHeading:ie,ControlButton:cn,ListAlbums:ds,ListIndexButtons:ys,ModalDialogGenre:lm,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.genre(t.params.name,t.query.mediaKind),Ct.genreAlbums(t.params.name,t.query.mediaKind)]).then(([s,i])=>{n(r=>{r.genre=s.items.shift(),r.albums=new Tt(i,{index:{field:"name_sort",type:String}})})})},data(){return{albums:new Tt,genre:{},mediaKind:this.$route.query.mediaKind,showDetailsModal:!1}},computed:{heading(){return this.genre.name?{subtitle:[{count:this.genre.album_count,key:"data.albums"},{count:this.genre.track_count,handler:this.openTracks,key:"data.tracks"}],title:this.genre.name}:{}}},methods:{openDetails(){this.showDetailsModal=!0},openTracks(){this.showDetailsModal=!1,this.$router.push({name:"genre-tracks",params:{name:this.genre.name},query:{mediaKind:this.mediaKind}})},play(){ae.playExpression(`genre is "${this.genre.name}" and media_kind is ${this.mediaKind}`,!0)}}};function pF(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("pane-title"),l=w("control-button"),c=w("list-albums"),u=w("content-with-heading"),d=w("modal-dialog-genre");return O(),F(it,null,[E(u,null,{options:R(()=>[E(o,{indices:i.albums.indices},null,8,["indices"])]),heading:R(()=>[E(a,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(l,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(l,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(c,{items:i.albums},null,8,["items"])]),_:1}),E(d,{item:i.genre,"media-kind":i.mediaKind,show:i.showDetailsModal,onClose:e[0]||(e[0]=f=>i.showDetailsModal=!1)},null,8,["item","media-kind","show"])],64)}const mF=nt(hF,[["render",pF]]),gF={name:"PageGenreTracks",components:{ContentWithHeading:ie,ControlButton:cn,ControlDropdown:Ur,ListIndexButtons:ys,ListOptions:Go,ListTracks:Jn,ModalDialogGenre:lm,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.genre(t.params.name,t.query.mediaKind),Ct.genreTracks(t.params.name,t.query.mediaKind)]).then(([s,i])=>{n(r=>{r.genre=s.items.shift(),r.trackList=new Tt(i)})})},setup(){return{uiStore:Zn()}},data(){return{genre:{},mediaKind:this.$route.query.mediaKind,showDetailsModal:!1,trackList:new Tt}},computed:{expression(){return`genre is "${this.genre.name}" and media_kind is ${this.mediaKind}`},groupings(){return[{id:1,name:this.$t("options.sort.name"),options:{index:{field:"title_sort",type:String}}},{id:2,name:this.$t("options.sort.rating"),options:{criteria:[{field:"rating",order:-1,type:Number}],index:{field:"rating",type:"Digits"}}}]},heading(){return this.genre.name?{subtitle:[{count:this.genre.album_count,handler:this.openGenre,key:"data.albums"},{count:this.genre.track_count,key:"data.tracks"}],title:this.genre.name}:{}},tracks(){const{options:t}=this.groupings.find(e=>e.id===this.uiStore.genreTracksSort);return this.trackList.group(t)}},methods:{openDetails(){this.showDetailsModal=!0},openGenre(){this.showDetailsModal=!1,this.$router.push({name:"genre-albums",params:{name:this.genre.name},query:{mediaKind:this.mediaKind}})},play(){ae.playExpression(this.expression,!0)}}};function yF(t,e,n,s,i,r){const o=w("list-index-buttons"),a=w("control-dropdown"),l=w("list-options"),c=w("pane-title"),u=w("control-button"),d=w("list-tracks"),f=w("content-with-heading"),h=w("modal-dialog-genre");return O(),F(it,null,[E(f,null,{options:R(()=>[E(o,{indices:r.tracks.indices},null,8,["indices"]),E(l,null,{sort:R(()=>[E(a,{value:s.uiStore.genreTracksSort,"onUpdate:value":e[0]||(e[0]=p=>s.uiStore.genreTracksSort=p),options:r.groupings},null,8,["value","options"])]),_:1})]),heading:R(()=>[E(c,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(u,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(u,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"}},null,8,["button"])]),content:R(()=>[E(d,{items:r.tracks,expression:r.expression},null,8,["items","expression"])]),_:1}),E(h,{item:i.genre,"media-kind":i.mediaKind,show:i.showDetailsModal,onClose:e[1]||(e[1]=p=>i.showDetailsModal=!1)},null,8,["item","media-kind","show"])],64)}const bF=nt(gF,[["render",yF]]),vF={name:"PageGenres",components:{ContentWithHeading:ie,ListGenres:vS,ListIndexButtons:ys,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){Ct.genres("music").then(s=>{n(i=>{i.genres=new Tt(s,{index:{field:"name_sort",type:String}})})})},data(){return{genres:new Tt}},computed:{heading(){return{subtitle:[{count:this.genres.total,key:"data.genres"}],title:this.$t("page.genres.title")}}}};function _F(t,e,n,s,i,r){const o=w("tabs-music"),a=w("list-index-buttons"),l=w("pane-title"),c=w("list-genres"),u=w("content-with-heading");return O(),F(it,null,[E(o),E(u,null,{options:R(()=>[E(a,{indices:i.genres.indices},null,8,["indices"])]),heading:R(()=>[E(l,{content:r.heading},null,8,["content"])]),content:R(()=>[E(c,{items:i.genres,"media-kind":"music"},null,8,["items"])]),_:1})],64)}const SF=nt(vF,[["render",_F]]),EF={name:"PageMusic",components:{ContentWithHeading:ie,ListAlbums:ds,ListTracks:Jn,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){Promise.all([Ct.search({expression:"time_added after 8 weeks ago and media_kind is music having track_count > 3 order by time_added desc",limit:3,type:"album"}),Ct.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:3,type:"track"})]).then(([{albums:s},{tracks:i}])=>{n(r=>{r.albums=new Tt(s),r.tracks=new Tt(i)})})},data(){return{albums:[],tracks:null}}};function wF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums"),c=w("router-link"),u=w("content-with-heading"),d=w("list-tracks");return O(),F(it,null,[E(o),E(u,null,{heading:R(()=>[E(a,{content:{title:t.$t("page.music.recently-added.title")}},null,8,["content"])]),content:R(()=>[E(l,{items:i.albums},null,8,["items"])]),footer:R(()=>[E(c,{class:"button is-small is-rounded",to:{name:"music-recently-added"}},{default:R(()=>[qs(et(t.$t("actions.show-more")),1)]),_:1})]),_:1}),E(u,null,{heading:R(()=>[E(a,{content:{title:t.$t("page.music.recently-played.title")}},null,8,["content"])]),content:R(()=>[E(d,{items:i.tracks},null,8,["items"])]),footer:R(()=>[E(c,{class:"button is-small is-rounded",to:{name:"music-recently-played"}},{default:R(()=>[qs(et(t.$t("actions.show-more")),1)]),_:1})]),_:1})],64)}const kF=nt(EF,[["render",wF]]),TF={name:"PageMusicRecentlyAdded",components:{ContentWithHeading:ie,ListAlbums:ds,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){const s=Ei().recentlyAddedLimit;Ct.search({expression:"media_kind is music having track_count > 3 order by time_added desc",limit:s,type:"album"}).then(i=>{n(r=>{r.albums=new Tt(i.albums,{criteria:[{field:"time_added",order:-1,type:Date}],index:{field:"time_added",type:Date}})})})},setup(){return{settingsStore:Ei()}},data(){return{albums:new Tt}}};function CF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:R(()=>[E(a,{content:{title:t.$t("page.music.recently-added.title")}},null,8,["content"])]),content:R(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1})],64)}const AF=nt(TF,[["render",CF]]),OF={name:"PageMusicRecentlyPlayed",components:{ContentWithHeading:ie,ListTracks:Jn,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){Ct.search({expression:"time_played after 8 weeks ago and media_kind is music order by time_played desc",limit:50,type:"track"}).then(s=>{n(i=>{i.tracks=new Tt(s.tracks)})})},data(){return{tracks:new Tt}}};function xF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-tracks"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:R(()=>[E(a,{content:{title:t.$t("page.music.recently-played.title")}},null,8,["content"])]),content:R(()=>[E(l,{items:i.tracks},null,8,["items"])]),_:1})],64)}const IF=nt(OF,[["render",xF]]),NF={name:"ModalDialogPlaylistSpotify",components:{ModalDialogPlayable:gs},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],computed:{playable(){var t,e;return{name:this.item.name,properties:[{key:"property.owner",value:(t=this.item.owner)==null?void 0:t.display_name},{key:"property.tracks",value:(e=this.item.tracks)==null?void 0:e.total},{key:"property.path",value:this.item.uri}],uri:this.item.uri}}}};function PF(t,e,n,s,i,r){const o=w("modal-dialog-playable");return O(),yt(o,{item:r.playable,show:n.show,onClose:e[0]||(e[0]=a=>t.$emit("close"))},null,8,["item","show"])}const ES=nt(NF,[["render",PF]]),DF={name:"ListPlaylistsSpotify",components:{ListItem:Ls,LoaderListItem:fd,ModalDialogPlaylistSpotify:ES},props:{items:{required:!0,type:Object},load:{default:null,type:Function}},data(){return{selectedItem:{},showDetailsModal:!1}},methods:{open(t){this.$router.push({name:"playlist-spotify",params:{id:t.id}})},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0}}};function MF(t,e,n,s,i,r){const o=w("list-item"),a=w("loader-list-item"),l=w("modal-dialog-playlist-spotify");return O(),F(it,null,[(O(!0),F(it,null,de(n.items,c=>(O(),yt(o,{key:c.id,"is-item":c.isItem,index:c.index,lines:[c.name,c.owner.display_name],onOpen:u=>r.open(c),onOpenDetails:u=>r.openDetails(c)},null,8,["is-item","index","lines","onOpen","onOpenDetails"]))),128)),E(a,{load:n.load},null,8,["load"]),E(l,{item:i.selectedItem,show:i.showDetailsModal,onClose:e[0]||(e[0]=c=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const dm=nt(DF,[["render",MF]]),LF={name:"PageMusicSpotify",components:{ContentWithHeading:ie,ListAlbumsSpotify:pd,ListPlaylistsSpotify:dm,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){cs.spotify().then(s=>{const i=new Ys;i.setAccessToken(s.webapi_token),Promise.all([i.getNewReleases({country:s.webapi_country,limit:3}),i.getFeaturedPlaylists({country:s.webapi_country,limit:3})]).then(r=>{n(o=>{o.albums=r[0].albums.items,o.playlists=r[1].playlists.items})})})},data(){return{albums:[],playlists:[]}}};function RF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums-spotify"),c=w("router-link"),u=w("content-with-heading"),d=w("list-playlists-spotify");return O(),F(it,null,[E(o),E(u,null,{heading:R(()=>[E(a,{content:{title:t.$t("page.spotify.music.new-releases")}},null,8,["content"])]),content:R(()=>[E(l,{items:i.albums},null,8,["items"])]),footer:R(()=>[E(c,{to:{name:"music-spotify-new-releases"},class:"button is-small is-rounded"},{default:R(()=>[qs(et(t.$t("actions.show-more")),1)]),_:1})]),_:1}),E(u,null,{heading:R(()=>[E(a,{content:{title:t.$t("page.spotify.music.featured-playlists")}},null,8,["content"])]),content:R(()=>[E(d,{items:i.playlists},null,8,["items"])]),footer:R(()=>[E(c,{to:{name:"music-spotify-featured-playlists"},class:"button is-small is-rounded"},{default:R(()=>[qs(et(t.$t("actions.show-more")),1)]),_:1})]),_:1})],64)}const $F=nt(LF,[["render",RF]]),FF={name:"PageMusicSpotifyFeaturedPlaylists",components:{ContentWithHeading:ie,ListPlaylistsSpotify:dm,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){cs.spotify().then(s=>{const i=new Ys;i.setAccessToken(s.webapi_token),i.getFeaturedPlaylists({country:s.webapi_country,limit:50}).then(r=>{n(o=>{o.playlists=r.playlists.items})})})},data(){return{playlists:[]}},computed:{heading(){return{title:this.$t("page.spotify.music.featured-playlists")}}}};function VF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-playlists-spotify"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:R(()=>[E(a,{content:r.heading},null,8,["content"])]),content:R(()=>[E(l,{items:i.playlists},null,8,["items"])]),_:1})],64)}const HF=nt(FF,[["render",VF]]),UF={name:"PageMusicSpotifyNewReleases",components:{ContentWithHeading:ie,ListAlbumsSpotify:pd,PaneTitle:re,TabsMusic:Js},beforeRouteEnter(t,e,n){cs.spotify().then(s=>{const i=new Ys;i.setAccessToken(s.webapi_token),i.getNewReleases({country:s.webapi_country,limit:50}).then(r=>{n(o=>{o.albums=r.albums.items})})})},data(){return{albums:[]}},computed:{heading(){return{title:this.$t("page.spotify.music.new-releases")}}}};function jF(t,e,n,s,i,r){const o=w("tabs-music"),a=w("pane-title"),l=w("list-albums-spotify"),c=w("content-with-heading");return O(),F(it,null,[E(o),E(c,null,{heading:R(()=>[E(a,{content:r.heading},null,8,["content"])]),content:R(()=>[E(l,{items:i.albums},null,8,["items"])]),_:1})],64)}const BF=nt(UF,[["render",jF]]),WF={name:"ModalDialogQueueItem",components:{ListProperties:gS,ModalDialog:sr},props:{item:{required:!0,type:Object},show:Boolean},emits:["close"],setup(){return{servicesStore:Je()}},data(){return{spotifyTrack:{}}},computed:{actions(){return[{handler:this.remove,icon:"delete",key:"actions.remove"},{handler:this.play,icon:"play",key:"actions.play"}]},playable(){return{name:this.item.title,properties:[{handler:this.openAlbum,key:"property.album",value:this.item.album},{handler:this.openArtist,key:"property.album-artist",value:this.item.album_artist},{key:"property.composer",value:this.item.composer},{key:"property.year",value:this.item.year},{handler:this.openGenre,key:"property.genre",value:this.item.genre},{key:"property.position",value:[this.item.disc_number,this.item.track_number].join(" / ")},{key:"property.duration",value:this.$formatters.toTimecode(this.item.length_ms)},{key:"property.path",value:this.item.path},{key:"property.type",value:`${this.$t(`media.kind.${this.item.media_kind}`)} - ${this.$t(`data.kind.${this.item.data_kind}`)}`},{key:"property.quality",value:this.$t("dialog.track.quality-value",{bitrate:this.item.bitrate,count:this.item.channels,format:this.item.type,samplerate:this.item.samplerate})}],uri:this.item.uri}}},watch:{item(){var t;if(((t=this.item)==null?void 0:t.data_kind)==="spotify"){const e=new Ys;e.setAccessToken(this.servicesStore.spotify.webapi_token),e.getTrack(this.item.path.slice(this.item.path.lastIndexOf(":")+1)).then(n=>{this.spotifyTrack=n})}else this.spotifyTrack={}}},methods:{openAlbum(){this.$emit("close"),this.item.data_kind==="spotify"?this.$router.push({name:"music-spotify-album",params:{id:this.spotifyTrack.album.id}}):this.item.media_kind==="podcast"?this.$router.push({name:"podcast",params:{id:this.item.album_id}}):this.$router.push({name:`${this.item.media_kind}-album`,params:{id:this.item.album_id}})},openArtist(){this.$emit("close"),this.item.data_kind==="spotify"?this.$router.push({name:"music-spotify-artist",params:{id:this.spotifyTrack.artists[0].id}}):this.item.media_kind==="music"||this.item.media_kind==="podcast"?this.$router.push({name:"music-artist",params:{id:this.item.album_artist_id}}):this.item.media_kind==="audiobook"&&this.$router.push({name:"audiobook-artist",params:{id:this.item.album_artist_id}})},openGenre(){this.$emit("close"),this.$router.push({name:"genre-albums",params:{name:this.item.genre},query:{mediaKind:this.item.media_kind}})},play(){this.$emit("close"),sn.play({item_id:this.item.id})},remove(){this.$emit("close"),ae.remove(this.item.id)}}};function GF(t,e,n,s,i,r){const o=w("list-properties"),a=w("modal-dialog");return O(),yt(a,{actions:r.actions,show:n.show,title:n.item.title,onClose:e[0]||(e[0]=l=>t.$emit("close"))},{content:R(()=>[E(o,{item:r.playable},null,8,["item"])]),_:1},8,["actions","show","title"])}const wS=nt(WF,[["render",GF]]),KF={name:"PaneLyrics",setup(){return{MIDDLE_POSITION:Math.floor(3.5),VISIBLE_VERSES:7,playerStore:Bn()}},data(){return{lastUpdateTime:0,lyrics:{synchronised:!1,verses:[]},time:0,timerId:null}},computed:{verseIndex(t,e){var i;let n=0,s=e.length-1;for(;n<=s;){const r=Math.floor((n+s)/2),o=e[r].time,a=(i=e[r+1])==null?void 0:i.time;if(o<=t&&(!a||a>t))return r;ot[n+r]??{text:" "})}},watch:{"playerStore.isPlaying"(t){t?(this.lastUpdateTime=Date.now(),this.startTimer()):this.stopTimer()},"playerStore.item_progress_ms"(t){this.lastUpdateTime=Date.now(),this.playerStore.isPlaying||(this.time=t)},"playerStore.lyricsContent"(){this.lyrics=this.parseLyrics()}},mounted(){this.playerStore.initialise(),this.lastUpdateTime=Date.now(),this.lyrics=this.parseLyrics(),this.updateTime()},beforeUnmount(){this.stopTimer()},methods:{isVerseHighlighted(t){return t===this.MIDDLE_POSITION&&this.lyrics.synchronised},isWordHighlighted(t){return this.time>=t.start&&this.time\d+):(?\d+)(?:\.(?\d+))?\])?\s*(?\S.*\S)?\s*/u;return this.playerStore.lyricsContent.split(` `).forEach(n=>{const s=e.exec(n);if(s){const{text:i,minutes:r,seconds:o,hundredths:a}=s.groups,l=i;if(l){const c=(Number(r)*60+ +`${o}.${a??0}`)*1e3;t.synchronised=!isNaN(c),t.verses.push({text:l,time:c})}}}),t.verses.forEach((n,s,i)=>{var u;const o=(((u=i[s+1])==null?void 0:u.time)??n.time+3e3)-n.time,a=n.text.match(/\S+\s*/gu)||[],l=a.reduce((d,f)=>d+f.length,0);let c=n.time;n.words=a.map(d=>{const f=c,h=f+o*(d.length/l);return c=h,{end:h,start:f,text:d}})}),t},startTimer(){this.timerId||(this.timerId=setInterval(this.tick,100))},stopTimer(){this.timerId&&(clearInterval(this.timerId),this.timerId=null)},tick(){this.time=this.playerStore.item_progress_ms+Date.now()-this.lastUpdateTime},updateTime(){this.lastUpdateTime=Date.now(),this.playerStore.isPlaying?this.startTimer():this.time=this.playerStore.item_progress_ms}}},zF={key:0,class:"title is-5 my-5"},qF=["textContent"],XF=["textContent"];function YF(t,e,n,s,i,r){return O(),F("div",{class:Gt(["is-overlay",{"is-synchronised":i.lyrics.synchronised,"is-unsynchronised":!i.lyrics.synchronised}])},[(O(!0),F(it,null,de(r.visibleVerses,(o,a)=>(O(),F(it,{key:a},[r.isVerseHighlighted(a)?(O(),F("div",zF,[(O(!0),F(it,null,de(o.words,(l,c)=>(O(),F("span",{key:c,class:Gt({"is-highlighted":r.isWordHighlighted(l)}),textContent:et(l.text)},null,10,qF))),128))])):(O(),F("div",{key:1,class:"verse",textContent:et(o.text)},null,8,XF))],64))),128))],2)}const ZF=nt(KF,[["render",YF],["__scopeId","data-v-8384b260"]]),Mi=1e3,JF={name:"PagePlayer",components:{ControlImage:Hr,ControlSlider:Ru,ModalDialogQueueItem:wS,PaneLyrics:ZF},setup(){return{playerStore:Bn(),queueStore:Ms(),settingsStore:Ei()}},data(){return{INTERVAL:Mi,intervalId:0,isDragged:!1,selectedItem:{},showDetailsModal:!1}},computed:{composer(){if(this.settingsStore.showComposerNowPlaying){const t=this.settingsStore.showComposerForGenre;if(!t||this.track.genre&&t.toLowerCase().split(",").findIndex(e=>this.track.genre.toLowerCase().indexOf(e.trim())>=0)>=0)return this.track.composer}return null},isLive(){return this.track.length_ms===0},track(){return this.queueStore.current},trackElapsedTime(){return this.$formatters.toTimecode(this.trackProgress*Mi)},trackProgress:{get(){return Math.floor(this.playerStore.item_progress_ms/Mi)},set(t){this.playerStore.item_progress_ms=t*Mi}},trackProgressMax(){return Number(this.isLive)||Math.floor(this.track.length_ms/Mi)},trackTotalTime(){return this.$t("page.player.time",this.track.length_ms,{named:{time:this.$formatters.toTimecode(this.track.length_ms)}})}},watch:{"playerStore.state"(t){this.intervalId>0&&(window.clearTimeout(this.intervalId),this.intervalId=0),t==="play"&&(this.intervalId=window.setInterval(this.tick,Mi))}},created(){this.playerStore.state==="play"&&(this.intervalId=window.setInterval(this.tick,Mi))},unmounted(){this.intervalId>0&&(window.clearTimeout(this.intervalId),this.intervalId=0)},methods:{endDragging(){this.isDragged=!1},openDetails(t){this.selectedItem=t,this.showDetailsModal=!0},seek(){this.isLive||sn.seekToPosition(this.trackProgress*Mi)},startDragging(){this.isDragged=!0},tick(){this.isDragged||(this.trackProgress+=1)}}},QF={class:"is-flex is-align-items-center has-text-centered px-5 is-full-height"},tV={key:0,class:"mx-auto",style:{"max-width":"32rem"}},eV={class:"is-relative"},nV={class:"is-flex is-justify-content-space-between"},sV=["textContent"],iV=["textContent"],rV=["textContent"],oV=["textContent"],aV=["textContent"],lV=["textContent"],cV=["textContent"],uV={key:1,class:"mx-auto"},dV=["textContent"],fV=["textContent"];function hV(t,e,n,s,i,r){const o=w("control-image"),a=w("pane-lyrics"),l=w("control-slider"),c=w("modal-dialog-queue-item");return O(),F(it,null,[P("div",QF,[s.queueStore.isEmpty?(O(),F("div",uV,[P("p",{class:"title is-5",textContent:et(t.$t("page.player.title"))},null,8,dV),P("p",{class:"subtitle",textContent:et(t.$t("page.player.info"))},null,8,fV)])):(O(),F("div",tV,[P("div",eV,[E(o,{url:r.track.artwork_url,caption:r.track.album,class:Gt(["is-big",{"is-masked":s.playerStore.showLyrics}]),onClick:e[0]||(e[0]=u=>r.openDetails(r.track))},null,8,["url","caption","class"]),s.playerStore.showLyrics?(O(),yt(a,{key:0})):_t("",!0)]),E(l,{value:r.trackProgress,"onUpdate:value":e[1]||(e[1]=u=>r.trackProgress=u),class:"mt-5",disabled:r.isLive,max:r.trackProgressMax,onChange:r.seek,onMousedown:r.startDragging,onMouseup:r.endDragging},null,8,["value","disabled","max","onChange","onMousedown","onMouseup"]),P("div",nV,[P("p",{class:"subtitle is-7",textContent:et(r.trackElapsedTime)},null,8,sV),P("p",{class:"subtitle is-7",textContent:et(r.trackTotalTime)},null,8,iV)]),P("p",{class:"title is-5",textContent:et(r.track.title)},null,8,rV),P("p",{class:"title is-6",textContent:et(r.track.artist)},null,8,oV),r.composer?(O(),F("p",{key:0,class:"subtitle is-6 has-text-grey has-text-weight-bold",textContent:et(r.composer)},null,8,aV)):_t("",!0),r.track.album?(O(),F("p",{key:1,class:"subtitle is-6",textContent:et(r.track.album)},null,8,lV)):_t("",!0),s.settingsStore.showFilepathNowPlaying?(O(),F("p",{key:2,class:"subtitle is-6 has-text-grey",textContent:et(r.track.path)},null,8,cV)):_t("",!0)]))]),E(c,{show:i.showDetailsModal,item:i.selectedItem,onClose:e[2]||(e[2]=u=>i.showDetailsModal=!1)},null,8,["show","item"])],64)}const pV=nt(JF,[["render",hV],["__scopeId","data-v-e277cccd"]]),mV={name:"PagePlaylistFolder",components:{ContentWithHeading:ie,ListPlaylists:um,PaneTitle:re},beforeRouteEnter(t,e,n){n(async s=>{await s.fetchData(t.params.id)})},beforeRouteUpdate(t,e,n){this.fetchData(t.params.id).then(()=>n())},setup(){return{configurationStore:Fo()}},data(){return{playlist:{},playlistList:new Tt}},computed:{heading(){return{subtitle:[{count:this.playlists.count,key:"data.playlists"}],title:this.$t("page.playlists.title",this.playlists.count,{name:this.playlist.name})}},playlists(){return this.playlistList.group({filters:[t=>t.folder||this.configurationStore.radio_playlists||t.stream_count===0||t.item_count>t.stream_count]})}},methods:{async fetchData(t){const[e,n]=await Promise.all([Ct.playlist(t),Ct.playlistFolder(t)]);this.playlist=e,this.playlistList=new Tt(n)}}};function gV(t,e,n,s,i,r){const o=w("pane-title"),a=w("list-playlists"),l=w("content-with-heading");return O(),yt(l,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),content:R(()=>[E(a,{items:r.playlists},null,8,["items"])]),_:1})}const yV=nt(mV,[["render",gV]]),bV={name:"PagePlaylistTracks",components:{ContentWithHeading:ie,ControlButton:cn,ListTracks:Jn,ModalDialogPlaylist:SS,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.playlist(t.params.id),Ct.playlistTracks(t.params.id)]).then(([s,i])=>{n(r=>{r.playlist=s,r.tracks=new Tt(i)})})},data(){return{playlist:{},showDetailsModal:!1,tracks:new Tt}},computed:{heading(){return{subtitle:[{count:this.tracks.count,key:"data.tracks"}],title:this.playlist.name}},uris(){return this.playlist.random?this.tracks.map(t=>t.uri).join():this.playlist.uri}},methods:{play(){ae.playUri(this.uris,!0)},openDetails(){this.showDetailsModal=!0}}};function vV(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-tracks"),c=w("content-with-heading"),u=w("modal-dialog-playlist");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"},disabled:i.tracks.count===0},null,8,["button","disabled"])]),content:R(()=>[E(l,{items:i.tracks,uris:r.uris},null,8,["items","uris"])]),_:1}),E(u,{item:i.playlist,show:i.showDetailsModal,uris:r.uris,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show","uris"])],64)}const _V=nt(bV,[["render",vV]]),rf=50,SV={name:"PagePlaylistTracksSpotify",components:{ContentWithHeading:ie,ControlButton:cn,ListTracksSpotify:im,ModalDialogPlaylistSpotify:ES,PaneTitle:re},beforeRouteEnter(t,e,n){const s=new Ys;s.setAccessToken(Je().spotify.webapi_token),Promise.all([s.getPlaylist(t.params.id),s.getPlaylistTracks(t.params.id,{limit:rf,market:Je().$state.spotify.webapi_country,offset:0})]).then(([i,r])=>{n(o=>{o.playlist=i,o.tracks=[],o.total=0,o.offset=0,o.appendTracks(r)})})},setup(){return{servicesStore:Je()}},data(){return{offset:0,playlist:{tracks:{}},showDetailsModal:!1,total:0,tracks:[]}},computed:{heading(){return this.playlist.name?{subtitle:[{count:this.playlist.tracks.total,key:"data.playlists"}],title:this.playlist.name}:{}}},methods:{appendTracks(t){let e=Math.max(-1,...this.tracks.map(n=>n.position).filter(n=>n));t.items.forEach(n=>{const{track:s}=n;s&&(s.is_playable&&(e+=1,s.position=e),this.tracks.push(s))}),this.total=t.total,this.offset+=t.limit},load({loaded:t}){const e=new Ys;e.setAccessToken(this.servicesStore.spotify.webapi_token),e.getPlaylistTracks(this.playlist.id,{limit:rf,market:this.servicesStore.spotify.webapi_country,offset:this.offset}).then(n=>{this.appendTracks(n),t(n.items.length,rf)})},play(){this.showDetailsModal=!1,ae.playUri(this.playlist.uri,!0)},openDetails(){this.showDetailsModal=!0}}};function EV(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-tracks-spotify"),c=w("content-with-heading"),u=w("modal-dialog-playlist-spotify");return O(),F(it,null,[E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:R(()=>[E(a,{button:{handler:r.openDetails,icon:"dots-horizontal"}},null,8,["button"]),E(a,{button:{handler:r.play,icon:"shuffle",key:"actions.shuffle"},disabled:i.playlist.tracks.total===0},null,8,["button","disabled"])]),content:R(()=>[E(l,{"context-uri":i.playlist.uri,items:i.tracks,load:r.load},null,8,["context-uri","items","load"])]),_:1}),E(u,{item:i.playlist,show:i.showDetailsModal,onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1)},null,8,["item","show"])],64)}const wV=nt(SV,[["render",EV]]),kV={name:"PagePodcast",components:{ContentWithHero:cd,ControlImage:Hr,ListTracks:Jn,ModalDialogAlbum:ud,PaneHero:dd},beforeRouteEnter(t,e,n){Promise.all([Ct.album(t.params.id),Ct.podcastEpisodes(t.params.id)]).then(([s,i])=>{n(r=>{r.album=s,r.tracks=new Tt(i)})})},data(){return{album:{},showDetailsModal:!1,tracks:new Tt}},computed:{heading(){return{count:this.$t("data.tracks",{count:this.album.track_count}),subtitle:"",title:this.album.name,actions:[{handler:this.play,icon:"play",key:"actions.play"},{handler:this.openDetails,icon:"dots-horizontal"}]}}},methods:{openDetails(){this.showDetailsModal=!0},play(){ae.playUri(this.album.uri,!1)},podcastDeleted(){this.$router.push({name:"podcasts"})},reloadTracks(){Ct.podcastEpisodes(this.album.id).then(t=>{this.tracks=new Tt(t)})}}};function TV(t,e,n,s,i,r){const o=w("pane-hero"),a=w("control-image"),l=w("list-tracks"),c=w("modal-dialog-album"),u=w("content-with-hero");return O(),yt(u,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),image:R(()=>[E(a,{url:i.album.artwork_url,caption:i.album.name,class:"is-medium",onClick:r.openDetails},null,8,["url","caption","onClick"])]),content:R(()=>[E(l,{items:i.tracks,"show-progress":!0,onPlayCountChanged:r.reloadTracks},null,8,["items","onPlayCountChanged"]),E(c,{item:i.album,show:i.showDetailsModal,"media-kind":"podcast",onClose:e[0]||(e[0]=d=>i.showDetailsModal=!1),onPlayCountChanged:r.reloadTracks,onPodcastDeleted:r.podcastDeleted},null,8,["item","show","onPlayCountChanged","onPodcastDeleted"])]),_:1})}const CV=nt(kV,[["render",TV]]),AV={name:"ControlUrlField",props:{help:{default:"",type:String},icon:{required:!0,type:String},loading:{default:!1,type:Boolean},placeholder:{required:!0,type:String}},emits:["input"],data(){return{value:""}},mounted(){setTimeout(()=>{this.$refs.input.focus()},10)},methods:{validate(t){const{validity:e}=t.target,n=e.patternMismatch||e.valueMissing;this.$emit("input",this.value,n)}}},OV={class:"field"},xV={class:"control has-icons-left"},IV=["placeholder","disabled"],NV=["textContent"];function PV(t,e,n,s,i,r){const o=w("mdicon");return O(),F("div",OV,[P("div",xV,[hs(P("input",{ref:"input","onUpdate:modelValue":e[0]||(e[0]=a=>i.value=a),class:"input",type:"url",pattern:"http[s]?://.+",required:"",placeholder:n.placeholder,disabled:n.loading,onInput:e[1]||(e[1]=(...a)=>r.validate&&r.validate(...a))},null,40,IV),[[Xs,i.value]]),E(o,{class:"icon is-left",name:n.icon,size:"16"},null,8,["name"])]),n.help?(O(),F("div",{key:0,class:"help",textContent:et(n.help)},null,8,NV)):_t("",!0)])}const kS=nt(AV,[["render",PV]]),DV={name:"ModalDialogAddRss",components:{ControlUrlField:kS,ModalDialog:sr},props:{show:Boolean},emits:["close","podcast-added"],data(){return{disabled:!0,loading:!1,url:""}},computed:{actions(){return this.loading?[{icon:"web",key:"dialog.add.rss.processing"}]:[{handler:this.cancel,icon:"cancel",key:"actions.cancel"},{disabled:this.disabled,handler:this.add,icon:"playlist-plus",key:"actions.add"}]}},methods:{add(){this.loading=!0,Ct.add(this.url).then(()=>{this.$emit("podcast-added"),this.$emit("close")}).finally(()=>{this.url="",this.loading=!1})},cancel(){this.$emit("close")},onUrlChange(t,e){this.url=t,this.disabled=e}}};function MV(t,e,n,s,i,r){const o=w("control-url-field"),a=w("modal-dialog");return O(),yt(a,{actions:r.actions,show:n.show,title:t.$t("dialog.add.rss.title"),onClose:e[1]||(e[1]=l=>t.$emit("close"))},{content:R(()=>[P("form",{onSubmit:e[0]||(e[0]=jn((...l)=>r.add&&r.add(...l),["prevent"]))},[E(o,{icon:"rss",help:t.$t("dialog.add.rss.help"),loading:i.loading,placeholder:t.$t("dialog.add.rss.placeholder"),onInput:r.onUrlChange},null,8,["help","loading","placeholder","onInput"])],32)]),_:1},8,["actions","show","title"])}const LV=nt(DV,[["render",MV]]),RV={name:"PagePodcasts",components:{ContentWithHeading:ie,ControlButton:cn,ListAlbums:ds,ListTracks:Jn,ModalDialogAddRss:LV,PaneTitle:re},beforeRouteEnter(t,e,n){Promise.all([Ct.albums("podcast"),Ct.newPodcastEpisodes(),Ct.rssCount()]).then(([s,i,r])=>{n(o=>{o.albums=new Tt(s),o.episodes=new Tt(i),o.rssCount=r})})},setup(){return{libraryStore:Lu(),uiStore:Zn()}},data(){return{albums:[],episodes:{items:[]},rssCount:{},showAddPodcastModal:!1}},computed:{hasRss(){return(this.rssCount.albums??0)>0},heading(){return this.albums.total?{subtitle:[{count:this.albums.count,key:"data.podcasts"}],title:this.$t("page.podcasts.title")}:{}}},methods:{markAllAsPlayed(){this.episodes.items.forEach(t=>{Ct.updateTrack(t.id,{play_count:"increment"})}),this.episodes.items={}},openAddPodcastDialog(){this.showAddPodcastModal=!0},reloadEpisodes(){Ct.newPodcastEpisodes().then(t=>{this.episodes=new Tt(t)})},reloadPodcasts(){Ct.albums("podcast").then(t=>{this.albums=new Tt(t),this.reloadEpisodes(),this.reloadRssCount()})},reloadRssCount(){Ct.rssCount().then(t=>{this.rssCount=t})},updateRss(){this.libraryStore.update_dialog_scan_kind="rss",this.uiStore.showUpdateDialog=!0}}};function $V(t,e,n,s,i,r){const o=w("pane-title"),a=w("control-button"),l=w("list-tracks"),c=w("content-with-heading"),u=w("list-albums"),d=w("modal-dialog-add-rss");return O(),F(it,null,[i.episodes.items.length>0?(O(),yt(c,{key:0},{heading:R(()=>[E(o,{content:{title:t.$t("page.podcasts.new-episodes")}},null,8,["content"])]),actions:R(()=>[E(a,{button:{handler:r.markAllAsPlayed,icon:"pencil",key:"actions.mark-all-played"}},null,8,["button"])]),content:R(()=>[E(l,{items:i.episodes,"show-progress":!0,onPlayCountChanged:r.reloadEpisodes},null,8,["items","onPlayCountChanged"])]),_:1})):_t("",!0),E(c,null,{heading:R(()=>[E(o,{content:r.heading},null,8,["content"])]),actions:R(()=>[r.hasRss?(O(),yt(a,{key:0,button:{handler:r.updateRss,icon:"refresh",key:"actions.update"}},null,8,["button"])):_t("",!0),E(a,{button:{handler:r.openAddPodcastDialog,icon:"rss",key:"actions.add"}},null,8,["button"])]),content:R(()=>[E(u,{items:i.albums,onPlayCountChanged:r.reloadEpisodes,onPodcastDeleted:r.reloadPodcasts},null,8,["items","onPlayCountChanged","onPodcastDeleted"])]),_:1}),E(d,{show:i.showAddPodcastModal,onClose:e[0]||(e[0]=f=>i.showAddPodcastModal=!1),onPodcastAdded:r.reloadPodcasts},null,8,["show","onPodcastAdded"])],64)}const FV=nt(RV,[["render",$V]]),VV={name:"ListItemQueueItem",props:{currentPosition:{required:!0,type:Number},editing:Boolean,hideReadItems:Boolean,item:{required:!0,type:Object},position:{required:!0,type:Number}},setup(){return{playerStore:Bn()}},computed:{isCurrent(){return this.item.id===this.playerStore.item_id},isNext(){return this.currentPosition<0||this.position>=this.currentPosition}},methods:{play(){sn.play({item_id:this.item.id})}}},HV={key:0,class:"media-left"},UV={class:"media-content"},jV=["textContent"],BV=["textContent"],WV=["textContent"],GV={class:"media-right"};function KV(t,e,n,s,i,r){const o=w("mdicon");return r.isNext||!n.hideReadItems?(O(),F("div",{key:0,class:"media is-align-items-center is-clickable mb-0",onClick:e[0]||(e[0]=(...a)=>r.play&&r.play(...a))},[n.editing?(O(),F("div",HV,[E(o,{class:"icon has-text-grey is-movable",name:"drag-horizontal",size:"18"})])):_t("",!0),P("div",UV,[P("div",{class:Gt(["is-size-6 has-text-weight-bold",{"has-text-primary":r.isCurrent,"has-text-grey-light":!r.isNext}]),textContent:et(n.item.title)},null,10,jV),P("div",{class:Gt(["is-size-7 has-text-weight-bold",{"has-text-primary":r.isCurrent,"has-text-grey-light":!r.isNext,"has-text-grey":r.isNext&&!r.isCurrent}]),textContent:et(n.item.artist)},null,10,BV),P("div",{class:Gt(["is-size-7",{"has-text-primary":r.isCurrent,"has-text-grey-light":!r.isNext,"has-text-grey":r.isNext&&!r.isCurrent}]),textContent:et(n.item.album)},null,10,WV)]),P("div",GV,[le(t.$slots,"actions",{},void 0,!0)])])):_t("",!0)}const zV=nt(VV,[["render",KV],["__scopeId","data-v-c07b7c2b"]]),qV={name:"ModalDialogAddStream",components:{ControlUrlField:kS,ModalDialog:sr},props:{show:Boolean},emits:["close"],data(){return{disabled:!0,loading:!1,url:""}},computed:{actions(){return this.loading?[{icon:"web",key:"dialog.add.stream.processing"}]:[{handler:this.cancel,icon:"cancel",key:"actions.cancel"},{disabled:this.disabled,handler:this.add,icon:"playlist-plus",key:"actions.add"},{disabled:this.disabled,handler:this.play,icon:"play",key:"actions.play"}]}},methods:{add(){this.loading=!0,ae.addUri(this.url).then(()=>{this.$emit("close")}).finally(()=>{this.url="",this.loading=!1})},cancel(){this.$emit("close")},onUrlChange(t,e){this.url=t,this.disabled=e},play(){this.loading=!0,ae.playUri(this.url,!1).then(()=>{this.$emit("close"),this.url=""}).catch(()=>{this.loading=!1})}}};function XV(t,e,n,s,i,r){const o=w("control-url-field"),a=w("modal-dialog");return O(),yt(a,{actions:r.actions,show:n.show,title:t.$t("dialog.add.stream.title"),onClose:e[1]||(e[1]=l=>t.$emit("close"))},{content:R(()=>[P("form",{onSubmit:e[0]||(e[0]=jn((...l)=>r.play&&r.play(...l),["prevent"]))},[E(o,{icon:"web",loading:i.loading,placeholder:t.$t("dialog.add.stream.placeholder"),onInput:r.onUrlChange},null,8,["loading","placeholder","onInput"])],32)]),_:1},8,["actions","show","title"])}const YV=nt(qV,[["render",XV]]),ZV={name:"ModalDialogPlaylistSave",components:{ModalDialog:sr},props:{show:Boolean},emits:["close"],data(){return{disabled:!0,loading:!1,playlistName:""}},computed:{actions(){return this.loading?[{icon:"web",key:"dialog.playlist.save.saving"}]:[{handler:this.cancel,icon:"cancel",key:"actions.cancel"},{disabled:this.disabled,handler:this.save,icon:"download",key:"actions.save"}]}},watch:{show(){this.show&&(this.loading=!1,setTimeout(()=>{this.$refs.playlist_name_field.focus()},10))}},methods:{cancel(){this.$emit("close")},check(t){const{validity:e}=t.target;this.disabled=e.patternMismatch||e.valueMissing},save(){this.loading=!0,ae.saveToPlaylist(this.playlistName).then(()=>{this.$emit("close"),this.playlistName=""}).catch(()=>{this.loading=!1})}}},JV={class:"field"},QV={class:"control has-icons-left"},t9=["placeholder","disabled"];function e9(t,e,n,s,i,r){const o=w("mdicon"),a=w("modal-dialog");return O(),yt(a,{actions:r.actions,show:n.show,title:t.$t("dialog.playlist.save.title"),onClose:e[3]||(e[3]=l=>t.$emit("close"))},{content:R(()=>[P("form",{onSubmit:e[2]||(e[2]=jn((...l)=>r.save&&r.save(...l),["prevent"]))},[P("div",JV,[P("div",QV,[hs(P("input",{ref:"playlist_name_field","onUpdate:modelValue":e[0]||(e[0]=l=>i.playlistName=l),class:"input",type:"text",pattern:".+",required:"",placeholder:t.$t("dialog.playlist.save.playlist-name"),disabled:i.loading,onInput:e[1]||(e[1]=(...l)=>r.check&&r.check(...l))},null,40,t9),[[Xs,i.playlistName]]),E(o,{class:"icon is-left",name:"playlist-music",size:"16"})])])],32)]),_:1},8,["actions","show","title"])}const n9=nt(ZV,[["render",e9]]);var hc={exports:{}};/**! * Sortable 1.14.0 * @author RubaXa diff --git a/web-src/src/components/ModalDialogQueueItem.vue b/web-src/src/components/ModalDialogQueueItem.vue index 9130b402..f20d024d 100644 --- a/web-src/src/components/ModalDialogQueueItem.vue +++ b/web-src/src/components/ModalDialogQueueItem.vue @@ -49,7 +49,7 @@ export default { value: this.item.album }, { - handler: this.openAlbumArtist, + handler: this.openArtist, key: 'property.album-artist', value: this.item.album_artist }, @@ -122,7 +122,7 @@ export default { }) } }, - openAlbumArtist() { + openArtist() { this.$emit('close') if (this.item.data_kind === 'spotify') { this.$router.push({