"use strict";(self["webpackChunkplatypush"]=self["webpackChunkplatypush"]||[]).push([[7898,342],{3222:function(t,e,s){s.d(e,{Z:function(){return r}});var l=s(6252),i=s(3577);const a={class:"no-items-container"};function n(t,e,s,n,d,o){return(0,l.wg)(),(0,l.iD)("div",a,[(0,l._)("div",{class:(0,i.C_)(["no-items fade-in",{shadow:s.withShadow}])},[(0,l.WI)(t.$slots,"default",{},void 0,!0)],2)])}var d={name:"NoItems",props:{withShadow:{type:Boolean,default:!0}}},o=s(3744);const u=(0,o.Z)(d,[["render",n],["__scopeId","data-v-4856c4d7"]]);var r=u},342:function(t,e,s){s.r(e),s.d(e,{default:function(){return p}});var l=s(6252);const i={class:"media-youtube-playlist"};function a(t,e,s,a,n,d){const o=(0,l.up)("Loading"),u=(0,l.up)("NoItems"),r=(0,l.up)("Results");return(0,l.wg)(),(0,l.iD)("div",i,[n.loading?((0,l.wg)(),(0,l.j4)(o,{key:0})):n.items?.length?((0,l.wg)(),(0,l.j4)(r,{key:2,results:n.items,sources:{youtube:!0},filter:s.filter,"selected-result":n.selectedResult,onSelect:e[0]||(e[0]=t=>n.selectedResult=t),onPlay:e[1]||(e[1]=e=>t.$emit("play",e))},null,8,["results","filter","selected-result"])):((0,l.wg)(),(0,l.j4)(u,{key:1,"with-shadow":!1},{default:(0,l.w5)((()=>[(0,l.Uk)(" No videos found. ")])),_:1}))])}var n=s(3222),d=s(6791),o=s(5390),u=s(8637),r={emits:["play"],mixins:[u.Z],components:{Loading:d.Z,NoItems:n.Z,Results:o.Z},props:{id:{type:String,required:!0},filter:{type:String,default:null}},data(){return{items:[],loading:!1,selectedResult:null}},methods:{async loadItems(){this.loading=!0;try{this.items=(await this.request("youtube.get_playlist",{id:this.id})).map((t=>({...t,type:"youtube"})))}finally{this.loading=!1}}},mounted(){this.loadItems()}},y=s(3744);const c=(0,y.Z)(r,[["render",a],["__scopeId","data-v-66236cc4"]]);var p=c},7898:function(t,e,s){s.r(e),s.d(e,{default:function(){return k}});var l=s(6252),i=s(3577);const a={class:"media-youtube-playlists"},n={key:0,class:"playlists-index"},d={key:2,class:"body grid"},o=["onClick"],u={class:"title"},r={key:1,class:"playlist-body"};function y(t,e,s,y,c,p){const m=(0,l.up)("Loading"),f=(0,l.up)("NoItems"),g=(0,l.up)("MediaImage"),h=(0,l.up)("Playlist");return(0,l.wg)(),(0,l.iD)("div",a,[s.selectedPlaylist?((0,l.wg)(),(0,l.iD)("div",r,[(0,l.Wm)(h,{id:s.selectedPlaylist,filter:s.filter,onPlay:e[0]||(e[0]=e=>t.$emit("play",e))},null,8,["id","filter"])])):((0,l.wg)(),(0,l.iD)("div",n,[c.loading?((0,l.wg)(),(0,l.j4)(m,{key:0})):c.playlists?.length?((0,l.wg)(),(0,l.iD)("div",d,[((0,l.wg)(!0),(0,l.iD)(l.HY,null,(0,l.Ko)(p.playlistsById,((e,s)=>((0,l.wg)(),(0,l.iD)("div",{class:"playlist item",key:s,onClick:s=>t.$emit("select",e)},[(0,l.Wm)(g,{item:e,"has-play":!1},null,8,["item"]),(0,l._)("div",u,(0,i.zw)(e.name),1)],8,o)))),128))])):((0,l.wg)(),(0,l.j4)(f,{key:1,"with-shadow":!1},{default:(0,l.w5)((()=>[(0,l.Uk)(" No playlists found. ")])),_:1}))]))])}var c=s(8408),p=s(3222),m=s(6791),f=s(342),g=s(8637),h={emits:["play","select"],mixins:[g.Z],components:{Loading:m.Z,MediaImage:c.Z,NoItems:p.Z,Playlist:f["default"]},props:{selectedPlaylist:{type:String,default:null},filter:{type:String,default:null}},data(){return{playlists:[],loading:!1}},computed:{playlistsById(){return this.playlists.filter((t=>!this.filter||t.name.toLowerCase().includes(this.filter.toLowerCase()))).reduce(((t,e)=>(t[e.id]=e,t)),{})}},methods:{async loadPlaylists(){this.loading=!0;try{this.playlists=await this.request("youtube.get_playlists")}finally{this.loading=!1}}},mounted(){this.loadPlaylists()}},w=s(3744);const v=(0,w.Z)(h,[["render",y],["__scopeId","data-v-4f7cc8e3"]]);var k=v}}]);
//# sourceMappingURL=7898.1aa354cc.js.map