diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index 040a6a035fceb..fb8f6328683f0 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -57,6 +57,7 @@ class FilesPlugin extends ServerPlugin { public const HAS_PREVIEW_PROPERTYNAME = '{http://nextcloud.org/ns}has-preview'; public const MOUNT_TYPE_PROPERTYNAME = '{http://nextcloud.org/ns}mount-type'; public const MOUNT_ROOT_PROPERTYNAME = '{http://nextcloud.org/ns}is-mount-root'; + public const IS_FEDERATED_PROPERTYNAME = '{http://nextcloud.org/ns}is-federated'; public const METADATA_ETAG_PROPERTYNAME = '{http://nextcloud.org/ns}metadata_etag'; public const UPLOAD_TIME_PROPERTYNAME = '{http://nextcloud.org/ns}upload_time'; public const CREATION_TIME_PROPERTYNAME = '{http://nextcloud.org/ns}creation_time'; @@ -118,6 +119,7 @@ public function initialize(Server $server) { $server->protectedProperties[] = self::DATA_FINGERPRINT_PROPERTYNAME; $server->protectedProperties[] = self::HAS_PREVIEW_PROPERTYNAME; $server->protectedProperties[] = self::MOUNT_TYPE_PROPERTYNAME; + $server->protectedProperties[] = self::IS_FEDERATED_PROPERTYNAME; $server->protectedProperties[] = self::SHARE_NOTE; // normally these cannot be changed (RFC4918), but we want them modifiable through PROPPATCH @@ -412,6 +414,11 @@ public function handleGetProperties(PropFind $propFind, \Sabre\DAV\INode $node) $propFind->handle(self::DISPLAYNAME_PROPERTYNAME, function () use ($node) { return $node->getName(); }); + + $propFind->handle(self::IS_FEDERATED_PROPERTYNAME, function () use ($node) { + return $node->getFileInfo()->getMountPoint() + instanceof \OCA\Files_Sharing\External\Mount; + }); } if ($node instanceof \OCA\DAV\Connector\Sabre\File) { diff --git a/apps/files/src/init.ts b/apps/files/src/init.ts index db4aec7fa0633..c12d4f193f33f 100644 --- a/apps/files/src/init.ts +++ b/apps/files/src/init.ts @@ -66,5 +66,6 @@ registerPreviewServiceWorker() registerDavProperty('nc:hidden', { nc: 'http://nextcloud.org/ns' }) registerDavProperty('nc:is-mount-root', { nc: 'http://nextcloud.org/ns' }) +registerDavProperty('nc:is-federated', { nc: 'http://nextcloud.org/ns' }) initLivePhotos() diff --git a/apps/files_sharing/src/actions/sharingStatusAction.ts b/apps/files_sharing/src/actions/sharingStatusAction.ts index 635e9e0d572dd..fc155985eee5f 100644 --- a/apps/files_sharing/src/actions/sharingStatusAction.ts +++ b/apps/files_sharing/src/actions/sharingStatusAction.ts @@ -18,7 +18,7 @@ import { generateAvatarSvg } from '../utils/AccountIcon' import './sharingStatusAction.scss' const isExternal = (node: Node) => { - return node.attributes.remote_id !== undefined + return node.attributes?.['is-federated'] ?? false } export const action = new FileAction({ diff --git a/apps/files_sharing/src/utils/AccountIcon.ts b/apps/files_sharing/src/utils/AccountIcon.ts index ac126fb1b35ad..a5fa210f7514f 100644 --- a/apps/files_sharing/src/utils/AccountIcon.ts +++ b/apps/files_sharing/src/utils/AccountIcon.ts @@ -7,9 +7,9 @@ import { generateUrl } from '@nextcloud/router' const isDarkMode = window?.matchMedia?.('(prefers-color-scheme: dark)')?.matches === true || document.querySelector('[data-themes*=dark]') !== null -export const generateAvatarSvg = (userId: string, isGuest = false) => { +export const generateAvatarSvg = (userId: string, isExternalUser = false) => { const url = isDarkMode ? '/avatar/{userId}/32/dark' : '/avatar/{userId}/32' - const avatarUrl = generateUrl(isGuest ? url : url + '?guestFallback=true', { userId }) + const avatarUrl = generateUrl(isExternalUser ? url + '?guestFallback=true' : url, { userId }) return ` diff --git a/dist/files-init.js b/dist/files-init.js index 09e01727b6838..eba48b0044a58 100644 --- a/dist/files-init.js +++ b/dist/files-init.js @@ -1,2 +1,2 @@ -(()=>{var e,t,s,n={9165:(e,t,s)=>{"use strict";s.d(t,{DvY:()=>i,NZC:()=>a,O1W:()=>n,ZL5:()=>o,fEr:()=>r});var n="M9,10H7V12H9V10M13,10H11V12H13V10M17,10H15V12H17V10M19,3H18V1H16V3H8V1H6V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M19,19H5V8H19V19Z",a="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z",i="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z",r="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",o="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"},9052:e=>{"use strict";var t=Object.prototype.hasOwnProperty,s="~";function n(){}function a(e,t,s){this.fn=e,this.context=t,this.once=s||!1}function i(e,t,n,i,r){if("function"!=typeof n)throw new TypeError("The listener must be a function");var o=new a(n,i||e,r),l=s?s+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function r(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function o(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(s=!1)),o.prototype.eventNames=function(){var e,n,a=[];if(0===this._eventsCount)return a;for(n in e=this._events)t.call(e,n)&&a.push(s?n.slice(1):n);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},o.prototype.listeners=function(e){var t=s?s+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var a=0,i=n.length,r=new Array(i);a{"use strict";var n=s(35810),a=s(85168),i=s(53334),r=s(49264),o=s(9558),l=s(61338),m=s(87485),d=s(65043);const g=()=>!0===(0,m.F)()?.files?.undelete,c=e=>e.every((e=>!0===e.attributes["is-mount-root"]&&"shared"===e.attributes["mount-type"])),u=e=>e.every((e=>!0===e.attributes["is-mount-root"]&&"external"===e.attributes["mount-type"])),f=(e,t)=>"trashbin"!==t.id&&g()?(e=>{if(1===e.length)return!1;const t=e.some((e=>c([e]))),s=e.some((e=>!c([e])));return t&&s})(e)?(0,i.t)("files","Delete and unshare"):c(e)?1===e.length?(0,i.t)("files","Leave this share"):(0,i.t)("files","Leave these shares"):u(e)?1===e.length?(0,i.t)("files","Disconnect storage"):(0,i.t)("files","Disconnect storages"):(e=>!e.some((e=>e.type!==n.pt.File)))(e)?1===e.length?(0,i.t)("files","Delete file"):(0,i.t)("files","Delete files"):(e=>!e.some((e=>e.type!==n.pt.Folder)))(e)?1===e.length?(0,i.t)("files","Delete folder"):(0,i.t)("files","Delete folders"):(0,i.t)("files","Delete"):(0,i.t)("files","Delete permanently"),p=async(e,t)=>{const s="trashbin"!==t.id&&g()?(0,i.n)("files","You are about to delete {count} item","You are about to delete {count} items",e.length,{count:e.length}):(0,i.n)("files","You are about to permanently delete {count} item","You are about to permanently delete {count} items",e.length,{count:e.length});return new Promise((n=>{window.OC.dialogs.confirmDestructive(s,(0,i.t)("files","Confirm deletion"),{type:window.OC.dialogs.YES_NO_BUTTONS,confirm:f(e,t),confirmClasses:"error",cancel:(0,i.t)("files","Cancel")},(e=>{n(e)}))}))},h=async e=>{await d.Ay.delete(e.encodedSource),(0,l.Ic)("files:node:deleted",e)},w=new r.A({concurrency:5}),v=new n.hY({id:"delete",displayName:f,iconSvgInline:e=>c(e)?'':u(e)?'':'',enabled:e=>e.length>0&&e.map((e=>e.permissions)).every((e=>!!(e&n.aX.DELETE))),async exec(e,t){try{let s=!0;return g()||(s=await p([e],t)),!1===s?((0,a.cf)((0,i.Tl)("files","Deletion cancelled")),null):(await h(e),!0)}catch(t){return o.A.error("Error while deleting a file",{error:t,source:e.source,node:e}),!1}},async execBatch(e,t){let s=!0;if(g()?e.length>=5&&!c(e)&&!u(e)&&(s=await p(e,t)):s=await p(e,t),!1===s)return(0,a.cf)((0,i.Tl)("files","Deletion cancelled")),Promise.all(e.map((()=>null)));const n=e.map((e=>new Promise((t=>{w.add((async()=>{try{await h(e),t(!0)}catch(s){o.A.error("Error while deleting a file",{error:s,source:e.source,node:e}),t(!1)}}))}))));return Promise.all(n)},order:100});var T=s(63814);const y=function(e){const t=document.createElement("a");t.download="",t.href=e,t.click()},x=function(e,t){const s=Math.random().toString(36).substring(2),n=(0,T.Jv)("/apps/files/ajax/download.php?dir={dir}&files={files}&downloadStartSecret={secret}",{dir:e,secret:s,files:JSON.stringify(t.map((e=>e.basename)))});y(n)},C=function(e){if(!(e.permissions&n.aX.READ))return!1;if("shared"===e.attributes["mount-type"]){const t=JSON.parse(e.attributes["share-attributes"]??"[]"),s=t?.find?.((e=>"permissions"===e.scope&&"download"===e.key));if(void 0!==s&&!1===s.value)return!1}return!0},b=new n.hY({id:"download",default:n.m9.DEFAULT,displayName:()=>(0,i.t)("files","Download"),iconSvgInline:()=>'',enabled:e=>0!==e.length&&(!e.some((e=>e.type===n.pt.Folder))||!e.some((e=>!e.root?.startsWith("/files"))))&&e.every(C),exec:async(e,t,s)=>e.type===n.pt.Folder?(x(s,[e]),null):(y(e.encodedSource),null),async execBatch(e,t,s){return 1===e.length?(this.exec(e[0],t,s),[null]):(x(s,e),new Array(e.length).fill(null))},order:30});var L=s(71225),k=s(21777),F=s(65659);const N=async function(e){const t=(0,T.KT)("apps/files/api/v1")+"/openlocaleditor?format=json";try{const s=await d.Ay.post(t,{path:e}),n=(0,k.HW)()?.uid;let a=`nc://open/${n}@`+window.location.host+(0,L.O0)(e);a+="?token="+s.data.ocs.data.token,window.location.href=a}catch(e){(0,a.Qg)((0,i.Tl)("files","Failed to redirect to client"))}},S=new n.hY({id:"edit-locally",displayName:()=>(0,i.Tl)("files","Edit locally"),iconSvgInline:()=>'',enabled:e=>1===e.length&&!!(e[0].permissions&n.aX.UPDATE),exec:async e=>((async e=>{N(e),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>{},t=!1;(new a.ik).setName((0,i.Tl)("files","Edit file locally")).setText((0,i.Tl)("files","The file should now open locally. If you don't see this happening, make sure that the desktop client is installed on your system.")).setButtons([{label:(0,i.Tl)("files","Retry local edit"),icon:'',callback:()=>{t=!0,e(!1)}},{label:(0,i.Tl)("files","Edit online"),icon:F,type:"primary",callback:()=>{t=!0,e(!0)}}]).build().show().then((()=>{t||e(!1)}))}((t=>{t?N(e):window.OCA.Viewer.open({path:e})}))})(e.path),null),order:25});var U=s(85471);const _='',A=e=>e.some((e=>1!==e.attributes.favorite)),E=async(e,t,s)=>{try{const n=(0,T.Jv)("/apps/files/api/v1/files")+(0,L.O0)(e.path);return await d.Ay.post(n,{tags:s?[window.OC.TAG_FAVORITE]:[]}),"favorites"!==t.id||s||"/"!==e.dirname||(0,l.Ic)("files:node:deleted",e),U.Ay.set(e.attributes,"favorite",s?1:0),s?(0,l.Ic)("files:favorites:added",e):(0,l.Ic)("files:favorites:removed",e),!0}catch(t){const n=s?"adding a file to favourites":"removing a file from favourites";return o.A.error("Error while "+n,{error:t,source:e.source,node:e}),!1}},P=new n.hY({id:"favorite",displayName:e=>A(e)?(0,i.Tl)("files","Add to favorites"):(0,i.Tl)("files","Remove from favorites"),iconSvgInline:e=>A(e)?'':_,enabled:e=>!e.some((e=>!e.root?.startsWith?.("/files")))&&e.every((e=>e.permissions!==n.aX.NONE)),async exec(e,t){const s=A([e]);return await E(e,t,s)},async execBatch(e,t){const s=A(e);return Promise.all(e.map((async e=>await E(e,t,s))))},order:-50});var I=s(86635),B=s(43627),M=s(36882),R=s(39285);let z;var j;!function(e){e.MOVE="Move",e.COPY="Copy",e.MOVE_OR_COPY="move-or-copy"}(j||(j={}));const O=e=>{const t=e.reduce(((e,t)=>Math.min(e,t.permissions)),n.aX.ALL);return Boolean(t&n.aX.DELETE)},D=e=>(e=>e.every((e=>!JSON.parse(e.attributes?.["share-attributes"]??"[]").some((e=>"permissions"===e.scope&&!1===e.value&&"download"===e.key)))))(e)&&!e.some((e=>e.permissions===n.aX.NONE));var V=s(36117);const H=(0,n.H4)(),$=e=>(0,n.Al)(e),W=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const t=new AbortController,s=(0,n.VL)();return e=`${n.lJ}${e}`,new V.CancelablePromise((async(n,a,i)=>{i((()=>t.abort()));try{const a=await H.getDirectoryContents(e,{details:!0,data:s,includeSelf:!0,signal:t.signal}),i=a.data[0],r=a.data.slice(1);if(i.filename!==e&&`${i.filename}/`!==e)throw o.A.debug(`Exepected "${e}" but got filename "${i.filename}" instead.`),new Error("Root node does not match requested path");n({folder:$(i),contents:r.map((e=>{try{return $(e)}catch(t){return o.A.error(`Invalid node detected '${e.basename}'`,{error:t}),null}})).filter(Boolean)})}catch(e){a(e)}}))},q=e=>O(e)?D(e)?j.MOVE_OR_COPY:j.MOVE:j.COPY,G=async function(e,t,s){let m=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!t)return;if(t.type!==n.pt.Folder)throw new Error((0,i.Tl)("files","Destination is not a folder"));if(s===j.MOVE&&e.dirname===t.path)throw new Error((0,i.Tl)("files","This file/folder is already in that directory"));if(`${t.path}/`.startsWith(`${e.path}/`))throw new Error((0,i.Tl)("files","You cannot move a file/folder onto itself or into a subfolder of itself"));U.Ay.set(e,"status",n.zI.LOADING);const g=(z||(z=new r.A({concurrency:5})),z);return await g.add((async()=>{const r=e=>1===e?(0,i.Tl)("files","(copy)"):(0,i.Tl)("files","(copy %n)",void 0,e);try{const o=(0,n.H4)(),d=(0,B.join)(n.lJ,e.path),g=(0,B.join)(n.lJ,t.path);if(s===j.COPY){let s=e.basename;if(!m){const t=await o.getDirectoryContents(g);s=(0,n.E6)(e.basename,t.map((e=>e.basename)),{suffix:r,ignoreFileExtension:e.type===n.pt.Folder})}if(await o.copyFile(d,(0,B.join)(g,s)),e.dirname===t.path){const{data:e}=await o.stat((0,B.join)(g,s),{details:!0,data:(0,n.VL)()});(0,l.Ic)("files:node:created",(0,n.Al)(e))}}else{const s=await W(t.path);if((0,I.h)([e],s.contents))try{const{selected:n,renamed:a}=await(0,I.o)(t.path,[e],s.contents);if(!n.length&&!a.length)return}catch(e){return void(0,a.Qg)((0,i.Tl)("files","Move cancelled"))}await o.moveFile(d,(0,B.join)(g,e.basename)),(0,l.Ic)("files:node:deleted",e)}}catch(e){if((0,d.F0)(e)){if(412===e.response?.status)throw new Error((0,i.Tl)("files","A file or folder with that name already exists in this folder"));if(423===e.response?.status)throw new Error((0,i.Tl)("files","The files are locked"));if(404===e.response?.status)throw new Error((0,i.Tl)("files","The file does not exist anymore"));if(e.message)throw new Error(e.message)}throw o.A.debug(e),new Error}finally{U.Ay.set(e,"status",void 0)}}))};async function Y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",s=arguments.length>2?arguments[2]:void 0;const{resolve:r,reject:l,promise:m}=Promise.withResolvers(),d=s.map((e=>e.fileid)).filter(Boolean);return(0,a.a1)((0,i.Tl)("files","Choose destination")).allowDirectories(!0).setFilter((e=>!d.includes(e.fileid))).setMimeTypeFilter([]).setMultiSelect(!1).startAt(t).setButtonFactory(((t,a)=>{const o=[],l=(0,B.basename)(a),m=s.map((e=>e.dirname)),d=s.map((e=>e.path));return e!==j.COPY&&e!==j.MOVE_OR_COPY||o.push({label:l?(0,i.Tl)("files","Copy to {target}",{target:l},void 0,{escape:!1,sanitize:!1}):(0,i.Tl)("files","Copy"),type:"primary",icon:M,disabled:t.some((e=>!(e.permissions&n.aX.CREATE))),async callback(e){r({destination:e[0],action:j.COPY})}}),m.includes(a)||d.includes(a)||e!==j.MOVE&&e!==j.MOVE_OR_COPY||o.push({label:l?(0,i.Tl)("files","Move to {target}",{target:l},void 0,{escape:!1,sanitize:!1}):(0,i.Tl)("files","Move"),type:e===j.MOVE?"primary":"secondary",icon:R,async callback(e){r({destination:e[0],action:j.MOVE})}}),o})).build().pick().catch((e=>{o.A.debug(e),e instanceof a.vT?r(!1):l(new Error((0,i.Tl)("files","Move or copy operation failed")))})),m}const J=new n.hY({id:"move-copy",displayName(e){switch(q(e)){case j.MOVE:return(0,i.Tl)("files","Move");case j.COPY:return(0,i.Tl)("files","Copy");case j.MOVE_OR_COPY:return(0,i.Tl)("files","Move or copy")}},iconSvgInline:()=>R,enabled:e=>!!e.every((e=>e.root?.startsWith("/files/")))&&e.length>0&&(O(e)||D(e)),async exec(e,t,s){const n=q([e]);let r;try{r=await Y(n,s,[e])}catch(e){return o.A.error(e),!1}if(!1===r)return(0,a.cf)((0,i.Tl)("files",'Cancelled move or copy of "{filename}".',{filename:e.displayname})),null;try{return await G(e,r.destination,r.action),!0}catch(e){return!!(e instanceof Error&&e.message)&&((0,a.Qg)(e.message),null)}},async execBatch(e,t,s){const n=q(e),r=await Y(n,s,e);if(!1===r)return(0,a.cf)(1===e.length?(0,i.Tl)("files",'Cancelled move or copy of "{filename}".',{filename:e[0].displayname}):(0,i.Tl)("files","Cancelled move or copy operation")),e.map((()=>null));const l=e.map((async e=>{try{return await G(e,r.destination,r.action),!0}catch(t){return o.A.error(`Failed to ${r.action} node`,{node:e,error:t}),!1}}));return await Promise.all(l)},order:15}),K='',Z=new n.hY({id:"open-folder",displayName(e){const t=e[0].displayname;return(0,i.Tl)("files","Open folder {displayName}",{displayName:t})},iconSvgInline:()=>K,enabled(e){if(1!==e.length)return!1;const t=e[0];return!!t.isDavRessource&&t.type===n.pt.Folder&&!!(t.permissions&n.aX.READ)},exec:async(e,t)=>!(!e||e.type!==n.pt.Folder)&&(window.OCP.Files.Router.goToRoute(null,{view:t.id,fileid:String(e.fileid)},{dir:e.path}),null),default:n.m9.HIDDEN,order:-100}),X=new n.hY({id:"open-in-files-recent",displayName:()=>(0,i.Tl)("files","Open in Files"),iconSvgInline:()=>"",enabled:(e,t)=>"recent"===t.id,async exec(e){let t=e.dirname;return e.type===n.pt.Folder&&(t=t+"/"+e.basename),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(e.fileid)},{dir:t,openfile:"true"}),null},order:-1e3,default:n.m9.HIDDEN}),Q=new n.hY({id:"rename",displayName:()=>(0,i.Tl)("files","Rename"),iconSvgInline:()=>'',enabled:e=>e.length>0&&e.map((e=>e.permissions)).every((e=>Boolean(e&n.aX.DELETE))),exec:async e=>((0,l.Ic)("files:node:rename",e),null),order:10});var ee=s(49981);const te=new n.hY({id:"details",displayName:()=>(0,i.Tl)("files","Open details"),iconSvgInline:()=>ee,enabled:e=>1===e.length&&!!e[0]&&!!window?.OCA?.Files?.Sidebar&&((e[0].root?.startsWith("/files/")&&e[0].permissions!==n.aX.NONE)??!1),async exec(e,t,s){try{return await window.OCA.Files.Sidebar.open(e.path),window.OCP.Files.Router.goToRoute(null,{view:t.id,fileid:String(e.fileid)},{...window.OCP.Files.Router.query,dir:s},!0),null}catch(e){return o.A.error("Error while opening sidebar",{error:e}),!1}},order:-50}),se=new n.hY({id:"view-in-folder",displayName:()=>(0,i.Tl)("files","View in folder"),iconSvgInline:()=>R,enabled(e,t){if("files"===t.id)return!1;if(1!==e.length)return!1;const s=e[0];return!!s.isDavRessource&&s.permissions!==n.aX.NONE&&s.type===n.pt.File},exec:async e=>!(!e||e.type!==n.pt.File)&&(window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(e.fileid)},{dir:e.dirname}),null),order:80});var ne=s(32981);class ae extends n.L3{constructor(){var e,t,s;super("files:hidden",0),e=this,s=void 0,(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var s=t.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t="showHidden"))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,this.showHidden=(0,ne.C)("files","config",{show_hidden:!1}).show_hidden,(0,l.B1)("files:config:updated",(e=>{let{key:t,value:s}=e;"show_hidden"===t&&(this.showHidden=Boolean(s),this.filterUpdated())}))}filter(e){return this.showHidden?e:e.filter((e=>!0!==e.attributes.hidden&&!e.basename.startsWith(".")))}}var ie=s(9165),re=s(89257),oe=s(6695),le=s(24764),me=s(80114);const de=(0,U.pM)({__name:"FileListFilter",props:{isActive:{type:Boolean},filterName:null},emits:["reset-filter"],setup:e=>({__sfc:!0,t:i.t,NcActions:le.A,NcActionButton:re.A,NcActionSeparator:me.A})});var ge=s(85072),ce=s.n(ge),ue=s(97825),fe=s.n(ue),pe=s(77659),he=s.n(pe),we=s(55056),ve=s.n(we),Te=s(10540),ye=s.n(Te),xe=s(41113),Ce=s.n(xe),be=s(69409),Le={};Le.styleTagTransform=Ce(),Le.setAttributes=ve(),Le.insert=he().bind(null,"head"),Le.domAPI=fe(),Le.insertStyleElement=ye(),ce()(be.A,Le),be.A&&be.A.locals&&be.A.locals;var ke=s(14486);const Fe=(0,ke.A)(de,(function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t(s.NcActions,{attrs:{"force-menu":"",type:e.isActive?"secondary":"tertiary","menu-name":e.filterName},scopedSlots:e._u([{key:"icon",fn:function(){return[e._t("icon")]},proxy:!0}],null,!0)},[e._v(" "),e._t("default"),e._v(" "),e.isActive?[t(s.NcActionSeparator),e._v(" "),t(s.NcActionButton,{staticClass:"files-list-filter__clear-button",attrs:{"close-after-click":""},on:{click:function(t){return e.$emit("reset-filter")}}},[e._v("\n\t\t\t"+e._s(s.t("files","Clear filter"))+"\n\t\t")])]:e._e()],2)}),[],!1,null,"5c37f334",null).exports,Ne=(0,U.pM)({name:"FileListFilterType",components:{FileListFilter:Fe,NcActionButton:re.A,NcIconSvgWrapper:oe.A},props:{typePresets:{type:Array,required:!0}},setup:()=>({mdiFile:ie.DvY,t:i.Tl}),data:()=>({selectedOptions:[]}),computed:{isActive(){return this.selectedOptions.length>0}},watch:{selectedOptions(e,t){0===this.selectedOptions.length?0!==t.length&&this.$emit("update:preset"):this.$emit("update:preset",this.selectedOptions)}},methods:{resetFilter(){this.selectedOptions=[]},toggleOption(e){const t=this.selectedOptions.indexOf(e);-1!==t?this.selectedOptions.splice(t,1):this.selectedOptions.push(e)}}});var Se=s(44989),Ue={};Ue.styleTagTransform=Ce(),Ue.setAttributes=ve(),Ue.insert=he().bind(null,"head"),Ue.domAPI=fe(),Ue.insertStyleElement=ye(),ce()(Se.A,Ue),Se.A&&Se.A.locals&&Se.A.locals;const _e=(0,ke.A)(Ne,(function(){var e=this,t=e._self._c;return e._self._setupProxy,t("FileListFilter",{staticClass:"file-list-filter-type",attrs:{"is-active":e.isActive,"filter-name":e.t("files","Type")},on:{"reset-filter":e.resetFilter},scopedSlots:e._u([{key:"icon",fn:function(){return[t("NcIconSvgWrapper",{attrs:{path:e.mdiFile}})]},proxy:!0}])},[e._v(" "),e._l(e.typePresets,(function(s){return t("NcActionButton",{key:s.id,attrs:{type:"checkbox","model-value":e.selectedOptions.includes(s)},on:{click:function(t){return e.toggleOption(s)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("NcIconSvgWrapper",{attrs:{svg:s.icon}})]},proxy:!0}],null,!0)},[e._v("\n\t\t"+e._s(s.label)+"\n\t")])}))],2)}),[],!1,null,null,null).exports;function Ae(e,t,s){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var s=t.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const Ee=(e,t)=>e.replace("this.setPreset()))}async mount(e){void 0===this.allPresets&&(this.allPresets=await(async()=>[{id:"document",label:(0,i.t)("files","Documents"),icon:Ee('',"#49abea"),mime:["x-office/document"]},{id:"spreadsheet",label:(0,i.t)("files","Spreadsheets"),icon:Ee('',"#9abd4e"),mime:["x-office/spreadsheet"]},{id:"presentation",label:(0,i.t)("files","Presentations"),icon:Ee('',"#f0965f"),mime:["x-office/presentation"]},{id:"pdf",label:(0,i.t)("files","PDFs"),icon:Ee('',"#dc5047"),mime:["application/pdf"]},{id:"folder",label:(0,i.t)("files","Folders"),icon:Ee(K,window.getComputedStyle(document.body).getPropertyValue("--color-primary-element")),mime:["httpd/unix-directory"]},{id:"audio",label:(0,i.t)("files","Audio"),icon:'',mime:["audio"]},{id:"image",label:(0,i.t)("files","Photos and images"),icon:'',mime:["image"]},{id:"video",label:(0,i.t)("files","Videos"),icon:'',mime:["video"]}])()),this.currentInstance&&this.currentInstance.$destroy();const t=U.Ay.extend(_e);this.currentInstance=new t({propsData:{typePresets:this.allPresets},el:e}).$on("update:preset",this.setPreset.bind(this)).$mount()}filter(e){if(!this.currentPresets||0===this.currentPresets.length)return e;const t=this.currentPresets.reduce(((e,t)=>[...e,...t.mime]),[]);return e.filter((e=>{if(!e.mime)return!1;const s=e.mime.toLowerCase();return!!t.includes(s)||!!t.includes(window.OC.MimeTypeList.aliases[s])||!!t.includes(s.split("/")[0])}))}setPreset(e){this.currentPresets=e,this.filterUpdated();const t=[];if(e&&e.length>0)for(const s of e)t.push({icon:s.icon,text:s.label,onclick:()=>this.setPreset(e.filter((e=>{let{id:t}=e;return t!==s.id})))});else this.currentInstance?.resetFilter();this.updateChips(t)}}const Ie=(0,U.pM)({components:{FileListFilter:Fe,NcActionButton:re.A,NcIconSvgWrapper:oe.A},props:{timePresets:{type:Array,required:!0}},setup:()=>({mdiCalendarRange:ie.O1W}),data:()=>({selectedOption:null,timeRangeEnd:null,timeRangeStart:null}),computed:{isActive(){return null!==this.selectedOption},currentPreset(){return this.timePresets.find((e=>{let{id:t}=e;return t===this.selectedOption}))??null}},watch:{selectedOption(){if(null===this.selectedOption)this.$emit("update:preset");else{const e=this.currentPreset;this.$emit("update:preset",e)}}},methods:{t:i.Tl,resetFilter(){this.selectedOption=null,this.timeRangeEnd=null,this.timeRangeStart=null}}});var Be=s(27107),Me={};Me.styleTagTransform=Ce(),Me.setAttributes=ve(),Me.insert=he().bind(null,"head"),Me.domAPI=fe(),Me.insertStyleElement=ye(),ce()(Be.A,Me),Be.A&&Be.A.locals&&Be.A.locals;const Re=(0,ke.A)(Ie,(function(){var e=this,t=e._self._c;return e._self._setupProxy,t("FileListFilter",{attrs:{"is-active":e.isActive,"filter-name":e.t("files","Modified")},on:{"reset-filter":e.resetFilter},scopedSlots:e._u([{key:"icon",fn:function(){return[t("NcIconSvgWrapper",{attrs:{path:e.mdiCalendarRange}})]},proxy:!0}])},[e._v(" "),e._l(e.timePresets,(function(s){return t("NcActionButton",{key:s.id,attrs:{type:"radio","close-after-click":"","model-value":e.selectedOption,value:s.id},on:{"update:modelValue":function(t){e.selectedOption=t},"update:model-value":function(t){e.selectedOption=t}}},[e._v("\n\t\t"+e._s(s.label)+"\n\t")])}))],2)}),[],!1,null,"cfb7f0ce",null).exports;function ze(e,t,s){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var s=t.call(e,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const je=()=>(new Date).setHours(0,0,0,0),Oe=[{id:"today",label:(0,i.t)("files","Today"),filter:e=>e>je()},{id:"last-7",label:(0,i.t)("files","Last 7 days"),filter:e=>e>je()-6048e5},{id:"last-30",label:(0,i.t)("files","Last 30 days"),filter:e=>e>je()-2592e6},{id:"this-year",label:(0,i.t)("files","This year ({year})",{year:(new Date).getFullYear()}),filter:e=>e>new Date(je()).setMonth(0,1)},{id:"last-year",label:(0,i.t)("files","Last year ({year})",{year:(new Date).getFullYear()-1}),filter:e=>e>new Date(je()).setFullYear((new Date).getFullYear()-1,0,1)&&ethis.setPreset()))}mount(e){this.currentInstance&&this.currentInstance.$destroy();const t=U.Ay.extend(Re);this.currentInstance=new t({propsData:{timePresets:Oe},el:e}).$on("update:preset",this.setPreset.bind(this)).$mount()}filter(e){return this.currentPreset?e.filter((e=>void 0===e.mtime||this.currentPreset.filter(e.mtime.getTime()))):e}setPreset(e){this.currentPreset=e,this.filterUpdated();const t=[];e?t.push({icon:'',text:e.label,onclick:()=>this.setPreset()}):this.currentInstance?.resetFilter(),this.updateChips(t)}}var Ve=s(18740),He=s(94219),$e=s(82182);const We=(0,U.pM)({__name:"NewNodeDialog",props:{defaultName:{type:String,default:(0,i.t)("files","New folder")},otherNames:{type:Array,default:()=>[]},open:{type:Boolean,default:!0},name:{type:String,default:(0,i.t)("files","Create new folder")},label:{type:String,default:(0,i.t)("files","Folder name")}},emits:["close"],setup(e,t){let{emit:s}=t;const a=e,r=(0,U.KR)(a.defaultName),o=(0,U.KR)(),l=(0,U.KR)(),m=(0,U.KR)("");function d(){(0,U.dY)((()=>{const e=o.value?.$el.querySelector("input");if(!a.open||!e)return;const t=r.value.length-(0,B.extname)(r.value).length;e.focus(),e.setSelectionRange(0,t)}))}return(0,U.wB)((()=>[a.defaultName,a.otherNames]),(()=>{r.value=(0,n.E6)(a.defaultName,a.otherNames).trim()})),(0,U.nT)((()=>{a.otherNames.includes(r.value.trim())?m.value=(0,i.t)("files","This name is already in use."):m.value=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(""===e.trim())return(0,i.t)("files","Filename must not be empty.");try{return(0,n.KT)(e),""}catch(e){if(!(e instanceof n.di))throw e;switch(e.reason){case n.nF.Character:return(0,i.t)("files",'"{char}" is not allowed inside a filename.',{char:e.segment},void 0,{escape:t});case n.nF.ReservedName:return(0,i.t)("files",'"{segment}" is a reserved name and not allowed for filenames.',{segment:e.segment},void 0,{escape:!1});case n.nF.Extension:return e.segment.match(/\.[a-z]/i)?(0,i.t)("files",'"{extension}" is not an allowed filetype.',{extension:e.segment},void 0,{escape:!1}):(0,i.t)("files",'Filenames must not end with "{extension}".',{extension:e.segment},void 0,{escape:!1});default:return(0,i.t)("files","Invalid filename.")}}}(r.value.trim());const e=o.value?.$el.querySelector("input");e&&(e.setCustomValidity(m.value),e.reportValidity())})),(0,U.wB)((()=>a.open),(()=>{(0,U.dY)((()=>{d()}))})),(0,U.sV)((()=>{r.value=(0,n.E6)(r.value,a.otherNames).trim(),(0,U.dY)((()=>d()))})),{__sfc:!0,props:a,emit:s,localDefaultName:r,nameInput:o,formElement:l,validity:m,focusInput:d,submit:function(){l.value?.requestSubmit()},t:i.t,NcButton:Ve.A,NcDialog:He.A,NcTextField:$e.A}}});var qe=s(17104),Ge={};Ge.styleTagTransform=Ce(),Ge.setAttributes=ve(),Ge.insert=he().bind(null,"head"),Ge.domAPI=fe(),Ge.insertStyleElement=ye(),ce()(qe.A,Ge),qe.A&&qe.A.locals&&qe.A.locals;const Ye=(0,ke.A)(We,(function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t(s.NcDialog,{attrs:{"data-cy-files-new-node-dialog":"",name:e.name,open:e.open,"close-on-click-outside":"","out-transition":""},on:{"update:open":function(e){return s.emit("close",null)}},scopedSlots:e._u([{key:"actions",fn:function(){return[t(s.NcButton,{attrs:{"data-cy-files-new-node-dialog-submit":"",type:"primary",disabled:""!==s.validity},on:{click:s.submit}},[e._v("\n\t\t\t"+e._s(s.t("files","Create"))+"\n\t\t")])]},proxy:!0}])},[e._v(" "),t("form",{ref:"formElement",staticClass:"new-node-dialog__form",on:{submit:function(e){return e.preventDefault(),s.emit("close",s.localDefaultName)}}},[t(s.NcTextField,{ref:"nameInput",attrs:{"data-cy-files-new-node-dialog-input":"",error:""!==s.validity,"helper-text":s.validity,label:e.label,value:s.localDefaultName},on:{"update:value":function(e){s.localDefaultName=e}}})],1)])}),[],!1,null,"42dcb609",null).exports;function Je(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=t.map((e=>e.basename));return new Promise((t=>{(0,a.Ss)(Ye,{...s,defaultName:e,otherNames:n},(e=>{t(e)}))}))}const Ke={id:"newFolder",displayName:(0,i.Tl)("files","New folder"),enabled:e=>!!(e.permissions&n.aX.CREATE),iconSvgInline:'',order:0,async handler(e,t){const s=await Je((0,i.Tl)("files","New folder"),t);if(null!==s)try{const{fileid:t,source:r}=await(async(e,t)=>{const s=e.source+"/"+t,n=e.encodedSource+"/"+encodeURIComponent(t),a=await(0,d.Ay)({method:"MKCOL",url:n,headers:{Overwrite:"F"}});return{fileid:parseInt(a.headers["oc-fileid"]),source:s}})(e,s.trim()),m=new n.vd({source:r,id:t,mtime:new Date,owner:e.owner,permissions:n.aX.ALL,root:e?.root||"/files/"+(0,k.HW)()?.uid,attributes:{"mount-type":e.attributes?.["mount-type"],"owner-id":e.attributes?.["owner-id"],"owner-display-name":e.attributes?.["owner-display-name"]}});(0,l.Ic)("files:node:created",m),(0,a.Te)((0,i.Tl)("files",'Created new folder "{name}"',{name:(0,B.basename)(r)})),o.A.debug("Created new folder",{folder:m,source:r}),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(t)},{dir:e.path})}catch(e){o.A.error("Creating new folder failed",{error:e}),(0,a.Qg)("Creating new folder failed")}else(0,a.cf)((0,i.Tl)("files","New folder creation cancelled"))}};let Ze=(0,ne.C)("files","templates_path",!1);o.A.debug("Initial templates folder",{templatesPath:Ze});const Xe={id:"template-picker",displayName:(0,i.Tl)("files","Create templates folder"),iconSvgInline:'',order:30,enabled:e=>!Ze&&e.owner===(0,k.HW)()?.uid&&!!(e.permissions&n.aX.CREATE),async handler(e,t){const s=await Je((0,i.Tl)("files","Templates"),t,{name:(0,i.Tl)("files","New template folder")});null!==s&&(async function(e,t){const s=(0,B.join)(e.path,t);try{o.A.debug("Initializing the templates directory",{templatePath:s});const{data:e}=await d.Ay.post((0,T.KT)("apps/files/api/v1/templates/path"),{templatePath:s,copySystemTemplates:!0});window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:void 0},{dir:s}),o.A.info("Created new templates folder",{...e.ocs.data}),Ze=e.ocs.data.templates_path}catch(e){o.A.error("Unable to initialize the templates directory"),(0,a.Qg)((0,i.Tl)("files","Unable to initialize the templates directory"))}}(e,s),(0,n.gj)("template-picker"))}},Qe=(0,U.$V)((()=>Promise.all([s.e(4208),s.e(3235)]).then(s.bind(s,95013))));let et=null;const tt=async e=>{if(null===et){const t=document.createElement("div");t.id="template-picker",document.body.appendChild(t),et=new U.Ay({render:t=>t(Qe,{ref:"picker",props:{parent:e}}),methods:{open(){this.$refs.picker.open(...arguments)}},el:t})}return et},st=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";return"/"!==e?W(e):new V.CancelablePromise(((e,t,s)=>{const a=(0,n.Q$)(H).catch(t).then((s=>{s?e({contents:s,folder:new n.vd({id:0,source:`${n.PY}${n.lJ}`,root:n.lJ,owner:(0,k.HW)()?.uid||null,permissions:n.aX.READ})}):t()}));s((()=>a.cancel()))}))},nt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new n.Ss({id:at(e.path),name:e.displayname,icon:K,order:t,params:{dir:e.path,fileid:String(e.fileid),view:"favorites"},parent:"favorites",columns:[],getContents:st})},at=function(e){return`favorite-${function(e){let t=0;for(let s=0;s>>0}(e)}`};var it=s(65899);const rt=(0,ne.C)("files","config",{show_hidden:!1,crop_image_previews:!0,sort_favorites_first:!0,sort_folders_first:!0,grid_view:!1}),ot=(0,it.Ey)(),lt=Math.round(Date.now()/1e3-1209600),mt=e=>(0,n.Al)(e,n.lJ,(0,T.$_)()),dt=(0,k.HW)()?.uid,gt=function(e){const t=e.attributes["mount-type"];return dt===e.owner&&!["group","shared"].includes(t)},ct="folders",ut=`${n.PY}/files/${(0,k.HW)()?.uid}`,ft=Intl.Collator([(0,i.Z0)(),(0,i.lO)()],{numeric:!0,usage:"sort"}),pt=(e,t)=>ft.compare(e.displayName??e.basename,t.displayName??t.basename),ht=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=e.toSorted(pt);for(const{id:e,basename:a,displayName:i,children:r}of n){const n=(0,L.HS)(t,a),o=`${ut}${n}`,l={source:o,encodedSource:vt(o),path:n,fileid:e,basename:a};i&&(l.displayName=i),s.push(l),r.length>0&&ht(r,n,s)}return s},wt=e=>W(e),vt=e=>{const{origin:t}=new URL(e);return t+(0,L.O0)(e.slice(t.length))},Tt=e=>{const t=(0,L.pD)(e);return t===ut?ct:vt(t)},yt=(0,ne.C)("files","config",{folder_tree:!0}).folder_tree;let xt=(0,ne.C)("files","config",{show_hidden:!1}).show_hidden;const Ct=(0,n.bh)(),bt=new r.A({concurrency:5,intervalCap:5,interval:200}),Lt=new r.A({concurrency:5,intervalCap:5,interval:200}),kt=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";await bt.add((async()=>{const t=await async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const{data:s}=await d.Ay.get((0,T.KT)("/apps/files/api/v1/folder-tree"),{params:new URLSearchParams({path:e,depth:String(t)})});return ht(s,e)}(e),s=t.map((e=>Lt.add((()=>Nt(e)))));await Promise.allSettled(s)}))},Ft=e=>async t=>{t.loading||t.loaded||(t.loading=!0,await kt(e.path),t.loading=!1,t.loaded=!0,(0,l.Ic)("files:navigation:updated"),(0,l.Ic)("files:folder-tree:expanded"))},Nt=e=>{const t=Ct.views.find((t=>t.id===e.encodedSource));t&&Ct.remove(t.id),!xt&&e.basename.startsWith(".")||Ct.register(new n.Ss({id:e.encodedSource,parent:Tt(e.source),name:e.displayName??e.displayname??e.basename,icon:K,getContents:wt,loadChildViews:Ft(e),params:{view:ct,fileid:String(e.fileid),dir:e.path}}))},St=e=>{e instanceof n.vd&&Nt(e)},Ut=e=>{e instanceof n.vd&&(e=>{const t=e.encodedSource;Ct.remove(t)})(e)},_t=e=>{let{node:t,oldSource:s}=e;if(!(t instanceof n.vd))return;var a;a=s,Ct.remove(a),Nt(t);const i=t.source.replace(ut,""),r=s.replace(ut,""),o=Ct.views.filter((e=>!!e.params?.dir&&!(0,L.ys)(e.params.dir,r)&&e.params.dir.startsWith(r)));for(const e of o)e.parent=Tt(t.source),e.params.dir=e.params.dir.replace(r,i)},At=async e=>{let{key:t,value:s}=e;"show_hidden"===t&&(xt=s,await kt(),(0,l.Ic)("files:folder-tree:initialized"))};(0,n.Gg)(v),(0,n.Gg)(b),(0,n.Gg)(S),(0,n.Gg)(P),(0,n.Gg)(J),(0,n.Gg)(Z),(0,n.Gg)(X),(0,n.Gg)(Q),(0,n.Gg)(te),(0,n.Gg)(se),(0,n.zj)(Ke),(0,n.zj)(Xe),(0,ne.C)("files","templates",[]).forEach(((e,t)=>{(0,n.zj)({id:`template-new-${e.app}-${t}`,displayName:e.label,iconClass:e.iconClass||"icon-file",iconSvgInline:e.iconSvgInline,enabled:e=>!!(e.permissions&n.aX.CREATE),order:11,async handler(t,s){const n=tt(t),a=await Je(`${e.label}${e.extension}`,s,{label:(0,i.Tl)("files","Filename"),name:e.label});null!==a&&(await n).open(a.trim(),e)}})})),(async()=>{const e=(0,n.bh)();e.register(new n.Ss({id:"favorites",name:(0,i.Tl)("files","Favorites"),caption:(0,i.Tl)("files","List of favorite files and folders."),emptyTitle:(0,i.Tl)("files","No favorites yet"),emptyCaption:(0,i.Tl)("files","Files and folders you mark as favorite will show up here"),icon:_,order:15,columns:[],getContents:st}));const t=(await(0,n.Q$)(H)).filter((e=>e.type===n.pt.Folder)),s=t.map(((e,t)=>nt(e,t)));o.A.debug("Generating favorites view",{favoriteFolders:t}),s.forEach((t=>e.register(t))),(0,l.B1)("files:favorites:added",(e=>{e.type===n.pt.Folder&&(null!==e.path&&e.root?.startsWith("/files")?r(e):o.A.error("Favorite folder is not within user files root",{node:e}))})),(0,l.B1)("files:favorites:removed",(e=>{e.type===n.pt.Folder&&(null!==e.path&&e.root?.startsWith("/files")?m(e.path):o.A.error("Favorite folder is not within user files root",{node:e}))})),(0,l.B1)("files:node:renamed",(e=>{e.type===n.pt.Folder&&1===e.attributes.favorite&&d(e)}));const a=function(){t.sort(((e,t)=>e.path.localeCompare(t.path,(0,i.Z0)(),{ignorePunctuation:!0}))),t.forEach(((e,t)=>{const n=s.find((t=>t.id===at(e.path)));n&&(n.order=t)}))},r=function(n){const i=nt(n);t.find((e=>e.path===n.path))||(t.push(n),s.push(i),a(),e.register(i))},m=function(n){const i=at(n),r=t.findIndex((e=>e.path===n));-1!==r&&(t.splice(r,1),s.splice(r,1),e.remove(i),a())},d=function(e){const s=t.find((t=>t.fileid===e.fileid));void 0!==s&&(m(s.path),r(e))}})(),(0,n.bh)().register(new n.Ss({id:"files",name:(0,i.Tl)("files","All files"),caption:(0,i.Tl)("files","List of your files and folders."),icon:K,order:0,getContents:W})),(0,n.bh)().register(new n.Ss({id:"recent",name:(0,i.Tl)("files","Recent"),caption:(0,i.Tl)("files","List of recently modified files and folders."),emptyTitle:(0,i.Tl)("files","No recently modified files"),emptyCaption:(0,i.Tl)("files","Files and folders you recently modified will show up here."),icon:'',order:10,defaultSortKey:"mtime",getContents:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";const t=function(){const e=(0,it.nY)("userconfig",{state:()=>({userConfig:rt}),actions:{onUpdate(e,t){U.Ay.set(this.userConfig,e,t)},async update(e,t){await d.Ay.put((0,T.Jv)("/apps/files/api/v1/config/"+e),{value:t}),(0,l.Ic)("files:config:updated",{key:e,value:t})}}})(...arguments);return e._initialized||((0,l.B1)("files:config:updated",(function(t){let{key:s,value:n}=t;e.onUpdate(s,n)})),e._initialized=!0),e}(ot),s=s=>"/"!==e||t.userConfig.show_hidden||!s.dirname.split("/").some((e=>e.startsWith("."))),a=new AbortController;return new V.CancelablePromise((async(e,t,i)=>{i((()=>a.abort())),e((async()=>{const e=(await H.search("/",{signal:a.signal,details:!0,data:(0,n.R3)(lt)})).data.results.map(mt).filter(s);return{folder:new n.vd({id:0,source:`${n.PY}${n.lJ}`,root:n.lJ,owner:(0,k.HW)()?.uid||null,permissions:n.aX.READ}),contents:e}})())}))}})),(0,n.bh)().register(new n.Ss({id:"personal",name:(0,i.Tl)("files","Personal Files"),caption:(0,i.Tl)("files","List of your files and folders that are not shared."),emptyTitle:(0,i.Tl)("files","No personal files found"),emptyCaption:(0,i.Tl)("files","Files that are not shared will show up here."),icon:'',order:5,getContents:function(){return W(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/").then((e=>(e.contents=e.contents.filter(gt),e)))}})),(async()=>{yt&&(Ct.register(new n.Ss({id:ct,name:(0,i.Tl)("files","All folders"),caption:(0,i.Tl)("files","List of your files and folders."),icon:M,order:50,getContents:wt})),await kt(),(0,l.B1)("files:node:created",St),(0,l.B1)("files:node:deleted",Ut),(0,l.B1)("files:node:moved",_t),(0,l.B1)("files:config:updated",At),(0,l.Ic)("files:folder-tree:initialized"))})(),(0,n.cZ)(new ae),(0,n.cZ)(new Pe),(0,n.cZ)(new De),"serviceWorker"in navigator?window.addEventListener("load",(async()=>{try{const e=(0,T.Jv)("/apps/files/preview-service-worker.js",{},{noRewrite:!0}),t=await navigator.serviceWorker.register(e,{scope:"/"});o.A.debug("SW registered: ",{registration:t})}catch(e){o.A.error("SW registration failed: ",{error:e})}})):o.A.debug("Service Worker is not enabled on this browser."),(0,n.Yc)("nc:hidden",{nc:"http://nextcloud.org/ns"}),(0,n.Yc)("nc:is-mount-root",{nc:"http://nextcloud.org/ns"}),(0,n.Yc)("nc:metadata-files-live-photo",{nc:"http://nextcloud.org/ns"})},9558:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});const n=(0,s(35947).YK)().setApp("files").detectUser().build()},82190:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var n=s(71354),a=s.n(n),i=s(76314),r=s.n(i)()(a());r.push([e.id,"\n.invalid-filename-dialog__input[data-v-3a479259] {\n\t/* Ensure the helper text can always be shown without jumping */\n\tmin-height: calc(var(--default-clickable-area) + 4 * var(--default-font-size));\n}\n.upload-picker[data-v-3e5a9212] {\n display: inline-flex;\n align-items: center;\n height: var(--default-clickable-area);\n}\n.upload-picker__progress[data-v-3e5a9212] {\n width: 200px;\n max-width: 0;\n transition: max-width var(--animation-quick) ease-in-out;\n margin-top: 8px;\n}\n.upload-picker__progress p[data-v-3e5a9212] {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.upload-picker--uploading .upload-picker__progress[data-v-3e5a9212] {\n max-width: 200px;\n margin-right: 20px;\n margin-left: 8px;\n}\n.upload-picker--paused .upload-picker__progress[data-v-3e5a9212] {\n animation: breathing-3e5a9212 3s ease-out infinite normal;\n}\n@keyframes breathing-3e5a9212 {\n0% {\n opacity: 0.5;\n}\n25% {\n opacity: 1;\n}\n60% {\n opacity: 0.5;\n}\n100% {\n opacity: 0.5;\n}\n}","",{version:3,sources:["webpack://./node_modules/@nextcloud/upload/dist/assets/index-Dg3Dlw7h.css"],names:[],mappings:";AACA;CACC,+DAA+D;CAC/D,8EAA8E;AAC/E;AACA;EACE,oBAAoB;EACpB,mBAAmB;EACnB,qCAAqC;AACvC;AACA;EACE,YAAY;EACZ,YAAY;EACZ,wDAAwD;EACxD,eAAe;AACjB;AACA;EACE,gBAAgB;EAChB,mBAAmB;EACnB,uBAAuB;AACzB;AACA;EACE,gBAAgB;EAChB,kBAAkB;EAClB,gBAAgB;AAClB;AACA;EACE,yDAAyD;AAC3D;AACA;AACA;IACI,YAAY;AAChB;AACA;IACI,UAAU;AACd;AACA;IACI,YAAY;AAChB;AACA;IACI,YAAY;AAChB;AACA",sourcesContent:["\n.invalid-filename-dialog__input[data-v-3a479259] {\n\t/* Ensure the helper text can always be shown without jumping */\n\tmin-height: calc(var(--default-clickable-area) + 4 * var(--default-font-size));\n}\n.upload-picker[data-v-3e5a9212] {\n display: inline-flex;\n align-items: center;\n height: var(--default-clickable-area);\n}\n.upload-picker__progress[data-v-3e5a9212] {\n width: 200px;\n max-width: 0;\n transition: max-width var(--animation-quick) ease-in-out;\n margin-top: 8px;\n}\n.upload-picker__progress p[data-v-3e5a9212] {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.upload-picker--uploading .upload-picker__progress[data-v-3e5a9212] {\n max-width: 200px;\n margin-right: 20px;\n margin-left: 8px;\n}\n.upload-picker--paused .upload-picker__progress[data-v-3e5a9212] {\n animation: breathing-3e5a9212 3s ease-out infinite normal;\n}\n@keyframes breathing-3e5a9212 {\n0% {\n opacity: 0.5;\n}\n25% {\n opacity: 1;\n}\n60% {\n opacity: 0.5;\n}\n100% {\n opacity: 0.5;\n}\n}"],sourceRoot:""}]);const o=r},27107:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var n=s(71354),a=s.n(n),i=s(76314),r=s.n(i)()(a());r.push([e.id,".files-list-filter-time__clear-button[data-v-cfb7f0ce] .action-button__text{color:var(--color-error-text)}","",{version:3,sources:["webpack://./apps/files/src/components/FileListFilter/FileListFilterModified.vue"],names:[],mappings:"AAEC,4EACC,6BAAA",sourcesContent:["\n.files-list-filter-time {\n\t&__clear-button :deep(.action-button__text) {\n\t\tcolor: var(--color-error-text);\n\t}\n}\n"],sourceRoot:""}]);const o=r},69409:(e,t,s)=>{"use strict";s.d(t,{A:()=>o});var n=s(71354),a=s.n(n),i=s(76314),r=s.n(i)()(a());r.push([e.id,"\n.files-list-filter__clear-button[data-v-5c37f334] .action-button__text {\n\tcolor: var(--color-error-text);\n}\n[data-v-5c37f334] .button-vue {\n\tfont-weight: normal !important;\n*[data-v-5c37f334] {\n\t\tfont-weight: normal !important;\n}\n}\n","",{version:3,sources:["webpack://./apps/files/src/components/FileListFilter/FileListFilter.vue"],names:[],mappings:";AAyCA;CACA,8BAAA;AACA;AAEA;CACA,8BAAA;AAEA;EACA,8BAAA;AACA;AACA",sourcesContent:["\x3c!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n--\x3e\n\n\n