photos/js/photos-vendors-node_modules...

3 lines
14 KiB
JavaScript

/*! For license information please see photos-vendors-node_modules_vue-virtual-grid_dist_vue-virtual-grid_es_js-node_modules_vue-material-d-4106f0.js.LICENSE.txt */
"use strict";(self.webpackChunkphotos=self.webpackChunkphotos||[]).push([["vendors-node_modules_vue-virtual-grid_dist_vue-virtual-grid_es_js-node_modules_vue-material-d-4106f0"],{29837:(t,e,n)=>{n.d(e,{Z:()=>W});var r=n(20144),o=Object.defineProperty,i=Object.defineProperties,a=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,u=(t,e,n)=>e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,d=(t,e)=>{for(var n in e||(e={}))c.call(e,n)&&u(t,n,e[n]);if(l)for(var n of l(e))s.call(e,n)&&u(t,n,e[n]);return t},f=(t,e)=>i(t,a(e));function p(t){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function g(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach((function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)}))}var m={__proto__:[]}instanceof Array;function y(t){return function(e,n,r){var o="function"==typeof e?e:e.constructor;o.__decorators__||(o.__decorators__=[]),"number"!=typeof r&&(r=void 0),o.__decorators__.push((function(e){return t(e,n,r)}))}}var w=["data","beforeCreate","created","beforeMount","mounted","beforeDestroy","destroyed","beforeUpdate","updated","activated","deactivated","render","errorCaptured","serverPrefetch"];function v(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.name=e.name||t._componentTag||t.name;var n=t.prototype;Object.getOwnPropertyNames(n).forEach((function(t){if("constructor"!==t)if(w.indexOf(t)>-1)e[t]=n[t];else{var r=Object.getOwnPropertyDescriptor(n,t);void 0!==r.value?"function"==typeof r.value?(e.methods||(e.methods={}))[t]=r.value:(e.mixins||(e.mixins=[])).push({data:function(){return function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},t,r.value)}}):(r.get||r.set)&&((e.computed||(e.computed={}))[t]={get:r.get,set:r.set})}})),(e.mixins||(e.mixins=[])).push({data:function(){return function(t,e){var n=e.prototype._init;e.prototype._init=function(){var e=this,n=Object.getOwnPropertyNames(t);if(t.$options.props)for(var r in t.$options.props)t.hasOwnProperty(r)||n.push(r);n.forEach((function(n){Object.defineProperty(e,n,{get:function(){return t[n]},set:function(e){t[n]=e},configurable:!0})}))};var r=new e;e.prototype._init=n;var o={};return Object.keys(r).forEach((function(t){void 0!==r[t]&&(o[t]=r[t])})),o}(this,t)}});var o=t.__decorators__;o&&(o.forEach((function(t){return t(e)})),delete t.__decorators__);var i,a,l=Object.getPrototypeOf(t.prototype),c=l instanceof r.ZP?l.constructor:r.ZP,s=c.extend(e);return function(t,e,n){Object.getOwnPropertyNames(e).forEach((function(r){if(!b[r]){var o=Object.getOwnPropertyDescriptor(t,r);if(!o||o.configurable){var i,a,l=Object.getOwnPropertyDescriptor(e,r);if(!m){if("cid"===r)return;var c=Object.getOwnPropertyDescriptor(n,r);if(i=l.value,a=p(i),null!=i&&("object"===a||"function"===a)&&c&&c.value===l.value)return}Object.defineProperty(t,r,l)}}}))}(s,t,c),"undefined"!=typeof Reflect&&Reflect.defineMetadata&&Reflect.getOwnMetadataKeys&&(g(i=s,a=t),Object.getOwnPropertyNames(a.prototype).forEach((function(t){g(i.prototype,a.prototype,t)})),Object.getOwnPropertyNames(a).forEach((function(t){g(i,a,t)}))),s}var b={prototype:!0,arguments:!0,callee:!0,caller:!0};function _(t){return"function"==typeof t?v(t):function(e){return v(e,t)}}_.registerHooks=function(t){w.push.apply(w,h(t))},globalThis&&globalThis.__spreadArrays;var O="__reactiveInject__";var R="undefined"!=typeof Reflect&&void 0!==Reflect.getMetadata;function S(t){return void 0===t&&(t={}),function(e,n){!function(t,e,n){if(R&&!Array.isArray(t)&&"function"!=typeof t&&!t.hasOwnProperty("type")&&void 0===t.type){var r=Reflect.getMetadata("design:type",e,n);r!==Object&&(t.type=r)}}(t,e,n),y((function(e,n){(e.props||(e.props={}))[n]=t}))(e,n)}}function D(t){return y((function(e,n){var r,o=e.provide;!function(t){Array.isArray(t.inject)||(t.inject=t.inject||{},t.inject[O]={from:O,default:{}})}(e),("function"!=typeof(r=o)||!r.managed&&!r.managedReactive)&&(o=e.provide=function(t){var e=function(){var n=this,r="function"==typeof t?t.call(this):t;for(var o in(r=Object.create(r||null))[O]=Object.create(this[O]||{}),e.managed)r[e.managed[o]]=this[o];var i=function(t){r[e.managedReactive[t]]=a[t],Object.defineProperty(r[O],e.managedReactive[t],{enumerable:!0,configurable:!0,get:function(){return n[t]}})},a=this;for(var o in e.managedReactive)i(o);return r};return e.managed={},e.managedReactive={},e}(o)),o.managedReactive[n]=t||n}))}const C=(t,e)=>t>720&&e>480?10:5,j=t=>Math.floor(t/250),M=t=>Math.round(1.5*t),E=(t,e,n)=>{const r=t/e;return Math.round(n*r)},x=function(t){if(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];console.debug(...n)}};var z=Object.defineProperty,P=Object.getOwnPropertyDescriptor,A=(t,e,n,r)=>{for(var o,i=r>1?void 0:r?P(e,n):e,a=t.length-1;a>=0;a--)(o=t[a])&&(i=(r?o(e,n,i):o(i))||i);return r&&i&&z(e,n,i),i};let N=class extends r.ZP{constructor(){super(...arguments),this.updateLock=!1,this.bottomReached=!1,this.ref=null,this.containerData={windowSize:{height:0,width:0},windowScroll:{x:0,y:0},elementWindowOffset:0,elementSize:{height:0,width:0}}}get loadingBatch(){return this.loader&&this.updateLock}get configData(){return this.computeConfigData(this.containerData,this.items)}get layoutData(){return this.computeLayoutData(this.configData)}get renderData(){return this.computeRenderData(this.configData,this.containerData,this.layoutData)}mounted(){var t;this.ref=this.$refs.virtualGrid,this.initiliazeGrid(),window.addEventListener("resize",this.resize),(null!=(t=this.scrollElement)?t:window).addEventListener("scroll",this.scroll)}beforeDestroy(){var t;window.removeEventListener("resize",this.resize),(null!=(t=this.scrollElement)?t:window).removeEventListener("scroll",this.scroll)}onScrollElementChanged(t,e){(null!=e?e:window).removeEventListener("scroll",this.scroll),(null!=t?t:window).addEventListener("scroll",this.scroll)}resize(){this.loadMoreData()}scroll(){this.loadMoreData()}initiliazeGrid(){this.computeContainerData(),this.$nextTick((async()=>{this.loadMoreData()}))}loadMoreData(){this.loadMoreDataAsync().catch((t=>{t&&console.error("Fail to load next data batch",t)})).then()}async loadMoreDataAsync(){this.computeContainerData();const t=this.containerData.windowScroll.y+this.containerData.windowSize.height,e=Math.max(0,this.containerData.elementWindowOffset+this.containerData.elementSize.height-this.updateTriggerMargin);if(!this.bottomReached&&t>=e&&!this.updateLock){this.updateLock=!0,x(this.debug,"Loading next batch");await this.updateFunction()&&(x(this.debug,"Bottom reached"),this.bottomReached=!0),this.updateLock=!1,await this.loadMoreDataAsync()}}computeContainerData(){if(null===this.ref)return;const t=this.getWindowSize(),e=this.getWindowScroll(),n=this.getElementOffset(this.ref),r=this.getElementSize(this.ref);this.containerData={windowSize:t,windowScroll:e,elementWindowOffset:n,elementSize:r}}computeConfigData(t,e){if(null===t||null===e)return{windowMargin:0,gridGap:0,columnCount:1,entries:[]};const n=t.elementSize?t.elementSize.width:0,r=this.getWindowMargin(t.windowSize.height),o=this.getGridGap(n,t.windowSize.height),i=this.getColumnCount(n),a=this.getColumnWidth(i,o,n),l=e.map((t=>{if(!t.width)return t;const e=a*t.columnSpan+o*(t.columnSpan-1);return f(d({},t),{height:this.getItemRatioHeight(t.height,t.width,e),width:e})}));return{windowMargin:r,gridGap:o,columnCount:i,entries:l}}computeLayoutData(t){if(null===t)return{cells:[],totalHeight:0};let e=1,n=0,r=0,o=0;return{cells:t.entries.map(((i,a)=>{const{columnCount:l,gridGap:c}=t;let s=i.columnSpan,u=i.height;s<1&&(s=l);const p=(a+o)%l;i.newRow&&0!==p&&(o+=l-p);const h=a+o,g=h%l+1,m=Math.floor(h/l)+1;if(g+s>l+1){const t=g+s-l-1;u*=1-t/s,s-=t}s>1&&(o+=s-1),m!==e&&(e=m,n+=r+c,r=0);const y=n,w=Math.round(u);return r=Math.max(r,w),f(d({},i),{columnNumber:g,rowNumber:m,offset:y,height:w,columnSpan:s})})),totalHeight:n+r}}computeRenderData(t,e,n){if(null===n||null===t)return{cellsToRender:[],firstRenderedRowNumber:0,firstRenderedRowOffset:0};const r=[];let o=null,i=null;if(null!==e.elementWindowOffset){const a=e.elementWindowOffset;for(const l of n.cells){const n=a+l.offset,c=n+l.height,s=e.windowScroll.y,u=s+e.windowSize.height,d=s-t.windowMargin;n>u+t.windowMargin||(c<d||(null===o&&(o=l.rowNumber),l.rowNumber===o&&(i=i?Math.min(i,l.offset):l.offset),r.push(l)))}}return{cellsToRender:r,firstRenderedRowNumber:o,firstRenderedRowOffset:i}}getColumnWidth(t,e,n){if(null===t||null===e||null===n)return 0;const r=(t-1)*e;return Math.round((n-r)/t)}getGridRowStart(t,e){if(null===e)return;const n=null!==e.firstRenderedRowNumber?e.firstRenderedRowNumber-1:0,r=t.rowNumber-n;return"".concat(r)}resetGrid(){this.bottomReached=!1,this.loadMoreData()}isSameElementSize(t,e){return t.width===e.width&&t.height===e.height}getWindowSize(){return{width:window.innerWidth,height:window.innerHeight}}getElementSize(t){const e=t.getBoundingClientRect();return{width:e.width,height:e.height}}isSameElementScroll(t,e){return t.x===e.x&&t.y===e.y}getWindowScroll(){return{x:window.scrollX,y:window.scrollY}}getElementOffset(t){return window.scrollY+t.getBoundingClientRect().top}};function k(t,e,n,r,o,i,a,l){var c,s="function"==typeof t?t.options:t;if(e&&(s.render=e,s.staticRenderFns=n,s._compiled=!0),r&&(s.functional=!0),i&&(s._scopeId="data-v-"+i),a?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},s._ssrRegister=c):o&&(c=l?function(){o.call(this,(s.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(s.functional){s._injectStyles=c;var u=s.render;s.render=function(t,e){return c.call(e),u(t,e)}}else{var d=s.beforeCreate;s.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:s}}A([S({required:!0})],N.prototype,"items",2),A([S({default:()=>()=>!0})],N.prototype,"updateFunction",2),A([S({default:()=>C})],N.prototype,"getGridGap",2),A([S({default:()=>j})],N.prototype,"getColumnCount",2),A([S({default:()=>M})],N.prototype,"getWindowMargin",2),A([S({default:()=>E})],N.prototype,"getItemRatioHeight",2),A([S({default:null})],N.prototype,"scrollElement",2),A([S({default:500})],N.prototype,"updateTriggerMargin",2),A([S({default:null})],N.prototype,"loader",2),A([S({default:!1})],N.prototype,"debug",2),A([D()],N.prototype,"updateLock",2),A([D()],N.prototype,"bottomReached",2),A([D()],N.prototype,"ref",2),A([D()],N.prototype,"containerData",2),A([function(t,e){void 0===e&&(e={});var n=e.deep,r=void 0!==n&&n,o=e.immediate,i=void 0!==o&&o;return y((function(e,n){"object"!=typeof e.watch&&(e.watch=Object.create(null));var o=e.watch;"object"!=typeof o[t]||Array.isArray(o[t])?void 0===o[t]&&(o[t]=[]):o[t]=[o[t]],o[t].push({handler:n,deep:r,immediate:i})}))}("scrollElement")],N.prototype,"onScrollElementChanged",1),N=A([_({name:"VirtualGrid"})],N);const G={};var L=k(N,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{ref:"virtualGrid",style:{boxSizing:"border-box",height:t.layoutData.totalHeight+"px",paddingTop:null!==t.renderData&&null!==t.renderData.firstRenderedRowOffset?t.renderData.firstRenderedRowOffset+"px":"0px"}},[n("div",{staticClass:"grid",style:{display:"-ms-grid",display:"grid","align-items":"center","grid-template-columns":"repeat("+t.configData.columnCount+", 1fr)",gap:t.configData.gridGap+"px"}},t._l(t.renderData.cellsToRender,(function(e){return n("div",{key:e.id,staticClass:"grid-item-wrapper",style:{height:e.height+"px","grid-column-start":e.columnNumber,"grid-column-end":e.columnNumber+e.columnSpan,"grid-row-start":t.getGridRowStart(e,t.renderData)}},[n(e.renderComponent,t._g({tag:"component",attrs:{item:e}},t.$listeners))],1)})),0),n(t.loadingBatch&&t.loader,{tag:"component"})],1)}),[],!1,T,null,null,null);function T(t){for(let t in G)this[t]=G[t]}var W=function(){return L.exports}()},81170:(t,e,n)=>{n.d(e,{Z:()=>o});const r={name:"FolderIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};const o=(0,n(51900).Z)(r,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon folder-icon",attrs:{"aria-hidden":!t.title,"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,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports}}]);
//# sourceMappingURL=photos-vendors-node_modules_vue-virtual-grid_dist_vue-virtual-grid_es_js-node_modules_vue-material-d-4106f0.js.map?v=1f6873fc139ca4305bd5