aboutsummaryrefslogtreecommitdiffstats
path: root/dist/files-main.js
blob: 374c5730b558d24d081d9657d8235820d26eff04 (plain)
1
2
3
/*! For license information please see files-main.js.LICENSE.txt */
(()=>{"use strict";var e,n={74156:(e,n,i)=>{var o=i(17499),s=i(79954),r=i(31352),a=i(79753),l=i(45994);const c=function(){var t,e,n,i;const o=(null===(t=OCA)||void 0===t||null===(e=t.Files)||void 0===e||null===(n=e.App)||void 0===n||null===(i=n.currentFileList)||void 0===i?void 0:i.dirInfo)||{path:"/",name:""};return"".concat(o.path,"/").concat(o.name).replace(/\/\//gi,"/")};var d=i(4820),u=i(20144),p=i(62520),h=i(64024),f=i(93455),A=i.n(f),m=i(70110),v=i.n(m);const g=256,w={name:"TemplatePreview",inheritAttrs:!1,props:{basename:{type:String,required:!0},checked:{type:Boolean,default:!1},fileid:{type:[String,Number],required:!0},filename:{type:String,required:!0},previewUrl:{type:String,default:null},hasPreview:{type:Boolean,default:!0},mime:{type:String,required:!0},ratio:{type:Number,default:null}},data:()=>({failedPreview:!1}),computed:{nameWithoutExt(){return this.basename.indexOf(".")>-1?this.basename.split(".").slice(0,-1).join("."):this.basename},id(){return"template-picker-".concat(this.fileid)},realPreviewUrl(){return this.failedPreview&&this.mimeIcon?this.mimeIcon:this.previewUrl?this.previewUrl:(0,l.ts)()?(0,a.generateUrl)("/core/preview?fileId=".concat(this.fileid,"&x=").concat(g,"&y=").concat(g,"&a=1")):(0,a.generateUrl)("/apps/files_sharing/publicpreview/".concat(document.getElementById("sharingToken")&&document.getElementById("sharingToken").value,"?fileId=").concat(this.fileid,"&file=").concat(function(t){const e=(t.startsWith("/")?t:"/".concat(t)).split("/");let n="";return e.forEach((t=>{""!==t&&(n+="/"+encodeURIComponent(t))})),n}(this.filename),"&x=").concat(g,"&y=").concat(g,"&a=1"))},mimeIcon(){return OC.MimeType.getIconUrl(this.mime)}},methods:{onCheck(){this.$emit("check",this.fileid)},onFailure(){this.failedPreview=!0}}};var b=i(93379),C=i.n(b),y=i(7795),_=i.n(y),x=i(90569),S=i.n(x),k=i(3565),N=i.n(k),I=i(19216),E=i.n(I),F=i(44589),B=i.n(F),P=i(3491),z={};z.styleTagTransform=B(),z.setAttributes=N(),z.insert=S().bind(null,"head"),z.domAPI=_(),z.insertStyleElement=E(),C()(P.Z,z),P.Z&&P.Z.locals&&P.Z.locals;var T=i(51900);const L=(0,T.Z)(w,(function(){var t=this,e=t._self._c;return e("li",{staticClass:"template-picker__item"},[e("input",{staticClass:"radio",attrs:{id:t.id,type:"radio",name:"template-picker"},domProps:{checked:t.checked},on:{change:t.onCheck}}),t._v(" "),e("label",{staticClass:"template-picker__label",attrs:{for:t.id}},[e("div",{staticClass:"template-picker__preview",class:t.failedPreview?"template-picker__preview--failed":""},[e("img",{staticClass:"template-picker__image",attrs:{src:t.realPreviewUrl,alt:"",draggable:"false"},on:{error:t.onFailure}})]),t._v(" "),e("span",{staticClass:"template-picker__title"},[t._v("\n\t\t\t"+t._s(t.nameWithoutExt)+"\n\t\t")])])])}),[],!1,null,"6c072a31",null).exports;var V=i(25108);const U={name:"TemplatePicker",components:{NcEmptyContent:A(),NcModal:v(),TemplatePreview:L},props:{logger:{type:Object,required:!0}},data:()=>({checked:-1,loading:!1,name:null,opened:!1,provider:null}),computed:{nameWithoutExt(){return this.name.indexOf(".")>-1?this.name.split(".").slice(0,-1).join("."):this.name},emptyTemplate(){var e,n;return{basename:t("files","Blank"),fileid:-1,filename:this.t("files","Blank"),hasPreview:!1,mime:(null===(e=this.provider)||void 0===e?void 0:e.mimetypes[0])||(null===(n=this.provider)||void 0===n?void 0:n.mimetypes)}},selectedTemplate(){return this.provider.templates.find((t=>t.fileid===this.checked))},style(){return{"--margin":"8px","--width":"160px","--border":"2px","--fullwidth":"180px","--height":this.provider.ratio?Math.round(160/this.provider.ratio)+"px":null}}},methods:{async open(t,e){this.checked=this.emptyTemplate.fileid,this.name=t,this.provider=e;const n=(await async function(){return(await d.default.get((0,a.generateOcsUrl)("apps/files/api/v1/templates"))).data.ocs.data}()).find((t=>t.app===e.app&&t.label===e.label));if(null===n)throw new Error("Failed to match provider in results");this.provider=n,0!==n.templates.length?this.opened=!0:this.onSubmit()},close(){this.checked=this.emptyTemplate.fileid,this.loading=!1,this.name=null,this.opened=!1,this.provider=null},onCheck(t){this.checked=t},async onSubmit(){var t,e,n;this.loading=!0;const i=c(),o=null===(t=OCA)||void 0===t||null===(e=t.Files)||void 0===e||null===(n=e.App)||void 0===n?void 0:n.currentFileList;var s,r;this.nameWithoutExt===this.name&&(this.logger.debug("Fixed invalid filename",{name:this.name,extension:null===(s=this.provider)||void 0===s?void 0:s.extension}),this.name=this.name+(null===(r=this.provider)||void 0===r?void 0:r.extension));try{var l,u;const t=await async function(t,e,n){return(await d.default.post((0,a.generateOcsUrl)("apps/files/api/v1/templates/create"),{filePath:t,templatePath:e,templateType:n})).data.ocs.data}((0,p.normalize)("".concat(i,"/").concat(this.name)),null===(l=this.selectedTemplate)||void 0===l?void 0:l.filename,null===(u=this.selectedTemplate)||void 0===u?void 0:u.templateType);this.logger.debug("Created new file",t);const e=await(null==o?void 0:o.addAndFetchFileInfo(this.name).then(((t,e)=>e))),n=new OCA.Files.FileInfoModel(e,{filesClient:null==o?void 0:o.filesClient}),s=OCA.Files.fileActions.getDefaultFileAction(t.mime,"file",OC.PERMISSION_ALL);s&&s.action(t.basename,{$file:null==o?void 0:o.findFileEl(this.name),dir:i,fileList:o,fileActions:null==o?void 0:o.fileActions,fileInfoModel:n}),this.close()}catch(t){this.logger.error("Error while creating the new file from template"),V.error(t),(0,h.x2)(this.t("files","Unable to create new file from template"))}finally{this.loading=!1}}}};var D=i(5103),O={};O.styleTagTransform=B(),O.setAttributes=N(),O.insert=S().bind(null,"head"),O.domAPI=_(),O.insertStyleElement=E(),C()(D.Z,O),D.Z&&D.Z.locals&&D.Z.locals;const Z=(0,T.Z)(U,(function(){var t=this,e=t._self._c;return t.opened?e("NcModal",{staticClass:"templates-picker",attrs:{"clear-view-delay":-1,size:"normal"},on:{close:t.close}},[e("form",{staticClass:"templates-picker__form",style:t.style,on:{submit:function(e){return e.preventDefault(),e.stopPropagation(),t.onSubmit.apply(null,arguments)}}},[e("h2",[t._v(t._s(t.t("files","Pick a template for {name}",{name:t.nameWithoutExt})))]),t._v(" "),e("ul",{staticClass:"templates-picker__list"},[e("TemplatePreview",t._b({attrs:{checked:t.checked===t.emptyTemplate.fileid},on:{check:t.onCheck}},"TemplatePreview",t.emptyTemplate,!1)),t._v(" "),t._l(t.provider.templates,(function(n){return e("TemplatePreview",t._b({key:n.fileid,attrs:{checked:t.checked===n.fileid,ratio:t.provider.ratio},on:{check:t.onCheck}},"TemplatePreview",n,!1))}))],2),t._v(" "),e("div",{staticClass:"templates-picker__buttons"},[e("button",{on:{click:t.close}},[t._v("\n\t\t\t\t"+t._s(t.t("files","Cancel"))+"\n\t\t\t")]),t._v(" "),e("input",{staticClass:"primary",attrs:{type:"submit","aria-label":t.t("files","Create a new file with the selected template")},domProps:{value:t.t("files","Create")}})])]),t._v(" "),t.loading?e("NcEmptyContent",{staticClass:"templates-picker__loading",attrs:{icon:"icon-loading"}},[t._v("\n\t\t"+t._s(t.t("files","Creating file"))+"\n\t")]):t._e()],1):t._e()}),[],!1,null,"715b4161",null).exports,M=(0,o.IY)().setApp("files").detectUser().build();u.default.mixin({methods:{t:r.Iu,n:r.uN}});const R=document.createElement("div");R.id="template-picker",document.body.appendChild(R);let q=(0,s.j)("files","templates",[]),j=(0,s.j)("files","templates_path",!1);M.debug("Templates providers",q),M.debug("Templates folder",{templatesPath:j});const $=new(u.default.extend(Z))({name:"TemplatePicker",propsData:{logger:M}});$.$mount("#template-picker"),window.addEventListener("DOMContentLoaded",(function(){if(!j){M.debug("Templates folder not initialized");const t={attach(t){t.addMenuEntry({id:"template-init",displayName:(0,r.Iu)("files","Set up templates folder"),templateName:(0,r.Iu)("files","Templates"),iconClass:"icon-template-add",fileType:"file",actionHandler(e){W(e),t.removeMenuEntry("template-init")}})}};OC.Plugins.register("OCA.Files.NewFileMenu",t)}})),q.forEach(((t,e)=>{const n={attach(n){const i=n.fileList;"files"!==i.id&&"files.public"!==i.id||n.addMenuEntry({id:"template-new-".concat(t.app,"-").concat(e),displayName:t.label,templateName:t.label+t.extension,iconClass:t.iconClass||"icon-file",fileType:"file",actionHandler(e){$.open(e,t)}})}};OC.Plugins.register("OCA.Files.NewFileMenu",n)}));const W=async function(t){const e=(c()+"/".concat(t)).replace("//","/");try{M.debug("Initializing the templates directory",{templatePath:e});const t=await d.default.post((0,a.generateOcsUrl)("apps/files/api/v1/templates/path"),{templatePath:e,copySystemTemplates:!0});OCA.Files.App.currentFileList.changeDirectory(e,!0,!0),q=t.data.ocs.data.templates,j=t.data.ocs.data.template_path}catch(t){M.error("Unable to initialize the templates directory"),(0,h.x2)((0,r.Iu)("files","Unable to initialize the templates directory"))}};var G=i(78595);!function(){const t={attach(t){(0,G.Ld)("nextcloud:unified-search.search",(e=>{let{query:n}=e;t.setFilter(n)})),(0,G.Ld)("nextcloud:unified-search.reset",(()=>{this.query=null,t.setFilter("")}))}};window.OC.Plugins.register("OCA.Files.FileList",t)}();var H=i(91770),K=i(78510);const Q=(0,o.IY)().setApp("files").detectUser().build();const Y=function(){return window._nc_fileactions||[]};var J;J=new class{constructor(t){var e,n,i;e=this,i=void 0,(n=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(n="_action"))in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i,this.validateAction(t),this._action=t}get id(){return this._action.id}get displayName(){return this._action.displayName}get iconSvgInline(){return this._action.iconSvgInline}get enabled(){return this._action.enabled}get exec(){return this._action.exec}get execBatch(){return this._action.execBatch}get order(){return this._action.order}get default(){return this._action.default}get inline(){return this._action.inline}get renderInline(){return this._action.renderInline}validateAction(t){if(!t.id||"string"!=typeof t.id)throw new Error("Invalid id");if(!t.displayName||"function"!=typeof t.displayName)throw new Error("Invalid displayName function");if(!t.iconSvgInline||"function"!=typeof t.iconSvgInline)throw new Error("Invalid iconSvgInline function");if(!t.exec||"function"!=typeof t.exec)throw new Error("Invalid exec function");if("enabled"in t&&"function"!=typeof t.enabled)throw new Error("Invalid enabled function");if("execBatch"in t&&"function"!=typeof t.execBatch)throw new Error("Invalid execBatch function");if("order"in t&&"number"!=typeof t.order)throw new Error("Invalid order");if("default"in t&&"boolean"!=typeof t.default)throw new Error("Invalid default");if("inline"in t&&"function"!=typeof t.inline)throw new Error("Invalid inline function");if("renderInline"in t&&"function"!=typeof t.renderInline)throw new Error("Invalid renderInline function")}}({id:"delete",displayName:(t,e)=>"trashbin"===e.id?(0,r.Iu)("files_trashbin","Delete permanently"):(0,r.Iu)("files","Delete"),iconSvgInline:()=>K,enabled:t=>t.length>0&&t.map((t=>t.permissions)).every((t=>0!=(t&H.y3.DELETE))),async exec(t){try{return await d.default.delete(t.source),(0,G.j8)("files:node:deleted",t),!0}catch(e){return Q.error("Error while deleting a file",{error:e,source:t.source,node:t}),!1}},async execBatch(t,e){return Promise.all(t.map((t=>this.exec(t,e))))},order:100}),void 0===window._nc_fileactions&&(window._nc_fileactions=[],Q.debug("FileActions initialized")),window._nc_fileactions.find((t=>t.id===J.id))?Q.error("FileAction ".concat(J.id," already registered"),{action:J}):window._nc_fileactions.push(J);const X=function(t){let{id:e,name:n,order:i,icon:o,parent:s,classes:r="",expanded:a,params:l}=t;OCP.Files.Navigation.register({id:e,name:n,order:i,params:l,parent:s,expanded:!0===a,iconClass:o?"icon-".concat(o):"nav-icon-"+e,legacy:!0,sticky:r.includes("pinned")})};var tt=i(59305),et=i(41487),nt=i.n(et);function it(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const ot=class{constructor(){it(this,"_views",[]),it(this,"_currentView",null),Q.debug("Navigation service initialized")}register(t){try{rt(t),st(t,this._views)}catch(e){throw e instanceof Error&&Q.error(e.message,{view:t}),e}t.legacy&&Q.warn("Legacy view detected, please migrate to Vue"),t.iconClass&&(t.legacy=!0),this._views.push(t)}get views(){return this._views}setActive(t){this._currentView=t}get active(){return this._currentView}},st=function(t,e){if(e.find((e=>e.id===t.id)))throw new Error("Navigation id ".concat(t.id," is already registered"));return!0},rt=function(t){if(!t.id||"string"!=typeof t.id)throw new Error("Navigation id is required and must be a string");if(!t.name||"string"!=typeof t.name)throw new Error("Navigation name is required and must be a string");if(!t.legacy){if(!t.getContents||"function"!=typeof t.getContents)throw new Error("Navigation getContents is required and must be a function");if(!t.icon||"string"!=typeof t.icon||!nt()(t.icon))throw new Error("Navigation icon is required and must be a valid svg string")}if(!("order"in t)||"number"!=typeof t.order)throw new Error("Navigation order is required and must be a number");if(t.columns&&t.columns.forEach(at),t.emptyView&&"function"!=typeof t.emptyView)throw new Error("Navigation emptyView must be a function");if(t.parent&&"string"!=typeof t.parent)throw new Error("Navigation parent must be a string");if("sticky"in t&&"boolean"!=typeof t.sticky)throw new Error("Navigation sticky must be a boolean");if("expanded"in t&&"boolean"!=typeof t.expanded)throw new Error("Navigation expanded must be a boolean");if(t.defaultSortKey&&"string"!=typeof t.defaultSortKey)throw new Error("Navigation defaultSortKey must be a string");return!0},at=function(t){if(!t.id||"string"!=typeof t.id)throw new Error("A column id is required");if(!t.title||"string"!=typeof t.title)throw new Error("A column title is required");if(!t.render||"function"!=typeof t.render)throw new Error("A render function is required");if(t.sort&&"function"!=typeof t.sort)throw new Error("Column sortFunction must be a function");if(t.summary&&"function"!=typeof t.summary)throw new Error("Column summary must be a function");return!0};var lt=i(57638),ct=i(55209),dt=i.n(ct),ut=i(14032),pt=i.n(ut),ht=i(91211),ft=i.n(ht),At=i(28615),mt=i(74184),vt=i(48959),gt=i.n(vt);const wt={name:"NavigationQuota",components:{ChartPie:mt.Z,NcAppNavigationItem:pt(),NcProgressBar:gt()},data:()=>({loadingStorageStats:!1,storageStats:(0,s.j)("files","storageStats",null)}),computed:{storageStatsTitle(){var t,e,n;const i=(0,H.sS)(null===(t=this.storageStats)||void 0===t?void 0:t.used),o=(0,H.sS)(null===(e=this.storageStats)||void 0===e?void 0:e.quota);return(null===(n=this.storageStats)||void 0===n?void 0:n.quota)<0?this.t("files","{usedQuotaByte} used",{usedQuotaByte:i}):this.t("files","{used} of {quota} used",{used:i,quota:o})},storageStatsTooltip(){return this.storageStats.relative?this.t("files","{relative}% used",this.storageStats):""}},beforeMount(){setInterval(this.throttleUpdateStorageStats,6e4),(0,G.Ld)("files:node:created",this.throttleUpdateStorageStats),(0,G.Ld)("files:node:deleted",this.throttleUpdateStorageStats),(0,G.Ld)("files:node:moved",this.throttleUpdateStorageStats),(0,G.Ld)("files:node:updated",this.throttleUpdateStorageStats)},methods:{debounceUpdateStorageStats:(0,At.D)(200,(function(t){this.updateStorageStats(t)})),throttleUpdateStorageStats:(0,At.P)(1e3,(function(t){this.updateStorageStats(t)})),async updateStorageStats(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!this.loadingStorageStats){this.loadingStorageStats=!0;try{var n;const t=await d.default.get((0,a.generateUrl)("/apps/files/api/v1/stats"));if(null==t||null===(n=t.data)||void 0===n||!n.data)throw new Error("Invalid storage stats");this.storageStats=t.data.data}catch(n){Q.error("Could not refresh storage stats",{error:n}),e&&(0,h.x2)(t("files","Could not refresh storage stats"))}finally{this.loadingStorageStats=!1}}},t:r.Iu}};var bt=i(93582),Ct={};Ct.styleTagTransform=B(),Ct.setAttributes=N(),Ct.insert=S().bind(null,"head"),Ct.domAPI=_(),Ct.insertStyleElement=E(),C()(bt.Z,Ct),bt.Z&&bt.Z.locals&&bt.Z.locals;const yt=(0,T.Z)(wt,(function(){var t=this,e=t._self._c;return t.storageStats?e("NcAppNavigationItem",{staticClass:"app-navigation-entry__settings-quota",class:{"app-navigation-entry__settings-quota--not-unlimited":t.storageStats.quota>=0},attrs:{"aria-label":t.t("files","Storage informations"),loading:t.loadingStorageStats,name:t.storageStatsTitle,title:t.storageStatsTooltip,"data-cy-files-navigation-settings-quota":""},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.debounceUpdateStorageStats.apply(null,arguments)}}},[e("ChartPie",{attrs:{slot:"icon",size:20},slot:"icon"}),t._v(" "),t.storageStats.quota>=0?e("NcProgressBar",{attrs:{slot:"extra",error:t.storageStats.relative>80,value:Math.min(t.storageStats.relative,100)},slot:"extra"}):t._e()],1):t._e()}),[],!1,null,"918797b2",null).exports;var _t=i(68988),xt=i.n(_t),St=i(16809),kt=i.n(St),Nt=i(20571),It=i.n(Nt),Et=i(70386),Ft=i(36029),Bt=i.n(Ft);const Pt={name:"Setting",props:{el:{type:Function,required:!0}},mounted(){this.$el.appendChild(this.el())}},zt=(0,T.Z)(Pt,(function(){return(0,this._self._c)("div")}),[],!1,null,null,null).exports,Tt=(0,s.j)("files","config",{show_hidden:!1,crop_image_previews:!0}),Lt=()=>{const t=(0,tt.Q_)("userconfig",{state:()=>({userConfig:Tt}),actions:{onUpdate(t,e){u.default.set(this.userConfig,t,e)},async update(t,e){await d.default.post((0,a.generateUrl)("/apps/files/api/v1/config/"+t),{value:e}),(0,G.j8)("files:config:updated",{key:t,value:e})}}})();return t._initialized||((0,G.Ld)("files:config:updated",(function(e){let{key:n,value:i}=e;t.onUpdate(n,i)})),t._initialized=!0),t},Vt={name:"Settings",components:{Clipboard:Et.Z,NcAppSettingsDialog:xt(),NcAppSettingsSection:kt(),NcCheckboxRadioSwitch:It(),NcInputField:Bt(),Setting:zt},props:{open:{type:Boolean,default:!1}},setup:()=>({userConfigStore:Lt()}),data(){var t,e,n,i;return{settings:(null===(t=window.OCA)||void 0===t||null===(e=t.Files)||void 0===e||null===(n=e.Settings)||void 0===n?void 0:n.settings)||[],webdavUrl:(0,a.generateRemoteUrl)("dav/files/"+encodeURIComponent(null===(i=(0,l.ts)())||void 0===i?void 0:i.uid)),webdavDocs:"https://docs.nextcloud.com/server/stable/go.php?to=user-webdav",appPasswordUrl:(0,a.generateUrl)("/settings/user/security#generate-app-token-section"),webdavUrlCopied:!1}},computed:{userConfig(){return this.userConfigStore.userConfig}},beforeMount(){this.settings.forEach((t=>t.open()))},beforeDestroy(){this.settings.forEach((t=>t.close()))},methods:{onClose(){this.$emit("close")},setConfig(t,e){this.userConfigStore.update(t,e)},async copyCloudId(){document.querySelector("input#webdav-url-input").select(),navigator.clipboard?(await navigator.clipboard.writeText(this.webdavUrl),this.webdavUrlCopied=!0,(0,h.s$)(t("files","WebDAV URL copied to clipboard")),setTimeout((()=>{this.webdavUrlCopied=!1}),5e3)):(0,h.x2)(t("files","Clipboard is not available"))},t:r.Iu}},Ut=Vt;var Dt=i(35662),Ot={};Ot.styleTagTransform=B(),Ot.setAttributes=N(),Ot.insert=S().bind(null,"head"),Ot.domAPI=_(),Ot.insertStyleElement=E(),C()(Dt.Z,Ot),Dt.Z&&Dt.Z.locals&&Dt.Z.locals;const Zt=(0,T.Z)(Ut,(function(){var t=this,e=t._self._c;return e("NcAppSettingsDialog",{attrs:{open:t.open,"show-navigation":!0,title:t.t("files","Files settings")},on:{"update:open":t.onClose}},[e("NcAppSettingsSection",{attrs:{id:"settings",title:t.t("files","Files settings")}},[e("NcCheckboxRadioSwitch",{attrs:{checked:t.userConfig.show_hidden},on:{"update:checked":function(e){return t.setConfig("show_hidden",e)}}},[t._v("\n\t\t\t"+t._s(t.t("files","Show hidden files"))+"\n\t\t")]),t._v(" "),e("NcCheckboxRadioSwitch",{attrs:{checked:t.userConfig.crop_image_previews},on:{"update:checked":function(e){return t.setConfig("crop_image_previews",e)}}},[t._v("\n\t\t\t"+t._s(t.t("files","Crop image previews"))+"\n\t\t")])],1),t._v(" "),0!==t.settings.length?e("NcAppSettingsSection",{attrs:{id:"more-settings",title:t.t("files","Additional settings")}},[t._l(t.settings,(function(t){return[e("Setting",{key:t.name,attrs:{el:t.el}})]}))],2):t._e(),t._v(" "),e("NcAppSettingsSection",{attrs:{id:"webdav",title:t.t("files","WebDAV")}},[e("NcInputField",{attrs:{id:"webdav-url-input","show-trailing-button":!0,success:t.webdavUrlCopied,"trailing-button-label":t.t("files","Copy to clipboard"),value:t.webdavUrl,readonly:"readonly",type:"url"},on:{focus:function(t){return t.target.select()},"trailing-button-click":t.copyCloudId},scopedSlots:t._u([{key:"trailing-button-icon",fn:function(){return[e("Clipboard",{attrs:{size:20}})]},proxy:!0}])}),t._v(" "),e("em",[e("a",{staticClass:"setting-link",attrs:{href:t.webdavDocs,target:"_blank",rel:"noreferrer noopener"}},[t._v("\n\t\t\t\t"+t._s(t.t("files","Use this address to access your Files via WebDAV"))+" ↗\n\t\t\t")])]),t._v(" "),e("br"),t._v(" "),e("em",[e("a",{staticClass:"setting-link",attrs:{href:t.appPasswordUrl}},[t._v("\n\t\t\t\t"+t._s(t.t("files","If you have enabled 2FA, you must create and use a new app password by clicking here."))+" ↗\n\t\t\t")])])],1)],1)}),[],!1,null,"76ca5d1f",null).exports;const Mt={name:"Navigation",components:{Cog:lt.default,NavigationQuota:yt,NcAppNavigation:dt(),NcAppNavigationItem:pt(),NcIconSvgWrapper:ft(),SettingsModal:Zt},props:{Navigation:{type:ot,required:!0}},data:()=>({settingsOpened:!1}),computed:{currentViewId(){var t,e;return(null===(t=this.$route)||void 0===t||null===(e=t.params)||void 0===e?void 0:e.view)||"files"},currentView(){return this.views.find((t=>t.id===this.currentViewId))},views(){return this.Navigation.views},parentViews(){return this.views.filter((t=>!t.parent)).sort(((t,e)=>t.order-e.order))},childViews(){return this.views.filter((t=>!!t.parent)).reduce(((t,e)=>(t[e.parent]=[...t[e.parent]||[],e],t[e.parent].sort(((t,e)=>t.order-e.order)),t)),{})}},watch:{currentView(t,e){(null==t?void 0:t.id)!==(null==e?void 0:e.id)&&(this.Navigation.setActive(t),Q.debug("Navigation changed",{id:t.id,view:t}),this.showView(t,e))}},beforeMount(){this.currentView&&(Q.debug("Navigation mounted. Showing requested view",{view:this.currentView}),this.showView(this.currentView)),(0,G.Ld)("files:legacy-navigation:changed",this.onLegacyNavigationChanged),(0,G.Ld)("files:legacy-view:initialized",(()=>{Q.debug("Legacy view initialized",{...this.currentView}),this.showView(this.currentView)}))},methods:{showView(t,e){var n,i,o,s,r;if(null===(n=window)||void 0===n||null===(i=n.OCA)||void 0===i||null===(o=i.Files)||void 0===o||null===(s=o.Sidebar)||void 0===s||null===(r=s.close)||void 0===r||r.call(s),null!=t&&t.legacy){const e=document.querySelector("#app-content #app-content-"+this.currentView.id+".viewcontainer");document.querySelectorAll("#app-content .viewcontainer").forEach((t=>{t.classList.add("hidden")})),e.classList.remove("hidden");const{dir:n="/"}=OC.Util.History.parseUrlQuery(),i={itemId:t.id,dir:n};Q.debug("Triggering legacy navigation event",i),window.jQuery(e).trigger(new window.jQuery.Event("show",i)),window.jQuery(e).trigger(new window.jQuery.Event("urlChanged",i))}this.Navigation.setActive(t),function(t){const e=document.getElementById("page-heading-level-1");e&&(e.textContent=t)}(t.name),(0,G.j8)("files:navigation:changed",t)},onLegacyNavigationChanged(){let{id:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:"files"};const e=this.Navigation.views.find((e=>e.id===t));e&&e.legacy&&e.id!==this.currentView.id&&(this.$router.replace({...this.$route,params:{view:e.id}}),this.Navigation.setActive(e),this.showView(e))},onToggleExpand(t){t.expanded=!t.expanded,d.default.post((0,a.generateUrl)("/apps/files/api/v1/toggleShowFolder/".concat(t.id)),{show:t.expanded})},generateToNavigation(t){if(t.params){const{dir:e,fileid:n}=t.params;return{name:"filelist",params:t.params,query:{dir:e,fileid:n}}}return{name:"filelist",params:{view:t.id}}},openSettings(){this.settingsOpened=!0},onSettingsClose(){this.settingsOpened=!1},t:r.Iu}},Rt=Mt;var qt=i(17867),jt={};jt.styleTagTransform=B(),jt.setAttributes=N(),jt.insert=S().bind(null,"head"),jt.domAPI=_(),jt.insertStyleElement=E(),C()(qt.Z,jt),qt.Z&&qt.Z.locals&&qt.Z.locals;const $t=(0,T.Z)(Rt,(function(){var t=this,e=t._self._c;return e("NcAppNavigation",{attrs:{"data-cy-files-navigation":""},scopedSlots:t._u([{key:"list",fn:function(){return t._l(t.parentViews,(function(n){return e("NcAppNavigationItem",{key:n.id,attrs:{"allow-collapse":!0,"data-cy-files-navigation-item":n.id,icon:n.iconClass,open:n.expanded,pinned:n.sticky,title:n.name,to:t.generateToNavigation(n)},on:{"update:open":function(e){return t.onToggleExpand(n)}}},[n.icon?e("NcIconSvgWrapper",{attrs:{slot:"icon",svg:n.icon},slot:"icon"}):t._e(),t._v(" "),t._l(t.childViews[n.id],(function(i){return e("NcAppNavigationItem",{key:i.id,attrs:{"data-cy-files-navigation-item":i.id,exact:!0,icon:i.iconClass,title:i.name,to:t.generateToNavigation(i)}},[n.icon?e("NcIconSvgWrapper",{attrs:{slot:"icon",svg:n.icon},slot:"icon"}):t._e()],1)}))],2)}))},proxy:!0},{key:"footer",fn:function(){return[e("ul",{staticClass:"app-navigation-entry__settings"},[e("NavigationQuota"),t._v(" "),e("NcAppNavigationItem",{attrs:{"aria-label":t.t("files","Open the files app settings"),title:t.t("files","Files settings"),"data-cy-files-navigation-settings-button":""},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.openSettings.apply(null,arguments)}}},[e("Cog",{attrs:{slot:"icon",size:20},slot:"icon"})],1)],1)]},proxy:!0}])},[t._v(" "),t._v(" "),e("SettingsModal",{attrs:{open:t.settingsOpened,"data-cy-files-navigation-settings":""},on:{close:t.onSettingsClose}})],1)}),[],!1,null,"d66c4bda",null).exports;var Wt=i(23664),Gt=i(69680),Ht=i.n(Gt),Kt=i(10861),Qt=i.n(Kt),Yt=i(64192),Jt=i.n(Yt),Xt=i(33581);const te=()=>{const t=(0,tt.Q_)("files",{state:()=>({files:{},roots:{}}),getters:{getNode:t=>e=>t.files[e],getNodes:t=>e=>e.map((e=>t.files[e])).filter(Boolean),getRoot:t=>e=>t.roots[e]},actions:{updateNodes(t){const e=t.reduce(((t,e)=>e.attributes.fileid?(t[e.attributes.fileid]=e,t):(Q.warn("Trying to update/set a node without fileid",e),t)),{});u.default.set(this,"files",{...this.files,...e})},deleteNodes(t){t.forEach((t=>{t.fileid&&u.default.delete(this.files,t.fileid)}))},setRoot(t){let{service:e,root:n}=t;u.default.set(this.roots,e,n)},onDeletedNode(t){this.deleteNodes([t])}}})();return t._initialized||((0,G.Ld)("files:node:deleted",t.onDeletedNode),t._initialized=!0),t},ee=()=>{const t=(0,tt.Q_)("paths",{state:()=>({}),getters:{getPath:t=>(e,n)=>{if(t[e])return t[e][n]}},actions:{addPath(t){this[t.service]||u.default.set(this,t.service,{}),u.default.set(this[t.service],t.path,t.fileid)}}})();return t._initialized||(t._initialized=!0),t},ne=(0,tt.Q_)("selection",{state:()=>({selected:[],lastSelection:[],lastSelectedIndex:null}),actions:{set(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];u.default.set(this,"selected",t)},setLastIndex(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.default.set(this,"lastSelection",t?this.selected:[]),u.default.set(this,"lastSelectedIndex",t)},reset(){u.default.set(this,"selected",[]),u.default.set(this,"lastSelection",[]),u.default.set(this,"lastSelectedIndex",null)}}}),ie=(t,e,n)=>d.default.post((0,a.generateUrl)("/apps/files/api/v1/sorting"),{mode:t,direction:e,view:n}),oe=(0,s.j)("files","filesSortingConfig",{}),se=(0,tt.Q_)("sorting",{state:()=>({filesSortingConfig:oe}),getters:{isAscSorting:t=>function(){var e;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"files";return"desc"!==(null===(e=t.filesSortingConfig[n])||void 0===e?void 0:e.direction)},getSortingMode:t=>function(){var e;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"files";return null===(e=t.filesSortingConfig[n])||void 0===e?void 0:e.mode}},actions:{setSortingBy(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"basename",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"files";const n=this.filesSortingConfig[e]||{};n.mode=t,n.direction="asc",u.default.set(this.filesSortingConfig,e,n),ie(n.mode,n.direction,e)},toggleSortingDirection(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"files";const e=this.filesSortingConfig[t]||{direction:"asc"},n="asc"===e.direction?"desc":"asc";e.direction=n,u.default.set(this.filesSortingConfig,t,e),ie(e.mode,e.direction,t)}}});var re=i(15764),ae=i(64412),le=i.n(ae),ce=i(44706),de=i.n(ce);const ue=u.default.extend({name:"BreadCrumbs",components:{Home:re.Z,NcBreadcrumbs:de(),NcBreadcrumb:le()},props:{path:{type:String,default:"/"}},setup:()=>({filesStore:te(),pathsStore:ee()}),computed:{currentView(){return this.$navigation.active},dirs(){var t;return["/",...this.path.split("/").filter(Boolean).map((t="/",e=>t+="".concat(e,"/"))).map((t=>t.replace(/^(.+)\/$/,"$1")))]},sections(){return this.dirs.map((t=>{const e={...this.$route,query:{dir:t}};return{dir:t,exact:!0,name:this.getDirDisplayName(t),to:e}}))}},methods:{getNodeFromId(t){return this.filesStore.getNode(t)},getFileIdFromPath(t){var e;return this.pathsStore.getPath(null===(e=this.currentView)||void 0===e?void 0:e.id,t)},getDirDisplayName(e){var n;if("/"===e)return t("files","Home");const i=this.getFileIdFromPath(e),o=this.getNodeFromId(i);return(null==o||null===(n=o.attributes)||void 0===n?void 0:n.displayName)||(0,p.basename)(e)},onClick(t){var e;(null==t||null===(e=t.query)||void 0===e?void 0:e.dir)===this.$route.query.dir&&this.$emit("reload")},ariaLabel(e){var n,i;return(null==e||null===(n=e.to)||void 0===n||null===(i=n.query)||void 0===i?void 0:i.dir)===this.$route.query.dir?t("files","Reload current directory"):t("files",'Go to the "{dir}" directory',e)}}});var pe=i(39959),he={};he.styleTagTransform=B(),he.setAttributes=N(),he.insert=S().bind(null,"head"),he.domAPI=_(),he.insertStyleElement=E(),C()(pe.Z,he),pe.Z&&pe.Z.locals&&pe.Z.locals;const fe=(0,T.Z)(ue,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("NcBreadcrumbs",{attrs:{"data-cy-files-content-breadcrumbs":""}},t._l(t.sections,(function(n,i){return e("NcBreadcrumb",t._b({key:n.dir,attrs:{"aria-label":t.ariaLabel(n),title:t.ariaLabel(n)},nativeOn:{click:function(e){return t.onClick(n.to)}},scopedSlots:t._u([0===i?{key:"icon",fn:function(){return[e("Home",{attrs:{size:20}})]},proxy:!0}:null],null,!0)},"NcBreadcrumb",n,!1))})),1)}),[],!1,null,"68b3b20b",null).exports;var Ae=i(35212),me=i(20296),ve=i(74139),ge=i(3443),we=i.n(ge),be=i(79855),Ce=i(34829),ye=i(45400),_e=i.n(ye),xe=i(12945),Se=i.n(xe);const ke=(0,tt.Q_)("actionsmenu",{state:()=>({opened:null})}),Ne=()=>{const t=(0,tt.Q_)("keyboard",{state:()=>({altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1}),actions:{onEvent(t){t||(t=window.event),u.default.set(this,"altKey",!!t.altKey),u.default.set(this,"ctrlKey",!!t.ctrlKey),u.default.set(this,"metaKey",!!t.metaKey),u.default.set(this,"shiftKey",!!t.shiftKey)}}})();return t._initialized||(window.addEventListener("keydown",t.onEvent),window.addEventListener("keyup",t.onEvent),window.addEventListener("mousemove",t.onEvent),t._initialized=!0),t},Ie={name:"CustomElementRender",props:{source:{type:Object,required:!0},currentView:{type:Object,required:!0},render:{type:Function,required:!0}},computed:{element(){return this.render(this.source,this.currentView)}},watch:{element(){this.$el.replaceWith(this.element),this.$el=this.element}},mounted(){this.$el.replaceWith(this.element),this.$el=this.element}},Ee=(0,T.Z)(Ie,(function(){return(0,this._self._c)("span")}),[],!1,null,null,null).exports;var Fe=i(27856);const Be={name:"CustomSvgIconRender",props:{svg:{type:String,required:!0}},watch:{svg(){this.$el.innerHTML=(0,Fe.sanitize)(this.svg)}},mounted(){this.$el.innerHTML=(0,Fe.sanitize)(this.svg)}};var Pe=i(61959),ze={};ze.styleTagTransform=B(),ze.setAttributes=N(),ze.insert=S().bind(null,"head"),ze.domAPI=_(),ze.insertStyleElement=E(),C()(Pe.Z,ze),Pe.Z&&Pe.Z.locals&&Pe.Z.locals;const Te=(0,T.Z)(Be,(function(){return(0,this._self._c)("span",{staticClass:"custom-svg-icon"})}),[],!1,null,"93e9b2f4",null).exports,Le=Y(),Ve=u.default.extend({name:"FileEntry",components:{CustomElementRender:Ee,CustomSvgIconRender:Te,FileIcon:be.Z,FolderIcon:Ce.default,Fragment:ve.H,NcActionButton:_e(),NcActions:Se(),NcCheckboxRadioSwitch:It(),NcLoadingIcon:Jt()},props:{active:{type:Boolean,default:!1},isSizeAvailable:{type:Boolean,default:!1},source:{type:Object,required:!0},index:{type:Number,required:!0},nodes:{type:Array,required:!0},filesListWidth:{type:Number,default:0}},setup:()=>({actionsMenuStore:ke(),filesStore:te(),keyboardStore:Ne(),selectionStore:ne(),userConfigStore:Lt()}),data:()=>({backgroundFailed:!1,backgroundImage:"",loading:""}),computed:{userConfig(){return this.userConfigStore.userConfig},currentView(){return this.$navigation.active},columns(){var t;return this.filesListWidth<512?[]:(null===(t=this.currentView)||void 0===t?void 0:t.columns)||[]},dir(){var t,e;return((null===(t=this.$route)||void 0===t||null===(e=t.query)||void 0===e?void 0:e.dir)||"/").replace(/^(.+)\/$/,"$1")},fileid(){var t,e,n;return null===(t=this.source)||void 0===t||null===(e=t.fileid)||void 0===e||null===(n=e.toString)||void 0===n?void 0:n.call(e)},displayName(){return this.source.attributes.displayName||this.source.basename},size(){const t=parseInt(this.source.size,10)||0;return"number"!=typeof t||t<0?this.t("files","Pending"):(0,H.sS)(t,!0)},sizeOpacity(){const t=parseInt(this.source.size,10)||0;return!t||t<0?1:.7+(1-.7)*Math.pow(this.source.size/10485760,2)},linkTo(){if("folder"===this.source.type){const t={...this.$route,query:{dir:(0,p.join)(this.dir,this.source.basename)}};return{is:"router-link",title:this.t("files","Open folder {name}",{name:this.displayName}),to:t}}return{href:this.source.source,title:this.t("files","Download file {name}",{name:this.displayName})}},selectedFiles(){return this.selectionStore.selected},isSelected(){var t,e,n;return this.selectedFiles.includes(null===(t=this.source)||void 0===t||null===(e=t.fileid)||void 0===e||null===(n=e.toString)||void 0===n?void 0:n.call(e))},cropPreviews(){return this.userConfig.crop_image_previews},previewUrl(){try{const t=new URL(window.location.origin+this.source.attributes.previewUrl);return t.searchParams.set("x","32"),t.searchParams.set("y","32"),t.searchParams.set("a",!0===this.cropPreviews?"1":"0"),t.href}catch(t){return null}},mimeIconUrl(){var t,e,n;const i=this.source.mime||"application/octet-stream",o=null===(t=window.OC)||void 0===t||null===(e=t.MimeType)||void 0===e||null===(n=e.getIconUrl)||void 0===n?void 0:n.call(e,i);return o?"url(".concat(o,")"):""},enabledActions(){return Le.filter((t=>!t.enabled||t.enabled([this.source],this.currentView))).sort(((t,e)=>(t.order||0)-(e.order||0)))},enabledInlineActions(){return this.filesListWidth<768?[]:this.enabledActions.filter((t=>{var e;return null==t||null===(e=t.inline)||void 0===e?void 0:e.call(t,this.source,this.currentView)}))},enabledMenuActions(){return this.filesListWidth<768?this.enabledActions:[...this.enabledInlineActions,...this.enabledActions.filter((t=>!t.inline))]},uniqueId(){return this.hashCode(this.source.source)},openedMenu:{get(){return this.actionsMenuStore.opened===this.uniqueId},set(t){this.actionsMenuStore.opened=t?this.uniqueId:null}}},watch:{active(t,e){if(!1===t&&!0===e)return this.resetState(),void(this.$el.parentNode.style.display="none");this.$el.parentNode.style.display=""},previewUrl(){this.clearImg(),this.debounceIfNotCached()}},mounted(){var t,e;this.debounceGetPreview=(0,me.debounce)((function(){this.fetchAndApplyPreview()}),150,!1),this.debounceIfNotCached(),null===(t=this.$el.parentNode)||void 0===t||null===(e=t.addEventListener)||void 0===e||e.call(t,"contextmenu",this.onRightClick)},beforeDestroy(){this.resetState()},methods:{async debounceIfNotCached(){var t;if(this.previewUrl)return await(t=this.previewUrl,caches.open("previews").then((function(e){return e.match(t).then((function(t){return!!t}))})))?(this.backgroundImage="url(".concat(this.previewUrl,")"),void(this.backgroundFailed=!1)):void this.debounceGetPreview()},fetchAndApplyPreview(){this.previewUrl&&(this.previewPromise&&this.clearImg(),this.previewPromise=new(we())(((t,e,n)=>{const i=new Image;i.fetchpriority=this.active?"high":"auto",i.onload=()=>{this.backgroundImage="url(".concat(this.previewUrl,")"),this.backgroundFailed=!1,t(i)},i.onerror=()=>{this.backgroundFailed=!0,e(i)},i.src=this.previewUrl,n((()=>{i.onerror=null,i.onload=null,i.src=""}))})))},resetState(){this.loading="",this.clearImg(),this.openedMenu=!1},clearImg(){this.backgroundImage="",this.backgroundFailed=!1,this.previewPromise&&(this.previewPromise.cancel(),this.previewPromise=null)},hashCode(t){let e=0;for(let n=0,i=t.length;n<i;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e},async onActionClick(t){const e=t.displayName([this.source],this.currentView);try{if(this.loading=t.id,u.default.set(this.source,"_loading",!0),await t.exec(this.source,this.currentView))return void(0,h.s$)(this.t("files",'"{displayName}" action executed successfully',{displayName:e}));(0,h.x2)(this.t("files",'"{displayName}" action failed',{displayName:e}))}catch(n){Q.error("Error while executing action",{action:t,e:n}),(0,h.x2)(this.t("files",'"{displayName}" action failed',{displayName:e}))}finally{this.loading="",u.default.set(this.source,"_loading",!1)}},onSelectionChange(t){var e;const n=this.index,i=this.selectionStore.lastSelectedIndex;if(null!==(e=this.keyboardStore)&&void 0!==e&&e.shiftKey&&null!==i){const t=this.selectedFiles.includes(this.fileid),e=Math.min(n,i),o=Math.max(i,n),s=this.selectionStore.lastSelection,r=this.nodes.map((t=>{var e,n;return null===(e=t.fileid)||void 0===e||null===(n=e.toString)||void 0===n?void 0:n.call(e)})).slice(e,o+1),a=[...s,...r].filter((e=>!t||e!==this.fileid));return Q.debug("Shift key pressed, selecting all files in between",{start:e,end:o,filesToSelect:r,isAlreadySelected:t}),void this.selectionStore.set(a)}Q.debug("Updating selection",{selection:t}),this.selectionStore.set(t),this.selectionStore.setLastIndex(n)},onRightClick(t){if(this.openedMenu)return;const e=this.selectedFiles.length>1;this.actionsMenuStore.opened=this.isSelected&&e?"global":this.uniqueId,t.preventDefault(),t.stopPropagation()},t:r.Iu,formatFileSize:H.sS}}),Ue=Ve;var De=i(75934),Oe={};Oe.styleTagTransform=B(),Oe.setAttributes=N(),Oe.insert=S().bind(null,"head"),Oe.domAPI=_(),Oe.insertStyleElement=E(),C()(De.Z,Oe),De.Z&&De.Z.locals&&De.Z.locals;var Ze=i(96669),Me={};Me.styleTagTransform=B(),Me.setAttributes=N(),Me.insert=S().bind(null,"head"),Me.domAPI=_(),Me.insertStyleElement=E(),C()(Ze.Z,Me),Ze.Z&&Ze.Z.locals&&Ze.Z.locals;var Re=(0,T.Z)(Ue,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("Fragment",[e("td",{staticClass:"files-list__row-checkbox"},[t.active?e("NcCheckboxRadioSwitch",{attrs:{"aria-label":t.t("files","Select the row for {displayName}",{displayName:t.displayName}),checked:t.selectedFiles,value:t.fileid,name:"selectedFiles"},on:{"update:checked":t.onSelectionChange}}):t._e()],1),t._v(" "),e("td",{staticClass:"files-list__row-name"},[e("a",t._b({ref:"name"},"a",t.linkTo,!1),[e("span",{staticClass:"files-list__row-icon"},["folder"===t.source.type?e("FolderIcon"):t.previewUrl&&!t.backgroundFailed?e("span",{ref:"previewImg",staticClass:"files-list__row-icon-preview",style:{backgroundImage:t.backgroundImage}}):t.mimeIconUrl?e("span",{staticClass:"files-list__row-icon-preview files-list__row-icon-preview--mime",style:{backgroundImage:t.mimeIconUrl}}):e("FileIcon")],1),t._v(" "),e("span",{staticClass:"files-list__row-name-text"},[t._v(t._s(t.displayName))])])]),t._v(" "),e("td",{staticClass:"files-list__row-actions",class:"files-list__row-actions-".concat(t.uniqueId)},[t.active?e("NcActions",{ref:"actionsMenu",attrs:{disabled:t.source._loading,"force-title":!0,inline:t.enabledInlineActions.length,open:t.openedMenu},on:{"update:open":function(e){t.openedMenu=e}}},t._l(t.enabledMenuActions,(function(n){return e("NcActionButton",{key:n.id,class:"files-list__row-action-"+n.id,on:{click:function(e){return t.onActionClick(n)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading===n.id?e("NcLoadingIcon",{attrs:{size:18}}):e("CustomSvgIconRender",{attrs:{svg:n.iconSvgInline([t.source],t.currentView)}})]},proxy:!0}],null,!0)},[t._v("\n\t\t\t\t"+t._s(n.displayName([t.source],t.currentView))+"\n\t\t\t")])})),1):t._e()],1),t._v(" "),t.isSizeAvailable?e("td",{staticClass:"files-list__row-size",style:{opacity:t.sizeOpacity}},[e("span",[t._v(t._s(t.size))])]):t._e(),t._v(" "),t._l(t.columns,(function(n){var i;return e("td",{key:n.id,staticClass:"files-list__row-column-custom",class:"files-list__row-".concat(null===(i=t.currentView)||void 0===i?void 0:i.id,"-").concat(n.id)},[t.active?e("CustomElementRender",{attrs:{"current-view":t.currentView,render:n.render,source:t.source}}):t._e()],1)}))],2)}),[],!1,null,"47057834",null);const qe=Re.exports,je=u.default.extend({name:"FilesListFooter",components:{},props:{isSizeAvailable:{type:Boolean,default:!1},nodes:{type:Array,required:!0},summary:{type:String,default:""},filesListWidth:{type:Number,default:0}},setup(){const t=ee();return{filesStore:te(),pathsStore:t}},computed:{currentView(){return this.$navigation.active},dir(){var t,e;return((null===(t=this.$route)||void 0===t||null===(e=t.query)||void 0===e?void 0:e.dir)||"/").replace(/^(.+)\/$/,"$1")},currentFolder(){var t;if(null===(t=this.currentView)||void 0===t||!t.id)return;if("/"===this.dir)return this.filesStore.getRoot(this.currentView.id);const e=this.pathsStore.getPath(this.currentView.id,this.dir);return this.filesStore.getNode(e)},columns(){var t;return this.filesListWidth<512?[]:(null===(t=this.currentView)||void 0===t?void 0:t.columns)||[]},totalSize(){var t;return null!==(t=this.currentFolder)&&void 0!==t&&t.size?(0,H.sS)(this.currentFolder.size,!0):(0,H.sS)(this.nodes.reduce(((t,e)=>t+e.size||0),0),!0)}},methods:{classForColumn(t){return{"files-list__row-column-custom":!0,["files-list__row-".concat(this.currentView.id,"-").concat(t.id)]:!0}},t:r.Iu}});var $e=i(97105),We={};We.styleTagTransform=B(),We.setAttributes=N(),We.insert=S().bind(null,"head"),We.domAPI=_(),We.insertStyleElement=E(),C()($e.Z,We),$e.Z&&$e.Z.locals&&$e.Z.locals;const Ge=(0,T.Z)(je,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("tr",[e("th",{staticClass:"files-list__row-checkbox"},[e("span",{staticClass:"hidden-visually"},[t._v(t._s(t.t("files","Total rows summary")))])]),t._v(" "),e("td",{staticClass:"files-list__row-name"},[e("span",{staticClass:"files-list__row-icon"}),t._v(" "),e("span",[t._v(t._s(t.summary))])]),t._v(" "),e("td",{staticClass:"files-list__row-actions"}),t._v(" "),t.isSizeAvailable?e("td",{staticClass:"files-list__column files-list__row-size"},[e("span",[t._v(t._s(t.totalSize))])]):t._e(),t._v(" "),t._l(t.columns,(function(n){var i;return e("th",{key:n.id,class:t.classForColumn(n)},[e("span",[t._v(t._s(null===(i=n.summary)||void 0===i?void 0:i.call(n,t.nodes,t.currentView)))])])}))],2)}),[],!1,null,"e6a083be",null).exports,He=u.default.extend({data:()=>({filesListWidth:null}),created(){const t=document.querySelector("#app-content-vue");this.$resizeObserver=new ResizeObserver((e=>{e.length>0&&e[0].target===t&&(this.filesListWidth=e[0].contentRect.width)})),this.$resizeObserver.observe(t)},beforeDestroy(){this.$resizeObserver.disconnect()}}),Ke=Y(),Qe=u.default.extend({name:"FilesListHeaderActions",components:{CustomSvgIconRender:Te,NcActions:Se(),NcActionButton:_e(),NcLoadingIcon:Jt()},mixins:[He],props:{currentView:{type:Object,required:!0},selectedNodes:{type:Array,default:()=>[]}},setup:()=>({actionsMenuStore:ke(),filesStore:te(),selectionStore:ne()}),data:()=>({loading:null}),computed:{enabledActions(){return Ke.filter((t=>t.execBatch)).filter((t=>!t.enabled||t.enabled(this.nodes,this.currentView))).sort(((t,e)=>(t.order||0)-(e.order||0)))},nodes(){return this.selectedNodes.map((t=>this.getNode(t))).filter((t=>t))},areSomeNodesLoading(){return this.nodes.some((t=>t._loading))},openedMenu:{get(){return"global"===this.actionsMenuStore.opened},set(t){this.actionsMenuStore.opened=t?"global":null}},inlineActions(){return this.filesListWidth<512?0:this.filesListWidth<768?1:this.filesListWidth<1024?2:3}},methods:{getNode(t){return this.filesStore.getNode(t)},async onActionClick(t){const e=t.displayName(this.nodes,this.currentView),n=this.selectedNodes;try{this.loading=t.id,this.nodes.forEach((t=>{u.default.set(t,"_loading",!0)}));const i=await t.execBatch(this.nodes,this.currentView);if(i.some((t=>!0!==t))){const t=n.filter(((t,e)=>!0!==i[e]));return this.selectionStore.set(t),void(0,h.x2)(this.t("files",'"{displayName}" failed on some elements ',{displayName:e}))}(0,h.s$)(this.t("files",'"{displayName}" batch action executed successfully',{displayName:e})),this.selectionStore.reset()}catch(n){Q.error("Error while executing action",{action:t,e:n}),(0,h.x2)(this.t("files",'"{displayName}" action failed',{displayName:e}))}finally{this.loading=null,this.nodes.forEach((t=>{u.default.set(t,"_loading",!1)}))}},t:r.Iu}}),Ye=Qe;var Je=i(19505),Xe={};Xe.styleTagTransform=B(),Xe.setAttributes=N(),Xe.insert=S().bind(null,"head"),Xe.domAPI=_(),Xe.insertStyleElement=E(),C()(Je.Z,Xe),Je.Z&&Je.Z.locals&&Je.Z.locals;var tn=(0,T.Z)(Ye,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("th",{staticClass:"files-list__column files-list__row-actions-batch",attrs:{colspan:"2"}},[e("NcActions",{ref:"actionsMenu",attrs:{disabled:!!t.loading||t.areSomeNodesLoading,"force-title":!0,inline:t.inlineActions,"menu-title":t.inlineActions<=1?t.t("files","Actions"):null,open:t.openedMenu},on:{"update:open":function(e){t.openedMenu=e}}},t._l(t.enabledActions,(function(n){return e("NcActionButton",{key:n.id,class:"files-list__row-actions-batch-"+n.id,on:{click:function(e){return t.onActionClick(n)}},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loading===n.id?e("NcLoadingIcon",{attrs:{size:18}}):e("CustomSvgIconRender",{attrs:{svg:n.iconSvgInline(t.nodes,t.currentView)}})]},proxy:!0}],null,!0)},[t._v("\n\t\t\t"+t._s(n.displayName(t.nodes,t.currentView))+"\n\t\t")])})),1)],1)}),[],!1,null,"9d92da06",null);const en=tn.exports;var nn=i(20404),on=i(23873);const sn=u.default.extend({name:"FilesListHeaderButton",components:{MenuDown:nn.Z,MenuUp:on.Z,NcButton:Qt()},inject:["toggleSortBy"],props:{name:{type:String,required:!0},mode:{type:String,required:!0}},setup:()=>({sortingStore:se()}),computed:{...(0,tt.rn)(se,["filesSortingConfig"]),currentView(){return this.$navigation.active},sortingMode(){return this.sortingStore.getSortingMode(this.currentView.id)||this.currentView.defaultSortKey||"basename"},isAscSorting(){return!0===this.sortingStore.isAscSorting(this.currentView.id)}},methods:{sortAriaLabel(t){const e=this.isAscSorting?this.t("files","ascending"):this.t("files","descending");return this.t("files","Sort list by {column} ({direction})",{column:t,direction:e})},t:r.Iu}});var rn=i(85036),an={};an.styleTagTransform=B(),an.setAttributes=N(),an.insert=S().bind(null,"head"),an.domAPI=_(),an.insertStyleElement=E(),C()(rn.Z,an),rn.Z&&rn.Z.locals&&rn.Z.locals;const ln=(0,T.Z)(sn,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("NcButton",{staticClass:"files-list__column-sort-button",class:{"files-list__column-sort-button--active":t.sortingMode===t.mode},attrs:{"aria-label":t.sortAriaLabel(t.name),type:"tertiary"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.toggleSortBy(t.mode)}}},[t.sortingMode!==t.mode||t.isAscSorting?e("MenuUp",{attrs:{slot:"icon"},slot:"icon"}):e("MenuDown",{attrs:{slot:"icon"},slot:"icon"}),t._v("\n\t"+t._s(t.name)+"\n")],1)}),[],!1,null,null,null).exports,cn=u.default.extend({name:"FilesListHeader",components:{FilesListHeaderButton:ln,NcCheckboxRadioSwitch:It(),FilesListHeaderActions:en},provide(){return{toggleSortBy:this.toggleSortBy}},props:{isSizeAvailable:{type:Boolean,default:!1},nodes:{type:Array,required:!0},filesListWidth:{type:Number,default:0}},setup:()=>({filesStore:te(),selectionStore:ne(),sortingStore:se()}),computed:{...(0,tt.rn)(se,["filesSortingConfig"]),currentView(){return this.$navigation.active},columns(){var t;return this.filesListWidth<512?[]:(null===(t=this.currentView)||void 0===t?void 0:t.columns)||[]},dir(){var t,e;return((null===(t=this.$route)||void 0===t||null===(e=t.query)||void 0===e?void 0:e.dir)||"/").replace(/^(.+)\/$/,"$1")},selectAllBind(){const t=this.isNoneSelected||this.isSomeSelected?this.t("files","Select all"):this.t("files","Unselect all");return{"aria-label":t,checked:this.isAllSelected,indeterminate:this.isSomeSelected,title:t}},selectedNodes(){return this.selectionStore.selected},isAllSelected(){return this.selectedNodes.length===this.nodes.length},isNoneSelected(){return 0===this.selectedNodes.length},isSomeSelected(){return!this.isAllSelected&&!this.isNoneSelected},sortingMode(){return this.sortingStore.getSortingMode(this.currentView.id)||this.currentView.defaultSortKey||"basename"},isAscSorting(){return!0===this.sortingStore.isAscSorting(this.currentView.id)}},methods:{classForColumn(t){return{"files-list__column":!0,"files-list__column--sortable":!!t.sort,"files-list__row-column-custom":!0,["files-list__row-".concat(this.currentView.id,"-").concat(t.id)]:!0}},onToggleAll(t){if(t){const t=this.nodes.map((t=>t.attributes.fileid.toString()));Q.debug("Added all nodes to selection",{selection:t}),this.selectionStore.setLastIndex(null),this.selectionStore.set(t)}else Q.debug("Cleared selection"),this.selectionStore.reset()},toggleSortBy(t){this.sortingMode!==t?this.sortingStore.setSortingBy(t,this.currentView.id):this.sortingStore.toggleSortingDirection(this.currentView.id)},t:r.Iu}});var dn=i(64329),un={};un.styleTagTransform=B(),un.setAttributes=N(),un.insert=S().bind(null,"head"),un.domAPI=_(),un.insertStyleElement=E(),C()(dn.Z,un),dn.Z&&dn.Z.locals&&dn.Z.locals;const pn=(0,T.Z)(cn,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("tr",[e("th",{staticClass:"files-list__column files-list__row-checkbox"},[e("NcCheckboxRadioSwitch",t._b({on:{"update:checked":t.onToggleAll}},"NcCheckboxRadioSwitch",t.selectAllBind,!1))],1),t._v(" "),t.isNoneSelected?[e("th",{staticClass:"files-list__column files-list__row-name files-list__column--sortable",on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.toggleSortBy("basename")}}},[e("span",{staticClass:"files-list__row-icon"}),t._v(" "),e("FilesListHeaderButton",{attrs:{name:t.t("files","Name"),mode:"basename"}})],1),t._v(" "),e("th",{staticClass:"files-list__row-actions"}),t._v(" "),t.isSizeAvailable?e("th",{staticClass:"files-list__column files-list__row-size",class:{"files-list__column--sortable":t.isSizeAvailable}},[e("FilesListHeaderButton",{attrs:{name:t.t("files","Size"),mode:"size"}})],1):t._e(),t._v(" "),t._l(t.columns,(function(n){return e("th",{key:n.id,class:t.classForColumn(n)},[n.sort?e("FilesListHeaderButton",{attrs:{name:n.title,mode:n.id}}):e("span",[t._v("\n\t\t\t\t"+t._s(n.title)+"\n\t\t\t")])],1)}))]:e("FilesListHeaderActions",{attrs:{"current-view":t.currentView,"selected-nodes":t.selectedNodes}})],2)}),[],!1,null,"57bd4174",null).exports,hn=u.default.extend({name:"FilesListVirtual",components:{RecycleScroller:Ae.EK,FileEntry:qe,FilesListHeader:pn,FilesListFooter:Ge},mixins:[He],props:{currentView:{type:Object,required:!0},nodes:{type:Array,required:!0}},data:()=>({FileEntry:qe}),computed:{files(){return this.nodes.filter((t=>"file"===t.type))},summaryFile(){const t=this.files.length;return(0,r.uN)("files","{count} file","{count} files",t,{count:t})},summaryFolder(){const t=this.nodes.length-this.files.length;return(0,r.uN)("files","{count} folder","{count} folders",t,{count:t})},summary(){return(0,r.Iu)("files","{summaryFile} and {summaryFolder}",this)},isSizeAvailable(){return!(this.filesListWidth<768)&&this.nodes.some((t=>void 0!==t.attributes.size))}},mounted(){const t=this.$el.querySelectorAll(".vue-recycle-scroller__slot");t[0].setAttribute("role","thead"),t[1].setAttribute("role","tfoot")},methods:{getFileId:t=>t.attributes.fileid,t:r.Iu}});var fn=i(525),An={};An.styleTagTransform=B(),An.setAttributes=N(),An.insert=S().bind(null,"head"),An.domAPI=_(),An.insertStyleElement=E(),C()(fn.Z,An),fn.Z&&fn.Z.locals&&fn.Z.locals;const mn=(0,T.Z)(hn,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("RecycleScroller",{ref:"recycleScroller",staticClass:"files-list",attrs:{"key-field":"source",items:t.nodes,"item-size":55,"table-mode":!0,"item-class":"files-list__row","item-tag":"tr","list-class":"files-list__body","list-tag":"tbody",role:"table"},scopedSlots:t._u([{key:"default",fn:function(n){let{item:i,active:o,index:s}=n;return[e("FileEntry",{attrs:{active:o,index:s,"is-size-available":t.isSizeAvailable,"files-list-width":t.filesListWidth,nodes:t.nodes,source:i}})]}},{key:"before",fn:function(){return[e("caption",{staticClass:"hidden-visually"},[t._v("\n\t\t\t"+t._s(t.currentView.caption||"")+"\n\t\t\t"+t._s(t.t("files","This list is not fully rendered for performances reasons. The files will be rendered as you navigate through the list."))+"\n\t\t")]),t._v(" "),e("FilesListHeader",{attrs:{"files-list-width":t.filesListWidth,"is-size-available":t.isSizeAvailable,nodes:t.nodes}})]},proxy:!0},{key:"after",fn:function(){return[e("FilesListFooter",{attrs:{"files-list-width":t.filesListWidth,"is-size-available":t.isSizeAvailable,nodes:t.nodes,summary:t.summary}})]},proxy:!0}])})}),[],!1,null,"07b86e54",null).exports,vn=u.default.extend({name:"FilesList",components:{BreadCrumbs:fe,FilesListVirtual:mn,NcAppContent:Ht(),NcButton:Qt(),NcEmptyContent:A(),NcLoadingIcon:Jt(),TrashCan:Xt.Z},setup(){const t=ee();return{filesStore:te(),pathsStore:t,selectionStore:ne(),sortingStore:se()}},data:()=>({loading:!0,promise:null}),computed:{currentView(){return this.$navigation.active||this.$navigation.views.find((t=>"files"===t.id))},dir(){var t,e;return((null===(t=this.$route)||void 0===t||null===(e=t.query)||void 0===e?void 0:e.dir)||"/").replace(/^(.+)\/$/,"$1")},currentFolder(){var t;if(null===(t=this.currentView)||void 0===t||!t.id)return;if("/"===this.dir)return this.filesStore.getRoot(this.currentView.id);const e=this.pathsStore.getPath(this.currentView.id,this.dir);return this.filesStore.getNode(e)},sortingMode(){return this.sortingStore.getSortingMode(this.currentView.id)||this.currentView.defaultSortKey||"basename"},isAscSorting(){return!0===this.sortingStore.isAscSorting(this.currentView.id)},dirContents(){var t;if(!this.currentView)return[];const e=this.currentView.columns.find((t=>t.id===this.sortingMode));if(null!=e&&e.sort&&"function"==typeof e.sort){var n;const t=[...((null===(n=this.currentFolder)||void 0===n?void 0:n._children)||[]).map(this.getNode).filter((t=>t))].sort(e.sort);return this.isAscSorting?t:t.reverse()}return(0,Wt.X)([...((null===(t=this.currentFolder)||void 0===t?void 0:t._children)||[]).map(this.getNode).filter((t=>t))],[..."basename"===this.sortingMode?[t=>"folder"!==t.type]:[],t=>t[this.sortingMode],t=>t.basename],this.isAscSorting?["asc","asc","asc"]:["desc","desc","desc"])},isEmptyDir(){return 0===this.dirContents.length},isRefreshing(){return void 0!==this.currentFolder&&!this.isEmptyDir&&this.loading},toPreviousDir(){const t=this.dir.split("/").slice(0,-1).join("/")||"/";return{...this.$route,query:{dir:t}}}},watch:{currentView(t,e){(null==t?void 0:t.id)!==(null==e?void 0:e.id)&&(Q.debug("View changed",{newView:t,oldView:e}),this.selectionStore.reset(),this.fetchContent())},dir(t,e){var n,i;Q.debug("Directory changed",{newDir:t,oldDir:e}),this.selectionStore.reset(),this.fetchContent(),null!==(n=this.$refs)&&void 0!==n&&null!==(i=n.filesListVirtual)&&void 0!==i&&i.$el&&(this.$refs.filesListVirtual.$el.scrollTop=0)}},methods:{async fetchContent(){var t,e;if(null!==(t=this.currentView)&&void 0!==t&&t.legacy)return;this.loading=!0;const n=this.dir,i=this.currentView;"function"==typeof(null===(e=this.promise)||void 0===e?void 0:e.cancel)&&(this.promise.cancel(),Q.debug("Cancelled previous ongoing fetch")),this.promise=i.getContents(n);try{const{folder:t,contents:e}=await this.promise;Q.debug("Fetched contents",{dir:n,folder:t,contents:e}),this.filesStore.updateNodes(e),t._children=e.map((t=>t.attributes.fileid)),"/"===n?this.filesStore.setRoot({service:i.id,root:t}):t.attributes.fileid?(this.filesStore.updateNodes([t]),this.pathsStore.addPath({service:i.id,fileid:t.attributes.fileid,path:n})):Q.error("Invalid root folder returned",{dir:n,folder:t,currentView:i}),e.filter((t=>"folder"===t.type)).forEach((t=>{this.pathsStore.addPath({service:i.id,fileid:t.attributes.fileid,path:(0,p.join)(n,t.basename)})}))}catch(t){Q.error("Error while fetching content",{error:t})}finally{this.loading=!1}},getNode(t){return this.filesStore.getNode(t)},t:r.Iu}});var gn=i(15766),wn={};wn.styleTagTransform=B(),wn.setAttributes=N(),wn.insert=S().bind(null,"head"),wn.domAPI=_(),wn.insertStyleElement=E(),C()(gn.Z,wn),gn.Z&&gn.Z.locals&&gn.Z.locals;const bn=(0,T.Z)(vn,(function(){var t,e,n=this,i=n._self._c;return n._self._setupProxy,i("NcAppContent",{directives:[{name:"show",rawName:"v-show",value:!(null!==(t=n.currentView)&&void 0!==t&&t.legacy),expression:"!currentView?.legacy"}],class:{"app-content--hidden":null===(e=n.currentView)||void 0===e?void 0:e.legacy},attrs:{"data-cy-files-content":""}},[i("div",{staticClass:"files-list__header"},[i("BreadCrumbs",{attrs:{path:n.dir},on:{reload:n.fetchContent}}),n._v(" "),n.isRefreshing?i("NcLoadingIcon",{staticClass:"files-list__refresh-icon"}):n._e()],1),n._v(" "),n.loading&&!n.isRefreshing?i("NcLoadingIcon",{staticClass:"files-list__loading-icon",attrs:{size:38,title:n.t("files","Loading current folder")}}):!n.loading&&n.isEmptyDir?i("NcEmptyContent",{attrs:{title:n.t("files","No files in here"),description:n.t("files","No files or folders have been deleted yet"),"data-cy-files-content-empty":""},scopedSlots:n._u([{key:"action",fn:function(){return["/"!==n.dir?i("NcButton",{attrs:{"aria-label":"t('files', 'Go to the previous folder')",type:"primary",to:n.toPreviousDir}},[n._v("\n\t\t\t\t"+n._s(n.t("files","Go back"))+"\n\t\t\t")]):n._e()]},proxy:!0},{key:"icon",fn:function(){return[i("TrashCan")]},proxy:!0}])}):i("FilesListVirtual",{ref:"filesListVirtual",attrs:{"current-view":n.currentView,nodes:n.dirContents}})],1)}),[],!1,null,"31594710",null).exports;var Cn=i(25108);function yn(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var _n=i(78345),xn=i(17563);u.default.use(_n.ZP);const Sn=new _n.ZP({mode:"history",base:(0,a.generateUrl)("/apps/files",""),linkActiveClass:"active",routes:[{path:"/",alias:"/files"},{path:"/:view/:fileid?",name:"filelist",props:!0}],stringifyQuery(t){const e=(0,xn.stringify)(t).replace(/%2F/gim,"/");return e?"?"+e:""}});var kn,Nn;window.OCA.Files=null!==(kn=window.OCA.Files)&&void 0!==kn?kn:{},window.OCP.Files=null!==(Nn=window.OCP.Files)&&void 0!==Nn?Nn:{},u.default.use(tt.og);const In=(0,tt.WB)(),En=new ot;Object.assign(window.OCP.Files,{Navigation:En}),u.default.prototype.$navigation=En;const Fn=new class{constructor(){var t,e,n;t=this,n=void 0,(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e="_settings"))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,this._settings=[],Cn.debug("OCA.Files.Settings initialized")}register(t){return this._settings.filter((e=>e.name===t.name)).length>0?(Cn.error("A setting with the same name is already registered"),!1):(this._settings.push(t),!0)}get settings(){return this._settings}};Object.assign(window.OCA.Files,{Settings:Fn}),Object.assign(window.OCA.Files.Settings,{Setting:class{constructor(t,e){let{el:n,open:i,close:o}=e;yn(this,"_close",void 0),yn(this,"_el",void 0),yn(this,"_name",void 0),yn(this,"_open",void 0),this._name=t,this._el=n,this._open=i,this._close=o,"function"!=typeof this._open&&(this._open=()=>{}),"function"!=typeof this._close&&(this._close=()=>{})}get name(){return this._name}get el(){return this._el}get open(){return this._open}get close(){return this._close}}}),new(u.default.extend($t))({name:"FilesNavigationRoot",propsData:{Navigation:En},router:Sn,pinia:In}).$mount("#app-navigation-files"),new(u.default.extend(bn))({name:"FilesListRoot",router:Sn,pinia:In}).$mount("#app-content-vue"),function(){const t=Object.values((0,s.j)("files","navigation",{}));t.length>0&&(Q.debug("Legacy files views detected. Processing...",t),t.forEach((t=>{X(t),t.sublist&&t.sublist.forEach((e=>X({...e,parent:t.id})))})))}(),"serviceWorker"in navigator?window.addEventListener("load",(async()=>{try{const t=(0,a.generateUrl)("/apps/files/preview-service-worker.js",{},{noRewrite:!0}),e=await navigator.serviceWorker.register(t,{scope:"/"});Q.debug("SW registered: ",{registration:e})}catch(t){Q.error("SW registration failed: ",{error:t})}})):Q.debug("Service Worker is not enabled on this browser.")},39959:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".breadcrumb[data-v-68b3b20b]{flex:1 1 100% !important;width:100%}.breadcrumb[data-v-68b3b20b] a{cursor:pointer !important}","",{version:3,sources:["webpack://./apps/files/src/components/BreadCrumbs.vue"],names:[],mappings:"AACA,6BAEC,wBAAA,CACA,UAAA,CAEA,+BACC,yBAAA",sourcesContent:["\n.breadcrumb {\n\t// Take as much space as possible\n\tflex: 1 1 100% !important;\n\twidth: 100%;\n\n\t::v-deep a {\n\t\tcursor: pointer !important;\n\t}\n}\n\n"],sourceRoot:""}]);const a=r},61959:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".custom-svg-icon[data-v-93e9b2f4]{display:flex;align-items:center;align-self:center;justify-content:center;justify-self:center;width:44px;height:44px;opacity:1}.custom-svg-icon[data-v-93e9b2f4] svg{height:22px;width:22px;fill:currentColor}","",{version:3,sources:["webpack://./apps/files/src/components/CustomSvgIconRender.vue"],names:[],mappings:"AACA,kCACC,YAAA,CACA,kBAAA,CACA,iBAAA,CACA,sBAAA,CACA,mBAAA,CACA,UAAA,CACA,WAAA,CACA,SAAA,CAEA,sCAGC,WAAA,CACA,UAAA,CACA,iBAAA",sourcesContent:["\n.custom-svg-icon {\n\tdisplay: flex;\n\talign-items: center;\n\talign-self: center;\n\tjustify-content: center;\n\tjustify-self: center;\n\twidth: 44px;\n\theight: 44px;\n\topacity: 1;\n\n\t::v-deep svg {\n\t\t// mdi icons have a size of 24px\n\t\t// 22px results in roughly 16px inner size\n\t\theight: 22px;\n\t\twidth: 22px;\n\t\tfill: currentColor;\n\t}\n}\n\n"],sourceRoot:""}]);const a=r},75934:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,"tr[data-v-47057834]:hover,tr[data-v-47057834]:focus,tr[data-v-47057834]:active{background-color:var(--color-background-dark)}.files-list__row-icon-preview[data-v-47057834]:not([style*=background]){background:var(--color-loading-dark)}","",{version:3,sources:["webpack://./apps/files/src/components/FileEntry.vue"],names:[],mappings:"AAGC,+EAGC,6CAAA,CAKF,wEACI,oCAAA",sourcesContent:["\n/* Hover effect on tbody lines only */\ntr {\n\t&:hover,\n\t&:focus,\n\t&:active {\n\t\tbackground-color: var(--color-background-dark);\n\t}\n}\n\n/* Preview not loaded animation effect */\n.files-list__row-icon-preview:not([style*='background']) {\n    background: var(--color-loading-dark);\n\t// animation: preview-gradient-fade 1.2s ease-in-out infinite;\n}\n"],sourceRoot:""}]);const a=r},97105:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,"tr[data-v-e6a083be]{padding-bottom:300px;border-top:1px solid var(--color-border);background-color:rgba(0,0,0,0) !important;border-bottom:none !important}td[data-v-e6a083be]{user-select:none;color:var(--color-text-maxcontrast) !important}","",{version:3,sources:["webpack://./apps/files/src/components/FilesListFooter.vue"],names:[],mappings:"AAEA,oBACC,oBAAA,CACA,wCAAA,CAEA,yCAAA,CACA,6BAAA,CAGD,oBACC,gBAAA,CAEA,8CAAA",sourcesContent:["\n// Scoped row\ntr {\n\tpadding-bottom: 300px;\n\tborder-top: 1px solid var(--color-border);\n\t// Prevent hover effect on the whole row\n\tbackground-color: transparent !important;\n\tborder-bottom: none !important;\n}\n\ntd {\n\tuser-select: none;\n\t// Make sure the cell colors don't apply to column headers\n\tcolor: var(--color-text-maxcontrast) !important;\n}\n\n"],sourceRoot:""}]);const a=r},64329:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".files-list__column[data-v-57bd4174]{user-select:none;color:var(--color-text-maxcontrast) !important}.files-list__column--sortable[data-v-57bd4174]{cursor:pointer}","",{version:3,sources:["webpack://./apps/files/src/components/FilesListHeader.vue"],names:[],mappings:"AACA,qCACC,gBAAA,CAEA,8CAAA,CAEA,+CACC,cAAA",sourcesContent:["\n.files-list__column {\n\tuser-select: none;\n\t// Make sure the cell colors don't apply to column headers\n\tcolor: var(--color-text-maxcontrast) !important;\n\n\t&--sortable {\n\t\tcursor: pointer;\n\t}\n}\n\n"],sourceRoot:""}]);const a=r},19505:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".files-list__row-actions-batch[data-v-9d92da06]{flex:1 1 100% !important}.files-list__row-actions-batch[data-v-9d92da06] .button-vue__wrapper{width:100%}.files-list__row-actions-batch[data-v-9d92da06] .button-vue__wrapper span.button-vue__text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}","",{version:3,sources:["webpack://./apps/files/src/components/FilesListHeaderActions.vue"],names:[],mappings:"AACA,gDACC,wBAAA,CAGA,qEACC,UAAA,CACA,2FACC,eAAA,CACA,sBAAA,CACA,kBAAA",sourcesContent:["\n.files-list__row-actions-batch {\n\tflex: 1 1 100% !important;\n\n\t// Remove when https://github.com/nextcloud/nextcloud-vue/pull/3936 is merged\n\t::v-deep .button-vue__wrapper {\n\t\twidth: 100%;\n\t\tspan.button-vue__text {\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const a=r},85036:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".files-list__column-sort-button{margin:0 calc(var(--cell-margin)*-1);padding:0 4px 0 16px !important}.files-list__column-sort-button .button-vue__wrapper{flex-direction:row-reverse;width:100%}.files-list__column-sort-button .button-vue__icon{transition-timing-function:linear;transition-duration:.1s;transition-property:opacity;opacity:0}.files-list__column-sort-button .button-vue__text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.files-list__column-sort-button--active .button-vue__icon,.files-list__column-sort-button:hover .button-vue__icon,.files-list__column-sort-button:focus .button-vue__icon,.files-list__column-sort-button:active .button-vue__icon{opacity:1 !important}","",{version:3,sources:["webpack://./apps/files/src/components/FilesListHeaderButton.vue"],names:[],mappings:"AACA,gCAEC,oCAAA,CAEA,+BAAA,CAGA,qDACC,0BAAA,CAGA,UAAA,CAGD,kDACC,iCAAA,CACA,uBAAA,CACA,2BAAA,CACA,SAAA,CAID,kDACC,eAAA,CACA,kBAAA,CACA,sBAAA,CAOA,mOACC,oBAAA",sourcesContent:["\n.files-list__column-sort-button {\n\t// Compensate for cells margin\n\tmargin: 0 calc(var(--cell-margin) * -1);\n\t// Reverse padding\n\tpadding: 0 4px 0 16px !important;\n\n\t// Icon after text\n\t.button-vue__wrapper {\n\t\tflex-direction: row-reverse;\n\t\t// Take max inner width for text overflow ellipsis\n\t\t// Remove when https://github.com/nextcloud/nextcloud-vue/pull/3936 is merged\n\t\twidth: 100%;\n\t}\n\n\t.button-vue__icon {\n\t\ttransition-timing-function: linear;\n\t\ttransition-duration: .1s;\n\t\ttransition-property: opacity;\n\t\topacity: 0;\n\t}\n\n\t// Remove when https://github.com/nextcloud/nextcloud-vue/pull/3936 is merged\n\t.button-vue__text {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t&--active,\n\t&:hover,\n\t&:focus,\n\t&:active {\n\t\t.button-vue__icon {\n\t\t\topacity: 1 !important;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const a=r},525:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".files-list[data-v-07b86e54]{--row-height: 55px;--cell-margin: 14px;--checkbox-padding: calc((var(--row-height) - var(--checkbox-size)) / 2);--checkbox-size: 24px;--clickable-area: 44px;--icon-preview-size: 32px;display:block;overflow:auto;height:100%}.files-list[data-v-07b86e54] tbody,.files-list[data-v-07b86e54] .vue-recycle-scroller__slot{display:flex;flex-direction:column;width:100%;position:relative}.files-list[data-v-07b86e54] .vue-recycle-scroller__slot[role=thead]{position:sticky;z-index:10;top:0;height:var(--row-height);background-color:var(--color-main-background)}.files-list[data-v-07b86e54] tr{position:absolute;display:flex;align-items:center;width:100%;border-bottom:1px solid var(--color-border)}.files-list[data-v-07b86e54] td,.files-list[data-v-07b86e54] th{display:flex;align-items:center;flex:0 0 auto;justify-content:left;width:var(--row-height);height:var(--row-height);margin:0;padding:0;color:var(--color-text-maxcontrast);border:none}.files-list[data-v-07b86e54] td span,.files-list[data-v-07b86e54] th span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.files-list[data-v-07b86e54] .files-list__row-checkbox{justify-content:center}.files-list[data-v-07b86e54] .files-list__row-checkbox .checkbox-radio-switch{display:flex;justify-content:center;--icon-size: var(--checkbox-size)}.files-list[data-v-07b86e54] .files-list__row-checkbox .checkbox-radio-switch label.checkbox-radio-switch__label{width:var(--clickable-area);height:var(--clickable-area);margin:0;padding:calc((var(--clickable-area) - var(--checkbox-size))/2)}.files-list[data-v-07b86e54] .files-list__row-checkbox .checkbox-radio-switch .checkbox-radio-switch__icon{margin:0 !important}.files-list[data-v-07b86e54] .files-list__row-icon{display:flex;align-items:center;justify-content:center;width:var(--icon-preview-size);height:100%;margin-right:var(--checkbox-padding);color:var(--color-primary-element);flex:0 0 var(--icon-preview-size)}.files-list[data-v-07b86e54] .files-list__row-icon>span{justify-content:flex-start}.files-list[data-v-07b86e54] .files-list__row-icon svg{width:var(--icon-preview-size);height:var(--icon-preview-size)}.files-list[data-v-07b86e54] .files-list__row-icon-preview{overflow:hidden;width:var(--icon-preview-size);height:var(--icon-preview-size);border-radius:var(--border-radius);background-repeat:no-repeat;background-position:center;background-size:contain}.files-list[data-v-07b86e54] .files-list__row-name{overflow:hidden;flex:1 1 auto}.files-list[data-v-07b86e54] .files-list__row-name a{display:flex;align-items:center;width:100%;height:100%}.files-list[data-v-07b86e54] .files-list__row-name a:focus .files-list__row-name-text,.files-list[data-v-07b86e54] .files-list__row-name a:focus-visible .files-list__row-name-text{outline:2px solid var(--color-main-text) !important;border-radius:20px}.files-list[data-v-07b86e54] .files-list__row-name .files-list__row-name-text{padding:5px 10px;margin-left:-10px}.files-list[data-v-07b86e54] .files-list__row-actions{width:auto}.files-list[data-v-07b86e54] .files-list__row-actions~td,.files-list[data-v-07b86e54] .files-list__row-actions~th{margin:0 var(--cell-margin)}.files-list[data-v-07b86e54] .files-list__row-actions button .button-vue__text{font-weight:normal}.files-list[data-v-07b86e54] .files-list__row-actions button:not(:hover,:focus,:active) .button-vue__wrapper{color:var(--color-text-maxcontrast)}.files-list[data-v-07b86e54] .files-list__row-size{justify-content:flex-end;width:calc(var(--row-height)*1.5);color:var(--color-main-text)}.files-list[data-v-07b86e54] .files-list__row-size .files-list__column-sort-button{padding:0 16px 0 4px !important}.files-list[data-v-07b86e54] .files-list__row-size .files-list__column-sort-button .button-vue__wrapper{flex-direction:row}.files-list[data-v-07b86e54] .files-list__row-column-custom{width:calc(var(--row-height)*2)}","",{version:3,sources:["webpack://./apps/files/src/components/FilesListVirtual.vue"],names:[],mappings:"AACA,6BACC,kBAAA,CACA,mBAAA,CAEA,wEAAA,CACA,qBAAA,CACA,sBAAA,CACA,yBAAA,CAEA,aAAA,CACA,aAAA,CACA,WAAA,CAIC,4FACC,YAAA,CACA,qBAAA,CACA,UAAA,CAEA,iBAAA,CAID,qEAEC,eAAA,CACA,UAAA,CACA,KAAA,CACA,wBAAA,CACA,6CAAA,CAGD,gCACC,iBAAA,CACA,YAAA,CACA,kBAAA,CACA,UAAA,CACA,2CAAA,CAGD,gEACC,YAAA,CACA,kBAAA,CACA,aAAA,CACA,oBAAA,CACA,uBAAA,CACA,wBAAA,CACA,QAAA,CACA,SAAA,CACA,mCAAA,CACA,WAAA,CAKA,0EACC,eAAA,CACA,kBAAA,CACA,sBAAA,CAIF,uDACC,sBAAA,CACA,8EACC,YAAA,CACA,sBAAA,CAEA,iCAAA,CAEA,iHACC,2BAAA,CACA,4BAAA,CACA,QAAA,CACA,8DAAA,CAGD,2GACC,mBAAA,CAKH,mDACC,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,8BAAA,CACA,WAAA,CAEA,oCAAA,CACA,kCAAA,CAEA,iCAAA,CAEA,wDACC,0BAAA,CAGD,uDACC,8BAAA,CACA,+BAAA,CAGD,2DACC,eAAA,CACA,8BAAA,CACA,+BAAA,CACA,kCAAA,CACA,2BAAA,CAEA,0BAAA,CACA,uBAAA,CAIF,mDAEC,eAAA,CAEA,aAAA,CAEA,qDACC,YAAA,CACA,kBAAA,CAEA,UAAA,CACA,WAAA,CAGA,oLAEC,mDAAA,CACA,kBAAA,CAIF,8EAEC,gBAAA,CACA,iBAAA,CAIF,sDACC,UAAA,CAGA,kHAEC,2BAAA,CAIA,+EAEC,kBAAA,CAED,6GAEC,mCAAA,CAKH,mDAEC,wBAAA,CACA,iCAAA,CAEA,4BAAA,CAGA,mFACC,+BAAA,CACA,wGACC,kBAAA,CAKH,4DACC,+BAAA",sourcesContent:["\n.files-list {\n\t--row-height: 55px;\n\t--cell-margin: 14px;\n\n\t--checkbox-padding: calc((var(--row-height) - var(--checkbox-size)) / 2);\n\t--checkbox-size: 24px;\n\t--clickable-area: 44px;\n\t--icon-preview-size: 32px;\n\n\tdisplay: block;\n\toverflow: auto;\n\theight: 100%;\n\n\t&::v-deep {\n\t\t// Table head, body and footer\n\t\ttbody, .vue-recycle-scroller__slot {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\twidth: 100%;\n\t\t\t// Necessary for virtual scrolling absolute\n\t\t\tposition: relative;\n\t\t}\n\n\t\t// Table header\n\t\t.vue-recycle-scroller__slot[role='thead'] {\n\t\t\t// Pinned on top when scrolling\n\t\t\tposition: sticky;\n\t\t\tz-index: 10;\n\t\t\ttop: 0;\n\t\t\theight: var(--row-height);\n\t\t\tbackground-color: var(--color-main-background);\n\t\t}\n\n\t\ttr {\n\t\t\tposition: absolute;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\twidth: 100%;\n\t\t\tborder-bottom: 1px solid var(--color-border);\n\t\t}\n\n\t\ttd, th {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tflex: 0 0 auto;\n\t\t\tjustify-content: left;\n\t\t\twidth: var(--row-height);\n\t\t\theight: var(--row-height);\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t\tborder: none;\n\n\t\t\t// Columns should try to add any text\n\t\t\t// node wrapped in a span. That should help\n\t\t\t// with the ellipsis on overflow.\n\t\t\tspan {\n\t\t\t\toverflow: hidden;\n\t\t\t\twhite-space: nowrap;\n\t\t\t\ttext-overflow: ellipsis;\n\t\t\t}\n\t\t}\n\n\t\t.files-list__row-checkbox {\n\t\t\tjustify-content: center;\n\t\t\t.checkbox-radio-switch {\n\t\t\t\tdisplay: flex;\n\t\t\t\tjustify-content: center;\n\n\t\t\t\t--icon-size: var(--checkbox-size);\n\n\t\t\t\tlabel.checkbox-radio-switch__label {\n\t\t\t\t\twidth: var(--clickable-area);\n\t\t\t\t\theight: var(--clickable-area);\n\t\t\t\t\tmargin: 0;\n\t\t\t\t\tpadding: calc((var(--clickable-area) - var(--checkbox-size)) / 2);\n\t\t\t\t}\n\n\t\t\t\t.checkbox-radio-switch__icon {\n\t\t\t\t\tmargin: 0 !important;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.files-list__row-icon {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: var(--icon-preview-size);\n\t\t\theight: 100%;\n\t\t\t// Show same padding as the checkbox right padding for visual balance\n\t\t\tmargin-right: var(--checkbox-padding);\n\t\t\tcolor: var(--color-primary-element);\n\t\t\t// No shrinking or growing allowed\n\t\t\tflex: 0 0 var(--icon-preview-size);\n\n\t\t\t& > span {\n\t\t\t\tjustify-content: flex-start;\n\t\t\t}\n\n\t\t\tsvg {\n\t\t\t\twidth: var(--icon-preview-size);\n\t\t\t\theight: var(--icon-preview-size);\n\t\t\t}\n\n\t\t\t&-preview {\n\t\t\t\toverflow: hidden;\n\t\t\t\twidth: var(--icon-preview-size);\n\t\t\t\theight: var(--icon-preview-size);\n\t\t\t\tborder-radius: var(--border-radius);\n\t\t\t\tbackground-repeat: no-repeat;\n\t\t\t\t// Center and contain the preview\n\t\t\t\tbackground-position: center;\n\t\t\t\tbackground-size: contain;\n\t\t\t}\n\t\t}\n\n\t\t.files-list__row-name {\n\t\t\t// Prevent link from overflowing\n\t\t\toverflow: hidden;\n\t\t\t// Take as much space as possible\n\t\t\tflex: 1 1 auto;\n\n\t\t\ta {\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\t// Fill cell height and width\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\n\t\t\t\t// Keyboard indicator a11y\n\t\t\t\t&:focus .files-list__row-name-text,\n\t\t\t\t&:focus-visible .files-list__row-name-text {\n\t\t\t\t\toutline: 2px solid var(--color-main-text) !important;\n\t\t\t\t\tborder-radius: 20px;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t.files-list__row-name-text {\n\t\t\t\t// Make some space for the outline\n\t\t\t\tpadding: 5px 10px;\n\t\t\t\tmargin-left: -10px;\n\t\t\t}\n\t\t}\n\n\t\t.files-list__row-actions {\n\t\t\twidth: auto;\n\n\t\t\t// Add margin to all cells after the actions\n\t\t\t& ~ td,\n\t\t\t& ~ th {\n\t\t\t\tmargin: 0 var(--cell-margin);\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t\t.button-vue__text {\n\t\t\t\t\t// Remove bold from default button styling\n\t\t\t\t\tfont-weight: normal;\n\t\t\t\t}\n\t\t\t\t&:not(:hover, :focus, :active) .button-vue__wrapper {\n\t\t\t\t\t// Also apply color-text-maxcontrast to non-active button\n\t\t\t\t\tcolor: var(--color-text-maxcontrast);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.files-list__row-size {\n\t\t\t// Right align text\n\t\t\tjustify-content: flex-end;\n\t\t\twidth: calc(var(--row-height) * 1.5);\n\t\t\t// opacity varies with the size\n\t\t\tcolor: var(--color-main-text);\n\n\t\t\t// Icon is before text since size is right aligned\n\t\t\t.files-list__column-sort-button {\n\t\t\t\tpadding: 0 16px 0 4px !important;\n\t\t\t\t.button-vue__wrapper {\n\t\t\t\t\tflex-direction: row;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.files-list__row-column-custom {\n\t\t\twidth: calc(var(--row-height) * 2);\n\t\t}\n\t}\n}\n"],sourceRoot:""}]);const a=r},93582:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".app-navigation-entry__settings-quota--not-unlimited[data-v-918797b2] .app-navigation-entry__title{margin-top:-4px}.app-navigation-entry__settings-quota progress[data-v-918797b2]{position:absolute;bottom:10px;margin-left:44px;width:calc(100% - 44px - 22px)}","",{version:3,sources:["webpack://./apps/files/src/components/NavigationQuota.vue"],names:[],mappings:"AAIC,mGACC,eAAA,CAGD,gEACC,iBAAA,CACA,WAAA,CACA,gBAAA,CACA,8BAAA",sourcesContent:["\n// User storage stats display\n.app-navigation-entry__settings-quota {\n\t// Align title with progress and icon\n\t&--not-unlimited::v-deep .app-navigation-entry__title {\n\t\tmargin-top: -4px;\n\t}\n\n\tprogress {\n\t\tposition: absolute;\n\t\tbottom: 10px;\n\t\tmargin-left: 44px;\n\t\twidth: calc(100% - 44px - 22px);\n\t}\n}\n"],sourceRoot:""}]);const a=r},3491:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".template-picker__item[data-v-6c072a31]{display:flex}.template-picker__label[data-v-6c072a31]{display:flex;align-items:center;flex:1 1;flex-direction:column}.template-picker__label[data-v-6c072a31],.template-picker__label *[data-v-6c072a31]{cursor:pointer;user-select:none}.template-picker__label[data-v-6c072a31]::before{display:none !important}.template-picker__preview[data-v-6c072a31]{display:block;overflow:hidden;flex:1 1;width:var(--width);min-height:var(--height);max-height:var(--height);padding:0;border:var(--border) solid var(--color-border);border-radius:var(--border-radius-large)}input:checked+label>.template-picker__preview[data-v-6c072a31]{border-color:var(--color-primary)}.template-picker__preview--failed[data-v-6c072a31]{display:flex}.template-picker__image[data-v-6c072a31]{max-width:100%;background-color:var(--color-main-background);object-fit:cover}.template-picker__preview--failed .template-picker__image[data-v-6c072a31]{width:calc(var(--margin)*8);margin:auto;background-color:rgba(0,0,0,0) !important;object-fit:initial}.template-picker__title[data-v-6c072a31]{overflow:hidden;max-width:calc(var(--width) + 4px);padding:var(--margin);white-space:nowrap;text-overflow:ellipsis}","",{version:3,sources:["webpack://./apps/files/src/components/TemplatePreview.vue"],names:[],mappings:"AAGC,wCACC,YAAA,CAGD,yCACC,YAAA,CAEA,kBAAA,CACA,QAAA,CACA,qBAAA,CAEA,oFACC,cAAA,CACA,gBAAA,CAGD,iDACC,uBAAA,CAIF,2CACC,aAAA,CACA,eAAA,CAEA,QAAA,CACA,kBAAA,CACA,wBAAA,CACA,wBAAA,CACA,SAAA,CACA,8CAAA,CACA,wCAAA,CAEA,+DACC,iCAAA,CAGD,mDAEC,YAAA,CAIF,yCACC,cAAA,CACA,6CAAA,CAEA,gBAAA,CAID,2EACC,2BAAA,CAEA,WAAA,CACA,yCAAA,CAEA,kBAAA,CAGD,yCACC,eAAA,CAEA,kCAAA,CACA,qBAAA,CACA,kBAAA,CACA,sBAAA",sourcesContent:["\n\n.template-picker {\n\t&__item {\n\t\tdisplay: flex;\n\t}\n\n\t&__label {\n\t\tdisplay: flex;\n\t\t// Align in the middle of the grid\n\t\talign-items: center;\n\t\tflex: 1 1;\n\t\tflex-direction: column;\n\n\t\t&, * {\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\n\t\t&::before {\n\t\t\tdisplay: none !important;\n\t\t}\n\t}\n\n\t&__preview {\n\t\tdisplay: block;\n\t\toverflow: hidden;\n\t\t// Stretch so all entries are the same width\n\t\tflex: 1 1;\n\t\twidth: var(--width);\n\t\tmin-height: var(--height);\n\t\tmax-height: var(--height);\n\t\tpadding: 0;\n\t\tborder: var(--border) solid var(--color-border);\n\t\tborder-radius: var(--border-radius-large);\n\n\t\tinput:checked + label > & {\n\t\t\tborder-color: var(--color-primary);\n\t\t}\n\n\t\t&--failed {\n\t\t\t// Make sure to properly center fallback icon\n\t\t\tdisplay: flex;\n\t\t}\n\t}\n\n\t&__image {\n\t\tmax-width: 100%;\n\t\tbackground-color: var(--color-main-background);\n\n\t\tobject-fit: cover;\n\t}\n\n\t// Failed preview, fallback to mime icon\n\t&__preview--failed &__image {\n\t\twidth: calc(var(--margin) * 8);\n\t\t// Center mime icon\n\t\tmargin: auto;\n\t\tbackground-color: transparent !important;\n\n\t\tobject-fit: initial;\n\t}\n\n\t&__title {\n\t\toverflow: hidden;\n\t\t// also count preview border\n\t\tmax-width: calc(var(--width) + 2*2px);\n\t\tpadding: var(--margin);\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t}\n}\n\n"],sourceRoot:""}]);const a=r},15766:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".app-content[data-v-31594710]{display:flex;overflow:hidden;flex-direction:column;max-height:100%}.app-content[data-v-31594710]:not(.app-content--hidden)+#app-content{display:none}.files-list__header[data-v-31594710]{display:flex;align-content:center;flex:0 0;margin:4px 4px 4px 50px}.files-list__header>*[data-v-31594710]{flex:0 0}.files-list__refresh-icon[data-v-31594710]{flex:0 0 44px;width:44px;height:44px}.files-list__loading-icon[data-v-31594710]{margin:auto}","",{version:3,sources:["webpack://./apps/files/src/views/FilesList.vue"],names:[],mappings:"AACA,8BAEC,YAAA,CACA,eAAA,CACA,qBAAA,CACA,eAAA,CAIA,qEACC,YAAA,CAQD,qCACC,YAAA,CACA,oBAAA,CAEA,QAAA,CAEA,uBAAA,CACA,uCAGC,QAAA,CAGF,2CACC,aAAA,CACA,UAAA,CACA,WAAA,CAED,2CACC,WAAA",sourcesContent:["\n.app-content {\n\t// Virtual list needs to be full height and is scrollable\n\tdisplay: flex;\n\toverflow: hidden;\n\tflex-direction: column;\n\tmax-height: 100%;\n\n\t// TODO: remove after all legacy views are migrated\n\t// Hides the legacy app-content if shown view is not legacy\n\t&:not(&--hidden)::v-deep + #app-content {\n\t\tdisplay: none;\n\t}\n}\n\n$margin: 4px;\n$navigationToggleSize: 50px;\n\n.files-list {\n\t&__header {\n\t\tdisplay: flex;\n\t\talign-content: center;\n\t\t// Do not grow or shrink (vertically)\n\t\tflex: 0 0;\n\t\t// Align with the navigation toggle icon\n\t\tmargin: $margin $margin $margin $navigationToggleSize;\n\t\t> * {\n\t\t\t// Do not grow or shrink (horizontally)\n\t\t\t// Only the breadcrumbs shrinks\n\t\t\tflex: 0 0;\n\t\t}\n\t}\n\t&__refresh-icon {\n\t\tflex: 0 0 44px;\n\t\twidth: 44px;\n\t\theight: 44px;\n\t}\n\t&__loading-icon {\n\t\tmargin: auto;\n\t}\n}\n\n"],sourceRoot:""}]);const a=r},17867:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".app-navigation[data-v-d66c4bda] .app-navigation-entry-icon{background-repeat:no-repeat;background-position:center}.app-navigation>ul.app-navigation__list[data-v-d66c4bda]{padding-bottom:var(--default-grid-baseline, 4px)}.app-navigation-entry__settings[data-v-d66c4bda]{height:auto !important;overflow:hidden !important;padding-top:0 !important;flex:0 0 auto}","",{version:3,sources:["webpack://./apps/files/src/views/Navigation.vue"],names:[],mappings:"AAEA,4DACC,2BAAA,CACA,0BAAA,CAGD,yDAEC,gDAAA,CAGD,iDACC,sBAAA,CACA,0BAAA,CACA,wBAAA,CAEA,aAAA",sourcesContent:["\n// TODO: remove when https://github.com/nextcloud/nextcloud-vue/pull/3539 is in\n.app-navigation::v-deep .app-navigation-entry-icon {\n\tbackground-repeat: no-repeat;\n\tbackground-position: center;\n}\n\n.app-navigation > ul.app-navigation__list {\n\t// Use flex gap value for more elegant spacing\n\tpadding-bottom: var(--default-grid-baseline, 4px);\n}\n\n.app-navigation-entry__settings {\n\theight: auto !important;\n\toverflow: hidden !important;\n\tpadding-top: 0 !important;\n\t// Prevent shrinking or growing\n\tflex: 0 0 auto;\n}\n"],sourceRoot:""}]);const a=r},35662:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".setting-link[data-v-76ca5d1f]:hover{text-decoration:underline}","",{version:3,sources:["webpack://./apps/files/src/views/Settings.vue"],names:[],mappings:"AACA,qCACC,yBAAA",sourcesContent:["\n.setting-link:hover {\n\ttext-decoration: underline;\n}\n"],sourceRoot:""}]);const a=r},5103:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,".templates-picker__form[data-v-715b4161]{padding:calc(var(--margin)*2);padding-bottom:0}.templates-picker__form h2[data-v-715b4161]{text-align:center;font-weight:bold;margin:var(--margin) 0 calc(var(--margin)*2)}.templates-picker__list[data-v-715b4161]{display:grid;grid-gap:calc(var(--margin)*2);grid-auto-columns:1fr;max-width:calc(var(--fullwidth)*6);grid-template-columns:repeat(auto-fit, var(--fullwidth));grid-auto-rows:1fr;justify-content:center}.templates-picker__buttons[data-v-715b4161]{display:flex;justify-content:space-between;padding:calc(var(--margin)*2) var(--margin);position:sticky;bottom:0;background-image:linear-gradient(0, var(--gradient-main-background))}.templates-picker__buttons button[data-v-715b4161],.templates-picker__buttons input[type=submit][data-v-715b4161]{height:44px}.templates-picker[data-v-715b4161] .modal-container{position:relative}.templates-picker__loading[data-v-715b4161]{position:absolute;top:0;left:0;justify-content:center;width:100%;height:100%;margin:0;background-color:var(--color-main-background-translucent)}","",{version:3,sources:["webpack://./apps/files/src/views/TemplatePicker.vue"],names:[],mappings:"AAEC,yCACC,6BAAA,CAEA,gBAAA,CAEA,4CACC,iBAAA,CACA,gBAAA,CACA,4CAAA,CAIF,yCACC,YAAA,CACA,8BAAA,CACA,qBAAA,CAEA,kCAAA,CACA,wDAAA,CAEA,kBAAA,CAEA,sBAAA,CAGD,4CACC,YAAA,CACA,6BAAA,CACA,2CAAA,CACA,eAAA,CACA,QAAA,CACA,oEAAA,CAEA,kHACC,WAAA,CAKF,oDACC,iBAAA,CAGD,4CACC,iBAAA,CACA,KAAA,CACA,MAAA,CACA,sBAAA,CACA,UAAA,CACA,WAAA,CACA,QAAA,CACA,yDAAA",sourcesContent:["\n.templates-picker {\n\t&__form {\n\t\tpadding: calc(var(--margin) * 2);\n\t\t// Will be handled by the buttons\n\t\tpadding-bottom: 0;\n\n\t\th2 {\n\t\t\ttext-align: center;\n\t\t\tfont-weight: bold;\n\t\t\tmargin: var(--margin) 0 calc(var(--margin) * 2);\n\t\t}\n\t}\n\n\t&__list {\n\t\tdisplay: grid;\n\t\tgrid-gap: calc(var(--margin) * 2);\n\t\tgrid-auto-columns: 1fr;\n\t\t// We want maximum 5 columns. Putting 6 as we don't count the grid gap. So it will always be lower than 6\n\t\tmax-width: calc(var(--fullwidth) * 6);\n\t\tgrid-template-columns: repeat(auto-fit, var(--fullwidth));\n\t\t// Make sure all rows are the same height\n\t\tgrid-auto-rows: 1fr;\n\t\t// Center the columns set\n\t\tjustify-content: center;\n\t}\n\n\t&__buttons {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tpadding: calc(var(--margin) * 2) var(--margin);\n\t\tposition: sticky;\n\t\tbottom: 0;\n\t\tbackground-image: linear-gradient(0, var(--gradient-main-background));\n\n\t\tbutton, input[type='submit'] {\n\t\t\theight: 44px;\n\t\t}\n\t}\n\n\t// Make sure we're relative for the loading emptycontent on top\n\t::v-deep .modal-container {\n\t\tposition: relative;\n\t}\n\n\t&__loading {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tjustify-content: center;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tmargin: 0;\n\t\tbackground-color: var(--color-main-background-translucent);\n\t}\n}\n\n"],sourceRoot:""}]);const a=r},96669:(t,e,n)=>{n.d(e,{Z:()=>a});var i=n(87537),o=n.n(i),s=n(23645),r=n.n(s)()(o());r.push([t.id,"\n/* @keyframes preview-gradient-fade {\n    0% {\n        opacity: 1;\n    }\n    50% {\n        opacity: 0.5;\n    }\n    100% {\n        opacity: 1;\n    }\n} */\n","",{version:3,sources:["webpack://./apps/files/src/components/FileEntry.vue"],names:[],mappings:";AAmjBA;;;;;;;;;;GAUA",sourcesContent:["\x3c!--\n  - @copyright Copyright (c) 2023 John Molakvoæ <skjnldsv@protonmail.com>\n  -\n  - @author John Molakvoæ <skjnldsv@protonmail.com>\n  -\n  - @license GNU AGPL version 3 or any later version\n  -\n  - This program is free software: you can redistribute it and/or modify\n  - it under the terms of the GNU Affero General Public License as\n  - published by the Free Software Foundation, either version 3 of the\n  - License, or (at your option) any later version.\n  -\n  - This program is distributed in the hope that it will be useful,\n  - but WITHOUT ANY WARRANTY; without even the implied warranty of\n  - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  - GNU Affero General Public License for more details.\n  -\n  - You should have received a copy of the GNU Affero General Public License\n  - along with this program. If not, see <http://www.gnu.org/licenses/>.\n  -\n  --\x3e\n\n<template>\n\t<Fragment>\n\t\t<td class=\"files-list__row-checkbox\">\n\t\t\t<NcCheckboxRadioSwitch v-if=\"active\"\n\t\t\t\t:aria-label=\"t('files', 'Select the row for {displayName}', { displayName })\"\n\t\t\t\t:checked=\"selectedFiles\"\n\t\t\t\t:value=\"fileid\"\n\t\t\t\tname=\"selectedFiles\"\n\t\t\t\t@update:checked=\"onSelectionChange\" />\n\t\t</td>\n\n\t\t\x3c!-- Link to file --\x3e\n\t\t<td class=\"files-list__row-name\">\n\t\t\t<a ref=\"name\" v-bind=\"linkTo\">\n\t\t\t\t\x3c!-- Icon or preview --\x3e\n\t\t\t\t<span class=\"files-list__row-icon\">\n\t\t\t\t\t<FolderIcon v-if=\"source.type === 'folder'\" />\n\n\t\t\t\t\t\x3c!-- Decorative image, should not be aria documented --\x3e\n\t\t\t\t\t<span v-else-if=\"previewUrl && !backgroundFailed\"\n\t\t\t\t\t\tref=\"previewImg\"\n\t\t\t\t\t\tclass=\"files-list__row-icon-preview\"\n\t\t\t\t\t\t:style=\"{ backgroundImage }\" />\n\n\t\t\t\t\t<span v-else-if=\"mimeIconUrl\"\n\t\t\t\t\t\tclass=\"files-list__row-icon-preview files-list__row-icon-preview--mime\"\n\t\t\t\t\t\t:style=\"{ backgroundImage: mimeIconUrl }\" />\n\n\t\t\t\t\t<FileIcon v-else />\n\t\t\t\t</span>\n\n\t\t\t\t\x3c!-- File name --\x3e\n\t\t\t\t<span class=\"files-list__row-name-text\">{{ displayName }}</span>\n\t\t\t</a>\n\t\t</td>\n\n\t\t\x3c!-- Actions --\x3e\n\t\t<td :class=\"`files-list__row-actions-${uniqueId}`\" class=\"files-list__row-actions\">\n\t\t\t\x3c!-- Inline actions --\x3e\n\t\t\t\x3c!-- TODO: implement CustomElementRender --\x3e\n\n\t\t\t\x3c!-- Menu actions --\x3e\n\t\t\t<NcActions v-if=\"active\"\n\t\t\t\tref=\"actionsMenu\"\n\t\t\t\t:disabled=\"source._loading\"\n\t\t\t\t:force-title=\"true\"\n\t\t\t\t:inline=\"enabledInlineActions.length\"\n\t\t\t\t:open.sync=\"openedMenu\">\n\t\t\t\t<NcActionButton v-for=\"action in enabledMenuActions\"\n\t\t\t\t\t:key=\"action.id\"\n\t\t\t\t\t:class=\"'files-list__row-action-' + action.id\"\n\t\t\t\t\t@click=\"onActionClick(action)\">\n\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t<NcLoadingIcon v-if=\"loading === action.id\" :size=\"18\" />\n\t\t\t\t\t\t<CustomSvgIconRender v-else :svg=\"action.iconSvgInline([source], currentView)\" />\n\t\t\t\t\t</template>\n\t\t\t\t\t{{ action.displayName([source], currentView) }}\n\t\t\t\t</NcActionButton>\n\t\t\t</NcActions>\n\t\t</td>\n\n\t\t\x3c!-- Size --\x3e\n\t\t<td v-if=\"isSizeAvailable\"\n\t\t\t:style=\"{ opacity: sizeOpacity }\"\n\t\t\tclass=\"files-list__row-size\">\n\t\t\t<span>{{ size }}</span>\n\t\t</td>\n\n\t\t\x3c!-- View columns --\x3e\n\t\t<td v-for=\"column in columns\"\n\t\t\t:key=\"column.id\"\n\t\t\t:class=\"`files-list__row-${currentView?.id}-${column.id}`\"\n\t\t\tclass=\"files-list__row-column-custom\">\n\t\t\t<CustomElementRender v-if=\"active\"\n\t\t\t\t:current-view=\"currentView\"\n\t\t\t\t:render=\"column.render\"\n\t\t\t\t:source=\"source\" />\n\t\t</td>\n\t</Fragment>\n</template>\n\n<script lang='ts'>\nimport { debounce } from 'debounce'\nimport { formatFileSize } from '@nextcloud/files'\nimport { Fragment } from 'vue-frag'\nimport { join } from 'path'\nimport { showError, showSuccess } from '@nextcloud/dialogs'\nimport { translate } from '@nextcloud/l10n'\nimport CancelablePromise from 'cancelable-promise'\nimport FileIcon from 'vue-material-design-icons/File.vue'\nimport FolderIcon from 'vue-material-design-icons/Folder.vue'\nimport NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'\nimport NcActions from '@nextcloud/vue/dist/Components/NcActions.js'\nimport NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'\nimport NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'\nimport Vue from 'vue'\n\nimport { getFileActions } from '../services/FileAction.ts'\nimport { isCachedPreview } from '../services/PreviewService.ts'\nimport { useActionsMenuStore } from '../store/actionsmenu.ts'\nimport { useFilesStore } from '../store/files.ts'\nimport { useKeyboardStore } from '../store/keyboard.ts'\nimport { useSelectionStore } from '../store/selection.ts'\nimport { useUserConfigStore } from '../store/userconfig.ts'\nimport CustomElementRender from './CustomElementRender.vue'\nimport CustomSvgIconRender from './CustomSvgIconRender.vue'\nimport logger from '../logger.js'\n\n// The registered actions list\nconst actions = getFileActions()\n\nexport default Vue.extend({\n\tname: 'FileEntry',\n\n\tcomponents: {\n\t\tCustomElementRender,\n\t\tCustomSvgIconRender,\n\t\tFileIcon,\n\t\tFolderIcon,\n\t\tFragment,\n\t\tNcActionButton,\n\t\tNcActions,\n\t\tNcCheckboxRadioSwitch,\n\t\tNcLoadingIcon,\n\t},\n\n\tprops: {\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tisSizeAvailable: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tsource: {\n\t\t\ttype: Object,\n\t\t\trequired: true,\n\t\t},\n\t\tindex: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t},\n\t\tnodes: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\t\tfilesListWidth: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst actionsMenuStore = useActionsMenuStore()\n\t\tconst filesStore = useFilesStore()\n\t\tconst keyboardStore = useKeyboardStore()\n\t\tconst selectionStore = useSelectionStore()\n\t\tconst userConfigStore = useUserConfigStore()\n\t\treturn {\n\t\t\tactionsMenuStore,\n\t\t\tfilesStore,\n\t\t\tkeyboardStore,\n\t\t\tselectionStore,\n\t\t\tuserConfigStore,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tbackgroundFailed: false,\n\t\t\tbackgroundImage: '',\n\t\t\tloading: '',\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tuserConfig() {\n\t\t\treturn this.userConfigStore.userConfig\n\t\t},\n\n\t\tcurrentView() {\n\t\t\treturn this.$navigation.active\n\t\t},\n\n\t\tcolumns() {\n\t\t\t// Hide columns if the list is too small\n\t\t\tif (this.filesListWidth < 512) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn this.currentView?.columns || []\n\t\t},\n\n\t\tdir() {\n\t\t\t// Remove any trailing slash but leave root slash\n\t\t\treturn (this.$route?.query?.dir || '/').replace(/^(.+)\\/$/, '$1')\n\t\t},\n\n\t\tfileid() {\n\t\t\treturn this.source?.fileid?.toString?.()\n\t\t},\n\t\tdisplayName() {\n\t\t\treturn this.source.attributes.displayName\n\t\t\t\t|| this.source.basename\n\t\t},\n\t\tsize() {\n\t\t\tconst size = parseInt(this.source.size, 10) || 0\n\t\t\tif (typeof size !== 'number' || size < 0) {\n\t\t\t\treturn this.t('files', 'Pending')\n\t\t\t}\n\t\t\treturn formatFileSize(size, true)\n\t\t},\n\n\t\tsizeOpacity() {\n\t\t\tconst size = parseInt(this.source.size, 10) || 0\n\t\t\tif (!size || size < 0) {\n\t\t\t\treturn 1\n\t\t\t}\n\n\t\t\t// Whatever theme is active, the contrast will pass WCAG AA\n\t\t\t// with color main text over main background and an opacity of 0.7\n\t\t\tconst minOpacity = 0.7\n\t\t\tconst maxOpacitySize = 10 * 1024 * 1024\n\t\t\treturn minOpacity + (1 - minOpacity) * Math.pow((this.source.size / maxOpacitySize), 2)\n\t\t},\n\n\t\tlinkTo() {\n\t\t\tif (this.source.type === 'folder') {\n\t\t\t\tconst to = { ...this.$route, query: { dir: join(this.dir, this.source.basename) } }\n\t\t\t\treturn {\n\t\t\t\t\tis: 'router-link',\n\t\t\t\t\ttitle: this.t('files', 'Open folder {name}', { name: this.displayName }),\n\t\t\t\t\tto,\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn {\n\t\t\t\thref: this.source.source,\n\t\t\t\t// TODO: Use first action title ?\n\t\t\t\ttitle: this.t('files', 'Download file {name}', { name: this.displayName }),\n\t\t\t}\n\t\t},\n\n\t\tselectedFiles() {\n\t\t\treturn this.selectionStore.selected\n\t\t},\n\t\tisSelected() {\n\t\t\treturn this.selectedFiles.includes(this.source?.fileid?.toString?.())\n\t\t},\n\n\t\tcropPreviews() {\n\t\t\treturn this.userConfig.crop_image_previews\n\t\t},\n\n\t\tpreviewUrl() {\n\t\t\ttry {\n\t\t\t\tconst url = new URL(window.location.origin + this.source.attributes.previewUrl)\n\t\t\t\t// Request tiny previews\n\t\t\t\turl.searchParams.set('x', '32')\n\t\t\t\turl.searchParams.set('y', '32')\n\t\t\t\t// Handle cropping\n\t\t\t\turl.searchParams.set('a', this.cropPreviews === true ? '1' : '0')\n\t\t\t\treturn url.href\n\t\t\t} catch (e) {\n\t\t\t\treturn null\n\t\t\t}\n\t\t},\n\n\t\tmimeIconUrl() {\n\t\t\tconst mimeType = this.source.mime || 'application/octet-stream'\n\t\t\tconst mimeIconUrl = window.OC?.MimeType?.getIconUrl?.(mimeType)\n\t\t\tif (mimeIconUrl) {\n\t\t\t\treturn `url(${mimeIconUrl})`\n\t\t\t}\n\t\t\treturn ''\n\t\t},\n\n\t\tenabledActions() {\n\t\t\treturn actions\n\t\t\t\t.filter(action => !action.enabled || action.enabled([this.source], this.currentView))\n\t\t\t\t.sort((a, b) => (a.order || 0) - (b.order || 0))\n\t\t},\n\n\t\tenabledInlineActions() {\n\t\t\tif (this.filesListWidth < 768) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\treturn this.enabledActions.filter(action => action?.inline?.(this.source, this.currentView))\n\t\t},\n\n\t\tenabledMenuActions() {\n\t\t\tif (this.filesListWidth < 768) {\n\t\t\t\treturn this.enabledActions\n\t\t\t}\n\n\t\t\treturn [\n\t\t\t\t...this.enabledInlineActions,\n\t\t\t\t...this.enabledActions.filter(action => !action.inline),\n\t\t\t]\n\t\t},\n\n\t\tuniqueId() {\n\t\t\treturn this.hashCode(this.source.source)\n\t\t},\n\n\t\topenedMenu: {\n\t\t\tget() {\n\t\t\t\treturn this.actionsMenuStore.opened === this.uniqueId\n\t\t\t},\n\t\t\tset(opened) {\n\t\t\t\tthis.actionsMenuStore.opened = opened ? this.uniqueId : null\n\t\t\t},\n\t\t},\n\t},\n\n\twatch: {\n\t\tactive(active, before) {\n\t\t\tif (active === false && before === true) {\n\t\t\t\tthis.resetState()\n\n\t\t\t\t// When the row is not active anymore\n\t\t\t\t// remove the display from the row to prevent\n\t\t\t\t// keyboard interaction with it.\n\t\t\t\tthis.$el.parentNode.style.display = 'none'\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Restore default tabindex\n\t\t\tthis.$el.parentNode.style.display = ''\n\t\t},\n\n\t\t/**\n\t\t * When the source changes, reset the preview\n\t\t * and fetch the new one.\n\t\t */\n\t\tpreviewUrl() {\n\t\t\tthis.clearImg()\n\t\t\tthis.debounceIfNotCached()\n\t\t},\n\t},\n\n\t/**\n\t * The row is mounted once and reused as we scroll.\n\t */\n\tmounted() {\n\t\t// ⚠ Init the debounce function on mount and\n\t\t// not when the module is imported  to\n\t\t// avoid sharing between recycled components\n\t\tthis.debounceGetPreview = debounce(function() {\n\t\t\tthis.fetchAndApplyPreview()\n\t\t}, 150, false)\n\n\t\t// Fetch the preview on init\n\t\tthis.debounceIfNotCached()\n\n\t\t// Right click watcher on tr\n\t\tthis.$el.parentNode?.addEventListener?.('contextmenu', this.onRightClick)\n\t},\n\n\tbeforeDestroy() {\n\t\tthis.resetState()\n\t},\n\n\tmethods: {\n\t\tasync debounceIfNotCached() {\n\t\t\tif (!this.previewUrl) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Check if we already have this preview cached\n\t\t\tconst isCached = await isCachedPreview(this.previewUrl)\n\t\t\tif (isCached) {\n\t\t\t\tthis.backgroundImage = `url(${this.previewUrl})`\n\t\t\t\tthis.backgroundFailed = false\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// We don't have this preview cached or it expired, requesting it\n\t\t\tthis.debounceGetPreview()\n\t\t},\n\n\t\tfetchAndApplyPreview() {\n\t\t\t// Ignore if no preview\n\t\t\tif (!this.previewUrl) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// If any image is being processed, reset it\n\t\t\tif (this.previewPromise) {\n\t\t\t\tthis.clearImg()\n\t\t\t}\n\n\t\t\t// Store the promise to be able to cancel it\n\t\t\tthis.previewPromise = new CancelablePromise((resolve, reject, onCancel) => {\n\t\t\t\tconst img = new Image()\n\t\t\t\t// If active, load the preview with higher priority\n\t\t\t\timg.fetchpriority = this.active ? 'high' : 'auto'\n\t\t\t\timg.onload = () => {\n\t\t\t\t\tthis.backgroundImage = `url(${this.previewUrl})`\n\t\t\t\t\tthis.backgroundFailed = false\n\t\t\t\t\tresolve(img)\n\t\t\t\t}\n\t\t\t\timg.onerror = () => {\n\t\t\t\t\tthis.backgroundFailed = true\n\t\t\t\t\treject(img)\n\t\t\t\t}\n\t\t\t\timg.src = this.previewUrl\n\n\t\t\t\t// Image loading has been canceled\n\t\t\t\tonCancel(() => {\n\t\t\t\t\timg.onerror = null\n\t\t\t\t\timg.onload = null\n\t\t\t\t\timg.src = ''\n\t\t\t\t})\n\t\t\t})\n\t\t},\n\n\t\tresetState() {\n\t\t\t// Reset loading state\n\t\t\tthis.loading = ''\n\n\t\t\t// Reset the preview\n\t\t\tthis.clearImg()\n\n\t\t\t// Close menu\n\t\t\tthis.openedMenu = false\n\t\t},\n\n\t\tclearImg() {\n\t\t\tthis.backgroundImage = ''\n\t\t\tthis.backgroundFailed = false\n\n\t\t\tif (this.previewPromise) {\n\t\t\t\tthis.previewPromise.cancel()\n\t\t\t\tthis.previewPromise = null\n\t\t\t}\n\t\t},\n\n\t\thashCode(str) {\n\t\t\tlet hash = 0\n\t\t\tfor (let i = 0, len = str.length; i < len; i++) {\n\t\t\t\tconst chr = str.charCodeAt(i)\n\t\t\t\thash = (hash << 5) - hash + chr\n\t\t\t\thash |= 0 // Convert to 32bit integer\n\t\t\t}\n\t\t\treturn hash\n\t\t},\n\n\t\tasync onActionClick(action) {\n\t\t\tconst displayName = action.displayName([this.source], this.currentView)\n\t\t\ttry {\n\t\t\t\t// Set the loading marker\n\t\t\t\tthis.loading = action.id\n\t\t\t\tVue.set(this.source, '_loading', true)\n\n\t\t\t\tconst success = await action.exec(this.source, this.currentView)\n\t\t\t\tif (success) {\n\t\t\t\t\tshowSuccess(this.t('files', '\"{displayName}\" action executed successfully', { displayName }))\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tshowError(this.t('files', '\"{displayName}\" action failed', { displayName }))\n\t\t\t} catch (e) {\n\t\t\t\tlogger.error('Error while executing action', { action, e })\n\t\t\t\tshowError(this.t('files', '\"{displayName}\" action failed', { displayName }))\n\t\t\t} finally {\n\t\t\t\t// Reset the loading marker\n\t\t\t\tthis.loading = ''\n\t\t\t\tVue.set(this.source, '_loading', false)\n\t\t\t}\n\t\t},\n\n\t\tonSelectionChange(selection) {\n\t\t\tconst newSelectedIndex = this.index\n\t\t\tconst lastSelectedIndex = this.selectionStore.lastSelectedIndex\n\n\t\t\t// Get the last selected and select all files in between\n\t\t\tif (this.keyboardStore?.shiftKey && lastSelectedIndex !== null) {\n\t\t\t\tconst isAlreadySelected = this.selectedFiles.includes(this.fileid)\n\n\t\t\t\tconst start = Math.min(newSelectedIndex, lastSelectedIndex)\n\t\t\t\tconst end = Math.max(lastSelectedIndex, newSelectedIndex)\n\n\t\t\t\tconst lastSelection = this.selectionStore.lastSelection\n\t\t\t\tconst filesToSelect = this.nodes\n\t\t\t\t\t.map(file => file.fileid?.toString?.())\n\t\t\t\t\t.slice(start, end + 1)\n\n\t\t\t\t// If already selected, update the new selection _without_ the current file\n\t\t\t\tconst selection = [...lastSelection, ...filesToSelect]\n\t\t\t\t\t.filter(fileId => !isAlreadySelected || fileId !== this.fileid)\n\n\t\t\t\tlogger.debug('Shift key pressed, selecting all files in between', { start, end, filesToSelect, isAlreadySelected })\n\t\t\t\t// Keep previous lastSelectedIndex to be use for further shift selections\n\t\t\t\tthis.selectionStore.set(selection)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tlogger.debug('Updating selection', { selection })\n\t\t\tthis.selectionStore.set(selection)\n\t\t\tthis.selectionStore.setLastIndex(newSelectedIndex)\n\t\t},\n\n\t\t// Open the actions menu on right click\n\t\tonRightClick(event) {\n\t\t\t// If already opened, fallback to default browser\n\t\t\tif (this.openedMenu) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// If the clicked row is in the selection, open global menu\n\t\t\tconst isMoreThanOneSelected = this.selectedFiles.length > 1\n\t\t\tthis.actionsMenuStore.opened = this.isSelected && isMoreThanOneSelected ? 'global' : this.uniqueId\n\n\t\t\t// Prevent any browser defaults\n\t\t\tevent.preventDefault()\n\t\t\tevent.stopPropagation()\n\t\t},\n\n\t\tt: translate,\n\t\tformatFileSize,\n\t},\n})\n<\/script>\n\n<style scoped lang='scss'>\n/* Hover effect on tbody lines only */\ntr {\n\t&:hover,\n\t&:focus,\n\t&:active {\n\t\tbackground-color: var(--color-background-dark);\n\t}\n}\n\n/* Preview not loaded animation effect */\n.files-list__row-icon-preview:not([style*='background']) {\n    background: var(--color-loading-dark);\n\t// animation: preview-gradient-fade 1.2s ease-in-out infinite;\n}\n</style>\n\n<style>\n/* @keyframes preview-gradient-fade {\n    0% {\n        opacity: 1;\n    }\n    50% {\n        opacity: 0.5;\n    }\n    100% {\n        opacity: 1;\n    }\n} */\n</style>\n"],sourceRoot:""}]);const a=r}},i={};function o(t){var e=i[t];if(void 0!==e)return e.exports;var s=i[t]={id:t,loaded:!1,exports:{}};return n[t].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}o.m=n,e=[],o.O=(t,n,i,s)=>{if(!n){var r=1/0;for(d=0;d<e.length;d++){n=e[d][0],i=e[d][1],s=e[d][2];for(var a=!0,l=0;l<n.length;l++)(!1&s||r>=s)&&Object.keys(o.O).every((t=>o.O[t](n[l])))?n.splice(l--,1):(a=!1,s<r&&(r=s));if(a){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[n,i,s]},o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),o.j=2181,(()=>{o.b=document.baseURI||self.location.href;var t={2181:0};o.O.j=e=>0===t[e];var e=(e,n)=>{var i,s,r=n[0],a=n[1],l=n[2],c=0;if(r.some((e=>0!==t[e]))){for(i in a)o.o(a,i)&&(o.m[i]=a[i]);if(l)var d=l(o)}for(e&&e(n);c<r.length;c++)s=r[c],o.o(t,s)&&t[s]&&t[s][0](),t[s]=0;return o.O(d)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),o.nc=void 0;var s=o.O(void 0,[7874],(()=>o(74156)));s=o.O(s)})();
//# sourceMappingURL=files-main.js.map?v=85295aa09ed675d2cd07