(()=>{"use strict";vare,r,n,s={62691:(e,r,n)=>{vars=n(85471),i=n(21777),a=n(65043),o=n(17334),l=n.n(o),c=n(63814),u=n(85168),d=n(67607),p=n(97012);constf=(0,n(35947).YK)().setApp("files").detectUser().build(),h=(0,u.a1)(t("files","Choose a file or folder to transfer")).setMultiSelect(!1).setType(1).allowDirectories().build(),m={name:"TransferOwnershipDialogue",components:{NcSelect:d.A,NcButton:p.A},data:()=>({directory:void0,directoryPickerError:void0,submitError:void0,loadingUsers:!1,selectedUser:null,userSuggestions:{},config:{minSearchStringLength:parseInt(OC.config["sharing.minSearchStringLength"],10)||0}}),computed:{canSubmit(){return!!this.directory&&!!this.selectedUser},formatedUserSuggestions(){returnObject.keys(this.userSuggestions).map((e=>{constt=this.userSuggestions[e];return{user:t.uid,displayName:t.displayName,icon:"icon-user",subname:t.shareWithDisplayNameUnique}}))},submitButtonText(){if(!this.canSubmit)returnt("files","Transfer");conste=this.readableDirectory.split("/");returnt("files","Transfer {path} to {userid}",{path:e[e.length-1],userid:this.selectedUser.displayName})},readableDirectory(){returnthis.directory?this.directory.substring(1):""}},created(){this.findUserDebounced=l()(this.findUser,300),this.findUser("")},methods:{start(){this.directoryPickerError=void0,h.pick().then((e=>""===e?"/":e)).then((e=>{if(f.debug(`path ${e} selected for transferring ownership`),!e.startsWith("/"))thrownewError(t("files","Invalid path selected"));this.directory=e})).catch((e=>{f.error(`Selecting object for transfer aborted: ${e.message||"Unknown error"}`,{error:e}),this.directoryPickerError=e.message||t("files","Unknown error"),(0,u.Qg)(this.directoryPickerError)}))},asyncfindUser(e){if(this.query=e.trim(),!(e.length<this.config.minSearchStringLength)){this.loadingUsers=!0;try{constt=awaita.Ay.get((0,c.KT)("apps/files_sharing/api/v1/sharees"),{params:{format:"json",itemType:"file",search:e,perPage:20,lookup:!1}});this.userSuggestions={},t.data.ocs.data.exact.users.concat(t.data.ocs.data.users).forEach((e=>{s.Ay.set(this.userSuggestions,e.value.shareWith,{uid:e.value.shareWith,displayName:e.label,shareWithDisplayNameUnique:e.shareWithDisplayNameUnique})}))}catch(e){f.error("could not fetch users",{error:e})}finally{this.loadingUsers=!1}}},submit(){this.canSubmit||f.warn("ignoring form submit"),this.submitError=void0;conste={path:this.directory,recipient:this.selectedUser.user};f.debug("submit transfer ownership form",e);constr=(0,c.KT)("apps/files/api/v1/transferownership");a.Ay.post(r,e).then((e=>e.data)).then((e=>{f.info("Transfer ownership request sent",{data:e}),this.directory=void0,this.selectedUser=null,(0,u.Te)(t("files","Ownership transfer request sent"))})).catch((e=>{f.error("Could not send ownership transfer request",{error:e}),this.submitError=403===e?.response?.status?t("files","Cannot transfer ownership of a file or folder you do not own"):e.message||t("files","Unknown error"),(0,u.Qg)(this.submitError)}))}}};varg=n(85072),b=n.n(g),v=n(97825),A=n.n(v),y=n(77659),w=n.n(y),C=n(55056),_=n.n(C),x=n(10540),S=n.n(x),k=n(41113),U=n.n(k),T=n(77344),E={};E.styleTagTransform=U(),E.setAttributes=_(),E.insert=w().bind(null,"head"),E.domAPI=A(),E.insertStyleElement=S(),b()(T.A,E),T.A&&T.A.locals&&T.A.locals;varO=n(14486);constD={name:"PersonalSettings",components:{TransferOwnershipDialogue:(0,O.A)(m,(function(){vare=this,t=e._self._c;returnt("div",[t("h3",[e._v(e._s(e.t("files","Transfer ownership of a file or folder"))+" ")]),e._v(" "),t("form",{on:{submit:function(t){returnt.preventDefault(),e.submit.apply(null,arguments)}}},[t("p",{staticClass:"transfer-select-row"},[t("span",[e._v(e._s(e.readableDirectory))]),e._v(" "),void0===e.directory?t("NcButton",{staticClass:"transfer-select-row__choose_button",on:{click:function(t){returnt.preventDefault(),e.start.apply(null,arguments)}}},[e._v("\n\t\t\t\t"+e._s(e.t("files","Choose file or folder to transfer"))+"\n\t\t\t")]):t("NcButton",{on:{click:function(t){returnt.preventDefault(),e.start.apply(null,arguments)}}},[e._v("\n\t\t\t\t"+e.