/*! For license information please see files-reference-files.js.LICENSE.txt */ !function(){"use strict";var e,i={13057:function(e,i,n){var o=n(20144),r=n(31352),a=n(86680),l=n(79753),c=n(62520),s=n.n(c),d=n(25108),A={name:"ReferenceFileWidget",props:{richObject:{type:Object,required:!0},accessible:{type:Boolean,default:!0}},data:function(){return{previewUrl:window.OC.MimeType.getIconUrl(this.richObject.mimetype)}},computed:{fileSize:function(){return window.OC.Util.humanFileSize(this.richObject.size)},fileMtime:function(){return window.OC.Util.relativeModifiedDate(1e3*this.richObject.mtime)},filePath:function(){return s().dirname(this.richObject.path)},filePreview:function(){return this.previewUrl?{backgroundImage:"url("+this.previewUrl+")"}:{backgroundImage:"url("+window.OC.MimeType.getIconUrl(this.richObject.mimetype)+")"}},filePreviewClass:function(){return this.previewUrl?"widget-file--image--preview":"widget-file--image--icon"}},mounted:function(){var e=this;if(this.richObject["preview-available"]){var t=(0,l.generateUrl)("/core/preview?fileId={fileId}&x=250&y=250",{fileId:this.richObject.id}),i=new Image;i.onload=function(){e.previewUrl=t},i.onerror=function(e){d.error("could not load recommendation preview",e)},i.src=t}},methods:{navigate:function(){OCA.Viewer&&-1!==OCA.Viewer.mimetypes.indexOf(this.richObject.mimetype)?OCA.Viewer.open({path:this.richObject.path}):window.location=this.richObject.link}}},f=n(93379),p=n.n(f),u=n(7795),C=n.n(u),g=n(90569),w=n.n(g),m=n(3565),v=n.n(m),h=n(19216),b=n.n(h),x=n(44589),k=n.n(x),y=n(7574),O={};O.styleTagTransform=k(),O.setAttributes=v(),O.insert=w().bind(null,"head"),O.domAPI=C(),O.insertStyleElement=b(),p()(y.Z,O),y.Z&&y.Z.locals&&y.Z.locals;var j=n(51900),B=(0,j.Z)(A,(function(){var e=this,t=e._self._c;return e.accessible?t("a",{staticClass:"widget-file",attrs:{href:e.richObject.link},on:{click:function(t){return t.preventDefault(),e.navigate.apply(null,arguments)}}},[t("div",{staticClass:"widget-file--image",class:e.filePreviewClass,style:e.filePreview}),e._v(" "),t("div",{staticClass:"widget-file--details"},[t("p",{staticClass:"widget-file--title"},[e._v(e._s(e.richObject.name))]),e._v(" "),t("p",{staticClass:"widget-file--description"},[e._v(e._s(e.fileSize)),t("br"),e._v(e._s(e.fileMtime))]),e._v(" "),t("p",{staticClass:"widget-file--link"},[e._v(e._s(e.filePath))])])]):t("div",{staticClass:"widget-file widget-file--no-access"},[t("div",{staticClass:"widget-file--image widget-file--image--icon icon-folder"}),e._v(" "),t("div",{staticClass:"widget-file--details"},[t("p",{staticClass:"widget-file--title"},[e._v("\n\t\t\t"+e._s(e.t("files","File cannot be accessed"))+"\n\t\t")]),e._v(" "),t("p",{staticClass:"widget-file--description"},[e._v("\n\t\t\t"+e._s(e.t("files","You might not have have permissions to view it, ask the sender to share it"))+"\n\t\t")])])])}),[],!1,null,"3f729da0",null),_=B.exports,P=n(64024);function I(e,t,i,n,o,r,a){try{var l=e[r](a),c=l.value}catch(e){return void i(e)}l.done?t(c):Promise.resolve(c).then(n,o)}var E={name:"FileReferencePickerElement",components:{},props:{providerId:{type:String,required:!0},accessible:{type:Boolean,default:!1}},mounted:function(){this.openFilePicker(),window.addEventListener("click",this.onWindowClick)},beforeDestroy:function(){window.removeEventListener("click",this.onWindowClick)},methods:{onWindowClick:function(e){"A"===e.target.tagName&&e.target.classList.contains("oc-dialog-close")&&this.$emit("cancel")},openFilePicker:function(){var e,i=this;return(e=regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:OC.dialogs.filepicker(t("files","Select file or folder to link to"),(function(e){OC.Files.getClient().getFileInfo(e).then((function(e,t){i.submit(t.id)}))}),!1,[],!1,P.K9.Choose,"",{target:i.$refs.picker});case 1:case"end":return e.stop()}}),e)})),function(){var t=this,i=arguments;return new Promise((function(n,o){var r=e.apply(t,i);function a(e){I(r,n,o,a,l,"next",e)}function l(e){I(r,n,o,a,l,"throw",e)}a(void 0)}))})()},submit:function(e){var t=window.location.protocol+"//"+window.location.host+(0,l.generateUrl)("/f/{fileId}",{fileId:e});this.$emit("submit",t)}}},Z=E,F=n(99999),S={};S.styleTagTransform=k(),S.setAttributes=v(),S.insert=w().bind(null,"head"),S.domAPI=C(),S.insertStyleElement=b(),p()(F.Z,S),F.Z&&F.Z.locals&&F.Z.locals;var D=(0,j.Z)(Z,(function(){return(0,this._self._c)("div",{ref:"picker",staticClass:"reference-file-picker"})}),[],!1,null,"087c9640",null).exports;o.ZP.mixin({methods:{t:r.Iu}}),(0,a.registerWidget)("file",(function(e,t){var i=t.richObjectType,n=t.richObject,r=t.accessible;new(o.ZP.extend(_))({propsData:{richObjectType:i,richObject:n,accessible:r}}).$mount(e)})),(0,a.registerCustomPickerElement)("files",(function(e,t){var i=t.providerId,n=t.accessible,r=new(o.ZP.extend(D))({propsData:{providerId:i,accessible:n}}).$mount(e);return new a.NcCustomPickerRenderResult(r.$el,r)}),(function(e,t){t.object.$destroy()}))},99999:function(e,t,i){var n=i(87537),o=i.n(n),r=i(23645),a=i.n(r)()(o());a.push([e.id,".reference-file-picker[data-v-087c9640]{flex-grow:1;margin-top:44px}.reference-file-picker[data-v-087c9640] .oc-dialog{transform:none !important;box-shadow:none !important;flex-grow:1 !important;position:static !important;width:100% !important;height:auto !important;padding:0 !important;max-width:initial}.reference-file-picker[data-v-087c9640] .oc-dialog .oc-dialog-close{display:none}.reference-file-picker[data-v-087c9640] .oc-dialog .oc-dialog-buttonrow.onebutton.aside{position:absolute;padding:12px 32px}.reference-file-picker[data-v-087c9640] .oc-dialog .oc-dialog-content{max-width:100% !important}","",{version:3,sources:["webpack://./apps/files/src/views/FileReferencePickerElement.vue"],names:[],mappings:"AACA,wCACC,WAAA,CACA,eAAA,CAEA,mDACC,yBAAA,CACA,0BAAA,CACA,sBAAA,CACA,0BAAA,CACA,qBAAA,CACA,sBAAA,CACA,oBAAA,CACA,iBAAA,CAEA,oEACC,YAAA,CAGD,wFACC,iBAAA,CACA,iBAAA,CAGD,sEACC,yBAAA",sourcesContent:["\n.reference-file-picker {\n\tflex-grow: 1;\n\tmargin-top: 44px;\n\n\t&:deep(.oc-dialog) {\n\t\ttransform: none !important;\n\t\tbox-shadow: none !important;\n\t\tflex-grow: 1 !important;\n\t\tposition: static !important;\n\t\twidth: 100% !important;\n\t\theight: auto !important;\n\t\tpadding: 0 !important;\n\t\tmax-width: initial;\n\n\t\t.oc-dialog-close {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t.oc-dialog-buttonrow.onebutton.aside {\n\t\t\tposition: absolute;\n\t\t\tpadding: 12px 32px;\n\t\t}\n\n\t\t.oc-dialog-content {\n\t\t\tmax-width: 100% !important;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]),t.Z=a},7574:function(e,t,i){var n=i(87537),o=i.n(n),r=i(23645),a=i.n(r)()(o());a.push([e.id,".widget-file[data-v-3f729da0]{display:flex;flex-grow:1;color:var(--color-main-text) !important;text-decoration:none !important}.widget-file--image[data-v-3f729da0]{min-width:40%;background-position:center;background-size:cover;background-repeat:no-repeat}.widget-file--image.widget-file--image--icon[data-v-3f729da0]{min-width:88px;background-size:44px}.widget-file--title[data-v-3f729da0]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:bold}.widget-file--details[data-v-3f729da0]{padding:12px;flex-grow:1;display:flex;flex-direction:column}.widget-file--details p[data-v-3f729da0]{margin:0;padding:0}.widget-file--description[data-v-3f729da0]{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical}.widget-file--link[data-v-3f729da0]{color:var(--color-text-maxcontrast)}.widget-file.widget-file--no-access[data-v-3f729da0]{padding:12px}.widget-file.widget-file--no-access .widget-file--details[data-v-3f729da0]{padding:0}","",{version:3,sources:["webpack://./apps/files/src/views/ReferenceFileWidget.vue"],names:[],mappings:"AACA,8BACC,YAAA,CACA,WAAA,CACA,uCAAA,CACA,+BAAA,CAEA,qCACC,aAAA,CACA,0BAAA,CACA,qBAAA,CACA,2BAAA,CAEA,8DACC,cAAA,CACA,oBAAA,CAIF,qCACC,eAAA,CACA,sBAAA,CACA,kBAAA,CACA,gBAAA,CAGD,uCACC,YAAA,CACA,WAAA,CACA,YAAA,CACA,qBAAA,CAEA,yCACC,QAAA,CACA,SAAA,CAIF,2CACC,eAAA,CACA,sBAAA,CACA,mBAAA,CACA,oBAAA,CACA,YAAA,CACA,2BAAA,CAGD,oCACC,mCAAA,CAGD,qDACC,YAAA,CAEA,2EACC,SAAA",sourcesContent:["\n.widget-file {\n\tdisplay: flex;\n\tflex-grow: 1;\n\tcolor: var(--color-main-text) !important;\n\ttext-decoration: none !important;\n\n\t&--image {\n\t\tmin-width: 40%;\n\t\tbackground-position: center;\n\t\tbackground-size: cover;\n\t\tbackground-repeat: no-repeat;\n\n\t\t&.widget-file--image--icon {\n\t\t\tmin-width: 88px;\n\t\t\tbackground-size: 44px;\n\t\t}\n\t}\n\n\t&--title {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tfont-weight: bold;\n\t}\n\n\t&--details {\n\t\tpadding: 12px;\n\t\tflex-grow: 1;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\tp {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t}\n\n\t&--description {\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\tdisplay: -webkit-box;\n\t\t-webkit-line-clamp: 3;\n\t\tline-clamp: 3;\n\t\t-webkit-box-orient: vertical;\n\t}\n\n\t&--link {\n\t\tcolor: var(--color-text-maxcontrast);\n\t}\n\n\t&.widget-file--no-access {\n\t\tpadding: 12px;\n\n\t\t.widget-file--details {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n}\n"],sourceRoot:""}]),t.Z=a}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={id:e,loaded:!1,exports:{}};return i[e].call(r.exports,r,r.exports,o),r.loaded=!0,r.exports}o.m=i,e=[],o.O=function(t,i,n,r){if(!i){var a=1/0;for(d=0;d=r)&&Object.keys(o.O).every((function(e){return o.O[e](i[c])}))?i.splice(c--,1):(l=!1,r0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[i,n,r]},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 i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},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=9098,function(){o.b=document.baseURI||self.location.href;var e={9098:0};o.O.j=function(t){return 0===e[t]};var t=function(t,i){var n,r,a=i[0],l=i[1],c=i[2],s=0;if(a.some((function(t){return 0!==e[t]}))){for(n in l)o.o(l,n)&&(o.m[n]=l[n]);if(c)var d=c(o)}for(t&&t(i);s