(()=>{var e,i,n,s={25704:(e,i,n)=>{"use strict";var s=n(85471),r=n(53334),o=n(43627),a=n.n(o),l=n(85168),c=n(61338),u=n(21777),d=n(59892),h=n(16406),p=n(63814),f=n(71225),m=n(19231),g=n(60669);const v=(0,p.dC)("dav"),A=(0,g.UU)(v),b=e=>{A.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:e??""})};(0,u.zo)(b),b((0,u.do)());const E=A,N=(0,n(35947).YK)().setApp("files_version").detectUser().build();const x={name:"BackupRestoreIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var I=n(14486);const w=(0,I.A)(x,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon backup-restore-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:"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"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports;var y=n(79759);const C={name:"DownloadIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},_=(0,I.A)(C,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon download-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:"M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,L={name:"FileCompareIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},O=(0,I.A)(L,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon file-compare-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,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"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,T={name:"ImageOffOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},R=(0,I.A)(T,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon image-off-outline-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:"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"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports;var S=n(2413),$=n(57505),P=n(37168),V=n(41944),D=n(4604),k=n(1522),F=n(94849),M=n(32981),B=n(35810),H=n(65043);const j=(e,t)=>!!(e&t),U=(0,s.pM)({name:"Version",components:{NcActionLink:P.A,NcActionButton:$.A,NcAvatar:V.A,NcDateTime:D.A,NcListItem:k.A,BackupRestore:w,Download:_,FileCompare:O,Pencil:S.A,Delete:y.A,ImageOffOutline:R},directives:{tooltip:F.A},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,M.C)("core","capabilities",{files:{version_labeling:!1,version_deletion:!1}}),versionAuthor:""}),computed:{humanReadableSize(){return(0,B.v7)(this.version.size)},versionLabel(){const e=this.version.label??"";return this.isCurrent?""===e?(0,r.Tl)("files_versions","Current version"):`${e} (${(0,r.Tl)("files_versions","Current version")})`:this.isFirstVersion&&""===e?(0,r.Tl)("files_versions","Initial version"):e},versionHumanExplicitDate(){return(0,m.A)(this.version.mtime).format("LLLL")},downloadURL(){return this.isCurrent?(0,p.aU)()+(0,f.HS)("/remote.php/webdav",this.fileInfo.path,this.fileInfo.name):(0,p.aU)()+this.version.url},enableLabeling(){return!0===this.capabilities.files.version_labeling},enableDeletion(){return!0===this.capabilities.files.version_deletion},hasDeletePermissions(){return j(this.fileInfo.permissions,B.aX.DELETE)},hasUpdatePermissions(){return j(this.fileInfo.permissions,B.aX.UPDATE)},isDownloadable(){if(!(this.fileInfo.permissions&B.aX.READ))return!1;if("shared"===this.fileInfo.mountType){const e=this.fileInfo.shareAttributes.find((e=>"permissions"===e.scope&&"download"===e.key))||{};if(!1===e?.value)return!1}return!0}},created(){this.fetchDisplayName()},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:e}=await H.Ay.get((0,p.KT)(`/cloud/users/${this.version.author}`));this.versionAuthor=e.ocs.data.displayname}catch(e){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 G=n(85072),X=n.n(G),z=n(97825),q=n.n(z),W=n(77659),Y=n.n(W),Z=n(55056),K=n.n(Z),J=n(10540),Q=n.n(J),ee=n(41113),te=n.n(ee),ie=n(98192),ne={};ne.styleTagTransform=te(),ne.setAttributes=K(),ne.insert=Y().bind(null,"head"),ne.domAPI=q(),ne.insertStyleElement=Q(),X()(ie.A,ne),ie.A&&ie.A.locals&&ie.A.locals;const se=(0,I.A)(U,(function(){var e=this,t=e._self._c;return e._self._setupProxy,t("NcListItem",{staticClass:"version",attrs:{"force-display-actions":!0,"actions-aria-label":e.t("files_versions","Actions for version from {versionHumanExplicitDate}",{versionHumanExplicitDate:e.versionHumanExplicitDate}),"data-files-versions-version":e.version.fileVersion},on:{click:e.click},scopedSlots:e._u([{key:"icon",fn:function(){return[e.loadPreview||e.previewLoaded?!e.isCurrent&&!e.version.hasPreview||e.previewErrored?t("div",{staticClass:"version__image"},[t("ImageOffOutline",{attrs:{size:20}})],1):t("img",{staticClass:"version__image",attrs:{src:e.version.previewUrl,alt:"",decoding:"async",fetchpriority:"low",loading:"lazy"},on:{load:function(t){e.previewLoaded=!0},error:function(t){e.previewErrored=!0}}}):t("div",{staticClass:"version__image"})]},proxy:!0},{key:"name",fn:function(){return[t("div",{staticClass:"version__info"},[e.versionLabel?t("div",{staticClass:"version__info__label",attrs:{title:e.versionLabel}},[e._v("\n\t\t\t\t"+e._s(e.versionLabel)+"\n\t\t\t")]):e._e(),e._v(" "),e.versionAuthor?t("div",{staticClass:"version__info"},[e.versionLabel?t("span",[e._v("•")]):e._e(),e._v(" "),t("NcAvatar",{staticClass:"avatar",attrs:{user:e.version.author,size:16,"disable-menu":!0,"disable-tooltip":!0,"show-user-status":!1}}),e._v(" "),t("div",[e._v(e._s(e.versionAuthor))])],1):e._e()])]},proxy:!0},{key:"subname",fn:function(){return[t("div",{staticClass:"version__info version__info__subline"},[t("NcDateTime",{staticClass:"version__info__date",attrs:{"relative-time":"short",timestamp:e.version.mtime}}),e._v(" "),t("span",[e._v("•")]),e._v(" "),t("span",[e._v(e._s(e.humanReadableSize))])],1)]},proxy:!0},{key:"actions",fn:function(){return[e.enableLabeling&&e.hasUpdatePermissions?t("NcActionButton",{attrs:{"data-cy-files-versions-version-action":"label","close-after-click":!0},on:{click:e.labelUpdate},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Pencil",{attrs:{size:22}})]},proxy:!0}],null,!1,3072546167)},[e._v("\n\t\t\t"+e._s(""===e.version.label?e.t("files_versions","Name this version"):e.t("files_versions","Edit version name"))+"\n\t\t")]):e._e(),e._v(" "),!e.isCurrent&&e.canView&&e.canCompare?t("NcActionButton",{attrs:{"data-cy-files-versions-version-action":"compare","close-after-click":!0},on:{click:e.compareVersion},scopedSlots:e._u([{key:"icon",fn:function(){return[t("FileCompare",{attrs:{size:22}})]},proxy:!0}],null,!1,1958207595)},[e._v("\n\t\t\t"+e._s(e.t("files_versions","Compare to current version"))+"\n\t\t")]):e._e(),e._v(" "),!e.isCurrent&&e.hasUpdatePermissions?t("NcActionButton",{attrs:{"data-cy-files-versions-version-action":"restore","close-after-click":!0},on:{click:e.restoreVersion},scopedSlots:e._u([{key:"icon",fn:function(){return[t("BackupRestore",{attrs:{size:22}})]},proxy:!0}],null,!1,2239038444)},[e._v("\n\t\t\t"+e._s(e.t("files_versions","Restore version"))+"\n\t\t")]):e._e(),e._v(" "),e.isDownloadable?t("NcActionLink",{attrs:{"data-cy-files-versions-version-action":"download",href:e.downloadURL,"close-after-click":!0,download:e.downloadURL},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Download",{attrs:{size:22}})]},proxy:!0}],null,!1,927269758)},[e._v("\n\t\t\t"+e._s(e.t("files_versions","Download version"))+"\n\t\t")]):e._e(),e._v(" "),!e.isCurrent&&e.enableDeletion&&e.hasDeletePermissions?t("NcActionButton",{attrs:{"data-cy-files-versions-version-action":"delete","close-after-click":!0},on:{click:e.deleteVersion},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Delete",{attrs:{size:22}})]},proxy:!0}],null,!1,2429175571)},[e._v("\n\t\t\t"+e._s(e.t("files_versions","Delete version"))+"\n\t\t")]):e._e()]},proxy:!0}])})}),[],!1,null,"4033be00",null).exports,re=(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(){N.debug("[VirtualScrolling] Computing visible section",{sections:this.sections});const e=this.containerHeight,t=this.scrollPosition,i=t+e;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 si&&(a=(n-i)/e),a>this.renderDistance?r:[...r,{...o,distance:a}]}),[])}))).filter((e=>e.rows.length>0)),o=r.flatMap((e=>{let{rows:t}=e;return t})).flatMap((e=>{let{items:t}=e;return t})),a=this._rowIdToKeyMap;o.forEach((e=>e.key=a[e.id]));const l=o.map((e=>{let{key:t}=e;return t})).filter((e=>void 0!==e)),c=Object.values(a).filter((e=>!l.includes(e)));return o.filter((e=>{let{key:t}=e;return void 0===t})).forEach((e=>e.key=c.pop()??Math.random().toString(36).substr(2))),this._rowIdToKeyMap=o.reduce(((e,t)=>{let{id:i,key:n}=t;return{...e,[`${i}`]:n}}),{}),r},totalHeight(){return this.sections.map((e=>this.headerHeight+e.height)).reduce(((e,t)=>e+t),0)+0},paddingTop(){if(0===this.visibleSections.length)return 0;let e=0;for(const t of this.sections)if(t.key===this.visibleSections[0].rows[0].sectionKey){for(const i of t.rows){if(i.key===this.visibleSections[0].rows[0].key)return e;e+=i.height}e+=this.headerHeight}else e+=this.headerHeight+t.height;return e},rowsContainerStyle(){return{height:`${this.totalHeight}px`,paddingTop:`${this.paddingTop}px`}},isNearBottom(){const e=this.containerHeight*this.bottomBufferRatio;return this.scrollPosition+this.containerHeight>=this.totalHeight-e},container(){return N.debug("[VirtualScrolling] Computing container"),null!==this.containerElement?this.containerElement:this.useWindow?window:this.$refs.container}},watch:{isNearBottom(e){N.debug("[VirtualScrolling] isNearBottom changed",{value:e}),e&&this.$emit("need-content")},visibleSections(){this.isNearBottom&&this.$emit("need-content")},scrollToKey(e){let t=0;for(const i of this.sections){if(i.key===e)break;t+=this.headerHeight+i.height}N.debug("[VirtualScrolling] Scrolling to",{currentRowTopDistanceFromTop:t}),this.container.scrollTo({top:t,behavior:"smooth"})}},beforeCreate(){this._rowIdToKeyMap={}},mounted(){this.resizeObserver=new ResizeObserver((e=>{for(const t of e){const e=t.contentRect;t.target===this.container&&(this.containerHeight=e.height),t.target.classList.contains("vs-rows-container")&&(this.rowsContainerHeight=e.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(){this.useWindow&&window.removeEventListener("resize",this.updateContainerSize),this.resizeObserver?.disconnect(),this.container.removeEventListener("scroll",this.updateScrollPosition)},methods:{updateScrollPosition(){this._onScrollHandle??=requestAnimationFrame((()=>{this._onScrollHandle=null,this.useWindow?this.scrollPosition=this.container.scrollY:this.scrollPosition=this.container.scrollTop}))},updateContainerSize(){this.containerHeight=window.innerHeight}}});var oe=n(26201),ae={};ae.styleTagTransform=te(),ae.setAttributes=K(),ae.insert=Y().bind(null,"head"),ae.domAPI=q(),ae.insertStyleElement=Q(),X()(oe.A,ae),oe.A&&oe.A.locals&&oe.A.locals;const le=(0,I.A)(re,(function(){var e=this,t=e._self._c;return e._self._setupProxy,e.useWindow||null!==e.containerElement?t("div",{ref:"rowsContainer",staticClass:"vs-rows-container",style:e.rowsContainerStyle},[e._t("default",null,{visibleSections:e.visibleSections}),e._v(" "),e._t("loader")],2):t("div",{ref:"container",staticClass:"vs-container"},[t("div",{ref:"rowsContainer",staticClass:"vs-rows-container",style:e.rowsContainerStyle},[e._t("default",null,{visibleSections:e.visibleSections}),e._v(" "),e._t("loader")],2)])}),[],!1,null,"49a1883f",null).exports;var ce=n(65659),ue=n(94219),de=n(82182);const he=(0,s.pM)({name:"VersionLabelDialog",components:{NcDialog:ue.A,NcTextField:de.A},props:{open:{type:Boolean,default:!1},versionLabel:{type:String,default:""}},data:()=>({editedVersionLabel:""}),computed:{dialogButtons(){const e=[];return""===this.versionLabel.trim()?e.push({label:(0,r.t)("files_versions","Cancel")}):e.push({label:(0,r.t)("files_versions","Remove version name"),type:"error",nativeType:"reset",callback:()=>{this.setVersionLabel("")}}),[...e,{label:(0,r.t)("files_versions","Save version name"),type:"primary",nativeType:"submit",icon:ce}]}},watch:{versionLabel:{immediate:!0,handler(e){this.editedVersionLabel=e??""}},open:{immediate:!0,handler(e){e&&this.$nextTick((()=>this.$refs.labelInput.focus())),this.editedVersionLabel=this.versionLabel}}},methods:{setVersionLabel(e){this.$emit("label-update",e)},t:r.t}});var pe=n(14085),fe={};fe.styleTagTransform=te(),fe.setAttributes=K(),fe.insert=Y().bind(null,"head"),fe.domAPI=q(),fe.insertStyleElement=Q(),X()(pe.A,fe),pe.A&&pe.A.locals&&pe.A.locals;const me={name:"VersionTab",components:{Version:se,VirtualScrolling:le,VersionLabelDialog:(0,I.A)(he,(function(){var e=this,t=e._self._c;return e._self._setupProxy,t("NcDialog",{attrs:{buttons:e.dialogButtons,"content-classes":"version-label-modal","is-form":"",open:e.open,size:"normal",name:e.t("files_versions","Name this version")},on:{"update:open":function(t){return e.$emit("update:open",t)},submit:function(t){return e.setVersionLabel(e.editedVersionLabel)}}},[t("NcTextField",{ref:"labelInput",staticClass:"version-label-modal__input",attrs:{label:e.t("files_versions","Version name"),placeholder:e.t("files_versions","Version name"),value:e.editedVersionLabel},on:{"update:value":function(t){e.editedVersionLabel=t}}}),e._v(" "),t("p",{staticClass:"version-label-modal__info"},[e._v("\n\t\t"+e._s(e.t("files_versions","Named versions are persisted, and excluded from automatic cleanups when your storage quota is full."))+"\n\t")])],1)}),[],!1,null,"6e140e12",null).exports,NcLoadingIcon:d.A},mixins:[h.A],data:()=>({fileInfo:null,isActive:!1,versions:[],loading:!1,showVersionLabelForm:!1,editedVersion:null}),computed:{sections(){return[{key:"versions",rows:this.orderedVersions.map((e=>({key:e.mtime,height:68,sectionKey:"versions",items:[e]}))),height:68*this.orderedVersions.length}]},orderedVersions(){return[...this.versions].sort(((e,t)=>e.mtime===this.fileInfo.mtime?-1:t.mtime===this.fileInfo.mtime?1:t.mtime-e.mtime))},initialVersionMtime(){return this.versions.map((e=>e.mtime)).reduce(((e,t)=>Math.min(e,t)))},viewerFileInfo(){let e="";return 1&this.fileInfo.permissions&&(e+="R"),2&this.fileInfo.permissions&&(e+="W"),8&this.fileInfo.permissions&&(e+="D"),{...this.fileInfo,mime:this.fileInfo.mimetype,basename:this.fileInfo.name,filename:this.fileInfo.path+"/"+this.fileInfo.name,permissions:e,fileid:this.fileInfo.id}},canView(){return window.OCA.Viewer?.mimetypesCompare?.includes(this.fileInfo.mimetype)},canCompare(){return!this.isMobile}},mounted(){(0,c.B1)("files_versions:restore:restored",this.fetchVersions)},beforeUnmount(){(0,c.al)("files_versions:restore:restored",this.fetchVersions)},methods:{async update(e){this.fileInfo=e,this.resetState(),this.fetchVersions()},async setIsActive(e){this.isActive=e},async fetchVersions(){try{this.loading=!0,this.versions=await async function(e){const t=`/versions/${(0,u.HW)()?.uid}/versions/${e.id}`;try{return(await E.getDirectoryContents(t,{data:'\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n',details:!0})).data.filter((e=>{let{mime:t}=e;return""!==t})).map((t=>function(e,t){const i=1e3*(0,m.A)(e.lastmod).unix();let n="";return n=i===t.mtime?(0,p.Jv)("/core/preview?fileId={fileId}&c={fileEtag}&x=250&y=250&forceIcon=0&a=0",{fileId:t.id,fileEtag:t.etag}):(0,p.Jv)("/apps/files_versions/preview?file={file}&version={fileVersion}",{file:(0,f.HS)(t.path,t.name),fileVersion:e.basename}),{fileId:t.id,label:e.props["version-label"]&&String(e.props["version-label"]),author:e.props["version-author"]??null,filename:e.filename,basename:(0,m.A)(i).format("LLL"),mime:e.mime,etag:`${e.props.getetag}`,size:e.size,type:e.type,mtime:i,permissions:"R",hasPreview:1===e.props["has-preview"],previewUrl:n,url:(0,f.HS)("/remote.php/dav",e.filename),source:(0,p.dC)("dav")+(0,f.O0)(e.filename),fileVersion:e.basename}}(t,e)))}catch(e){throw N.error("Could not fetch version",{exception:e}),e}}(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,c.Ic)("files_versions:restore:requested",n),!n.preventDefault)try{await async function(e){try{N.debug("Restoring version",{url:e.url}),await E.moveFile(`/versions/${(0,u.HW)()?.uid}/versions/${e.fileId}/${e.fileVersion}`,`/versions/${(0,u.HW)()?.uid}/restore/target`)}catch(e){throw N.error("Could not restore version",{exception:e}),e}}(e),""!==e.label?(0,l.Te)(t("files_versions",`${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,c.Ic)("files_versions:restore:restored",e)}catch(n){this.fileInfo=i,(0,l.Qg)(t("files_versions","Could not restore version")),(0,c.Ic)("files_versions:restore:failed",e)}},handleLabelUpdateRequest(e){this.showVersionLabelForm=!0,this.editedVersion=e},async handleLabelUpdate(e){const t=this.editedVersion.label;this.editedVersion.label=e,this.showVersionLabelForm=!1;try{await async function(e,t){return await E.customRequest(e.filename,{method:"PROPPATCH",data:`\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t${t}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t`})}(this.editedVersion,e),this.editedVersion=null}catch(e){this.editedVersion.label=t,(0,l.Qg)(this.t("files_versions","Could not set version label")),logger.error("Could not set version label",{exception:e})}},async handleDelete(e){const i=this.versions.indexOf(e);this.versions.splice(i,1);try{await async function(e){await E.deleteFile(e.filename)}(e)}catch(i){this.versions.push(e),(0,l.Qg)(t("files_versions","Could not delete version"))}},resetState(){this.$set(this,"versions",[])},openVersion(e){let{version:t}=e;if(t.mtime===this.fileInfo.mtime)return void OCA.Viewer.open({fileInfo:this.viewerFileInfo});const i=this.versions.map((e=>({...e,filename:e.mtime===this.fileInfo.mtime?a().join("files",(0,u.HW)()?.uid??"",this.fileInfo.path,this.fileInfo.name):e.filename,hasPreview:!1,previewUrl:void 0})));OCA.Viewer.open({fileInfo:i.find((e=>e.source===t.source)),enableSidebar:!1})},compareVersion(e){let{version:t}=e;const i=this.versions.map((e=>({...e,hasPreview:!1,previewUrl:void 0})));OCA.Viewer.compare(this.viewerFileInfo,i.find((e=>e.source===t.source)))}}};var ge=n(92444),ve={};ve.styleTagTransform=te(),ve.setAttributes=K(),ve.insert=Y().bind(null,"head"),ve.domAPI=q(),ve.insertStyleElement=Q(),X()(ge.A,ve),ge.A&&ge.A.locals&&ge.A.locals;const Ae=(0,I.A)(me,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"versions-tab__container"},[t("VirtualScrolling",{attrs:{sections:e.sections,"header-height":0},scopedSlots:e._u([{key:"default",fn:function(i){let{visibleSections:n}=i;return[t("ul",{attrs:{"data-files-versions-versions-list":""}},[1===n.length?e._l(n[0].rows,(function(i){return t("Version",{key:i.items[0].mtime,attrs:{"can-view":e.canView,"can-compare":e.canCompare,"load-preview":e.isActive,version:i.items[0],"file-info":e.fileInfo,"is-current":i.items[0].mtime===e.fileInfo.mtime,"is-first-version":i.items[0].mtime===e.initialVersionMtime},on:{click:e.openVersion,compare:e.compareVersion,restore:e.handleRestore,"label-update-request":function(t){return e.handleLabelUpdateRequest(i.items[0])},delete:e.handleDelete}})})):e._e()],2)]}}])},[e._v(" "),e.loading?t("NcLoadingIcon",{staticClass:"files-list-viewer__loader",attrs:{slot:"loader"},slot:"loader"}):e._e()],1),e._v(" "),e.editedVersion?t("VersionLabelDialog",{attrs:{open:e.showVersionLabelForm,"version-label":e.editedVersion.label},on:{"update:open":function(t){e.showVersionLabelForm=t},"label-update":e.handleLabelUpdate}}):e._e()],1)}),[],!1,null,null,null).exports;var be=n(80284);s.Ay.prototype.t=r.Tl,s.Ay.prototype.n=r.zw,s.Ay.use(be.Ay);const Ee=s.Ay.extend(Ae);let Ne=null;window.addEventListener("DOMContentLoaded",(function(){void 0!==OCA.Files?.Sidebar&&OCA.Files.Sidebar.registerTab(new OCA.Files.Sidebar.Tab({id:"version_vue",name:(0,r.Tl)("files_versions","Versions"),iconSvg:'',async mount(e,t,i){Ne&&Ne.$destroy(),Ne=new Ee({parent:i}),await Ne.update(t),Ne.$mount(e)},update(e){Ne.update(e)},setIsActive(e){Ne&&Ne.setIsActive(e)},destroy(){Ne.$destroy(),Ne=null},enabled:e=>!(e?.isDirectory()??1)}))}))},98192:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var n=i(71354),s=i.n(n),r=i(76314),o=i.n(r)()(s());o.push([e.id,".version[data-v-4033be00]{display:flex;flex-direction:row}.version__info[data-v-4033be00]{display:flex;flex-direction:row;align-items:center;gap:.5rem;color:var(--color-main-text);font-weight:500}.version__info__label[data-v-4033be00]{font-weight:700;overflow:hidden;text-overflow:ellipsis}.version__info__date[data-v-4033be00]{overflow:hidden;text-overflow:ellipsis}.version__info__subline[data-v-4033be00]{color:var(--color-text-maxcontrast)}.version__image[data-v-4033be00]{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,CAEA,eAAA,CACA,sBAAA,CAGD,sCAEC,eAAA,CACA,sBAAA,CAGD,yCACC,mCAAA,CAIF,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\t// Fix overflow on narrow screens\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__date {\n\t\t\t// Fix overflow on narrow screens\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\n\t\t&__subline {\n\t\t\tcolor: var(--color-text-maxcontrast)\n\t\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},14085:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var n=i(71354),s=i.n(n),r=i(76314),o=i.n(r)()(s());o.push([e.id,".version-label-modal__info[data-v-6e140e12]{color:var(--color-text-maxcontrast);margin-block:calc(3*var(--default-grid-baseline))}.version-label-modal__input[data-v-6e140e12]{margin-block-start:calc(2*var(--default-grid-baseline))}","",{version:3,sources:["webpack://./apps/files_versions/src/components/VersionLabelDialog.vue"],names:[],mappings:"AAEC,4CACC,mCAAA,CACA,iDAAA,CAGD,6CACC,uDAAA",sourcesContent:["\n.version-label-modal {\n\t&__info {\n\t\tcolor: var(--color-text-maxcontrast);\n\t\tmargin-block: calc(3 * var(--default-grid-baseline));\n\t}\n\n\t&__input {\n\t\tmargin-block-start: calc(2 * var(--default-grid-baseline));\n\t}\n}\n"],sourceRoot:""}]);const a=o},26201:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var n=i(71354),s=i.n(n),r=i(76314),o=i.n(r)()(s());o.push([e.id,".vs-container[data-v-49a1883f]{overflow-y:scroll;height:100%}.vs-rows-container[data-v-49a1883f]{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},92444:(e,t,i)=>{"use strict";i.d(t,{A:()=>a});var n=i(71354),s=i.n(n),r=i(76314),o=i.n(r)()(s());o.push([e.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},42634:()=>{},63779:()=>{},77199:()=>{},59169:()=>{},86833:()=>{},35810:(e,t,i)=>{"use strict";i.d(t,{Al:()=>n.r,H4:()=>n.c,Q$:()=>n.e,R3:()=>n.n,VL:()=>n.l,aX:()=>n.P,lJ:()=>n.d,pt:()=>n.F,ur:()=>d,v7:()=>c});var n=i(68251),s=(i(43627),i(53334)),r=i(380),o=i(65606);Error;const a=["B","KB","MB","GB","TB","PB"],l=["B","KiB","MiB","GiB","TiB","PiB"];function c(e,t=!1,i=!1,n=!1){i=i&&!n,"string"==typeof e&&(e=Number(e));let r=e>0?Math.floor(Math.log(e)/Math.log(n?1e3:1024)):0;r=Math.min((i?l.length:a.length)-1,r);const o=i?l[r]:a[r];let c=(e/Math.pow(n?1e3:1024,r)).toFixed(1);return!0===t&&0===r?("0.0"!==c?"< 1 ":"0 ")+(i?l[1]:a[1]):(c=r<2?parseFloat(c).toFixed(0):parseFloat(c).toLocaleString((0,s.lO)()),c+" "+o)}function u(e){return e instanceof Date?e.toISOString():String(e)}function d(e,t={}){const i={sortingMode:"basename",sortingOrder:"asc",...t};return function(e,t,i){i=i??[];const n=(t=t??[e=>e]).map(((e,t)=>"asc"===(i[t]??"asc")?1:-1)),r=Intl.Collator([(0,s.Z0)(),(0,s.lO)()],{numeric:!0,usage:"sort"});return[...e].sort(((e,i)=>{for(const[s,o]of t.entries()){const t=r.compare(u(o(e)),u(o(i)));if(0!==t)return t*n[s]}return 0}))}(e,[...i.sortFavoritesFirst?[e=>1!==e.attributes?.favorite]:[],...i.sortFoldersFirst?[e=>"folder"!==e.type]:[],..."basename"!==i.sortingMode?[e=>e[i.sortingMode]]:[],e=>{return(t=e.displayname||e.attributes?.displayname||e.basename).lastIndexOf(".")>0?t.slice(0,t.lastIndexOf(".")):t;var t},e=>e.basename],[...i.sortFavoritesFirst?["asc"]:[],...i.sortFoldersFirst?["asc"]:[],..."mtime"===i.sortingMode?["asc"===i.sortingOrder?"desc":"asc"]:[],..."mtime"!==i.sortingMode&&"basename"!==i.sortingMode?[i.sortingOrder]:[],i.sortingOrder,i.sortingOrder])}var h,p,f={},m={};function g(){return h||(h=1,function(e){const t=":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="["+t+"]["+t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",n=new RegExp("^"+i+"$");e.isExist=function(e){return void 0!==e},e.isEmptyObject=function(e){return 0===Object.keys(e).length},e.merge=function(e,t,i){if(t){const n=Object.keys(t),s=n.length;for(let r=0;r5&&"xml"===n)return d("InvalidXml","XML declaration allowed only at the start of the document.",m(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function s(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let i=1;for(t+=8;t"===e[t]&&(i--,0===i))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t"===e[t+2]){t+=2;break}return t}f.validate=function(r,o){o=Object.assign({},t,o);const l=[];let h=!1,p=!1;"\ufeff"===r[0]&&(r=r.substr(1));for(let t=0;t"!==r[t]&&" "!==r[t]&&"\t"!==r[t]&&"\n"!==r[t]&&"\r"!==r[t];t++)A+=r[t];if(A=A.trim(),"/"===A[A.length-1]&&(A=A.substring(0,A.length-1),t--),f=A,!e.isName(f)){let e;return e=0===A.trim().length?"Invalid space after '<'.":"Tag '"+A+"' is an invalid name.",d("InvalidTag",e,m(r,t))}const b=a(r,t);if(!1===b)return d("InvalidAttr","Attributes for '"+A+"' have open quote.",m(r,t));let E=b.value;if(t=b.index,"/"===E[E.length-1]){const e=t-E.length;E=E.substring(0,E.length-1);const i=c(E,o);if(!0!==i)return d(i.err.code,i.err.msg,m(r,e+i.err.line));h=!0}else if(v){if(!b.tagClosed)return d("InvalidTag","Closing tag '"+A+"' doesn't have proper closing.",m(r,t));if(E.trim().length>0)return d("InvalidTag","Closing tag '"+A+"' can't have attributes or invalid starting.",m(r,g));if(0===l.length)return d("InvalidTag","Closing tag '"+A+"' has not been opened.",m(r,g));{const e=l.pop();if(A!==e.tagName){let t=m(r,e.tagStartPos);return d("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+t.line+", col "+t.col+") instead of closing tag '"+A+"'.",m(r,g))}0==l.length&&(p=!0)}}else{const e=c(E,o);if(!0!==e)return d(e.err.code,e.err.msg,m(r,t-E.length+e.err.line));if(!0===p)return d("InvalidXml","Multiple possible root nodes found.",m(r,t));-1!==o.unpairedTags.indexOf(A)||l.push({tagName:A,tagStartPos:g}),h=!0}for(t++;t0)||d("InvalidXml","Invalid '"+JSON.stringify(l.map((e=>e.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):d("InvalidXml","Start tag expected.",1)};const r='"',o="'";function a(e,t){let i="",n="",s=!1;for(;t"===e[t]&&""===n){s=!0;break}i+=e[t]}return""===n&&{value:i,index:t,tagClosed:s}}const l=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function c(t,i){const n=e.getAllMatches(t,l),s={};for(let e=0;e{for(const i of e){if("string"==typeof i&&t===i)return!0;if(i instanceof RegExp&&i.test(t))return!0}}:()=>!1})}var R,S,$,P,V,D,k,F,M,B,H,j,U,G={};function X(){if(R)return G;function e(s,r,o){let a;const l={};for(let c=0;c0&&(l[r.textNodeName]=a):void 0!==a&&(l[r.textNodeName]=a),l}function t(e){const t=Object.keys(e);for(let e=0;e!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,i){return e}};return O.buildOptions=function(t){return Object.assign({},e,t)},O.defaultOptions=e,O}(),t=function(){if(L)return _;L=1;const e=g(),t=E?b:(E=1,b=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}),i=function(){if(x)return N;x=1;const e=g();function t(e,t){let i="";for(;t"===e[a]){if(d?"-"===e[a-1]&&"-"===e[a-2]&&(d=!1,c--):c--,0===c)break}else"["===e[a]?u=!0:h+=e[a];else{if(u&&i(e,a)){let i,n;a+=7,[i,n,a]=t(e,a+1),-1===n.indexOf("&")&&(l[o(i)]={regx:RegExp(`&${i};`,"g"),val:n})}else u&&n(e,a)||u&&s(e,a)?a+=8:u&&r(e,a)?a+=9:d=!0;c++,h=""}if(0!==c)throw new Error("Unclosed DOCTYPE")}return{entities:l,i:a}}}(),n=function(){if(w)return I;w=1;const e=/^[-+]?0x[a-fA-F0-9]+$/,t=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const i={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};return I=function(n,s={}){if(s=Object.assign({},i,s),!n||"string"!=typeof n)return n;let r=n.trim();if(void 0!==s.skipLike&&s.skipLike.test(r))return n;if(s.hex&&e.test(r))return Number.parseInt(r,16);{const e=t.exec(r);if(e){const t=e[1],i=e[2];let a=(o=e[3])&&-1!==o.indexOf(".")?("."===(o=o.replace(/0+$/,""))?o="0":"."===o[0]?o="0"+o:"."===o[o.length-1]&&(o=o.substr(0,o.length-1)),o):o;const l=e[4]||e[6];if(!s.leadingZeros&&i.length>0&&t&&"."!==r[2])return n;if(!s.leadingZeros&&i.length>0&&!t&&"."!==r[1])return n;{const e=Number(r),o=""+e;return-1!==o.search(/[eE]/)||l?s.eNotation?e:n:-1!==r.indexOf(".")?"0"===o&&""===a||o===a||t&&o==="-"+a?e:n:i?a===o||t+a===o?e:n:r===o||r===t+o?e:n}}return n}var o}}(),s=T();function r(e){const t=Object.keys(e);for(let i=0;i0)){o||(e=this.replaceEntitiesValue(e));const n=this.options.tagValueProcessor(t,e,i,s,r);return null==n?e:typeof n!=typeof e||n!==e?n:this.options.trimValues||e.trim()===e?y(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function a(e){if(this.options.removeNSPrefix){const t=e.split(":"),i="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=i+t[1])}return e}const l=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function c(t,i,n){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const n=e.getAllMatches(t,l),s=n.length,r={};for(let e=0;e",a,"Closing Tag is not closed.");let i=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){const e=i.indexOf(":");-1!==e&&(i=i.substr(e+1))}this.options.transformTagName&&(i=this.options.transformTagName(i)),s&&(r=this.saveTextToParentTag(r,s,o));const n=o.substring(o.lastIndexOf(".")+1);if(i&&-1!==this.options.unpairedTags.indexOf(i))throw new Error(`Unpaired tag can not be used as closing tag: `);let l=0;n&&-1!==this.options.unpairedTags.indexOf(n)?(l=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=o.lastIndexOf("."),o=o.substring(0,l),s=this.tagsNodeStack.pop(),r="",a=t}else if("?"===e[a+1]){let i=v(e,a,!1,"?>");if(!i)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,s,o),this.options.ignoreDeclaration&&"?xml"===i.tagName||this.options.ignorePiTags);else{const e=new t(i.tagName);e.add(this.options.textNodeName,""),i.tagName!==i.tagExp&&i.attrExpPresent&&(e[":@"]=this.buildAttributesMap(i.tagExp,o,i.tagName)),this.addChild(s,e,o)}a=i.closeIndex+1}else if("!--"===e.substr(a+1,3)){const t=m(e,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){const i=e.substring(a+4,t-2);r=this.saveTextToParentTag(r,s,o),s.add(this.options.commentPropName,[{[this.options.textNodeName]:i}])}a=t}else if("!D"===e.substr(a+1,2)){const t=i(e,a);this.docTypeEntities=t.entities,a=t.i}else if("!["===e.substr(a+1,2)){const t=m(e,"]]>",a,"CDATA is not closed.")-2,i=e.substring(a+9,t);r=this.saveTextToParentTag(r,s,o);let n=this.parseTextData(i,s.tagname,o,!0,!1,!0,!0);null==n&&(n=""),this.options.cdataPropName?s.add(this.options.cdataPropName,[{[this.options.textNodeName]:i}]):s.add(this.options.textNodeName,n),a=t+2}else{let i=v(e,a,this.options.removeNSPrefix),l=i.tagName;const c=i.rawTagName;let u=i.tagExp,d=i.attrExpPresent,h=i.closeIndex;this.options.transformTagName&&(l=this.options.transformTagName(l)),s&&r&&"!xml"!==s.tagname&&(r=this.saveTextToParentTag(r,s,o,!1));const p=s;if(p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(s=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),l!==n.tagname&&(o+=o?"."+l:l),this.isItStopNode(this.options.stopNodes,o,l)){let n="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===l[l.length-1]?(l=l.substr(0,l.length-1),o=o.substr(0,o.length-1),u=l):u=u.substr(0,u.length-1),a=i.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(l))a=i.closeIndex;else{const t=this.readStopNodeData(e,c,h+1);if(!t)throw new Error(`Unexpected end of ${c}`);a=t.i,n=t.tagContent}const r=new t(l);l!==u&&d&&(r[":@"]=this.buildAttributesMap(u,o,l)),n&&(n=this.parseTextData(n,l,o,!0,d,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),r.add(this.options.textNodeName,n),this.addChild(s,r,o)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){"/"===l[l.length-1]?(l=l.substr(0,l.length-1),o=o.substr(0,o.length-1),u=l):u=u.substr(0,u.length-1),this.options.transformTagName&&(l=this.options.transformTagName(l));const e=new t(l);l!==u&&d&&(e[":@"]=this.buildAttributesMap(u,o,l)),this.addChild(s,e,o),o=o.substr(0,o.lastIndexOf("."))}else{const e=new t(l);this.tagsNodeStack.push(s),l!==u&&d&&(e[":@"]=this.buildAttributesMap(u,o,l)),this.addChild(s,e,o),s=e}r="",a=h}}else r+=e[a];return n.child};function d(e,t,i){const n=this.options.updateTag(t.tagname,i,t[":@"]);!1===n||("string"==typeof n?(t.tagname=n,e.addChild(t)):e.addChild(t))}const h=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const i=this.docTypeEntities[t];e=e.replace(i.regx,i.val)}for(let t in this.lastEntities){const i=this.lastEntities[t];e=e.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const i=this.htmlEntities[t];e=e.replace(i.regex,i.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function p(e,t,i,n){return e&&(void 0===n&&(n=0===Object.keys(t.child).length),void 0!==(e=this.parseTextData(e,t.tagname,i,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,n))&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function f(e,t,i){const n="*."+i;for(const i in e){const s=e[i];if(n===s||t===s)return!0}return!1}function m(e,t,i,n){const s=e.indexOf(t,i);if(-1===s)throw new Error(n);return s+t.length-1}function v(e,t,i,n=">"){const s=function(e,t,i=">"){let n,s="";for(let r=t;r",i,`${t} is not closed`);if(e.substring(i+2,r).trim()===t&&(s--,0===s))return{tagContent:e.substring(n,i),i:r};i=r}else if("?"===e[i+1])i=m(e,"?>",i+1,"StopNode is not closed.");else if("!--"===e.substr(i+1,3))i=m(e,"--\x3e",i+3,"StopNode is not closed.");else if("!["===e.substr(i+1,2))i=m(e,"]]>",i,"StopNode is not closed.")-2;else{const n=v(e,i,">");n&&((n&&n.tagName)===t&&"/"!==n.tagExp[n.tagExp.length-1]&&s++,i=n.closeIndex)}}function y(t,i,s){if(i&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&n(t,s)}return e.isExist(t)?t:""}return _=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,16))}},this.addExternalEntities=r,this.parseXml=u,this.parseTextData=o,this.resolveNameSpace=a,this.buildAttributesMap=c,this.isItStopNode=f,this.replaceEntitiesValue=h,this.readStopNodeData=A,this.saveTextToParentTag=p,this.addChild=d,this.ignoreAttributesFn=s(this.options.ignoreAttributes)}}}(),{prettify:i}=X(),n=v();return S=class{constructor(t){this.externalEntities={},this.options=e(t)}parse(e,s){if("string"==typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(s){!0===s&&(s={});const t=n.validate(e,s);if(!0!==t)throw Error(`${t.err.msg}:${t.err.line}:${t.err.col}`)}const r=new t(this.options);r.addExternalEntities(this.externalEntities);const o=r.parseXml(e);return this.options.preserveOrder||void 0===o?o:i(o,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}}}function q(){if(V)return P;function e(r,o,a,l){let c="",u=!1;for(let d=0;d`,u=!1;continue}if(p===o.commentPropName){c+=l+`\x3c!--${h[p][0][o.textNodeName]}--\x3e`,u=!0;continue}if("?"===p[0]){const e=i(h[":@"],o),t="?xml"===p?"":l;let n=h[p][0][o.textNodeName];n=0!==n.length?" "+n:"",c+=t+`<${p}${n}${e}?>`,u=!0;continue}let m=l;""!==m&&(m+=o.indentBy);const g=l+`<${p}${i(h[":@"],o)}`,v=e(h[p],o,f,m);-1!==o.unpairedTags.indexOf(p)?o.suppressUnpairedNode?c+=g+">":c+=g+"/>":v&&0!==v.length||!o.suppressEmptyNode?v&&v.endsWith(">")?c+=g+`>${v}${l}`:(c+=g+">",v&&""!==l&&(v.includes("/>")||v.includes("`):c+=g+"/>",u=!0}return c}function t(e){const t=Object.keys(e);for(let i=0;i0&&t.processEntities)for(let i=0;i0&&(n="\n"),e(t,i,"",n)}}function W(){if(H)return B;H=1;const e="object"==typeof o&&o.env&&o.env.NODE_DEBUG&&/\bsemver\b/i.test(o.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return B=e}function Y(){if(U)return j;U=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return j={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}!function(){if(M)return F;M=1;const e=v(),t=z(),i=function(){if(k)return D;k=1;const e=q(),t=T(),i={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function n(e){this.options=Object.assign({},i,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=t(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=o),this.processTextOrObjNode=s,this.options.format?(this.indentate=r,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function s(e,t,i,n){const s=this.j2x(e,i+1,n.concat(t));return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,s.attrStr,i):this.buildObjectNode(s.val,t,s.attrStr,i)}function r(e){return this.options.indentBy.repeat(e)}function o(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}return n.prototype.build=function(t){return this.options.preserveOrder?e(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},n.prototype.j2x=function(e,t,i){let n="",s="";const r=i.join(".");for(let o in e)if(Object.prototype.hasOwnProperty.call(e,o))if(void 0===e[o])this.isAttribute(o)&&(s+="");else if(null===e[o])this.isAttribute(o)?s+="":"?"===o[0]?s+=this.indentate(t)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(t)+"<"+o+"/"+this.tagEndChar;else if(e[o]instanceof Date)s+=this.buildTextValNode(e[o],o,"",t);else if("object"!=typeof e[o]){const i=this.isAttribute(o);if(i&&!this.ignoreAttributesFn(i,r))n+=this.buildAttrPairStr(i,""+e[o]);else if(!i)if(o===this.options.textNodeName){let t=this.options.tagValueProcessor(o,""+e[o]);s+=this.replaceEntitiesValue(t)}else s+=this.buildTextValNode(e[o],o,"",t)}else if(Array.isArray(e[o])){const n=e[o].length;let r="",a="";for(let l=0;l"+e+s}},n.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(n)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(n)+"<"+t+i+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(t,e);return s=this.replaceEntitiesValue(s),""===s?this.indentate(n)+"<"+t+i+this.closeTag(t)+this.tagEndChar:this.indentate(n)+"<"+t+i+">"+s+"0&&this.options.processEntities)for(let t=0;t{const n=(e=>{for(const[t,i]of h)e=e.split(`${t}*`).join(`${t}{0,${i}}`).split(`${t}+`).join(`${t}{1,${i}}`);return e})(t),s=u++;r(e,s,t),c[e]=s,l[s]=t,o[s]=new RegExp(t,i?"g":void 0),a[s]=new RegExp(n,i?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),p("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${d}+`),p("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),p("FULL",`^${l[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),p("LOOSE",`^${l[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),p("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?`),p("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",l[c.COERCE],!0),p("COERCERTLFULL",l[c.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ce,ce.exports)),ce.exports),r=function(){if(J)return K;J=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return K=i=>i?"object"!=typeof i?e:i:t}(),{compareIdentifiers:o}=function(){if(ee)return Q;ee=1;const e=/^[0-9]+$/,t=(t,i)=>{const n=e.test(t),s=e.test(i);return n&&s&&(t=+t,i=+i),t===i?0:n&&!s?-1:s&&!n?1:tt(i,e)}}();class a{constructor(o,l){if(l=r(l),o instanceof a){if(o.loose===!!l.loose&&o.includePrerelease===!!l.includePrerelease)return o;o=o.version}else if("string"!=typeof o)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof o}".`);if(o.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",o,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const c=o.trim().match(l.loose?n[s.LOOSE]:n[s.FULL]);if(!c)throw new TypeError(`Invalid Version: ${o}`);if(this.raw=o,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===i)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===i&&(n=[t]),0===o(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return te=a}!function(){if(oe)return re;oe=1;const e=function(){if(se)return ne;se=1;const e=ue();return ne=(t,i,n=!1)=>{if(t instanceof e)return t;try{return new e(t,i)}catch(e){if(!n)return null;throw e}}}();re=(t,i)=>{const n=e(t,i);return n?n.version:null}}(),function(){if(le)return ae;le=1;const e=ue();ae=(t,i)=>new e(t,i).major}(),r.m}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return s[e].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(u=0;u=s)&&Object.keys(o.O).every((e=>o.O[e](i[l])))?i.splice(l--,1):(a=!1,s0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[i,n,s]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,i)=>(o.f[i](e,t),t)),[])),o.u=e=>e+"-"+e+".js?v="+{2441:"fc741cf57e9647f370a3",5862:"142cd48ca8ec32e57725",7874:"cd16576625b0c6e0d277"}[e],o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},n="nextcloud:",o.l=(e,t,s,r)=>{if(i[e])i[e].push(t);else{var a,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),u=0;u{a.onerror=a.onload=null,clearTimeout(p);var s=i[e];if(delete i[e],a.parentNode&&a.parentNode.removeChild(a),s&&s.forEach((e=>e(n))),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.j=2250,(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");if(i.length)for(var n=i.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=i[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{o.b=document.baseURI||self.location.href;var e={2250:0};o.f.j=(t,i)=>{var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)i.push(n[2]);else{var s=new Promise(((i,s)=>n=e[t]=[i,s]));i.push(n[2]=s);var r=o.p+o.u(t),a=new Error;o.l(r,(i=>{if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var s=i&&("load"===i.type?"missing":i.type),r=i&&i.target&&i.target.src;a.message="Loading chunk "+t+" failed.\n("+s+": "+r+")",a.name="ChunkLoadError",a.type=s,a.request=r,n[1](a)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,i)=>{var n,s,r=i[0],a=i[1],l=i[2],c=0;if(r.some((t=>0!==e[t]))){for(n in a)o.o(a,n)&&(o.m[n]=a[n]);if(l)var u=l(o)}for(t&&t(i);co(25704)));a=o.O(a)})(); //# sourceMappingURL=files_versions-files_versions.js.map?v=23539b7902f95d4b9b1f