import{f as e,t as a,q as r,k as l}from"./preload-helper-DadE4qT2.chunk.mjs";import{N as i}from"./NcEmptyContent-nvOtdNB6.chunk.mjs";import{N as n}from"./NcUserBubble-VLY4hn5K-CG-Rja6k.chunk.mjs";import{I as m,n as u}from"./icons-CFZwNZD8.chunk.mjs";import{C as c,a as b}from"./CollectionsList-CiLe-XYk.chunk.mjs";import{H as p}from"./HeaderNavigation-DJYxed00.chunk.mjs";import{F as h}from"./FetchCollectionsMixin-Cpz_5SEM.chunk.mjs";import{v as d}from"./index-CTabiXQG.chunk.mjs";import"./createElementId-DhjFt1I9-B2HCdIOx.chunk.mjs";import"./video-BSG4kMCj.chunk.mjs";import"./index-BCevi9E9.chunk.mjs";import"./NcAvatar-D5nljVEA-v3fM8YER.chunk.mjs";import"./NcActionButton-DykQxmXJ-CTbph1Ex.chunk.mjs";import"./collectionFetcher-umd8irlb.chunk.mjs";import"./AbortControllerMixin-Bb5X6Yae.chunk.mjs";const f={name:"SharedAlbums",components:{ImageMultipleOutline:m,NcEmptyContent:i,CollectionsList:b,CollectionCover:c,HeaderNavigation:p,NcUserBubble:n},filters:{coverUrl(t){return t===-1?"":l(`/apps/photos/api/v1/preview/${t}?x=512&y=512`)},albumOriginalName(t){return t.basename.replace(new RegExp(`\\(${t.attributes.collaborators[0].id}\\)$`),"")}},mixins:[h],computed:{sharedAlbums(){return this.$store.getters.sharedAlbums}},async beforeMount(){this.fetchSharedAlbums()},methods:{fetchSharedAlbums(){this.fetchCollections(`/photos/${r()?.uid}/sharedalbums`,d)},t:a,n:e}};var v=function(){var t=this,s=t._self._c;return s("CollectionsList",{staticClass:"albums-list",attrs:{collections:t.sharedAlbums,loading:t.loadingCollections,error:t.errorFetchingCollections},scopedSlots:t._u([{key:"default",fn:function({collection:o}){return s("CollectionCover",{key:o.basename,attrs:{"parent-route":"/sharedalbums","collection-name":o.basename,"alt-img":t.t("photos","Cover photo for shared album {albumName}",{albumName:o.basename}),"data-test":o.basename,"cover-url":t._f("coverUrl")(o.attributes["last-photo"])}},[s("span",{staticClass:"album__name"},[t._v(" "+t._s(t._f("albumOriginalName")(o))+" ")]),s("div",{staticClass:"album__details",attrs:{slot:"subtitle"},slot:"subtitle"},[t._v(" "+t._s(o.attributes.date)+" ⸱ "+t._s(t.n("photos","%n item","%n photos and videos",o.attributes.nbItems))+" "),s("br"),t._v(" "+t._s(t.t("photos","Shared by"))+" "),s("NcUserBubble",{attrs:{"display-name":o.attributes.collaborators[0].label,user:o.attributes.collaborators[0].id}})],1)])}}])},[s("HeaderNavigation",{key:"navigation",attrs:{slot:"header",loading:t.loadingCollections,title:t.t("photos","Collaborative albums"),"root-title":t.t("photos","Collaborative albums")},on:{refresh:t.fetchSharedAlbums},slot:"header"}),s("NcEmptyContent",{attrs:{slot:"empty-collections-list",name:t.t("photos","There is no album yet!")},slot:"empty-collections-list"},[s("ImageMultipleOutline",{attrs:{slot:"icon"},slot:"icon"})],1)],1)},C=[],_=u(f,v,C,!1,null,"48906c46");const B=_.exports;export{B as default};
//# sourceMappingURL=SharedAlbums-Bj8zjprL.chunk.mjs.map
