photos/js/photos-src_services_DavRequ...

3 lines
14 KiB
JavaScript

/*! For license information please see photos-src_services_DavRequest_js-src_utils_CancelableRequest_js-src_components_File_vue.js.LICENSE.txt */
"use strict";(self.webpackChunkphotos=self.webpackChunkphotos||[]).push([["src_services_DavRequest_js-src_utils_CancelableRequest_js-src_components_File_vue"],{2161:(t,n,e)=>{e.d(n,{N:()=>i,Z:()=>o});var i="\n\t<oc:fileid />\n\t<d:getlastmodified />\n\t<d:getetag />\n\t<d:getcontenttype />\n\t<d:getcontentlength />\n\t<nc:realpath />\n\t<nc:has-preview />\n\t<nc:file-metadata-size />\n\t<nc:face-detections />\n\t<oc:favorite />\n\t<d:resourcetype />";const o='<?xml version="1.0"?>\n\t\t\t<d:propfind xmlns:d="DAV:"\n\t\t\t\txmlns:oc="http://owncloud.org/ns"\n\t\t\t\txmlns:nc="http://nextcloud.org/ns"\n\t\t\t\txmlns:ocs="http://open-collaboration-services.org/ns">\n\t\t\t\t<d:prop>\n\t\t\t\t\t'.concat(i,"\n\t\t\t\t</d:prop>\n\t\t\t</d:propfind>")},4615:(t,n,e)=>{e.d(n,{Z:()=>a});var i=e(4820);function o(t,n,e,i,o,a,r){try{var A=t[a](r),s=A.value}catch(t){return void e(t)}A.done?n(s):Promise.resolve(s).then(i,o)}const a=function(t){var n=i.default.CancelToken.source();return{request:function(){var e,i=(e=regeneratorRuntime.mark((function e(i,o){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t(i,Object.assign({cancelToken:n.token},o)));case 1:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(i,a){var r=e.apply(t,n);function A(t){o(r,i,a,A,s,"next",t)}function s(t){o(r,i,a,A,s,"throw",t)}A(void 0)}))});return function(t,n){return i.apply(this,arguments)}}(),cancel:n.cancel}}},84496:(t,n,e)=>{e.d(n,{Z:()=>A});var i=e(87537),o=e.n(i),a=e(23645),r=e.n(a)()(o());r.push([t.id,'.file-container[data-v-67e992e4]{background:var(--color-primary-light);position:relative;height:100%;width:100%;border:2px solid var(--color-main-background);box-sizing:border-box}.file-container.selected[data-v-67e992e4]::after,.file-container[data-v-67e992e4]:focus-within::after{position:absolute;top:0;left:0;z-index:2;width:100%;height:100%;content:"";outline:var(--color-primary) solid 4px;outline-offset:-4px;pointer-events:none}.file-container .file[data-v-67e992e4]{width:100%;height:100%;box-sizing:border-box;outline:none}.file-container .file__images[data-v-67e992e4]{display:contents}.file-container .file__images .video-icon[data-v-67e992e4]{position:absolute;top:0px;right:0px;width:100%;height:100%;z-index:1;opacity:.8}.file-container .file__images .video-icon[data-v-67e992e4] .material-design-icon__svg{fill:var(--color-main-background)}.file-container .file__images img[data-v-67e992e4]{width:100%;height:100%;object-fit:cover;position:absolute;color:transparent}.file-container .file__images .loading-overlay[data-v-67e992e4]{position:absolute;height:100%;width:100%;display:flex;align-content:center;align-items:center;justify-content:center}.file-container .file__images .loading-overlay svg[data-v-67e992e4]{width:70%;height:70%}.file-container .file__hidden-description[data-v-67e992e4]{position:absolute;left:-10000px;top:-10000px;width:1px;height:1px;overflow:hidden}.file-container .file__hidden-description.show[data-v-67e992e4]{position:initial;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.file-container:hover .selection-checkbox[data-v-67e992e4],.file-container.selected .selection-checkbox[data-v-67e992e4],.file-container:focus-within .selection-checkbox[data-v-67e992e4]{display:flex}.file-container:hover .favorite-state[data-v-67e992e4],.file-container.selected .favorite-state[data-v-67e992e4],.file-container:focus-within .favorite-state[data-v-67e992e4]{display:none}.file-container .selection-checkbox[data-v-67e992e4]{display:none;position:absolute;top:8px;right:min(22px,50% - 7px);z-index:1;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.file-container .selection-checkbox[data-v-67e992e4] .checkbox-radio-switch__label{padding:10px;box-sizing:border-box}.file-container .selection-checkbox[data-v-67e992e4] .checkbox-radio-switch__label::after{content:"";background:var(--color-primary-light);width:16px;height:16px;position:absolute;left:1px;z-index:-1}.file-container .selection-checkbox[data-v-67e992e4] .checkbox-radio-switch__label .checkbox-radio-switch__icon{margin:0}.file-container .selection-checkbox .input-label[data-v-67e992e4]{position:fixed;z-index:-1;top:-5000px;left:-5000px}.file-container .favorite-state[data-v-67e992e4]{position:absolute;top:2px;right:min(2px,50% - 7px)}.file-container .favorite-state[data-v-67e992e4] .material-design-icon__svg{fill:#fc0}.file-container .favorite-state[data-v-67e992e4] .material-design-icon__svg path{stroke:var(--color-primary-light);stroke-width:1px}',"",{version:3,sources:["webpack://./src/components/File.vue"],names:[],mappings:"AAiOA,iCACC,qCAAA,CACA,iBAAA,CACA,WAAA,CACA,UAAA,CACA,6CAAA,CACA,qBAAA,CAIC,sGACC,iBAAA,CACA,KAAA,CACA,MAAA,CACA,SAAA,CACA,UAAA,CACA,WAAA,CACA,UAAA,CACA,sCAAA,CACA,mBAAA,CACA,mBAAA,CAIF,uCACC,UAAA,CACA,WAAA,CACA,qBAAA,CACA,YAAA,CAEA,+CACC,gBAAA,CAEA,2DACC,iBAAA,CACA,OAAA,CACA,SAAA,CACA,UAAA,CACA,WAAA,CACA,SAAA,CACA,UAAA,CAEA,uFACC,iCAAA,CAIF,mDACC,UAAA,CACA,WAAA,CACA,gBAAA,CACA,iBAAA,CACA,iBAAA,CAGD,gEACC,iBAAA,CACA,WAAA,CACA,UAAA,CACA,YAAA,CACA,oBAAA,CACA,kBAAA,CACA,sBAAA,CAEA,oEACC,SAAA,CACA,UAAA,CAKH,2DACC,iBAAA,CACA,aAAA,CACA,YAAA,CACA,SAAA,CACA,UAAA,CACA,eAAA,CAEA,gEACC,gBAAA,CACA,yBAAA,CAAA,sBAAA,CAAA,iBAAA,CACA,0BAAA,CAAA,uBAAA,CAAA,kBAAA,CAOF,2LACC,YAAA,CAGD,+KACC,YAAA,CAIF,qDACC,YAAA,CACA,iBAAA,CACA,OAAA,CAEA,yBAAA,CACA,SAAA,CACA,yBAAA,CAAA,sBAAA,CAAA,iBAAA,CAGA,oFACC,YAAA,CACA,qBAAA,CAGA,2FACC,UAAA,CACA,qCAAA,CACA,UAAA,CACA,WAAA,CACA,iBAAA,CACA,QAAA,CACA,UAAA,CAGD,iHACC,QAAA,CAIF,kEACC,cAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CAIF,iDACC,iBAAA,CACA,OAAA,CAEA,wBAAA,CAEA,6EACC,SAAA,CAEA,kFACC,iCAAA,CACA,gBAAA",sourcesContent:['$sizes: ("400": ("count": 3, "marginTop": 66, "marginW": 8), "700": ("count": 4, "marginTop": 66, "marginW": 8), "1024": ("count": 5, "marginTop": 66, "marginW": 44), "1280": ("count": 4, "marginTop": 66, "marginW": 44), "1440": ("count": 5, "marginTop": 88, "marginW": 66), "1600": ("count": 6, "marginTop": 88, "marginW": 66), "2048": ("count": 7, "marginTop": 88, "marginW": 66), "2560": ("count": 8, "marginTop": 88, "marginW": 88), "3440": ("count": 9, "marginTop": 88, "marginW": 88), "max": ("count": 10, "marginTop": 88, "marginW": 88));\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.file-container {\n\tbackground: var(--color-primary-light);\n\tposition: relative;\n\theight: 100%;\n\twidth: 100%;\n\tborder: 2px solid var(--color-main-background); // Use border so create a separation between images.\n\tbox-sizing: border-box;\n\n\t// Selection border.\n\t&.selected, &:focus-within {\n\t\t&::after {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tz-index: 2;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tcontent: \'\';\n\t\t\toutline: var(--color-primary) solid 4px;\n\t\t\toutline-offset: -4px;\n\t\t\tpointer-events: none;\n\t\t}\n\t}\n\n\t.file {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tbox-sizing: border-box;\n\t\toutline: none; // Override global focus state.\n\n\t\t&__images {\n\t\t\tdisplay: contents;\n\n\t\t\t.video-icon {\n\t\t\t\tposition: absolute;\n\t\t\t\ttop: 0px;\n\t\t\t\tright: 0px;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tz-index: 1;\n\t\t\t\topacity: 0.8;\n\n\t\t\t\t::v-deep .material-design-icon__svg {\n\t\t\t\t\tfill: var(--color-main-background);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\timg {\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tobject-fit: cover;\n\t\t\t\tposition: absolute;\n\t\t\t\tcolor: transparent; /// Hide alt=\'\' text when loading.\n\t\t\t}\n\n\t\t\t.loading-overlay {\n\t\t\t\tposition: absolute;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 100%;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-content: center;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\n\t\t\t\tsvg {\n\t\t\t\t\twidth: 70%;\n\t\t\t\t\theight: 70%;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t&__hidden-description {\n\t\t\tposition: absolute;\n\t\t\tleft: -10000px;\n\t\t\ttop: -10000px;\n\t\t\twidth: 1px;\n\t\t\theight: 1px;\n\t\t\toverflow: hidden;\n\n\t\t\t&.show {\n\t\t\t\tposition: initial;\n\t\t\t\twidth: fit-content;\n\t\t\t\theight: fit-content;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Reveal checkbox on hover.\n\t&:hover, &.selected, &:focus-within {\n\t\t.selection-checkbox {\n\t\t\tdisplay: flex;\n\t\t}\n\n\t\t.favorite-state {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\n\t.selection-checkbox {\n\t\tdisplay: none;\n\t\tposition: absolute;\n\t\ttop: 8px;\n\t\t// Fancy calculation to render the checkbox in the middle of narrow images.\n\t\tright: min(22px, calc(50% - 7px));\n\t\tz-index: 1;\n\t\twidth: fit-content;\n\n\t\t// Make the checkbox background round on hover.\n\t\t::v-deep .checkbox-radio-switch__label {\n\t\t\tpadding: 10px;\n\t\t\tbox-sizing: border-box;\n\n\t\t\t// Add a background to the checkbox so we do not see the image through it.\n\t\t\t&::after {\n\t\t\t\tcontent: \'\';\n\t\t\t\tbackground: var(--color-primary-light);\n\t\t\t\twidth: 16px;\n\t\t\t\theight: 16px;\n\t\t\t\tposition: absolute;\n\t\t\t\tleft: 1px;\n\t\t\t\tz-index: -1;\n\t\t\t}\n\n\t\t\t.checkbox-radio-switch__icon {\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t}\n\n\t\t.input-label {\n\t\t\tposition: fixed;\n\t\t\tz-index: -1;\n\t\t\ttop: -5000px;\n\t\t\tleft: -5000px;\n\t\t}\n\t}\n\n\t.favorite-state {\n\t\tposition: absolute;\n\t\ttop: 2px;\n\t\t// Fancy calculation to render the start in the middle of narrow images.\n\t\tright: min(2px, calc(50% - 7px));\n\n\t\t::v-deep .material-design-icon__svg {\n\t\t\tfill: #FC0;\n\n\t\t\tpath {\n\t\t\t\tstroke: var(--color-primary-light);\n\t\t\t\tstroke-width: 1px;\n\t\t\t}\n\t\t}\n\t}\n}\n'],sourceRoot:""}]);const A=r},53932:(n,e,i)=>{i.d(e,{Z:()=>z});var o=i(46405),a=i(69525),r=i(79753),A=i(22200),s=i(33476),c=i(81090),l=i(32114);function d(t,n,e,i,o,a,r){try{var A=t[a](r),s=A.value}catch(t){return void e(t)}A.done?n(s):Promise.resolve(s).then(i,o)}function h(t){return function(){var n=this,e=arguments;return new Promise((function(i,o){var a=t.apply(n,e);function r(t){d(a,i,o,r,A,"next",t)}function A(t){d(a,i,o,r,A,"throw",t)}r(void 0)}))}}const C={name:"File",components:{CheckboxRadioSwitch:s.CheckboxRadioSwitch,Star:o.default,VideoIcon:a.Z},mixins:[c.Z],inheritAttrs:!1,props:{file:{type:Object,required:!0},selected:{type:Boolean,required:!0},allowSelection:{type:Boolean,default:!0},visibility:{type:String,required:!0},semaphore:{type:l.Z,required:!0}},data:function(){return{loaded:!1,error:!1,canLoad:!1,semaphoreSymbol:null,isDestroyed:!1}},computed:{davPath:function(){return(0,r.generateRemoteUrl)("dav/files/".concat((0,A.getCurrentUser)().uid))+this.file.filename},ariaDescription:function(){return"image-description-".concat(this.file.fileid)},ariaLabel:function(){return t("photos",'Open the full size "{name}" image',{name:this.file.basename})},isImage:function(){return this.file.mime.startsWith("image")},decodedEtag:function(){return this.file.etag.replace("&quot;","").replace("&quot;","")},srcVisible:function(){return this.getItemURL(512)},srcNear:function(){return this.getItemURL(64)}},mounted:function(){var t=this;setTimeout(h(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.semaphore.acquire((function(){switch(t.visibility){case"visible":return 1;case"near":return 2;default:return 3}}),t.file.fileid);case 2:t.semaphoreSymbol=n.sent,t.canLoad=!0,("none"===t.visibility||t.isDestroyed)&&t.releaseSemaphore();case 5:case"end":return n.stop()}}),n)}))),250)},beforeDestroy:function(){this.isDestroyed=!0,this.releaseSemaphore(),void 0!==this.$refs.imgNear&&(this.$refs.imgNear.src=""),void 0!==this.$refs.srcVisible&&(this.$refs.srcVisible.src="")},methods:{emitClick:function(){this.$emit("click",this.file.fileid)},onLoad:function(){this.loaded=!0,this.releaseSemaphore()},onError:function(){this.error=!0,this.releaseSemaphore()},onToggle:function(t){this.$emit("select-toggled",{id:this.file.fileid,value:t})},getItemURL:function(t){return(0,r.generateUrl)("/core/preview?fileId=".concat(this.file.fileid,"&c=").concat(this.decodedEtag,"&x=").concat(t,"&y=").concat(t,"&forceIcon=0&a=1"))},releaseSemaphore:function(){null!==this.semaphoreSymbol&&(this.semaphore.release(this.semaphoreSymbol),this.semaphoreSymbol=null)}}};var p=i(93379),f=i.n(p),u=i(7795),g=i.n(u),m=i(90569),v=i.n(m),b=i(3565),x=i.n(b),w=i(19216),_=i.n(w),k=i(44589),y=i.n(k),B=i(84496),S={};S.styleTagTransform=y(),S.setAttributes=x(),S.insert=v().bind(null,"head"),S.domAPI=g(),S.insertStyleElement=_();f()(B.Z,S);B.Z&&B.Z.locals&&B.Z.locals;const z=(0,i(51900).Z)(C,(function(){var t=this,n=t.$createElement,e=t._self._c||n;return e("div",{staticClass:"file-container",class:{selected:t.selected}},[e("a",{staticClass:"file",attrs:{href:t.davPath,"aria-label":t.ariaLabel},on:{click:function(n){return n.preventDefault(),t.emitClick.apply(null,arguments)}}},[e("div",{staticClass:"file__images"},[t.file.mime.includes("video")?e("VideoIcon",{staticClass:"video-icon",attrs:{size:64}}):t._e(),t._v(" "),"none"!==t.visibility&&t.canLoad&&!t.error?e("img",{key:t.file.basename+"-near",ref:"imgNear",attrs:{src:t.srcNear,alt:t.file.basename,"aria-describedby":t.ariaDescription},on:{load:t.onLoad,error:t.onError}}):t._e(),t._v(" "),"visible"===t.visibility&&t.canLoad&&!t.error?e("img",{key:t.file.basename+"-visible",ref:"imgVisible",attrs:{src:t.srcVisible,alt:t.file.basename,"aria-describedby":t.ariaDescription},on:{load:t.onLoad,error:t.onError}}):t._e()],1),t._v(" "),e("p",{staticClass:"file__hidden-description",class:{show:t.error},attrs:{id:t.ariaDescription}},[t._v(t._s(t.file.basename))])]),t._v(" "),t.allowSelection?e("CheckboxRadioSwitch",{staticClass:"selection-checkbox",attrs:{checked:t.selected},on:{"update:checked":t.onToggle}},[e("span",{staticClass:"input-label"},[t._v(t._s(t.t("photos","Select image {imageName}",{imageName:t.file.basename})))])]):t._e(),t._v(" "),1===t.file.favorite?e("Star",{staticClass:"favorite-state",attrs:{"aria-label":t.t("photos","The file is in the favorites")}}):t._e()],1)}),[],!1,null,"67e992e4",null).exports}}]);
//# sourceMappingURL=photos-src_services_DavRequest_js-src_utils_CancelableRequest_js-src_components_File_vue.js.map?v=0dc8d0d25f2781672fee