diff --git a/css/TagsView-DR177-FV.chunk.css b/css/TagsView-DR177-FV.chunk.css new file mode 100644 index 0000000000..2616df0e83 --- /dev/null +++ b/css/TagsView-DR177-FV.chunk.css @@ -0,0 +1 @@ +.tag-cover[data-v-dc0a6411]{display:flex;flex-direction:column;padding:16px;border-radius:12px}.tag-cover[data-v-dc0a6411]:hover,.tag-cover[data-v-dc0a6411]:focus{background:var(--color-background-dark)}.tag-cover__image[data-v-dc0a6411]{width:350px;height:350px;object-fit:cover;border-radius:12px}@media only screen and (max-width:1200px){.tag-cover__image[data-v-dc0a6411]{width:250px;height:250px}}.tag-cover__image--placeholder[data-v-dc0a6411]{background:var(--color-primary-element-light)}.tag-cover__image--placeholder[data-v-dc0a6411] .material-design-icon{width:100%;height:100%}.tag-cover__image--placeholder[data-v-dc0a6411] .material-design-icon .material-design-icon__svg{fill:var(--color-primary-element)}.tag-cover__details[data-v-dc0a6411]{display:flex;flex-direction:column;margin-top:16px;width:350px}@media only screen and (max-width:1200px){.tag-cover__details[data-v-dc0a6411]{width:250px}}.tag-cover__details__first-line[data-v-dc0a6411]{display:flex}.tag-cover__details__second-line[data-v-dc0a6411]{display:flex;color:var(--color-text-lighter)}.tag-cover__details__name[data-v-dc0a6411]{flex-grow:1;margin:0;font-weight:400;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.loader[data-v-de3acc2d]{margin-top:30vh}.container[data-v-de3acc2d]{padding-inline-start:44px}.container>h2[data-v-de3acc2d]{margin-inline-start:14px;margin-top:40px}.popular-tags[data-v-de3acc2d],.tags[data-v-de3acc2d]{display:flex;flex-direction:row;gap:8px;flex-wrap:wrap} diff --git a/css/TagsView-DhQ9SnI2.chunk.css b/css/TagsView-DhQ9SnI2.chunk.css deleted file mode 100644 index 5ba54990d9..0000000000 --- a/css/TagsView-DhQ9SnI2.chunk.css +++ /dev/null @@ -1 +0,0 @@ -.tag-cover[data-v-01249121]{display:flex;flex-direction:column;padding:16px;border-radius:12px}.tag-cover[data-v-01249121]:hover,.tag-cover[data-v-01249121]:focus{background:var(--color-background-dark)}.tag-cover__image[data-v-01249121]{width:350px;height:350px;object-fit:cover;border-radius:12px}@media only screen and (max-width:1200px){.tag-cover__image[data-v-01249121]{width:250px;height:250px}}.tag-cover__image--placeholder[data-v-01249121]{background:var(--color-primary-element-light)}.tag-cover__image--placeholder[data-v-01249121] .material-design-icon{width:100%;height:100%}.tag-cover__image--placeholder[data-v-01249121] .material-design-icon .material-design-icon__svg{fill:var(--color-primary-element)}.tag-cover__details[data-v-01249121]{display:flex;flex-direction:column;margin-top:16px;width:350px}@media only screen and (max-width:1200px){.tag-cover__details[data-v-01249121]{width:250px}}.tag-cover__details__first-line[data-v-01249121]{display:flex}.tag-cover__details__second-line[data-v-01249121]{display:flex;color:var(--color-text-lighter)}.tag-cover__details__name[data-v-01249121]{flex-grow:1;margin:0;font-weight:400;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.loader[data-v-cb8dfce8]{margin-top:30vh}.container[data-v-cb8dfce8]{padding-inline-start:44px}.container>h2[data-v-cb8dfce8]{margin-inline-start:14px;margin-top:40px}.popular-tags[data-v-cb8dfce8],.tags[data-v-cb8dfce8]{display:flex;flex-direction:row;gap:8px;flex-wrap:wrap} diff --git a/js/ActionFavorite-39MOXqmM.chunk.mjs b/js/ActionFavorite-Bvi1_8Tn.chunk.mjs similarity index 91% rename from js/ActionFavorite-39MOXqmM.chunk.mjs rename to js/ActionFavorite-Bvi1_8Tn.chunk.mjs index 4057cfc478..e10b1d64b1 100644 --- a/js/ActionFavorite-39MOXqmM.chunk.mjs +++ b/js/ActionFavorite-Bvi1_8Tn.chunk.mjs @@ -1,2 +1,2 @@ -import{c as o,t as s}from"./dav-CWjVE7gP.chunk.mjs";import{N as i}from"./NcAvatar-C1ty7wsG-CLn0OfFi.chunk.mjs";import{S as r,a,n as l}from"./icons-BogBEt5I.chunk.mjs";const c=o({name:"ActionFavorite",components:{Star:a,StarOutline:r,NcActionButton:i},props:{selectedFileIds:{type:Array,required:!0}},computed:{files(){return this.$store.state.files.files},shouldFavoriteSelection(){return this.selectedFileIds.some(t=>this.files[t].attributes.favorite===0)}},methods:{async favoriteSelection(){await this.$store.dispatch("toggleFavoriteForFiles",{fileIds:this.selectedFileIds,favoriteState:1})},async unFavoriteSelection(){await this.$store.dispatch("toggleFavoriteForFiles",{fileIds:this.selectedFileIds,favoriteState:0})},t:s}});var n=function(){var t=this,e=t._self._c;return t._self._setupProxy,t.shouldFavoriteSelection?e("NcActionButton",{attrs:{"close-after-click":!0,"aria-label":t.t("photos","Mark selection as favorite")},on:{click:t.favoriteSelection}},[t._v(" "+t._s(t.t("photos","Add selection to favorites"))+" "),e("StarOutline",{attrs:{slot:"icon"},slot:"icon"})],1):e("NcActionButton",{attrs:{"close-after-click":!0,"aria-label":t.t("photos","Remove selection from favorites")},on:{click:t.unFavoriteSelection}},[t._v(" "+t._s(t.t("photos","Remove selection from favorites"))+" "),e("Star",{attrs:{slot:"icon"},slot:"icon"})],1)},f=[],v=l(c,n,f,!1,null,null);const h=v.exports;export{h as A}; -//# sourceMappingURL=ActionFavorite-39MOXqmM.chunk.mjs.map +import{c as o,t as s}from"./dav-CWjVE7gP.chunk.mjs";import{N as i}from"./NcAvatar-C1ty7wsG-CgwbZZZ_.chunk.mjs";import{S as r,a,n as l}from"./icons-BogBEt5I.chunk.mjs";const c=o({name:"ActionFavorite",components:{Star:a,StarOutline:r,NcActionButton:i},props:{selectedFileIds:{type:Array,required:!0}},computed:{files(){return this.$store.state.files.files},shouldFavoriteSelection(){return this.selectedFileIds.some(t=>this.files[t].attributes.favorite===0)}},methods:{async favoriteSelection(){await this.$store.dispatch("toggleFavoriteForFiles",{fileIds:this.selectedFileIds,favoriteState:1})},async unFavoriteSelection(){await this.$store.dispatch("toggleFavoriteForFiles",{fileIds:this.selectedFileIds,favoriteState:0})},t:s}});var n=function(){var t=this,e=t._self._c;return t._self._setupProxy,t.shouldFavoriteSelection?e("NcActionButton",{attrs:{"close-after-click":!0,"aria-label":t.t("photos","Mark selection as favorite")},on:{click:t.favoriteSelection}},[t._v(" "+t._s(t.t("photos","Add selection to favorites"))+" "),e("StarOutline",{attrs:{slot:"icon"},slot:"icon"})],1):e("NcActionButton",{attrs:{"close-after-click":!0,"aria-label":t.t("photos","Remove selection from favorites")},on:{click:t.unFavoriteSelection}},[t._v(" "+t._s(t.t("photos","Remove selection from favorites"))+" "),e("Star",{attrs:{slot:"icon"},slot:"icon"})],1)},f=[],v=l(c,n,f,!1,null,null);const h=v.exports;export{h as A}; +//# sourceMappingURL=ActionFavorite-Bvi1_8Tn.chunk.mjs.map diff --git a/js/ActionFavorite-39MOXqmM.chunk.mjs.license b/js/ActionFavorite-Bvi1_8Tn.chunk.mjs.license similarity index 100% rename from js/ActionFavorite-39MOXqmM.chunk.mjs.license rename to js/ActionFavorite-Bvi1_8Tn.chunk.mjs.license diff --git a/js/ActionFavorite-39MOXqmM.chunk.mjs.map b/js/ActionFavorite-Bvi1_8Tn.chunk.mjs.map similarity index 97% rename from js/ActionFavorite-39MOXqmM.chunk.mjs.map rename to js/ActionFavorite-Bvi1_8Tn.chunk.mjs.map index 163383e758..9c19e4e38b 100644 --- a/js/ActionFavorite-39MOXqmM.chunk.mjs.map +++ b/js/ActionFavorite-Bvi1_8Tn.chunk.mjs.map @@ -1 +1 @@ -{"version":3,"file":"ActionFavorite-39MOXqmM.chunk.mjs","sources":["../src/components/Actions/ActionFavorite.vue"],"sourcesContent":["\n\n\n\n"],"names":["_sfc_main","defineComponent","Star","StarOutline","NcActionButton","fileId","t"],"mappings":"uKAkCA,MAAAA,EAAAC,EAAA,CACA,KAAA,iBACA,WAAA,CACA,KAAAC,EACA,YAAAC,EACA,eAAAC,CAAA,EAGA,MAAA,CACA,gBAAA,CACA,KAAA,MACA,SAAA,EAAA,CACA,EAGA,SAAA,CACA,OAAA,CACA,OAAA,KAAA,OAAA,MAAA,MAAA,KACA,EAEA,yBAAA,CAEA,OAAA,KAAA,gBAAA,KAAAC,GAAA,KAAA,MAAAA,CAAA,EAAA,WAAA,WAAA,CAAA,CACA,CAAA,EAGA,QAAA,CACA,MAAA,mBAAA,CACA,MAAA,KAAA,OAAA,SAAA,yBAAA,CAAA,QAAA,KAAA,gBAAA,cAAA,EAAA,CACA,EAEA,MAAA,qBAAA,CACA,MAAA,KAAA,OAAA,SAAA,yBAAA,CAAA,QAAA,KAAA,gBAAA,cAAA,EAAA,CACA,EAAA,EAEAC,CAAA,CAEA,CAAA"} \ No newline at end of file +{"version":3,"file":"ActionFavorite-Bvi1_8Tn.chunk.mjs","sources":["../src/components/Actions/ActionFavorite.vue"],"sourcesContent":["\n\n\n\n"],"names":["_sfc_main","defineComponent","Star","StarOutline","NcActionButton","fileId","t"],"mappings":"uKAkCA,MAAAA,EAAAC,EAAA,CACA,KAAA,iBACA,WAAA,CACA,KAAAC,EACA,YAAAC,EACA,eAAAC,CAAA,EAGA,MAAA,CACA,gBAAA,CACA,KAAA,MACA,SAAA,EAAA,CACA,EAGA,SAAA,CACA,OAAA,CACA,OAAA,KAAA,OAAA,MAAA,MAAA,KACA,EAEA,yBAAA,CAEA,OAAA,KAAA,gBAAA,KAAAC,GAAA,KAAA,MAAAA,CAAA,EAAA,WAAA,WAAA,CAAA,CACA,CAAA,EAGA,QAAA,CACA,MAAA,mBAAA,CACA,MAAA,KAAA,OAAA,SAAA,yBAAA,CAAA,QAAA,KAAA,gBAAA,cAAA,EAAA,CACA,EAEA,MAAA,qBAAA,CACA,MAAA,KAAA,OAAA,SAAA,yBAAA,CAAA,QAAA,KAAA,gBAAA,cAAA,EAAA,CACA,EAAA,EAEAC,CAAA,CAEA,CAAA"} \ No newline at end of file diff --git a/js/ActionFavorite-39MOXqmM.chunk.mjs.map.license b/js/ActionFavorite-Bvi1_8Tn.chunk.mjs.map.license similarity index 100% rename from js/ActionFavorite-39MOXqmM.chunk.mjs.map.license rename to js/ActionFavorite-Bvi1_8Tn.chunk.mjs.map.license diff --git a/js/AlbumContent-Dt79ow4u.chunk.mjs b/js/AlbumContent-CTTPbVIX.chunk.mjs similarity index 87% rename from js/AlbumContent-Dt79ow4u.chunk.mjs rename to js/AlbumContent-CTTPbVIX.chunk.mjs index 697ba32022..805ae368b6 100644 --- a/js/AlbumContent-Dt79ow4u.chunk.mjs +++ b/js/AlbumContent-CTTPbVIX.chunk.mjs @@ -1,2 +1,2 @@ -import{c as v,m as n,i as _,x as c,y as C,q as A,A as F,t as g,a as N}from"./dav-CWjVE7gP.chunk.mjs";import{N as y,l as w,f as P,e as S,h as k}from"./index-DJvZzPIC.chunk.mjs";import{c as I,N as M}from"./NcAvatar-C1ty7wsG-CLn0OfFi.chunk.mjs";import{a as E,N as $}from"./FileComponent-D1wkaJ0l.chunk.mjs";import{c as B,N as O}from"./PhotosFiltersInput-CWFg84lX.chunk.mjs";import{N as x}from"./NcEmptyContent-D6ytF470.chunk.mjs";import{N as L}from"./NcLoadingIcon-BhCR1fI8.chunk.mjs";import{n as d,o as R,P as V,i as D,M as H,b as U,D as T,C as z}from"./icons-BogBEt5I.chunk.mjs";import{A as X}from"./ActionFavorite-39MOXqmM.chunk.mjs";import{F as W,C as Y,A as j}from"./AlbumForm-okviGw24.chunk.mjs";import{C as q}from"./CollectionContent-D-6tiSX4.chunk.mjs";import{H as Z}from"./HeaderNavigation-OH_3c78m.chunk.mjs";import{P as G}from"./PhotosPicker-DtH8fc-b.chunk.mjs";import{F as J}from"./FetchFilesMixin-Cc2Xc76v.chunk.mjs";import"./index-D2ndhlCS.chunk.mjs";import"./NcCheckboxRadioSwitch-BAjRm8PQ-CYG_w710.chunk.mjs";import"./NcVNodes-D-8U_r3G.chunk.mjs";import"./NcUserBubble-Bd-PEfyK-CFFEmYTl.chunk.mjs";import"./FetchCollectionsMixin-BMeHDJG2.chunk.mjs";import"./collectionFetcher-BK_Uf5YT.chunk.mjs";import"./AbortControllerMixin-ZTUlUgrD.chunk.mjs";import"./floating-ui.utils.dom-Ddqhmmdk.chunk.mjs";import"./he-C5adG_V0.chunk.mjs";import"./ShareType-BimJVf67.chunk.mjs";import"./FilesSelectionMixin-CXk9N89d.chunk.mjs";import"./fileFetcher-CKIP4MA5.chunk.mjs";import"./index-SPoS3_zU-CXwv8HS8.chunk.mjs";import"./NcProgressBar-D7zYeXBH-YjII6Vtq.chunk.mjs";import"./useHotKey-BJyJyREz.chunk.mjs";import"./FilesByMonthMixin-dnHoDKYf.chunk.mjs";import"./PhotoSearch-D3ja69fL.chunk.mjs";const K=v({__name:"AlbumHero",props:{coverFileId:{default:-1},blurhash:{default:void 0},title:null,subtitle:{default:""}},setup(t){const o=t,e=60,a=.35,l=1024,b=n(()=>o.coverFileId>0),u=n(()=>_(`/apps/photos/api/v1/preview/${o.coverFileId}?x=${l}&y=${l}`)),m=c(!1),h=c(!1);C(u,()=>{m.value=!1,h.value=!1});const r=c(0),p=n(()=>({height:`calc(100% + ${e}px)`,transform:`translateY(${r.value}px)`})),s=document.getElementById("app-content-vue")??window;A(()=>{s.addEventListener("scroll",i,{passive:!0}),i()}),F(()=>s.removeEventListener("scroll",i));function i(){const f=s instanceof Window?s.scrollY:s.scrollTop;r.value=Math.min(e,f*a)}return{__sfc:!0,props:o,MAX_PARALLAX_OFFSET:e,PARALLAX_RATIO:a,COVER_PREVIEW_SIZE:l,hasCover:b,coverUrl:u,coverLoaded:m,coverFailed:h,parallaxOffset:r,coverStyle:p,scroller:s,onScroll:i,NcBlurHash:E}}});var Q=function(){var t=this,o=t._self._c,e=t._self._setupProxy;return e.hasCover?o("header",{staticClass:"album-hero",attrs:{"aria-hidden":"true"}},[o("div",{staticClass:"album-hero__cover",style:e.coverStyle},[t.blurhash!==void 0?o(e.NcBlurHash,{staticClass:"album-hero__layer",attrs:{hash:t.blurhash}}):t._e(),e.coverFailed?t._e():o("img",{key:e.coverUrl,staticClass:"album-hero__layer album-hero__photo",class:{"album-hero__photo--visible":e.coverLoaded},attrs:{src:e.coverUrl,alt:"",decoding:"async",fetchpriority:"high"},on:{load:function(a){e.coverLoaded=!0},error:function(a){e.coverFailed=!0}}})],1),o("div",{staticClass:"album-hero__scrim"}),o("div",{staticClass:"album-hero__content"},[o("div",{staticClass:"album-hero__title"},[t._v(" "+t._s(t.title)+" ")]),t.subtitle!==""?o("div",{staticClass:"album-hero__subtitle"},[t._v(" "+t._s(t.subtitle)+" ")]):t._e()])]):t._e()},tt=[],ot=d(K,Q,tt,!1,null,"868386d8");const et=ot.exports;function at(t,o){const e=t.find(a=>a.fileid===o);return e?.attributes.hasPreview?e:t.filter(a=>a.attributes.hasPreview).reduce((a,l)=>a===void 0||l.attributes.timestamp>a.attributes.timestamp?l:a,void 0)??e}const lt={name:"AlbumContent",components:{ActionFavorite:X,AlbumForm:j,AlbumHero:et,Close:z,CollaboratorsSelectionForm:Y,CollectionContent:q,DeleteOutline:T,PhotosPicker:G,HeaderNavigation:Z,ImagePlusOutline:U,MapMarkerOutline:H,NcActionButton:M,NcActions:I,NcActionSeparator:$,NcButton:y,NcDialog:O,NcEmptyContent:x,NcLoadingIcon:L,NcModal:B,PencilOutline:D,Plus:V,ShareVariantOutline:R},mixins:[W,J],props:{albumName:{type:String,default:"/"}},setup(){return{isMobile:k()}},data(){return{showAddPhotosModal:!1,showManageCollaboratorView:!1,showEditAlbumForm:!1,loadingAddCollaborators:!1}},computed:{album(){return this.$store.getters.getAlbum(this.albumName)},albumFileIds(){return this.$store.getters.getAlbumFiles(this.albumName)},sharingEnabled(){return OC.Share!==void 0},albumFileName(){return this.$store.getters.getAlbumName(this.albumName)},albumPhotos(){return this.albumFileIds.map(t=>this.$store.state.files.files[t]).filter(t=>t!==void 0)},coverPhoto(){return at(this.albumPhotos,this.album?.attributes["last-photo"]??-1)},coverFileId(){return this.coverPhoto?.fileid??this.album?.attributes["last-photo"]??-1},coverBlurhash(){return this.coverPhoto?.attributes["metadata-blurhash"]},albumSubtitle(){return this.album===void 0?"":[this.album.attributes.location,N("photos","%n photo","%n photos",this.album.attributes.nbItems)].filter(t=>t!=="").join(" · ")},removableSelectedFiles(){return(this.$refs.collectionContent?.selectedFileIds).map(t=>this.$store.state.files.files[t]).filter(t=>t.attributes["photos-album-file-origin"]!=="filters").map(t=>t.fileid.toString())}},async mounted(){this.fetchAlbum(),this.fetchAlbumContent()},methods:{async fetchAlbum(){await this.fetchCollection(this.albumFileName,S)},async fetchAlbumContent(){await this.fetchCollectionFiles(this.albumFileName,P)},async handleAlbumUpdate({album:t,changes:o}){this.showEditAlbumForm=!1,o.includes("name")&&await this.$router.push(`/albums/${t.basename}`),o.includes("filters")&&this.fetchAlbumContent()},async handleFilesPicked(t){this.showAddPhotosModal=!1,await this.$store.dispatch("addFilesToCollection",{collectionFileName:this.album?.root+this.album?.path,fileIdsToAdd:t}),await this.fetchAlbumContent()},async handleRemoveFilesFromAlbum(t){this.$refs.collectionContent?.onUncheckFiles(t),await this.$store.dispatch("removeFilesFromCollection",{collectionFileName:this.album?.root+this.album?.path,fileIdsToRemove:t})},async handleDeleteAlbum(){await this.$store.dispatch("deleteCollection",{collectionFileName:this.album?.root+this.album?.path})&&this.$router.push("/albums")},async handleSetCollaborators(t){try{this.loadingAddCollaborators=!0,this.showManageCollaboratorView=!1,await this.$store.dispatch("updateCollection",{collectionFileName:this.album?.root+this.album?.path,properties:{collaborators:t}})}catch(o){w.error("Error while setting album collaborators",{error:o})}finally{this.loadingAddCollaborators=!1}},async handleFiltersChange(t){await this.$store.dispatch("updateCollection",{collectionFileName:this.album?.root+this.album?.path,properties:{filters:t}}),this.fetchAlbumContent()},t:g}};var st=function(){var t=this,o=t._self._c;return o("div",{staticClass:"album-container"},[t.album!==void 0?o("AlbumHero",{attrs:{"cover-file-id":t.coverFileId,blurhash:t.coverBlurhash,title:t.albumName,subtitle:t.albumSubtitle}}):t._e(),o("CollectionContent",{ref:"collectionContent",attrs:{collection:t.album,"collection-file-ids":t.albumFileIds,loading:t.loadingCollection||t.loadingCollectionFiles,error:t.errorFetchingCollection||t.errorFetchingCollectionFiles},scopedSlots:t._u([{key:"header",fn:function({selectedFileIds:e,resetSelection:a}){return o("HeaderNavigation",{key:"navigation",attrs:{loading:t.loadingCollectionFiles,params:{albumName:t.albumName},path:"/"+t.albumName,title:t.albumName},on:{refresh:t.fetchAlbumContent}},[t.album!==void 0&&t.album.attributes.location!==""?o("div",{staticClass:"album__location",attrs:{slot:"subtitle"},slot:"subtitle"},[o("MapMarkerOutline"),t._v(t._s(t.album.attributes.location)+" ")],1):t._e(),o("template",{slot:"default"},[e.length>0?o("NcButton",{attrs:{"aria-label":t.t("photos","Unselect all")},on:{click:a},scopedSlots:t._u([{key:"icon",fn:function(){return[o("Close")]},proxy:!0}],null,!0)},[t._v(" "+t._s(t.t("photos","Unselect all"))+" ")]):t._e()],1),t.album!==void 0?o("template",{slot:"right"},[o("NcButton",{on:{click:function(l){t.showAddPhotosModal=!0}},scopedSlots:t._u([{key:"icon",fn:function(){return[o("Plus",{attrs:{size:20}})]},proxy:!0}],null,!0)},[t._v(" "+t._s(t.t("photos","Add photos to this album"))+" ")]),t.sharingEnabled?o("NcButton",{attrs:{variant:"tertiary","aria-label":t.t("photos","Manage collaborators for this album")},on:{click:function(l){t.showManageCollaboratorView=!0}}},[o("ShareVariantOutline",{attrs:{slot:"icon"},slot:"icon"})],1):t._e(),o("NcActions",{attrs:{"aria-label":t.t("photos","Open actions menu")}},[o("NcActionButton",{attrs:{"close-after-click":!0,"aria-label":t.t("photos","Edit album details")},on:{click:function(l){t.showEditAlbumForm=!0}}},[t._v(" "+t._s(t.t("photos","Edit album details"))+" "),o("PencilOutline",{attrs:{slot:"icon"},slot:"icon"})],1),o("NcActionButton",{attrs:{"close-after-click":!0},on:{click:t.handleDeleteAlbum}},[t._v(" "+t._s(t.t("photos","Delete album"))+" "),o("DeleteOutline",{attrs:{slot:"icon"},slot:"icon"})],1),e.length>0?[o("NcActionSeparator"),o("ActionFavorite",{attrs:{"selected-file-ids":e}}),t.removableSelectedFiles.length!==0?o("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(l){return t.handleRemoveFilesFromAlbum(t.removableSelectedFiles)}}},[t._v(" "+t._s(t.t("photos","Remove selection from album"))+" "),o("Close",{attrs:{slot:"icon"},slot:"icon"})],1):t._e()]:t._e()],2)],1):t._e()],2)}}])},[t.album!==void 0&&t.album.attributes.nbItems===0&&!(t.loadingCollectionFiles||t.loadingCollection)?o("NcEmptyContent",{staticClass:"album__empty",attrs:{slot:"empty-content",name:t.t("photos","This album does not have any photos or videos yet!")},slot:"empty-content"},[o("ImagePlusOutline",{attrs:{slot:"icon"},slot:"icon"}),o("NcButton",{staticClass:"album__empty__button",attrs:{slot:"action",variant:"primary","aria-label":t.t("photos","Add photos to this album")},on:{click:function(e){t.showAddPhotosModal=!0}},slot:"action"},[o("Plus",{attrs:{slot:"icon"},slot:"icon"}),t._v(" "+t._s(t.t("photos","Add"))+" ")],1)],1):t._e()],1),t.album!==void 0?o("PhotosPicker",{attrs:{open:t.showAddPhotosModal,"blacklist-ids":t.albumFileIds,destination:t.album.basename,name:t.t("photos","Add photos to {albumName}",{albumName:t.albumName},void 0,{escape:!1,sanitize:!1})},on:{"update:open":function(e){t.showAddPhotosModal=e},"files-picked":t.handleFilesPicked}}):t._e(),t.showManageCollaboratorView&&t.album!==void 0?o("NcModal",{attrs:{name:t.t("photos","Manage collaborators")},on:{close:function(e){t.showManageCollaboratorView=!1}}},[o("CollaboratorsSelectionForm",{attrs:{"album-name":t.album.basename,collaborators:t.album.attributes.collaborators},scopedSlots:t._u([{key:"default",fn:function({collaborators:e}){return[o("NcButton",{attrs:{"aria-label":t.t("photos","Save collaborators for this album."),variant:"primary",disabled:t.loadingAddCollaborators},on:{click:function(a){return t.handleSetCollaborators(e)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loadingAddCollaborators?o("NcLoadingIcon"):t._e()]},proxy:!0}],null,!0)},[t._v(" "+t._s(t.t("photos","Save"))+" ")])]}}],null,!1,2061546483)})],1):t._e(),t.showEditAlbumForm?o("NcDialog",{attrs:{name:t.t("photos","Edit album details"),"close-on-click-outside":"",size:"normal"},on:{closing:function(e){t.showEditAlbumForm=!1}}},[o("AlbumForm",{attrs:{album:t.album},on:{done:e=>t.handleAlbumUpdate(e)}})],1):t._e()],1)},it=[],rt=d(lt,st,it,!1,null,"dd86895f");const Dt=rt.exports;export{Dt as default}; -//# sourceMappingURL=AlbumContent-Dt79ow4u.chunk.mjs.map +import{c as v,m as n,i as _,x as c,y as C,q as A,A as F,t as g,a as N}from"./dav-CWjVE7gP.chunk.mjs";import{N as y,l as w,f as P,e as S,h as k}from"./index-fcYXXWIu.chunk.mjs";import{c as I,N as M}from"./NcAvatar-C1ty7wsG-CgwbZZZ_.chunk.mjs";import{a as E,N as $}from"./FileComponent-CsC0H_Ob.chunk.mjs";import{c as B,N as O}from"./PhotosFiltersInput-BRVzHHOC.chunk.mjs";import{N as x}from"./NcEmptyContent-DN__penr.chunk.mjs";import{N as L}from"./NcLoadingIcon-XgSwY1D8.chunk.mjs";import{n as d,o as R,P as V,i as D,M as H,b as U,D as T,C as z}from"./icons-BogBEt5I.chunk.mjs";import{A as X}from"./ActionFavorite-Bvi1_8Tn.chunk.mjs";import{F as W,C as Y,A as j}from"./AlbumForm-CJumwUvV.chunk.mjs";import{C as q}from"./CollectionContent-BeBWwq1Q.chunk.mjs";import{H as Z}from"./HeaderNavigation-m11otdse.chunk.mjs";import{P as G}from"./PhotosPicker-BQOMJWPh.chunk.mjs";import{F as J}from"./FetchFilesMixin-DFVV5j9I.chunk.mjs";import"./index-D2ndhlCS.chunk.mjs";import"./NcCheckboxRadioSwitch-BAjRm8PQ-Dbaez3Sv.chunk.mjs";import"./NcVNodes-BQ7rksi-.chunk.mjs";import"./NcUserBubble-Bd-PEfyK-DTfVdb4a.chunk.mjs";import"./FetchCollectionsMixin-B-WFNvAy.chunk.mjs";import"./collectionFetcher-CxH90nfe.chunk.mjs";import"./AbortControllerMixin-ZTUlUgrD.chunk.mjs";import"./floating-ui.utils.dom-Ddqhmmdk.chunk.mjs";import"./he-C5adG_V0.chunk.mjs";import"./ShareType-BaT3OrWf.chunk.mjs";import"./FilesSelectionMixin-CJnD5SJf.chunk.mjs";import"./fileFetcher-BX4I5mFA.chunk.mjs";import"./index-SPoS3_zU-B_Yux-Op.chunk.mjs";import"./NcProgressBar-D7zYeXBH-DakD0XO8.chunk.mjs";import"./useHotKey-CgNXixZk.chunk.mjs";import"./FilesByMonthMixin-dnHoDKYf.chunk.mjs";import"./PhotoSearch-4PbVo0nu.chunk.mjs";const K=v({__name:"AlbumHero",props:{coverFileId:{default:-1},blurhash:{default:void 0},title:null,subtitle:{default:""}},setup(t){const o=t,e=60,a=.35,l=1024,b=n(()=>o.coverFileId>0),u=n(()=>_(`/apps/photos/api/v1/preview/${o.coverFileId}?x=${l}&y=${l}`)),m=c(!1),h=c(!1);C(u,()=>{m.value=!1,h.value=!1});const r=c(0),p=n(()=>({height:`calc(100% + ${e}px)`,transform:`translateY(${r.value}px)`})),s=document.getElementById("app-content-vue")??window;A(()=>{s.addEventListener("scroll",i,{passive:!0}),i()}),F(()=>s.removeEventListener("scroll",i));function i(){const f=s instanceof Window?s.scrollY:s.scrollTop;r.value=Math.min(e,f*a)}return{__sfc:!0,props:o,MAX_PARALLAX_OFFSET:e,PARALLAX_RATIO:a,COVER_PREVIEW_SIZE:l,hasCover:b,coverUrl:u,coverLoaded:m,coverFailed:h,parallaxOffset:r,coverStyle:p,scroller:s,onScroll:i,NcBlurHash:E}}});var Q=function(){var t=this,o=t._self._c,e=t._self._setupProxy;return e.hasCover?o("header",{staticClass:"album-hero",attrs:{"aria-hidden":"true"}},[o("div",{staticClass:"album-hero__cover",style:e.coverStyle},[t.blurhash!==void 0?o(e.NcBlurHash,{staticClass:"album-hero__layer",attrs:{hash:t.blurhash}}):t._e(),e.coverFailed?t._e():o("img",{key:e.coverUrl,staticClass:"album-hero__layer album-hero__photo",class:{"album-hero__photo--visible":e.coverLoaded},attrs:{src:e.coverUrl,alt:"",decoding:"async",fetchpriority:"high"},on:{load:function(a){e.coverLoaded=!0},error:function(a){e.coverFailed=!0}}})],1),o("div",{staticClass:"album-hero__scrim"}),o("div",{staticClass:"album-hero__content"},[o("div",{staticClass:"album-hero__title"},[t._v(" "+t._s(t.title)+" ")]),t.subtitle!==""?o("div",{staticClass:"album-hero__subtitle"},[t._v(" "+t._s(t.subtitle)+" ")]):t._e()])]):t._e()},tt=[],ot=d(K,Q,tt,!1,null,"868386d8");const et=ot.exports;function at(t,o){const e=t.find(a=>a.fileid===o);return e?.attributes.hasPreview?e:t.filter(a=>a.attributes.hasPreview).reduce((a,l)=>a===void 0||l.attributes.timestamp>a.attributes.timestamp?l:a,void 0)??e}const lt={name:"AlbumContent",components:{ActionFavorite:X,AlbumForm:j,AlbumHero:et,Close:z,CollaboratorsSelectionForm:Y,CollectionContent:q,DeleteOutline:T,PhotosPicker:G,HeaderNavigation:Z,ImagePlusOutline:U,MapMarkerOutline:H,NcActionButton:M,NcActions:I,NcActionSeparator:$,NcButton:y,NcDialog:O,NcEmptyContent:x,NcLoadingIcon:L,NcModal:B,PencilOutline:D,Plus:V,ShareVariantOutline:R},mixins:[W,J],props:{albumName:{type:String,default:"/"}},setup(){return{isMobile:k()}},data(){return{showAddPhotosModal:!1,showManageCollaboratorView:!1,showEditAlbumForm:!1,loadingAddCollaborators:!1}},computed:{album(){return this.$store.getters.getAlbum(this.albumName)},albumFileIds(){return this.$store.getters.getAlbumFiles(this.albumName)},sharingEnabled(){return OC.Share!==void 0},albumFileName(){return this.$store.getters.getAlbumName(this.albumName)},albumPhotos(){return this.albumFileIds.map(t=>this.$store.state.files.files[t]).filter(t=>t!==void 0)},coverPhoto(){return at(this.albumPhotos,this.album?.attributes["last-photo"]??-1)},coverFileId(){return this.coverPhoto?.fileid??this.album?.attributes["last-photo"]??-1},coverBlurhash(){return this.coverPhoto?.attributes["metadata-blurhash"]},albumSubtitle(){return this.album===void 0?"":[this.album.attributes.location,N("photos","%n photo","%n photos",this.album.attributes.nbItems)].filter(t=>t!=="").join(" · ")},removableSelectedFiles(){return(this.$refs.collectionContent?.selectedFileIds).map(t=>this.$store.state.files.files[t]).filter(t=>t.attributes["photos-album-file-origin"]!=="filters").map(t=>t.fileid.toString())}},async mounted(){this.fetchAlbum(),this.fetchAlbumContent()},methods:{async fetchAlbum(){await this.fetchCollection(this.albumFileName,S)},async fetchAlbumContent(){await this.fetchCollectionFiles(this.albumFileName,P)},async handleAlbumUpdate({album:t,changes:o}){this.showEditAlbumForm=!1,o.includes("name")&&await this.$router.push(`/albums/${t.basename}`),o.includes("filters")&&this.fetchAlbumContent()},async handleFilesPicked(t){this.showAddPhotosModal=!1,await this.$store.dispatch("addFilesToCollection",{collectionFileName:this.album?.root+this.album?.path,fileIdsToAdd:t}),await this.fetchAlbumContent()},async handleRemoveFilesFromAlbum(t){this.$refs.collectionContent?.onUncheckFiles(t),await this.$store.dispatch("removeFilesFromCollection",{collectionFileName:this.album?.root+this.album?.path,fileIdsToRemove:t})},async handleDeleteAlbum(){await this.$store.dispatch("deleteCollection",{collectionFileName:this.album?.root+this.album?.path})&&this.$router.push("/albums")},async handleSetCollaborators(t){try{this.loadingAddCollaborators=!0,this.showManageCollaboratorView=!1,await this.$store.dispatch("updateCollection",{collectionFileName:this.album?.root+this.album?.path,properties:{collaborators:t}})}catch(o){w.error("Error while setting album collaborators",{error:o})}finally{this.loadingAddCollaborators=!1}},async handleFiltersChange(t){await this.$store.dispatch("updateCollection",{collectionFileName:this.album?.root+this.album?.path,properties:{filters:t}}),this.fetchAlbumContent()},t:g}};var st=function(){var t=this,o=t._self._c;return o("div",{staticClass:"album-container"},[t.album!==void 0?o("AlbumHero",{attrs:{"cover-file-id":t.coverFileId,blurhash:t.coverBlurhash,title:t.albumName,subtitle:t.albumSubtitle}}):t._e(),o("CollectionContent",{ref:"collectionContent",attrs:{collection:t.album,"collection-file-ids":t.albumFileIds,loading:t.loadingCollection||t.loadingCollectionFiles,error:t.errorFetchingCollection||t.errorFetchingCollectionFiles},scopedSlots:t._u([{key:"header",fn:function({selectedFileIds:e,resetSelection:a}){return o("HeaderNavigation",{key:"navigation",attrs:{loading:t.loadingCollectionFiles,params:{albumName:t.albumName},path:"/"+t.albumName,title:t.albumName},on:{refresh:t.fetchAlbumContent}},[t.album!==void 0&&t.album.attributes.location!==""?o("div",{staticClass:"album__location",attrs:{slot:"subtitle"},slot:"subtitle"},[o("MapMarkerOutline"),t._v(t._s(t.album.attributes.location)+" ")],1):t._e(),o("template",{slot:"default"},[e.length>0?o("NcButton",{attrs:{"aria-label":t.t("photos","Unselect all")},on:{click:a},scopedSlots:t._u([{key:"icon",fn:function(){return[o("Close")]},proxy:!0}],null,!0)},[t._v(" "+t._s(t.t("photos","Unselect all"))+" ")]):t._e()],1),t.album!==void 0?o("template",{slot:"right"},[o("NcButton",{on:{click:function(l){t.showAddPhotosModal=!0}},scopedSlots:t._u([{key:"icon",fn:function(){return[o("Plus",{attrs:{size:20}})]},proxy:!0}],null,!0)},[t._v(" "+t._s(t.t("photos","Add photos to this album"))+" ")]),t.sharingEnabled?o("NcButton",{attrs:{variant:"tertiary","aria-label":t.t("photos","Manage collaborators for this album")},on:{click:function(l){t.showManageCollaboratorView=!0}}},[o("ShareVariantOutline",{attrs:{slot:"icon"},slot:"icon"})],1):t._e(),o("NcActions",{attrs:{"aria-label":t.t("photos","Open actions menu")}},[o("NcActionButton",{attrs:{"close-after-click":!0,"aria-label":t.t("photos","Edit album details")},on:{click:function(l){t.showEditAlbumForm=!0}}},[t._v(" "+t._s(t.t("photos","Edit album details"))+" "),o("PencilOutline",{attrs:{slot:"icon"},slot:"icon"})],1),o("NcActionButton",{attrs:{"close-after-click":!0},on:{click:t.handleDeleteAlbum}},[t._v(" "+t._s(t.t("photos","Delete album"))+" "),o("DeleteOutline",{attrs:{slot:"icon"},slot:"icon"})],1),e.length>0?[o("NcActionSeparator"),o("ActionFavorite",{attrs:{"selected-file-ids":e}}),t.removableSelectedFiles.length!==0?o("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(l){return t.handleRemoveFilesFromAlbum(t.removableSelectedFiles)}}},[t._v(" "+t._s(t.t("photos","Remove selection from album"))+" "),o("Close",{attrs:{slot:"icon"},slot:"icon"})],1):t._e()]:t._e()],2)],1):t._e()],2)}}])},[t.album!==void 0&&t.album.attributes.nbItems===0&&!(t.loadingCollectionFiles||t.loadingCollection)?o("NcEmptyContent",{staticClass:"album__empty",attrs:{slot:"empty-content",name:t.t("photos","This album does not have any photos or videos yet!")},slot:"empty-content"},[o("ImagePlusOutline",{attrs:{slot:"icon"},slot:"icon"}),o("NcButton",{staticClass:"album__empty__button",attrs:{slot:"action",variant:"primary","aria-label":t.t("photos","Add photos to this album")},on:{click:function(e){t.showAddPhotosModal=!0}},slot:"action"},[o("Plus",{attrs:{slot:"icon"},slot:"icon"}),t._v(" "+t._s(t.t("photos","Add"))+" ")],1)],1):t._e()],1),t.album!==void 0?o("PhotosPicker",{attrs:{open:t.showAddPhotosModal,"blacklist-ids":t.albumFileIds,destination:t.album.basename,name:t.t("photos","Add photos to {albumName}",{albumName:t.albumName},void 0,{escape:!1,sanitize:!1})},on:{"update:open":function(e){t.showAddPhotosModal=e},"files-picked":t.handleFilesPicked}}):t._e(),t.showManageCollaboratorView&&t.album!==void 0?o("NcModal",{attrs:{name:t.t("photos","Manage collaborators")},on:{close:function(e){t.showManageCollaboratorView=!1}}},[o("CollaboratorsSelectionForm",{attrs:{"album-name":t.album.basename,collaborators:t.album.attributes.collaborators},scopedSlots:t._u([{key:"default",fn:function({collaborators:e}){return[o("NcButton",{attrs:{"aria-label":t.t("photos","Save collaborators for this album."),variant:"primary",disabled:t.loadingAddCollaborators},on:{click:function(a){return t.handleSetCollaborators(e)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loadingAddCollaborators?o("NcLoadingIcon"):t._e()]},proxy:!0}],null,!0)},[t._v(" "+t._s(t.t("photos","Save"))+" ")])]}}],null,!1,2061546483)})],1):t._e(),t.showEditAlbumForm?o("NcDialog",{attrs:{name:t.t("photos","Edit album details"),"close-on-click-outside":"",size:"normal"},on:{closing:function(e){t.showEditAlbumForm=!1}}},[o("AlbumForm",{attrs:{album:t.album},on:{done:e=>t.handleAlbumUpdate(e)}})],1):t._e()],1)},it=[],rt=d(lt,st,it,!1,null,"dd86895f");const Dt=rt.exports;export{Dt as default}; +//# sourceMappingURL=AlbumContent-CTTPbVIX.chunk.mjs.map diff --git a/js/AlbumContent-Dt79ow4u.chunk.mjs.license b/js/AlbumContent-CTTPbVIX.chunk.mjs.license similarity index 100% rename from js/AlbumContent-Dt79ow4u.chunk.mjs.license rename to js/AlbumContent-CTTPbVIX.chunk.mjs.license diff --git a/js/AlbumContent-Dt79ow4u.chunk.mjs.map b/js/AlbumContent-CTTPbVIX.chunk.mjs.map similarity index 99% rename from js/AlbumContent-Dt79ow4u.chunk.mjs.map rename to js/AlbumContent-CTTPbVIX.chunk.mjs.map index 9ef41ecbb7..98d3c04de0 100644 --- a/js/AlbumContent-Dt79ow4u.chunk.mjs.map +++ b/js/AlbumContent-CTTPbVIX.chunk.mjs.map @@ -1 +1 @@ -{"version":3,"file":"AlbumContent-Dt79ow4u.chunk.mjs","sources":["../src/components/AlbumHero.vue","../src/utils/albumCover.ts","../src/views/AlbumContent.vue"],"sourcesContent":["\n\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { PhotoFile } from '../store/files.ts'\n\n/**\n * Pick the photo to show as the cover of an album.\n *\n * The album points at the photo added last, which is not necessarily one a\n * preview can be built for - and a cover without a preview leaves an empty\n * tile. The most recent photo with a preview is used instead in that case,\n * falling back to the photo the album points at when none of them has one.\n *\n * @param files - Photos of the album\n * @param coverFileId - File id the album points at, `-1` when it has no photo\n */\nexport function pickAlbumCover(files: PhotoFile[], coverFileId: number): PhotoFile | undefined {\n\tconst cover = files.find((file) => file.fileid === coverFileId)\n\tif (cover?.attributes.hasPreview) {\n\t\treturn cover\n\t}\n\n\tconst mostRecentWithPreview = files\n\t\t.filter((file) => file.attributes.hasPreview)\n\t\t.reduce(\n\t\t\t(newest, file) => newest === undefined || file.attributes.timestamp > newest.attributes.timestamp ? file : newest,\n\t\t\tundefined,\n\t\t)\n\n\treturn mostRecentWithPreview ?? cover\n}\n","\n\n\n\n\n\n"],"names":["MAX_PARALLAX_OFFSET","PARALLAX_RATIO","COVER_PREVIEW_SIZE","hasCover","computed","props","coverUrl","generateUrl","coverLoaded","ref","coverFailed","watch","parallaxOffset","coverStyle","scroller","onMounted","onScroll","onBeforeUnmount","scrollTop","pickAlbumCover","files","coverFileId","cover","file","newest","_sfc_main","ActionFavorite","AlbumForm","AlbumHero","Close","CollaboratorsSelectionForm","CollectionContent","DeleteOutline","PhotosPicker","HeaderNavigation","ImagePlusOutline","MapMarkerOutline","NcActionButton","NcActions","NcActionSeparator","NcButton","NcDialog","NcEmptyContent","NcLoadingIcon","NcModal","PencilOutline","Plus","ShareVariantOutline","FetchCollectionContentMixin","FetchFilesMixin","useIsMobile","fileId","translatePlural","part","albumsExtraProps","albumFilesExtraProps","album","changes","fileIds","collaborators","error","logger","filters","translate"],"mappings":"2yDAkEMA,EAAsB,GAGtBC,EAAiB,IAQjBC,EAAqB,KAErBC,EAAWC,EAAkB,IAAMC,EAAM,YAAc,CAAC,EAExDC,EAAWF,EAAiB,IAAMG,EAAY,+BAA+BF,EAAM,WAAW,MAAMH,CAAkB,MAAMA,CAAkB,EAAE,CAAC,EAEjJM,EAAcC,EAAI,EAAK,EAKvBC,EAAcD,EAAI,EAAK,EAE7BE,EAAML,EAAU,IAAM,CACrBE,EAAY,MAAQ,GACpBE,EAAY,MAAQ,EACrB,CAAC,EAED,MAAME,EAAiBH,EAAI,CAAC,EAItBI,EAAaT,EAAS,KAAO,CAClC,OAAQ,eAAeJ,CAAmB,MAC1C,UAAW,cAAcY,EAAe,KAAK,KAAA,EAC5C,EAGIE,EAAW,SAAS,eAAe,iBAAiB,GAAK,OAE/DC,EAAU,IAAM,C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A,GACA,KAAA,kBAAA,CAEA,EAEA,MAAA,kBAAAC,EAAA,CACA,KAAA,mBAAA,GACA,MAAA,KAAA,OAAA,SAAA,uBAAA,CAAA,mBAAA,KAAA,OAAA,KAAA,KAAA,OAAA,KAAA,aAAAA,EAAA,EAEA,MAAA,KAAA,kBAAA,CACA,EAEA,MAAA,2BAAAA,EAAA,CACA,KAAA,MAAA,mBAAA,eAAAA,CAAA,EACA,MAAA,KAAA,OAAA,SAAA,4BAAA,CAAA,mBAAA,KAAA,OAAA,KAAA,KAAA,OAAA,KAAA,gBAAAA,EAAA,CACA,EAEA,MAAA,mBAAA,CACA,MAAA,KAAA,OAAA,SAAA,mBAAA,CAAA,mBAAA,KAAA,OAAA,KAAA,KAAA,OAAA,KAAA,GAEA,KAAA,QAAA,KAAA,SAAA,CAEA,EAEA,MAAA,uBAAAC,EAAA,CACA,GAAA,CACA,KAAA,wBAAA,GACA,KAAA,2BAAA,GACA,MAAA,KAAA,OAAA,SAAA,mBAAA,CAAA,mBAAA,KAAA,OAAA,KAAA,KAAA,OAAA,KAAA,WAAA,CAAA,cAAAA,CAAA,EAAA,CACA,OAAAC,EAAA,CACAC,EAAA,MAAA,0CAAA,CAAA,MAAAD,CAAA,CAAA,CACA,QAAA,CACA,KAAA,wBAAA,EACA,CACA,EAEA,MAAA,oBAAAE,EAAA,CACA,MAAA,KAAA,OAAA,SAAA,mBAAA,CAAA,mBAAA,KAAA,OAAA,KAAA,KAAA,OAAA,KAAA,WAAA,CAAA,QAAAA,CAAA,EAAA,EACA,KAAA,kBAAA,CACA,EAEA,EAAAC,CAAA,CAEA"} \ No newline at end of file +{"version":3,"file":"AlbumContent-CTTPbVIX.chunk.mjs","sources":["../src/components/AlbumHero.vue","../src/utils/albumCover.ts","../src/views/AlbumContent.vue"],"sourcesContent":["\n\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { PhotoFile } from '../store/files.ts'\n\n/**\n * Pick the photo to show as the cover of an album.\n *\n * The album points at the photo added last, which is not necessarily one a\n * preview can be built for - and a cover without a preview leaves an empty\n * tile. The most recent photo with a preview is used instead in that case,\n * falling back to the photo the album points at when none of them has one.\n *\n * @param files - Photos of the album\n * @param coverFileId - File id the album points at, `-1` when it has no photo\n */\nexport function pickAlbumCover(files: PhotoFile[], coverFileId: number): PhotoFile | undefined {\n\tconst cover = files.find((file) => file.fileid === coverFileId)\n\tif (cover?.attributes.hasPreview) {\n\t\treturn cover\n\t}\n\n\tconst mostRecentWithPreview = files\n\t\t.filter((file) => file.attributes.hasPreview)\n\t\t.reduce(\n\t\t\t(newest, file) => newest === undefined || file.attributes.timestamp > newest.attributes.timestamp ? file : newest,\n\t\t\tundefined,\n\t\t)\n\n\treturn mostRecentWithPreview ?? cover\n}\n","\n\n\n\n\n\n"],"names":["MAX_PARALLAX_OFFSET","PARALLAX_RATIO","COVER_PREVIEW_SIZE","hasCover","computed","props","coverUrl","generateUrl","coverLoaded","ref","coverFailed","watch","parallaxOffset","coverStyle","scroller","onMounted","onScroll","onBeforeUnmount","scrollTop","pickAlbumCover","files","coverFileId","cover","file","newest","_sfc_main","ActionFavorite","AlbumForm","AlbumHero","Close","CollaboratorsSelectionForm","CollectionContent","DeleteOutline","PhotosPicker","HeaderNavigation","ImagePlusOutline","MapMarkerOutline","NcActionButton","NcActions","NcActionSeparator","NcButton","NcDialog","NcEmptyContent","NcLoadingIcon","NcModal","PencilOutline","Plus","ShareVariantOutline","FetchCollectionContentMixin","FetchFilesMixin","useIsMobile","fileId","translatePlural","part","albumsExtraProps","albumFilesExtraProps","album","changes","fileIds","collaborators","error","logger","filters","translate"],"mappings":"2yDAkEMA,EAAsB,GAGtBC,EAAiB,IAQjBC,EAAqB,KAErBC,EAAWC,EAAkB,IAAMC,EAAM,YAAc,CAAC,EAExDC,EAAWF,EAAiB,IAAMG,EAAY,+BAA+BF,EAAM,WAAW,MAAMH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CAAA,mBAAA,KAAA,OAAA,KAAA,KAAA,OAAA,KAAA,WAAA,CAAA,QAAAA,CAAA,EAAA,EACA,KAAA,kBAAA,CACA,EAEA,EAAAC,CAAA,CAEA"} \ No newline at end of file diff --git a/js/AlbumContent-Dt79ow4u.chunk.mjs.map.license b/js/AlbumContent-CTTPbVIX.chunk.mjs.map.license similarity index 100% rename from js/AlbumContent-Dt79ow4u.chunk.mjs.map.license rename to js/AlbumContent-CTTPbVIX.chunk.mjs.map.license diff --git a/js/AlbumForm-okviGw24.chunk.mjs b/js/AlbumForm-CJumwUvV.chunk.mjs similarity index 97% rename from js/AlbumForm-okviGw24.chunk.mjs rename to js/AlbumForm-CJumwUvV.chunk.mjs index fa6c469c5a..8c8d70a1e1 100644 --- a/js/AlbumForm-okviGw24.chunk.mjs +++ b/js/AlbumForm-CJumwUvV.chunk.mjs @@ -1,2 +1,2 @@ -import{S as o,v as S,I as _,a as d}from"./ShareType-BimJVf67.chunk.mjs";import{c as y,x as w,y as $,t as s,E as x,i as B,k as A,b as I,g as M}from"./dav-CWjVE7gP.chunk.mjs";import{n as P,q as n,r as V,D as O,E,F as U,s as c,l as u,S as z,N as g,e as T,z as q,m as K,c as f}from"./index-DJvZzPIC.chunk.mjs";import{N as R}from"./NcLoadingIcon-BhCR1fI8.chunk.mjs";import{d as D,e as j,P as G,f as H,b as Y,g as J}from"./PhotosFiltersInput-CWFg84lX.chunk.mjs";import{E as W,s as Z,t as Q,C as X,n as k,g as tt,u as et,M as at}from"./icons-BogBEt5I.chunk.mjs";import{G as lt}from"./NcAvatar-C1ty7wsG-CLn0OfFi.chunk.mjs";import{a as ot,b as it}from"./collectionFetcher-BK_Uf5YT.chunk.mjs";import{A as st}from"./AbortControllerMixin-ZTUlUgrD.chunk.mjs";const C="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='mdi-account-group-outline'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M12,5A3.5,3.5%200%200,0%208.5,8.5A3.5,3.5%200%200,0%2012,12A3.5,3.5%200%200,0%2015.5,8.5A3.5,3.5%200%200,0%2012,5M12,7A1.5,1.5%200%200,1%2013.5,8.5A1.5,1.5%200%200,1%2012,10A1.5,1.5%200%200,1%2010.5,8.5A1.5,1.5%200%200,1%2012,7M5.5,8A2.5,2.5%200%200,0%203,10.5C3,11.44%203.53,12.25%204.29,12.68C4.65,12.88%205.06,13%205.5,13C5.94,13%206.35,12.88%206.71,12.68C7.08,12.47%207.39,12.17%207.62,11.81C6.89,10.86%206.5,9.7%206.5,8.5C6.5,8.41%206.5,8.31%206.5,8.22C6.2,8.08%205.86,8%205.5,8M18.5,8C18.14,8%2017.8,8.08%2017.5,8.22C17.5,8.31%2017.5,8.41%2017.5,8.5C17.5,9.7%2017.11,10.86%2016.38,11.81C16.5,12%2016.63,12.15%2016.78,12.3C16.94,12.45%2017.1,12.58%2017.29,12.68C17.65,12.88%2018.06,13%2018.5,13C18.94,13%2019.35,12.88%2019.71,12.68C20.47,12.25%2021,11.44%2021,10.5A2.5,2.5%200%200,0%2018.5,8M12,14C9.66,14%205,15.17%205,17.5V19H19V17.5C19,15.17%2014.34,14%2012,14M4.71,14.55C2.78,14.78%200,15.76%200,17.5V19H3V17.07C3,16.06%203.69,15.22%204.71,14.55M19.29,14.55C20.31,15.22%2021,16.06%2021,17.07V19H24V17.5C24,15.76%2021.22,14.78%2019.29,14.55M12,16C13.53,16%2015.24,16.5%2016.23,17H7.77C8.76,16.5%2010.47,16%2012,16Z'%20/%3e%3c/svg%3e";V(E,O);const rt={model:{prop:"modelValue",event:"update:modelValue"}},nt=y({...rt,__name:"NcSelectUsers",props:{ariaLabelClearSelected:{type:String,default:n("Clear selected")},ariaLabelListbox:{type:String,default:n("Options")},ariaLabelDeselectOption:{type:Function,default:t=>n("Deselect {option}",{option:t})},keepOpen:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},filterBy:{type:Function,default:null},inputId:{type:String,default:()=>lt()},inputLabel:{type:String,default:n("Select account")},labelOutside:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},noWrap:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},required:{type:Boolean,default:!1},modelValue:{type:Object,default:null}},emits:["search","update:modelValue"],setup(t,{emit:e}){const a=t,l=w("");$(l,()=>{e("search",l.value)});const i=Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--default-clickable-area")),r=Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--default-grid-baseline")),h=i-2*r;function N(p,v,b){if(a.filterBy)return a.filterBy;const F=/[^<]*<([^>]+)/,m=b.match(F),L=p.subname?.toLocaleLowerCase()??"";return m&&L.indexOf(m[1].toLocaleLowerCase())>-1||`${v} ${p.subname}`.toLocaleLowerCase().indexOf(b.toLocaleLowerCase())>-1}return{__sfc:!0,props:a,emit:e,search:l,clickableArea:i,gridBaseLine:r,avatarSize:h,localFilterBy:N,NcListItemIcon:j,NcSelect:D}}});var ct=function(){var t=this,e=t._self._c,a=t._self._setupProxy;return e(a.NcSelect,t._b({staticClass:"nc-select-users",attrs:{"filter-by":a.localFilterBy,label:"displayName"},on:{search:function(l){a.search=l},"update:model-value":function(l){return t.$emit("update:modelValue",l)}},scopedSlots:t._u([{key:"option",fn:function(l){return[e(a.NcListItemIcon,t._b({attrs:{"avatar-size":32,name:l.displayName,search:a.search}},"NcListItemIcon",l,!1))]}},{key:"selected-option",fn:function(l){return[e(a.NcListItemIcon,t._b({attrs:{"avatar-size":a.avatarSize,name:l.displayName,"no-margin":"",search:a.search}},"NcListItemIcon",l,!1))]}}])},"NcSelect",t.$props,!1))},ut=[],ht=P(nt,ct,ut,!1,null,"7f7ecbfe");const dt=ht.exports,pt=y({name:"FetchCollectionContentMixin",data(){return{fetchSemaphore:new z(1),loadingCollection:!1,loadingCollectionFiles:!1,errorFetchingCollection:null,errorFetchingCollectionFiles:null}},mixins:[st],methods:{async fetchCollection(t,e,a){if(this.loadingCollection)return null;try{this.loadingCollection=!0,this.errorFetchingCollection=null;const l=await it(t,{signal:this.abortController.signal},e,a);return this.$store.dispatch("addCollections",{collections:[l]}),l}catch(l){if(l.response?.status===404)return this.errorFetchingCollection=404,null;this.errorFetchingCollection=l,u.error("[PublicCollectionContent] Error fetching collection",{error:l}),c(s("photos","Failed to fetch collection."))}finally{this.loadingCollection=!1}return null},async fetchCollectionFiles(t,e=[],a){if(this.loadingCollectionFiles)return[];e=[...e,...U];const l=await this.fetchSemaphore.acquire();try{this.errorFetchingCollectionFiles=null,this.loadingCollectionFiles=!0;const i=await ot(t,{signal:this.abortController.signal},e,a),r=i.map(h=>h.fileid?.toString());return this.$store.dispatch("appendFiles",i),await this.$store.commit("setCollectionFiles",{collectionFileName:t,fileIds:r}),i}catch(i){if(i.response?.status===404)return this.errorFetchingCollectionFiles=404,[];this.errorFetchingCollectionFiles=i,c(s("photos","Failed to fetch collections list.")),u.error("[PublicCollectionContent] Error fetching collection files",{error:i})}finally{this.loadingCollectionFiles=!1,this.fetchSemaphore.release(l)}return[]}}}),bt={name:"CollaboratorsSelectionForm",components:{Close:X,ContentCopy:Q,Check:Z,Earth:W,NcButton:g,NcSelectUsers:dt},mixins:[pt],props:{albumName:{type:String,required:!0},collaborators:{type:Array,default:()=>[]},allowPublicLink:{type:Boolean,default:!0}},data(){return{availableCollaborators:{},selectedCollaboratorsKeys:[],currentSearchResults:[],loadingCollaborators:!1,randomId:Math.random().toString().substring(2,10),searchSequence:0,publicLinkCopied:!1,collaboratorTypes:o,config:{minSearchStringLength:parseInt(OC.config["sharing.minSearchStringLength"],10)||0}}},computed:{searchResults(){return this.currentSearchResults.filter(({id:t})=>t!==A()?.uid).map(t=>({key:`${t.type}:${t.id}`,id:t.id,user:t.id,displayName:t.label,type:t.type===o.User?"user":"group",iconSvg:t.type===o.Group?C:void 0})).filter(({key:t})=>!this.selectedCollaboratorsKeys.includes(t))},selectedCollaborators(){return this.selectedCollaboratorsKeys.map(t=>this.availableCollaborators[t])},selectedUsers:{get(){return this.selectedCollaborators.filter(({type:t})=>t!==o.Link).map(t=>({key:`${t.type}:${t.id}`,id:t.id,user:t.id,displayName:t.label,type:t.type===o.User?"user":"group",iconSvg:t.type===o.Group?C:void 0}))},set(t){this.selectedCollaboratorsKeys=t.map(({key:e})=>e)}},isPublicLinkSelected(){return this.selectedCollaboratorsKeys.includes(`${o.Link}`)},publicLink(){return this.availableCollaborators[o.Link]},publicLinkURL(){return`${window.location.protocol}//${window.location.host}${B(`apps/photos/public/${this.publicLink.id}`)}`},albumFileName(){return this.$store.getters.getAlbumName(this.albumName)}},watch:{collaborators(t){this.populateCollaborators(t)}},mounted(){this.populateCollaborators(this.collaborators)},methods:{async searchCollaborators(t){if(t===void 0||(t=t.trim(),t.length{switch(l.source){case"users":return{id:l.id,label:l.label,type:o.User};case"groups":return{id:l.id,label:l.label,type:o.Group};default:throw new Error(`Invalid collaborator source ${l.source}`)}}),this.availableCollaborators={...this.availableCollaborators,...this.currentSearchResults.reduce(this.indexCollaborators,{})}}catch(a){if(e!==this.searchSequence)return;this.errorFetchingCollaborators=a,u.error(this.t("photos","Failed to fetch collaborators list."),{error:a}),c(this.t("photos","Failed to fetch collaborators list."))}finally{e===this.searchSequence&&(this.loadingCollaborators=!1)}},populateCollaborators(t){const e=t.reduce(this.indexCollaborators,{});this.selectedCollaboratorsKeys=Object.keys(e),this.availableCollaborators={3:{id:"",label:this.t("photos","Public link"),type:o.Link},...this.availableCollaborators,...e}},indexCollaborators(t,e){return{...t,[`${e.type}${e.type===o.Link?"":":"}${e.type===o.Link?"":e.id}`]:e}},async createPublicLinkForAlbum(){this.selectEntity(`${o.Link}`),await this.updateAlbumCollaborators(),await this.fetchCollection(this.albumFileName,T)},async deletePublicLink(){this.unselectEntity(`${o.Link}`),this.availableCollaborators[3]={id:"",label:this.t("photos","Public link"),type:o.Link},this.publicLinkCopied=!1,await this.updateAlbumCollaborators()},async updateAlbumCollaborators(){try{await this.$store.dispatch("updateCollection",{collectionFileName:this.albumFileName,properties:{collaborators:this.selectedCollaborators}})}catch(t){u.error("[PublicAlbumContent] Error updating album",{error:t}),c(this.t("photos","Failed to update album."))}},async copyPublicLink(){await navigator.clipboard.writeText(this.publicLinkURL),this.publicLinkCopied=!0,setTimeout(()=>{this.publicLinkCopied=!1},1e4)},selectEntity(t){this.selectedCollaboratorsKeys.includes(t)||this.selectedCollaboratorsKeys.push(t)},unselectEntity(t){const e=this.selectedCollaboratorsKeys.indexOf(t);e!==-1&&this.selectedCollaboratorsKeys.splice(e,1)},t:s}};var mt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"manage-collaborators"},[e("h2",{staticClass:"manage-collaborators__title"},[t._v(" "+t._s(t.t("photos","Add collaborators"))+" ")]),e("form",{staticClass:"manage-collaborators__form",on:{submit:function(a){a.preventDefault()}}},[e("NcSelectUsers",{attrs:{"input-id":"sharing-search-input","input-label":t.t("photos","Add people or groups who can edit your album"),loading:t.loadingCollaborators,label:"label",filterable:!1,placeholder:t.t("photos","Search people or groups"),"clear-search-on-blur":()=>!1,multiple:!0,"append-to-body":!1,options:t.searchResults},on:{search:t.searchCollaborators,"option:selected":({key:a})=>t.selectEntity(a)},model:{value:t.selectedUsers,callback:function(a){t.selectedUsers=a},expression:"selectedUsers"}},[t._v(" "+t._s(t.t("photos","No recommendations. Start typing."))+" ")])],1),e("div",{staticClass:"actions"},[t.allowPublicLink?e("div",{staticClass:"actions__public-link"},[t.isPublicLinkSelected&&t.publicLink.id!==""?[e("NcButton",{staticClass:"manage-collaborators__public-link-button",attrs:{"aria-label":t.t("photos","Copy the public link"),title:t.publicLinkURL},on:{click:t.copyPublicLink},scopedSlots:t._u([{key:"icon",fn:function(){return[t.publicLinkCopied?e("Check"):e("ContentCopy")]},proxy:!0}],null,!1,845538853)},[t.publicLinkCopied?[t._v(" "+t._s(t.t("photos","Public link copied!"))+" ")]:[t._v(" "+t._s(t.t("photos","Copy public link"))+" ")]],2),e("NcButton",{attrs:{variant:"tertiary","aria-label":t.t("photos","Delete the public link")},on:{click:t.deletePublicLink}},[e("Close",{attrs:{slot:"icon"},slot:"icon"})],1)]:e("NcButton",{staticClass:"manage-collaborators__public-link-button",attrs:{disabled:t.isPublicLinkSelected&&t.publicLink.id==="","aria-label":t.t("photos","Create public link share")},on:{click:t.createPublicLinkForAlbum}},[e("Earth",{attrs:{slot:"icon"},slot:"icon"}),t._v(" "+t._s(t.t("photos","Share via public link"))+" ")],1)],2):t._e(),e("div",{staticClass:"actions__slot"},[t._t("default",null,{collaborators:t.selectedCollaborators})],2)])])},ft=[],Ct=k(bt,mt,ft,!1,null,"beb979f1");const yt=Ct.exports,gt={name:"AlbumForm",components:{MapMarkerOutline:at,AccountMultiplePlusOutline:et,SendOutline:tt,NcButton:g,NcLoadingIcon:R,NcTextField:Y,CollaboratorsSelectionForm:yt,PhotosFiltersInput:H,PhotosFiltersDisplay:G},props:{album:{type:Object,default:null},filtersValue:{type:Object,default:()=>({})},displayBackButton:{type:Boolean,default:!1}},data(){return{showCollaboratorView:!1,albumName:"",albumLocation:"",albumFilters:J.reduce((t,e)=>({...t,[e.id]:[]}),{}),loading:!1}},computed:{editMode(){return this.album!==null},sharingEnabled(){return OC.Share!==void 0},albumFileName(){return this.$store.getters.getAlbumName(this.albumName)},albumNameValidationError(){const t=this.$store.getters.albums[this.albumFileName];if(t!==void 0&&this.album!==t&&!this.loading)return s("files","This name is already in use.");try{S(this.albumName)}catch(e){if(!(e instanceof _))throw e;switch(e.reason){case d.Character:return s("files",'"{char}" is not allowed inside a filename.',{char:e.segment});case d.ReservedName:return;case d.Extension:return;default:return s("files","Invalid filename.")}}},canSubmit(){return this.albumName!==""&&this.albumNameValidationError===void 0&&!this.loading}},mounted(){this.editMode?(this.albumName=this.album?.basename,this.albumLocation=this.album?.attributes.location??"",this.albumFilters={...this.albumFilters,...structuredClone(this.album?.attributes.filters??{})}):this.albumFilters={...this.albumFilters,...structuredClone(this.filtersValue)},this.$nextTick(()=>{this.$refs.nameInput.$el.getElementsByTagName("input")[0].focus()})},methods:{submit(t=[]){this.canSubmit&&(this.editMode?this.handleUpdateAlbum():this.handleCreateAlbum(t))},async handleCreateAlbum(t=[]){try{this.loading=!0;const e=I({basename:this.albumName,filename:f+"/"+this.albumName,lastmod:"",size:0,type:"directory",etag:null,props:{displayname:this.albumName,resourcetype:{},nbItems:0,location:this.albumLocation,"last-photo":-1,date:K().format("MMMM YYYY"),collaborators:t,filters:this.filtersValue,source:M(`dav/${this.albumFileName}`)}},f);let a=await this.$store.dispatch("createCollection",{collection:e});if(a===void 0)return;const l={};this.albumLocation!==""&&(l.location=this.albumLocation),(this.albumLocation!==""||t.length!==0)&&(l.collaborators=t),Object.keys(this.filtersValue).length>0&&(l.filters=this.filtersValue),a=await this.$store.dispatch("updateCollection",{collectionFileName:this.albumFileName,properties:l}),this.$emit("done",{album:a})}finally{this.loading=!1}},async handleUpdateAlbum(){try{this.loading=!0;let t=this.album?.clone();const e=[];if(this.album!==null&&this.album.basename!==this.albumName&&(e.push("name"),t=await this.$store.dispatch("renameCollection",{collectionFileName:this.album.root+this.album.path,newBaseName:this.albumName}),t===this.album))return;this.album!==null&&this.album.attributes.location!==this.albumLocation&&(e.push("location"),t=await this.$store.dispatch("updateCollection",{collectionFileName:t.root+t.path,properties:{location:this.albumLocation}})),this.album!==null&&JSON.stringify(this.album.attributes.filters)!==JSON.stringify(this.albumFilters)&&(e.push("filters"),t=await this.$store.dispatch("updateCollection",{collectionFileName:t.root+t.path,properties:{filters:this.albumFilters}})),this.$emit("done",{album:t,changes:e})}finally{this.loading=!1}},selectFilter(t){this.albumFilters[t.filterId].push(t.value)},deselectFilter(t){const e=this.albumFilters[t.filterId].indexOf(t.value);e!==-1&&this.albumFilters[t.filterId].splice(e,1)},back(){this.$emit("back")},t:s}};var kt=function(){var t=this,e=t._self._c;return t.showCollaboratorView?e("CollaboratorsSelectionForm",{attrs:{"album-name":t.albumName,"allow-public-link":!1},scopedSlots:t._u([{key:"default",fn:function({collaborators:a}){return[e("span",{staticClass:"left-buttons"},[e("NcButton",{attrs:{variant:"tertiary"},on:{click:function(l){t.showCollaboratorView=!1}}},[t._v(" "+t._s(t.t("photos","Back"))+" ")])],1),e("span",{staticClass:"right-buttons"},[e("NcButton",{attrs:{variant:"primary",disabled:!t.canSubmit},on:{click:function(l){return t.submit(a)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon",{attrs:{size:20}}):e("SendOutline",{attrs:{size:20}})]},proxy:!0}],null,!0)},[t._v(" "+t._s(t.editMode?t.t("photos","Save"):t.t("photos","Create album"))+" ")])],1)]}}])}):e("form",{staticClass:"album-form",on:{submit:function(a){return a.preventDefault(),t.submit()}}},[e("div",{staticClass:"form-inputs"},[e("NcTextField",{ref:"nameInput",attrs:{type:"text",name:"name","helper-text":t.albumNameValidationError,error:t.albumNameValidationError!==void 0,required:!0,label:t.t("photos","Name of the album")},model:{value:t.albumName,callback:function(a){t.albumName=typeof a=="string"?a.trim():a},expression:"albumName"}}),e("NcTextField",{attrs:{name:"location",type:"text",label:t.t("photos","Location of the album")},scopedSlots:t._u([{key:"default",fn:function(){return[e("MapMarkerOutline",{attrs:{size:20}})]},proxy:!0}],null,!1,3863723734),model:{value:t.albumLocation,callback:function(a){t.albumLocation=a},expression:"albumLocation"}})],1),e("PhotosFiltersInput",{attrs:{"selected-filters":t.albumFilters},on:{"select-filter":t.selectFilter}}),e("PhotosFiltersDisplay",{attrs:{"selected-filters":t.albumFilters},on:{"deselect-filter":t.deselectFilter}}),e("div",{staticClass:"form-buttons"},[e("span",{staticClass:"left-buttons"},[t.displayBackButton?e("NcButton",{attrs:{variant:"tertiary"},on:{click:t.back}},[t._v(" "+t._s(t.t("photos","Back"))+" ")]):t._e()],1),e("span",{staticClass:"right-buttons"},[t.sharingEnabled&&!t.editMode?e("NcButton",{attrs:{variant:"secondary",disabled:!t.canSubmit},on:{click:function(a){t.showCollaboratorView=!0}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("AccountMultiplePlusOutline",{attrs:{size:20}})]},proxy:!0}],null,!1,1381680579)},[t._v(" "+t._s(t.t("photos","Add collaborators"))+" ")]):t._e(),e("NcButton",{attrs:{variant:"primary",disabled:!t.canSubmit},on:{click:function(a){return t.submit()}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon",{attrs:{size:20}}):e("SendOutline",{attrs:{size:20}})]},proxy:!0}],null,!1,2348760288)},[t._v(" "+t._s(t.editMode?t.t("photos","Save"):t.t("photos","Create album"))+" ")])],1)])],1)},Nt=[],vt=k(gt,kt,Nt,!1,null,"546e550b");const It=vt.exports;export{It as A,yt as C,pt as F}; -//# sourceMappingURL=AlbumForm-okviGw24.chunk.mjs.map +import{S as o,v as S,I as _,a as d}from"./ShareType-BaT3OrWf.chunk.mjs";import{c as y,x as w,y as $,t as s,E as x,i as B,k as A,b as I,g as M}from"./dav-CWjVE7gP.chunk.mjs";import{n as P,q as n,r as V,D as O,E,F as U,s as c,l as u,S as z,N as g,e as T,z as q,m as K,c as f}from"./index-fcYXXWIu.chunk.mjs";import{N as R}from"./NcLoadingIcon-XgSwY1D8.chunk.mjs";import{d as D,e as j,P as G,f as H,b as Y,g as J}from"./PhotosFiltersInput-BRVzHHOC.chunk.mjs";import{E as W,s as Z,t as Q,C as X,n as k,g as tt,u as et,M as at}from"./icons-BogBEt5I.chunk.mjs";import{G as lt}from"./NcAvatar-C1ty7wsG-CgwbZZZ_.chunk.mjs";import{a as ot,b as it}from"./collectionFetcher-CxH90nfe.chunk.mjs";import{A as st}from"./AbortControllerMixin-ZTUlUgrD.chunk.mjs";const C="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='mdi-account-group-outline'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M12,5A3.5,3.5%200%200,0%208.5,8.5A3.5,3.5%200%200,0%2012,12A3.5,3.5%200%200,0%2015.5,8.5A3.5,3.5%200%200,0%2012,5M12,7A1.5,1.5%200%200,1%2013.5,8.5A1.5,1.5%200%200,1%2012,10A1.5,1.5%200%200,1%2010.5,8.5A1.5,1.5%200%200,1%2012,7M5.5,8A2.5,2.5%200%200,0%203,10.5C3,11.44%203.53,12.25%204.29,12.68C4.65,12.88%205.06,13%205.5,13C5.94,13%206.35,12.88%206.71,12.68C7.08,12.47%207.39,12.17%207.62,11.81C6.89,10.86%206.5,9.7%206.5,8.5C6.5,8.41%206.5,8.31%206.5,8.22C6.2,8.08%205.86,8%205.5,8M18.5,8C18.14,8%2017.8,8.08%2017.5,8.22C17.5,8.31%2017.5,8.41%2017.5,8.5C17.5,9.7%2017.11,10.86%2016.38,11.81C16.5,12%2016.63,12.15%2016.78,12.3C16.94,12.45%2017.1,12.58%2017.29,12.68C17.65,12.88%2018.06,13%2018.5,13C18.94,13%2019.35,12.88%2019.71,12.68C20.47,12.25%2021,11.44%2021,10.5A2.5,2.5%200%200,0%2018.5,8M12,14C9.66,14%205,15.17%205,17.5V19H19V17.5C19,15.17%2014.34,14%2012,14M4.71,14.55C2.78,14.78%200,15.76%200,17.5V19H3V17.07C3,16.06%203.69,15.22%204.71,14.55M19.29,14.55C20.31,15.22%2021,16.06%2021,17.07V19H24V17.5C24,15.76%2021.22,14.78%2019.29,14.55M12,16C13.53,16%2015.24,16.5%2016.23,17H7.77C8.76,16.5%2010.47,16%2012,16Z'%20/%3e%3c/svg%3e";V(E,O);const rt={model:{prop:"modelValue",event:"update:modelValue"}},nt=y({...rt,__name:"NcSelectUsers",props:{ariaLabelClearSelected:{type:String,default:n("Clear selected")},ariaLabelListbox:{type:String,default:n("Options")},ariaLabelDeselectOption:{type:Function,default:t=>n("Deselect {option}",{option:t})},keepOpen:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},filterBy:{type:Function,default:null},inputId:{type:String,default:()=>lt()},inputLabel:{type:String,default:n("Select account")},labelOutside:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},noWrap:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},required:{type:Boolean,default:!1},modelValue:{type:Object,default:null}},emits:["search","update:modelValue"],setup(t,{emit:e}){const a=t,l=w("");$(l,()=>{e("search",l.value)});const i=Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--default-clickable-area")),r=Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--default-grid-baseline")),h=i-2*r;function N(p,v,b){if(a.filterBy)return a.filterBy;const F=/[^<]*<([^>]+)/,m=b.match(F),L=p.subname?.toLocaleLowerCase()??"";return m&&L.indexOf(m[1].toLocaleLowerCase())>-1||`${v} ${p.subname}`.toLocaleLowerCase().indexOf(b.toLocaleLowerCase())>-1}return{__sfc:!0,props:a,emit:e,search:l,clickableArea:i,gridBaseLine:r,avatarSize:h,localFilterBy:N,NcListItemIcon:j,NcSelect:D}}});var ct=function(){var t=this,e=t._self._c,a=t._self._setupProxy;return e(a.NcSelect,t._b({staticClass:"nc-select-users",attrs:{"filter-by":a.localFilterBy,label:"displayName"},on:{search:function(l){a.search=l},"update:model-value":function(l){return t.$emit("update:modelValue",l)}},scopedSlots:t._u([{key:"option",fn:function(l){return[e(a.NcListItemIcon,t._b({attrs:{"avatar-size":32,name:l.displayName,search:a.search}},"NcListItemIcon",l,!1))]}},{key:"selected-option",fn:function(l){return[e(a.NcListItemIcon,t._b({attrs:{"avatar-size":a.avatarSize,name:l.displayName,"no-margin":"",search:a.search}},"NcListItemIcon",l,!1))]}}])},"NcSelect",t.$props,!1))},ut=[],ht=P(nt,ct,ut,!1,null,"7f7ecbfe");const dt=ht.exports,pt=y({name:"FetchCollectionContentMixin",data(){return{fetchSemaphore:new z(1),loadingCollection:!1,loadingCollectionFiles:!1,errorFetchingCollection:null,errorFetchingCollectionFiles:null}},mixins:[st],methods:{async fetchCollection(t,e,a){if(this.loadingCollection)return null;try{this.loadingCollection=!0,this.errorFetchingCollection=null;const l=await it(t,{signal:this.abortController.signal},e,a);return this.$store.dispatch("addCollections",{collections:[l]}),l}catch(l){if(l.response?.status===404)return this.errorFetchingCollection=404,null;this.errorFetchingCollection=l,u.error("[PublicCollectionContent] Error fetching collection",{error:l}),c(s("photos","Failed to fetch collection."))}finally{this.loadingCollection=!1}return null},async fetchCollectionFiles(t,e=[],a){if(this.loadingCollectionFiles)return[];e=[...e,...U];const l=await this.fetchSemaphore.acquire();try{this.errorFetchingCollectionFiles=null,this.loadingCollectionFiles=!0;const i=await ot(t,{signal:this.abortController.signal},e,a),r=i.map(h=>h.fileid?.toString());return this.$store.dispatch("appendFiles",i),await this.$store.commit("setCollectionFiles",{collectionFileName:t,fileIds:r}),i}catch(i){if(i.response?.status===404)return this.errorFetchingCollectionFiles=404,[];this.errorFetchingCollectionFiles=i,c(s("photos","Failed to fetch collections list.")),u.error("[PublicCollectionContent] Error fetching collection files",{error:i})}finally{this.loadingCollectionFiles=!1,this.fetchSemaphore.release(l)}return[]}}}),bt={name:"CollaboratorsSelectionForm",components:{Close:X,ContentCopy:Q,Check:Z,Earth:W,NcButton:g,NcSelectUsers:dt},mixins:[pt],props:{albumName:{type:String,required:!0},collaborators:{type:Array,default:()=>[]},allowPublicLink:{type:Boolean,default:!0}},data(){return{availableCollaborators:{},selectedCollaboratorsKeys:[],currentSearchResults:[],loadingCollaborators:!1,randomId:Math.random().toString().substring(2,10),searchSequence:0,publicLinkCopied:!1,collaboratorTypes:o,config:{minSearchStringLength:parseInt(OC.config["sharing.minSearchStringLength"],10)||0}}},computed:{searchResults(){return this.currentSearchResults.filter(({id:t})=>t!==A()?.uid).map(t=>({key:`${t.type}:${t.id}`,id:t.id,user:t.id,displayName:t.label,type:t.type===o.User?"user":"group",iconSvg:t.type===o.Group?C:void 0})).filter(({key:t})=>!this.selectedCollaboratorsKeys.includes(t))},selectedCollaborators(){return this.selectedCollaboratorsKeys.map(t=>this.availableCollaborators[t])},selectedUsers:{get(){return this.selectedCollaborators.filter(({type:t})=>t!==o.Link).map(t=>({key:`${t.type}:${t.id}`,id:t.id,user:t.id,displayName:t.label,type:t.type===o.User?"user":"group",iconSvg:t.type===o.Group?C:void 0}))},set(t){this.selectedCollaboratorsKeys=t.map(({key:e})=>e)}},isPublicLinkSelected(){return this.selectedCollaboratorsKeys.includes(`${o.Link}`)},publicLink(){return this.availableCollaborators[o.Link]},publicLinkURL(){return`${window.location.protocol}//${window.location.host}${B(`apps/photos/public/${this.publicLink.id}`)}`},albumFileName(){return this.$store.getters.getAlbumName(this.albumName)}},watch:{collaborators(t){this.populateCollaborators(t)}},mounted(){this.populateCollaborators(this.collaborators)},methods:{async searchCollaborators(t){if(t===void 0||(t=t.trim(),t.length{switch(l.source){case"users":return{id:l.id,label:l.label,type:o.User};case"groups":return{id:l.id,label:l.label,type:o.Group};default:throw new Error(`Invalid collaborator source ${l.source}`)}}),this.availableCollaborators={...this.availableCollaborators,...this.currentSearchResults.reduce(this.indexCollaborators,{})}}catch(a){if(e!==this.searchSequence)return;this.errorFetchingCollaborators=a,u.error(this.t("photos","Failed to fetch collaborators list."),{error:a}),c(this.t("photos","Failed to fetch collaborators list."))}finally{e===this.searchSequence&&(this.loadingCollaborators=!1)}},populateCollaborators(t){const e=t.reduce(this.indexCollaborators,{});this.selectedCollaboratorsKeys=Object.keys(e),this.availableCollaborators={3:{id:"",label:this.t("photos","Public link"),type:o.Link},...this.availableCollaborators,...e}},indexCollaborators(t,e){return{...t,[`${e.type}${e.type===o.Link?"":":"}${e.type===o.Link?"":e.id}`]:e}},async createPublicLinkForAlbum(){this.selectEntity(`${o.Link}`),await this.updateAlbumCollaborators(),await this.fetchCollection(this.albumFileName,T)},async deletePublicLink(){this.unselectEntity(`${o.Link}`),this.availableCollaborators[3]={id:"",label:this.t("photos","Public link"),type:o.Link},this.publicLinkCopied=!1,await this.updateAlbumCollaborators()},async updateAlbumCollaborators(){try{await this.$store.dispatch("updateCollection",{collectionFileName:this.albumFileName,properties:{collaborators:this.selectedCollaborators}})}catch(t){u.error("[PublicAlbumContent] Error updating album",{error:t}),c(this.t("photos","Failed to update album."))}},async copyPublicLink(){await navigator.clipboard.writeText(this.publicLinkURL),this.publicLinkCopied=!0,setTimeout(()=>{this.publicLinkCopied=!1},1e4)},selectEntity(t){this.selectedCollaboratorsKeys.includes(t)||this.selectedCollaboratorsKeys.push(t)},unselectEntity(t){const e=this.selectedCollaboratorsKeys.indexOf(t);e!==-1&&this.selectedCollaboratorsKeys.splice(e,1)},t:s}};var mt=function(){var t=this,e=t._self._c;return e("div",{staticClass:"manage-collaborators"},[e("h2",{staticClass:"manage-collaborators__title"},[t._v(" "+t._s(t.t("photos","Add collaborators"))+" ")]),e("form",{staticClass:"manage-collaborators__form",on:{submit:function(a){a.preventDefault()}}},[e("NcSelectUsers",{attrs:{"input-id":"sharing-search-input","input-label":t.t("photos","Add people or groups who can edit your album"),loading:t.loadingCollaborators,label:"label",filterable:!1,placeholder:t.t("photos","Search people or groups"),"clear-search-on-blur":()=>!1,multiple:!0,"append-to-body":!1,options:t.searchResults},on:{search:t.searchCollaborators,"option:selected":({key:a})=>t.selectEntity(a)},model:{value:t.selectedUsers,callback:function(a){t.selectedUsers=a},expression:"selectedUsers"}},[t._v(" "+t._s(t.t("photos","No recommendations. Start typing."))+" ")])],1),e("div",{staticClass:"actions"},[t.allowPublicLink?e("div",{staticClass:"actions__public-link"},[t.isPublicLinkSelected&&t.publicLink.id!==""?[e("NcButton",{staticClass:"manage-collaborators__public-link-button",attrs:{"aria-label":t.t("photos","Copy the public link"),title:t.publicLinkURL},on:{click:t.copyPublicLink},scopedSlots:t._u([{key:"icon",fn:function(){return[t.publicLinkCopied?e("Check"):e("ContentCopy")]},proxy:!0}],null,!1,845538853)},[t.publicLinkCopied?[t._v(" "+t._s(t.t("photos","Public link copied!"))+" ")]:[t._v(" "+t._s(t.t("photos","Copy public link"))+" ")]],2),e("NcButton",{attrs:{variant:"tertiary","aria-label":t.t("photos","Delete the public link")},on:{click:t.deletePublicLink}},[e("Close",{attrs:{slot:"icon"},slot:"icon"})],1)]:e("NcButton",{staticClass:"manage-collaborators__public-link-button",attrs:{disabled:t.isPublicLinkSelected&&t.publicLink.id==="","aria-label":t.t("photos","Create public link share")},on:{click:t.createPublicLinkForAlbum}},[e("Earth",{attrs:{slot:"icon"},slot:"icon"}),t._v(" "+t._s(t.t("photos","Share via public link"))+" ")],1)],2):t._e(),e("div",{staticClass:"actions__slot"},[t._t("default",null,{collaborators:t.selectedCollaborators})],2)])])},ft=[],Ct=k(bt,mt,ft,!1,null,"beb979f1");const yt=Ct.exports,gt={name:"AlbumForm",components:{MapMarkerOutline:at,AccountMultiplePlusOutline:et,SendOutline:tt,NcButton:g,NcLoadingIcon:R,NcTextField:Y,CollaboratorsSelectionForm:yt,PhotosFiltersInput:H,PhotosFiltersDisplay:G},props:{album:{type:Object,default:null},filtersValue:{type:Object,default:()=>({})},displayBackButton:{type:Boolean,default:!1}},data(){return{showCollaboratorView:!1,albumName:"",albumLocation:"",albumFilters:J.reduce((t,e)=>({...t,[e.id]:[]}),{}),loading:!1}},computed:{editMode(){return this.album!==null},sharingEnabled(){return OC.Share!==void 0},albumFileName(){return this.$store.getters.getAlbumName(this.albumName)},albumNameValidationError(){const t=this.$store.getters.albums[this.albumFileName];if(t!==void 0&&this.album!==t&&!this.loading)return s("files","This name is already in use.");try{S(this.albumName)}catch(e){if(!(e instanceof _))throw e;switch(e.reason){case d.Character:return s("files",'"{char}" is not allowed inside a filename.',{char:e.segment});case d.ReservedName:return;case d.Extension:return;default:return s("files","Invalid filename.")}}},canSubmit(){return this.albumName!==""&&this.albumNameValidationError===void 0&&!this.loading}},mounted(){this.editMode?(this.albumName=this.album?.basename,this.albumLocation=this.album?.attributes.location??"",this.albumFilters={...this.albumFilters,...structuredClone(this.album?.attributes.filters??{})}):this.albumFilters={...this.albumFilters,...structuredClone(this.filtersValue)},this.$nextTick(()=>{this.$refs.nameInput.$el.getElementsByTagName("input")[0].focus()})},methods:{submit(t=[]){this.canSubmit&&(this.editMode?this.handleUpdateAlbum():this.handleCreateAlbum(t))},async handleCreateAlbum(t=[]){try{this.loading=!0;const e=I({basename:this.albumName,filename:f+"/"+this.albumName,lastmod:"",size:0,type:"directory",etag:null,props:{displayname:this.albumName,resourcetype:{},nbItems:0,location:this.albumLocation,"last-photo":-1,date:K().format("MMMM YYYY"),collaborators:t,filters:this.filtersValue,source:M(`dav/${this.albumFileName}`)}},f);let a=await this.$store.dispatch("createCollection",{collection:e});if(a===void 0)return;const l={};this.albumLocation!==""&&(l.location=this.albumLocation),(this.albumLocation!==""||t.length!==0)&&(l.collaborators=t),Object.keys(this.filtersValue).length>0&&(l.filters=this.filtersValue),a=await this.$store.dispatch("updateCollection",{collectionFileName:this.albumFileName,properties:l}),this.$emit("done",{album:a})}finally{this.loading=!1}},async handleUpdateAlbum(){try{this.loading=!0;let t=this.album?.clone();const e=[];if(this.album!==null&&this.album.basename!==this.albumName&&(e.push("name"),t=await this.$store.dispatch("renameCollection",{collectionFileName:this.album.root+this.album.path,newBaseName:this.albumName}),t===this.album))return;this.album!==null&&this.album.attributes.location!==this.albumLocation&&(e.push("location"),t=await this.$store.dispatch("updateCollection",{collectionFileName:t.root+t.path,properties:{location:this.albumLocation}})),this.album!==null&&JSON.stringify(this.album.attributes.filters)!==JSON.stringify(this.albumFilters)&&(e.push("filters"),t=await this.$store.dispatch("updateCollection",{collectionFileName:t.root+t.path,properties:{filters:this.albumFilters}})),this.$emit("done",{album:t,changes:e})}finally{this.loading=!1}},selectFilter(t){this.albumFilters[t.filterId].push(t.value)},deselectFilter(t){const e=this.albumFilters[t.filterId].indexOf(t.value);e!==-1&&this.albumFilters[t.filterId].splice(e,1)},back(){this.$emit("back")},t:s}};var kt=function(){var t=this,e=t._self._c;return t.showCollaboratorView?e("CollaboratorsSelectionForm",{attrs:{"album-name":t.albumName,"allow-public-link":!1},scopedSlots:t._u([{key:"default",fn:function({collaborators:a}){return[e("span",{staticClass:"left-buttons"},[e("NcButton",{attrs:{variant:"tertiary"},on:{click:function(l){t.showCollaboratorView=!1}}},[t._v(" "+t._s(t.t("photos","Back"))+" ")])],1),e("span",{staticClass:"right-buttons"},[e("NcButton",{attrs:{variant:"primary",disabled:!t.canSubmit},on:{click:function(l){return t.submit(a)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon",{attrs:{size:20}}):e("SendOutline",{attrs:{size:20}})]},proxy:!0}],null,!0)},[t._v(" "+t._s(t.editMode?t.t("photos","Save"):t.t("photos","Create album"))+" ")])],1)]}}])}):e("form",{staticClass:"album-form",on:{submit:function(a){return a.preventDefault(),t.submit()}}},[e("div",{staticClass:"form-inputs"},[e("NcTextField",{ref:"nameInput",attrs:{type:"text",name:"name","helper-text":t.albumNameValidationError,error:t.albumNameValidationError!==void 0,required:!0,label:t.t("photos","Name of the album")},model:{value:t.albumName,callback:function(a){t.albumName=typeof a=="string"?a.trim():a},expression:"albumName"}}),e("NcTextField",{attrs:{name:"location",type:"text",label:t.t("photos","Location of the album")},scopedSlots:t._u([{key:"default",fn:function(){return[e("MapMarkerOutline",{attrs:{size:20}})]},proxy:!0}],null,!1,3863723734),model:{value:t.albumLocation,callback:function(a){t.albumLocation=a},expression:"albumLocation"}})],1),e("PhotosFiltersInput",{attrs:{"selected-filters":t.albumFilters},on:{"select-filter":t.selectFilter}}),e("PhotosFiltersDisplay",{attrs:{"selected-filters":t.albumFilters},on:{"deselect-filter":t.deselectFilter}}),e("div",{staticClass:"form-buttons"},[e("span",{staticClass:"left-buttons"},[t.displayBackButton?e("NcButton",{attrs:{variant:"tertiary"},on:{click:t.back}},[t._v(" "+t._s(t.t("photos","Back"))+" ")]):t._e()],1),e("span",{staticClass:"right-buttons"},[t.sharingEnabled&&!t.editMode?e("NcButton",{attrs:{variant:"secondary",disabled:!t.canSubmit},on:{click:function(a){t.showCollaboratorView=!0}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("AccountMultiplePlusOutline",{attrs:{size:20}})]},proxy:!0}],null,!1,1381680579)},[t._v(" "+t._s(t.t("photos","Add collaborators"))+" ")]):t._e(),e("NcButton",{attrs:{variant:"primary",disabled:!t.canSubmit},on:{click:function(a){return t.submit()}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?e("NcLoadingIcon",{attrs:{size:20}}):e("SendOutline",{attrs:{size:20}})]},proxy:!0}],null,!1,2348760288)},[t._v(" "+t._s(t.editMode?t.t("photos","Save"):t.t("photos","Create album"))+" ")])],1)])],1)},Nt=[],vt=k(gt,kt,Nt,!1,null,"546e550b");const It=vt.exports;export{It as A,yt as C,pt as F}; +//# sourceMappingURL=AlbumForm-CJumwUvV.chunk.mjs.map diff --git a/js/AlbumForm-okviGw24.chunk.mjs.license b/js/AlbumForm-CJumwUvV.chunk.mjs.license similarity index 100% rename from js/AlbumForm-okviGw24.chunk.mjs.license rename to js/AlbumForm-CJumwUvV.chunk.mjs.license diff --git a/js/AlbumForm-okviGw24.chunk.mjs.map b/js/AlbumForm-CJumwUvV.chunk.mjs.map similarity index 99% rename from js/AlbumForm-okviGw24.chunk.mjs.map rename to js/AlbumForm-CJumwUvV.chunk.mjs.map index e19ebd5b28..190bf53a83 100644 --- a/js/AlbumForm-okviGw24.chunk.mjs.map +++ b/js/AlbumForm-CJumwUvV.chunk.mjs.map @@ -1 +1 @@ -{"version":3,"file":"AlbumForm-okviGw24.chunk.mjs","sources":["../node_modules/@mdi/svg/svg/account-group-outline.svg","../node_modules/@nextcloud/vue/dist/chunks/NcSelectUsers-D2jOjPs4.mjs","../src/mixins/FetchCollectionContentMixin.ts","../src/components/Albums/CollaboratorsSelectionForm.vue","../src/components/Albums/AlbumForm.vue"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20id='mdi-account-group-outline'%20viewBox='0%200%2024%2024'%3e%3cpath%20d='M12,5A3.5,3.5%200%200,0%208.5,8.5A3.5,3.5%200%200,0%2012,12A3.5,3.5%200%200,0%2015.5,8.5A3.5,3.5%200%200,0%2012,5M12,7A1.5,1.5%200%200,1%2013.5,8.5A1.5,1.5%200%200,1%2012,10A1.5,1.5%200%200,1%2010.5,8.5A1.5,1.5%200%200,1%2012,7M5.5,8A2.5,2.5%200%200,0%203,10.5C3,11.44%203.53,12.25%204.29,12.68C4.65,12.88%205.06,13%205.5,13C5.94,13%206.35,12.88%206.71,12.68C7.08,12.47%207.39,12.17%207.62,11.81C6.89,10.86%206.5,9.7%206.5,8.5C6.5,8.41%206.5,8.31%206.5,8.22C6.2,8.08%205.86,8%205.5,8M18.5,8C18.14,8%2017.8,8.08%2017.5,8.22C17.5,8.31%2017.5,8.41%2017.5,8.5C17.5,9.7%2017.11,10.86%2016.38,11.81C16.5,12%2016.63,12.15%2016.78,12.3C16.94,12.45%2017.1,12.58%2017.29,12.68C17.65,12.88%2018.06,13%2018.5,13C18.94,13%2019.35,12.88%2019.71,12.68C20.47,12.25%2021,11.44%2021,10.5A2.5,2.5%200%200,0%2018.5,8M12,14C9.66,14%205,15.17%205,17.5V19H19V17.5C19,15.17%2014.34,14%2012,14M4.71,14.55C2.78,14.78%200,15.76%200,17.5V19H3V17.07C3,16.06%203.69,15.22%204.71,14.55M19.29,14.55C20.31,15.22%2021,16.06%2021,17.07V19H24V17.5C24,15.76%2021.22,14.78%2019.29,14.55M12,16C13.53,16%2015.24,16.5%2016.23,17H7.77C8.76,16.5%2010.47,16%2012,16Z'%20/%3e%3c/svg%3e\"","import '../assets/NcSelectUsers-BDh2CSCJ.css';\nimport { defineComponent, ref, watch } from \"vue\";\nimport { N as NcListItemIcon } from \"./NcListItemIcon-DIecVacf.mjs\";\nimport { N as NcSelect } from \"./NcSelect-CxHfXvZV.mjs\";\nimport { r as register, x as t47, h as t17, a as t } from \"./_l10n-CAnZaLWU.mjs\";\nimport { G as GenRandomId } from \"./GenRandomId-F5ebeBB_.mjs\";\nimport { n as normalizeComponent } from \"./_plugin-vue2_normalizer-DU4iP6Vu.mjs\";\nregister(t17, t47);\nconst __default__ = {\n model: {\n prop: \"modelValue\",\n event: \"update:modelValue\"\n }\n};\nconst _sfc_main = /* @__PURE__ */ defineComponent({\n ...__default__,\n __name: \"NcSelectUsers\",\n props: {\n /**\n * `aria-label` for the clear input button\n */\n ariaLabelClearSelected: {\n type: String,\n default: t(\"Clear selected\")\n },\n /**\n * `aria-label` for the listbox element\n */\n ariaLabelListbox: {\n type: String,\n default: t(\"Options\")\n },\n /**\n * Allows to customize the `aria-label` for the deselect-option button\n * The default is \"Deselect \" + optionLabel\n */\n ariaLabelDeselectOption: {\n type: Function,\n default: (optionLabel) => t(\"Deselect {option}\", { option: optionLabel })\n },\n /**\n * Keep the dropdown open after selecting an entry.\n */\n keepOpen: {\n type: Boolean,\n default: false\n },\n /**\n * Disable the component\n */\n disabled: {\n type: Boolean,\n default: false\n },\n /**\n * Callback to determine if the provided option should match the current search text.\n * Used to determine if the option should be displayed.\n *\n * By default it filters by the `displayName` and `subname` properties of the user\n * option object unless this prop is set explicitly\n */\n filterBy: {\n type: Function,\n default: null\n },\n /**\n * Input element id\n */\n inputId: {\n type: String,\n default: () => GenRandomId()\n },\n /**\n * Visible label for the input element\n *\n * @default 'Select account'\n */\n inputLabel: {\n type: String,\n default: t(\"Select account\")\n },\n /**\n * Pass true if you are using an external label.\n * In this case make sure you set the `for` attribute of your `