You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud/dist/files_versions-files_versio...

3 lines
49 KiB
JavaScript

/*! For license information please see files_versions-files_versions.js.LICENSE.txt */
(()=>{"use strict";var e,i,n,s={94023:(e,i,n)=>{var s=n(85471),r=n(53334),o=n(43627),a=n.n(o),l=n(85168),c=n(16406),d=n(61338),u=n(92457),p=n(46222),h=n(53278),f=n(63814),m=n(71089),v=n(51651),g=n(44719);const b=(0,f.dC)("dav"),A=(0,g.UU)(b),w=t=>{A.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:null!=t?t:""})};(0,u.zo)(w),w((0,u.do)());const y=A,_=(0,n(53529).YK)().setApp("files_version").detectUser().build();const C={name:"BackupRestoreIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var x=n(14486);const N=(0,x.A)(C,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon backup-restore-icon",attrs:{"aria-hidden":!t.title||null,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports;var V=n(11037);const E={name:"DownloadIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},L=(0,x.A)(E,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon download-icon",attrs:{"aria-hidden":!t.title||null,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports,k={name:"FileCompareIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},S=(0,x.A)(k,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon file-compare-icon",attrs:{"aria-hidden":!t.title||null,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M10,18H6V16H10V18M10,14H6V12H10V14M10,1V2H6C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H10V23H12V1H10M20,8V20C20,21.11 19.11,22 18,22H14V20H18V11H14V9H18.5L14,4.5V2L20,8M16,14H14V12H16V14M16,18H14V16H16V18Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports,I={name:"ImageOffOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},O=(0,x.A)(I,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon image-off-outline-icon",attrs:{"aria-hidden":!t.title||null,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M22 20.7L3.3 2L2 3.3L3 4.3V19C3 20.1 3.9 21 5 21H19.7L20.7 22L22 20.7M5 19V6.3L12.6 13.9L11.1 15.8L9 13.1L6 17H15.7L17.7 19H5M8.8 5L6.8 3H19C20.1 3 21 3.9 21 5V17.2L19 15.2V5H8.8"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports;var T=n(93919),D=n(63420),P=n(10700),H=n(41944),$=n(44559),R=n(57874),B=n(26287),F=n(38613),j=n(35810);const z=(t,e)=>0!=(t&e),M=(0,s.pM)({name:"Version",components:{NcActionLink:P.A,NcActionButton:D.A,NcAvatar:H.A,NcListItem:$.N,BackupRestore:N,Download:L,FileCompare:S,Pencil:T.A,Delete:V.A,ImageOffOutline:O},directives:{tooltip:R.A},created(){this.fetchDisplayName()},filters:{humanReadableSize:t=>(0,j.v7)(t),humanDateFromNow:t=>(0,v.A)(t).fromNow()},props:{version:{type:Object,required:!0},fileInfo:{type:Object,required:!0},isCurrent:{type:Boolean,default:!1},isFirstVersion:{type:Boolean,default:!1},loadPreview:{type:Boolean,default:!1},canView:{type:Boolean,default:!1},canCompare:{type:Boolean,default:!1}},emits:["click","compare","restore","delete","label-update-request"],data:()=>({previewLoaded:!1,previewErrored:!1,capabilities:(0,F.C)("core","capabilities",{files:{version_labeling:!1,version_deletion:!1}}),versionAuthor:""}),computed:{versionLabel(){var t;const e=null!==(t=this.version.label)&&void 0!==t?t:"";return this.isCurrent?""===e?(0,r.Tl)("files_versions","Current version"):"".concat(e," (").concat((0,r.Tl)("files_versions","Current version"),")"):this.isFirstVersion&&""===e?(0,r.Tl)("files_versions","Initial version"):e},downloadURL(){return this.isCurrent?(0,f.aU)()+(0,m.HS)("/remote.php/webdav",this.fileInfo.path,this.fileInfo.name):(0,f.aU)()+this.version.url},formattedDate(){return(0,v.A)(this.version.mtime).format("LLL")},enableLabeling(){return!0===this.capabilities.files.version_labeling},enableDeletion(){return!0===this.capabilities.files.version_deletion},hasDeletePermissions(){return z(this.fileInfo.permissions,j.aX.DELETE)},hasUpdatePermissions(){return z(this.fileInfo.permissions,j.aX.UPDATE)},isDownloadable(){if(0==(this.fileInfo.permissions&j.aX.READ))return!1;if("shared"===this.fileInfo.mountType){const t=this.fileInfo.shareAttributes.find((t=>"permissions"===t.scope&&"download"===t.key))||{};if(!1===(null==t?void 0:t.enabled))return!1}return!0}},methods:{labelUpdate(){this.$emit("label-update-request")},restoreVersion(){this.$emit("restore",this.version)},async deleteVersion(){await this.$nextTick(),await this.$nextTick(),this.$emit("delete",this.version)},async fetchDisplayName(){if(this.version.author)try{const{data:t}=await B.A.get((0,f.KT)("/cloud/users/".concat(this.version.author)));this.versionAuthor=t.ocs.data.displayname}catch(t){this.versionAuthor=null}},click(){this.canView?this.$emit("click",{version:this.version}):window.location=this.downloadURL},compareVersion(){if(!this.canView)throw new Error("Cannot compare version of this file");this.$emit("compare",{version:this.version})},t:r.Tl}});var U=n(85072),q=n.n(U),W=n(97825),G=n.n(W),K=n(77659),Y=n.n(K),X=n(55056),Z=n.n(X),Q=n(10540),J=n.n(Q),tt=n(41113),et=n.n(tt),it=n(2301),nt={};nt.styleTagTransform=et(),nt.setAttributes=Z(),nt.insert=Y().bind(null,"head"),nt.domAPI=G(),nt.insertStyleElement=J(),q()(it.A,nt),it.A&&it.A.locals&&it.A.locals;const st=(0,x.A)(M,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("NcListItem",{staticClass:"version",attrs:{"force-display-actions":!0,"data-files-versions-version":t.version.fileVersion},on:{click:t.click},scopedSlots:t._u([{key:"icon",fn:function(){return[t.loadPreview||t.previewLoaded?!t.isCurrent&&!t.version.hasPreview||t.previewErrored?e("div",{staticClass:"version__image"},[e("ImageOffOutline",{attrs:{size:20}})],1):e("img",{staticClass:"version__image",attrs:{src:t.version.previewUrl,alt:"",decoding:"async",fetchpriority:"low",loading:"lazy"},on:{load:function(e){t.previewLoaded=!0},error:function(e){t.previewErrored=!0}}}):e("div",{staticClass:"version__image"})]},proxy:!0},{key:"name",fn:function(){return[e("div",{staticClass:"version__info"},[t.versionLabel?e("div",{staticClass:"version__info__label"},[t._v(t._s(t.versionLabel))]):t._e(),t._v(" "),t.versionAuthor?e("div",{staticClass:"version__info"},[t.versionLabel?e("div",[t._v("•")]):t._e(),t._v(" "),e("NcAvatar",{staticClass:"avatar",attrs:{user:t.version.author,size:16,"disable-menu":!0,"disable-tooltip":!0,"show-user-status":!1}}),t._v(" "),e("div",[t._v(t._s(t.versionAuthor))])],1):t._e()])]},proxy:!0},{key:"subname",fn:function(){return[e("div",{staticClass:"version__info version__info__subline"},[e("span",{attrs:{title:t.formattedDate}},[t._v(t._s(t._f("humanDateFromNow")(t.version.mtime)))]),t._v(" "),e("span",[t._v("•")]),t._v(" "),e("span",[t._v(t._s(t._f("humanReadableSize")(t.version.size)))])])]},proxy:!0},{key:"actions",fn:function(){return[t.enableLabeling&&t.hasUpdatePermissions?e("NcActionButton",{attrs:{"data-cy-files-versions-version-action":"label","close-after-click":!0},on:{click:t.labelUpdate},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Pencil",{attrs:{size:22}})]},proxy:!0}],null,!1,3072546167)},[t._v("\n\t\t\t"+t._s(""===t.version.label?t.t("files_versions","Name this version"):t.t("files_versions","Edit version name"))+"\n\t\t")]):t._e(),t._v(" "),!t.isCurrent&&t.canView&&t.canCompare?e("NcActionButton",{attrs:{"data-cy-files-versions-version-action":"compare","close-after-click":!0},on:{click:t.compareVersion},scopedSlots:t._u([{key:"icon",fn:function(){return[e("FileCompare",{attrs:{size:22}})]},proxy:!0}],null,!1,1958207595)},[t._v("\n\t\t\t"+t._s(t.t("files_versions","Compare to current version"))+"\n\t\t")]):t._e(),t._v(" "),!t.isCurrent&&t.hasUpdatePermissions?e("NcActionButton",{attrs:{"data-cy-files-versions-version-action":"restore","close-after-click":!0},on:{click:t.restoreVersion},scopedSlots:t._u([{key:"icon",fn:function(){return[e("BackupRestore",{attrs:{size:22}})]},proxy:!0}],null,!1,2239038444)},[t._v("\n\t\t\t"+t._s(t.t("files_versions","Restore version"))+"\n\t\t")]):t._e(),t._v(" "),t.isDownloadable?e("NcActionLink",{attrs:{"data-cy-files-versions-version-action":"download",href:t.downloadURL,"close-after-click":!0,download:t.downloadURL},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Download",{attrs:{size:22}})]},proxy:!0}],null,!1,927269758)},[t._v("\n\t\t\t"+t._s(t.t("files_versions","Download version"))+"\n\t\t")]):t._e(),t._v(" "),!t.isCurrent&&t.enableDeletion&&t.hasDeletePermissions?e("NcActionButton",{attrs:{"data-cy-files-versions-version-action":"delete","close-after-click":!0},on:{click:t.deleteVersion},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Delete",{attrs:{size:22}})]},proxy:!0}],null,!1,2429175571)},[t._v("\n\t\t\t"+t._s(t.t("files_versions","Delete version"))+"\n\t\t")]):t._e()]},proxy:!0}])})}),[],!1,null,"d575acfe",null).exports,rt=(0,s.pM)({name:"VirtualScrolling",props:{sections:{type:Array,required:!0},containerElement:{type:HTMLElement,default:null},useWindow:{type:Boolean,default:!1},headerHeight:{type:Number,default:75},renderDistance:{type:Number,default:.5},bottomBufferRatio:{type:Number,default:2},scrollToKey:{type:String,default:""}},data:()=>({scrollPosition:0,containerHeight:0,rowsContainerHeight:0,resizeObserver:null}),computed:{visibleSections(){_.debug("[VirtualScrolling] Computing visible section",{sections:this.sections});const t=this.containerHeight,e=this.scrollPosition,i=e+t;let n=0,s=0;const r=this.sections.map((r=>(s+=this.headerHeight,{...r,rows:r.rows.reduce(((r,o)=>{n=s,s+=o.height;let a=0;return s<e?a=(e-s)/t:n>i&&(a=(n-i)/t),a>this.renderDistance?r:[...r,{...o,distance:a}]}),[])}))).filter((t=>t.rows.length>0)),o=r.flatMap((t=>{let{rows:e}=t;return e})).flatMap((t=>{let{items:e}=t;return e})),a=this._rowIdToKeyMap;o.forEach((t=>t.key=a[t.id]));const l=o.map((t=>{let{key:e}=t;return e})).filter((t=>void 0!==t)),c=Object.values(a).filter((t=>!l.includes(t)));return o.filter((t=>{let{key:e}=t;return void 0===e})).forEach((t=>{var e;return t.key=null!==(e=c.pop())&&void 0!==e?e:Math.random().toString(36).substr(2)})),this._rowIdToKeyMap=o.reduce(((t,e)=>{let{id:i,key:n}=e;return{...t,["".concat(i)]:n}}),{}),r},totalHeight(){return this.sections.map((t=>this.headerHeight+t.height)).reduce(((t,e)=>t+e),0)+0},paddingTop(){if(0===this.visibleSections.length)return 0;let t=0;for(const e of this.sections)if(e.key===this.visibleSections[0].rows[0].sectionKey){for(const i of e.rows){if(i.key===this.visibleSections[0].rows[0].key)return t;t+=i.height}t+=this.headerHeight}else t+=this.headerHeight+e.height;return t},rowsContainerStyle(){return{height:"".concat(this.totalHeight,"px"),paddingTop:"".concat(this.paddingTop,"px")}},isNearBottom(){const t=this.containerHeight*this.bottomBufferRatio;return this.scrollPosition+this.containerHeight>=this.totalHeight-t},container(){return _.debug("[VirtualScrolling] Computing container"),null!==this.containerElement?this.containerElement:this.useWindow?window:this.$refs.container}},watch:{isNearBottom(t){_.debug("[VirtualScrolling] isNearBottom changed",{value:t}),t&&this.$emit("need-content")},visibleSections(){this.isNearBottom&&this.$emit("need-content")},scrollToKey(t){let e=0;for(const i of this.sections){if(i.key===t)break;e+=this.headerHeight+i.height}_.debug("[VirtualScrolling] Scrolling to",{currentRowTopDistanceFromTop:e}),this.container.scrollTo({top:e,behavior:"smooth"})}},beforeCreate(){this._rowIdToKeyMap={}},mounted(){this.resizeObserver=new ResizeObserver((t=>{for(const e of t){const t=e.contentRect;e.target===this.container&&(this.containerHeight=t.height),e.target.classList.contains("vs-rows-container")&&(this.rowsContainerHeight=t.height)}})),this.useWindow?(window.addEventListener("resize",this.updateContainerSize,{passive:!0}),this.containerHeight=window.innerHeight):this.resizeObserver.observe(this.container),this.resizeObserver.observe(this.$refs.rowsContainer),this.container.addEventListener("scroll",this.updateScrollPosition,{passive:!0})},beforeDestroy(){var t;this.useWindow&&window.removeEventListener("resize",this.updateContainerSize),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),this.container.removeEventListener("scroll",this.updateScrollPosition)},methods:{updateScrollPosition(){var t;null!==(t=this._onScrollHandle)&&void 0!==t||(this._onScrollHandle=requestAnimationFrame((()=>{this._onScrollHandle=null,this.useWindow?this.scrollPosition=this.container.scrollY:this.scrollPosition=this.container.scrollTop})))},updateContainerSize(){this.containerHeight=window.innerHeight}}});var ot=n(6659),at={};at.styleTagTransform=et(),at.setAttributes=Z(),at.insert=Y().bind(null,"head"),at.domAPI=G(),at.insertStyleElement=J(),q()(ot.A,at),ot.A&&ot.A.locals&&ot.A.locals;const lt=(0,x.A)(rt,(function(){var t=this,e=t._self._c;return t._self._setupProxy,t.useWindow||null!==t.containerElement?e("div",{ref:"rowsContainer",staticClass:"vs-rows-container",style:t.rowsContainerStyle},[t._t("default",null,{visibleSections:t.visibleSections}),t._v(" "),t._t("loader")],2):e("div",{ref:"container",staticClass:"vs-container"},[e("div",{ref:"rowsContainer",staticClass:"vs-rows-container",style:t.rowsContainerStyle},[t._t("default",null,{visibleSections:t.visibleSections}),t._v(" "),t._t("loader")],2)])}),[],!1,null,"11dbbae6",null).exports;var ct=n(85338),dt=n(9518),ut=n(82182);const pt=(0,s.pM)({name:"VersionLabelForm",components:{NcButton:dt.A,NcTextField:ut.A,Check:ct.A},props:{versionLabel:{type:String,default:""}},data(){return{innerVersionLabel:this.versionLabel}},mounted(){this.$nextTick((()=>{this.$refs.labelInput.$el.getElementsByTagName("input")[0].focus()}))},methods:{setVersionLabel(t){this.$emit("label-update",t)},t:r.Tl}});var ht=n(43100),ft={};ft.styleTagTransform=et(),ft.setAttributes=Z(),ft.insert=Y().bind(null,"head"),ft.domAPI=G(),ft.insertStyleElement=J(),q()(ht.A,ft),ht.A&&ht.A.locals&&ht.A.locals;const mt={name:"VersionTab",components:{Version:st,VirtualScrolling:lt,VersionLabelForm:(0,x.A)(pt,(function(){var t=this,e=t._self._c;return t._self._setupProxy,e("form",{staticClass:"version-label-modal",on:{submit:function(e){return e.preventDefault(),t.setVersionLabel(t.innerVersionLabel)}}},[e("label",[e("div",{staticClass:"version-label-modal__title"},[t._v(t._s(t.t("files_versions","Version name")))]),t._v(" "),e("NcTextField",{ref:"labelInput",attrs:{value:t.innerVersionLabel,placeholder:t.t("files_versions","Version name"),"label-outside":!0},on:{"update:value":function(e){t.innerVersionLabel=e}}})],1),t._v(" "),e("div",{staticClass:"version-label-modal__info"},[t._v("\n\t\t"+t._s(t.t("files_versions","Named versions are persisted, and excluded from automatic cleanups when your storage quota is full."))+"\n\t")]),t._v(" "),e("div",{staticClass:"version-label-modal__actions"},[e("NcButton",{attrs:{disabled:0===t.innerVersionLabel.trim().length},on:{click:function(e){return t.setVersionLabel("")}}},[t._v("\n\t\t\t"+t._s(t.t("files_versions","Remove version name"))+"\n\t\t")]),t._v(" "),e("NcButton",{attrs:{type:"primary","native-type":"submit"},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Check")]},proxy:!0}])},[t._v("\n\t\t\t"+t._s(t.t("files_versions","Save version name"))+"\n\t\t")])],1)])}),[],!1,null,"58311f0c",null).exports,NcLoadingIcon:p.A,NcModal:h.A},mixins:[c.A],data:()=>({fileInfo:null,isActive:!1,versions:[],loading:!1,showVersionLabelForm:!1}),computed:{sections(){return[{key:"versions",rows:this.orderedVersions.map((t=>({key:t.mtime,height:68,sectionKey:"versions",items:[t]}))),height:68*this.orderedVersions.length}]},orderedVersions(){return[...this.versions].sort(((t,e)=>t.mtime===this.fileInfo.mtime?-1:e.mtime===this.fileInfo.mtime?1:e.mtime-t.mtime))},initialVersionMtime(){return this.versions.map((t=>t.mtime)).reduce(((t,e)=>Math.min(t,e)))},viewerFileInfo(){let t="";return 1&this.fileInfo.permissions&&(t+="R"),2&this.fileInfo.permissions&&(t+="W"),8&this.fileInfo.permissions&&(t+="D"),{...this.fileInfo,mime:this.fileInfo.mimetype,basename:this.fileInfo.name,filename:this.fileInfo.path+"/"+this.fileInfo.name,permissions:t,fileid:this.fileInfo.id}},canView(){var t;return null===(t=window.OCA.Viewer)||void 0===t||null===(t=t.mimetypesCompare)||void 0===t?void 0:t.includes(this.fileInfo.mimetype)},canCompare(){return!this.isMobile}},mounted(){(0,d.B1)("files_versions:restore:restored",this.fetchVersions)},beforeUnmount(){(0,d.al)("files_versions:restore:restored",this.fetchVersions)},methods:{async update(t){this.fileInfo=t,this.resetState(),this.fetchVersions()},async setIsActive(t){this.isActive=t},async fetchVersions(){try{this.loading=!0,this.versions=await async function(t){var e;const i="/versions/".concat(null===(e=(0,u.HW)())||void 0===e?void 0:e.uid,"/versions/").concat(t.id);try{return(await y.getDirectoryContents(i,{data:'<?xml version="1.0"?>\n<d:propfind xmlns:d="DAV:"\n\txmlns:oc="http://owncloud.org/ns"\n\txmlns:nc="http://nextcloud.org/ns"\n\txmlns:ocs="http://open-collaboration-services.org/ns">\n\t<d:prop>\n\t\t<d:getcontentlength />\n\t\t<d:getcontenttype />\n\t\t<d:getlastmodified />\n\t\t<d:getetag />\n\t\t<nc:version-label />\n\t\t<nc:version-author />\n\t\t<nc:has-preview />\n\t</d:prop>\n</d:propfind>',details:!0})).data.filter((t=>{let{mime:e}=t;return""!==e})).map((e=>function(t,e){var i;const n=1e3*(0,v.A)(t.lastmod).unix();let s="";return s=n===e.mtime?(0,f.Jv)("/core/preview?fileId={fileId}&c={fileEtag}&x=250&y=250&forceIcon=0&a=0",{fileId:e.id,fileEtag:e.etag}):(0,f.Jv)("/apps/files_versions/preview?file={file}&version={fileVersion}",{file:(0,m.HS)(e.path,e.name),fileVersion:t.basename}),{fileId:e.id,label:t.props["version-label"],author:null!==(i=t.props["version-author"])&&void 0!==i?i:null,filename:t.filename,basename:(0,v.A)(n).format("LLL"),mime:t.mime,etag:"".concat(t.props.getetag),size:t.size,type:t.type,mtime:n,permissions:"R",hasPreview:1===t.props["has-preview"],previewUrl:s,url:(0,m.HS)("/remote.php/dav",t.filename),source:(0,f.dC)("dav")+(0,m.O0)(t.filename),fileVersion:t.basename}}(e,t)))}catch(t){throw _.error("Could not fetch version",{exception:t}),t}}(this.fileInfo)}finally{this.loading=!1}},async handleRestore(e){const i=this.fileInfo;this.fileInfo={...this.fileInfo,size:e.size,mtime:e.mtime};const n={preventDefault:!1,fileInfo:this.fileInfo,version:e};if((0,d.Ic)("files_versions:restore:requested",n),!n.preventDefault)try{await async function(t){try{var e,i;_.debug("Restoring version",{url:t.url}),await y.moveFile("/versions/".concat(null===(e=(0,u.HW)())||void 0===e?void 0:e.uid,"/versions/").concat(t.fileId,"/").concat(t.fileVersion),"/versions/".concat(null===(i=(0,u.HW)())||void 0===i?void 0:i.uid,"/restore/target"))}catch(t){throw _.error("Could not restore version",{exception:t}),t}}(e),""!==e.label?(0,l.Te)(t("files_versions","".concat(e.label," restored"))):e.mtime===this.initialVersionMtime?(0,l.Te)(t("files_versions","Initial version restored")):(0,l.Te)(t("files_versions","Version restored")),(0,d.Ic)("files_versions:restore:restored",e)}catch(n){this.fileInfo=i,(0,l.Qg)(t("files_versions","Could not restore version")),(0,d.Ic)("files_versions:restore:failed",e)}},handleLabelUpdateRequest(t){this.showVersionLabelForm=!0,this.editedVersion=t},async handleLabelUpdate(t){const e=this.editedVersion.label;this.editedVersion.label=t,this.showVersionLabelForm=!1;try{await async function(t,e){return await y.customRequest(t.filename,{method:"PROPPATCH",data:'<?xml version="1.0"?>\n\t\t\t\t\t<d:propertyupdate xmlns:d="DAV:"\n\t\t\t\t\t\txmlns:oc="http://owncloud.org/ns"\n\t\t\t\t\t\txmlns:nc="http://nextcloud.org/ns"\n\t\t\t\t\t\txmlns:ocs="http://open-collaboration-services.org/ns">\n\t\t\t\t\t<d:set>\n\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t<nc:version-label>'.concat(e,"</nc:version-label>\n\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t</d:set>\n\t\t\t\t\t</d:propertyupdate>")})}(this.editedVersion,t),this.editedVersion=null}catch(t){this.editedVersion.label=e,(0,l.Qg)(this.t("files_versions","Could not set version label")),logger.error("Could not set version label",{exception:t})}},async handleDelete(e){const i=this.versions.indexOf(e);this.versions.splice(i,1);try{await async function(t){await y.deleteFile(t.filename)}(e)}catch(i){this.versions.push(e),(0,l.Qg)(t("files_versions","Could not delete version"))}},resetState(){this.$set(this,"versions",[])},openVersion(t){let{version:e}=t;if(e.mtime===this.fileInfo.mtime)return void OCA.Viewer.open({fileInfo:this.viewerFileInfo});const i=this.versions.map((t=>{var e,i;return{...t,filename:t.mtime===this.fileInfo.mtime?a().join("files",null!==(e=null===(i=(0,u.HW)())||void 0===i?void 0:i.uid)&&void 0!==e?e:"",this.fileInfo.path,this.fileInfo.name):t.filename,hasPreview:!1,previewUrl:void 0}}));OCA.Viewer.open({fileInfo:i.find((t=>t.source===e.source)),enableSidebar:!1})},compareVersion(t){let{version:e}=t;const i=this.versions.map((t=>({...t,hasPreview:!1,previewUrl:void 0})));OCA.Viewer.compare(this.viewerFileInfo,i.find((t=>t.source===e.source)))}}};var vt=n(11507),gt={};gt.styleTagTransform=et(),gt.setAttributes=Z(),gt.insert=Y().bind(null,"head"),gt.domAPI=G(),gt.insertStyleElement=J(),q()(vt.A,gt),vt.A&&vt.A.locals&&vt.A.locals;const bt=(0,x.A)(mt,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"versions-tab__container"},[e("VirtualScrolling",{attrs:{sections:t.sections,"header-height":0},scopedSlots:t._u([{key:"default",fn:function(i){let{visibleSections:n}=i;return[e("ul",{attrs:{"data-files-versions-versions-list":""}},[1===n.length?t._l(n[0].rows,(function(i){return e("Version",{key:i.items[0].mtime,attrs:{"can-view":t.canView,"can-compare":t.canCompare,"load-preview":t.isActive,version:i.items[0],"file-info":t.fileInfo,"is-current":i.items[0].mtime===t.fileInfo.mtime,"is-first-version":i.items[0].mtime===t.initialVersionMtime},on:{click:t.openVersion,compare:t.compareVersion,restore:t.handleRestore,"label-update-request":function(e){return t.handleLabelUpdateRequest(i.items[0])},delete:t.handleDelete}})})):t._e()],2)]}}])},[t._v(" "),t.loading?e("NcLoadingIcon",{staticClass:"files-list-viewer__loader",attrs:{slot:"loader"},slot:"loader"}):t._e()],1),t._v(" "),t.showVersionLabelForm?e("NcModal",{attrs:{title:t.t("files_versions","Name this version")},on:{close:function(e){t.showVersionLabelForm=!1}}},[e("VersionLabelForm",{attrs:{"version-label":t.editedVersion.label},on:{"label-update":t.handleLabelUpdate}})],1):t._e()],1)}),[],!1,null,null,null).exports;var At=n(80284);s.Ay.prototype.t=r.Tl,s.Ay.prototype.n=r.zw,s.Ay.use(At.Ay);const wt=s.Ay.extend(bt);let yt=null;window.addEventListener("DOMContentLoaded",(function(){var t;void 0!==(null===(t=OCA.Files)||void 0===t?void 0:t.Sidebar)&&OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab({id:"version_vue",name:(0,r.Tl)("files_versions","Versions"),iconSvg:'<svg xmlns="http://www.w3.org/2000/svg" id="mdi-backup-restore" viewBox="0 0 24 24"><path d="M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z" /></svg>',async mount(t,e,i){yt&&yt.$destroy(),yt=new wt({parent:i}),await yt.update(e),yt.$mount(t)},update(t){yt.update(t)},setIsActive(t){yt&&yt.setIsActive(t)},destroy(){yt.$destroy(),yt=null},enabled(t){var e;return!(null===(e=null==t?void 0:t.isDirectory())||void 0===e||e)}}))}))},2301:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(71354),s=i.n(n),r=i(76314),o=i.n(r)()(s());o.push([t.id,".version[data-v-d575acfe]{display:flex;flex-direction:row}.version__info[data-v-d575acfe]{display:flex;flex-direction:row;align-items:center;gap:.5rem;color:var(--color-main-text);font-weight:500}.version__info__label[data-v-d575acfe]{font-weight:700}.version__info__subline[data-v-d575acfe]{color:var(--color-text-maxcontrast)}.version__image[data-v-d575acfe]{width:3rem;height:3rem;border:1px solid var(--color-border);border-radius:var(--border-radius-large);display:flex;justify-content:center;color:var(--color-text-light)}","",{version:3,sources:["webpack://./apps/files_versions/src/components/Version.vue"],names:[],mappings:"AACA,0BACC,YAAA,CACA,kBAAA,CAEA,gCACC,YAAA,CACA,kBAAA,CACA,kBAAA,CACA,SAAA,CACA,4BAAA,CACA,eAAA,CAEA,uCACC,eAAA,CAGD,yCACA,mCAAA,CAID,iCACC,UAAA,CACA,WAAA,CACA,oCAAA,CACA,wCAAA,CAGA,YAAA,CACA,sBAAA,CACA,6BAAA",sourcesContent:["\n.version {\n\tdisplay: flex;\n\tflex-direction: row;\n\n\t&__info {\n\t\tdisplay: flex;\n\t\tflex-direction: row;\n\t\talign-items: center;\n\t\tgap: 0.5rem;\n\t\tcolor: var(--color-main-text);\n\t\tfont-weight: 500;\n\n\t\t&__label {\n\t\t\tfont-weight: 700;\n\t\t}\n\n\t\t&__subline {\n\t\tcolor: var(--color-text-maxcontrast)\n\t}\n\t}\n\n\t&__image {\n\t\twidth: 3rem;\n\t\theight: 3rem;\n\t\tborder: 1px solid var(--color-border);\n\t\tborder-radius: var(--border-radius-large);\n\n\t\t// Useful to display no preview icon.\n\t\tdisplay: flex;\n\t\tjustify-content: center;\n\t\tcolor: var(--color-text-light);\n\t}\n}\n"],sourceRoot:""}]);const a=o},43100:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(71354),s=i.n(n),r=i(76314),o=i.n(r)()(s());o.push([t.id,".version-label-modal[data-v-58311f0c]{display:flex;justify-content:space-between;flex-direction:column;height:250px;padding:16px}.version-label-modal__title[data-v-58311f0c]{margin-bottom:12px;font-weight:600}.version-label-modal__info[data-v-58311f0c]{margin-top:12px;color:var(--color-text-maxcontrast)}.version-label-modal__actions[data-v-58311f0c]{display:flex;justify-content:space-between;margin-top:64px}","",{version:3,sources:["webpack://./apps/files_versions/src/components/VersionLabelForm.vue"],names:[],mappings:"AACA,sCACC,YAAA,CACA,6BAAA,CACA,qBAAA,CACA,YAAA,CACA,YAAA,CAEA,6CACC,kBAAA,CACA,eAAA,CAGD,4CACC,eAAA,CACA,mCAAA,CAGD,+CACC,YAAA,CACA,6BAAA,CACA,eAAA",sourcesContent:["\n.version-label-modal {\n\tdisplay: flex;\n\tjustify-content: space-between;\n\tflex-direction: column;\n\theight: 250px;\n\tpadding: 16px;\n\n\t&__title {\n\t\tmargin-bottom: 12px;\n\t\tfont-weight: 600;\n\t}\n\n\t&__info {\n\t\tmargin-top: 12px;\n\t\tcolor: var(--color-text-maxcontrast);\n\t}\n\n\t&__actions {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tmargin-top: 64px;\n\t}\n}\n"],sourceRoot:""}]);const a=o},6659:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(71354),s=i.n(n),r=i(76314),o=i.n(r)()(s());o.push([t.id,".vs-container[data-v-11dbbae6]{overflow-y:scroll;height:100%}.vs-rows-container[data-v-11dbbae6]{box-sizing:border-box;will-change:scroll-position,padding;contain:layout paint style}","",{version:3,sources:["webpack://./apps/files_versions/src/components/VirtualScrolling.vue"],names:[],mappings:"AACA,+BACC,iBAAA,CACA,WAAA,CAGD,oCACC,qBAAA,CACA,mCAAA,CACA,0BAAA",sourcesContent:["\n.vs-container {\n\toverflow-y: scroll;\n\theight: 100%;\n}\n\n.vs-rows-container {\n\tbox-sizing: border-box;\n\twill-change: scroll-position, padding;\n\tcontain: layout paint style;\n}\n"],sourceRoot:""}]);const a=o},11507:(t,e,i)=>{i.d(e,{A:()=>a});var n=i(71354),s=i.n(n),r=i(76314),o=i.n(r)()(s());o.push([t.id,".versions-tab__container{height:100%}","",{version:3,sources:["webpack://./apps/files_versions/src/views/VersionTab.vue"],names:[],mappings:"AACA,yBACC,WAAA",sourcesContent:["\n.versions-tab__container {\n\theight: 100%;\n}\n"],sourceRoot:""}]);const a=o},35810:(t,e,i)=>{i.d(e,{Al:()=>T,H4:()=>I,PY:()=>S,Q$:()=>O,R3:()=>y,VL:()=>w,aX:()=>m,lJ:()=>k,pt:()=>_,v7:()=>f});var n,s=i(92457),r=i(53529),o=i(53334),a=i(43627),l=i(71089),c=i(63814),d=i(44719),u=i(36117);null===(n=(0,s.HW)())?(0,r.YK)().setApp("files").build():(0,r.YK)().setApp("files").setUid(n.uid).build();const p=["B","KB","MB","GB","TB","PB"],h=["B","KiB","MiB","GiB","TiB","PiB"];function f(t,e=!1,i=!1,n=!1){i=i&&!n,"string"==typeof t&&(t=Number(t));let s=t>0?Math.floor(Math.log(t)/Math.log(n?1e3:1024)):0;s=Math.min((i?h.length:p.length)-1,s);const r=i?h[s]:p[s];let a=(t/Math.pow(n?1e3:1024,s)).toFixed(1);return!0===e&&0===s?("0.0"!==a?"< 1 ":"0 ")+(i?h[1]:p[1]):(a=s<2?parseFloat(a).toFixed(0):parseFloat(a).toLocaleString((0,o.lO)()),a+" "+r)}var m=(t=>(t[t.NONE=0]="NONE",t[t.CREATE=4]="CREATE",t[t.READ=1]="READ",t[t.UPDATE=2]="UPDATE",t[t.DELETE=8]="DELETE",t[t.SHARE=16]="SHARE",t[t.ALL=31]="ALL",t))(m||{});const v=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],g={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},b=function(){return typeof window._nc_dav_properties>"u"&&(window._nc_dav_properties=[...v]),window._nc_dav_properties.map((t=>`<${t} />`)).join(" ")},A=function(){return typeof window._nc_dav_namespaces>"u"&&(window._nc_dav_namespaces={...g}),Object.keys(window._nc_dav_namespaces).map((t=>`xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`)).join(" ")},w=function(){return`<?xml version="1.0"?>\n\t\t<d:propfind ${A()}>\n\t\t\t<d:prop>\n\t\t\t\t${b()}\n\t\t\t</d:prop>\n\t\t</d:propfind>`},y=function(t){return`<?xml version="1.0" encoding="UTF-8"?>\n<d:searchrequest ${A()}\n\txmlns:ns="https://github.com/icewind1991/SearchDAV/ns">\n\t<d:basicsearch>\n\t\t<d:select>\n\t\t\t<d:prop>\n\t\t\t\t${b()}\n\t\t\t</d:prop>\n\t\t</d:select>\n\t\t<d:from>\n\t\t\t<d:scope>\n\t\t\t\t<d:href>/files/${(0,s.HW)()?.uid}/</d:href>\n\t\t\t\t<d:depth>infinity</d:depth>\n\t\t\t</d:scope>\n\t\t</d:from>\n\t\t<d:where>\n\t\t\t<d:and>\n\t\t\t\t<d:or>\n\t\t\t\t\t<d:not>\n\t\t\t\t\t\t<d:eq>\n\t\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t\t<d:getcontenttype/>\n\t\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t\t<d:literal>httpd/unix-directory</d:literal>\n\t\t\t\t\t\t</d:eq>\n\t\t\t\t\t</d:not>\n\t\t\t\t\t<d:eq>\n\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t<oc:size/>\n\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t<d:literal>0</d:literal>\n\t\t\t\t\t</d:eq>\n\t\t\t\t</d:or>\n\t\t\t\t<d:gt>\n\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t<d:getlastmodified/>\n\t\t\t\t\t</d:prop>\n\t\t\t\t\t<d:literal>${t}</d:literal>\n\t\t\t\t</d:gt>\n\t\t\t</d:and>\n\t\t</d:where>\n\t\t<d:orderby>\n\t\t\t<d:order>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<d:getlastmodified/>\n\t\t\t\t</d:prop>\n\t\t\t\t<d:descending/>\n\t\t\t</d:order>\n\t\t</d:orderby>\n\t\t<d:limit>\n\t\t\t<d:nresults>100</d:nresults>\n\t\t\t<ns:firstresult>0</ns:firstresult>\n\t\t</d:limit>\n\t</d:basicsearch>\n</d:searchrequest>`};var _=(t=>(t.Folder="folder",t.File="file",t))(_||{});const C=function(t,e){return null!==t.match(e)},x=(t,e)=>{if(t.id&&"number"!=typeof t.id)throw new Error("Invalid id type of value");if(!t.source)throw new Error("Missing mandatory source");try{new URL(t.source)}catch{throw new Error("Invalid source format, source must be a valid URL")}if(!t.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(t.mtime&&!(t.mtime instanceof Date))throw new Error("Invalid mtime type");if(t.crtime&&!(t.crtime instanceof Date))throw new Error("Invalid crtime type");if(!t.mime||"string"!=typeof t.mime||!t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in t&&"number"!=typeof t.size&&void 0!==t.size)throw new Error("Invalid size type");if("permissions"in t&&void 0!==t.permissions&&!("number"==typeof t.permissions&&t.permissions>=m.NONE&&t.permissions<=m.ALL))throw new Error("Invalid permissions");if(t.owner&&null!==t.owner&&"string"!=typeof t.owner)throw new Error("Invalid owner type");if(t.attributes&&"object"!=typeof t.attributes)throw new Error("Invalid attributes type");if(t.root&&"string"!=typeof t.root)throw new Error("Invalid root type");if(t.root&&!t.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(t.root&&!t.source.includes(t.root))throw new Error("Root must be part of the source");if(t.root&&C(t.source,e)){const i=t.source.match(e)[0];if(!t.source.includes((0,a.join)(i,t.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(t.status&&!Object.values(N).includes(t.status))throw new Error("Status must be a valid NodeStatus")};var N=(t=>(t.NEW="new",t.FAILED="failed",t.LOADING="loading",t.LOCKED="locked",t))(N||{});class V{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;constructor(t,e){x(t,e||this._knownDavService),this._data=t;const i={set:(t,e,i)=>(this.updateMtime(),Reflect.set(t,e,i)),deleteProperty:(t,e)=>(this.updateMtime(),Reflect.deleteProperty(t,e))};this._attributes=new Proxy(t.attributes||{},i),delete this._data.attributes,e&&(this._knownDavService=e)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:t}=new URL(this.source);return t+(0,l.O0)(this.source.slice(t.length))}get basename(){return(0,a.basename)(this.source)}get extension(){return(0,a.extname)(this.source)}get dirname(){if(this.root){let t=this.source;this.isDavRessource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),i=this.root.replace(/\/$/,"");return(0,a.dirname)(t.slice(e+i.length)||"/")}const t=new URL(this.source);return(0,a.dirname)(t.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}get crtime(){return this._data.crtime}get size(){return this._data.size}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:m.NONE:m.READ}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return C(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,a.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let t=this.source;this.isDavRessource&&(t=t.split(this._knownDavService).pop());const e=t.indexOf(this.root),i=this.root.replace(/\/$/,"");return t.slice(e+i.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id||this.attributes?.fileid}get status(){return this._data?.status}set status(t){this._data.status=t}move(t){x({...this._data,source:t},this._knownDavService),this._data.source=t,this.updateMtime()}rename(t){if(t.includes("/"))throw new Error("Invalid basename");this.move((0,a.dirname)(this.source)+"/"+t)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}}class E extends V{get type(){return _.File}}class L extends V{constructor(t){super({...t,mime:"httpd/unix-directory"})}get type(){return _.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}const k=`/files/${(0,s.HW)()?.uid}`,S=(0,c.dC)("dav"),I=function(t=S,e={}){const i=(0,d.UU)(t,{headers:e});function n(t){i.setHeaders({...e,"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})}return(0,s.zo)(n),n((0,s.do)()),(0,d.Gu)().patch("fetch",((t,e)=>{const i=e.headers;return i?.method&&(e.method=i.method,delete i.method),fetch(t,e)})),i},O=(t,e="/",i=k)=>{const n=new AbortController;return new u.CancelablePromise((async(s,r,o)=>{o((()=>n.abort()));try{s((await t.getDirectoryContents(`${i}${e}`,{signal:n.signal,details:!0,data:`<?xml version="1.0"?>\n\t\t<oc:filter-files ${A()}>\n\t\t\t<d:prop>\n\t\t\t\t${b()}\n\t\t\t</d:prop>\n\t\t\t<oc:filter-rules>\n\t\t\t\t<oc:favorite>1</oc:favorite>\n\t\t\t</oc:filter-rules>\n\t\t</oc:filter-files>`,headers:{method:"REPORT"},includeSelf:!0})).data.filter((t=>t.filename!==e)).map((t=>T(t,i))))}catch(t){r(t)}}))},T=function(t,e=k,i=S){const n=(0,s.HW)()?.uid;if(!n)throw new Error("No user id found");const r=t.props,o=function(t=""){let e=m.NONE;return t&&((t.includes("C")||t.includes("K"))&&(e|=m.CREATE),t.includes("G")&&(e|=m.READ),(t.includes("W")||t.includes("N")||t.includes("V"))&&(e|=m.UPDATE),t.includes("D")&&(e|=m.DELETE),t.includes("R")&&(e|=m.SHARE)),e}(r?.permissions),a=(r?.["owner-id"]||n).toString(),l={id:r?.fileid||0,source:`${i}${t.filename}`,mtime:new Date(Date.parse(t.lastmod)),mime:t.mime||"application/octet-stream",size:r?.size||Number.parseInt(r.getcontentlength||"0"),permissions:o,owner:a,root:e,attributes:{...t,...r,hasPreview:r?.["has-preview"]}};return delete l.attributes?.props,"file"===t.type?new E(l):new L(l)};var D={};!function(t){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i="["+e+"]["+e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",n=new RegExp("^"+i+"$");t.isExist=function(t){return typeof t<"u"},t.isEmptyObject=function(t){return 0===Object.keys(t).length},t.merge=function(t,e,i){if(e){const n=Object.keys(e),s=n.length;for(let r=0;r<s;r++)t[n[r]]="strict"===i?[e[n[r]]]:e[n[r]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=function(t){const e=n.exec(t);return!(null===e||typeof e>"u")},t.getAllMatches=function(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t<r;t++)s.push(n[t]);i.push(s),n=e.exec(t)}return i},t.nameRegexp=i}(D);new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");var P={};const H={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,i){return t}};P.buildOptions=function(t){return Object.assign({},H,t)},P.defaultOptions=H,!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat),new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");var $={};function R(t,e,i){let n;const s={};for(let r=0;r<t.length;r++){const o=t[r],a=B(o);let l="";if(l=void 0===i?a:i+"."+a,a===e.textNodeName)void 0===n?n=o[a]:n+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=R(o[a],e,l);const i=j(t,e);o[":@"]?F(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==s[a]&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(t)):e.isArray(a,l,i)?s[a]=[t]:s[a]=t}}}return"string"==typeof n?n.length>0&&(s[e.textNodeName]=n):void 0!==n&&(s[e.textNodeName]=n),s}function B(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function F(t,e,i,n){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const r=s[o];n.isArray(r,i+"."+r,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function j(t,e){const{textNodeName:i}=e,n=Object.keys(t).length;return!(0!==n&&(1!==n||!t[i]&&"boolean"!=typeof t[i]&&0!==t[i]))}$.prettify=function(t,e){return R(t,e)};const{buildOptions:z}=P,{prettify:M}=$;function U(t,e,i,n){let s="",r=!1;for(let o=0;o<t.length;o++){const a=t[o],l=q(a);if(void 0===l)continue;let c="";if(c=0===i.length?l:`${i}.${l}`,l===e.textNodeName){let t=a[l];G(c,e)||(t=e.tagValueProcessor(l,t),t=K(t,e)),r&&(s+=n),s+=t,r=!1;continue}if(l===e.cdataPropName){r&&(s+=n),s+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,r=!1;continue}if(l===e.commentPropName){s+=n+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,r=!0;continue}if("?"===l[0]){const t=W(a[":@"],e),i="?xml"===l?"":n;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=i+`<${l}${o}${t}?>`,r=!0;continue}let d=n;""!==d&&(d+=e.indentBy);const u=n+`<${l}${W(a[":@"],e)}`,p=U(a[l],e,c,d);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?s+=u+">":s+=u+"/>":p&&0!==p.length||!e.suppressEmptyNode?p&&p.endsWith(">")?s+=u+`>${p}${n}</${l}>`:(s+=u+">",p&&""!==n&&(p.includes("/>")||p.includes("</"))?s+=n+e.indentBy+p+n:s+=p,s+=`</${l}>`):s+=u+"/>",r=!0}return s}function q(t){const e=Object.keys(t);for(let i=0;i<e.length;i++){const n=e[i];if(t.hasOwnProperty(n)&&":@"!==n)return n}}function W(t,e){let i="";if(t&&!e.ignoreAttributes)for(let n in t){if(!t.hasOwnProperty(n))continue;let s=e.attributeValueProcessor(n,t[n]);s=K(s,e),!0===s&&e.suppressBooleanAttributes?i+=` ${n.substr(e.attributeNamePrefix.length)}`:i+=` ${n.substr(e.attributeNamePrefix.length)}="${s}"`}return i}function G(t,e){let i=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let n in e.stopNodes)if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+i)return!0;return!1}function K(t,e){if(t&&t.length>0&&e.processEntities)for(let i=0;i<e.entities.length;i++){const n=e.entities[i];t=t.replace(n.regex,n.val)}return t}const Y=function(t,e){let i="";return e.format&&e.indentBy.length>0&&(i="\n"),U(t,e,"",i)},X={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function Z(t){this.options=Object.assign({},X,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=tt),this.processTextOrObjNode=Q,this.options.format?(this.indentate=J,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function Q(t,e,i){const n=this.j2x(t,i+1);return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,i):this.buildObjectNode(n.val,e,n.attrStr,i)}function J(t){return this.options.indentBy.repeat(t)}function tt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}Z.prototype.build=function(t){return this.options.preserveOrder?Y(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)},Z.prototype.j2x=function(t,e){let i="",n="";for(let s in t)if(Object.prototype.hasOwnProperty.call(t,s))if(typeof t[s]>"u")this.isAttribute(s)&&(n+="");else if(null===t[s])this.isAttribute(s)?n+="":"?"===s[0]?n+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+s+"/"+this.tagEndChar;else if(t[s]instanceof Date)n+=this.buildTextValNode(t[s],s,"",e);else if("object"!=typeof t[s]){const r=this.isAttribute(s);if(r)i+=this.buildAttrPairStr(r,""+t[s]);else if(s===this.options.textNodeName){let e=this.options.tagValueProcessor(s,""+t[s]);n+=this.replaceEntitiesValue(e)}else n+=this.buildTextValNode(t[s],s,"",e)}else if(Array.isArray(t[s])){const i=t[s].length;let r="";for(let o=0;o<i;o++){const i=t[s][o];typeof i>"u"||(null===i?"?"===s[0]?n+=this.indentate(e)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+s+"/"+this.tagEndChar:"object"==typeof i?this.options.oneListGroup?r+=this.j2x(i,e+1).val:r+=this.processTextOrObjNode(i,s,e):r+=this.buildTextValNode(i,s,"",e))}this.options.oneListGroup&&(r=this.buildObjectNode(r,s,"",e)),n+=r}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const e=Object.keys(t[s]),n=e.length;for(let r=0;r<n;r++)i+=this.buildAttrPairStr(e[r],""+t[s][e[r]])}else n+=this.processTextOrObjNode(t[s],s,e);return{attrStr:i,val:n}},Z.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},Z.prototype.buildObjectNode=function(t,e,i,n){if(""===t)return"?"===e[0]?this.indentate(n)+"<"+e+i+"?"+this.tagEndChar:this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar;{let s="</"+e+this.tagEndChar,r="";return"?"===e[0]&&(r="?",s=""),!i&&""!==i||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===r.length?this.indentate(n)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(n)+"<"+e+i+r+this.tagEndChar+t+this.indentate(n)+s:this.indentate(n)+"<"+e+i+r+">"+t+s}},Z.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},Z.prototype.buildTextValNode=function(t,e,i,n){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+i+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s?this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+i+">"+s+"</"+e+this.tagEndChar}},Z.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const i=this.options.entities[e];t=t.replace(i.regex,i.val)}return t}}},r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={id:t,loaded:!1,exports:{}};return s[t].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.m=s,e=[],o.O=(t,i,n,s)=>{if(!i){var r=1/0;for(d=0;d<e.length;d++){i=e[d][0],n=e[d][1],s=e[d][2];for(var a=!0,l=0;l<i.length;l++)(!1&s||r>=s)&&Object.keys(o.O).every((t=>o.O[t](i[l])))?i.splice(l--,1):(a=!1,s<r&&(r=s));if(a){e.splice(d--,1);var c=n();void 0!==c&&(t=c)}}return t}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[i,n,s]},o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.f={},o.e=t=>Promise.all(Object.keys(o.f).reduce(((e,i)=>(o.f[i](t,e),e)),[])),o.u=t=>t+"-"+t+".js?v="+{1110:"b004475d49f882b902d2",5455:"f307561ce3954558c689"}[t],o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i={},n="nextcloud:",o.l=(t,e,s,r)=>{if(i[t])i[t].push(e);else{var a,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==t||u.getAttribute("data-webpack")==n+s){a=u;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,o.nc&&a.setAttribute("nonce",o.nc),a.setAttribute("data-webpack",n+s),a.src=t),i[t]=[e];var p=(e,n)=>{a.onerror=a.onload=null,clearTimeout(h);var s=i[t];if(delete i[t],a.parentNode&&a.parentNode.removeChild(a),s&&s.forEach((t=>t(n))),e)return e(n)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=p.bind(null,a.onerror),a.onload=p.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),o.j=2250,(()=>{var t;o.g.importScripts&&(t=o.g.location+"");var e=o.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var i=e.getElementsByTagName("script");if(i.length)for(var n=i.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=i[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t})(),(()=>{o.b=document.baseURI||self.location.href;var t={2250:0};o.f.j=(e,i)=>{var n=o.o(t,e)?t[e]:void 0;if(0!==n)if(n)i.push(n[2]);else{var s=new Promise(((i,s)=>n=t[e]=[i,s]));i.push(n[2]=s);var r=o.p+o.u(e),a=new Error;o.l(r,(i=>{if(o.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var s=i&&("load"===i.type?"missing":i.type),r=i&&i.target&&i.target.src;a.message="Loading chunk "+e+" failed.\n("+s+": "+r+")",a.name="ChunkLoadError",a.type=s,a.request=r,n[1](a)}}),"chunk-"+e,e)}},o.O.j=e=>0===t[e];var e=(e,i)=>{var n,s,r=i[0],a=i[1],l=i[2],c=0;if(r.some((e=>0!==t[e]))){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);if(l)var d=l(o)}for(e&&e(i);c<r.length;c++)s=r[c],o.o(t,s)&&t[s]&&t[s][0](),t[s]=0;return o.O(d)},i=self.webpackChunknextcloud=self.webpackChunknextcloud||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})(),o.nc=void 0;var a=o.O(void 0,[4208],(()=>o(94023)));a=o.O(a)})();
//# sourceMappingURL=files_versions-files_versions.js.map?v=89b8af6ca94757a072f9