photos/js/photos-src_mixins_FetchAlbu...

3 lines
23 KiB
JavaScript

/*! For license information please see photos-src_mixins_FetchAlbumsMixin_js-src_components_Albums_AlbumForm_vue.js.LICENSE.txt */
"use strict";(self.webpackChunkphotos=self.webpackChunkphotos||[]).push([["src_mixins_FetchAlbumsMixin_js-src_components_Albums_AlbumForm_vue"],{12945:(t,a,o)=>{o.d(a,{Z:()=>r});var l=o(20629),n=o(45994),e=o(69363),i=o(99622);const r={name:"FetchAlbumsMixin",data:()=>({errorFetchingAlbums:null,loadingAlbums:!1}),mixins:[e.Z],async beforeMount(){this.fetchAlbums()},computed:{...(0,l.Se)(["albums"])},methods:{...(0,l.nv)(["addAlbums"]),async fetchAlbums(){if(!this.loadingAlbums)try{var t;this.loadingAlbums=!0,this.errorFetchingAlbums=null;const a=await(0,i.CE)("/photos/".concat(null===(t=(0,n.ts)())||void 0===t?void 0:t.uid,"/albums"),this.abortController.signal);this.addAlbums({albums:a})}catch(t){var a;404===(null===(a=t.response)||void 0===a?void 0:a.status)?this.errorFetchingAlbums=404:this.errorFetchingAlbums=t}finally{this.loadingAlbums=!1}}}}},17522:(t,a,o)=>{o.d(a,{Z:()=>r});var l=o(87537),n=o.n(l),e=o(23645),i=o.n(e)()(n());i.push([t.id,".album-form[data-v-979616f8]{display:flex;flex-direction:column;height:350px;padding:16px}.album-form .form-title[data-v-979616f8]{font-weight:bold}.album-form .form-subtitle[data-v-979616f8]{color:var(--color-text-lighter)}.album-form .form-inputs[data-v-979616f8]{flex-grow:1;justify-items:flex-end}.album-form .form-inputs input[data-v-979616f8]{width:100%}.album-form .form-inputs label[data-v-979616f8]{display:flex;margin-top:16px}.album-form .form-inputs label[data-v-979616f8] .material-design-icon{align-self:flex-end;margin-right:12px;margin-bottom:6px}.album-form .form-buttons[data-v-979616f8]{display:flex;justify-content:space-between}.album-form .form-buttons .left-buttons[data-v-979616f8],.album-form .form-buttons .right-buttons[data-v-979616f8]{display:flex}.album-form .form-buttons .right-buttons[data-v-979616f8]{justify-content:flex-end}.album-form .form-buttons button[data-v-979616f8]{margin-right:16px}.left-buttons[data-v-979616f8]{flex-grow:1}","",{version:3,sources:["webpack://./src/components/Albums/AlbumForm.vue"],names:[],mappings:"AAEA,6BACC,YAAA,CACA,qBAAA,CACA,YAAA,CACA,YAAA,CAEA,yCACC,gBAAA,CAGD,4CACC,+BAAA,CAGD,0CACC,WAAA,CACA,sBAAA,CAEA,gDACC,UAAA,CAGD,gDACC,YAAA,CACA,eAAA,CAGC,sEACC,mBAAA,CACA,iBAAA,CACA,iBAAA,CAMJ,2CACC,YAAA,CACA,6BAAA,CAEA,mHACC,YAAA,CAGD,0DACC,wBAAA,CAGD,kDACC,iBAAA,CAKH,+BACC,WAAA",sourcesContent:['$sizes: ("400": ("count": 3, "marginTop": 66, "marginW": 8), "700": ("count": 4, "marginTop": 66, "marginW": 8), "1024": ("count": 5, "marginTop": 66, "marginW": 44), "1280": ("count": 4, "marginTop": 66, "marginW": 44), "1440": ("count": 5, "marginTop": 88, "marginW": 66), "1600": ("count": 6, "marginTop": 88, "marginW": 66), "2048": ("count": 7, "marginTop": 88, "marginW": 66), "2560": ("count": 8, "marginTop": 88, "marginW": 88), "3440": ("count": 9, "marginTop": 88, "marginW": 88), "max": ("count": 10, "marginTop": 88, "marginW": 88));\n\n.album-form {\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 350px;\n\tpadding: 16px;\n\n\t.form-title {\n\t\tfont-weight: bold;\n\t}\n\n\t.form-subtitle {\n\t\tcolor: var(--color-text-lighter);\n\t}\n\n\t.form-inputs {\n\t\tflex-grow: 1;\n\t\tjustify-items: flex-end;\n\n\t\tinput {\n\t\t\twidth: 100%;\n\t\t}\n\n\t\tlabel {\n\t\t\tdisplay: flex;\n\t\t\tmargin-top: 16px;\n\n\t\t\t:deep {\n\t\t\t\t.material-design-icon {\n\t\t\t\t\talign-self: flex-end;\n\t\t\t\t\tmargin-right: 12px;\n\t\t\t\t\tmargin-bottom: 6px;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t.form-buttons {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\n\t\t.left-buttons, .right-buttons {\n\t\t\tdisplay: flex;\n\t\t}\n\n\t\t.right-buttons {\n\t\t\tjustify-content: flex-end;\n\t\t}\n\n\t\tbutton {\n\t\t\tmargin-right: 16px;\n\t\t}\n\t}\n}\n\n.left-buttons {\n\tflex-grow: 1;\n}\n'],sourceRoot:""}]);const r=i},60950:(t,a,o)=>{o.d(a,{Z:()=>r});var l=o(87537),n=o.n(l),e=o(23645),i=o.n(e)()(n());i.push([t.id,".manage-collaborators[data-v-7c29199c]{display:flex;flex-direction:column;padding:20px;height:500px}.manage-collaborators__title[data-v-7c29199c]{font-weight:bold}.manage-collaborators__subtitle[data-v-7c29199c]{color:var(--color-text-lighter)}.manage-collaborators__public-link-button[data-v-7c29199c]{margin:4px 0}.manage-collaborators__form[data-v-7c29199c]{margin-top:4px 0;display:flex;flex-direction:column}.manage-collaborators__form__input[data-v-7c29199c]{position:relative;display:block}.manage-collaborators__form__input input[data-v-7c29199c]{width:100%;padding-left:34px}.manage-collaborators__form__input .loading-icon[data-v-7c29199c]{position:absolute;top:8px;right:8px}.manage-collaborators__form__list[data-v-7c29199c]{padding:8px;height:350px;overflow:scroll}.manage-collaborators__form__list__result[data-v-7c29199c]{padding:8px;border-radius:100px;box-sizing:border-box}.manage-collaborators__form__list__result[data-v-7c29199c],.manage-collaborators__form__list__result *[data-v-7c29199c]{cursor:pointer !important}.manage-collaborators__form__list__result[data-v-7c29199c]:hover{background:var(--color-background-dark)}.manage-collaborators__form__list--empty[data-v-7c29199c]{margin:100px 0}.manage-collaborators__selection[data-v-7c29199c]{display:flex;flex-direction:column;margin-top:8px;flex-grow:1}.manage-collaborators__selection__item[data-v-7c29199c]{border-radius:var(--border-radius-pill);padding:0 8px}.manage-collaborators__selection__item[data-v-7c29199c]:hover{background:var(--color-background-dark)}.manage-collaborators .actions[data-v-7c29199c]{display:flex;margin-top:8px}.manage-collaborators .actions__public-link[data-v-7c29199c]{display:flex;align-items:center}.manage-collaborators .actions__public-link button[data-v-7c29199c]{margin-left:8px}.manage-collaborators .actions__slot[data-v-7c29199c]{flex-grow:1;display:flex;justify-content:flex-end;align-items:center}","",{version:3,sources:["webpack://./src/components/Albums/CollaboratorsSelectionForm.vue"],names:[],mappings:"AAEA,uCACC,YAAA,CACA,qBAAA,CACA,YAAA,CACA,YAAA,CAEA,8CACC,gBAAA,CAGD,iDACC,+BAAA,CAGD,2DACC,YAAA,CAGD,6CACC,gBAAA,CACA,YAAA,CACA,qBAAA,CAEA,oDACC,iBAAA,CACA,aAAA,CAEA,0DACC,UAAA,CACA,iBAAA,CAGD,kEACC,iBAAA,CACA,OAAA,CACA,SAAA,CAIF,mDACC,WAAA,CACA,YAAA,CACA,eAAA,CAEA,2DACC,WAAA,CACA,mBAAA,CACA,qBAAA,CAEA,wHACC,yBAAA,CAGD,iEACC,uCAAA,CAIF,0DACC,cAAA,CAKH,kDACC,YAAA,CACA,qBAAA,CACA,cAAA,CACA,WAAA,CAEA,wDACC,uCAAA,CACA,aAAA,CAEA,8DACC,uCAAA,CAKH,gDACC,YAAA,CACA,cAAA,CAEA,6DACC,YAAA,CACA,kBAAA,CAEA,oEACC,eAAA,CAIF,sDACC,WAAA,CACA,YAAA,CACA,wBAAA,CACA,kBAAA",sourcesContent:['$sizes: ("400": ("count": 3, "marginTop": 66, "marginW": 8), "700": ("count": 4, "marginTop": 66, "marginW": 8), "1024": ("count": 5, "marginTop": 66, "marginW": 44), "1280": ("count": 4, "marginTop": 66, "marginW": 44), "1440": ("count": 5, "marginTop": 88, "marginW": 66), "1600": ("count": 6, "marginTop": 88, "marginW": 66), "2048": ("count": 7, "marginTop": 88, "marginW": 66), "2560": ("count": 8, "marginTop": 88, "marginW": 88), "3440": ("count": 9, "marginTop": 88, "marginW": 88), "max": ("count": 10, "marginTop": 88, "marginW": 88));\n\n.manage-collaborators {\n\tdisplay: flex;\n\tflex-direction: column;\n\tpadding: 20px;\n\theight: 500px;\n\n\t&__title {\n\t\tfont-weight: bold;\n\t}\n\n\t&__subtitle {\n\t\tcolor: var(--color-text-lighter);\n\t}\n\n\t&__public-link-button {\n\t\tmargin: 4px 0;\n\t}\n\n\t&__form {\n\t\tmargin-top: 4px 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\t&__input {\n\t\t\tposition: relative;\n\t\t\tdisplay: block;\n\n\t\t\tinput {\n\t\t\t\twidth: 100%;\n\t\t\t\tpadding-left: 34px;\n\t\t\t}\n\n\t\t\t.loading-icon {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: calc(36px / 2 - 20px / 2);\n\t\t\t\tright: 8px;\n\t\t\t}\n\t\t}\n\n\t\t&__list {\n\t\t\tpadding: 8px;\n\t\t\theight: 350px;\n\t\t\toverflow: scroll;\n\n\t\t\t&__result {\n\t\t\t\tpadding: 8px;\n\t\t\t\tborder-radius: 100px;\n\t\t\t\tbox-sizing: border-box;\n\n\t\t\t\t&, & * {\n\t\t\t\t\tcursor: pointer !important;\n\t\t\t\t}\n\n\t\t\t\t&:hover {\n\t\t\t\t\tbackground: var(--color-background-dark);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t&--empty {\n\t\t\t\tmargin: 100px 0;\n\t\t\t}\n\t\t}\n\t}\n\n\t&__selection {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmargin-top: 8px;\n\t\tflex-grow: 1;\n\n\t\t&__item {\n\t\t\tborder-radius: var(--border-radius-pill);\n\t\t\tpadding: 0 8px;\n\n\t\t\t&:hover {\n\t\t\t\tbackground: var(--color-background-dark);\n\t\t\t}\n\t\t}\n\t}\n\n\t.actions {\n\t\tdisplay: flex;\n\t\tmargin-top: 8px;\n\n\t\t&__public-link {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\n\t\t\tbutton {\n\t\t\t\tmargin-left: 8px;\n\t\t\t}\n\t\t}\n\n\t\t&__slot {\n\t\t\tflex-grow: 1;\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: flex-end;\n\t\t\talign-items: center;\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const r=i},1446:(t,a,o)=>{o.d(a,{Z:()=>N});var l=o(20629),n=o(67983),e=o(59573),i=o(84955),r=o(45994),s=o(15961),c=o(80351),u=o.n(c),b=o(8136);const m={name:"AlbumForm",components:{MapMarker:n.Z,AccountMultiplePlus:e.Z,Send:i.Z,NcButton:s.P2,NcLoadingIcon:s.lb,NcTextField:s.h3,CollaboratorsSelectionForm:b.Z},props:{album:{type:Object,default:null},displayBackButton:{type:Boolean,default:!1}},data:()=>({showCollaboratorView:!1,albumName:"",albumLocation:"",loading:!1}),computed:{editMode(){return null!==this.album},sharingEnabled:()=>void 0!==OC.Share},mounted(){this.editMode&&(this.albumName=this.album.basename,this.albumLocation=this.album.location),this.$nextTick((()=>{this.$refs.nameInput.$el.getElementsByTagName("input")[0].focus()}))},methods:{...(0,l.nv)(["createAlbum","renameAlbum","updateAlbum"]),submit(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];""===this.albumName||this.loading||(this.editMode?this.handleUpdateAlbum():this.handleCreateAlbum(t))},async handleCreateAlbum(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];try{this.loading=!0;let a=await this.createAlbum({album:{basename:this.albumName,filename:"/photos/".concat((0,r.ts)().uid,"/albums/").concat(this.albumName),nbItems:0,location:this.albumLocation,lastPhoto:-1,date:u()().format("MMMM YYYY"),collaborators:t}});""===this.albumLocation&&0===t.length||(a=await this.updateAlbum({albumName:this.albumName,properties:{location:this.albumLocation,collaborators:t}})),this.$emit("done",{album:a})}finally{this.loading=!1}},async handleUpdateAlbum(){try{this.loading=!0;let t={...this.album};this.album.basename!==this.albumName&&(t=await this.renameAlbum({currentAlbumName:this.album.basename,newAlbumName:this.albumName})),this.album.location!==this.albumLocation&&(t.location=await this.updateAlbum({albumName:this.albumName,properties:{location:this.albumLocation}})),this.$emit("done",{album:t})}finally{this.loading=!1}},back(){this.$emit("back")}}};var A=o(93379),d=o.n(A),p=o(7795),h=o.n(p),C=o(90569),g=o.n(C),_=o(3565),f=o.n(_),v=o(19216),y=o.n(v),x=o(44589),k=o.n(x),w=o(17522),E={};E.styleTagTransform=k(),E.setAttributes=f(),E.insert=g().bind(null,"head"),E.domAPI=h(),E.insertStyleElement=y();d()(w.Z,E);w.Z&&w.Z.locals&&w.Z.locals;const N=(0,o(51900).Z)(m,(function(){var t=this,a=t._self._c;return t.showCollaboratorView?a("CollaboratorsSelectionForm",{attrs:{"album-name":t.albumName,"allow-public-link":!1},scopedSlots:t._u([{key:"default",fn:function(o){let{collaborators:l}=o;return[a("span",{staticClass:"left-buttons"},[a("NcButton",{attrs:{"aria-label":t.t("photos","Back to the new album form."),type:"tertiary"},on:{click:function(a){t.showCollaboratorView=!1}}},[t._v("\n\t\t\t\t"+t._s(t.t("photos","Back"))+"\n\t\t\t")])],1),t._v(" "),a("span",{staticClass:"right-buttons"},[a("NcButton",{attrs:{"aria-label":t.editMode?t.t("photos","Save."):t.t("photos","Create the album."),type:"primary",disabled:""===t.albumName.trim()||t.loading},on:{click:function(a){return t.submit(l)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?a("NcLoadingIcon"):a("Send")]},proxy:!0}],null,!0)},[t._v("\n\t\t\t\t"+t._s(t.editMode?t.t("photos","Save"):t.t("photos","Create album"))+"\n\t\t\t")])],1)]}}])}):a("form",{staticClass:"album-form",on:{submit:function(a){return a.preventDefault(),t.submit.apply(null,arguments)}}},[a("div",{staticClass:"form-inputs"},[a("NcTextField",{ref:"nameInput",attrs:{value:t.albumName,type:"text",name:"name",required:!0,autofocus:"true",label:t.t("photos","Name of the album"),"label-visible":!0},on:{"update:value":function(a){t.albumName=a}}}),t._v(" "),a("label",[a("MapMarker"),t._v(" "),a("NcTextField",{attrs:{value:t.albumLocation,name:"location",type:"text",label:t.t("photos","Location of the album"),"label-visible":!0},on:{"update:value":function(a){t.albumLocation=a}}})],1)],1),t._v(" "),a("div",{staticClass:"form-buttons"},[a("span",{staticClass:"left-buttons"},[t.displayBackButton?a("NcButton",{attrs:{"aria-label":t.t("photos","Go back to the previous view."),type:"tertiary"},on:{click:t.back}},[t._v("\n\t\t\t\t"+t._s(t.t("photos","Back"))+"\n\t\t\t")]):t._e()],1),t._v(" "),a("span",{staticClass:"right-buttons"},[t.sharingEnabled&&!t.editMode?a("NcButton",{attrs:{"aria-label":t.t("photos","Go to the add collaborators view."),type:"secondary",disabled:""===t.albumName.trim()||t.loading},on:{click:function(a){t.showCollaboratorView=!0}},scopedSlots:t._u([{key:"icon",fn:function(){return[a("AccountMultiplePlus")]},proxy:!0}],null,!1,1531126728)},[t._v("\n\t\t\t\t"+t._s(t.t("photos","Add collaborators"))+"\n\t\t\t")]):t._e(),t._v(" "),a("NcButton",{attrs:{"aria-label":t.editMode?t.t("photos","Save."):t.t("photos","Create the album."),type:"primary",disabled:""===t.albumName||t.loading},on:{click:function(a){return t.submit()}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading?a("NcLoadingIcon"):a("Send")]},proxy:!0}],null,!1,3914512768)},[t._v("\n\t\t\t\t"+t._s(t.editMode?t.t("photos","Save"):t.t("photos","Create album"))+"\n\t\t\t")])],1)])])}),[],!1,null,"979616f8",null).exports},8136:(a,o,l)=>{l.d(o,{Z:()=>F});var n=l(20629),e=l(20720),i=l(71546),r=l(27448),s=l(37251),c=l(75953),u=l(61705),b=l(26937),m=l(82880),A=l(45994),d=l(79753),p=l(15961),h=l(41922),C=l(59537),g=l(69363),_=l(99622);const f={name:"CollaboratorsSelectionForm",components:{Magnify:e.default,Close:i.default,AccountGroup:c.Z,ContentCopy:s.Z,Check:r.default,Earth:u.Z,NcLoadingIcon:p.lb,NcButton:p.P2,NcListItemIcon:p.Ic,NcTextField:p.h3,NcPopover:p.Fh,NcEmptyContent:p.SL},mixins:[g.Z],props:{albumName:{type:String,required:!0},collaborators:{type:Array,default:()=>[]},allowPublicLink:{type:Boolean,default:!0}},data:()=>({searchText:"",availableCollaborators:{},selectedCollaboratorsKeys:[],currentSearchResults:[],loadingAlbum:!1,errorFetchingAlbum:null,loadingCollaborators:!1,randomId:Math.random().toString().substring(2,10),publicLinkCopied:!1,config:{minSearchStringLength:parseInt(OC.config["sharing.minSearchStringLength"],10)||0}}),computed:{searchResults(){return this.currentSearchResults.filter((t=>{let{id:a}=t;return a!==(0,A.ts)().uid})).map((t=>{let{type:a,id:o}=t;return"".concat(a,":").concat(o)})).filter((t=>!this.selectedCollaboratorsKeys.includes(t)))},listableSelectedCollaboratorsKeys(){return this.selectedCollaboratorsKeys.filter((t=>this.availableCollaborators[t].type!==h.D.SHARE_TYPE_LINK))},selectedCollaborators(){return this.selectedCollaboratorsKeys.map((t=>this.availableCollaborators[t]))},isPublicLinkSelected(){return this.selectedCollaboratorsKeys.includes("".concat(h.D.SHARE_TYPE_LINK))},publicLink(){return this.availableCollaborators[h.D.SHARE_TYPE_LINK]}},watch:{collaborators(t){this.populateCollaborators(t)}},mounted(){this.searchCollaborators(),this.populateCollaborators(this.collaborators)},methods:{...(0,n.nv)(["updateAlbum","addAlbums"]),async searchCollaborators(){this.searchText.length>=1&&this.$refs.popover.$refs.popover.show();try{if(this.searchText.length<this.config.minSearchStringLength)return;this.loadingCollaborators=!0;const t=await b.Z.get((0,d.generateOcsUrl)("core/autocomplete/get"),{params:{search:this.searchText,itemType:"share-recipients",shareTypes:[h.D.SHARE_TYPE_USER,h.D.SHARE_TYPE_GROUP]}});this.currentSearchResults=t.data.ocs.data.map((t=>{switch(t.source){case"users":return{id:t.id,label:t.label,type:h.D.SHARE_TYPE_USER};case"groups":return{id:t.id,label:t.label,type:h.D.SHARE_TYPE_GROUP};default:throw new Error("Invalid collaborator source ".concat(t.source))}})),this.availableCollaborators={...this.availableCollaborators,...this.currentSearchResults.reduce(this.indexCollaborators,{})}}catch(a){this.errorFetchingCollaborators=a,C.Z.error(t("photos","Failed to fetch collaborators list."),a),(0,m.x2)(t("photos","Failed to fetch collaborators list."))}finally{this.loadingCollaborators=!1}},populateCollaborators(a){const o=a.reduce(this.indexCollaborators,{});this.selectedCollaboratorsKeys=Object.keys(o),this.availableCollaborators={3:{id:"",label:t("photos","Public link"),type:h.D.SHARE_TYPE_LINK},...this.availableCollaborators,...o}},indexCollaborators:(t,a)=>({...t,["".concat(a.type).concat(a.type===h.D.SHARE_TYPE_LINK?"":":").concat(a.type===h.D.SHARE_TYPE_LINK?"":a.id)]:a}),async createPublicLinkForAlbum(){this.selectEntity("".concat(h.D.SHARE_TYPE_LINK)),await this.updateAlbumCollaborators();try{this.loadingAlbum=!0,this.errorFetchingAlbum=null;const t=await(0,_.Lz)("/photos/".concat((0,A.ts)().uid,"/albums/").concat(this.albumName),{signal:this.abortController.signal});this.addAlbums({albums:[t]})}catch(a){var t;404===(null===(t=a.response)||void 0===t?void 0:t.status)?this.errorFetchingAlbum=404:this.errorFetchingAlbum=a,C.Z.error("[PublicAlbumContent] Error fetching album",{error:a}),(0,m.x2)(this.t("photos","Failed to fetch album."))}finally{this.loadingAlbum=!1}},async deletePublicLink(){this.unselectEntity("".concat(h.D.SHARE_TYPE_LINK)),this.availableCollaborators[3]={id:"",label:t("photos","Public link"),type:h.D.SHARE_TYPE_LINK},this.publicLinkCopied=!1,await this.updateAlbumCollaborators()},async updateAlbumCollaborators(){try{await this.updateAlbum({albumName:this.albumName,properties:{collaborators:this.selectedCollaborators}})}catch(t){C.Z.error("[PublicAlbumContent] Error updating album",{error:t}),(0,m.x2)(this.t("photos","Failed to update album."))}finally{this.loadingAlbum=!1}},async copyPublicLink(){await navigator.clipboard.writeText("".concat(window.location.protocol,"//").concat(window.location.host).concat((0,d.generateUrl)("apps/photos/public/".concat(this.publicLink.id)))),this.publicLinkCopied=!0,setTimeout((()=>{this.publicLinkCopied=!1}),1e4)},selectEntity(t){this.selectedCollaboratorsKeys.includes(t)||(this.$refs.popover.$refs.popover.hide(),this.selectedCollaboratorsKeys.push(t))},unselectEntity(t){const a=this.selectedCollaboratorsKeys.indexOf(t);-1!==a&&this.selectedCollaboratorsKeys.splice(a,1)}}};var v=l(93379),y=l.n(v),x=l(7795),k=l.n(x),w=l(90569),E=l.n(w),N=l(3565),L=l.n(N),S=l(19216),T=l.n(S),B=l(44589),D=l.n(B),P=l(60950),I={};I.styleTagTransform=D(),I.setAttributes=L(),I.insert=E().bind(null,"head"),I.domAPI=k(),I.insertStyleElement=T();y()(P.Z,I);P.Z&&P.Z.locals&&P.Z.locals;const F=(0,l(51900).Z)(f,(function(){var t=this,a=t._self._c;return a("div",{staticClass:"manage-collaborators"},[a("h2",{staticClass:"manage-collaborators__title"},[t._v("\n\t\t"+t._s(t.t("photos","Add collaborators"))+"\n\t")]),t._v(" "),a("div",{staticClass:"manage-collaborators__subtitle"},[t._v("\n\t\t"+t._s(t.t("photos","Add people or groups who can edit your album"))+"\n\t")]),t._v(" "),a("form",{staticClass:"manage-collaborators__form",on:{submit:function(t){t.preventDefault()}}},[a("NcPopover",{ref:"popover",attrs:{"auto-size":!0,distance:0}},[a("label",{staticClass:"manage-collaborators__form__input",attrs:{slot:"trigger"},slot:"trigger"},[a("NcTextField",{attrs:{value:t.searchText,autocomplete:"off",type:"search",name:"search","aria-label":t.t("photos","Search for collaborators"),"aria-autocomplete":"list","aria-controls":"manage-collaborators__form__selection-".concat(t.randomId," manage-collaborators__form__list-").concat(t.randomId),placeholder:t.t("photos","Search people or groups")},on:{"update:value":function(a){t.searchText=a},input:t.searchCollaborators}},[a("Magnify",{attrs:{size:16}})],1),t._v(" "),t.loadingCollaborators?a("NcLoadingIcon"):t._e()],1),t._v(" "),0!==t.searchResults.length?a("ul",{staticClass:"manage-collaborators__form__list",attrs:{id:"manage-collaborators__form__list-".concat(t.randomId)}},t._l(t.searchResults,(function(o){return a("li",{key:o},[a("NcListItemIcon",{staticClass:"manage-collaborators__form__list__result",attrs:{id:t.availableCollaborators[o].id,title:t.availableCollaborators[o].label,search:t.searchText,user:t.availableCollaborators[o].id,"display-name":t.availableCollaborators[o].label,"aria-label":t.t("photos","Add {collaboratorLabel} to the collaborators list",{collaboratorLabel:t.availableCollaborators[o].label}),tabindex:"0"},on:{click:function(a){return t.selectEntity(o)}}})],1)})),0):a("NcEmptyContent",{key:"emptycontent",staticClass:"manage-collaborators__form__list--empty",attrs:{title:t.t("photos","No collaborators available")}},[a("AccountGroup",{attrs:{slot:"icon"},slot:"icon"})],1)],1)],1),t._v(" "),a("ul",{staticClass:"manage-collaborators__selection"},t._l(t.listableSelectedCollaboratorsKeys,(function(o){return a("li",{key:o,staticClass:"manage-collaborators__selection__item"},[a("NcListItemIcon",{attrs:{id:t.availableCollaborators[o].id,"display-name":t.availableCollaborators[o].label,title:t.availableCollaborators[o].label,user:t.availableCollaborators[o].id}},[a("NcButton",{attrs:{type:"tertiary","aria-label":t.t("photos","Remove {collaboratorLabel} from the collaborators list",{collaboratorLabel:t.availableCollaborators[o].label})},on:{click:function(a){return t.unselectEntity(o)}}},[a("Close",{attrs:{slot:"icon",size:20},slot:"icon"})],1)],1)],1)})),0),t._v(" "),a("div",{staticClass:"actions"},[t.allowPublicLink?a("div",{staticClass:"actions__public-link"},[t.isPublicLinkSelected?[a("NcButton",{staticClass:"manage-collaborators__public-link-button",attrs:{"aria-label":t.t("photos","Copy the public link"),disabled:""===t.publicLink.id},on:{click:t.copyPublicLink},scopedSlots:t._u([{key:"icon",fn:function(){return[t.publicLinkCopied?a("Check"):a("ContentCopy")]},proxy:!0}],null,!1,845538853)},[t.publicLinkCopied?[t._v("\n\t\t\t\t\t\t"+t._s(t.t("photos","Public link copied!"))+"\n\t\t\t\t\t")]:[t._v("\n\t\t\t\t\t\t"+t._s(t.t("photos","Copy public link"))+"\n\t\t\t\t\t")]],2),t._v(" "),a("NcButton",{attrs:{type:"tertiary","aria-label":t.t("photos","Delete the public link"),disabled:""===t.publicLink.id},on:{click:t.deletePublicLink}},[""===t.publicLink.id?a("NcLoadingIcon",{attrs:{slot:"icon"},slot:"icon"}):a("Close",{attrs:{slot:"icon"},slot:"icon"})],1)]:a("NcButton",{staticClass:"manage-collaborators__public-link-button",on:{click:t.createPublicLinkForAlbum}},[a("Earth",{attrs:{slot:"icon"},slot:"icon"}),t._v("\n\t\t\t\t"+t._s(t.t("photos","Share via public link"))+"\n\t\t\t")],1)],2):t._e(),t._v(" "),a("div",{staticClass:"actions__slot"},[t._t("default",null,{collaborators:t.selectedCollaborators})],2)])])}),[],!1,null,"7c29199c",null).exports}}]);
//# sourceMappingURL=photos-src_mixins_FetchAlbumsMixin_js-src_components_Albums_AlbumForm_vue.js.map?v=fe1d30480c5da0b609b1