(()=>{var e,s,t,n={30312(e,s,t){"use strict";var n=t(35810),i=t(77815),a=t(32505),o=t(87485),l=t(53334),r=t(63814),d=t(19051),m=t(85168),g=t(61338),c=t(49264),u=t(84560),f=t(99201);const p=new c.A({concurrency:5});function h(e,s){return d.Ay.post((0,r.KT)("/apps/files/api/v1/convert"),{fileId:e,targetMimeType:s})}const w="convert";var v=t(81222),k=t(88140),b=t(21777),y=t(10810),x=t(85471);const T=(0,v.C)("files","config",{crop_image_previews:!0,default_view:"files",folder_tree:!0,grid_view:!1,show_files_extensions:!0,show_hidden:!1,show_mime_column:!0,sort_favorites_first:!0,sort_folders_first:!0,show_dialog_deletion:!1,show_dialog_file_extension:!0}),C=(0,y.nY)("userconfig",()=>{const e=(0,x.KR)({...T});return(0,g.B1)("files:config:updated",({key:s,value:t})=>function(s,t){(0,x.hZ)(e.value,s,t)}(s,t)),{userConfig:e,update:async function(e,s){null!==(0,b.HW)()&&await d.Ay.put((0,r.Jv)("/apps/files/api/v1/config/{key}",{key:e}),{value:s}),(0,g.Ic)("files:config:updated",{key:e,value:s})}}}),U=()=>!0===(0,o.F)()?.files?.undelete;function S(e){return e.every(e=>!0===e.attributes["is-mount-root"]&&"shared"===e.attributes["mount-type"])}function L(e){return e.every(e=>!0===e.attributes["is-mount-root"]&&"external"===e.attributes["mount-type"])}function F({nodes:e,view:s}){return S(e)?1===e.length?(0,l.t)("files","Leave this share"):(0,l.t)("files","Leave these shares"):L(e)?1===e.length?(0,l.t)("files","Disconnect storage"):(0,l.t)("files","Disconnect storages"):"trashbin"!==s.id&&U()?function(e){if(1===e.length)return!1;const s=e.some(e=>S([e])),t=e.some(e=>!S([e]));return s&&t}(e)?(0,l.t)("files","Delete and unshare"):function(e){return!e.some(e=>e.type!==n.pt.File)}(e)?1===e.length?(0,l.t)("files","Delete file"):(0,l.t)("files","Delete files"):function(e){return!e.some(e=>e.type!==n.pt.Folder)}(e)?1===e.length?(0,l.t)("files","Delete folder"):(0,l.t)("files","Delete folders"):(0,l.t)("files","Delete"):(0,l.t)("files","Delete permanently")}function N(){return!1!==C((0,k.u)()).userConfig.show_dialog_deletion}async function _(e,s){const t="trashbin"!==s.id&&U()?(0,l.n)("files","You are about to delete {count} item","You are about to delete {count} items",e.length,{count:e.length}):(0,l.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(t,(0,l.t)("files","Confirm deletion"),{type:window.OC.dialogs.YES_NO_BUTTONS,confirm:F({nodes:e,view:s}),confirmClasses:"error",cancel:(0,l.t)("files","Cancel")},e=>{n(e)})})}async function A(e){await d.Ay.delete(e.encodedSource),(0,g.Ic)("files:node:deleted",e)}const P=new c.A({concurrency:5}),z={id:"delete",displayName:F,iconSvgInline:({nodes:e})=>S(e)?'':L(e)?'':'',enabled:({nodes:e,view:s})=>("trashbin"!==s.id||!1!==(0,v.C)("files_trashbin","config",{allow_delete:!0}).allow_delete)&&(e.length>0&&e.map(e=>e.permissions).every(e=>0!==(e&n.aX.DELETE))),async exec({nodes:e,view:s}){try{let t=!0;const n=((new Error).stack||"").toLocaleLowerCase().includes("keydown");return(N()||n)&&(t=await _([e[0]],s)),!1===t?null:(await A(e[0]),!0)}catch(s){return u.A.error("Error while deleting a file",{error:s,source:e[0].source,node:e[0]}),!1}},async execBatch({nodes:e,view:s}){let t=!0;if((N()||e.length>=5&&!S(e)&&!L(e))&&(t=await _(e,s)),!1===t)return Promise.all(e.map(()=>null));const n=e.map(e=>new Promise(s=>{P.add(async()=>{try{await A(e),s(!0)}catch(t){u.A.error("Error while deleting a file",{error:t,source:e.source,node:e}),s(!1)}})}));return Promise.all(n)},destructive:!0,order:100,hotkey:{description:(0,l.t)("files","Delete"),key:"Delete"}};var j=t(88975),E=t(16488);function I(e){if(0===(e.permissions&n.aX.READ))return!1;if(!0===e.attributes["hide-download"]||"true"===e.attributes["hide-download"])return!1;if(e.attributes["share-attributes"]){const s=JSON.parse(e.attributes["share-attributes"]||"[]").find(({scope:e,key:s})=>"permissions"===e&&"download"===s);if(void 0!==s)return!0===s.value}return!0}const B={id:"download",default:n.m9.DEFAULT,displayName:()=>(0,l.t)("files","Download"),iconSvgInline:()=>'',enabled:({nodes:e,view:s})=>0!==e.length&&!e.some(e=>!e.isDavResource)&&!(e.length>1&&"trashbin"===s.id)&&e.every(I),async exec({nodes:e}){try{await D(e)}catch(s){(0,m.Qg)((0,l.t)("files","The requested file is not available.")),u.A.error("The requested file is not available.",{error:s}),(0,g.Ic)("files:node:deleted",e[0])}return null},async execBatch({nodes:e,view:s,folder:t}){try{await D(e)}catch(e){(0,m.Qg)((0,l.t)("files","The requested files are not available.")),u.A.error("The requested files are not available.",{error:e});const n=function(e,s){const t=(0,j._)((0,k.u)()),n=(0,E.B)((0,k.u)());if(!e?.id)return null;if("/"===s)return t.getRoot(e.id)||null;const i=n.getPath(e.id,s);return t.getNode(i)||null}(s,t.path);(0,g.Ic)("files:node:updated",n)}return new Array(e.length).fill(null)},order:30};async function R(e,s){await d.Ay.head(e);const t=document.createElement("a");t.download=s??"",t.href=e,t.click()}function W(e,s){const t=e.split("/").filter(Boolean),n=s.split("/").filter(Boolean);let i="";for(const[e,a]of t.entries()){if(e>=s.length)break;if(a!==n[e])break;i=`${i}${""===i?"":"/"}${a}`}return i}async function D(e){let s;if(!e[0])throw new Error("No nodes to download");if(1===e.length){if(e[0].type===n.pt.File)return void await R(e[0].encodedSource,e[0].displayname);s=new URL(e[0].encodedSource),s.searchParams.append("accept","zip")}else{s=new URL(e[0].encodedSource);let t=s.pathname;for(const s of e.slice(1))t=W(t,new URL(s.encodedSource).pathname);s.pathname=t;const n=e.map(e=>decodeURIComponent(e.encodedSource.slice(s.href.length+1)));s.searchParams.append("accept","zip"),s.searchParams.append("files",JSON.stringify(n))}"/"!==s.pathname.at(-1)&&(s.pathname=`${s.pathname}/`),await R(s.href)}const O='';var H=t(11459),M=t(71225);const V=new c.A({concurrency:5}),Y={id:"favorite",displayName:({nodes:e})=>$(e)?(0,l.t)("files","Add to favorites"):(0,l.t)("files","Remove from favorites"),iconSvgInline:({nodes:e})=>$(e)?O:H,enabled:({nodes:e})=>!(0,a.f)()&&e.every(e=>e.root?.startsWith?.("/files"))&&e.every(e=>e.permissions!==n.aX.NONE),async exec({nodes:e,view:s}){const t=$([e[0]]);return await q(e[0],s,t)},async execBatch({nodes:e,view:s}){const t=$(e),n=e.map(e=>new Promise(n=>{V.add(async()=>{try{await q(e,s,t),n(!0)}catch(s){u.A.error("Error while adding file to favorite",{error:s,source:e.source,node:e}),n(!1)}})}));return Promise.all(n)},order:-50,hotkey:{description:(0,l.t)("files","Add or remove favorite"),key:"S"}};async function q(e,s,t){try{const n=(0,r.Jv)("/apps/files/api/v1/files")+(0,M.O0)(e.path);return await d.Ay.post(n,{tags:t?[window.OC.TAG_FAVORITE]:[]}),"favorites"!==s.id||t||"/"!==e.dirname||(0,g.Ic)("files:node:deleted",e),x.Ay.set(e.attributes,"favorite",t?1:0),(0,g.Ic)("files:node:updated",e),t?(0,g.Ic)("files:favorites:added",e):(0,g.Ic)("files:favorites:removed",e),!0}catch(s){const n=t?"adding a file to favourites":"removing a file from favourites";return u.A.error("Error while "+n,{error:s,source:e.source,node:e}),!1}}function $(e){return e.some(e=>1!==e.attributes.favorite)}const K='';var G=t(21363),J=t(66860),Z=t(43627),Q=t(14668);const X=(0,v.C)("files_sharing","sharePermissions",n.aX.NONE);let ee;var se;function te(e){const s=e.reduce((e,s)=>Math.min(e,s.permissions),n.aX.ALL);return Boolean(s&n.aX.DELETE)}function ne(e){return!!function(e){return 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)&&(!(0,a.f)()||Boolean(X&n.aX.CREATE))}!function(e){e.MOVE="Move",e.COPY="Copy",e.MOVE_OR_COPY="move-or-copy"}(se||(se={}));class ie extends Error{}const ae={id:"move-copy",order:15,displayName({nodes:e}){switch(oe(e)){case se.MOVE:return(0,l.t)("files","Move");case se.COPY:return(0,l.t)("files","Copy");case se.MOVE_OR_COPY:return(0,l.t)("files","Move or copy")}},iconSvgInline:()=>K,enabled:({nodes:e,view:s})=>"public-file-share"!==s.id&&!!e.every(e=>e.root?.startsWith("/files/"))&&e.length>0&&(te(e)||ne(e)),async exec(e){return this.execBatch(e)[0]},async execBatch({nodes:e,folder:s}){const t=oe(e),a=await async function(e,s="/",t){const{resolve:i,reject:a,promise:o}=Promise.withResolvers(),r=t.map(e=>e.fileid).filter(Boolean),d=(0,m.a1)((0,l.t)("files","Choose destination")).allowDirectories(!0).setFilter(e=>!r.includes(e.fileid)).setCanPick(e=>(e.permissions&n.aX.CREATE)===n.aX.CREATE).setMimeTypeFilter([]).setMultiSelect(!1).startAt(s).setButtonFactory((s,a)=>{const o=[],r=(0,Z.basename)(a),d=t.map(e=>e.dirname),m=t.map(e=>e.path);return e!==se.COPY&&e!==se.MOVE_OR_COPY||o.push({label:r?(0,l.t)("files","Copy to {target}",{target:r},{escape:!1,sanitize:!1}):(0,l.t)("files","Copy"),variant:"primary",icon:G,async callback(e){i({destination:e[0],action:se.COPY})}}),d.includes(a)||m.includes(a)||s.some(e=>0===(e.permissions&n.aX.CREATE))||e!==se.MOVE&&e!==se.MOVE_OR_COPY||o.push({label:r?(0,l.t)("files","Move to {target}",{target:r},void 0,{escape:!1,sanitize:!1}):(0,l.t)("files","Move"),variant:e===se.MOVE?"primary":"secondary",icon:K,async callback(e){i({destination:e[0],action:se.MOVE})}}),o}).build();return d.pick().catch(e=>{u.A.debug(e),e instanceof m.vT?i(!1):a(new Error((0,l.t)("files","Move or copy operation failed")))}),o}(t,s.path,e);if(!1===a)return e.map(()=>null);try{const s=await Array.fromAsync(async function*(e,s,t,a=!1){if(!s)return;if(s.type!==n.pt.Folder)throw new Error((0,l.t)("files","Destination is not a folder"));if(t===se.MOVE&&e.some(e=>e.dirname===s.path))throw new Error((0,l.t)("files","This file/folder is already in that directory"));if(e.some(e=>`${s.path}/`.startsWith(`${e.path}/`)))throw new Error((0,l.t)("files","You cannot move a file/folder onto itself or into a subfolder of itself"));const o=new Map;if(!a){const i=(await(0,Q.h)(s.path)).contents,a=(0,J.e)(e,i),l=[];if(a.length>0){if(t===se.MOVE){const t=i.filter(e=>a.some(s=>s.basename===e.basename)),n=await(0,m.VA)(s.path,a,t);if(!n)return;e=e.filter(e=>!n.skipped.includes(e)),l.push(...n.renamed)}else l.push(...a);const r=[...i,...e.filter(e=>!a.includes(e))].map(e=>e.basename);for(const e of l){const s=(0,n.lJ)(e.basename,r,{ignoreFileExtension:e.type===n.pt.Folder});o.set(e.source,s),r.push(s)}}}const r=function(e,s,t){const n=e===se.MOVE?1===s.length?(0,l.t)("files",'Moving "{source}" to "{destination}" …',{source:s[0],destination:t}):(0,l.t)("files",'Moving {count} files to "{destination}" …',{count:s.length,destination:t}):1===s.length?(0,l.t)("files",'Copying "{source}" to "{destination}" …',{source:s[0],destination:t}):(0,l.t)("files",'Copying {count} files to "{destination}" …',{count:s.length,destination:t}),i=(0,m.Cs)(n);return()=>i&&i.hideToast()}(t,e.map(e=>e.basename),s.path),f=(ee||(ee=new c.A({concurrency:5})),ee);try{for(const a of e)x.Ay.set(a,"status",n.zI.LOADING),yield f.add(async()=>{try{const e=(0,i.KU)(),n=(0,Z.join)(i.VA,a.path),l=(0,Z.join)(i.VA,s.path,o.get(a.source)??a.basename);if(t===se.COPY){if(await e.copyFile(n,l),a.dirname===s.path){const{data:s}=await e.stat(l,{details:!0,data:(0,i.aN)()});(0,g.Ic)("files:node:created",(0,i.pO)(s))}}else await e.moveFile(n,l),(0,g.Ic)("files:node:deleted",a)}catch(e){if(u.A.debug(`Error while trying to ${t===se.COPY?"copy":"move"} node`,{node:a,error:e}),(0,d.F0)(e)){if(412===e.response?.status)throw new ie((0,l.t)("files","A file or folder with that name already exists in this folder"));if(423===e.response?.status)throw new ie((0,l.t)("files","The files are locked"));if(404===e.response?.status)throw new ie((0,l.t)("files","The file does not exist anymore"));if("response"in e&&e.response){const s=new DOMParser,t=await e.response.text(),n=s.parseFromString(t??"","text/xml").querySelector("message")?.textContent;if(n)throw new ie(n)}}throw e}finally{x.Ay.set(a,"status",void 0)}})}finally{r()}}(e,a.destination,a.action));return s.map(()=>!0)}catch(s){return u.A.error(`Failed to ${a.action} node`,{nodes:e,error:s}),s instanceof ie&&s.message?((0,m.Qg)(s.message),e.map(()=>null)):e.map(()=>!1)}}};function oe(e){return te(e)?ne(e)?se.MOVE_OR_COPY:se.MOVE:se.COPY}const le='',re={id:"open-folder",displayName({nodes:e}){if(1!==e.length||!e[0])return(0,l.t)("files","Open folder");const s=e[0].displayname;return(0,l.t)("files","Open folder {displayName}",{displayName:s})},iconSvgInline:()=>le,enabled({nodes:e}){if(1!==e.length||!e[0])return!1;const s=e[0];return!!s.isDavResource&&s.type===n.pt.Folder&&0!==(s.permissions&n.aX.READ)},async exec({nodes:e,view:s}){const t=e[0];return!(!t||t.type!==n.pt.Folder)&&(window.OCP.Files.Router.goToRoute(null,{view:s.id,fileid:String(t.fileid)},{dir:t.path}),null)},default:n.m9.HIDDEN,order:-100};var de=t(10333);const me={id:"open-in-files",displayName:()=>(0,l.t)("files","Open in Files"),iconSvgInline:()=>"",enabled:({view:e})=>"recent"===e.id||e.id===de.w,async exec({nodes:e}){if(!e[0])return!1;let s=e[0].dirname;return e[0].type===n.pt.Folder&&(s=s+"/"+e[0].basename),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(e[0].fileid)},{dir:s,openfile:"true"}),null},order:-1e3,default:n.m9.HIDDEN},ge={id:"edit-locally",displayName:()=>(0,l.Tl)("files","Open locally"),iconSvgInline:()=>'',enabled({nodes:e}){return!(1!==e.length||!e[0])&&!(0,a.f)()&&!!(s=e[0]).isDavResource&&0!==(s.permissions&n.aX.WRITE)&&I(s);var s},exec:async({nodes:e})=>(await async function(e){await ce(e);const s=await async function(){let e=!1;const s=(new m.ik).setName((0,l.Tl)("files","Open file locally")).setText((0,l.Tl)("files","The file should now open on your device. If it doesn't, please check that you have the desktop app installed.")).setButtons([{label:(0,l.Tl)("files","Retry and close"),variant:"secondary",callback:()=>{e="local"}},{label:(0,l.Tl)("files","Open online"),icon:'',variant:"primary",callback:()=>{e="online"}}]).build();return await s.show(),e}();"local"===s?await ce(e):"online"===s&&window.OCA.Viewer.open({path:e})}(e[0].path),null),order:25};async function ce(e){const s=(0,r.KT)("apps/files/api/v1")+"/openlocaleditor?format=json";try{const t=await d.Ay.post(s,{path:e}),n=(0,b.HW)()?.uid;let i=`nc://open/${n}@`+window.location.host+(0,M.O0)(e);i+="?token="+t.data.ocs.data.token,window.open(i,"_self")}catch(e){(0,m.Qg)((0,l.Tl)("files","Failed to redirect to client")),u.A.error("Failed to redirect to client",{error:e})}}const ue={id:"rename",displayName:()=>(0,l.Tl)("files","Rename"),iconSvgInline:()=>'',enabled:({nodes:e,view:s})=>{if(0===e.length||!e[0])return!1;if("public-file-share"===s.id)return!1;const t=e[0],i=(0,j._)((0,k.u)()),a="/"===t.dirname?i.getRoot(s.id):i.getNode((0,Z.dirname)(t.source)),o=a?.permissions||n.aX.NONE;return Boolean(t.permissions&n.aX.DELETE)&&Boolean(o&n.aX.CREATE)},exec:async({nodes:e})=>((0,g.Ic)("files:node:rename",e[0]),null),order:10,hotkey:{description:(0,l.Tl)("files","Rename"),key:"F2"}},fe={id:"details",displayName:()=>(0,l.t)("files","Details"),iconSvgInline:()=>'',enabled:({nodes:e})=>{const s=e[0];return!(1!==e.length||!s)&&(!!(0,n.dC)().available&&!(0,a.f)()&&s.root.startsWith("/files/")&&s.permissions!==n.aX.NONE)},async exec({nodes:e}){const s=(0,n.dC)(),[t]=e;try{return s.node?.source===t.source?(u.A.debug("Sidebar already open for this file",{node:t}),null):(s.open(t,"sharing"),null)}catch(e){return u.A.error("Error while opening sidebar",{error:e}),!1}},order:-50,hotkey:{key:"D",description:(0,l.t)("files","Open the details sidebar")}},pe={id:"view-in-folder",displayName:()=>(0,l.t)("files","View in folder"),iconSvgInline:()=>K,enabled({nodes:e,view:s}){if((0,a.f)())return!1;if("files"===s.id)return!1;if(1!==e.length||!e[0])return!1;const t=e[0];return!!t.isDavResource&&!!t.root?.startsWith("/files")&&t.permissions!==n.aX.NONE&&t.type===n.pt.File},exec:async({nodes:e})=>!(!e[0]||e[0].type!==n.pt.File)&&(window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(e[0].fileid)},{dir:e[0].dirname}),null),order:80};var he=t(78246);class we extends n.L3{constructor(){var e,s,t;super("files:filename",5),e=this,t="",(s=function(e){var s=function(e){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var t=s.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof s?s:s+""}(s="searchQuery"))in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,(0,g.B1)("files:search:updated",({query:e,scope:s})=>{"filter"===s&&this.updateQuery(e)})}filter(e){const s=this.searchQuery.toLocaleLowerCase().split(" ").filter(Boolean);return e.filter(e=>{const t=e.displayname.toLocaleLowerCase();return s.every(e=>t.includes(e))})}reset(){this.updateQuery("")}updateQuery(e){if((e=(e||"").trim())!==this.searchQuery){this.searchQuery=e,this.filterUpdated();const s=[];if(""!==e)s.push({text:e,onclick:()=>{this.updateQuery("")}});else{const e=(0,he.j)((0,k.u)());"filter"===e.scope&&(e.query="")}this.updateChips(s)}}}class ve extends n.L3{constructor(){var e,s,t;super("files:hidden",0),e=this,t=void 0,(s=function(e){var s=function(e){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var t=s.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof s?s:s+""}(s="showHidden"))in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,this.showHidden=(0,v.C)("files","config",{show_hidden:!1}).show_hidden,(0,g.B1)("files:config:updated",({key:e,value:s})=>{"show_hidden"===e&&(this.showHidden=Boolean(s),this.filterUpdated())})}filter(e){return this.showHidden?e:e.filter(e=>!0!==e.attributes.hidden&&!e.basename.startsWith("."))}}const ke='';var be=t(26422),ye=t(950),xe=t(43988),Te=t(61744),Ce=t(78928),Ue=t(42610),Se=t(57908),Le=t(64426),Fe=t(59915),Ne=t(68166),_e=t(15502),Ae=t(71711),Pe=t(25878),ze=t(85407),je=t(47611),Ee=t(10363),Ie=t(282),Be=t(78009),Re=t(54048),We=t(88486),De=t(27345),Oe=t(49595),He=t(31866),Me=t(70036),Ve=t(44031),Ye=t(542),qe=t(94012),$e=t(93651),Ke=t(77834),Ge=t(91019),Je=t(50017),Ze=t(60258),Qe=t(22258),Xe=t(66865),es=t(17067),ss=t(10211),ts=t(52631),ns=t(73148),is=t(81621),as=t(94294),os=t(93314),ls=t(8054),rs=t(99016),ds=t(83358),ms=t(90429),gs=t(12318),cs=t(46173),us=t(44025),fs=t(92257),ps=t(48198),hs=t(59668),ws=t(18343),vs=t(83194),ks=t(50481),bs=t(42507),ys=t(85646),xs=t(71565),Ts=t(49975),Cs=t(17848),Us=t(99925),Ss=t(66768),Ls=t(8633),Fs=t(97398),Ns=t(51550),_s=t(63195),As=t(77082),Ps=t(48191),zs=t(77462),js=t(34962),Es=t(38159),Is=t(88289),Bs=t(99759),Rs=t(371),Ws=t(22983),Ds=t(71912),Os=t(35290),Hs=t(1938),Ms=t(1357),Vs=t(81974),Ys=t(36079),qs=t(67582),$s=(t(65139),t(52781),t(3168),t(40490)),Ks=t(87059),Gs=t(40959),Js=t(71639),Zs=t(4258),Qs=t(29586),Xs=t(684),et=t(61618),st=t(62179),tt=t(25771),nt=t(8256),it=t(19234),at=t(5843),ot=t(48748),lt=t(23610),rt=(t(55581),t(94205),t(95462),t(23020),t(53429),t(23739),t(16343),t(29928),t(64660),t(18547),t(42892)),dt=t(69885),mt=(t(59656),t(75105),t(92471),t(16406),t(2508));ye.N,xe.N,Te.A,Ce.N,Ue.N,Se.A,Le.N,Fe.A,_e.A,Ae.A,Pe.N,Ne.N,ze.N,je.A,Ee.A,Ie.N,Be.N,Re.A,We.N,De.A,Oe.N,He.N,Me.N,Ve.N,Ye.A,qe.N,$e.N,Ke.N,Ke.N,Ge.N,Je.N,Ze.A,Qe.N,Xe.A,es.N,qs.N,ss.N,ts.N,ns.N,is.N,as.N,os.N,ls.N,rs.N,ds.N,ms.N,gs.N,cs.N,us.N,fs.default,ps.A,hs.N,ws.N,vs.A,ks.N,bs.A,ys.N,xs.N,Ts.N,Cs.N,Us.N,Ss.A,Ls.N,Fs.N,Ns.N,_s.N,As.N,Ps.N,zs.N,js.N,Es.N,Is.A,Ys.N,Bs.A,Rs.A,Ws.N,Ds.N,Os.N,Hs.N,Ms.N,Vs.N,qs.a,$s.N,Js.N,Ks.N,Zs.N,Qs.N,Xs.N,et.N,st.N,tt.N,Gs.N,nt.N,it.N,at.N,ot.N,lt.A,Symbol.toStringTag,rt.A,dt.A,mt.yw,Symbol.toStringTag;var gt=t(74095);const ct=()=>(new Date).setHours(0,0,0,0),ut=()=>ct()-6048e5,ft=[{id:"today",label:(0,l.t)("files","Today"),filter:e=>e>ct()},{id:"last-7",label:(0,l.t)("files","Last 7 days"),filter:e=>e>ut()},{id:"last-30",label:(0,l.t)("files","Last 30 days"),filter:e=>e>ct()-2592e6},{id:"this-year",label:(0,l.t)("files","This year ({year})",{year:(new Date).getFullYear()}),filter:e=>e>new Date(ct()).setMonth(0,1)},{id:"last-year",label:(0,l.t)("files","Last year ({year})",{year:(new Date).getFullYear()-1}),filter:e=>e>new Date(ct()).setFullYear((new Date).getFullYear()-1,0,1)&&e=this.timeRange[0].getTime()&&s<=this.timeRange[1].getTime()}}],pt=(0,x.pM)({__name:"FileListFilterModified",props:{filter:null},setup(e){const s=e,t=(0,x.KR)();(0,x.wB)(t,e=>{t.value?("custom"!==t.value.id||n.value||(n.value=[new Date(ut()),new Date(ct())],t.value.timeRange=[...n.value]),s.filter.setPreset(t.value)):s.filter.setPreset()});const n=(0,x.KR)();function i(){t.value=void 0,n.value=void 0}return(0,x.wB)(n,()=>{n.value&&(t.value.timeRange=[...n.value],s.filter.setPreset(t.value))}),(0,x.sV)(()=>{t.value=s.filter.preset&&ft.find(e=>e.id===s.filter.preset.id),s.filter.addEventListener("reset",i)}),(0,x.hi)(()=>{s.filter.removeEventListener("reset",i)}),{__sfc:!0,startOfToday:ct,startOfLastWeek:ut,timePresets:ft,props:s,selectedOption:t,timeRange:n,onReset:i,t:l.t,NcDateTimePicker:fs.default,NcButton:gt.A}}});var ht=t(85072),wt=t.n(ht),vt=t(97825),kt=t.n(vt),bt=t(77659),yt=t.n(bt),xt=t(55056),Tt=t.n(xt),Ct=t(10540),Ut=t.n(Ct),St=t(41113),Lt=t.n(St),Ft=t(75689),Nt={};Nt.styleTagTransform=Lt(),Nt.setAttributes=Tt(),Nt.insert=yt().bind(null,"head"),Nt.domAPI=kt(),Nt.insertStyleElement=Ut(),wt()(Ft.A,Nt),Ft.A&&Ft.A.locals&&Ft.A.locals;var _t=t(14486);const At=(0,_t.A)(pt,function(){var e=this,s=e._self._c,t=e._self._setupProxy;return s("div",[e._l(t.timePresets,function(n){return s(t.NcButton,{key:n.id,attrs:{alignment:"start",pressed:n===t.selectedOption,variant:"tertiary",wide:""},on:{"update:pressed":function(e){e?t.selectedOption=n:t.onReset()}}},[e._v("\n\t\t"+e._s(n.label)+"\n\t")])}),e._v(" "),"custom"===t.selectedOption?.id?s(t.NcDateTimePicker,{attrs:{"append-to-body":"","aria-label":t.t("files","Custom date range"),type:"date-range"},model:{value:t.timeRange,callback:function(e){t.timeRange=e},expression:"timeRange"}}):e._e()],2)},[],!1,null,"2841ff92",null).exports;function Pt(e,s,t){return(s=function(e){var s=function(e){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var t=s.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof s?s:s+""}(s))in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}const zt="files-file-list-filter-modified";class jt extends n.L3{constructor(){super("files:modified",50),Pt(this,"currentInstance",void 0),Pt(this,"currentPreset",void 0),Pt(this,"displayName",(0,l.t)("files","Modified")),Pt(this,"iconSvgInline",ke),Pt(this,"tagName",zt)}filter(e){return this.currentPreset?e.filter(e=>void 0===e.mtime||this.currentPreset.filter(e.mtime.getTime())):e}reset(){this.dispatchEvent(new CustomEvent("reset"))}get preset(){return this.currentPreset}setPreset(e){this.currentPreset=e,this.filterUpdated();const s=[];e?s.push({icon:ke,text:e.label,onclick:()=>this.reset()}):this.currentInstance?.resetFilter(),this.updateChips(s)}}var Et=t(6695);const It=[{id:"document",label:(0,l.t)("files","Documents"),icon:Bt('',"#49abea"),mime:["x-office/document"]},{id:"spreadsheet",label:(0,l.t)("files","Spreadsheets"),icon:Bt('',"#9abd4e"),mime:["x-office/spreadsheet"]},{id:"presentation",label:(0,l.t)("files","Presentations"),icon:Bt('',"#f0965f"),mime:["x-office/presentation"]},{id:"pdf",label:(0,l.t)("files","PDFs"),icon:Bt('',"#dc5047"),mime:["application/pdf"]},{id:"folder",label:(0,l.t)("files","Folders"),icon:Bt(le,window.getComputedStyle(document.body).getPropertyValue("--color-primary-element")),mime:["httpd/unix-directory"]},{id:"audio",label:(0,l.t)("files","Audio"),icon:'',mime:["audio"]},{id:"image",label:(0,l.t)("files","Images"),icon:'',mime:["image"]},{id:"video",label:(0,l.t)("files","Videos"),icon:'',mime:["video"]}];function Bt(e,s){return e.replace("s.id===e.detail);s&&a(s,!1)}function a(e,s){t.value=t.value.filter(s=>s.id!==e.id),s&&t.value.push(e)}return(0,x.wB)(t,()=>{s.filter.setPresets([...t.value])}),(0,x.sV)(()=>{s.filter.addEventListener("reset",n),s.filter.addEventListener("deselect",i),t.value=It.filter(({id:e})=>s.filter.presets.some(s=>s.id===e))}),(0,x.hi)(()=>{s.filter.removeEventListener("reset",n),s.filter.removeEventListener("deselect",i)}),{__sfc:!0,typePresets:It,colorize:Bt,props:s,selectedOptions:t,resetFilter:n,onDeselect:i,toggleOption:a,NcButton:gt.A,NcIconSvgWrapper:Et.A}}});var Wt=t(35225),Dt={};Dt.styleTagTransform=Lt(),Dt.setAttributes=Tt(),Dt.insert=yt().bind(null,"head"),Dt.domAPI=kt(),Dt.insertStyleElement=Ut(),wt()(Wt.A,Dt);const Ot=Wt.A&&Wt.A.locals?Wt.A.locals:void 0,Ht=(0,_t.A)(Rt,function(){var e=this,s=e._self._c,t=e._self._setupProxy;return s("div",{class:e.$style.fileListFilterType},e._l(t.typePresets,function(n){return s(t.NcButton,{key:n.id,attrs:{pressed:t.selectedOptions.includes(n),variant:"tertiary",alignment:"start",wide:""},on:{"update:pressed":function(e){return t.toggleOption(n,e)}},scopedSlots:e._u([{key:"icon",fn:function(){return[s(t.NcIconSvgWrapper,{attrs:{svg:n.icon}})]},proxy:!0}],null,!0)},[e._v("\n\t\t"+e._s(n.label)+"\n\t")])}),1)},[],!1,function(e){this.$style=Ot.locals||Ot},null,null).exports;function Mt(e,s,t){return(s=function(e){var s=function(e){if("object"!=typeof e||!e)return e;var s=e[Symbol.toPrimitive];if(void 0!==s){var t=s.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof s?s:s+""}(s))in e?Object.defineProperty(e,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[s]=t,e}const Vt="files-file-list-filter-type";class Yt extends n.L3{constructor(){super("files:type",10),Mt(this,"currentInstance",void 0),Mt(this,"currentPresets",void 0),Mt(this,"displayName",(0,l.t)("files","Type")),Mt(this,"iconSvgInline",''),Mt(this,"tagName",Vt),this.currentPresets=[]}filter(e){if(!this.currentPresets||0===this.currentPresets.length)return e;const s=this.currentPresets.reduce((e,s)=>[...e,...s.mime],[]);return e.filter(e=>{if(!e.mime)return!1;const t=e.mime.toLowerCase();return!!s.includes(t)||!!s.includes(window.OC.MimeTypeList.aliases[t])||!!s.includes(t.split("/")[0])})}reset(){this.dispatchEvent(new CustomEvent("reset"))}get presets(){return this.currentPresets}setPresets(e){u.A.debug("TypeFilter: setting presets",{presets:e}),this.currentPresets=e??[],void 0!==this.currentInstance&&(this.currentInstance.$props.presets=e),this.filterUpdated();const s=[];if(e&&e.length>0)for(const t of e)s.push({icon:t.icon,text:t.label,onclick:()=>this.removeFilterPreset(t.id)});else this.currentInstance?.resetFilter();this.updateChips(s)}removeFilterPreset(e){const s=this.currentPresets.filter(({id:s})=>s!==e);this.dispatchEvent(new CustomEvent("deselect",{detail:e})),this.setPresets(s)}}var qt=t(98469),$t=t(94219),Kt=t(82182);const Gt=(0,x.pM)({__name:"NewNodeDialog",props:{defaultName:{type:String,default:(0,l.t)("files","New folder")},otherNames:{type:Array,default:()=>[]},open:{type:Boolean,default:!0},name:{type:String,default:(0,l.t)("files","Create new folder")},label:{type:String,default:(0,l.t)("files","Folder name")}},emits:["close"],setup(e,{emit:s}){const t=e,i=(0,x.KR)(t.defaultName),a=(0,x.KR)(),o=(0,x.KR)(),r=(0,x.KR)(""),d=(0,x.EW)(()=>i.value.trim().startsWith("."));function m(){(0,x.dY)(()=>{const e=a.value?.$el.querySelector("input");if(!t.open||!e)return;const s=i.value.length-(0,Z.extname)(i.value).length;e.focus(),e.setSelectionRange(0,s)})}return(0,x.wB)(()=>[t.defaultName,t.otherNames],()=>{i.value=(0,n.lJ)(t.defaultName,t.otherNames).trim()}),(0,x.nT)(()=>{t.otherNames.includes(i.value.trim())?r.value=(0,l.t)("files","This name is already in use."):r.value=function(e,s=!1){if(""===e.trim())return(0,l.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,l.t)("files",'"{char}" is not allowed inside a filename.',{char:e.segment},void 0,{escape:s});case n.nF.ReservedName:return(0,l.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,l.t)("files",'"{extension}" is not an allowed filetype.',{extension:e.segment},void 0,{escape:!1}):(0,l.t)("files",'Filenames must not end with "{extension}".',{extension:e.segment},void 0,{escape:!1});default:return(0,l.t)("files","Invalid filename.")}}}(i.value.trim());const e=a.value?.$el.querySelector("input");e&&(e.setCustomValidity(r.value),e.reportValidity())}),(0,x.wB)(()=>t.open,()=>{(0,x.dY)(()=>{m()})}),(0,x.sV)(()=>{i.value=(0,n.lJ)(i.value,t.otherNames).trim(),(0,x.dY)(()=>m())}),{__sfc:!0,props:t,emit:s,localDefaultName:i,nameInput:a,formElement:o,validity:r,isHiddenFileName:d,focusInput:m,submit:function(){o.value?.requestSubmit()},t:l.t,NcButton:gt.A,NcDialog:$t.A,NcNoteCard:Rs.A,NcTextField:Kt.A}}});var Jt=t(78224),Zt={};Zt.styleTagTransform=Lt(),Zt.setAttributes=Tt(),Zt.insert=yt().bind(null,"head"),Zt.domAPI=kt(),Zt.insertStyleElement=Ut(),wt()(Jt.A,Zt),Jt.A&&Jt.A.locals&&Jt.A.locals;const Qt=(0,_t.A)(Gt,function(){var e=this,s=e._self._c,t=e._self._setupProxy;return s(t.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 t.emit("close",null)}},scopedSlots:e._u([{key:"actions",fn:function(){return[s(t.NcButton,{attrs:{"data-cy-files-new-node-dialog-submit":"",variant:"primary",disabled:""!==t.validity},on:{click:t.submit}},[e._v("\n\t\t\t"+e._s(t.t("files","Create"))+"\n\t\t")])]},proxy:!0}])},[e._v(" "),s("form",{ref:"formElement",staticClass:"new-node-dialog__form",on:{submit:function(e){return e.preventDefault(),t.emit("close",t.localDefaultName)}}},[s(t.NcTextField,{ref:"nameInput",attrs:{"data-cy-files-new-node-dialog-input":"",error:""!==t.validity,"helper-text":t.validity,label:e.label},model:{value:t.localDefaultName,callback:function(e){t.localDefaultName=e},expression:"localDefaultName"}}),e._v(" "),t.isHiddenFileName?s(t.NcNoteCard,{attrs:{type:"warning",text:t.t("files","Files starting with a dot are hidden by default")}}):e._e()],1)])},[],!1,null,"77bf0406",null).exports;function Xt(e,s,t={}){const n=s.map(e=>e.basename);return new Promise(s=>{(0,qt.S)(Qt,{...t,defaultName:e,otherNames:n},e=>{s(e)})})}const en={id:"newFolder",order:0,displayName:(0,l.t)("files","New folder"),iconSvgInline:''.replace(/viewBox/gi,'style="color: var(--color-primary-element)" viewBox'),enabled:e=>Boolean(e.permissions&n.aX.CREATE)&&Boolean(e.permissions&n.aX.READ),async handler(e,s){const t=await Xt((0,l.t)("files","New folder"),s);if(null!==t)try{const{fileid:s,source:i}=await async function(e,s){const t=e.source+"/"+s,n=e.encodedSource+"/"+encodeURIComponent(s),i=await(0,d.Ay)({method:"MKCOL",url:n,headers:{Overwrite:"F"}});return{fileid:parseInt(i.headers["oc-fileid"]),source:t}}(e,t.trim()),a=new n.vd({source:i,id:s,mtime:new Date,owner:e.owner,permissions:n.aX.ALL,root:e?.root||"/files/"+(0,b.HW)()?.uid,attributes:{"mount-type":e.attributes?.["mount-type"],"owner-id":e.attributes?.["owner-id"],"owner-display-name":e.attributes?.["owner-display-name"]}});(0,g.Ic)("files:node:created",a),(0,m.Te)((0,l.t)("files",'Created new folder "{name}"',{name:(0,Z.basename)(i)})),u.A.debug("Created new folder",{folder:a,source:i}),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(s)},{dir:e.path})}catch(e){u.A.error("Creating new folder failed",{error:e}),(0,m.Qg)("Creating new folder failed")}}},sn=(0,x.$V)(()=>Promise.all([t.e(4208),t.e(2915)]).then(t.bind(t,32915)));let tn=null;const nn=(0,v.C)("files","templates_enabled",!0);let an=(0,v.C)("files","templates_path",!1);u.A.debug("Templates folder enabled",{templatesEnabled:nn}),u.A.debug("Initial templates folder",{templatesPath:an});const on={id:"template-picker",displayName:(0,l.Tl)("files","Create templates folder"),iconSvgInline:'',order:30,enabled:e=>!(!nn||an)&&e.owner===(0,b.HW)()?.uid&&0!==(e.permissions&n.aX.CREATE),async handler(e,s){const t=await Xt((0,l.Tl)("files","Templates"),s,{name:(0,l.Tl)("files","New template folder")});null!==t&&(async function(e,s){const t=(0,Z.join)(e.path,s);try{u.A.debug("Initializing the templates directory",{templatePath:t});const{data:e}=await d.Ay.post((0,r.KT)("apps/files/api/v1/templates/path"),{templatePath:t,copySystemTemplates:!0});window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:void 0},{dir:t}),u.A.info("Created new templates folder",{...e.ocs.data}),an=e.ocs.data.templates_path}catch(e){u.A.error("Unable to initialize the templates directory",{error:e}),(0,m.Qg)((0,l.Tl)("files","Unable to initialize the templates directory"))}}(e,t),(0,n.gj)("template-picker"))}};var ln=t(43690);async function rn(e="/",s){if(e&&"/"!==e)return(0,Q.h)(e,s);try{return{contents:await(0,i.Q$)({client:f.S,signal:s.signal}),folder:new n.vd({id:0,source:`${(0,i.EY)()}${(0,i.ei)()}`,root:(0,i.ei)(),owner:(0,b.HW)()?.uid||null,permissions:n.aX.READ})}}catch(e){if(s.signal.aborted)throw u.A.debug("Favorite nodes request was aborted"),new DOMException("Aborted","AbortError");throw u.A.error("Failed to load favorite nodes via WebDAV",{error:e}),e}}function dn(e,s=0){return new n.Ss({id:mn(e.path),name:e.displayname,icon:ln,order:s,params:{dir:e.path,fileid:String(e.fileid),view:"favorites"},parent:"favorites",columns:[],getContents:rn})}function mn(e){return`favorite-${function(e){let s=0;for(let t=0;t>>0}(e)}`}var gn=t(66480);const cn="folders",un=`${(0,i.EY)()}/files/${(0,b.HW)()?.uid}`,fn=Intl.Collator([(0,l.Z0)(),(0,l.lO)()],{numeric:!0,usage:"sort"}),pn=(e,s)=>fn.compare(e.displayName??e.basename,s.displayName??s.basename);function hn(e,s="/",t=[]){const n=e.toSorted(pn);for(const{id:e,basename:i,displayName:a,children:o}of n){const n=(0,M.fj)(s,i),l=`${un}${n}`,r={source:l,encodedSource:kn(l),path:n,fileid:e,basename:i};a&&(r.displayName=a),t.push(r),o.length>0&&hn(o,n,t)}return t}async function wn(e="/",s=1,t=!1){const{data:n}=await d.Ay.get((0,r.KT)("/apps/files/api/v1/folder-tree"),{params:new URLSearchParams({path:e,depth:String(s),withParents:String(t)})});return hn(n,t?"/":e)}const vn=(e,s)=>(0,Q.h)(e,s);function kn(e){const{origin:s}=new URL(e);return s+(0,M.O0)(e.slice(s.length))}function bn(e){const s=(0,M.pD)(e);return s===un?cn:`${cn}::${kn(s)}`}const yn=(0,n.bh)(),xn=new c.A({concurrency:5,intervalCap:5,interval:200}),Tn=(0,v.C)("files","config",{folder_tree:!0}).folder_tree;let Cn=(0,v.C)("files","config",{show_hidden:!1}).show_hidden;const Un=new n.Ss({id:cn,name:(0,l.t)("files","Folder tree"),caption:(0,l.t)("files","List of your files and folders."),icon:G,order:50,getContents:vn,async loadChildViews(e){const s=e;if(!s.loading&&!s.loaded){s.loading=!0;try{const e=new URLSearchParams(window.location.search).get("dir")??"/";Sn(await wn(e,1,!0),e),s.loaded=!0,(0,g.B1)("files:node:created",_n),(0,g.B1)("files:node:deleted",An),(0,g.B1)("files:node:moved",Pn),(0,g.B1)("files:config:updated",zn)}finally{s.loading=!1}}}});async function Sn(e,s){const t=[];for(const n of e){const e=yn.views.some(e=>e.id===`${cn}::${n.encodedSource}`);Cn||!n.basename.startsWith(".")?e||t.push(Ln(n,!(s!==n.path&&!s?.startsWith(n.path+"/"))||void 0)):e&&yn.remove(`${cn}::${n.encodedSource}`)}yn.register(...t)}function Ln(e,s){return{id:`${cn}::${e.encodedSource}`,parent:bn(e.source),expanded:s,loaded:s,name:e.displayName??e.displayname??e.basename,icon:ln,getContents:vn,loadChildViews:Fn(e),params:{view:cn,fileid:String(e.fileid),dir:e.path}}}function Fn(e){return async s=>{const t=s;if(!t.loading&&!t.loaded){t.loading=!0;try{await Nn(e.path),t.loaded=!0}finally{t.loading=!1}}}}async function Nn(e="/"){await xn.add(async()=>{const s=(0,j._)((0,k.u)()).getNodesByPath(yn.active.id,e);s.length>0?Sn(s.filter(e=>e.type===n.pt.Folder),e):Sn(await wn(e,2))})}function _n(e){e.type===n.pt.Folder&&Sn([e])}function An(e){e.type===n.pt.Folder&&function(e){const s=e.encodedSource;yn.remove(s)}(e)}function Pn({node:e,oldSource:s}){if(e.type!==n.pt.Folder)return;var t;t=s,yn.remove(t),Sn([e]);const i=e.source.replace(un,""),a=s.replace(un,""),o=yn.views.filter(e=>!!e.params?.dir&&!(0,M.ys)(e.params.dir,a)&&e.params.dir.startsWith(a));for(const s of o)s.parent=bn(e.source),s.params.dir=s.params.dir.replace(a,i)}async function zn({key:e,value:s}){"show_hidden"===e&&(Cn=s,await Nn())}const jn=(0,b.HW)()?.uid;function En(e){const s=e.attributes["mount-type"];return jn===e.owner&&!["group","shared"].includes(s)}function In(e="/",s){return(0,Q.h)(e,s).then(e=>(e.contents=e.contents.filter(En),e))}var Bn=t(92829);const Rn="personal",Wn=Math.round(Date.now()/1e3-1209600);!function(){const e=((0,o.F)()?.files?.file_conversions??[]).map(({to:e,from:s,displayName:t})=>({id:`convert-${s}-${e}`,displayName:()=>(0,l.t)("files","Save as {displayName}",{displayName:t}),iconSvgInline:()=>{return s=e,`\n\t\t\n\t`;var s},enabled:({nodes:e})=>e.every(e=>s===e.mime),exec:async({nodes:s})=>!!s[0]&&(async function(e,s){const t=(0,m.Cs)((0,l.t)("files","Converting file …"));try{const t=await p.add(()=>h(e,s));(0,m.Te)((0,l.t)("files","File successfully converted"));const n=await(0,f.t)(t.data.ocs.data.path);(0,g.Ic)("files:node:created",n);const i=t.data.ocs.data.fileId;window.OCP.Files.Router.goToRoute(null,{...window.OCP.Files.Router.params,fileid:i.toString()},window.OCP.Files.Router.query)}catch(t){if((0,d.F0)(t)&&t.response?.data?.ocs?.meta?.message)return void(0,m.Qg)((0,l.t)("files","Failed to convert file: {message}",{message:t.response.data.ocs.meta.message}));u.A.error("Failed to convert file",{fileId:e,targetMimeType:s,error:t}),(0,m.Qg)((0,l.t)("files","Failed to convert file"))}finally{t.hideToast()}}(s[0].fileid,e),null),execBatch:async({nodes:s})=>(async function(e,s){const t=e.map(e=>p.add(()=>h(e,s))),n=(0,m.Cs)((0,l.t)("files","Converting files …"));try{const n=await Promise.allSettled(t),i=n.filter(e=>"rejected"===e.status);if(i.length>0){const t=i.map(e=>e.reason?.response?.data?.ocs?.meta?.message);return u.A.error("Failed to convert files",{fileIds:e,targetMimeType:s,messages:t}),1===new Set(t).size&&"string"==typeof t[0]?void(0,m.Qg)((0,l.t)("files","Failed to convert files: {message}",{message:t[0]})):i.length===e.length?void(0,m.Qg)((0,l.t)("files","All files failed to be converted")):1===i.length&&t[0]?void(0,m.Qg)((0,l.t)("files","One file could not be converted: {message}",{message:t[0]})):((0,m.Qg)((0,l.n)("files","%n file could not be converted","%n files could not be converted",i.length)),void(0,m.Te)((0,l.n)("files","%n file converted","%n files converted",e.length-i.length)))}(0,m.Te)((0,l.t)("files","Files converted"));const a=window.OCP.Files.Router.query.dir,o=n.filter(e=>"fulfilled"===e.status).map(e=>e.value.data.ocs.data.path).filter(e=>e.startsWith(a));u.A.debug("Files to fetch",{newPaths:o}),(await Promise.all(o.map(e=>(0,f.t)(e)))).forEach(e=>(0,g.Ic)("files:node:created",e));const r=n[0].value.data.ocs.data.fileId;window.OCP.Files.Router.goToRoute(null,{...window.OCP.Files.Router.params,fileid:r.toString()},window.OCP.Files.Router.query)}catch(t){(0,m.Qg)((0,l.t)("files","Failed to convert files")),u.A.error("Failed to convert files",{fileIds:e,targetMimeType:s,error:t})}finally{n.hideToast()}}(s.map(e=>e.fileid).filter(Boolean),e),Array(s.length).fill(null)),parent:w}));(0,n.Gg)({id:w,displayName:()=>(0,l.t)("files","Save as …"),iconSvgInline:()=>'',enabled:s=>e.some(e=>e.enabled(s)),exec:async()=>null,order:25}),e.forEach(n.Gg)}(),(0,n.Gg)(z),(0,n.Gg)(B),(0,n.Gg)(ge),(0,n.Gg)(Y),(0,n.Gg)(ae),(0,n.Gg)(re),(0,n.Gg)(me),(0,n.Gg)(ue),(0,n.Gg)(fe),(0,n.Gg)(pe),(0,n.zj)(en),(0,n.zj)(on),function(){let e;e=(0,a.f)()?(0,v.C)("files_sharing","templates",[]):(0,v.C)("files","templates",[]),e.forEach((e,s)=>{(0,n.zj)({id:`template-new-${e.app}-${s}`,displayName:e.label,iconClass:e.iconClass||"icon-file",iconSvgInline:e.iconSvgInline,enabled:e=>0!==(e.permissions&n.aX.CREATE),order:11,async handler(s,t){const n=async function(e){if(null===tn){const s=document.createElement("div");s.id="template-picker",document.body.appendChild(s),tn=new x.Ay({render:s=>s(sn,{ref:"picker",props:{parent:e}}),methods:{open(...e){this.$refs.picker.open(...e)}},el:s})}return tn}(s),i=await Xt(`${e.label}${e.extension}`,t,{label:(0,l.Tl)("files","Filename"),name:e.label});null!==i&&(await n).open(i.trim(),e)}})})}(),!1===(0,a.f)()&&(async function(){const e=(0,n.bh)();e.register(new n.Ss({id:"favorites",name:(0,l.t)("files","Favorites"),caption:(0,l.t)("files","List of favorite files and folders."),emptyTitle:(0,l.t)("files","No favorites yet"),emptyCaption:(0,l.t)("files","Files and folders you mark as favorite will show up here"),icon:O,order:15,columns:[],getContents:rn}));const s=new AbortController,t=(await rn("",{signal:s.signal})).contents.filter(e=>e.type===n.pt.Folder),i=t.map((e,s)=>dn(e,s));u.A.debug("Generating favorites view",{favoriteFolders:t}),i.forEach(s=>e.register(s)),(0,g.B1)("files:favorites:added",e=>{e.type===n.pt.Folder&&(null!==e.path&&e.root?.startsWith("/files")?o(e):u.A.error("Favorite folder is not within user files root",{node:e}))}),(0,g.B1)("files:favorites:removed",e=>{e.type===n.pt.Folder&&(null!==e.path&&e.root?.startsWith("/files")?r(e.path):u.A.error("Favorite folder is not within user files root",{node:e}))}),(0,g.B1)("files:node:renamed",e=>{e.type===n.pt.Folder&&1===e.attributes.favorite&&function(e){const s=t.find(s=>s.fileid===e.fileid);void 0!==s&&(r(s.path),o(e))}(e)});const a=function(){t.sort((e,s)=>e.basename.localeCompare(s.basename,[(0,l.Z0)(),(0,l.lO)()],{ignorePunctuation:!0,numeric:!0,usage:"sort"})),t.forEach((e,s)=>{const t=i.find(s=>s.id===mn(e.path));t&&(t.order=s)})};function o(s){const n=dn(s);t.find(e=>e.path===s.path)||(t.push(s),i.push(n),a(),e.register(n))}function r(s){const n=mn(s),o=t.findIndex(e=>e.path===s);-1!==o&&(t.splice(o,1),i.splice(o,1),e.remove(n),a())}a()}(),(0,gn.g)(),(0,Bn.L)()&&(0,n.bh)().register(new n.Ss({id:Rn,name:(0,l.t)("files","Personal files"),caption:(0,l.t)("files","List of your files and folders that are not shared."),emptyTitle:(0,l.t)("files","No personal files found"),emptyCaption:(0,l.t)("files","Files that are not shared will show up here."),icon:'',order:(0,Bn.P)()===Rn?0:5,getContents:In})),(0,n.bh)().register(new n.Ss({id:"recent",name:(0,l.t)("files","Recent"),caption:(0,l.t)("files","List of recently modified files and folders."),emptyTitle:(0,l.t)("files","No recently modified files"),emptyCaption:(0,l.t)("files","Files and folders you recently modified will show up here."),icon:'',order:10,defaultSortKey:"mtime",getContents:async function(e="/",s){const t=C((0,k.u)()),a=s=>"/"!==e||t.userConfig.show_hidden||!s.dirname.split("/").some(e=>e.startsWith("."));try{const e=(await f.S.search("/",{signal:s.signal,details:!0,data:(0,i.Yr)(Wn)})).data.results.map(e=>(e.filename=e.filename.replace("/remote.php/dav",""),(0,i.pO)(e))).filter(a);return{folder:new n.vd({id:0,source:`${(0,i.EY)()}${(0,i.ei)()}`,root:(0,i.ei)(),owner:(0,b.HW)()?.uid||null,permissions:n.aX.READ}),contents:e}}catch(e){if(s.signal.aborted)throw u.A.info("Fetching recent files aborted"),new DOMException("Aborted","AbortError");throw u.A.error("Failed to fetch recent files",{error:e}),e}}})),(0,de.d)(),async function(){Tn&&yn.register(Un)}()),(0,n.cZ)(new ve),function(){const e=(0,be.A)(x.Ay,Ht);Object.defineProperty(e.prototype,"attachShadow",{value(){return this}}),Object.defineProperty(e.prototype,"shadowRoot",{get(){return this}}),window.customElements.define(Vt,e),(0,n.cZ)(new Yt)}(),function(){const e=(0,be.A)(x.Ay,At);Object.defineProperty(e.prototype,"attachShadow",{value(){return this}}),Object.defineProperty(e.prototype,"shadowRoot",{get(){return this}}),customElements.define(zt,e),(0,n.cZ)(new jt)}(),(0,n.cZ)(new we),(0,n.SX)({id:"files-favorite",order:0,enabled:({node:e})=>e.isDavResource&&e.root.startsWith("/files/"),displayName:({node:e})=>e.attributes.favorite?(0,l.t)("files","Unfavorite"):(0,l.t)("files","Favorite"),iconSvgInline:({node:e})=>e.attributes.favorite?H:O,onClick({node:e,view:s}){q(e,s,!e.attributes.favorite)}}),"serviceWorker"in navigator?window.addEventListener("load",async()=>{try{const e=(0,r.Jv)("/apps/files/preview-service-worker.js",{},{noRewrite:!0});let s=(0,r.aU)();""===s&&(s="/");const t=await navigator.serviceWorker.register(e,{scope:s});u.A.debug("SW registered: ",{registration:t})}catch(e){u.A.error("SW registration failed: ",{error:e})}}):u.A.debug("Service Worker is not enabled on this browser."),(0,i.Yc)("nc:hidden",{nc:"http://nextcloud.org/ns"}),(0,i.Yc)("nc:is-mount-root",{nc:"http://nextcloud.org/ns"}),(0,i.Yc)("nc:metadata-blurhash",{nc:"http://nextcloud.org/ns"}),(0,i.Yc)("nc:metadata-files-live-photo",{nc:"http://nextcloud.org/ns"}),window._nc_newfilemenu=new Proxy((0,n.id)(),{get:(e,s)=>e[s],set:(e,s,t)=>(e[s]=t,!0)})},84560(e,s,t){"use strict";t.d(s,{A:()=>n});const n=(0,t(35947).YK)().setApp("files").detectUser().build()},14668(e,s,t){"use strict";t.d(s,{h:()=>g});var n=t(77815),i=t(43627),a=t(84560),o=t(88975),l=t(88140),r=t(78246),d=t(99201),m=t(46502);async function g(e="/",s){const t=(0,r.j)((0,l.u)());return t.query.length<3?await async function(e,s){e=(0,i.join)((0,n.ei)(),e);const t=(0,n.aN)(),o=await d.S.getDirectoryContents(e,{details:!0,data:t,includeSelf:!0,signal:s?.signal}),l=o.data[0],r=o.data.slice(1);if(l?.filename!==e&&`${l?.filename}/`!==e)throw a.A.debug(`Exepected "${e}" but got filename "${l.filename}" instead.`),new Error("Root node does not match requested path");return{folder:(0,n.pO)(l),contents:r.map(e=>{try{return(0,n.pO)(e)}catch(s){return a.A.error(`Invalid node detected '${e.basename}'`,{error:s}),null}}).filter(Boolean)}}(e,s):await async function(e,s,t){let a=(0,o._)((0,l.u)()).getDirectoryByPath("files",e);if(!a){const s=(0,i.join)((0,n.ei)(),e),t=await d.S.stat(s,{details:!0});a=(0,n.pO)(t.data)}return{folder:a,contents:await(0,m.E)(s,{dir:e,signal:t})}}(e,t.query,s?.signal)}},46502(e,s,t){"use strict";t.d(s,{E:()=>r});var n=t(21777),i=t(77815),a=t(63814),o=t(84560),l=t(99201);async function r(e,{dir:s,signal:t}){const r=(0,n.HW)();if(!r)return[];if((e=e.trim()).length<3)return[];s&&!s.startsWith("/")&&(s=`/${s}`),o.A.debug("Searching for nodes",{query:e,dir:s});const{data:d}=await l.S.search("/",{details:!0,signal:t,data:`\n\n\t \n\t\t \n\t\t\t \n\t\t\t ${(0,i.VX)()}\n\t\t\t \n\t\t \n\t\t \n\t\t\t \n\t\t\t\t /files/${r.uid}${s||""}\n\t\t\t\t infinity\n\t\t\t \n\t\t \n\t\t \n\t\t\t \n\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t \n\t\t\t\t %${e.replace("%","")}%\n\t\t\t \n\t\t \n\t\t \n\t\n`});return t?.aborted?[]:d.results.map(e=>(0,i.pO)(e,i.VA,(0,a.$_)()))}},99201(e,s,t){"use strict";t.d(s,{S:()=>i,t:()=>a});var n=t(77815);const i=(0,n.KU)();async function a(e){const s=(0,n.aN)(),t=await i.stat(`${(0,n.ei)()}${e}`,{details:!0,data:s});return(0,n.pO)(t.data)}},39992(e,s,t){"use strict";t.d(s,{F:()=>g});var n=t(21777),i=t(61338),a=t(35810),o=t(77815),l=t(10810),r=t(85471),d=t(84560);const m=new a.vd({id:0,source:(0,o.EY)()+(0,o.ei)(),root:(0,o.ei)(),owner:(0,n.HW)()?.uid||null,permissions:a.aX.NONE}),g=(0,l.nY)("active",()=>{const e=(0,r.IJ)(),s=(0,r.KR)(),t=(0,r.IJ)(),n=(0,r.KR)(m);function o(e){s.value&&s.value.source===e.source&&(s.value=void 0)}function l(e=null){d.A.debug("Setting active view",{view:e}),t.value=e??void 0,s.value=void 0}return(0,r.wB)(s,()=>{"number"==typeof s.value?.fileid&&s.value.fileid!==n.value?.fileid&&(d.A.debug("Updating active fileid in URL query",{fileid:s.value.fileid}),window.OCP.Files.Router.goToRoute(null,{...window.OCP.Files.Router.params,fileid:String(s.value.fileid)},{...window.OCP.Files.Router.query},!0))}),function(){const e=(0,a.bh)();l(e.active),(0,i.B1)("files:node:deleted",o),e.addEventListener("updateActive",e=>{l(e.detail)})}(),{activeAction:e,activeFolder:n,activeNode:s,activeView:t}})},88975(e,s,t){"use strict";t.d(s,{_:()=>d});var n=t(61338),i=t(10810),a=t(85471),o=t(84560),l=t(99201),r=t(16488);function d(...e){const s=(0,i.nY)("files",{state:()=>({files:{},roots:{}}),getters:{getNode:e=>s=>e.files[s],getNodes:e=>s=>s.map(s=>e.files[s]).filter(Boolean),getNodesById:e=>s=>Object.values(e.files).filter(e=>e.fileid===s),getRoot:e=>s=>e.roots[s]},actions:{getDirectoryByPath(e,s){const t=(0,r.B)();let n;if(s&&"/"!==s){const i=t.getPath(e,s);i&&(n=this.getNode(i))}else n=this.getRoot(e);return n},getNodesByPath(e,s){const t=this.getDirectoryByPath(e,s);return(t?._children??[]).map(e=>this.getNode(e)).filter(Boolean)},updateNodes(e){const s=e.reduce((e,s)=>s.fileid?(e[s.source]=s,e):(o.A.error("Trying to update/set a node without fileid",{node:s}),e),{});a.Ay.set(this,"files",{...this.files,...s})},deleteNodes(e){e.forEach(e=>{e.source&&a.Ay.delete(this.files,e.source)})},setRoot({service:e,root:s}){a.Ay.set(this.roots,e,s)},onDeletedNode(e){this.deleteNodes([e])},onCreatedNode(e){this.updateNodes([e])},onMovedNode({node:e,oldSource:s}){e.fileid?(a.Ay.delete(this.files,s),this.updateNodes([e])):o.A.error("Trying to update/set a node without fileid",{node:e})},async onUpdatedNode(e){if(!e.fileid)return void o.A.error("Trying to update/set a node without fileid",{node:e});const s=this.getNodesById(e.fileid);if(s.length>1)return await Promise.all(s.map(e=>(0,l.t)(e.path))).then(this.updateNodes),void o.A.debug(s.length+" nodes updated in store",{fileid:e.fileid});1!==s.length||e.source!==s[0].source?(0,l.t)(e.path).then(e=>this.updateNodes([e])):this.updateNodes([e])},onAddFavorite(e){const s=this.getNode(e.source);s&&a.Ay.set(s.attributes,"favorite",1)},onRemoveFavorite(e){const s=this.getNode(e.source);s&&a.Ay.set(s.attributes,"favorite",0)}}})(...e);return s._initialized||((0,n.B1)("files:node:created",s.onCreatedNode),(0,n.B1)("files:node:deleted",s.onDeletedNode),(0,n.B1)("files:node:updated",s.onUpdatedNode),(0,n.B1)("files:node:moved",s.onMovedNode),(0,n.B1)("files:favorites:added",s.onAddFavorite),(0,n.B1)("files:favorites:removed",s.onRemoveFavorite),s._initialized=!0),s}},88140(e,s,t){"use strict";t.d(s,{u:()=>i});var n=t(10810);function i(){return window._nc_files_pinia||(window._nc_files_pinia=(0,n.Ey)()),window._nc_files_pinia}},16488(e,s,t){"use strict";t.d(s,{B:()=>m});var n=t(61338),i=t(35810),a=t(71225),o=t(10810),l=t(85471),r=t(84560),d=t(88975);function m(...e){const s=(0,d._)(...e),t=(0,o.nY)("paths",{state:()=>({paths:{}}),getters:{getPath:e=>(s,t)=>{if(e.paths[s])return e.paths[s][t]}},actions:{addPath(e){this.paths[e.service]||l.Ay.set(this.paths,e.service,{}),l.Ay.set(this.paths[e.service],e.path,e.source)},deletePath(e,s){this.paths[e]&&l.Ay.delete(this.paths[e],s)},onCreatedNode(e){const s=(0,i.bh)()?.active?.id||"files";e.fileid?(e.type===i.pt.Folder&&this.addPath({service:s,path:e.path,source:e.source}),this.addNodeToParentChildren(e)):r.A.error("Node has no fileid",{node:e})},onDeletedNode(e){const s=(0,i.bh)()?.active?.id||"files";e.type===i.pt.Folder&&this.deletePath(s,e.path),this.deleteNodeFromParentChildren(e)},onMovedNode({node:e,oldSource:s}){const t=(0,i.bh)()?.active?.id||"files";if(e.type===i.pt.Folder){const n=Object.entries(this.paths[t]).find(([,e])=>e===s);n?.[0]&&this.deletePath(t,n[0]),this.addPath({service:t,path:e.path,source:e.source})}const n=new i.ZH({source:s,owner:e.owner,mime:e.mime,root:e.root});this.deleteNodeFromParentChildren(n),this.addNodeToParentChildren(e)},deleteNodeFromParentChildren(e){const t=(0,i.bh)()?.active?.id||"files",n=(0,a.pD)(e.source),o="/"===e.dirname?s.getRoot(t):s.getNode(n);if(o){const s=new Set(o._children??[]);return s.delete(e.source),l.Ay.set(o,"_children",[...s.values()]),void r.A.debug("Children updated",{parent:o,node:e,children:o._children})}r.A.debug("Parent path does not exists, skipping children update",{node:e})},addNodeToParentChildren(e){const t=(0,i.bh)()?.active?.id||"files",n=(0,a.pD)(e.source),o="/"===e.dirname?s.getRoot(t):s.getNode(n);if(o){const s=new Set(o._children??[]);return s.add(e.source),l.Ay.set(o,"_children",[...s.values()]),void r.A.debug("Children updated",{parent:o,node:e,children:o._children})}r.A.debug("Parent path does not exists, skipping children update",{node:e})}}})(...e);return t._initialized||((0,n.B1)("files:node:created",t.onCreatedNode),(0,n.B1)("files:node:deleted",t.onDeletedNode),(0,n.B1)("files:node:moved",t.onMovedNode),t._initialized=!0),t}},78246(e,s,t){"use strict";t.d(s,{j:()=>d});var n=t(61338),i=t(46855),a=t(10810),o=t(85471),l=t(84560),r=t(10333);const d=(0,a.nY)("search",()=>{const e=(0,o.KR)(""),s=(0,o.KR)("filter");(0,o.wB)(s,a),(0,o.wB)(e,(e,s)=>{e.trim()!==s.trim()&&a()}),function(){(0,n.B1)("files:navigation:changed",d);const t=window.OCP.Files.Router;t.params.view===r.w&&(e.value=[t.query.query].flat()[0]??"",e.value?(s.value="globally",l.A.debug("Directly navigated to search view",{query:e.value})):(l.A.info("Directly navigated to search view without any query, redirect to files view."),t.goToRoute(void 0,{...t.params,view:"files"},{...t.query,query:void 0},!0)))}();const t=(0,i.A)(s=>{window.OCP.Files.Router.goToRoute(void 0,{view:r.w},{query:e.value},s)});function a(){(0,n.Ic)("files:search:updated",{query:e.value,scope:s.value});const i=window.OCP.Files.Router;if(i.params.view===r.w&&(""===e.value||"filter"===s.value))return s.value="filter",i.goToRoute(void 0,{view:"files"},{...i.query,query:void 0});if("filter"===s.value||!e.value)return;const a=i.params.view===r.w;l.A.debug("Update route for updated search query",{query:e.value,isSearch:a}),t(a)}function d(t){t.id!==r.w&&(e.value="",s.value="filter")}return{query:e,scope:s}})},92829(e,s,t){"use strict";t.d(s,{L:()=>i,P:()=>a});var n=t(81222);function i(){return 0!==(0,n.C)("files","storageStats",{quota:-1}).quota}function a(){const{default_view:e}=(0,n.C)("files","config",{default_view:"files"});return"personal"!==e||i()?e:"files"}},66480(e,s,t){"use strict";t.d(s,{g:()=>g,w:()=>m});var n=t(43690),i=t(61338),a=t(35810),o=t(53334),l=t(14668),r=t(39992),d=t(92829);const m="files";function g(){let e="";const s=(0,a.bh)();s.register(new a.Ss({id:m,name:(0,o.t)("files","All files"),caption:(0,o.t)("files","List of your files and folders."),icon:n,order:(0,d.P)()===m?0:5,getContents:l.h})),(0,i.B1)("files:search:updated",({scope:t,query:n})=>{if("globally"===t)return;if(s.active?.id!==m)return;if(e.length<3&&n.length<3)return;const a=(0,r.F)();a.activeFolder&&(e=n,(0,i.Ic)("files:node:updated",a.activeFolder))})}},10333(e,s,t){"use strict";t.d(s,{w:()=>p,d:()=>h});var n=t(97390),i=t(35810),a=t(53334),o=t(85471),l=t(21777),r=t(77815),d=t(84560),m=t(88140),g=t(78246),c=t(46502);async function u(e,s){const t=(0,g.j)((0,m.u)());try{return{contents:await(0,c.E)(t.query,{signal:s.signal}),folder:new i.vd({id:0,source:`${r.Xn}${(0,r.ei)()}}#search`,owner:(0,l.HW)().uid,permissions:i.aX.READ,root:(0,r.ei)()})}}catch(e){if(s.signal.aborted)throw d.A.info("Fetching search results aborted"),new DOMException("Aborted","AbortError");throw d.A.error("Failed to fetch search results",{error:e}),e}}var f=t(66480);const p="search";function h(){let e,s;(0,i.bh)().register(new i.Ss({id:p,name:(0,a.t)("files","Search"),caption:(0,a.t)("files","Search results within your files."),async emptyView(n){s?e.$destroy():s=(await Promise.all([t.e(4208),t.e(1035)]).then(t.bind(t,91035))).default,e=new o.Ay(s),e.$mount(n)},icon:n,order:10,parent:f.w,expanded:!0,hidden:!0,getContents:u}))}},75689(e,s,t){"use strict";t.d(s,{A:()=>l});var n=t(71354),i=t.n(n),a=t(76314),o=t.n(a)()(i());o.push([e.id,".files-list-filter-time__clear-button[data-v-2841ff92] .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 l=o},78224(e,s,t){"use strict";t.d(s,{A:()=>l});var n=t(71354),i=t.n(n),a=t(76314),o=t.n(a)()(i());o.push([e.id,"\n.new-node-dialog__form[data-v-77bf0406] {\n\t/* Ensure the dialog does not jump when there is a validity error */\n\tmin-height: calc(2 * var(--default-clickable-area));\n}\n","",{version:3,sources:["webpack://./apps/files/src/components/NewNodeDialog.vue"],names:[],mappings:";AAwKA;CACA,mEAAA;CACA,mDAAA;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