2400-2400.js 33 KB

12
  1. "use strict";(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[2400],{9165:(e,t,i)=>{i.d(t,{NZC:()=>l,ZL5:()=>a,fEr:()=>n});var l="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",n="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",a="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"},27518:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M15.4%2016.6L10.8%2012l4.6-4.6L14%206l-6%206%206%206%201.4-1.4z%27/%3e%3c/svg%3e"},27514:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M18.4%207.4L17%206l-6%206%206%206%201.4-1.4-4.6-4.6%204.6-4.6m-6%200L11%206l-6%206%206%206%201.4-1.4L7.8%2012l4.6-4.6z%27/%3e%3c/svg%3e"},79722:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M5.6%207.4L7%206l6%206-6%206-1.4-1.4%204.6-4.6-4.6-4.6m6%200L13%206l6%206-6%206-1.4-1.4%204.6-4.6-4.6-4.6z%27/%3e%3c/svg%3e"},86886:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M8.6%2016.6l4.6-4.6-4.6-4.6L10%206l6%206-6%206-1.4-1.4z%27/%3e%3c/svg%3e"},70594:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Be});var l=i(85471),n=i(85136),a=i(31346),r=i(76333),o=i(32981),s=i(63814),c=i(82680);function u(e){return"function"==typeof e?e():(0,l.R1)(e)}function d(e){const t=Object.create(null);return i=>t[i]||(t[i]=e(i))}l.Ay.util.warn,i(96763),"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope),Object.prototype.toString;const p=/\B([A-Z])/g,f=(d((e=>e.replace(p,"-$1").toLowerCase())),/-(\w)/g);d((e=>e.replace(f,((e,t)=>t?t.toUpperCase():""))));var v=i(65043),m=i(57485),g=i(21777),h=i(54914),w=i(9165),_=i(61338),y=i(36117),b=i(43627),C=i(96763);const k={name:"FileIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var N=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon file-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"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"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},S=[];const F=(0,n.a)(k,N,S,!1,null,null).exports,x=()=>{var e,t,i;const a=(0,o.C)("files","config",null),r=(0,l.KR)(null==(e=null==a?void 0:a.show_hidden)||e),u=(0,l.KR)(null==(t=null==a?void 0:a.sort_favorites_first)||t),d=(0,l.KR)(null==(i=null==a?void 0:a.crop_image_previews)||i);return(0,l.sV)((async()=>{var e,t,i,l,a,o;if((0,c.f)())C.debug("Skip loading files settings - currently on public share");else try{const{data:n}=await v.Ay.get((0,s.Jv)("/apps/files/api/v1/configs"));r.value=null!=(t=null==(e=null==n?void 0:n.data)?void 0:e.show_hidden)&&t,u.value=null==(l=null==(i=null==n?void 0:n.data)?void 0:i.sort_favorites_first)||l,d.value=null==(o=null==(a=null==n?void 0:n.data)?void 0:a.crop_image_previews)||o}catch(e){C.error("Could not load files settings",e),(0,n.l)((0,n.t)("Could not load files settings"))}})),{showHiddenFiles:r,sortFavoritesFirst:u,cropImagePreviews:d}},L={name:"MenuUpIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var P=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon menu-up-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M7,15L12,10L17,15H7Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},A=[];const B=(0,n.a)(L,P,A,!1,null,null).exports,I={name:"MenuDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var z=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon menu-down-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M7,10L12,15L17,10H7Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},V=[];const R=(0,n.a)(I,z,V,!1,null,null).exports,M={"file-picker__file-icon":"_file-picker__file-icon_19mjt_9"},D=(0,l.pM)({__name:"LoadingTableRow",props:{showCheckbox:{type:Boolean}},setup:e=>({__sfc:!0,fileListIconStyles:M})});var E=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("tr",{staticClass:"file-picker__row loading-row",attrs:{"aria-hidden":"true"}},[e.showCheckbox?t("td",{staticClass:"row-checkbox"},[t("span")]):e._e(),t("td",{staticClass:"row-name"},[t("div",{staticClass:"row-wrapper"},[t("span",{class:i.fileListIconStyles["file-picker__file-icon"]}),t("span")])]),e._m(0),e._m(1)])},H=[function(){var e=this._self._c;return this._self._setupProxy,e("td",{staticClass:"row-size"},[e("span")])},function(){var e=this._self._c;return this._self._setupProxy,e("td",{staticClass:"row-modified"},[e("span")])}];const W=(0,n.a)(D,E,H,!1,null,"15187afc").exports,K=new m.A({concurrency:5}),$={name:"FolderIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var T=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon folder-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"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"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},O=[];const Z=(0,n.a)($,T,O,!1,null,null).exports,j=(0,l.pM)({name:"FilePreview",props:{node:null,cropImagePreviews:{type:Boolean}},setup(e){const t=e,i=(0,l.KR)(M),{previewURL:n,previewLoaded:r}=((e,t)=>{const i=(0,l.KR)(null),n=(0,l.KR)(!1);return(0,l.nT)((()=>{n.value=!1,i.value=function(e,t={}){var i;t={size:32,cropPreview:!1,mimeFallback:!0,...t};try{const l=(null==(i=e.attributes)?void 0:i.previewUrl)||(0,s.Jv)("/core/preview?fileId={fileid}",{fileid:e.fileid});let n;try{n=new URL(l)}catch(e){n=new URL(l,window.location.origin)}return n.searchParams.set("x","".concat(t.size)),n.searchParams.set("y","".concat(t.size)),n.searchParams.set("mimeFallback","".concat(t.mimeFallback)),n.searchParams.set("a",!0===t.cropPreview?"0":"1"),n.searchParams.set("c","".concat(e.attributes.etag)),n}catch(e){return null}}(u(e),u(t||{})),i.value&&function(e){const{resolve:t,promise:i}=Promise.withResolvers();return K.add((()=>{const l=new Image;return l.onerror=()=>t(!1),l.onload=()=>t(!0),l.src=e,i})),i}(i.value.href).then((e=>{n.value=e}))})),{previewURL:i,previewLoaded:n}})((0,l.lW)(t,"node"),(0,l.EW)((()=>({cropPreview:t.cropImagePreviews})))),o=(0,l.EW)((()=>t.node.type===a.pt.File));return{__sfc:!0,fileListIconStyles:i,props:t,previewURL:n,previewLoaded:r,isFile:o,IconFile:F,IconFolder:Z}}});var U=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{class:i.fileListIconStyles["file-picker__file-icon"],style:i.previewLoaded?{backgroundImage:"url(".concat(i.previewURL,")")}:void 0},[i.previewLoaded?e._e():[i.isFile?t(i.IconFile,{attrs:{size:20}}):t(i.IconFolder,{attrs:{size:20}})]],2)},J=[];const X=(0,n.a)(j,U,J,!1,null,null).exports,G=(0,l.pM)({__name:"FileListRow",props:{allowPickDirectory:{type:Boolean},selected:{type:Boolean},showCheckbox:{type:Boolean},canPick:{type:Boolean},node:null,cropImagePreviews:{type:Boolean}},emits:["update:selected","enter-directory"],setup(e,{emit:t}){const i=e,o=(0,l.EW)((()=>{var e;return(null==(e=i.node.attributes)?void 0:e.displayName)||i.node.basename.slice(0,i.node.extension?-i.node.extension.length:void 0)})),s=(0,l.EW)((()=>i.node.extension)),c=(0,l.EW)((()=>i.node.type===a.pt.Folder)),u=(0,l.EW)((()=>i.canPick&&(i.allowPickDirectory||!c.value)));function d(){t("update:selected",!i.selected)}function p(){c.value?t("enter-directory",i.node):d()}return{__sfc:!0,props:i,emit:t,displayName:o,fileExtension:s,isDirectory:c,isPickable:u,toggleSelected:d,handleClick:p,handleKeyDown:function(e){"Enter"===e.key&&p()},formatFileSize:a.v7,NcCheckboxRadioSwitch:r.AO,NcDateTime:r.lT,t:n.t,FilePreview:X}}});var Q=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("tr",e._g({class:["file-picker__row",{"file-picker__row--selected":e.selected&&!e.showCheckbox}],attrs:{tabindex:e.showCheckbox&&!i.isDirectory?void 0:0,"aria-selected":i.isPickable?e.selected:void 0,"data-filename":e.node.basename,"data-testid":"file-list-row"}},{click:i.handleClick,...!e.showCheckbox||i.isDirectory?{keydown:i.handleKeyDown}:{}}),[e.showCheckbox?t("td",{staticClass:"row-checkbox",on:{click:function(e){return e.stopPropagation(),(()=>{}).apply(null,arguments)}}},[t(i.NcCheckboxRadioSwitch,{attrs:{"aria-label":i.t("Select the row for {nodename}",{nodename:i.displayName}),checked:e.selected,disabled:!i.isPickable,"data-testid":"row-checkbox"},on:{"update:checked":i.toggleSelected}})],1):e._e(),t("td",{staticClass:"row-name"},[t("div",{staticClass:"file-picker__name-container",attrs:{"data-testid":"row-name"}},[t(i.FilePreview,{attrs:{node:e.node,"crop-image-previews":e.cropImagePreviews}}),t("div",{staticClass:"file-picker__file-name",attrs:{title:i.displayName},domProps:{textContent:e._s(i.displayName)}}),t("div",{staticClass:"file-picker__file-extension",domProps:{textContent:e._s(i.fileExtension)}})],1)]),t("td",{staticClass:"row-size"},[e._v(" "+e._s(i.formatFileSize(e.node.size||0))+" ")]),t("td",{staticClass:"row-modified"},[t(i.NcDateTime,{attrs:{timestamp:e.node.mtime,"ignore-seconds":!0}})],1)])},q=[];const Y=(0,n.a)(G,Q,q,!1,null,"cb12dccb").exports,ee=(0,l.pM)({__name:"FileList",props:{currentView:null,multiselect:{type:Boolean},allowPickDirectory:{type:Boolean},loading:{type:Boolean},files:null,selectedFiles:null,path:null},emits:["update:path","update:selectedFiles"],setup(e,{emit:t}){const i=e,d=(0,l.KR)(),{currentConfig:p}=(e=>{var t,i,a,r,d,p,f,m,g,h,w,_;const y=e=>"asc"===e?"ascending":"desc"===e?"descending":"none",b=(0,o.C)("files","viewConfigs",null),k=(0,l.KR)({sortBy:null!=(i=null==(t=null==b?void 0:b.files)?void 0:t.sorting_mode)?i:"basename",order:y(null!=(r=null==(a=null==b?void 0:b.files)?void 0:a.sorting_direction)?r:"asc")}),N=(0,l.KR)({sortBy:null!=(p=null==(d=null==b?void 0:b.recent)?void 0:d.sorting_mode)?p:"basename",order:y(null!=(m=null==(f=null==b?void 0:b.recent)?void 0:f.sorting_direction)?m:"asc")}),S=(0,l.KR)({sortBy:null!=(h=null==(g=null==b?void 0:b.favorites)?void 0:g.sorting_mode)?h:"basename",order:y(null!=(_=null==(w=null==b?void 0:b.favorites)?void 0:w.sorting_direction)?_:"asc")});(0,l.sV)((async()=>{var e,t,i,l,a,r,o,u,d,p,f,m,g,h,w;if((0,c.f)())C.debug("Skip loading files views - currently on public share");else try{const{data:n}=await v.Ay.get((0,s.Jv)("/apps/files/api/v1/views"));k.value={sortBy:null!=(i=null==(t=null==(e=null==n?void 0:n.data)?void 0:e.files)?void 0:t.sorting_mode)?i:"basename",order:y(null==(a=null==(l=null==n?void 0:n.data)?void 0:l.files)?void 0:a.sorting_direction)},S.value={sortBy:null!=(u=null==(o=null==(r=null==n?void 0:n.data)?void 0:r.favorites)?void 0:o.sorting_mode)?u:"basename",order:y(null==(p=null==(d=null==n?void 0:n.data)?void 0:d.favorites)?void 0:p.sorting_direction)},N.value={sortBy:null!=(g=null==(m=null==(f=null==n?void 0:n.data)?void 0:f.recent)?void 0:m.sorting_mode)?g:"basename",order:y(null==(w=null==(h=null==n?void 0:n.data)?void 0:h.recent)?void 0:w.sorting_direction)}}catch(e){C.error("Could not load files views",e),(0,n.l)((0,n.t)("Could not load files views"))}}));const F=(0,l.EW)((()=>"files"===u(e||"files")?k.value:"recent"===u(e)?N.value:S.value)),x=(0,l.EW)((()=>F.value.sortBy)),L=(0,l.EW)((()=>F.value.order));return{filesViewConfig:k,favoritesViewConfig:S,recentViewConfig:N,currentConfig:F,sortBy:x,order:L}})(i.currentView),f=(0,l.EW)((()=>{var e;return null!=(e=d.value)?e:p.value})),m=(0,l.EW)((()=>"basename"===f.value.sortBy?"none"===f.value.order?void 0:f.value.order:void 0)),g=(0,l.EW)((()=>"size"===f.value.sortBy?"none"===f.value.order?void 0:f.value.order:void 0)),h=(0,l.EW)((()=>"mtime"===f.value.sortBy?"none"===f.value.order?void 0:f.value.order:void 0)),{sortFavoritesFirst:w,cropImagePreviews:_}=x(),y=(0,l.EW)((()=>(0,a.ur)(i.files,{sortFoldersFirst:!0,sortFavoritesFirst:w.value,sortingOrder:"descending"===f.value.order?"desc":"asc",sortingMode:f.value.sortBy}))),b=(0,l.EW)((()=>i.files.filter((e=>i.allowPickDirectory||e.type!==a.pt.Folder)))),k=(0,l.EW)((()=>!i.loading&&i.selectedFiles.length>0&&i.selectedFiles.length>=b.value.length)),N=(0,l.KR)(4),S=(0,l.KR)();{const e=()=>(0,l.dY)((()=>{var e,t,i,l,n;const a=(null==(t=null==(e=S.value)?void 0:e.parentElement)?void 0:t.children)||[];let r=(null==(l=null==(i=S.value)?void 0:i.parentElement)?void 0:l.clientHeight)||450;for(let e=0;e<a.length;e++)(null==(n=S.value)?void 0:n.isSameNode(a[e]))||(r-=a[e].clientHeight);N.value=Math.max(1,Math.floor((r-50)/50))}));(0,l.sV)((()=>{window.addEventListener("resize",e),e()})),(0,l.hi)((()=>{window.removeEventListener("resize",e)}))}return{__sfc:!0,props:i,emit:t,customSortingConfig:d,filesAppSorting:p,sortingConfig:f,sortByName:m,sortBySize:g,sortByModified:h,toggleSorting:e=>{f.value.sortBy===e?"ascending"===f.value.order?d.value={sortBy:f.value.sortBy,order:"descending"}:d.value={sortBy:f.value.sortBy,order:"ascending"}:d.value={sortBy:e,order:"ascending"}},sortFavoritesFirst:w,cropImagePreviews:_,sortedFiles:y,selectableFiles:b,allSelected:k,onSelectAll:function(){i.selectedFiles.length<b.value.length?t("update:selectedFiles",b.value):t("update:selectedFiles",[])},onNodeSelected:function(e){i.selectedFiles.includes(e)?t("update:selectedFiles",i.selectedFiles.filter((t=>t.path!==e.path))):i.multiselect?t("update:selectedFiles",[...i.selectedFiles,e]):t("update:selectedFiles",[e])},onChangeDirectory:function(e){t("update:path",e.path)},skeletonNumber:N,fileContainer:S,NcButton:r.x1,NcCheckboxRadioSwitch:r.AO,t:n.t,IconSortAscending:B,IconSortDescending:R,LoadingTableRow:W,FileListRow:Y}}});var te=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{ref:"fileContainer",staticClass:"file-picker__files"},[t("table",[t("thead",[t("tr",[e.multiselect?t("th",{staticClass:"row-checkbox"},[t("span",{staticClass:"hidden-visually"},[e._v(" "+e._s(i.t("Select entry"))+" ")]),e.multiselect?t(i.NcCheckboxRadioSwitch,{attrs:{"aria-label":i.t("Select all entries"),checked:i.allSelected,"data-testid":"select-all-checkbox"},on:{"update:checked":i.onSelectAll}}):e._e()],1):e._e(),t("th",{staticClass:"row-name",attrs:{"aria-sort":i.sortByName}},[t("div",{staticClass:"header-wrapper"},[t("span",{staticClass:"file-picker__header-preview"}),t(i.NcButton,{attrs:{wide:!0,type:"tertiary","data-test":"file-picker_sort-name"},on:{click:function(e){return i.toggleSorting("basename")}},scopedSlots:e._u([{key:"icon",fn:function(){return["ascending"===i.sortByName?t(i.IconSortAscending,{attrs:{size:20}}):"descending"===i.sortByName?t(i.IconSortDescending,{attrs:{size:20}}):t("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[e._v(" "+e._s(i.t("Name"))+" ")])],1)]),t("th",{staticClass:"row-size",attrs:{"aria-sort":i.sortBySize}},[t(i.NcButton,{attrs:{wide:!0,type:"tertiary"},on:{click:function(e){return i.toggleSorting("size")}},scopedSlots:e._u([{key:"icon",fn:function(){return["ascending"===i.sortBySize?t(i.IconSortAscending,{attrs:{size:20}}):"descending"===i.sortBySize?t(i.IconSortDescending,{attrs:{size:20}}):t("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[e._v(" "+e._s(i.t("Size"))+" ")])],1),t("th",{staticClass:"row-modified",attrs:{"aria-sort":i.sortByModified}},[t(i.NcButton,{attrs:{wide:!0,type:"tertiary"},on:{click:function(e){return i.toggleSorting("mtime")}},scopedSlots:e._u([{key:"icon",fn:function(){return["ascending"===i.sortByModified?t(i.IconSortAscending,{attrs:{size:20}}):"descending"===i.sortByModified?t(i.IconSortDescending,{attrs:{size:20}}):t("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[e._v(" "+e._s(i.t("Modified"))+" ")])],1)])]),t("tbody",[e.loading?e._l(i.skeletonNumber,(function(l){return t(i.LoadingTableRow,{key:l,attrs:{"show-checkbox":e.multiselect}})})):e._l(i.sortedFiles,(function(l){return t(i.FileListRow,{key:l.fileid||l.path,attrs:{"allow-pick-directory":e.allowPickDirectory,"show-checkbox":e.multiselect,"can-pick":e.multiselect||0===e.selectedFiles.length||e.selectedFiles.includes(l),selected:e.selectedFiles.includes(l),node:l,"crop-image-previews":i.cropImagePreviews},on:{"update:selected":function(e){return i.onNodeSelected(l)},"enter-directory":i.onChangeDirectory}})}))],2)])])},ie=[];const le=(0,n.a)(ee,te,ie,!1,null,"006fdbd0").exports,ne={name:"HomeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var ae=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon home-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},re=[];const oe=(0,n.a)(ne,ae,re,!1,null,null).exports,se={name:"PlusIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var ce=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon plus-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},ue=[];const de=(0,n.a)(se,ce,ue,!1,null,null).exports,pe=(0,l.pM)({__name:"FilePickerBreadcrumbs",props:{path:null,showMenu:{type:Boolean}},emits:["update:path","create-node"],setup(e,{emit:t}){const i=e,a=(0,l.KR)(!1),o=(0,l.KR)(""),s=(0,l.KR)();function c(){var e,t,i,l;const a=o.value.trim(),r=null==(t=null==(e=s.value)?void 0:e.$el)?void 0:t.querySelector("input");let c="";return 0===a.length?c=(0,n.t)("Folder name cannot be empty."):a.includes("/")?c=(0,n.t)('"/" is not allowed inside a folder name.'):["..","."].includes(a)?c=(0,n.t)('"{name}" is an invalid folder name.',{name:a}):(null==(i=window.OC.config)?void 0:i.blacklist_files_regex)&&a.match(null==(l=window.OC.config)?void 0:l.blacklist_files_regex)&&(c=(0,n.t)('"{name}" is not an allowed folder name',{name:a})),r&&r.setCustomValidity(c),""===c}const u=(0,l.EW)((()=>i.path.split("/").filter((e=>""!==e)).map(((e,t,i)=>({name:e,path:"/"+i.slice(0,t+1).join("/")})))));return{__sfc:!0,props:i,emit:t,actionsOpen:a,newNodeName:o,nameInput:s,validateInput:c,onSubmit:function(){const e=o.value.trim();c()&&(a.value=!1,t("create-node",e),o.value="")},pathElements:u,IconFolder:Z,IconHome:oe,IconPlus:de,NcActions:r.B6,NcActionInput:r.Az,NcBreadcrumbs:r.Qz,NcBreadcrumb:r.R1,t:n.t}}});var fe=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.NcBreadcrumbs,{staticClass:"file-picker__breadcrumbs",scopedSlots:e._u([{key:"default",fn:function(){return[t(i.NcBreadcrumb,{attrs:{name:i.t("All files"),title:i.t("Home")},on:{click:function(e){return i.emit("update:path","/")}},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconHome,{attrs:{size:20}})]},proxy:!0}])}),e._l(i.pathElements,(function(e){return t(i.NcBreadcrumb,{key:e.path,attrs:{name:e.name,title:e.path},on:{click:function(t){return i.emit("update:path",e.path)}}})}))]},proxy:!0},e.showMenu?{key:"actions",fn:function(){return[t(i.NcActions,{attrs:{"aria-label":i.t("Create directory"),"force-menu":!0,"force-name":!0,"menu-name":i.t("New"),open:i.actionsOpen,type:"secondary"},on:{"update:open":function(e){i.actionsOpen=e},close:function(e){i.newNodeName=""}},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconPlus,{attrs:{size:20}})]},proxy:!0}],null,!1,2971667417)},[t(i.NcActionInput,{ref:"nameInput",attrs:{value:i.newNodeName,label:i.t("New folder"),placeholder:i.t("New folder name")},on:{"update:value":function(e){i.newNodeName=e},submit:i.onSubmit,input:i.validateInput},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconFolder,{attrs:{size:20}})]},proxy:!0}],null,!1,1614167509)})],1)]},proxy:!0}:null],null,!0)})},ve=[];const me=(0,n.a)(pe,fe,ve,!1,null,"b357227a").exports,ge={name:"CloseIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var he=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon close-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{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"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},we=[];const _e=(0,n.a)(ge,he,we,!1,null,null).exports,ye={name:"MagnifyIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var be=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon magnify-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},Ce=[];const ke=(0,n.a)(ye,be,Ce,!1,null,null).exports,Ne=(0,l.pM)({__name:"FilePickerNavigation",props:{currentView:null,filterString:null,isCollapsed:{type:Boolean},disabledNavigation:{type:Boolean}},emits:["update:currentView","update:filterString"],setup(e,{emit:t}){const i=e,{availableViews:a}=(e=>{const t=[{id:"files",label:(0,n.t)("All files"),icon:w.fEr},{id:"recent",label:(0,n.t)("Recent"),icon:w.NZC},{id:"favorites",label:(0,n.t)("Favorites"),icon:w.ZL5}],i=e.value?t.filter((({id:e})=>"files"===e)):t;return{allViews:t,availableViews:i}})((0,l.KR)(null===(0,g.HW)())),o=(0,l.EW)((()=>{var e;return null!=(e=a.filter((e=>e.id===i.currentView))[0])?e:a[0]}));return{__sfc:!0,props:i,emit:t,availableViews:a,currentViewObject:o,updateFilterValue:e=>t("update:filterString",e),IconClose:_e,IconMagnify:ke,NcButton:r.x1,NcIconSvgWrapper:r.K1,NcSelect:r.EQ,NcTextField:r.v,Fragment:h.F,t:n.t}}});var Se=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.Fragment,[t(i.NcTextField,{staticClass:"file-picker__filter-input",attrs:{value:e.filterString,label:i.t("Filter file list"),"show-trailing-button":!!e.filterString},on:{"update:value":i.updateFilterValue,"trailing-button-click":function(e){return i.updateFilterValue("")}},scopedSlots:e._u([{key:"trailing-button-icon",fn:function(){return[t(i.IconClose,{attrs:{size:16}})]},proxy:!0}])},[t(i.IconMagnify,{attrs:{size:16}})],1),i.availableViews.length>1&&!e.disabledNavigation?[e.isCollapsed?t(i.NcSelect,{attrs:{"aria-label":i.t("Current view selector"),clearable:!1,searchable:!1,options:i.availableViews,value:i.currentViewObject},on:{input:e=>i.emit("update:currentView",e.id)}}):t("ul",{staticClass:"file-picker__side"},e._l(i.availableViews,(function(l){return t("li",{key:l.id},[t(i.NcButton,{attrs:{type:e.currentView===l.id?"primary":"tertiary",wide:!0},on:{click:function(t){return e.$emit("update:currentView",l.id)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.NcIconSvgWrapper,{attrs:{path:l.icon,size:20}})]},proxy:!0}],null,!0)},[e._v(" "+e._s(l.label)+" ")])],1)})),0)]:e._e()],2)},Fe=[];const xe=(0,n.a)(Ne,Se,Fe,!1,null,"b42054b8").exports,Le=(0,l.pM)({name:"FilePicker",props:{buttons:null,name:null,allowPickDirectory:{type:Boolean,default:!1},disabledNavigation:{type:Boolean,default:!1},container:{default:"body"},filterFn:{default:void 0},mimetypeFilter:{default:()=>[]},multiselect:{type:Boolean,default:!0},path:{default:void 0}},emits:["close"],setup(e,{emit:t}){const i=e,o=(0,l.KR)(!0),s=(0,l.EW)((()=>{const e=0===f.value.length&&i.allowPickDirectory&&N.value?[N.value]:f.value;return("function"==typeof i.buttons?i.buttons(e,g.value,d.value):i.buttons).map((t=>({...t,disabled:t.disabled||S.value,callback:()=>{c=!0,u(t.callback,e)}})))}));let c=!1;const u=async(e,i)=>{e(i),t("close",i),c=!1},d=(0,l.KR)("files"),p=(0,l.EW)((()=>"favorites"===d.value?(0,n.t)("Favorites"):"recent"===d.value?(0,n.t)("Recent"):"")),f=(0,l.IJ)([]),v=(0,l.KR)((null==window?void 0:window.sessionStorage.getItem("NC.FilePicker.LastPath"))||"/"),m=(0,l.KR)("");(0,l.wB)([m],(()=>{void 0===i.path&&m.value&&window.sessionStorage.setItem("NC.FilePicker.LastPath",m.value),f.value=[]}));const g=(0,l.EW)({get:()=>"files"===d.value?m.value||i.path||v.value:"/",set:e=>{m.value=e}}),h=(0,l.KR)(""),{isSupportedMimeType:w}=function(e){const t=(0,l.EW)((()=>e.value.map((e=>e.split("/")))));return{isSupportedMimeType:e=>{const i=e.split("/");return t.value.some((([e,t])=>!(i[0]!==e&&"*"!==e||i[1]!==t&&"*"!==t)))}}}((0,l.lW)(i,"mimetypeFilter")),{files:k,folder:N,isLoading:S,loadFiles:L,createDirectory:P}=function(e,t){const i=(0,a.H4)(),n=(0,l.IJ)([]),r=(0,l.IJ)(null),o=(0,l.KR)(!0),s=(0,l.KR)(null);async function c(){s.value&&s.value.cancel(),o.value=!0,"favorites"===e.value?s.value=(0,a.Q$)(i,t.value):"recent"===e.value?s.value=function(e){const t=new AbortController,i=Math.round(Date.now()/1e3)-1209600;return new y.CancelablePromise((async(l,n,r)=>{r((()=>t.abort()));try{const{data:n}=await e.search("/",{signal:t.signal,details:!0,data:(0,a.R3)(i)});l(n.results.map((e=>(0,a.Al)(e))))}catch(e){n(e)}}))}(i):s.value=function(e,t){const i=new AbortController;return new y.CancelablePromise((async(l,n,r)=>{r((()=>i.abort()));try{const n=(await e.getDirectoryContents((0,b.join)(a.lJ,t),{signal:i.signal,details:!0,includeSelf:!0,data:(0,a.VL)()})).data.map((e=>(0,a.Al)(e)));l({contents:n.filter((({path:e})=>e!==t)),folder:n.find((({path:e})=>e===t))})}catch(e){n(e)}}))}(i,t.value);const l=await s.value;"folder"in l?(r.value=l.folder,n.value=l.contents):(r.value=null,n.value=l),s.value=null,o.value=!1}return(0,l.wB)([e,t],(()=>c())),(0,l.sV)((()=>c())),{isLoading:o,files:n,folder:r,loadFiles:c,createDirectory:async function(e){const l=(0,b.join)(t.value,e);await i.createDirectory((0,b.join)(a.lJ,l));const r=await async function(e,t){const{data:i}=await e.stat((0,b.join)(a.lJ,t),{details:!0,data:(0,a.VL)()});return(0,a.Al)(i)}(i,l);return n.value=[...n.value,r],r}}}(d,g);(0,l.sV)((()=>L()));const{showHiddenFiles:A}=x(),B=(0,l.EW)((()=>{let e=k.value;return A.value||(e=e.filter((e=>!e.basename.startsWith(".")))),i.mimetypeFilter.length>0&&(e=e.filter((e=>"folder"===e.type||e.mime&&w(e.mime)))),h.value&&(e=e.filter((e=>e.basename.toLowerCase().includes(h.value.toLowerCase())))),i.filterFn&&(e=e.filter((e=>i.filterFn(e)))),e})),I=(0,l.EW)((()=>"files"===d.value?(0,n.t)("Upload some content or sync with your devices!"):"recent"===d.value?(0,n.t)("Files and folders you recently modified will show up here."):(0,n.t)("Files and folders you mark as favorite will show up here.")));return{__sfc:!0,props:i,emit:t,isOpen:o,dialogButtons:s,isHandlingCallback:c,handleButtonClick:u,currentView:d,viewHeadline:p,selectedFiles:f,savedPath:v,navigatedPath:m,currentPath:g,filterString:h,isSupportedMimeType:w,files:k,currentFolder:N,isLoading:S,loadFiles:L,createDirectory:P,showHiddenFiles:A,filteredFiles:B,noFilesDescription:I,onCreateFolder:async e=>{try{const t=await P(e);m.value=t.path,(0,_.Ic)("files:node:created",k.value.filter((t=>t.basename===e))[0])}catch(t){C.warn("Could not create new folder",{name:e,error:t}),(0,n.l)((0,n.t)("Could not create the new folder"))}},handleClose:e=>{e||c||t("close")},IconFile:F,FileList:le,FilePickerBreadcrumbs:me,FilePickerNavigation:xe,NcDialog:r.i$,NcEmptyContent:r.yI,t:n.t}}});var Pe=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.NcDialog,{attrs:{container:e.container,buttons:i.dialogButtons,name:e.name,size:"large","content-classes":"file-picker__content","dialog-classes":"file-picker","navigation-classes":"file-picker__navigation",open:i.isOpen},on:{"update:open":[function(e){i.isOpen=e},i.handleClose]},scopedSlots:e._u([{key:"navigation",fn:function({isCollapsed:l}){return[t(i.FilePickerNavigation,{attrs:{"is-collapsed":l,"current-view":i.currentView,"filter-string":i.filterString,"disabled-navigation":e.disabledNavigation},on:{"update:currentView":function(e){i.currentView=e},"update:current-view":function(e){i.currentView=e},"update:filterString":function(e){i.filterString=e},"update:filter-string":function(e){i.filterString=e}}})]}}])},[t("div",{staticClass:"file-picker__main"},["files"===i.currentView?t(i.FilePickerBreadcrumbs,{attrs:{path:i.currentPath,"show-menu":e.allowPickDirectory},on:{"update:path":function(e){i.currentPath=e},"create-node":i.onCreateFolder}}):t("div",{staticClass:"file-picker__view"},[t("h3",[e._v(e._s(i.viewHeadline))])]),i.isLoading||i.filteredFiles.length>0?t(i.FileList,{attrs:{"allow-pick-directory":e.allowPickDirectory,"current-view":i.currentView,files:i.filteredFiles,multiselect:e.multiselect,loading:i.isLoading,path:i.currentPath,"selected-files":i.selectedFiles,name:i.viewHeadline},on:{"update:path":[function(e){i.currentPath=e},function(e){i.currentView="files"}],"update:selectedFiles":function(e){i.selectedFiles=e},"update:selected-files":function(e){i.selectedFiles=e}}}):i.filterString?t(i.NcEmptyContent,{attrs:{name:i.t("No matching files"),description:i.t("No files matching your filter were found.")},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconFile)]},proxy:!0}])}):t(i.NcEmptyContent,{attrs:{name:i.t("No files in here"),description:i.noFilesDescription},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconFile)]},proxy:!0}])})],1)])},Ae=[];const Be=(0,n.a)(Le,Pe,Ae,!1,null,"20b719ba").exports},76333:(e,t,i)=>{i.d(t,{AO:()=>M.N,Az:()=>o.N,B6:()=>d.N,EQ:()=>ve.N,K1:()=>ee.N,Qz:()=>V.N,R1:()=>z.N,i$:()=>j.N,lT:()=>T.N,v:()=>me.N,x1:()=>R.A,yI:()=>G.A}),i(28054);var l=i(89257),n=i(94398),a=i(30567),r=i(1790),o=i(61893),s=i(73267),c=i(17452),u=i(93806),d=i(24997),p=i(80114),f=i(32831),v=i(98060),m=i(28907),g=i(47611),h=i(10363),w=i(65321),_=i(31474),y=i(20377),b=i(57074),C=i(80329),k=i(62720),N=i(7902),S=i(56760),F=i(57174),x=i(66687),L=i(69996),P=i(85948),A=i(70029),B=i(46503),I=i(18664),z=i(62081),V=i(75556),R=i(18740),M=i(63733),D=i(81886),E=i(63536),H=i(32061),W=i(21558),K=i(77622),$=i(38205),T=i(5538),O=i(50559),Z=i(31126),j=i(51568),U=i(43041),J=i(68296),X=i(41781),G=i(34196),Q=i(78298),q=i(54157),Y=i(26517),ee=i(96338),te=i(63407),ie=i(23570),le=i(11524),ne=i(84237),ae=i(68567),re=i(80910),oe=i(53297),se=i(17622),ce=i(79742),ue=i(83157),de=i(51681),pe=i(6282),fe=i(57004),ve=(i(40708),i(37382),i(65043),i(21777),i(26710)),me=i(44960),ge=(i(61338),i(94632)),he=i(6332),we=i(64084),_e=i(88534),ye=i(34816),be=i(42740),Ce=i(35263),ke=i(86719),Ne=i(49453),Se=i(23610),Fe=(i(23020),i(53429),i(94205),i(9050),i(63534),i(42892)),xe=i(65842),Le=(i(18300),i(75105),i(92471),i(16406),i(2508));l.A,n.N,a.A,r.A,o.N,s.A,c.A,u.A,p.A,f.A,v.A,d.N,m.N,g.A,h.A,w.N,_.N,y.A,b.N,C.A,k.A,N.N,S.N,F.N,x.A,L.N,P.A,A.N,B.A,pe.N,I.N,z.N,V.N,R.A,M.N,D.N,E.N,H.N,W.N,K.N,$.N,T.N,O.A,Z.A,j.N,U.N,J.A,X.N,G.A,Q.A,q.N,Y.N,ee.N,te.A,ie.N,le.N,ne.A,de.N,ae.A,re.A,oe.N,se.N,ce.N,ue.N,pe.a,fe.N,ge.N,ve.N,he.N,we.N,_e.N,ye.N,be.A,me.N,Ce.N,ke.N,Ne.N,Se.A,Symbol.toStringTag,Fe.u,xe.u,Le.yw,Symbol.toStringTag}}]);
  2. //# sourceMappingURL=2400-2400.js.map?v=711ae667d537c9bf16c7