2026-06-17 07:49:27 -04:00
|
|
|
(()=>{var e,s,t,n={22351(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(44368),m=t(85168),g=t(61338),c=t(49264),u=t(99201),f=t(64630);const p=new c.Ay({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 P(e){await d.Ay.delete(e.encodedSource),(0,g.Ic)("files:node:deleted",e)}const A=new c.Ay({concurrency:5}),z={id:"delete",displayName:F,iconSvgInline:({nodes:e})=>S(e)?'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-close" viewBox="0 0 24 24"><path d="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" /></svg>':L(e)?'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-network-off" viewBox="0 0 24 24"><path d="M1,5.27L5,9.27V15A2,2 0 0,0 7,17H11V19H10A1,1 0 0,0 9,20H2V22H9A1,1 0 0,0 10,23H14A1,1 0 0,0 15,22H17.73L19.73,24L21,22.72L2.28,4L1,5.27M15,20A1,1 0 0,0 14,19H13V17.27L15.73,20H15M17.69,16.87L5.13,4.31C5.41,3.55 6.14,3 7,3H17A2,2 0 0,1 19,5V15C19,15.86 18.45,16.59 17.69,16.87M22,20V21.18L20.82,20H22Z" /></svg>':'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-trash-can-outline" viewBox="0 0 24 24"><path d="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" /></svg>',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 P(e[0]),!0)}catch(s){return f.v.error("Error while deleting a file",{error:s,source:e[0].source,node:e[0]}),!1}},async exec
|