/*! For license information please see files_sharing-files_sharing_tab.js.LICENSE.txt */ !function(){"use strict";var e,n={25564:function(e,n,r){var i=r(20144),a=r(72268),s=r.n(a),o=r(9944),c=r(1794),l=r(79753),u=r(75925),h=r.n(u),d=r(4820),f=r(79954);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function m(e,t){for(var n=0;nthis.config.minSearchStringLength},options:function(){return this.isValidQuery?this.suggestions:this.recommendations},noResultText:function(){return this.loading?t("files_sharing","Searching …"):t("files_sharing","No elements found.")}},mounted:function(){this.getRecommendations()},methods:{asyncFind:function(e,t){var n=this;return Ae(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n.query=e.trim(),!n.isValidQuery){t.next=5;break}return n.loading=!0,t.next=5,n.debounceGetSuggestions(e);case 5:case"end":return t.stop()}}),t)})))()},getSuggestions:function(e){var n=arguments,r=this;return Ae(regeneratorRuntime.mark((function i(){var a,s,o,c,u,h,f,p,m,g,v,y,_;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return a=n.length>1&&void 0!==n[1]&&n[1],r.loading=!0,!0===OC.getCapabilities().files_sharing.sharee.query_lookup_default&&(a=!0),s=[r.SHARE_TYPES.SHARE_TYPE_USER,r.SHARE_TYPES.SHARE_TYPE_GROUP,r.SHARE_TYPES.SHARE_TYPE_REMOTE,r.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP,r.SHARE_TYPES.SHARE_TYPE_CIRCLE,r.SHARE_TYPES.SHARE_TYPE_ROOM,r.SHARE_TYPES.SHARE_TYPE_GUEST,r.SHARE_TYPES.SHARE_TYPE_DECK],!0===OC.getCapabilities().files_sharing.public.enabled&&s.push(r.SHARE_TYPES.SHARE_TYPE_EMAIL),o=null,i.prev=6,i.next=9,d.default.get((0,l.generateOcsUrl)("apps/files_sharing/api/v1/sharees"),{params:{format:"json",itemType:"dir"===r.fileInfo.type?"folder":"file",search:e,lookup:a,perPage:r.config.maxAutocompleteResults,shareType:s}});case 9:o=i.sent,i.next=16;break;case 12:return i.prev=12,i.t0=i.catch(6),console.error("Error fetching suggestions",i.t0),i.abrupt("return");case 16:c=o.data.ocs.data,u=o.data.ocs.data.exact,c.exact=[],h=Object.values(u).reduce((function(e,t){return e.concat(t)}),[]),f=Object.values(c).reduce((function(e,t){return e.concat(t)}),[]),p=r.filterOutExistingShares(h).map((function(e){return r.formatForMultiselect(e)})).sort((function(e,t){return e.shareType-t.shareType})),m=r.filterOutExistingShares(f).map((function(e){return r.formatForMultiselect(e)})).sort((function(e,t){return e.shareType-t.shareType})),g=[],c.lookupEnabled&&!a&&g.push({id:"global-lookup",isNoUser:!0,displayName:t("files_sharing","Search globally"),lookup:!0}),v=r.externalResults.filter((function(e){return!e.condition||e.condition(r)})),y=p.concat(m).concat(v).concat(g),_=y.reduce((function(e,t){return t.displayName?(e[t.displayName]||(e[t.displayName]=0),e[t.displayName]++,e):e}),{}),r.suggestions=y.map((function(e){return _[e.displayName]>1&&!e.desc?ve(ve({},e),{},{desc:e.shareWithDisplayNameUnique}):e})),r.loading=!1,console.info("suggestions",r.suggestions);case 31:case"end":return i.stop()}}),i,null,[[6,12]])})))()},debounceGetSuggestions:ne()((function(){this.getSuggestions.apply(this,arguments)}),300),getRecommendations:function(){var e=this;return Ae(regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading=!0,n=null,t.prev=2,t.next=5,d.default.get((0,l.generateOcsUrl)("apps/files_sharing/api/v1/sharees_recommended"),{params:{format:"json",itemType:e.fileInfo.type}});case 5:n=t.sent,t.next=12;break;case 8:return t.prev=8,t.t0=t.catch(2),console.error("Error fetching recommendations",t.t0),t.abrupt("return");case 12:r=e.externalResults.filter((function(t){return!t.condition||t.condition(e)})),i=Object.values(n.data.ocs.data.exact).reduce((function(e,t){return e.concat(t)}),[]),e.recommendations=e.filterOutExistingShares(i).map((function(t){return e.formatForMultiselect(t)})).concat(r),e.loading=!1,console.info("recommendations",e.recommendations);case 17:case"end":return t.stop()}}),t,null,[[2,8]])})))()},filterOutExistingShares:function(e){var t=this;return e.reduce((function(e,n){if("object"!==me(n))return e;try{if(n.value.shareType===t.SHARE_TYPES.SHARE_TYPE_USER){if(n.value.shareWith===(0,ee.ts)().uid)return e;if(t.reshare&&n.value.shareWith===t.reshare.owner)return e}if(n.value.shareType===t.SHARE_TYPES.SHARE_TYPE_EMAIL){if(-1!==t.linkShares.map((function(e){return e.shareWith})).indexOf(n.value.shareWith.trim()))return e}else{var r=t.shares.reduce((function(e,t){return e[t.shareWith]=t.type,e}),{}),i=n.value.shareWith.trim();if(i in r&&r[i]===n.value.shareType)return e}e.push(n)}catch(t){return e}return e}),[])},shareTypeToIcon:function(e){switch(e){case this.SHARE_TYPES.SHARE_TYPE_GUEST:return"icon-user";case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:case this.SHARE_TYPES.SHARE_TYPE_GROUP:return"icon-group";case this.SHARE_TYPES.SHARE_TYPE_EMAIL:return"icon-mail";case this.SHARE_TYPES.SHARE_TYPE_CIRCLE:return"icon-circle";case this.SHARE_TYPES.SHARE_TYPE_ROOM:return"icon-room";case this.SHARE_TYPES.SHARE_TYPE_DECK:return"icon-deck";default:return""}},formatForMultiselect:function(e){var n,r;if(e.value.shareType===this.SHARE_TYPES.SHARE_TYPE_USER&&this.config.shouldAlwaysShowUnique)n=null!==(r=e.shareWithDisplayNameUnique)&&void 0!==r?r:"";else if(e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_REMOTE&&e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP||!e.value.server)if(e.value.shareType===this.SHARE_TYPES.SHARE_TYPE_EMAIL)n=e.value.shareWith;else{var i;n=null!==(i=e.shareWithDescription)&&void 0!==i?i:""}else n=t("files_sharing","on {server}",{server:e.value.server});return{id:"".concat(e.value.shareType,"-").concat(e.value.shareWith),shareWith:e.value.shareWith,shareType:e.value.shareType,user:e.uuid||e.value.shareWith,isNoUser:e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_USER,displayName:e.name||e.label,subtitle:n,shareWithDisplayNameUnique:e.shareWithDisplayNameUnique||"",icon:this.shareTypeToIcon(e.value.shareType)}},addShare:function(e){var t=this;return Ae(regeneratorRuntime.mark((function n(){var r,i,a,s,o,c,l,u;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.lookup){n.next=5;break}return n.next=3,t.getSuggestions(t.query,!0);case 3:return t.$nextTick((function(){t.$refs.multiselect.$el.querySelector(".multiselect__input").focus()})),n.abrupt("return",!0);case 5:if(!e.handler){n.next=11;break}return n.next=8,e.handler(t);case 8:return r=n.sent,t.$emit("add:share",new b(r)),n.abrupt("return",!0);case 11:if(t.loading=!0,console.debug("Adding a new share from the input for",e),n.prev=13,o=null,!t.config.enforcePasswordForPublicLink||e.shareType!==t.SHARE_TYPES.SHARE_TYPE_EMAIL){n.next=19;break}return n.next=18,le();case 18:o=n.sent;case 19:return c=(t.fileInfo.path+"/"+t.fileInfo.name).replace("//","/"),n.next=22,t.createShare({path:c,shareType:e.shareType,shareWith:e.shareWith,password:o,permissions:t.fileInfo.sharePermissions&OC.getCapabilities().files_sharing.default_permissions,attributes:JSON.stringify(t.fileInfo.shareAttributes)});case 22:if(l=n.sent,!o){n.next=31;break}return l.newPassword=o,n.next=27,new Promise((function(e){t.$emit("add:share",l,e)}));case 27:n.sent.open=!0,n.next=32;break;case 31:t.$emit("add:share",l);case 32:return null!==(i=t.$refs.multiselect)&&void 0!==i&&null!==(a=i.$refs)&&void 0!==a&&null!==(s=a.VueMultiselect)&&void 0!==s&&s.search&&(t.$refs.multiselect.$refs.VueMultiselect.search=""),n.next=35,t.getRecommendations();case 35:n.next=43;break;case 37:n.prev=37,n.t0=n.catch(13),(u=t.$refs.multiselect.$el.querySelector("input"))&&u.focus(),t.query=e.shareWith,console.error("Error while adding new share",n.t0);case 43:return n.prev=43,t.loading=!1,n.finish(43);case 46:case"end":return n.stop()}}),n,null,[[13,37,43,46]])})))()}}},we=be,Se=r(7440),Ee={};Ee.styleTagTransform=W(),Ee.setAttributes=Y(),Ee.insert=H().bind(null,"head"),Ee.domAPI=I(),Ee.insertStyleElement=M(),N()(Se.Z,Ee),Se.Z&&Se.Z.locals&&Se.Z.locals;var Ce=(0,Z.Z)(we,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"sharing-search"},[t("label",{attrs:{for:"sharing-search-input"}},[e._v(e._s(e.t("files_sharing","Search for share recipients")))]),e._v(" "),t("NcMultiselect",{ref:"multiselect",staticClass:"sharing-search__input",attrs:{id:"sharing-search-input","clear-on-select":!0,disabled:!e.canReshare,"hide-selected":!0,"internal-search":!1,loading:e.loading,options:e.options,placeholder:e.inputPlaceholder,"preselect-first":!0,"preserve-search":!0,searchable:!0,"user-select":!0,"open-direction":"below",label:"displayName","track-by":"id"},on:{"search-change":e.asyncFind,select:e.addShare},scopedSlots:e._u([{key:"noOptions",fn:function(){return[e._v("\n\t\t\t"+e._s(e.t("files_sharing","No recommendations. Start typing."))+"\n\t\t")]},proxy:!0},{key:"noResult",fn:function(){return[e._v("\n\t\t\t"+e._s(e.noResultText)+"\n\t\t")]},proxy:!0}])})],1)}),[],!1,null,null,null).exports,xe=r(45400),ke=r.n(xe),Pe=r(65358),De=r(1162),Te=r.n(De),Re=r(25746);function Ne(e){return Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ne(e)}function Oe(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function Ie(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){Oe(a,r,i,s,o,"next",e)}function o(e){Oe(a,r,i,s,o,"throw",e)}s(void 0)}))}}var Le={mixins:[pe,w],props:{fileInfo:{type:Object,default:function(){},required:!0},share:{type:b,default:null},isUnique:{type:Boolean,default:!0}},data:function(){var e;return{config:new g,errors:{},loading:!1,saving:!1,open:!1,updateQueue:new Re.Z({concurrency:1}),reactiveState:null===(e=this.share)||void 0===e?void 0:e.state}},computed:{hasNote:{get:function(){return""!==this.share.note},set:function(e){this.share.note=e?null:""}},dateTomorrow:function(){return new Date((new Date).setDate((new Date).getDate()+1))},lang:function(){var e=window.dayNamesShort?window.dayNamesShort:["Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."],t=window.monthNamesShort?window.monthNamesShort:["Jan.","Feb.","Mar.","Apr.","May.","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec."];return{formatLocale:{firstDayOfWeek:window.firstDay?window.firstDay:0,monthsShort:t,weekdaysMin:e,weekdaysShort:e},monthFormat:"MMM"}},isShareOwner:function(){return this.share&&this.share.owner===(0,ee.ts)().uid}},methods:{checkShare:function(e){return(!e.password||"string"==typeof e.password&&""!==e.password.trim())&&!(e.expirationDate&&!e.expirationDate.isValid())},parseDateString:function(e){var t;if(e)return new Date(null===(t=e.match(/([0-9]{4}-[0-9]{2}-[0-9]{2})/i))||void 0===t?void 0:t.pop())},formatDateToString:function(e){return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())).toISOString().split("T")[0]},onExpirationChange:function(e){this.share.expireDate=this.formatDateToString(e),this.queueUpdate("expireDate")},onExpirationDisable:function(){this.share.expireDate="",this.queueUpdate("expireDate")},onNoteChange:function(e){this.$set(this.share,"newNote",e.trim())},onNoteSubmit:function(){this.share.newNote&&(this.share.note=this.share.newNote,this.$delete(this.share,"newNote"),(0,S.s$)(t("files_sharing","Share note saved")),this.queueUpdate("note"))},onDelete:function(){var e=this;return Ie(regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,e.loading=!0,e.open=!1,n.next=5,e.deleteShare(e.share.id);case 5:console.debug("Share deleted",e.share.id),r="file"===e.share.itemType?t("files_sharing",'File "{path}" has been unshared',{path:e.share.path}):t("files_sharing",'Folder "{path}" has been unshared',{path:e.share.path}),(0,S.s$)(r),e.$emit("remove:share",e.share),n.next=14;break;case 11:n.prev=11,n.t0=n.catch(0),e.open=!0;case 14:return n.prev=14,e.loading=!1,n.finish(14);case 17:case"end":return n.stop()}}),n,null,[[0,11,14,17]])})))()},queueUpdate:function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r=0&&(e.$delete(e.share,"newPassword"),e.share.passwordExpirationTime=r.password_expiration_time),e.$delete(e.errors,n[0]),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(2),(a=t.t0.message)&&""!==a&&e.onSyncError(n[0],a);case 14:return t.prev=14,e.saving=!1,t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[2,10,14,17]])}))))}console.debug("Updated local share",this.share)}},onSyncError:function(e,t){switch(this.open=!0,e){case"password":case"pending":case"expireDate":case"label":case"note":this.$set(this.errors,e,t);var n=this.$refs[e];if(n){n.$el&&(n=n.$el);var r=n.querySelector(".focusable");r&&r.focus()}break;case"sendPasswordByTalk":this.$set(this.errors,e,t),this.share.sendPasswordByTalk=!this.share.sendPasswordByTalk}},debounceQueueUpdate:ne()((function(e){this.queueUpdate(e)}),500)}},He={name:"SharingEntryInherited",components:{NcActionButton:ke(),NcActionLink:C(),NcActionText:Te(),NcAvatar:h(),SharingEntrySimple:$},mixins:[Le],props:{share:{type:b,required:!0}},computed:{viaFileTargetUrl:function(){return(0,l.generateUrl)("/f/{fileid}",{fileid:this.share.viaFileid})},viaFolderName:function(){return(0,Pe.EZ)(this.share.viaPath)}}},Ue=r(15547),Ye={};Ye.styleTagTransform=W(),Ye.setAttributes=Y(),Ye.insert=H().bind(null,"head"),Ye.domAPI=I(),Ye.insertStyleElement=M(),N()(Ue.Z,Ye),Ue.Z&&Ue.Z.locals&&Ue.Z.locals;var je=(0,Z.Z)(He,(function(){var e=this,t=e._self._c;return t("SharingEntrySimple",{key:e.share.id,staticClass:"sharing-entry__inherited",attrs:{title:e.share.shareWithDisplayName},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.share.shareWith,"display-name":e.share.shareWithDisplayName,"tooltip-message":""}})]},proxy:!0}])},[e._v(" "),t("NcActionText",{attrs:{icon:"icon-user"}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Added by {initiator}",{initiator:e.share.ownerDisplayName}))+"\n\t")]),e._v(" "),e.share.viaPath&&e.share.viaFileid?t("NcActionLink",{attrs:{icon:"icon-folder",href:e.viaFileTargetUrl}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Via “{folder}”",{folder:e.viaFolderName}))+"\n\t")]):e._e(),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t")]):e._e()],1)}),[],!1,null,"2bbe78b4",null),Me=je.exports;function Be(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}var We={name:"SharingInherited",components:{NcActionButton:ke(),SharingEntryInherited:Me,SharingEntrySimple:$},props:{fileInfo:{type:Object,default:function(){},required:!0}},data:function(){return{loaded:!1,loading:!1,showInheritedShares:!1,shares:[]}},computed:{showInheritedSharesIcon:function(){return this.loading?"icon-loading-small":this.showInheritedShares?"icon-triangle-n":"icon-triangle-s"},mainTitle:function(){return t("files_sharing","Others with access")},subTitle:function(){return this.showInheritedShares&&0===this.shares.length?t("files_sharing","No other users with access found"):""},toggleTooltip:function(){return"dir"===this.fileInfo.type?t("files_sharing","Toggle list of others with access to this directory"):t("files_sharing","Toggle list of others with access to this file")},fullPath:function(){return"".concat(this.fileInfo.path,"/").concat(this.fileInfo.name).replace("//","/")}},watch:{fileInfo:function(){this.resetState()}},methods:{toggleInheritedShares:function(){this.showInheritedShares=!this.showInheritedShares,this.showInheritedShares?this.fetchInheritedShares():this.resetState()},fetchInheritedShares:function(){var e,n=this;return(e=regeneratorRuntime.mark((function e(){var r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.loading=!0,e.prev=1,r=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/shares/inherited?format=json&path={path}",{path:n.fullPath}),e.next=5,d.default.get(r);case 5:i=e.sent,n.shares=i.data.ocs.data.map((function(e){return new b(e)})).sort((function(e,t){return t.createdTime-e.createdTime})),console.info(n.shares),n.loaded=!0,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),OC.Notification.showTemporary(t("files_sharing","Unable to fetch inherited shares"),{type:"error"});case 14:return e.prev=14,n.loading=!1,e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})),function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){Be(a,r,i,s,o,"next",e)}function o(e){Be(a,r,i,s,o,"throw",e)}s(void 0)}))})()},resetState:function(){this.loaded=!1,this.loading=!1,this.showInheritedShares=!1,this.shares=[]},removeShare:function(e){var t=this.shares.findIndex((function(t){return t===e}));this.shares.splice(t,1)}}},qe=We,Fe=r(45057),Ze={};Ze.styleTagTransform=W(),Ze.setAttributes=Y(),Ze.insert=H().bind(null,"head"),Ze.domAPI=I(),Ze.insertStyleElement=M(),N()(Fe.Z,Ze),Fe.Z&&Fe.Z.locals&&Fe.Z.locals;var $e=(0,Z.Z)(qe,(function(){var e=this,t=e._self._c;return t("ul",{attrs:{id:"sharing-inherited-shares"}},[t("SharingEntrySimple",{staticClass:"sharing-entry__inherited",attrs:{title:e.mainTitle,subtitle:e.subTitle,"aria-expanded":e.showInheritedShares},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("div",{staticClass:"avatar-shared icon-more-white"})]},proxy:!0}])},[e._v(" "),t("NcActionButton",{attrs:{icon:e.showInheritedSharesIcon,"aria-label":e.mainTitle},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.toggleInheritedShares.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.toggleTooltip)+"\n\t\t")])],1),e._v(" "),e._l(e.shares,(function(n){return t("SharingEntryInherited",{key:n.id,attrs:{"file-info":e.fileInfo,share:n},on:{"remove:share":e.removeShare}})}))],2)}),[],!1,null,"2d3dafb9",null),Ge=$e.exports,Ve=r(81807),Ke=r.n(Ve),Qe=r(79570),ze=r.n(Qe),Je=r(875),Xe=r.n(Je),et=r(18074),tt=r.n(et),nt={name:"ExternalShareAction",props:{id:{type:String,required:!0},action:{type:Object,default:function(){return{}}},fileInfo:{type:Object,default:function(){},required:!0},share:{type:b,default:null}},computed:{data:function(){return this.action.data(this)}}},rt=(0,Z.Z)(nt,(function(){var e=this;return(0,e._self._c)(e.data.is,e._g(e._b({tag:"Component"},"Component",e.data,!1),e.action.handlers),[e._v("\n\t"+e._s(e.data.text)+"\n")])}),[],!1,null,null,null).exports,it=r(30158),at=r.n(it),st={NONE:0,READ:1,UPDATE:2,CREATE:4,DELETE:8,SHARE:16},ot={READ_ONLY:st.READ,UPLOAD_AND_UPDATE:st.READ|st.UPDATE|st.CREATE|st.DELETE,FILE_DROP:st.CREATE,ALL:st.UPDATE|st.CREATE|st.READ|st.DELETE|st.SHARE};function ct(e,t){return e!==st.NONE&&(e&t)===t}function lt(e){return!(!ct(e,st.READ)&&!ct(e,st.CREATE)||!ct(e,st.READ)&&(ct(e,st.UPDATE)||ct(e,st.DELETE)))}function ut(e,t){return ct(e,t)?function(e,t){return e&~t}(e,t):function(e,t){return e|t}(e,t)}var ht=r(55976),dt=r(32964),ft={name:"SharePermissionsEditor",components:{NcActionButton:ke(),NcActionCheckbox:Ke(),NcActionRadio:at(),Tune:ht.Z,ChevronLeft:dt.default},mixins:[Le],data:function(){return{randomFormName:Math.random().toString(27).substring(2),showCustomPermissionsForm:!1,atomicPermissions:st,bundledPermissions:ot}},computed:{sharePermissionsSummary:function(){var e=this;return Object.values(this.atomicPermissions).filter((function(t){return e.shareHasPermissions(t)})).map((function(t){switch(t){case e.atomicPermissions.CREATE:return e.t("files_sharing","Upload");case e.atomicPermissions.READ:return e.t("files_sharing","Read");case e.atomicPermissions.UPDATE:return e.t("files_sharing","Edit");case e.atomicPermissions.DELETE:return e.t("files_sharing","Delete");default:return null}})).filter((function(e){return null!==e})).join(", ")},sharePermissionsIsBundle:function(){var e=this;return Object.values(ot).map((function(t){return e.sharePermissionEqual(t)})).filter((function(e){return e})).length>0},sharePermissionsSetIsValid:function(){return lt(this.share.permissions)},isFolder:function(){return"dir"===this.fileInfo.type},fileHasCreatePermission:function(){return!!(this.fileInfo.permissions&st.CREATE)}},mounted:function(){this.showCustomPermissionsForm=!this.sharePermissionsIsBundle},methods:{sharePermissionEqual:function(e){return(this.share.permissions&~st.SHARE)===e},shareHasPermissions:function(e){return ct(this.share.permissions,e)},setSharePermissions:function(e){this.share.permissions=e,this.queueUpdate("permissions")},canToggleSharePermissions:function(e){return function(e,t){return lt(ut(e,t))}(this.share.permissions,e)},toggleSharePermissions:function(e){this.share.permissions=ut(this.share.permissions,e),lt(this.share.permissions)&&this.queueUpdate("permissions")}}},pt=r(73286),mt={};mt.styleTagTransform=W(),mt.setAttributes=Y(),mt.insert=H().bind(null,"head"),mt.domAPI=I(),mt.insertStyleElement=M(),N()(pt.Z,mt),pt.Z&&pt.Z.locals&&pt.Z.locals;var gt=(0,Z.Z)(ft,(function(){var e=this,t=e._self._c;return t("li",[t("ul",[e.isFolder?e._e():t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.UPDATE),disabled:e.saving},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.UPDATE)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Allow editing"))+"\n\t\t")]),e._v(" "),e.isFolder&&e.fileHasCreatePermission&&e.config.isPublicUploadEnabled?[e.showCustomPermissionsForm?t("span",{class:{error:!e.sharePermissionsSetIsValid}},[t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.READ),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.READ)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.READ)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Read"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.CREATE),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.CREATE)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.CREATE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Upload"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.UPDATE),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.UPDATE)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.UPDATE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Edit"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.shareHasPermissions(e.atomicPermissions.DELETE),disabled:e.saving||!e.canToggleSharePermissions(e.atomicPermissions.DELETE)},on:{"update:checked":function(t){return e.toggleSharePermissions(e.atomicPermissions.DELETE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Delete"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{on:{click:function(t){e.showCustomPermissionsForm=!1}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("ChevronLeft")]},proxy:!0}],null,!1,1018742195)},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Bundled permissions"))+"\n\t\t\t\t")])],1):[t("NcActionRadio",{attrs:{checked:e.sharePermissionEqual(e.bundledPermissions.READ_ONLY),value:e.bundledPermissions.READ_ONLY,name:e.randomFormName,disabled:e.saving},on:{change:function(t){return e.setSharePermissions(e.bundledPermissions.READ_ONLY)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Read only"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionRadio",{attrs:{checked:e.sharePermissionEqual(e.bundledPermissions.UPLOAD_AND_UPDATE),value:e.bundledPermissions.UPLOAD_AND_UPDATE,disabled:e.saving,name:e.randomFormName},on:{change:function(t){return e.setSharePermissions(e.bundledPermissions.UPLOAD_AND_UPDATE)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Allow upload and editing"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionRadio",{staticClass:"sharing-entry__action--public-upload",attrs:{checked:e.sharePermissionEqual(e.bundledPermissions.FILE_DROP),value:e.bundledPermissions.FILE_DROP,disabled:e.saving,name:e.randomFormName},on:{change:function(t){return e.setSharePermissions(e.bundledPermissions.FILE_DROP)}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","File drop (upload only)"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionButton",{attrs:{title:e.t("files_sharing","Custom permissions")},on:{click:function(t){e.showCustomPermissionsForm=!0}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Tune")]},proxy:!0}],null,!1,961531849)},[e._v("\n\t\t\t\t\t"+e._s(e.sharePermissionsIsBundle?"":e.sharePermissionsSummary)+"\n\t\t\t\t")])]]:e._e()],2)])}),[],!1,null,"5e957d09",null).exports;function vt(e){return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vt(e)}function yt(e,t,n,r,i,a,s){try{var o=e[a](s),c=o.value}catch(e){return void n(e)}o.done?t(c):Promise.resolve(c).then(r,i)}function _t(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function s(e){yt(a,r,i,s,o,"next",e)}function o(e){yt(a,r,i,s,o,"throw",e)}s(void 0)}))}}var At={name:"SharingEntryLink",components:{NcActions:k(),NcActionButton:ke(),NcActionCheckbox:Ke(),NcActionInput:ze(),NcActionLink:C(),NcActionText:Te(),NcActionTextEditable:tt(),NcActionSeparator:Xe(),NcAvatar:h(),ExternalShareAction:rt,SharePermissionsEditor:gt},directives:{Tooltip:D()},mixins:[Le],props:{canReshare:{type:Boolean,default:!0}},data:function(){return{copySuccess:!0,copied:!1,pending:!1,ExternalLegacyLinkActions:OCA.Sharing.ExternalLinkActions.state,ExternalShareActions:OCA.Sharing.ExternalShareActions.state}},computed:{title:function(){if(this.share&&this.share.id){if(!this.isShareOwner&&this.share.ownerDisplayName)return this.isEmailShareType?t("files_sharing","{shareWith} by {initiator}",{shareWith:this.share.shareWith,initiator:this.share.ownerDisplayName}):t("files_sharing","Shared via link by {initiator}",{initiator:this.share.ownerDisplayName});if(this.share.label&&""!==this.share.label.trim())return this.isEmailShareType?t("files_sharing","Mail share ({label})",{label:this.share.label.trim()}):t("files_sharing","Share link ({label})",{label:this.share.label.trim()});if(this.isEmailShareType)return this.share.shareWith}return t("files_sharing","Share link")},subtitle:function(){return this.isEmailShareType&&this.title!==this.share.shareWith?this.share.shareWith:null},hasExpirationDate:{get:function(){return this.config.isDefaultExpireDateEnforced||!!this.share.expireDate},set:function(e){var t=this.config.defaultExpirationDate||new Date((new Date).setDate((new Date).getDate()+1));this.share.expireDate=e?this.formatDateToString(t):"",console.debug("Expiration date status",e,this.share.expireDate)}},dateMaxEnforced:function(){return this.config.isDefaultExpireDateEnforced?new Date((new Date).setDate((new Date).getDate()+this.config.defaultExpireDate)):null},isPasswordProtected:{get:function(){return this.config.enforcePasswordForPublicLink||!!this.share.password},set:function(e){var t=this;return _t(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=i.ZP,n.t1=t.share,!e){n.next=8;break}return n.next=5,le();case 5:n.t2=n.sent,n.next=9;break;case 8:n.t2="";case 9:n.t3=n.t2,n.t0.set.call(n.t0,n.t1,"password",n.t3),i.ZP.set(t.share,"newPassword",t.share.password);case 12:case"end":return n.stop()}}),n)})))()}},passwordExpirationTime:function(){if(null===this.share.passwordExpirationTime)return null;var e=moment(this.share.passwordExpirationTime);return!(e.diff(moment())<0)&&e.fromNow()},isTalkEnabled:function(){return void 0!==OC.appswebroots.spreed},isPasswordProtectedByTalkAvailable:function(){return this.isPasswordProtected&&this.isTalkEnabled},isPasswordProtectedByTalk:{get:function(){return this.share.sendPasswordByTalk},set:function(e){var t=this;return _t(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t.share.sendPasswordByTalk=e;case 1:case"end":return n.stop()}}),n)})))()}},isEmailShareType:function(){return!!this.share&&this.share.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL},canTogglePasswordProtectedByTalkAvailable:function(){return!(!this.isPasswordProtected||this.isEmailShareType&&!this.hasUnsavedPassword)},pendingPassword:function(){return this.config.enforcePasswordForPublicLink&&this.share&&!this.share.id},pendingExpirationDate:function(){return this.config.isDefaultExpireDateEnforced&&this.share&&!this.share.id},hasUnsavedPassword:function(){return void 0!==this.share.newPassword},shareLink:function(){return window.location.protocol+"//"+window.location.host+(0,l.generateUrl)("/s/")+this.share.token},clipboardTooltip:function(){return this.copied?this.copySuccess?"":t("files_sharing","Cannot copy, please copy the link manually"):t("files_sharing","Copy to clipboard")},externalLegacyLinkActions:function(){return this.ExternalLegacyLinkActions.actions},externalLinkActions:function(){return this.ExternalShareActions.actions.filter((function(e){return e.shareType.includes(v.D.SHARE_TYPE_LINK)||e.shareType.includes(v.D.SHARE_TYPE_EMAIL)}))},isPasswordPolicyEnabled:function(){return"object"===vt(this.config.passwordPolicy)},canChangeHideDownload:function(){return this.fileInfo.shareAttributes.some((function(e){return"download"===e.key&&"permissions"===e.scope&&!1===e.enabled}))}},methods:{onNewLinkShare:function(){var e=this;return _t(regeneratorRuntime.mark((function n(){var r,i,a,s;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e.loading){n.next=2;break}return n.abrupt("return");case 2:if(r={share_type:v.D.SHARE_TYPE_LINK},e.config.isDefaultExpireDateEnforced&&(r.expiration=e.formatDateToString(e.config.defaultExpirationDate)),!e.config.enableLinkPasswordByDefault){n.next=8;break}return n.next=7,le();case 7:r.password=n.sent;case 8:if(!e.config.enforcePasswordForPublicLink&&!e.config.isDefaultExpireDateEnforced){n.next=33;break}if(e.pending=!0,!e.share||e.share.id){n.next=20;break}if(!e.checkShare(e.share)){n.next=17;break}return n.next=14,e.pushNewLinkShare(e.share,!0);case 14:return n.abrupt("return",!0);case 17:return e.open=!0,OC.Notification.showTemporary(t("files_sharing","Error, please enter proper password and/or expiration date")),n.abrupt("return",!1);case 20:if(!e.config.enforcePasswordForPublicLink){n.next=24;break}return n.next=23,le();case 23:r.password=n.sent;case 24:return i=new b(r),n.next=27,new Promise((function(t){e.$emit("add:share",i,t)}));case 27:a=n.sent,e.open=!1,e.pending=!1,a.open=!0,n.next=36;break;case 33:return s=new b(r),n.next=36,e.pushNewLinkShare(s);case 36:case"end":return n.stop()}}),n)})))()},pushNewLinkShare:function(e,n){var r=this;return _t(regeneratorRuntime.mark((function i(){var a,s,o,c,l,u,h,d,f;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(i.prev=0,!r.loading){i.next=3;break}return i.abrupt("return",!0);case 3:return r.loading=!0,r.errors={},a=(r.fileInfo.path+"/"+r.fileInfo.name).replace("//","/"),s={path:a,shareType:v.D.SHARE_TYPE_LINK,password:e.password,expireDate:e.expireDate,attributes:JSON.stringify(r.fileInfo.shareAttributes)},console.debug("Creating link share with options",s),i.next=10,r.createShare(s);case 10:if(o=i.sent,r.open=!1,console.debug("Link share created",o),!n){i.next=19;break}return i.next=16,new Promise((function(e){r.$emit("update:share",o,e)}));case 16:c=i.sent,i.next=22;break;case 19:return i.next=21,new Promise((function(e){r.$emit("add:share",o,e)}));case 21:c=i.sent;case 22:r.config.enforcePasswordForPublicLink||c.copyLink(),i.next=33;break;case 25:if(i.prev=25,i.t0=i.catch(0),f=null===i.t0||void 0===i.t0||null===(l=i.t0.response)||void 0===l||null===(u=l.data)||void 0===u||null===(h=u.ocs)||void 0===h||null===(d=h.meta)||void 0===d?void 0:d.message){i.next=32;break}return(0,S.x2)(t("sharing","Error while creating the share")),console.error(i.t0),i.abrupt("return");case 32:f.match(/password/i)?r.onSyncError("password",f):f.match(/date/i)?r.onSyncError("expireDate",f):r.onSyncError("pending",f);case 33:return i.prev=33,r.loading=!1,i.finish(33);case 36:case"end":return i.stop()}}),i,null,[[0,25,33,36]])})))()},onLabelChange:function(e){this.$set(this.share,"newLabel",e.trim())},onLabelSubmit:function(){"string"==typeof this.share.newLabel&&(this.share.label=this.share.newLabel,this.$delete(this.share,"newLabel"),(0,S.s$)(t("files_sharing","Share label saved")),this.queueUpdate("label"))},copyLink:function(){var e=this;return _t(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e.$copyText(e.shareLink);case 3:(0,S.s$)(t("files_sharing","Link copied")),e.$refs.copyButton.$el.focus(),e.copySuccess=!0,e.copied=!0,n.next=14;break;case 9:n.prev=9,n.t0=n.catch(0),e.copySuccess=!1,e.copied=!0,console.error(n.t0);case 14:return n.prev=14,setTimeout((function(){e.copySuccess=!1,e.copied=!1}),4e3),n.finish(14);case 17:case"end":return n.stop()}}),n,null,[[0,9,14,17]])})))()},onPasswordChange:function(e){this.$set(this.share,"newPassword",e)},onPasswordDisable:function(){this.share.password="",this.$delete(this.share,"newPassword"),this.share.id&&this.queueUpdate("password")},onPasswordSubmit:function(){this.hasUnsavedPassword&&(this.share.password=this.share.newPassword.trim(),(0,S.s$)(t("files_sharing","Share password saved")),this.queueUpdate("password"))},onPasswordProtectedByTalkChange:function(){this.hasUnsavedPassword&&(this.share.password=this.share.newPassword.trim()),this.queueUpdate("sendPasswordByTalk","password")},onMenuClose:function(){this.onPasswordSubmit(),this.onNoteSubmit()},onCancel:function(){this.$emit("remove:share",this.share)}}},bt=At,wt=r(63665),St={};St.styleTagTransform=W(),St.setAttributes=Y(),St.insert=H().bind(null,"head"),St.domAPI=I(),St.insertStyleElement=M(),N()(wt.Z,St),wt.Z&&wt.Z.locals&&wt.Z.locals;var Et=(0,Z.Z)(bt,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry sharing-entry__link",class:{"sharing-entry--share":e.share}},[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":!0,"icon-class":e.isEmailShareType?"avatar-link-share icon-mail-white":"avatar-link-share icon-public-white"}}),e._v(" "),t("div",{staticClass:"sharing-entry__desc"},[t("span",{staticClass:"sharing-entry__title",attrs:{title:e.title}},[e._v("\n\t\t\t"+e._s(e.title)+"\n\t\t")]),e._v(" "),e.subtitle?t("p",[e._v("\n\t\t\t"+e._s(e.subtitle)+"\n\t\t")]):e._e()]),e._v(" "),e.share&&!e.isEmailShareType&&e.share.token?t("NcActions",{ref:"copyButton",staticClass:"sharing-entry__copy"},[t("NcActionLink",{attrs:{href:e.shareLink,target:"_blank","aria-label":e.t("files_sharing","Copy public link to clipboard"),icon:e.copied&&e.copySuccess?"icon-checkmark-color":"icon-clippy"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.copyLink.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.clipboardTooltip)+"\n\t\t")])],1):e._e(),e._v(" "),e.pending||!e.pendingPassword&&!e.pendingExpirationDate?e.loading?t("div",{staticClass:"icon-loading-small sharing-entry__loading"}):t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onMenuClose}},[e.share?[e.share.canEdit&&e.canReshare?[t("NcActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.label,show:e.errors.label,trigger:"manual",defaultContainer:".app-sidebar"},expression:"{\n\t\t\t\t\t\tcontent: errors.label,\n\t\t\t\t\t\tshow: errors.label,\n\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\tdefaultContainer: '.app-sidebar'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"label",class:{error:e.errors.label},attrs:{disabled:e.saving,"aria-label":e.t("files_sharing","Share label"),value:void 0!==e.share.newLabel?e.share.newLabel:e.share.label,icon:"icon-edit",maxlength:"255"},on:{"update:value":e.onLabelChange,submit:e.onLabelSubmit}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Share label"))+"\n\t\t\t\t")]),e._v(" "),t("SharePermissionsEditor",{attrs:{"can-reshare":e.canReshare,share:e.share,"file-info":e.fileInfo},on:{"update:share":function(t){e.share=t}}}),e._v(" "),t("NcActionSeparator"),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.share.hideDownload,disabled:e.saving||e.canChangeHideDownload},on:{"update:checked":function(t){return e.$set(e.share,"hideDownload",t)},change:function(t){return e.queueUpdate("hideDownload")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Hide download"))+"\n\t\t\t\t")]),e._v(" "),t("NcActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:e.isPasswordProtected,disabled:e.config.enforcePasswordForPublicLink||e.saving},on:{"update:checked":function(t){e.isPasswordProtected=t},uncheck:e.onPasswordDisable}},[e._v("\n\t\t\t\t\t"+e._s(e.config.enforcePasswordForPublicLink?e.t("files_sharing","Password protection (enforced)"):e.t("files_sharing","Password protect"))+"\n\t\t\t\t")]),e._v(" "),e.isPasswordProtected?t("NcActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.password,show:e.errors.password,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\t\t\tcontent: errors.password,\n\t\t\t\t\t\tshow: errors.password,\n\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"password",staticClass:"share-link-password",class:{error:e.errors.password},attrs:{disabled:e.saving,required:e.config.enforcePasswordForPublicLink,value:e.hasUnsavedPassword?e.share.newPassword:"***************",icon:"icon-password",autocomplete:"new-password",type:e.hasUnsavedPassword?"text":"password"},on:{"update:value":e.onPasswordChange,submit:e.onPasswordSubmit}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Enter a password"))+"\n\t\t\t\t")]):e._e(),e._v(" "),e.isEmailShareType&&e.passwordExpirationTime?t("NcActionText",{attrs:{icon:"icon-info"}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Password expires {passwordExpirationTime}",{passwordExpirationTime:e.passwordExpirationTime}))+"\n\t\t\t\t")]):e.isEmailShareType&&null!==e.passwordExpirationTime?t("NcActionText",{attrs:{icon:"icon-error"}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Password expired"))+"\n\t\t\t\t")]):e._e(),e._v(" "),e.isPasswordProtectedByTalkAvailable?t("NcActionCheckbox",{staticClass:"share-link-password-talk-checkbox",attrs:{checked:e.isPasswordProtectedByTalk,disabled:!e.canTogglePasswordProtectedByTalkAvailable||e.saving},on:{"update:checked":function(t){e.isPasswordProtectedByTalk=t},change:e.onPasswordProtectedByTalkChange}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Video verification"))+"\n\t\t\t\t")]):e._e(),e._v(" "),t("NcActionCheckbox",{staticClass:"share-link-expire-date-checkbox",attrs:{checked:e.hasExpirationDate,disabled:e.config.isDefaultExpireDateEnforced||e.saving},on:{"update:checked":function(t){e.hasExpirationDate=t},uncheck:e.onExpirationDisable}},[e._v("\n\t\t\t\t\t"+e._s(e.config.isDefaultExpireDateEnforced?e.t("files_sharing","Expiration date (enforced)"):e.t("files_sharing","Set expiration date"))+"\n\t\t\t\t")]),e._v(" "),e.hasExpirationDate?t("NcActionInput",{ref:"expireDate",staticClass:"share-link-expire-date",class:{error:e.errors.expireDate},attrs:{"is-native-picker":!0,"hide-label":!0,disabled:e.saving,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.dateMaxEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t\t\t")]):e._e(),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.hasNote,disabled:e.saving},on:{"update:checked":function(t){e.hasNote=t},uncheck:function(t){return e.queueUpdate("note")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),e._v(" "),e.hasNote?t("NcActionTextEditable",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.note,show:e.errors.note,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\t\t\tcontent: errors.note,\n\t\t\t\t\t\tshow: errors.note,\n\t\t\t\t\t\ttrigger: 'manual',\n\t\t\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"note",class:{error:e.errors.note},attrs:{disabled:e.saving,placeholder:e.t("files_sharing","Enter a note for the share recipient"),value:e.share.newNote||e.share.note,icon:"icon-edit"},on:{"update:value":e.onNoteChange,submit:e.onNoteSubmit}}):e._e()]:e._e(),e._v(" "),t("NcActionSeparator"),e._v(" "),e._l(e.externalLinkActions,(function(n){return t("ExternalShareAction",{key:n.id,attrs:{id:n.id,action:n,"file-info":e.fileInfo,share:e.share}})})),e._v(" "),e._l(e.externalLegacyLinkActions,(function(n,r){var i=n.icon,a=n.url,s=n.name;return t("NcActionLink",{key:r,attrs:{href:a(e.shareLink),icon:i,target:"_blank"}},[e._v("\n\t\t\t\t"+e._s(s)+"\n\t\t\t")])})),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t\t\t")]):e._e(),e._v(" "),!e.isEmailShareType&&e.canReshare?t("NcActionButton",{staticClass:"new-share-link",attrs:{icon:"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Add another link"))+"\n\t\t\t")]):e._e()]:e.canReshare?t("NcActionButton",{staticClass:"new-share-link",attrs:{icon:e.loading?"icon-loading-small":"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Create a new share link"))+"\n\t\t")]):e._e()],2):t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onNewLinkShare}},[e.errors.pending?t("NcActionText",{class:{error:e.errors.pending},attrs:{icon:"icon-error"}},[e._v("\n\t\t\t"+e._s(e.errors.pending)+"\n\t\t")]):t("NcActionText",{attrs:{icon:"icon-info"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Please enter the following required information before creating the share"))+"\n\t\t")]),e._v(" "),e.pendingPassword?t("NcActionText",{attrs:{icon:"icon-password"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Password protection (enforced)"))+"\n\t\t")]):e.config.enableLinkPasswordByDefault?t("NcActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:e.isPasswordProtected,disabled:e.config.enforcePasswordForPublicLink||e.saving},on:{"update:checked":function(t){e.isPasswordProtected=t},uncheck:e.onPasswordDisable}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Password protection"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingPassword||e.share.password?t("NcActionInput",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.password,show:e.errors.password,trigger:"manual",defaultContainer:"#app-sidebar"},expression:"{\n\t\t\t\tcontent: errors.password,\n\t\t\t\tshow: errors.password,\n\t\t\t\ttrigger: 'manual',\n\t\t\t\tdefaultContainer: '#app-sidebar'\n\t\t\t}",modifiers:{auto:!0}}],staticClass:"share-link-password",attrs:{value:e.share.password,disabled:e.saving,required:e.config.enableLinkPasswordByDefault||e.config.enforcePasswordForPublicLink,minlength:e.isPasswordPolicyEnabled&&e.config.passwordPolicy.minLength,icon:"",autocomplete:"new-password"},on:{"update:value":function(t){return e.$set(e.share,"password",t)},submit:e.onNewLinkShare}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Enter a password"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingExpirationDate?t("NcActionText",{attrs:{icon:"icon-calendar-dark"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Expiration date (enforced)"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingExpirationDate?t("NcActionInput",{staticClass:"share-link-expire-date",attrs:{disabled:e.saving,"is-native-picker":!0,"hide-label":!0,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.dateMaxEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t")]):e._e(),e._v(" "),t("NcActionButton",{attrs:{icon:"icon-checkmark"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Create share"))+"\n\t\t")]),e._v(" "),t("NcActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onCancel.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Cancel"))+"\n\t\t")])],1)],1)}),[],!1,null,"a30e9c06",null),Ct={name:"SharingLinkList",components:{SharingEntryLink:Et.exports},mixins:[w],props:{fileInfo:{type:Object,default:function(){},required:!0},shares:{type:Array,default:function(){return[]},required:!0},canReshare:{type:Boolean,required:!0}},data:function(){return{canLinkShare:OC.getCapabilities().files_sharing.public.enabled}},computed:{hasLinkShares:function(){var e=this;return this.shares.filter((function(t){return t.type===e.SHARE_TYPES.SHARE_TYPE_LINK})).length>0},hasShares:function(){return this.shares.length>0}},methods:{addShare:function(e,t){this.shares.unshift(e),this.awaitForShare(e,t)},awaitForShare:function(e,t){var n=this;this.$nextTick((function(){var r=n.$children.find((function(t){return t.share===e}));r&&t(r)}))},removeShare:function(e){var t=this.shares.findIndex((function(t){return t===e}));this.shares.splice(t,1)}}},xt=(0,Z.Z)(Ct,(function(){var e=this,t=e._self._c;return e.canLinkShare?t("ul",{staticClass:"sharing-link-list"},[!e.hasLinkShares&&e.canReshare?t("SharingEntryLink",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo},on:{"add:share":e.addShare}}):e._e(),e._v(" "),e.hasShares?e._l(e.shares,(function(n,r){return t("SharingEntryLink",{key:n.id,attrs:{"can-reshare":e.canReshare,share:e.shares[r],"file-info":e.fileInfo},on:{"update:share":[function(t){return e.$set(e.shares,r,t)},function(t){return e.awaitForShare.apply(e,arguments)}],"add:share":function(t){return e.addShare.apply(e,arguments)},"remove:share":e.removeShare}})})):e._e()],2):e._e()}),[],!1,null,null,null),kt=xt.exports;function Pt(e){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pt(e)}var Dt={name:"SharingEntry",components:{NcActions:k(),NcActionButton:ke(),NcActionCheckbox:Ke(),NcActionInput:ze(),NcActionTextEditable:tt(),NcAvatar:h()},directives:{Tooltip:D()},mixins:[Le],data:function(){return{permissionsEdit:OC.PERMISSION_UPDATE,permissionsCreate:OC.PERMISSION_CREATE,permissionsDelete:OC.PERMISSION_DELETE,permissionsRead:OC.PERMISSION_READ,permissionsShare:OC.PERMISSION_SHARE}},computed:{title:function(){var e=this.share.shareWithDisplayName;return this.share.type===this.SHARE_TYPES.SHARE_TYPE_GROUP?e+=" (".concat(t("files_sharing","group"),")"):this.share.type===this.SHARE_TYPES.SHARE_TYPE_ROOM?e+=" (".concat(t("files_sharing","conversation"),")"):this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE?e+=" (".concat(t("files_sharing","remote"),")"):this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP?e+=" (".concat(t("files_sharing","remote group"),")"):this.share.type===this.SHARE_TYPES.SHARE_TYPE_GUEST&&(e+=" (".concat(t("files_sharing","guest"),")")),e},tooltip:function(){if(this.share.owner!==this.share.uidFileOwner){var e={user:this.share.shareWithDisplayName,owner:this.share.ownerDisplayName};return this.share.type===this.SHARE_TYPES.SHARE_TYPE_GROUP?t("files_sharing","Shared with the group {user} by {owner}",e):this.share.type===this.SHARE_TYPES.SHARE_TYPE_ROOM?t("files_sharing","Shared with the conversation {user} by {owner}",e):t("files_sharing","Shared with {user} by {owner}",e)}return null},canHaveNote:function(){return!this.isRemote},isRemote:function(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE||this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP},canSetEdit:function(){return this.fileInfo.sharePermissions&OC.PERMISSION_UPDATE||this.canEdit},canSetCreate:function(){return this.fileInfo.sharePermissions&OC.PERMISSION_CREATE||this.canCreate},canSetDelete:function(){return this.fileInfo.sharePermissions&OC.PERMISSION_DELETE||this.canDelete},canSetReshare:function(){return this.fileInfo.sharePermissions&OC.PERMISSION_SHARE||this.canReshare},canSetDownload:function(){return this.fileInfo.canDownload()||this.canDownload},canEdit:{get:function(){return this.share.hasUpdatePermission},set:function(e){this.updatePermissions({isEditChecked:e})}},canCreate:{get:function(){return this.share.hasCreatePermission},set:function(e){this.updatePermissions({isCreateChecked:e})}},canDelete:{get:function(){return this.share.hasDeletePermission},set:function(e){this.updatePermissions({isDeleteChecked:e})}},canReshare:{get:function(){return this.share.hasSharePermission},set:function(e){this.updatePermissions({isReshareChecked:e})}},canDownload:{get:function(){return this.share.hasDownloadPermission},set:function(e){this.updatePermissions({isDownloadChecked:e})}},hasRead:{get:function(){return this.share.hasReadPermission}},isFolder:function(){return"dir"===this.fileInfo.type},hasExpirationDate:{get:function(){return this.config.isDefaultInternalExpireDateEnforced||!!this.share.expireDate},set:function(e){var t=this.config.defaultInternalExpirationDate||new Date((new Date).setDate((new Date).getDate()+1));this.share.expireDate=e?this.formatDateToString(t):"",console.debug("Expiration date status",e,this.share.expireDate)}},dateMaxEnforced:function(){return!this.isRemote&&this.config.isDefaultInternalExpireDateEnforced?new Date((new Date).setDate((new Date).getDate()+1+this.config.defaultInternalExpireDate)):this.config.isDefaultRemoteExpireDateEnforced?new Date((new Date).setDate((new Date).getDate()+1+this.config.defaultRemoteExpireDate)):null},hasStatus:function(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_USER&&"object"===Pt(this.share.status)&&!Array.isArray(this.share.status)},allowDownloadText:function(){return t("files_sharing","Allow download")},isSetDownloadButtonVisible:function(){return this.isFolder||["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation"].includes(this.fileInfo.mimetype)}},methods:{updatePermissions:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isEditChecked,n=void 0===t?this.canEdit:t,r=e.isCreateChecked,i=void 0===r?this.canCreate:r,a=e.isDeleteChecked,s=void 0===a?this.canDelete:a,o=e.isReshareChecked,c=void 0===o?this.canReshare:o,l=e.isDownloadChecked,u=void 0===l?this.canDownload:l,h=0|(this.hasRead?this.permissionsRead:0)|(i?this.permissionsCreate:0)|(s?this.permissionsDelete:0)|(n?this.permissionsEdit:0)|(c?this.permissionsShare:0);this.share.permissions=h,this.share.hasDownloadPermission!==u&&(this.share.hasDownloadPermission=u),this.queueUpdate("permissions","attributes")},onMenuClose:function(){this.onNoteSubmit()}}},Tt=Dt,Rt=r(78054),Nt={};Nt.styleTagTransform=W(),Nt.setAttributes=Y(),Nt.insert=H().bind(null,"head"),Nt.domAPI=I(),Nt.insertStyleElement=M(),N()(Rt.Z,Nt),Rt.Z&&Rt.Z.locals&&Rt.Z.locals;var Ot=(0,Z.Z)(Tt,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry"},[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":e.share.type!==e.SHARE_TYPES.SHARE_TYPE_USER,user:e.share.shareWith,"display-name":e.share.shareWithDisplayName,"tooltip-message":e.share.type===e.SHARE_TYPES.SHARE_TYPE_USER?e.share.shareWith:"","menu-position":"left",url:e.share.shareWithAvatar}}),e._v(" "),t(e.share.shareWithLink?"a":"div",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:e.tooltip,expression:"tooltip",modifiers:{auto:!0}}],tag:"component",staticClass:"sharing-entry__desc",attrs:{href:e.share.shareWithLink}},[t("span",[e._v(e._s(e.title)),e.isUnique?e._e():t("span",{staticClass:"sharing-entry__desc-unique"},[e._v(" ("+e._s(e.share.shareWithDisplayNameUnique)+")")])]),e._v(" "),e.hasStatus?t("p",[t("span",[e._v(e._s(e.share.status.icon||""))]),e._v(" "),t("span",[e._v(e._s(e.share.status.message||""))])]):e._e()]),e._v(" "),t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"menu-align":"right"},on:{close:e.onMenuClose}},[e.share.canEdit?[t("NcActionCheckbox",{ref:"canEdit",attrs:{checked:e.canEdit,value:e.permissionsEdit,disabled:e.saving||!e.canSetEdit},on:{"update:checked":function(t){e.canEdit=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow editing"))+"\n\t\t\t")]),e._v(" "),e.isFolder?t("NcActionCheckbox",{ref:"canCreate",attrs:{checked:e.canCreate,value:e.permissionsCreate,disabled:e.saving||!e.canSetCreate},on:{"update:checked":function(t){e.canCreate=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow creating"))+"\n\t\t\t")]):e._e(),e._v(" "),e.isFolder?t("NcActionCheckbox",{ref:"canDelete",attrs:{checked:e.canDelete,value:e.permissionsDelete,disabled:e.saving||!e.canSetDelete},on:{"update:checked":function(t){e.canDelete=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow deleting"))+"\n\t\t\t")]):e._e(),e._v(" "),e.config.isResharingAllowed?t("NcActionCheckbox",{ref:"canReshare",attrs:{checked:e.canReshare,value:e.permissionsShare,disabled:e.saving||!e.canSetReshare},on:{"update:checked":function(t){e.canReshare=t}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Allow resharing"))+"\n\t\t\t")]):e._e(),e._v(" "),e.isSetDownloadButtonVisible?t("NcActionCheckbox",{ref:"canDownload",attrs:{checked:e.canDownload,disabled:e.saving||!e.canSetDownload},on:{"update:checked":function(t){e.canDownload=t}}},[e._v("\n\t\t\t\t"+e._s(e.allowDownloadText)+"\n\t\t\t")]):e._e(),e._v(" "),t("NcActionCheckbox",{attrs:{checked:e.hasExpirationDate,disabled:e.config.isDefaultInternalExpireDateEnforced||e.saving},on:{"update:checked":function(t){e.hasExpirationDate=t},uncheck:e.onExpirationDisable}},[e._v("\n\t\t\t\t"+e._s(e.config.isDefaultInternalExpireDateEnforced?e.t("files_sharing","Expiration date enforced"):e.t("files_sharing","Set expiration date"))+"\n\t\t\t")]),e._v(" "),e.hasExpirationDate?t("NcActionInput",{ref:"expireDate",class:{error:e.errors.expireDate},attrs:{"is-native-picker":!0,"hide-label":!0,disabled:e.saving,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.dateMaxEnforced},on:{input:e.onExpirationChange}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Enter a date"))+"\n\t\t\t")]):e._e(),e._v(" "),e.canHaveNote?[t("NcActionCheckbox",{attrs:{checked:e.hasNote,disabled:e.saving},on:{"update:checked":function(t){e.hasNote=t},uncheck:function(t){return e.queueUpdate("note")}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),e._v(" "),e.hasNote?t("NcActionTextEditable",{directives:[{name:"tooltip",rawName:"v-tooltip.auto",value:{content:e.errors.note,show:e.errors.note,trigger:"manual"},expression:"{\n\t\t\t\t\t\tcontent: errors.note,\n\t\t\t\t\t\tshow: errors.note,\n\t\t\t\t\t\ttrigger: 'manual'\n\t\t\t\t\t}",modifiers:{auto:!0}}],ref:"note",class:{error:e.errors.note},attrs:{disabled:e.saving,value:e.share.newNote||e.share.note,icon:"icon-edit"},on:{"update:value":e.onNoteChange,submit:e.onNoteSubmit}}):e._e()]:e._e()]:e._e(),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close",disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t\t")]):e._e()],2)],1)}),[],!1,null,"708928fe",null);function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0},canReshare:function(){return!!(this.fileInfo.permissions&OC.PERMISSION_SHARE)||!!(this.reshare&&this.reshare.hasSharePermission&&this.config.isResharingAllowed)}},methods:{update:function(e){var t=this;return jt(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t.fileInfo=e,t.resetState(),t.getShares();case 3:case"end":return n.stop()}}),n)})))()},getShares:function(){var e=this;return jt(regeneratorRuntime.mark((function n(){var r,i,a,s,o,c,u,h,f,p,m,g;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,e.loading=!0,r=(0,l.generateOcsUrl)("apps/files_sharing/api/v1/shares"),i="json",a=(e.fileInfo.path+"/"+e.fileInfo.name).replace("//","/"),s=d.default.get(r,{params:{format:i,path:a,reshares:!0}}),o=d.default.get(r,{params:{format:i,path:a,shared_with_me:!0}}),n.next=9,Promise.all([s,o]);case 9:c=n.sent,y=2,u=function(e){if(Array.isArray(e))return e}(v=c)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,s,o=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(o.push(r.value),o.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return o}}(v,y)||function(e,t){if(e){if("string"==typeof e)return Ut(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ut(e,t):void 0}}(v,y)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),h=u[0],f=u[1],e.loading=!1,e.processSharedWithMe(f),e.processShares(h),n.next=23;break;case 18:n.prev=18,n.t0=n.catch(0),null!==(p=n.t0.response.data)&&void 0!==p&&null!==(m=p.ocs)&&void 0!==m&&null!==(g=m.meta)&&void 0!==g&&g.message?e.error=n.t0.response.data.ocs.meta.message:e.error=t("files_sharing","Unable to load the shares list"),e.loading=!1,console.error("Error loading the shares list",n.t0);case 23:case"end":return n.stop()}var v,y}),n,null,[[0,18]])})))()},resetState:function(){clearInterval(this.expirationInterval),this.loading=!0,this.error="",this.sharedWithMe={},this.shares=[],this.linkShares=[]},updateExpirationSubtitle:function(e){var n=moment(e.expireDate).unix();this.$set(this.sharedWithMe,"subtitle",t("files_sharing","Expires {relativetime}",{relativetime:OC.Util.relativeModifiedDate(1e3*n)})),moment().unix()>n&&(clearInterval(this.expirationInterval),this.$set(this.sharedWithMe,"subtitle",t("files_sharing","this share just expired.")))},processShares:function(e){var t=this,n=e.data;if(n.ocs&&n.ocs.data&&n.ocs.data.length>0){var r=n.ocs.data.map((function(e){return new b(e)})).sort((function(e,t){return t.createdTime-e.createdTime}));this.linkShares=r.filter((function(e){return e.type===t.SHARE_TYPES.SHARE_TYPE_LINK||e.type===t.SHARE_TYPES.SHARE_TYPE_EMAIL})),this.shares=r.filter((function(e){return e.type!==t.SHARE_TYPES.SHARE_TYPE_LINK&&e.type!==t.SHARE_TYPES.SHARE_TYPE_EMAIL})),console.debug("Processed",this.linkShares.length,"link share(s)"),console.debug("Processed",this.shares.length,"share(s)")}},processSharedWithMe:function(e){var n=e.data;if(n.ocs&&n.ocs.data&&n.ocs.data[0]){var r=new b(n),i=function(e){return e.type===v.D.SHARE_TYPE_GROUP?t("files_sharing","Shared with you and the group {group} by {owner}",{group:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):e.type===v.D.SHARE_TYPE_CIRCLE?t("files_sharing","Shared with you and {circle} by {owner}",{circle:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):e.type===v.D.SHARE_TYPE_ROOM?e.shareWithDisplayName?t("files_sharing","Shared with you and the conversation {conversation} by {owner}",{conversation:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):t("files_sharing","Shared with you in a conversation by {owner}",{owner:e.ownerDisplayName},void 0,{escape:!1}):t("files_sharing","Shared with you by {owner}",{owner:e.ownerDisplayName},void 0,{escape:!1})}(r),a=r.ownerDisplayName,s=r.owner;this.sharedWithMe={displayName:a,title:i,user:s},this.reshare=r,r.expireDate&&moment(r.expireDate).unix()>moment().unix()&&(this.updateExpirationSubtitle(r),this.expirationInterval=setInterval(this.updateExpirationSubtitle,1e4,r))}else this.fileInfo&&void 0!==this.fileInfo.shareOwnerId&&this.fileInfo.shareOwnerId!==OC.currentUser&&(this.sharedWithMe={displayName:this.fileInfo.shareOwner,title:t("files_sharing","Shared with you by {owner}",{owner:this.fileInfo.shareOwner},void 0,{escape:!1}),user:this.fileInfo.shareOwnerId})},addShare:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL?this.linkShares.unshift(e):this.shares.unshift(e),this.awaitForShare(e,t)},awaitForShare:function(e,t){var n=this.$refs.shareList;e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL&&(n=this.$refs.linkShareList),this.$nextTick((function(){var r=n.$children.find((function(t){return t.share===e}));r&&t(r)}))}}},Bt=Mt,Wt=r(27785),qt={};qt.styleTagTransform=W(),qt.setAttributes=Y(),qt.insert=H().bind(null,"head"),qt.domAPI=I(),qt.insertStyleElement=M(),N()(Wt.Z,qt),Wt.Z&&Wt.Z.locals&&Wt.Z.locals;var Ft=(0,Z.Z)(Bt,(function(){var e=this,t=e._self._c;return t("div",{class:{"icon-loading":e.loading}},[e.error?t("div",{staticClass:"emptycontent",class:{emptyContentWithSections:e.sections.length>0}},[t("div",{staticClass:"icon icon-error"}),e._v(" "),t("h2",[e._v(e._s(e.error))])]):t("div",{staticClass:"sharingTab__content"},[e.isSharedWithMe?t("SharingEntrySimple",e._b({staticClass:"sharing-entry__reshare",scopedSlots:e._u([{key:"avatar",fn:function(){return[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.sharedWithMe.user,"display-name":e.sharedWithMe.displayName,"tooltip-message":""}})]},proxy:!0}],null,!1,1656378807)},"SharingEntrySimple",e.sharedWithMe,!1)):e._e(),e._v(" "),e.loading?e._e():t("SharingInput",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,"link-shares":e.linkShares,reshare:e.reshare,shares:e.shares},on:{"add:share":e.addShare}}),e._v(" "),e.loading?e._e():t("SharingLinkList",{ref:"linkShareList",attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,shares:e.linkShares}}),e._v(" "),e.loading?e._e():t("SharingList",{ref:"shareList",attrs:{shares:e.shares,"file-info":e.fileInfo}}),e._v(" "),e.canReshare&&!e.loading?t("SharingInherited",{attrs:{"file-info":e.fileInfo}}):e._e(),e._v(" "),t("SharingEntryInternal",{attrs:{"file-info":e.fileInfo}}),e._v(" "),e.projectsEnabled&&e.fileInfo?t("CollectionList",{attrs:{id:"".concat(e.fileInfo.id),type:"file",name:e.fileInfo.name}}):e._e()],1),e._v(" "),e._l(e.sections,(function(n,r){return t("div",{key:r,ref:"section-"+r,refInFor:!0,staticClass:"sharingTab__additionalContent"},[t(n(e.$refs["section-"+r],e.fileInfo),{tag:"component",attrs:{"file-info":e.fileInfo}})],1)}))],2)}),[],!1,null,"59d829c2",null).exports;function Zt(e){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zt(e)}function $t(e,t){for(var n=0;n-1?(console.error("An action with the same id ".concat(e.id," already exists"),e),!1):(this._state.actions.push(e),!0):(console.error("Invalid action provided",e),!1)}}])&&en(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function rn(e){return rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rn(e)}function an(e,t){for(var n=0;n=a)&&Object.keys(i.O).every((function(e){return i.O[e](n[c])}))?n.splice(c--,1):(o=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,r,a]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},i.j=7870,function(){i.b=document.baseURI||self.location.href;var e={7870:0};i.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,a,s=n[0],o=n[1],c=n[2],l=0;if(s.some((function(t){return 0!==e[t]}))){for(r in o)i.o(o,r)&&(i.m[r]=o[r]);if(c)var u=c(i)}for(t&&t(n);l