/*! For license information please see files_versions-files_versions.js.LICENSE.txt */ !function(){var e,n={227:function(e,n,r){"use strict";var o=r(20144),s=r(31352),i=r(64024),a=r(45994),l=r(81063),c=r(79753),u=r(4820);(0,l.getPatcher)().patch("request",u.default);var f=(0,c.generateRemoteUrl)("dav"),d=(0,l.createClient)(f),v='\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n',p=(0,r(17499).IY)().setApp("files_version").detectUser().build(),m=r(65358),h=r(80351),b=r.n(h);function j(e,t,n,r,o,s,i){try{var a=e[s](i),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,o)}function A(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var s=e.apply(t,n);function i(e){j(s,r,o,i,a,"next",e)}function a(e){j(s,r,o,i,a,"throw",e)}i(void 0)}))}}function y(e){return g.apply(this,arguments)}function g(){return(g=A(regeneratorRuntime.mark((function e(t){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="/versions/".concat(null===(n=(0,a.ts)())||void 0===n?void 0:n.uid,"/versions/").concat(t.id),e.prev=1,e.next=4,d.getDirectoryContents(r,{data:v,details:!0});case 4:return o=e.sent,e.abrupt("return",o.data.filter((function(e){return""!==e.mime})).map((function(e){return C(e,t)})));case 8:throw e.prev=8,e.t0=e.catch(1),p.error("Could not fetch version",{exception:e.t0}),e.t0;case 12:case"end":return e.stop()}}),e,null,[[1,8]])})))).apply(this,arguments)}function _(e){return x.apply(this,arguments)}function x(){return(x=A(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,p.debug("Restoring version",{url:t.url}),e.next=4,d.moveFile("/versions/".concat(null===(n=(0,a.ts)())||void 0===n?void 0:n.uid,"/versions/").concat(t.fileId,"/").concat(t.fileVersion),"/versions/".concat(null===(r=(0,a.ts)())||void 0===r?void 0:r.uid,"/restore/target"));case 4:e.next=10;break;case 6:throw e.prev=6,e.t0=e.catch(0),p.error("Could not restore version",{exception:e.t0}),e.t0;case 10:case"end":return e.stop()}}),e,null,[[0,6]])})))).apply(this,arguments)}function C(e,t){return{fileId:t.id,label:e.props["version-label"],fileName:e.filename,mimeType:e.mime,size:e.size,type:e.type,mtime:1e3*b()(e.lastmod).unix(),preview:(0,c.generateUrl)("/apps/files_versions/preview?file={file}&version={fileVersion}",{file:(0,m.RQ)(t.path,t.name),fileVersion:e.basename}),url:(0,m.RQ)("/remote.php/dav",e.filename),fileVersion:e.basename}}function w(e,t){return k.apply(this,arguments)}function k(){return(k=A(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.customRequest(t.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'.concat(n,"\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t")});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function V(e){return O.apply(this,arguments)}function O(){return(O=A(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.deleteFile(t.fileName);case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var I=r(88722),R=r(41293),z=r(73229),S=r(80419),L=r(57612),P=r(24860),N=r(15961),D=r(79954),B={name:"Version",components:{NcActionLink:N.ih,NcActionButton:N.Js,NcListItem:N.hx,NcModal:N.Jc,NcButton:N.P2,NcTextField:N.h3,BackupRestore:I.Z,Download:R.Z,Pencil:z.default,Check:S.default,Delete:L.Z,ImageOffOutline:P.Z},directives:{tooltip:N.u},filters:{humanReadableSize:function(e){return OC.Util.humanFileSize(e)},humanDateFromNow:function(e){return b()(e).fromNow()}},props:{version:{type:Object,required:!0},fileInfo:{type:Object,required:!0},isCurrent:{type:Boolean,default:!1},isFirstVersion:{type:Boolean,default:!1}},data:function(){return{showVersionLabelForm:!1,formVersionLabelValue:this.version.label,capabilities:(0,D.j)("core","capabilities",{files:{version_labeling:!1,version_deletion:!1}}),previewError:!1}},computed:{versionLabel:function(){var e,t=null!==(e=this.version.label)&&void 0!==e?e:"";return this.isCurrent?""===t?(0,s.Iu)("files_versions","Current version"):"".concat(t," (").concat((0,s.Iu)("files_versions","Current version"),")"):this.isFirstVersion&&""===t?(0,s.Iu)("files_versions","Initial version"):t},downloadURL:function(){return this.isCurrent?(0,m.RQ)("/remote.php/webdav",this.fileInfo.path,this.fileInfo.name):this.version.url},previewURL:function(){return this.isCurrent?(0,c.generateUrl)("/core/preview?fileId={fileId}&c={fileEtag}&x=250&y=250&forceIcon=0&a=0",{fileId:this.fileInfo.id,fileEtag:this.fileInfo.etag}):this.version.preview},formattedDate:function(){return b()(this.version.mtime).format("LLL")}},methods:{openVersionLabelModal:function(){var e=this;this.showVersionLabelForm=!0,this.$nextTick((function(){e.$refs.labelInput.$el.getElementsByTagName("input")[0].focus()}))},restoreVersion:function(){this.$emit("restore",this.version)},setVersionLabel:function(e){this.formVersionLabelValue=e,this.showVersionLabelForm=!1,this.$emit("label-update",this.version,e)},deleteVersion:function(){this.$emit("delete",this.version)}}},F=r(93379),E=r.n(F),U=r(7795),T=r.n(U),Z=r(90569),M=r.n(Z),$=r(3565),q=r.n($),Y=r(19216),G=r.n(Y),Q=r(44589),J=r.n(Q),H=r(77547),W={};W.styleTagTransform=J(),W.setAttributes=q(),W.insert=M().bind(null,"head"),W.domAPI=T(),W.insertStyleElement=G(),E()(H.Z,W),H.Z&&H.Z.locals&&H.Z.locals;var K=r(51900);function X(e){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X(e)}function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function te(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=s)&&Object.keys(o.O).every((function(e){return o.O[e](n[l])}))?n.splice(l--,1):(a=!1,s0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[n,r,s]},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},o.j=1358,function(){o.b=document.baseURI||self.location.href;var e={1358:0};o.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,s,i=n[0],a=n[1],l=n[2],c=0;if(i.some((function(t){return 0!==e[t]}))){for(r in a)o.o(a,r)&&(o.m[r]=a[r]);if(l)var u=l(o)}for(t&&t(n);c