Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@egjs/grid

Package Overview
Dependencies
Maintainers
10
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@egjs/grid - npm Package Compare versions

Comparing version 1.16.0 to 1.17.0-beta.0

8

declaration/GridItem.d.ts

@@ -142,3 +142,3 @@ /**

/**
* Set CSS Rect through GridRect.
* Set CSS rect through GridRect.
* @ko GridRect을 통해 CSS Rect를 설정한다.

@@ -149,2 +149,8 @@ * @param - The style for setting CSS rect. <ko>CSS rect를 설정하기 위한 스타일.</ko>

/**
* Add CSS part of rect through GridRect.
* @ko GridRect을 통해 CSS Rect의 일부를 추가한다..
* @param - The style for setting CSS rect. <ko>CSS rect를 설정하기 위한 스타일.</ko>
*/
addCSSGridRect(gridRect: GridRect): void;
/**
* Returns the status of the item.

@@ -151,0 +157,0 @@ * @ko 아이템의 상태를 반환한다.

12

declaration/grids/MasonryGrid.d.ts

@@ -29,7 +29,7 @@ /**

/**
* The size ratio(inlineSize / contentSize) of the columns. 0 is not set.
* <ko>열의 사이즈 비율(inlineSize / contentSize). 0은 미설정이다.</ko>
* The size ratio(inlineSize / contentSize) of the columns. 0 is not set. `true` is automatically calculated as orgInlineSize / orgContentSize.
* <ko>열의 사이즈 비율(inlineSize / contentSize). 0은 미설정이다. `true` 는 orgInlineSize / orgContentSize로 자동 계산이 된다.</ko>
* @default 0
*/
columnSizeRatio?: number;
columnSizeRatio?: number | boolean;
/**

@@ -60,2 +60,7 @@ * Align of the position of the items. If you want to use `stretch`, be sure to set `column`, `columnSize` or `maxStretchColumnSize` option. ("start", "center", "end", "justify", "stretch")

maxStretchColumnSize?: number;
/**
* <ko>여러 칼럼들에 배치된 아이템들의 contentSize를 조절하여 outline을 동등하게 한다.</ko>
* @default ""
*/
stretchOutline?: "scale-down" | "scale-up" | "scale-center" | "";
}

@@ -78,2 +83,3 @@ /**

contentAlign: PROPERTY_TYPE;
stretchOutline: PROPERTY_TYPE;
gap: PROPERTY_TYPE;

@@ -80,0 +86,0 @@ defaultDirection: PROPERTY_TYPE;

@@ -7,5 +7,5 @@ /*

repository: https://github.com/naver/egjs-grid
version: 1.16.0
version: 1.17.0-beta.0
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Grid=t()}(this,function(){"use strict";var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var p=function(){return(p=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function o(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(o<3?r(s):3<o?r(t,n,s):r(t,n))||s);return 3<o&&s&&Object.defineProperty(t,n,s),s}function m(e,t){for(var n=0,i=t.length,r=e.length;n<i;n++,r++)e[r]=t[n];return e}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(i=o.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}(arguments[t]));return e}function l(e){return void 0===e}var a,g,R,u=function(){function e(e,t){var n,i;if(this.eventType=e,this._canceled=!1,t)try{for(var r=h(Object.keys(t)),o=r.next();!o.done;o=r.next()){var s=o.value;this[s]=t[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}var t=e.prototype;return t.stop=function(){this._canceled=!0},t.isCanceled=function(){return this._canceled},e}(),n=function(){function e(){this._eventHandler={}}var t=e.prototype;return t.trigger=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var i=t instanceof u?t.eventType:t,i=s(this._eventHandler[i]||[]);return i.length<=0||(t instanceof u?(t.currentTarget=this,i.forEach(function(e){e(t)})):i.forEach(function(e){e.apply(void 0,s(n))})),this},t.once=function(n,i){var r,o=this;if("object"==typeof n&&l(i)){var e,t=n;for(e in t)this.once(e,t[e]);return this}return"string"==typeof n&&"function"==typeof i&&this.on(n,r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.apply(void 0,s(e)),o.off(n,r)}),this},t.hasOn=function(e){return!!this._eventHandler[e]},t.on=function(e,t){if("object"==typeof e&&l(t)){var n,i=e;for(n in i)this.on(n,i[n]);return this}var r;return"string"==typeof e&&"function"==typeof t&&(r=this._eventHandler[e],l(r)&&(this._eventHandler[e]=[],r=this._eventHandler[e]),r.push(t)),this},t.off=function(e,t){var n,i;if(l(e))return this._eventHandler={},this;if(l(t)){if("string"==typeof e)return delete this._eventHandler[e],this;var r,o=e;for(r in o)this.off(r,o[r]);return this}var s=this._eventHandler[e];if(s){var a=0;try{for(var u=h(s),c=u.next();!c.done;c=u.next()){if(c.value===t){s.splice(a,1),s.length<=0&&delete this._eventHandler[e];break}a++}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}return this},e.VERSION="3.0.1",e}(),c=u,f={horizontal:!1,useTransform:!1,percentage:!1,isEqualSize:!1,isConstantSize:!1,gap:0,attributePrefix:"data-grid-",resizeDebounce:100,maxResizeDebounce:0,autoResize:!0,preserveUIOnDestroy:!1,defaultDirection:"end",externalContainerManager:null,externalItemRenderer:null,renderOnPropertyChange:!0,useFit:!0,outlineLength:0,outlineSize:0,useRoundedSize:!0,useResizeObserver:!1,observeChildren:!1};(q=a=a||{})[q.PROPERTY=1]="PROPERTY",q[q.RENDER_PROPERTY=2]="RENDER_PROPERTY",(B=g=g||{})[B.UNCHECKED=1]="UNCHECKED",B[B.UNMOUNTED=2]="UNMOUNTED",B[B.MOUNTED=3]="MOUNTED",(ce=R=R||{})[ce.NEED_UPDATE=1]="NEED_UPDATE",ce[ce.WAIT_LOADING=2]="WAIT_LOADING",ce[ce.UPDATED=3]="UPDATED";var z={gap:a.RENDER_PROPERTY,defaultDirection:a.PROPERTY,renderOnPropertyChange:a.PROPERTY,preserveUIOnDestroy:a.PROPERTY,useFit:a.PROPERTY,outlineSize:a.RENDER_PROPERTY,outlineLength:a.RENDER_PROPERTY},e=["syncElements","updateItems","getItems","setItems","renderItems","getContainerInlineSize","getContainerElement"],d={horizontal:{inlinePos:"top",contentPos:"left",inlineSize:"height",contentSize:"width"},vertical:{inlinePos:"left",contentPos:"top",inlineSize:"width",contentSize:"height"}},v=function(){function e(){this.keys=[],this.values=[]}var t=e.prototype;return t.get=function(e){return this.values[this.keys.indexOf(e)]},t.set=function(e,t){var n=this.keys,i=this.values,r=n.indexOf(e),r=-1===r?n.length:r;n[r]=e,i[r]=t},e}(),S=function(){function e(){this.object={}}var t=e.prototype;return t.get=function(e){return this.object[e]},t.set=function(e,t){this.object[e]=t},e}(),y="function"==typeof Map,E=function(){function e(){}var t=e.prototype;return t.connect=function(e,t){this.prev=e,this.next=t,e&&(e.next=this),t&&(t.prev=this)},t.disconnect=function(){var e=this.prev,t=this.next;e&&(e.next=t),t&&(t.prev=e)},t.getIndex=function(){for(var e=this,t=-1;e;)e=e.prev,++t;return t},e}();var _=function(){function e(e,t,n,i,r,o,s,a){this.prevList=e,this.list=t,this.added=n,this.removed=i,this.changed=r,this.maintained=o,this.changedBeforeAdded=s,this.fixed=a}var t=e.prototype;return Object.defineProperty(t,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(t,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),t.caculateOrdered=function(){var e,n,r,o,e=(e=this.changedBeforeAdded,n=this.fixed,r=[],o=[],e.forEach(function(e){var t=e[0],n=e[1],e=new E;r[t]=e,o[n]=e}),r.forEach(function(e,t){e.connect(r[t-1])}),e.filter(function(e,t){return!n[t]}).map(function(e,t){var n=e[0],i=e[1];if(n===i)return[0,0];e=r[n],n=o[i-1],i=e.getIndex();return e.disconnect(),n?e.connect(n,n.next):e.connect(void 0,r[0]),[i,e.getIndex()]})),s=this.changed,a=[];this.cacheOrdered=e.filter(function(e,t){var n=e[0],i=e[1],e=s[t],t=e[0],e=e[1];if(n!==i)return a.push([t,e]),!0}),this.cachePureChanged=a},e}();var t,P="function"==typeof Map?void 0:(t=0,function(e){return e.__DIFF_KEY__||(e.__DIFF_KEY__=++t)});function C(e,t){return n=e,i=t,r=P,e=y?Map:r?S:v,t=r||function(e){return e},o=[],s=[],a=[],r=n.map(t),t=i.map(t),u=new e,c=new e,h=[],l=[],f={},d=[],g=p=0,r.forEach(function(e,t){u.set(e,t)}),t.forEach(function(e,t){c.set(e,t)}),r.forEach(function(e,t){e=c.get(e);void 0===e?(++g,s.push(t)):f[e]=g}),t.forEach(function(e,t){e=u.get(e);void 0===e?(o.push(t),++p):(a.push([e,t]),g=f[t]||0,h.push([e-g,t-p]),l.push(t===e),e!==t&&d.push([e,t]))}),s.reverse(),new _(n,i,o,s,d,a,h,l);var n,i,r,o,s,a,u,c,h,l,f,d,p,g}function b(n,i){var e=O(n);return C(i.map(function(e){return e.target}),e.map(function(e){return e.element})).maintained.filter(function(e){var t=e[0],e=e[1],t=i[t].size,e=n[e];return!e.inlineSize||!e.contentSize||t.inlineSize!==e.computedInlineSize||t.blockSize!==e.computedContentSize}).map(function(e){e=e[1];return n[e]})}function O(e){return e.filter(function(e){return e.element})}function I(e){return O(e).map(function(e){return e.element})}function x(e){return"string"==typeof e}function T(e){return"object"==typeof e}function w(e){return"number"==typeof e}function D(e){return e.reduce(function(e,t){return e+t},0)}function M(e){var t,r=e.prototype,o=e.propertyTypes;for(t in o)!function(n){var i=o[n]===a.RENDER_PROPERTY,e=Object.getOwnPropertyDescriptor(r,n)||{};Object.defineProperty(r,n,{enumerable:!0,configurable:!0,get:e.get||function(){return this.options[n]},set:e.set||function(e){var t=this.options;t[n]!==e&&(t[n]=e,i&&t.renderOnPropertyChange&&this.scheduleRender())}})}(t)}function N(t){return function(e,r){t.forEach(function(i){i in e||(e[i]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(n=this[r])[i].apply(n,e);return n===this[r]?this:n})})}}function A(e){for(var t=[],n=0;n<e;++n)t.push(n);return t}function k(e,t){return Math.max(e-t[1],t[0]-e,0)+1}function L(e,t,n){return Math.min(n,Math.max(e,t))}function U(e,t){if(!t)return e;var n=1/t;return Math.round(e/t)/n}var j=N(e),F=function(){function e(e,t){var u=this;void 0===t&&(t={}),this._resizeTimer=0,this._maxResizeDebounceTimer=0,this.rect={width:0,height:0},this._updatedEntries=[],this._onWindowResize=function(){u._scheduleResize([{target:u.container}])},this._onObserve=function(e){var t=u._options,i=u.container,r=t.rectBox,o=t.childrenRectBox;u._scheduleResize(e.map(function(e){var t,n="border-box"===(e.target===i?r:o)?e.borderBoxSize:e.contentBoxSize;return{size:(n=!n?[{inlineSize:(t=e.contentRect).width,blockSize:t.height}]:n)[0]||n,target:e.target}}))},this._scheduleResize=function(e){var t=u._options,n=t.resizeDebounce,t=t.maxResizeDebounce,i=u._updatedEntries;i.push.apply(i,e),u._updatedEntries=i.filter(function(e,t){return i.lastIndexOf(e)===t}),!u._maxResizeDebounceTimer&&n<=t&&(u._maxResizeDebounceTimer=window.setTimeout(u._onResize,t)),u._resizeTimer&&(clearTimeout(u._resizeTimer),u._resizeTimer=0),u._resizeTimer=window.setTimeout(u._onResize,n)},this._onResize=function(){clearTimeout(u._resizeTimer),clearTimeout(u._maxResizeDebounceTimer),u._maxResizeDebounceTimer=0,u._resizeTimer=0;var t,e,n,i=u._updatedEntries,r=u.container,o=i.filter(function(e){return e.target!==r||(t=e,!1)}),s=0<o.length,a=!!t;a&&(e=u._options.watchDirection,n=u.rect,(i=t.size)?u.setRect({width:i.inlineSize,height:i.blockSize}):u.resize(),i=u.rect,a=!e||("box"===e||"width"===e)&&n.width!==i.width||("box"===e||"height"===e)&&n.height!==i.height),u._updatedEntries=[],(a||s)&&u._emitter.trigger("resize",{isResizeContainer:a,childEntries:o})},this._options=p({resizeDebounce:100,maxResizeDebounce:0,useResizeObserver:!1,useWindowResize:!0,watchDirection:!1,rectBox:"content-box",childrenRectBox:"border-box"},t),this.container=x(e)?document.querySelector(e):e,this._init()}var t=e.prototype;return t.getRect=function(){return this.rect},t.setRect=function(e){this.rect=p({},e)},t.isObserverEnabled=function(){return!!this._observer},t.resize=function(){var e=this.container;this.setRect("border-box"===this._options.rectBox?{width:e.offsetWidth,height:e.offsetHeight}:{width:e.clientWidth,height:e.clientHeight})},t.observeChildren=function(e){var t,n=this._observer;n&&(t=this._options.childrenRectBox,e.forEach(function(e){e&&n.observe(e,{box:t})}))},t.unobserveChildren=function(e){var t=this._observer;t&&e.forEach(function(e){e&&t.unobserve(e)})},t.listen=function(e){return this._emitter.on("resize",e),this},t.destroy=function(){var e;null!==(e=this._observer)&&void 0!==e&&e.disconnect(),this._options.useWindowResize&&window.removeEventListener("resize",this._onWindowResize)},t._init=function(){var e=this.container,t=this._options;this._emitter=new n,t.useResizeObserver&&window.ResizeObserver&&(this._observer=new window.ResizeObserver(this._onObserve),this._observer.observe(e,{box:t.rectBox})),t.useWindowResize&&window.addEventListener("resize",this._onWindowResize),this.resize()},e}(),G=function(i){function e(e,t){var n=i.call(this)||this;return n.container=e,n._onResize=function(e){n.trigger("resize",e)},n.options=p({horizontal:f.horizontal,autoResize:f.autoResize,resizeDebounce:f.resizeDebounce,maxResizeDebounce:f.maxResizeDebounce,useResizeObserver:f.useResizeObserver},t),n._init(),n}r(e,i);var t=e.prototype;return t.resize=function(){var e=this.container;this.setRect({width:e.clientWidth,height:e.clientHeight})},t.isObserverEnabled=function(){return this._watcher.isObserverEnabled()},t.getRect=function(){return this._watcher.getRect()},t.observeChildren=function(e){this._watcher.observeChildren(e)},t.unobserveChildren=function(e){this._watcher.unobserveChildren(e)},t.setRect=function(e){this._watcher.setRect(e)},t.getInlineSize=function(){return this.getRect()[this._names.inlineSize]},t.getContentSize=function(){return this.getRect()[this._names.contentSize]},t.getStatus=function(){return{rect:this._watcher.getRect()}},t.setStatus=function(e){this.setRect(e.rect),this.setContentSize(this.getContentSize())},t.setContentSize=function(e){var t,n=this.options.horizontal?"width":"height";this.setRect(p(p({},this.getRect()),((t={})[n]=e,t))),this.container.style[n]=e+"px"},t.destroy=function(e){void 0===e&&(e={}),this._watcher.destroy(),e.preserveUI||(this.container.style.cssText=this.orgCSSText)},t._init=function(){var e=this.container,t=window.getComputedStyle(e);this.orgCSSText=e.style.cssText,"static"===t.position&&(e.style.position="relative");t=this.options;this._watcher=new F(e,{useWindowResize:t.autoResize,useResizeObserver:t.useResizeObserver,resizeDebounce:t.resizeDebounce,maxResizeDebounce:t.maxResizeDebounce,watchDirection:!!t.useResizeObserver&&this._names.inlineSize}).listen(this._onResize)},Object.defineProperty(t,"_names",{get:function(){return d[this.options.horizontal?"horizontal":"vertical"]},enumerable:!1,configurable:!0}),e}(n),Y=function(e,t){return(Y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function W(e,t){function n(){this.constructor=e}Y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var H=function(){return(H=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};var q="undefined"!=typeof window,B=q?window.navigator.userAgent:"",V=q&&!!("getComputedStyle"in window),K=/MSIE|Trident|Windows Phone|Edge/.test(B),X=q&&!!("addEventListener"in document),J="width",$="height";function Q(e,t){return e.getAttribute(t)||""}function Z(e){return[].slice.call(e)}function ee(e,t){return void 0===t&&(t="data-"),"loading"in e&&"lazy"===e.getAttribute("loading")||!!e.getAttribute(t+"lazy")}function te(e,t,n){X?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function ne(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function ie(e,t){var n=e["client"+t]||e["offset"+t];return parseFloat(n||(e=e,((V?window.getComputedStyle(e):e.currentStyle)||{})[t.toLowerCase()]))||0}function re(e,t,n){var i=Z(e.querySelectorAll(function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),r=0,t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i}(["["+n+"skip] ["+n+"width]"],t.map(function(e){return["["+n+"skip] "+e,e+"["+n+"skip]","["+n+"width] "+e].join(", ")})).join(", ")));return Z(e.querySelectorAll("["+n+"width], "+t.join(", "))).filter(function(e){return-1===i.indexOf(e)})}var oe=[];function se(e,t){oe.length||te(window,"resize",ue),e.__PREFIX__=t,oe.push(e),ae(e)}function ae(e,t){void 0===t&&(t="data-");var n,i=e.__PREFIX__||t,r=parseInt(Q(e,""+i+J),10)||0,t=parseInt(Q(e,""+i+$),10)||0;Q(e,i+"fixed")===$?(n=ie(e,"Height")||t,e.style[J]=r/t*n+"px"):(n=ie(e,"Width")||r,e.style[$]=t/r*n+"px")}function ue(){oe.forEach(function(e){ae(e)})}var ce=function(r){function e(e,t){void 0===t&&(t={});var n=r.call(this)||this;n.isReady=!1,n.isPreReady=!1,n.hasDataSize=!1,n.hasLoading=!1,n.isSkip=!1,n.onCheck=function(e){n.clear(),e&&"error"===e.type&&n.onError(n.element),n.hasLoading&&n.checkElement()||(e=!n.hasDataSize&&!n.hasLoading,n.onReady(e))},n.options=H({prefix:"data-"},t),n.element=e;var i=n.options.prefix;return n.hasDataSize=(t=i,!!e.getAttribute((t=void 0===t?"data-":t)+"width")),n.isSkip=(t=i,!!e.getAttribute((t=void 0===t?"data-":t)+"skip")),n.hasLoading=ee(e,i),n}W(e,r);var t=e.prototype;return t.check=function(){return this.isSkip||!this.checkElement()?(this.onAlreadyReady(!0),!1):(this.hasDataSize&&se(this.element,this.options.prefix),(this.hasDataSize||this.hasLoading)&&this.onAlreadyPreReady(),!0)},t.addEvents=function(){var t=this,n=this.element;this.constructor.EVENTS.forEach(function(e){te(n,e,t.onCheck)})},t.clear=function(){var t=this,n=this.element;this.constructor.EVENTS.forEach(function(e){ne(n,e,t.onCheck)}),this.removeAutoSizer()},t.destroy=function(){this.clear(),this.off()},t.removeAutoSizer=function(){var e,t,n;this.hasDataSize&&(n=this.options.prefix,e=this.element,t=n,(n=oe.indexOf(e))<0||(t=Q(e,t+"fixed"),delete e.__PREFIX__,e.style[t===$?J:$]="",oe.splice(n,1),oe.length||ne(window,"resize",ue)))},t.onError=function(e){this.trigger("error",{element:this.element,target:e})},t.onPreReady=function(){this.isPreReady||(this.isPreReady=!0,this.trigger("preReady",{element:this.element,hasLoading:this.hasLoading,isSkip:this.isSkip}))},t.onReady=function(e){this.isReady||((e=!this.isPreReady&&e)&&(this.isPreReady=!0),this.removeAutoSizer(),this.isReady=!0,this.trigger("ready",{element:this.element,withPreReady:e,hasLoading:this.hasLoading,isSkip:this.isSkip}))},t.onAlreadyError=function(e){var t=this;setTimeout(function(){t.onError(e)})},t.onAlreadyPreReady=function(){var e=this;setTimeout(function(){e.onPreReady()})},t.onAlreadyReady=function(e){var t=this;setTimeout(function(){t.onReady(e)})},e.EVENTS=[],e}(n),he=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}W(t,e);var n=t.prototype;return n.setHasLoading=function(e){this.hasLoading=e},n.check=function(){return this.isSkip?(this.onAlreadyReady(!0),!1):(this.hasDataSize?(se(this.element,this.options.prefix),this.onAlreadyPreReady()):this.trigger("requestChildren"),!0)},n.checkElement=function(){return!0},n.destroy=function(){this.clear(),this.trigger("requestDestroy"),this.off()},n.onAlreadyPreReady=function(){e.prototype.onAlreadyPreReady.call(this),this.trigger("reqeustReadyChildren")},t.EVENTS=[],t}(ce),B=function(n){function e(e){void 0===e&&(e={});var t=n.call(this)||this;return t.readyCount=0,t.preReadyCount=0,t.totalCount=0,t.totalErrorCount=0,t.isPreReadyOver=!0,t.elementInfos=[],t.options=H({loaders:{},prefix:"data-"},e),t}W(e,n);var t=e.prototype;return t.check=function(e){var o=this,n=this.options.prefix;this.clear(),this.elementInfos=Z(e).map(function(e,r){var t=o.getLoader(e,{prefix:n});return t.check(),t.on("error",function(e){o.onError(r,e.target)}).on("preReady",function(e){var t=o.elementInfos[r];t.hasLoading=e.hasLoading,t.isSkip=e.isSkip;e=o.checkPreReady(r);o.onPreReadyElement(r),e&&o.onPreReady()}).on("ready",function(e){var t=e.withPreReady,n=e.hasLoading,i=e.isSkip,e=o.elementInfos[r];e.hasLoading=n,e.isSkip=i;e=t&&o.checkPreReady(r),i=o.checkReady(r);t&&o.onPreReadyElement(r),o.onReadyElement(r),e&&o.onPreReady(),i&&o.onReady()}),{loader:t,element:e,hasLoading:!1,hasError:!1,isPreReady:!1,isReady:!1,isSkip:!1}});e=this.elementInfos.length;return(this.totalCount=e)||setTimeout(function(){o.onPreReady(),o.onReady()}),this},t.getTotalCount=function(){return this.totalCount},t.isPreReady=function(){return this.elementInfos.every(function(e){return e.isPreReady})},t.isReady=function(){return this.elementInfos.every(function(e){return e.isReady})},t.hasError=function(){return 0<this.totalErrorCount},t.clear=function(){this.isPreReadyOver=!1,this.totalCount=0,this.preReadyCount=0,this.readyCount=0,this.totalErrorCount=0,this.elementInfos.forEach(function(e){!e.isReady&&e.loader&&e.loader.destroy()}),this.elementInfos=[]},t.destroy=function(){this.clear(),this.off()},t.getLoader=function(t,e){var n=this,i=t.tagName.toLowerCase(),r=this.options.loaders,o=e.prefix,s=Object.keys(r);if(r[i])return new r[i](t,e);var a=new he(t,e),u=Z(t.querySelectorAll(s.join(", ")));a.setHasLoading(u.some(function(e){return ee(e,o)}));var c=!1,h=this.clone().on("error",function(e){a.onError(e.target)}).on("ready",function(){a.onReady(c)});return a.on("requestChildren",function(){var e=re(t,s,n.options.prefix);h.check(e).on("preReady",function(e){(c=e.isReady)||a.onPreReady()})}).on("reqeustReadyChildren",function(){h.check(u)}).on("requestDestroy",function(){h.destroy()}),a},t.clone=function(){return new e(H({},this.options))},t.checkPreReady=function(e){return this.elementInfos[e].isPreReady=!0,++this.preReadyCount,!(this.preReadyCount<this.totalCount)},t.checkReady=function(e){return this.elementInfos[e].isReady=!0,++this.readyCount,!(this.readyCount<this.totalCount)},t.onError=function(e,t){var n=this.elementInfos[e];n.hasError=!0,this.trigger(new c("error",{element:n.element,index:e,target:t,errorCount:this.getErrorCount(),totalErrorCount:++this.totalErrorCount}))},t.onPreReadyElement=function(e){var t=this.elementInfos[e];this.trigger(new c("preReadyElement",{element:t.element,index:e,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:t.hasLoading,isSkip:t.isSkip}))},t.onPreReady=function(){this.isPreReadyOver=!0,this.trigger(new c("preReady",{readyCount:this.readyCount,totalCount:this.totalCount,isReady:this.isReady(),hasLoading:this.hasLoading()}))},t.onReadyElement=function(e){var t=this.elementInfos[e];this.trigger(new c("readyElement",{index:e,element:t.element,hasError:t.hasError,errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:t.hasLoading,isPreReadyOver:this.isPreReadyOver,isSkip:t.isSkip}))},t.onReady=function(){this.trigger(new c("ready",{errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,totalCount:this.totalCount}))},t.getErrorCount=function(){return this.elementInfos.filter(function(e){return e.hasError}).length},t.hasLoading=function(){return this.elementInfos.some(function(e){return e.hasLoading})},e}(n),le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return W(t,e),t.prototype.checkElement=function(){var e=this.element,t=e.getAttribute("src");if(e.complete){if(t)return e.naturalWidth||this.onAlreadyError(e),!1;this.onAlreadyPreReady()}return this.addEvents(),K&&e.setAttribute("src",t),!0},t.EVENTS=["load","error"],t}(ce),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return W(t,e),t.prototype.checkElement=function(){var e=this.element;return!(1<=e.readyState)&&(e.error?(this.onAlreadyError(e),!1):(this.addEvents(),!0))},t.EVENTS=["loadedmetadata","error"],t}(ce),de=function(t){function e(e){return t.call(this,H({loaders:{img:le,video:fe}},e=void 0===e?{}:e))||this}return W(e,t),e}(B),pe=function(){function e(e){this.initialRects={},this.sizePercetage=!1,this.posPercetage=!1,this.options=p({attributePrefix:f.attributePrefix,useTransform:f.useTransform,horizontal:f.horizontal,percentage:f.percentage,isEqualSize:f.isEqualSize,isConstantSize:f.isConstantSize,useRoundedSize:f.useRoundedSize},e),this._init()}var t=e.prototype;return t.resize=function(){this.initialRects={}},t.renderItems=function(e){var t=this;e.forEach(function(e){t._renderItem(e)})},t.getInlineSize=function(){return this.containerRect[this.options.horizontal?"height":"width"]},t.setContainerRect=function(e){this.containerRect=e},t.updateEqualSizeItems=function(t,e){var n=this;this.updateItems(t);var i=t.some(function(e){return e.attributes.sizeGroup});(this.options.isEqualSize||i)&&t.some(function(e){return e.updateState===R.UPDATED})&&e.forEach(function(e){-1===t.indexOf(e)&&n.updateItem(e,!0)})},t.updateItems=function(e){var t=this;e.forEach(function(e){t.updateItem(e)})},t.getStatus=function(){return{initialRects:this.initialRects}},t.setStatus=function(e){this.initialRects=e.initialRects},t._init=function(){var e=this.options.percentage,t=!1,n=!1;!0===e?n=t=!0:e&&(-1<e.indexOf("position")&&(n=!0),-1<e.indexOf("size")&&(t=!0)),this.posPercetage=n,this.sizePercetage=t},t.updateItem=function(e,t){var n=this.options,i=n.isEqualSize,r=n.isConstantSize,o=n.useRoundedSize,s=this.initialRects,a=e.orgRect,u=e.element,c=e.updateState===R.WAIT_LOADING,h=a&&a.width&&a.height,l=u?function(e,t){for(var n={},i=e.attributes,r=i.length,o=0;o<r;++o){var s=i[o],a=s.name,s=s.value;-1!==a.indexOf(t)&&(n[a.replace(t,"").replace(/[\s-_]([a-z])/g,function(e,t){return t.toUpperCase()})]=s)}return n}(u,this.options.attributePrefix):e.attributes,n=null!==(f=l.sizeGroup)&&void 0!==f?f:"",f=l.notEqualSize;if(""!==n&&s[n])d=s[n];else if(i&&!f&&!n&&s[""])d=s[""];else if(r&&h&&!c)d=a;else{if(t||!u)return;var d={left:u.offsetLeft,top:u.offsetTop,width:0,height:0};o?(d.width=u.offsetWidth,d.height=u.offsetHeight):(u=u.getBoundingClientRect(),d.width=u.width,d.height=u.height)}return e.attributes=l,e.shouldReupdate=!1,e.isFirstUpdate&&h||(e.orgRect=p({},d)),e.rect=p({},d),t||(e.element&&(e.mountState=g.MOUNTED),e.updateState===R.NEED_UPDATE&&(e.updateState=R.UPDATED,e.isFirstUpdate=!0),c||f||s[n]||(s[n]=p({},d))),d},t._renderItem=function(e){var t,n,i,r,o,s,a,u,c=e.element,h=e.cssRect;c&&h&&(u=(a=this.options).horizontal,t=a.useTransform,n=this.posPercetage,i=this.sizePercetage,e=["position: absolute;"],r=(a=d[u?"horizontal":"vertical"]).inlineSize,o=a.inlinePos,s=this.getInlineSize(),u=h,u=0<(a=Object.keys(u)).length,t&&(a=a.filter(function(e){return"top"!==e&&"left"!==e}),e.push("transform: translate("+(h.left||0)+"px, "+(h.top||0)+"px);")),e.push.apply(e,a.map(function(e){var t=h[e];return e===r&&i||e===o&&n?e+": "+t/s*100+"%;":e+": "+t+"px;"})),u&&(c.style.cssText+=e.join("")))},e}(),ge=function(){function e(e,t){void 0===t&&(t={}),this.horizontal=e,this.isUpdating=!1,this.shouldReupdate=!1,this.hasTransition=!1,this.transitionDuration="",this.isRestoreOrgCSSText=!0;var n,e=t.element,i=p({key:"",index:0,orgRect:{left:0,top:0,width:0,height:0},rect:{left:0,top:0,width:0,height:0},cssRect:{},attributes:{},data:{},isFirstUpdate:!1,mountState:g.UNCHECKED,updateState:R.NEED_UPDATE,element:e||null,orgCSSText:null!==(e=null==e?void 0:e.style.cssText)&&void 0!==e?e:"",gridData:{}},t);for(n in i)this[n]=i[n]}var t=e.prototype;return Object.defineProperty(t,"orgInlineSize",{get:function(){var e=this._names.inlineSize;return this.orgRect[e]||this.rect[e]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"orgContentSize",{get:function(){var e=this._names.contentSize;return this.orgRect[e]||this.rect[e]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"inlineSize",{get:function(){return this.rect[this._names.inlineSize]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"contentSize",{get:function(){return this.rect[this._names.contentSize]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssInlineSize",{get:function(){return this.cssRect[this._names.inlineSize]},set:function(e){this.cssRect[this._names.inlineSize]=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssContentSize",{get:function(){return this.cssRect[this._names.contentSize]},set:function(e){this.cssRect[this._names.contentSize]=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssInlinePos",{get:function(){return this.cssRect[this._names.inlinePos]},set:function(e){this.cssRect[this._names.inlinePos]=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssContentPos",{get:function(){return this.cssRect[this._names.contentPos]},set:function(e){this.cssRect[this._names.contentPos]=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"computedInlineSize",{get:function(){var e=this._names.inlineSize;return this.cssRect[e]||this.rect[e]||this.orgRect[e]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"computedContentSize",{get:function(){var e=this._names.contentSize;return this.cssRect[e]||this.rect[e]||this.orgRect[e]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"computedInlinePos",{get:function(){var e,t=this._names.inlinePos;return null!==(e=this.cssRect[t])&&void 0!==e?e:this.rect[t]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"computedContentPos",{get:function(){var e,t=this._names.contentPos;return null!==(e=this.cssRect[t])&&void 0!==e?e:this.rect[t]},enumerable:!1,configurable:!0}),t.setCSSGridRect=function(e){var t,n=d[this.horizontal?"horizontal":"vertical"],i={};for(t in e)i[n[t]]=e[t];this.cssRect=i},t.getStatus=function(){return{index:this.index,mountState:this.mountState,updateState:this.updateState,attributes:this.attributes,orgCSSText:this.orgCSSText,isFirstUpdate:this.isFirstUpdate,element:null,key:this.key,orgRect:this.orgRect,rect:this.rect,cssRect:this.cssRect,gridData:this.gridData,data:this.data}},t.getMinimizedStatus=function(){var e={orgRect:this.orgRect,rect:this.rect,cssRect:this.cssRect,attributes:this.attributes,gridData:this.gridData},t=this,n=t.key,i=t.mountState,r=t.updateState,o=t.isFirstUpdate,t=t.orgCSSText;return void 0!==n&&(e.key=n),i!==g.UNCHECKED&&(e.mountState=i),r!==R.NEED_UPDATE&&(e.updateState=r),o&&(e.isFirstUpdate=!0),t&&(e.orgCSSText=t),e},Object.defineProperty(t,"_names",{get:function(){return this.horizontal?d.horizontal:d.vertical},enumerable:!1,configurable:!0}),e}(),me=function(d){function e(e,t){void 0===t&&(t={});var n=d.call(this)||this;n.items=[],n.outlines={start:[],end:[]},n._renderTimer=0,n._onResize=function(e){e.isResizeContainer?n._renderItems({useResize:!0},!0):0<(e=b(n.items,e.childEntries)).length&&n.updateItems(e)},n.options=p(p({},n.constructor.defaultOptions),t),n.containerElement=x(e)?document.querySelector(e):e;var i=n.options,r=i.isEqualSize,o=i.isConstantSize,s=i.useTransform,a=i.horizontal,u=i.percentage,c=i.externalContainerManager,h=i.externalItemRenderer,l=i.resizeDebounce,f=i.maxResizeDebounce,t=i.autoResize,e=i.useRoundedSize,i=i.useResizeObserver;return n.containerManager=c||new G(n.containerElement,{horizontal:a,resizeDebounce:l,maxResizeDebounce:f,autoResize:t,useResizeObserver:i}).on("resize",n._onResize),n.itemRenderer=h||new pe({useTransform:s,isEqualSize:r,isConstantSize:o,percentage:u,useRoundedSize:e}),n._init(),n}r(e,d);var t=e.prototype;return t.getContainerElement=function(){return this.containerElement},t.getItems=function(){return this.items},t.getChildren=function(){return[].slice.call(this.containerElement.children)},t.setItems=function(e){e.forEach(function(e,t){e.index=t});var t=this.options;return t.useResizeObserver&&t.observeChildren&&((t=this.containerManager).unobserveChildren(I(this.items)),t.observeChildren(I(e))),this.items=e,this},t.getContainerInlineSize=function(){return this.containerManager.getInlineSize()},t.getOutlines=function(){return this.outlines},t.setOutlines=function(e){return this.outlines=e,this},t.syncElements=function(e){void 0===e&&(e={});var n=this.items,t=this.options.horizontal,i=this.getChildren(),r=C(this.items.map(function(e){return e.element}),i),o=r.added,s=r.maintained,a=r.changed,r=r.removed,u=[];return s.forEach(function(e){var t=e[0],e=e[1];u[e]=n[t]}),o.forEach(function(e){u[e]=new ge(t,{element:i[e]})}),this.setItems(u),(o.length||r.length||a.length)&&this.renderItems(e),this},t.updateItems=function(e,t){void 0===e&&(e=this.items);var n=(t=void 0===t?{}:t).useOrgResize;return e.forEach(function(e){var t;n&&((t=e.orgRect).width=0,t.height=0),e.updateState=R.NEED_UPDATE}),this.checkReady(t),this},t.renderItems=function(e){return this._renderItems(e=void 0===e?{}:e),this},t.getStatus=function(t){return{outlines:this.outlines,items:this.items.map(function(e){return t?e.getMinimizedStatus():e.getStatus()}),containerManager:this.containerManager.getStatus(),itemRenderer:this.itemRenderer.getStatus()}},t.setStatus=function(e){var t=this,n=this.options.horizontal,i=this.containerManager,r=i.getInlineSize(),o=this.getChildren();return this.itemRenderer.setStatus(e.itemRenderer),i.setStatus(e.containerManager),this.outlines=e.outlines,this.items=e.items.map(function(e,t){return new ge(n,p(p({},e),{element:o[t]}))}),this.itemRenderer.renderItems(this.items),r!==i.getInlineSize()?this.renderItems({useResize:!0}):window.setTimeout(function(){t._renderComplete({direction:t.defaultDirection,mounted:t.items,updated:[],isResize:!1})}),this},t.getComputedOutlineSize=function(e){return void 0===e&&(e=this.items),this.options.outlineSize||this.getContainerInlineSize()},t.getComputedOutlineLength=function(e){return void 0===e&&(e=this.items),this.options.outlineLength||1},t.destroy=function(e){var e=(e=void 0===e?{}:e).preserveUI,e=void 0===e?this.options.preserveUIOnDestroy:e;this.containerManager.destroy({preserveUI:e}),e||this.items.forEach(function(e){var t=e.element,e=e.orgCSSText;t&&(t.style.cssText=e)}),null!==(e=this._im)&&void 0!==e&&e.destroy()},t.getInlineGap=function(){return this._getDirectionalGap("inline")},t.getContentGap=function(){return this._getDirectionalGap("content")},t.checkReady=function(n){var i=this;void 0===n&&(n={});var e=this.items,r=e.filter(function(e){var t;return(null===(t=e.element)||void 0===t?void 0:t.parentNode)&&e.updateState!==R.UPDATED}),t=e.filter(function(e){var t;return(null===(t=e.element)||void 0===t?void 0:t.parentNode)&&e.mountState!==g.MOUNTED}),o=[];t.filter(function(e){if(e.hasTransition)return!0;var t=e.element;return 0<parseFloat(getComputedStyle(t).transitionDuration)&&(e.hasTransition=!0,e.transitionDuration=t.style.transitionDuration,!0)}).forEach(function(e){e.element.style.transitionDuration="0s"}),null!==(e=this._im)&&void 0!==e&&e.destroy(),this._im=new de({prefix:this.options.attributePrefix}).on("preReadyElement",function(e){r[e.index].updateState=R.WAIT_LOADING}).on("preReady",function(){r.forEach(function(e){var t=e.orgRect.width&&e.orgRect.height,n=e.cssRect.width||e.cssRect.height;!t&&n&&(e.element.style.cssText=e.orgCSSText)}),i._updateItems(r),i.readyItems(t,r,n)}).on("readyElement",function(e){var t=r[e.index];t.updateState=R.NEED_UPDATE,e.isPreReadyOver&&(t.isRestoreOrgCSSText&&(t.element.style.cssText=t.orgCSSText),i._updateItems([t]),i.readyItems([],[t],n))}).on("error",function(e){var t=r[e.index];i.trigger("contentError",{element:e.element,target:e.target,item:t,update:function(){o.push(t)}})}).on("ready",function(){o.length&&i.updateItems(o)}).check(r.map(function(e){return e.element}))},t.scheduleRender=function(){var e=this;this._clearRenderTimer(),this._renderTimer=window.setTimeout(function(){e.renderItems()})},t.fitOutlines=function(e){void 0===e&&(e=this.useFit);var t=this.outlines,n=t.start,i=t.end,r=n.length?Math.min.apply(Math,n):0;!e&&0<r||(t.start=n.map(function(e){return e-r}),t.end=i.map(function(e){return e-r}),this.items.forEach(function(e){var t=e.cssContentPos;w(t)&&(e.cssContentPos=t-r)}))},t.readyItems=function(e,t,n){var i=this.outlines,r=n.direction||this.options.defaultDirection,o=n.outline||i["end"===r?"start":"end"],s=this.items,i={start:m([],o),end:m([],o)};e.forEach(function(e){e.mountState=g.MOUNTED}),t.forEach(function(e){e.isUpdating=!0}),s.length&&(i=this.applyGrid(this.items,r,o)),t.forEach(function(e){e.isUpdating=!1}),this.setOutlines(i),this.fitOutlines(),this.itemRenderer.renderItems(this.items),this._refreshContainerContentSize();i=e.filter(function(e){return e.hasTransition});i.length&&(this.containerManager.resize(),i.forEach(function(e){e.element.style.transitionDuration=e.transitionDuration})),this._renderComplete({direction:r,mounted:e,updated:t,isResize:!!n.useResize});t=t.filter(function(e){return e.shouldReupdate});t.length&&this.updateItems(t)},t._isObserverEnabled=function(){return this.containerManager.isObserverEnabled()},t._updateItems=function(e){this.itemRenderer.updateEqualSizeItems(e,this.getItems())},t._getDirectionalGap=function(e){var t=this.options.horizontal,n=this.options.gap;return"number"==typeof n||null!==(n=t&&"inline"===e||!t&&"content"===e?n.vertical:n.horizontal)&&void 0!==n?n:f.gap},t._renderComplete=function(e){this.trigger("renderComplete",e)},t._clearRenderTimer=function(){clearTimeout(this._renderTimer),this._renderTimer=0},t._refreshContainerContentSize=function(){var e=this.outlines,t=e.start,n=e.end,e=this.getContentGap(),n=n.length?Math.max.apply(Math,n):0,t=t.length?Math.max.apply(Math,t):0,e=Math.max(t,n-e);this.containerManager.setContentSize(e)},t._resizeContainer=function(){this.containerManager.resize(),this.itemRenderer.setContainerRect(this.containerManager.getRect())},t._init=function(){this._resizeContainer()},t._renderItems=function(e,t){void 0===e&&(e={}),this._clearRenderTimer();var n=e.useResize||e.useOrgResize;n&&!t&&(this._resizeContainer(),this.itemRenderer.resize()),!this.getItems().length&&this.getChildren().length?this.syncElements(e):n?this.updateItems(this.items,e):this.checkReady(e)},e.defaultOptions=f,e.propertyTypes=z,o([M],e)}(n);function Re(e,t,n,i){return Math[i].apply(Math,e.slice(t,t+n))}q=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(z,e,t){z.forEach(function(e){e.isRestoreOrgCSSText=!1});var n,v=this.getComputedOutlineSize(z),S=this.getComputedOutlineLength(z),i=this.options,r=i.align,y=i.observeChildren,E=i.columnSizeRatio,o=i.contentAlign,_=this.getContentGap(),P=this.getContentGap(),i=t.length,C=z.length,b=this._getAlignPoses(S,v),O="end"===e,I=O?"min":"max",x=O?"max":"min",e=[0],T=(e=i===S?t.slice():(n=i?Math[x].apply(Math,t):0,A(S).map(function(){return n}))).slice(),w=1<S?b[1]-b[0]:0,D="stretch"===r,M=O&&"start"===o,N=O?-1/0:1/0;M&&(N=Math.min.apply(Math,T));for(var s=function(e){var t,n,i,r,o,s=z[O?e:C-1-e],a=parseInt(s.attributes.column||"1",10),u=parseInt(s.attributes.maxColumn||"1",10),c=s.contentSize,h=Math.min(S,a||Math.max(1,Math.ceil((s.inlineSize+_)/w))),l=Math.min(S,Math.max(h,u)),f=(n=h,i=I,r=N,e=(t=T).length-n+1,o="max"===i?"min":"max",u="max"===i?"lastIndexOf":"indexOf",(e=A(e).map(function(e){e=Re(t,e,n,o);return Math[o](r,e)}))[u](Math[i].apply(Math,e))),d=Re(T,f,h,x);for(M&&N!==d&&(N=Math.max.apply(Math,T),T=T.map(function(){return N}),d=N,f=0);h<l;){var p=f+h,g=f-1;if(O&&(S<=p||T[p]>d))break;if(!O&&(g<0||T[g]<d))break;O||--f,++h}f=Math.max(0,f),h=Math.min(S-f,h),(0<a&&1<h||D)&&(m=(h-1)*w+v,k._isObserverEnabled()&&y||s.cssInlineSize===m||(s.shouldReupdate=!0),s.cssInlineSize=m),0<E&&(c=s.computedInlineSize/E,s.cssContentSize=c);var m=b[f],d=O?d:d-P-c;s.cssInlinePos=m,s.cssContentPos=d;var R=O?d+c+P:d;A(h).forEach(function(e){T[f+e]=R})},k=this,a=0;a<C;++a)s(a);return M&&N!==Math.min.apply(Math,T)&&(N=Math.max.apply(Math,T),T=T.map(function(){return N})),{start:O?e:T,end:O?T:e}},n.getComputedOutlineSize=function(e){void 0===e&&(e=this.items);var t=this.options.align,n=this.getInlineGap(),i=this.getContainerInlineSize(),r=this.columnSize||this.outlineSize,o=this.column||this.outlineLength,s=o||1,a=0;if("stretch"===t)o||(o=this.maxStretchColumnSize||1/0,s=Math.max(1,Math.ceil((i+n)/(o+n)))),a=(i+n)/(s||1)-n;else if(r)a=r;else if(e.length){for(var u=e[0],c=0,h=e;c<h.length;c++){var l=h[c],f=l.attributes,d=parseInt(f.column||"1",10),f=parseInt(f.maxColumn||"1",10);if(l.updateState===R.UPDATED&&l.inlineSize&&1===d&&1===f){u=l;break}}a=u.inlineSize||0}else a=i;return a||0},n.getComputedOutlineLength=function(e){void 0===e&&(e=this.items);var t=this.getInlineGap(),n=this.column||this.outlineLength,i=this.columnCalculationThreshold;return n||(n=this.getComputedOutlineSize(e),Math.min(e.length,Math.max(1,Math.floor((this.getContainerInlineSize()+t)/(n-i+t)))))},n._getAlignPoses=function(e,t){var n,i=this.options.align,r=this.getInlineGap(),o=this.getContainerInlineSize(),s=A(e),a=0,u=0;return"justify"===i||"stretch"===i?(u=(n=e-1)?Math.max((o-t)/n,t+r):0,a=Math.min(0,o/2-(n*u+t)/2)):(t=(e-1)*(u=t+r)+t,"center"===i?a=(o-t)/2:"end"===i&&(a=o-t)),s.map(function(e){return a+e*u})},t.propertyTypes=p(p({},me.propertyTypes),{column:a.RENDER_PROPERTY,columnSize:a.RENDER_PROPERTY,columnSizeRatio:a.RENDER_PROPERTY,align:a.RENDER_PROPERTY,columnCalculationThreshold:a.RENDER_PROPERTY,maxStretchColumnSize:a.RENDER_PROPERTY,contentAlign:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},me.defaultOptions),{align:"justify",column:0,columnSize:0,columnSizeRatio:0,columnCalculationThreshold:.5,maxStretchColumnSize:1/0,contentAlign:"masonry"}),o([M],t)}(me);function ze(e,t,n){return function(e,t){for(var n=[],i=t;i;)n.push(i),i=e[i];return n.reverse(),n}(function(e,t,n){var i={},r={};r[t]=0;var o,s,a,u,c,h,l=new ve(function(e){return e.cost});for(l.push({value:t,cost:0});l.size();)for(var f in s=(o=l.pop()).value,a=o.cost,u=e(s)||{})c=a+u[f],h=r[f],(void 0===r[f]||c<h)&&(r[f]=c,l.push({value:f,cost:c}),i[f]=s);if(void 0!==r[n])return i;throw n=["Could not find a path from ",t," to ",n,"."].join(""),new Error(n)}(e,t,n),n)}var ve=function(){function e(e){this.content=[],this.scoreFunction=e}var t=e.prototype;return t.push=function(e){this.content.push(e),this.bubbleUp(this.content.length-1)},t.pop=function(){var e=this.content[0],t=this.content.pop();return 0<this.content.length&&(this.content[0]=t,this.sinkDown(0)),e},t.size=function(){return this.content.length},t.bubbleUp=function(e){for(var t=e,n=this.content[t];0<t;){var i=Math.floor((t+1)/2)-1,r=this.content[i];if(!(this.scoreFunction(n)<this.scoreFunction(r)))break;this.content[i]=n,this.content[t]=r,t=i}},t.sinkDown=function(e){for(var t=this.content.length,n=this.content[e],i=this.scoreFunction(n);;){var r,o=2*(e+1),s=o-1,a=null;if(s<t&&(r=this.content[s],(r=this.scoreFunction(r))<i&&(a=s)),o<t&&(s=this.content[o],this.scoreFunction(s)<(null==a?i:r)&&(a=o)),null===a)break;this.content[e]=this.content[a],this.content[a]=n,e=a}},e}();function Se(e,t){if(w(t))return t;var n=t.charAt(0),i="+"===n?1:"-"===n?-1:0,n=parseFloat(t);return t.match(/%$/g)&&(n*=e/100),i?e+n:n}function ye(e,t){var n=e.orgInlineSize,i=e.orgContentSize,r=e.gridData.inlineOffset||0,e=e.gridData.contentOffset||0;return n&&i?(i<=e?1:(n-r)/(i-e))*(t-e)+r:t}ce=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(e,t,n){var s=this,i=this.options,a=i.attributePrefix,u=i.horizontal;e.forEach(function(e){var t,n,i,r,o;e.isUpdating&&(t=e.element,r=e.attributes,n=e.gridData,i=parseFloat(r.inlineOffset),o=parseFloat(r.contentOffset),isNaN(i)&&(i=s.inlineOffset||n.inlineOffset||0),isNaN(o)&&(o=s.contentOffset||0|n.contentOffset),!t||"inlineOffset"in r||"contentOffset"in r||e.mountState!==g.MOUNTED||(r=t.querySelector("["+a+"maintained-target]"))&&(e=t.offsetWidth-t.clientWidth+t.scrollWidth-r.clientWidth,r=t.offsetHeight-t.clientHeight+t.scrollHeight-r.clientHeight,o=u?(i=r,e):(i=e,r)),n.inlineOffset=i,n.contentOffset=o)});var r=this.options.rowRange,o=[],i="end"===t;return e.length&&(o=r?this._getRowPath(e,i):this._getPath(e,i)),this._setStyle(e,o,n,"end"===t)},n._getRowPath=function(e,t){var n=this._getColumnRange(),i=this._getRowRange(),t=this._getRowLink(e,{path:[0],cost:0,length:0,currentNode:0},n,i,t);return null!==(t=null==t?void 0:t.path.map(function(e){return""+e}))&&void 0!==t?t:[]},n._getRowLink=function(e,t,n,i,r){var o=n[0],s=i[0],a=i[1],u=e.length,c=t.path,h=t.length,l=t.cost,f=t.currentNode;if(f<u&&(a<=h||u<f+o)){o=k(u-f,n)*Math.abs(this._getCost(e,f,u,r));return p(p({},t),{length:h+1,path:m(m([],c),[u]),currentNode:u,cost:l+o,isOver:!0})}return u<=f?p(p({},t),{currentNode:u,isOver:h<s||a<h}):this._searchRowLink(e,t,u,n,i,r)},n._searchRowLink=function(e,t,n,i,r,o){for(var s,a=i[0],u=i[1],c=t.currentNode,h=t.path,l=t.length,f=t.cost,d=Math.min(n,c+u),p=[],g=c+a;g<=d;++g)g!==c&&(s=Math.abs(this._getCost(e,c,g,o)),(s=this._getRowLink(e,{path:m(m([],h),[g]),length:l+1,cost:f+s,currentNode:g},i,r,o))&&p.push(s));return p.sort(function(e,t){var n=e.isOver;return n!==t.isOver?n?1:-1:k(e.length,r)-k(t.length,r)||e.cost-t.cost}),p[0]},n._getExpectedRowSize=function(i,e){var t=this.getContainerInlineSize()-this.getInlineGap()*(i.length-1),r=t,o=0,s=0;if(i.forEach(function(e){var t,n=e.orgInlineSize,i=e.orgContentSize;n&&i?(t=e.gridData.inlineOffset||0,e=e.gridData.contentOffset||0,o+=i=i<=e?1:(n-t)/(i-e),s+=e*i,r-=t):o+=1}),o){var n=(r+s)/o;if(this.stretch){var a=this._getSizeRange(),u=L(n,a[0],a[1]);if(e)return u;var c=this.stretchRange,a=i.map(function(e){return ye(e,u)}),e=a.reduce(function(e,t,n){return e+Se(t,i[n].attributes.minStretch||c[0])},0),a=a.reduce(function(e,t,n){return e+Se(t,i[n].attributes.maxStretch||c[1])},0);if(e<=t&&t<=a)return u}return n}return 0},n._getExpectedInlineSizes=function(e,o){var t=this.options,s=t.stretch,a=t.stretchRange;return e.map(function(e){var t=s?Se(e.orgInlineSize,e.attributes.minStretch||a[0]):-1/0,n=s?Se(e.orgInlineSize,e.attributes.maxStretch||a[1]):1/0,i=ye(e,o),r=!1,e=!1;return n<=i?r=!0:i<=t&&(e=!0),{minSize:t,maxSize:n,size:L(i,t,n),originalSize:i,isMax:r,isMin:e}})},n._getStretchItemInfos=function(e,t){var n=e.length,i=this.getContainerInlineSize()-this.getInlineGap()*(Math.max(1,n)-1),e=this._getExpectedInlineSizes(e,t),t=D(e.map(function(e){return e.size})),t=i-t,r=i/D(e.map(function(e){return e.originalSize})),o=e.map(function(e){return p(p({},e),{passed:!1,size:e.originalSize*r})});if(0==t)return{infos:o,cost:0};for(var s=0<t,a=o.length,u=0;u<a;++u)if("break"===function(){var e=D(o.map(function(e){return e.passed?e.size:0})),t=D(o.map(function(e){return e.passed?0:e.originalSize})),n=(i-e)/t;if(o.forEach(function(e){e.passed||(s?e.size>e.maxSize&&(n=Math.min(n,e.maxSize/e.originalSize)):e.size<e.minSize&&(n=Math.max(n,e.minSize/e.originalSize)))}),o.forEach(function(e){e.passed||(e.size=L(e.originalSize*n,e.minSize,e.maxSize),(s&&!U(e.size-e.maxSize,.001)||!s&&!U(e.size-e.minSize,.001))&&(e.passed=!0))}),o.every(function(e){return e.passed}))return"break"}())break;var c=i/D(o.map(function(e){return e.size}));return U(c-1,.001)&&o.forEach(function(e){e.size*=c}),{infos:o,cost:D(o.map(function(e){var t=1;(e.size>e.maxSize||e.size<e.minSize)&&(t=2);var n=e.originalSize,n=s?Math.max(n,e.minSize):Math.min(n,e.maxSize);return Math.abs(e.size-n)*t}))}},n._getExpectedInlineSize=function(e,t){var n=this.getInlineGap(),t=this._getExpectedInlineSizes(e,t);return t.length?D(t.map(function(e){return e.size}))+n*(e.length-1):0},n._getCost=function(e,t,n,i){var r=e.slice(t,n),o=this.getContainerInlineSize(),s=this._getExpectedRowSize(r),a=this._getSizeRange(),u=a[0],c=a[1];if(this.isCroppedSize){if(u<=s&&s<=c)return 0;var h=this._getExpectedInlineSize(r,s<u?u:c);return Math.pow(h-o,2)}var l=0;if(this.stretch){s<u?s=u:c<s&&(s=c);a=Math.abs(s-u),h=this._getExpectedInlineSize(r,s);return(l=!this.passUnstretchRow||(i?n!==e.length:0!==t)||o<=h?this._getStretchItemInfos(r,s).cost:l)+a}if(isFinite(c)){if(s<u)return Math.pow(s-u,2)+Math.pow(c,2)+l;if(c<s)return Math.pow(s-c,2)+Math.pow(c,2)+l}else if(s<u)return Math.max(Math.pow(u,2),Math.pow(s,2))+Math.pow(c,2)+l;return s-u+l},n._getPath=function(o,s){var a=this,u=o.length,e=this.options.columnRange,e=T(e)?e:[e,e],c=e[0],h=e[1];return ze(function(e){for(var t={},n=parseInt(e,10),i=Math.min(n+c,u);i<=u&&!(h<i-n);++i){var r=a._getCost(o,n,i,s);r<0&&i===u&&(r=0),t[""+i]=Math.pow(r,2)}return t},"0",""+u)},n._setStyle=function(e,t,n,l){var f=this;void 0===n&&(n=[]);var d,p,i=this.options,g=i.isCroppedSize,m=i.displayedRow,R=i.stretch,z=i.passUnstretchRow,v=e.length,S=this._getSizeRange(),n=n[0]||0,y=this.getContainerInlineSize(),E=this.getInlineGap(),_=this.getContentGap(),t=function(e,t){for(var n=t.length,i=[],r=0;r<n-1;++r){var o=parseInt(t[r],10),s=parseInt(t[r+1],10);i.push(e.slice(o,s))}return i}(e,t),P=t.length,C=n,b=0;if(t.forEach(function(o,e){var n=o.length,s=f._getExpectedRowSize(o,!0);g&&(s=Math.max(S[0],Math.min(s,S[1])));var i,r,t=E*(length-1),a=o.map(function(e,t){var n=ye(e,s);return{index:t,item:e,inlineSize:n,orgInlineSize:n,maxInlineSize:n,minInlineSize:n}}),u=f._getExpectedInlineSize(o,s),c=(y-t)/(u-t),h=u-t,t=y-t;R&&u&&t!=h&&(z&&h<t&&(l?e===P-1:0===e)?(p=[C],d=o.map(function(e,t){return v-n+t}),i=f._getExpectedInlineSizes(o,s),a.forEach(function(e,t){e.minInlineSize=i[t].minSize,e.maxInlineSize=i[t].maxSize,e.inlineSize=L(e.inlineSize,e.minInlineSize,e.maxInlineSize)})):(r=f._getStretchItemInfos(o,s).infos,a.forEach(function(e,t){e.inlineSize=r[t].size,e.minInlineSize=r[t].minSize,e.maxInlineSize=r[t].maxSize}))),a.forEach(function(e,t){var n=e.item,i=e.inlineSize,r=o[t-1],t=r?r.cssInlinePos+r.cssInlineSize+E:0;g&&(i*=c);r=n.gridData;r.orgInlineSize=e.orgInlineSize,r.orgContentSize=s,r.minInlineSize=e.minInlineSize,r.maxInlineSize=e.maxInlineSize,n.setCSSGridRect({inlinePos:t,contentPos:C,inlineSize:i,contentSize:s})}),C+=_+s,(m<0||e<m)&&(b=C)}),l)return{start:[n],end:[b],passedItems:d,passed:p};var r=C-n;return e.forEach(function(e){e.cssContentPos-=r}),{passedItems:d,passed:p?[p[0]-r]:null,start:[n-r],end:[n]}},n.getComputedOutlineLength=function(){return 1},n.getComputedOutlineSize=function(){return this.getContainerInlineSize()},n._getRowRange=function(){var e=this.rowRange;return T(e)?e:[e,e]},n._getColumnRange=function(){var e=this.columnRange;return T(e)?e:[e,e]},n._getSizeRange=function(){var e=this.sizeRange;return T(e)?e:[e,e]},t.propertyTypes=p(p({},me.propertyTypes),{columnRange:a.RENDER_PROPERTY,rowRange:a.RENDER_PROPERTY,sizeRange:a.RENDER_PROPERTY,isCroppedSize:a.RENDER_PROPERTY,displayedRow:a.RENDER_PROPERTY,stretch:a.RENDER_PROPERTY,stretchRange:a.RENDER_PROPERTY,passUnstretchRow:a.RENDER_PROPERTY,inlineMargin:a.RENDER_PROPERTY,contentMargin:a.RENDER_PROPERTY,inlineOffset:a.RENDER_PROPERTY,contentOffset:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},me.defaultOptions),{columnRange:[1,8],rowRange:0,sizeRange:[0,1/0],displayedRow:-1,isCroppedSize:!1,stretch:!1,passUnstretchRow:!0,stretchRange:["-20%","+20%"],inlineOffset:0,contentOffset:0}),o([M],t)}(me);function Ee(e){var t=-1/0;return e.forEach(function(e){isFinite(e)&&(t=Math.max(t,e))}),isFinite(t)?t:0}function _e(e,t,n){return Ee(e)+function(e,t,n){var i=e.length;if(!i)return 0;var r=function(e){var t=1/0;return e.forEach(function(e){isFinite(e)&&(t=Math.min(t,e))}),isFinite(t)?t:0}(t),o=Ee(e),s=0;if(!n)return 0;for(var a=0;a<i;++a){var u=e[a],c=t[a];isFinite(u)&&isFinite(c)&&(u=u-o,c=c-r,s=a?Math.max(s,s+u-c):u-c)}return s}(e,t,n)}function Pe(e,t,n){for(var i=n.inlinePos,r=n.inlineSize,o=n.contentPos,s=n.contentSize,a=i;a<i+r;++a)e[a]=Math.min(e[a],o),t[a]=Math.max(t[a],o+s)}var B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(e,t,n){var i=this._getFrame(),r=i.inlineSize,o=i.contentSize,s=i.rects,a=this.options.useFrameFill,u=this.getRectSize(r),c=u.inlineSize,h=u.contentSize,l=this.getInlineGap(),f=this.getContentGap(),d=e.length;if(!d||!r||!o)return{start:n,end:n};for(var p=s.length,g=A(r).map(function(){return 1/0}),m=A(r).map(function(){return-1/0}),R=i.outline.map(function(e){return e*(h+f)}),z=0;z<d;z+=p)for(var v=_e(m,R,a),S=0;S<p&&z+S<d;++S){var y=e[z+S],E=s[S],_=E.contentPos,P=E.inlinePos,C=E.contentSize,b=E.inlineSize,O=v+_*(h+f),E=P*(c+l),_=C*(h+f)-f,C=b*(c+l)-l;Pe(g,m,{inlinePos:P,inlineSize:b,contentPos:O,contentSize:_+f}),y.setCSSGridRect({inlinePos:E,contentPos:O,inlineSize:C,contentSize:_})}var I,t="end"===t,n=n.length?n:[0];n.length!==r&&(I=(t?Math.max:Math.min).apply(Math,n),n=A(r).map(function(){return I}));var g=g.map(function(e){return isFinite(e)?e:0}),m=m.map(function(e){return isFinite(e)?e:0}),x=t?_e(n,g,a):_e(m,n,a);return e.forEach(function(e){e.cssContentPos+=x}),{start:g.map(function(e){return e+x}),end:m.map(function(e){return e+x})}},n.getComputedOutlineLength=function(){var e=this.options.frame;return e.length?e[0].length:0},n.getComputedOutlineSize=function(){var e=this.options.rectSize;if("object"==typeof e)return e.inlineSize;var t=this.getInlineGap();return e||(this.getContainerInlineSize()+t)/this.getComputedOutlineLength()-t},n.getRectSize=function(e){var t=this.options.rectSize;if("object"==typeof t)return t;var n=this.getInlineGap(),n=t||(this.getContainerInlineSize()+n)/e-n;return{inlineSize:n,contentSize:n}},n._getFrame=function(){for(var e=this.options.frame,t=e.length,n=t?e[0].length:0,i=[],r={},o=A(n).map(function(){return 1/0}),s=A(n).map(function(){return-1/0}),a=0;a<t;++a)for(var u=0;u<n;++u){var c=e[a][u];c&&(r[a+","+u]||(Pe(o,s,c=this._findRect(r,c,a,u,n,t)),i.push(c)))}return i.sort(function(e,t){return e.type<t.type?-1:1}),{rects:i,inlineSize:n,contentSize:t,outline:o}},n._findRect=function(e,t,n,i,r,o){for(var s=this.options.frame,a=1,u=1,c=i;c<r&&s[n][c]===t;++c)u=c-i+1;for(var h=n;h<o&&s[h][i]===t;++h)a=h-n+1;for(var l=n;l<n+a;++l)for(var f=i;f<i+u;++f)e[l+","+f]=!0;return{type:t,inlinePos:i,contentPos:n,inlineSize:u,contentSize:a}},t.propertyTypes=p(p({},me.propertyTypes),{frame:a.RENDER_PROPERTY,useFrameFill:a.RENDER_PROPERTY,rectSize:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},me.defaultOptions),{frame:[],rectSize:0,useFrameFill:!0}),o([M],t)}(me),Ce=function(){function e(e){var t,n=p({orgInlineSize:0,orgContentSize:0,inlineSize:0,contentSize:0,inlinePos:0,contentPos:0,items:[]},e);for(t in n)this[t]=n[t]}var t=e.prototype;return t.scaleTo=function(e,t){var n=this.inlineSize?e/this.inlineSize:0,i=this.contentSize?t/this.contentSize:0;this.items.forEach(function(e){0!=n&&(e.inlinePos*=n,e.inlineSize*=n),0!=i&&(e.contentPos*=i,e.contentSize*=i)}),this.inlineSize=e,this.contentSize=t},t.push=function(e){this.items.push(e)},t.getOrgSizeWeight=function(){return this.orgInlineSize*this.orgContentSize},t.getSize=function(){return this.inlineSize*this.contentSize},t.getOrgRatio=function(){return 0===this.orgContentSize?0:this.orgInlineSize/this.orgContentSize},t.getRatio=function(){return 0===this.contentSize?0:this.inlineSize/this.contentSize},e}();function be(e,t){t=e/t;return(t=t<1?1/t:t)-1}var Oe,Ie={__proto__:null,default:me,GetterSetter:M,withGridMethods:j,withMethods:N,getMountedElements:I,getUpdatedItems:b,MasonryGrid:q,JustifiedGrid:ce,FrameGrid:B,PackingGrid:function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(e,t,n){var i=this,r=this.options.aspectRatio,o=this.getContainerInlineSize(),s=o/r,a=this.getInlineGap(),u=this.getContentGap(),n=n.length?n:[0],c="end"===t?Math.max.apply(Math,n):Math.min.apply(Math,n)-s-u,n=c+s+u,h=new Ce({});return e.forEach(function(e){e=new Ce({inlineSize:e.orgInlineSize,contentSize:e.orgContentSize,orgInlineSize:e.orgInlineSize,orgContentSize:e.orgContentSize});i._findBestFitArea(h,e),h.push(e),h.scaleTo(o+a,s+u)}),e.forEach(function(e,t){var n=h.items[t],i=n.inlineSize-a,r=n.contentSize-u,t=c+n.contentPos,n=n.inlinePos;e.setCSSGridRect({inlinePos:n,contentPos:t,inlineSize:i,contentSize:r})}),{start:[c],end:[n]}},n._findBestFitArea=function(e,p){if(0===e.getRatio())return e.orgInlineSize=p.inlineSize,e.orgContentSize=p.contentSize,e.inlineSize=p.inlineSize,void(e.contentSize=p.contentSize);var g,t,n,i,r,m=1/0,R=!1,z={inlineSize:0,contentSize:0},v={inlineSize:0,contentSize:0},S=this._getWeight("size"),y=this._getWeight("ratio");e.items.forEach(function(e){for(var t=be(e.getOrgSizeWeight(),e.getSize())*S,n=be(e.getOrgRatio(),e.getRatio())*y,i=e.inlineSize,r=e.contentSize,o=0;o<2;++o){var s=void 0,a=void 0,u=void 0,c=void 0;0===o?(u=s=i,c=r-(a=r*(p.contentSize/(e.orgContentSize+p.contentSize)))):(c=a=r,u=i-(s=i*(p.inlineSize/(e.orgInlineSize+p.inlineSize))));var h=s*a,l=s/a,f=u*c,d=c/c,h=be(p.getSize(),h)*S;h+=be(p.getRatio(),l)*y,h+=be(e.getOrgSizeWeight(),f)*S-t,(h+=be(e.getOrgRatio(),d)*y-n)===Math.min(h,m)&&(m=h,g=e,R=0===o,z.inlineSize=s,z.contentSize=a,v.inlineSize=u,v.contentSize=c)}}),t=g,n=z,i=v,r=R,(e=p).contentSize=n.contentSize,e.inlineSize=n.inlineSize,t.contentSize=i.contentSize,t.inlineSize=i.inlineSize,r?(e.contentPos=t.contentPos+t.contentSize,e.inlinePos=t.inlinePos):(e.inlinePos=t.inlinePos+t.inlineSize,e.contentPos=t.contentPos)},n.getComputedOutlineLength=function(){return 1},n.getComputedOutlineSize=function(){return this.getContainerInlineSize()},n._getWeight=function(e){var t=this.options,n=t.weightPriority;return n===e?100:"custom"===n?t[e+"Weight"]:1},t.propertyTypes=p(p({},me.propertyTypes),{aspectRatio:a.RENDER_PROPERTY,sizeWeight:a.RENDER_PROPERTY,ratioWeight:a.RENDER_PROPERTY,weightPriority:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},me.defaultOptions),{aspectRatio:1,sizeWeight:1,ratioWeight:1,weightPriority:"custom"}),o([M],t)}(me),ItemRenderer:pe,GridItem:ge,ContainerManager:G,ResizeWatcher:F,DEFAULT_GRID_OPTIONS:f,get PROPERTY_TYPE(){return a},get MOUNT_STATE(){return g},get UPDATE_STATE(){return R},GRID_PROPERTY_TYPES:z,GRID_METHODS:e,GRID_EVENTS:["renderComplete","contentError"],RECT_NAMES:d};for(Oe in Ie)me[Oe]=Ie[Oe];return me});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Grid=t()}(this,function(){"use strict";var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var p=function(){return(p=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function o(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(o<3?r(s):3<o?r(t,n,s):r(t,n))||s);return 3<o&&s&&Object.defineProperty(t,n,s),s}function m(e,t){for(var n=0,i=t.length,r=e.length;n<i;n++,r++)e[r]=t[n];return e}function h(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(i=o.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s}(arguments[t]));return e}function l(e){return void 0===e}var a,g,R,u=function(){function e(e,t){var n,i;if(this.eventType=e,this._canceled=!1,t)try{for(var r=h(Object.keys(t)),o=r.next();!o.done;o=r.next()){var s=o.value;this[s]=t[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}var t=e.prototype;return t.stop=function(){this._canceled=!0},t.isCanceled=function(){return this._canceled},e}(),n=function(){function e(){this._eventHandler={}}var t=e.prototype;return t.trigger=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var i=t instanceof u?t.eventType:t,i=s(this._eventHandler[i]||[]);return i.length<=0||(t instanceof u?(t.currentTarget=this,i.forEach(function(e){e(t)})):i.forEach(function(e){e.apply(void 0,s(n))})),this},t.once=function(n,i){var r,o=this;if("object"==typeof n&&l(i)){var e,t=n;for(e in t)this.once(e,t[e]);return this}return"string"==typeof n&&"function"==typeof i&&this.on(n,r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.apply(void 0,s(e)),o.off(n,r)}),this},t.hasOn=function(e){return!!this._eventHandler[e]},t.on=function(e,t){if("object"==typeof e&&l(t)){var n,i=e;for(n in i)this.on(n,i[n]);return this}var r;return"string"==typeof e&&"function"==typeof t&&(r=this._eventHandler[e],l(r)&&(this._eventHandler[e]=[],r=this._eventHandler[e]),r.push(t)),this},t.off=function(e,t){var n,i;if(l(e))return this._eventHandler={},this;if(l(t)){if("string"==typeof e)return delete this._eventHandler[e],this;var r,o=e;for(r in o)this.off(r,o[r]);return this}var s=this._eventHandler[e];if(s){var a=0;try{for(var u=h(s),c=u.next();!c.done;c=u.next()){if(c.value===t){s.splice(a,1),s.length<=0&&delete this._eventHandler[e];break}a++}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}return this},e.VERSION="3.0.1",e}(),c=u,f={horizontal:!1,useTransform:!1,percentage:!1,isEqualSize:!1,isConstantSize:!1,gap:0,attributePrefix:"data-grid-",resizeDebounce:100,maxResizeDebounce:0,autoResize:!0,preserveUIOnDestroy:!1,defaultDirection:"end",externalContainerManager:null,externalItemRenderer:null,renderOnPropertyChange:!0,useFit:!0,outlineLength:0,outlineSize:0,useRoundedSize:!0,useResizeObserver:!1,observeChildren:!1};(q=a=a||{})[q.PROPERTY=1]="PROPERTY",q[q.RENDER_PROPERTY=2]="RENDER_PROPERTY",(B=g=g||{})[B.UNCHECKED=1]="UNCHECKED",B[B.UNMOUNTED=2]="UNMOUNTED",B[B.MOUNTED=3]="MOUNTED",(ce=R=R||{})[ce.NEED_UPDATE=1]="NEED_UPDATE",ce[ce.WAIT_LOADING=2]="WAIT_LOADING",ce[ce.UPDATED=3]="UPDATED";var z={gap:a.RENDER_PROPERTY,defaultDirection:a.PROPERTY,renderOnPropertyChange:a.PROPERTY,preserveUIOnDestroy:a.PROPERTY,useFit:a.PROPERTY,outlineSize:a.RENDER_PROPERTY,outlineLength:a.RENDER_PROPERTY},e=["syncElements","updateItems","getItems","setItems","renderItems","getContainerInlineSize","getContainerElement"],d={horizontal:{inlinePos:"top",contentPos:"left",inlineSize:"height",contentSize:"width"},vertical:{inlinePos:"left",contentPos:"top",inlineSize:"width",contentSize:"height"}},S=function(){function e(){this.keys=[],this.values=[]}var t=e.prototype;return t.get=function(e){return this.values[this.keys.indexOf(e)]},t.set=function(e,t){var n=this.keys,i=this.values,r=n.indexOf(e),r=-1===r?n.length:r;n[r]=e,i[r]=t},e}(),v=function(){function e(){this.object={}}var t=e.prototype;return t.get=function(e){return this.object[e]},t.set=function(e,t){this.object[e]=t},e}(),y="function"==typeof Map,E=function(){function e(){}var t=e.prototype;return t.connect=function(e,t){this.prev=e,this.next=t,e&&(e.next=this),t&&(t.prev=this)},t.disconnect=function(){var e=this.prev,t=this.next;e&&(e.next=t),t&&(t.prev=e)},t.getIndex=function(){for(var e=this,t=-1;e;)e=e.prev,++t;return t},e}();var _=function(){function e(e,t,n,i,r,o,s,a){this.prevList=e,this.list=t,this.added=n,this.removed=i,this.changed=r,this.maintained=o,this.changedBeforeAdded=s,this.fixed=a}var t=e.prototype;return Object.defineProperty(t,"ordered",{get:function(){return this.cacheOrdered||this.caculateOrdered(),this.cacheOrdered},enumerable:!0,configurable:!0}),Object.defineProperty(t,"pureChanged",{get:function(){return this.cachePureChanged||this.caculateOrdered(),this.cachePureChanged},enumerable:!0,configurable:!0}),t.caculateOrdered=function(){var e,n,r,o,e=(e=this.changedBeforeAdded,n=this.fixed,r=[],o=[],e.forEach(function(e){var t=e[0],n=e[1],e=new E;r[t]=e,o[n]=e}),r.forEach(function(e,t){e.connect(r[t-1])}),e.filter(function(e,t){return!n[t]}).map(function(e,t){var n=e[0],i=e[1];if(n===i)return[0,0];e=r[n],n=o[i-1],i=e.getIndex();return e.disconnect(),n?e.connect(n,n.next):e.connect(void 0,r[0]),[i,e.getIndex()]})),s=this.changed,a=[];this.cacheOrdered=e.filter(function(e,t){var n=e[0],i=e[1],e=s[t],t=e[0],e=e[1];if(n!==i)return a.push([t,e]),!0}),this.cachePureChanged=a},e}();var t,P="function"==typeof Map?void 0:(t=0,function(e){return e.__DIFF_KEY__||(e.__DIFF_KEY__=++t)});function C(e,t){return n=e,i=t,r=P,e=y?Map:r?v:S,t=r||function(e){return e},o=[],s=[],a=[],r=n.map(t),t=i.map(t),u=new e,c=new e,h=[],l=[],f={},d=[],g=p=0,r.forEach(function(e,t){u.set(e,t)}),t.forEach(function(e,t){c.set(e,t)}),r.forEach(function(e,t){e=c.get(e);void 0===e?(++g,s.push(t)):f[e]=g}),t.forEach(function(e,t){e=u.get(e);void 0===e?(o.push(t),++p):(a.push([e,t]),g=f[t]||0,h.push([e-g,t-p]),l.push(t===e),e!==t&&d.push([e,t]))}),s.reverse(),new _(n,i,o,s,d,a,h,l);var n,i,r,o,s,a,u,c,h,l,f,d,p,g}function b(n,i){var e=O(n);return C(i.map(function(e){return e.target}),e.map(function(e){return e.element})).maintained.filter(function(e){var t=e[0],e=e[1],t=i[t].size,e=n[e];return!e.inlineSize||!e.contentSize||t.inlineSize!==e.computedInlineSize||t.blockSize!==e.computedContentSize}).map(function(e){e=e[1];return n[e]})}function O(e){return e.filter(function(e){return e.element})}function I(e){return O(e).map(function(e){return e.element})}function x(e){return"string"==typeof e}function T(e){return"object"==typeof e}function w(e){return"number"==typeof e}function D(e){return e.reduce(function(e,t){return e+t},0)}function M(e){var t,r=e.prototype,o=e.propertyTypes;for(t in o)!function(n){var i=o[n]===a.RENDER_PROPERTY,e=Object.getOwnPropertyDescriptor(r,n)||{};Object.defineProperty(r,n,{enumerable:!0,configurable:!0,get:e.get||function(){return this.options[n]},set:e.set||function(e){var t=this.options;t[n]!==e&&(t[n]=e,i&&t.renderOnPropertyChange&&this.scheduleRender())}})}(t)}function N(t){return function(e,r){t.forEach(function(i){i in e||(e[i]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(n=this[r])[i].apply(n,e);return n===this[r]?this:n})})}}function U(e){for(var t=[],n=0;n<e;++n)t.push(n);return t}function k(e,t){return Math.max(e-t[1],t[0]-e,0)+1}function A(e,t,n){return Math.min(n,Math.max(e,t))}function L(e,t){if(!t)return e;var n=1/t;return Math.round(e/t)/n}var F=N(e),j=function(){function e(e,t){var u=this;void 0===t&&(t={}),this._resizeTimer=0,this._maxResizeDebounceTimer=0,this.rect={width:0,height:0},this._updatedEntries=[],this._onWindowResize=function(){u._scheduleResize([{target:u.container}])},this._onObserve=function(e){var t=u._options,i=u.container,r=t.rectBox,o=t.childrenRectBox;u._scheduleResize(e.map(function(e){var t,n="border-box"===(e.target===i?r:o)?e.borderBoxSize:e.contentBoxSize;return{size:(n=!n?[{inlineSize:(t=e.contentRect).width,blockSize:t.height}]:n)[0]||n,target:e.target}}))},this._scheduleResize=function(e){var t=u._options,n=t.resizeDebounce,t=t.maxResizeDebounce,i=u._updatedEntries;i.push.apply(i,e),u._updatedEntries=i.filter(function(e,t){return i.lastIndexOf(e)===t}),!u._maxResizeDebounceTimer&&n<=t&&(u._maxResizeDebounceTimer=window.setTimeout(u._onResize,t)),u._resizeTimer&&(clearTimeout(u._resizeTimer),u._resizeTimer=0),u._resizeTimer=window.setTimeout(u._onResize,n)},this._onResize=function(){clearTimeout(u._resizeTimer),clearTimeout(u._maxResizeDebounceTimer),u._maxResizeDebounceTimer=0,u._resizeTimer=0;var t,e,n,i=u._updatedEntries,r=u.container,o=i.filter(function(e){return e.target!==r||(t=e,!1)}),s=0<o.length,a=!!t;a&&(e=u._options.watchDirection,n=u.rect,(i=t.size)?u.setRect({width:i.inlineSize,height:i.blockSize}):u.resize(),i=u.rect,a=!e||("box"===e||"width"===e)&&n.width!==i.width||("box"===e||"height"===e)&&n.height!==i.height),u._updatedEntries=[],(a||s)&&u._emitter.trigger("resize",{isResizeContainer:a,childEntries:o})},this._options=p({resizeDebounce:100,maxResizeDebounce:0,useResizeObserver:!1,useWindowResize:!0,watchDirection:!1,rectBox:"content-box",childrenRectBox:"border-box"},t),this.container=x(e)?document.querySelector(e):e,this._init()}var t=e.prototype;return t.getRect=function(){return this.rect},t.setRect=function(e){this.rect=p({},e)},t.isObserverEnabled=function(){return!!this._observer},t.resize=function(){var e=this.container;this.setRect("border-box"===this._options.rectBox?{width:e.offsetWidth,height:e.offsetHeight}:{width:e.clientWidth,height:e.clientHeight})},t.observeChildren=function(e){var t,n=this._observer;n&&(t=this._options.childrenRectBox,e.forEach(function(e){e&&n.observe(e,{box:t})}))},t.unobserveChildren=function(e){var t=this._observer;t&&e.forEach(function(e){e&&t.unobserve(e)})},t.listen=function(e){return this._emitter.on("resize",e),this},t.destroy=function(){var e;null!==(e=this._observer)&&void 0!==e&&e.disconnect(),this._options.useWindowResize&&window.removeEventListener("resize",this._onWindowResize)},t._init=function(){var e=this.container,t=this._options;this._emitter=new n,t.useResizeObserver&&window.ResizeObserver&&(this._observer=new window.ResizeObserver(this._onObserve),this._observer.observe(e,{box:t.rectBox})),t.useWindowResize&&window.addEventListener("resize",this._onWindowResize),this.resize()},e}(),G=function(i){function e(e,t){var n=i.call(this)||this;return n.container=e,n._onResize=function(e){n.trigger("resize",e)},n.options=p({horizontal:f.horizontal,autoResize:f.autoResize,resizeDebounce:f.resizeDebounce,maxResizeDebounce:f.maxResizeDebounce,useResizeObserver:f.useResizeObserver},t),n._init(),n}r(e,i);var t=e.prototype;return t.resize=function(){var e=this.container;this.setRect({width:e.clientWidth,height:e.clientHeight})},t.isObserverEnabled=function(){return this._watcher.isObserverEnabled()},t.getRect=function(){return this._watcher.getRect()},t.observeChildren=function(e){this._watcher.observeChildren(e)},t.unobserveChildren=function(e){this._watcher.unobserveChildren(e)},t.setRect=function(e){this._watcher.setRect(e)},t.getInlineSize=function(){return this.getRect()[this._names.inlineSize]},t.getContentSize=function(){return this.getRect()[this._names.contentSize]},t.getStatus=function(){return{rect:this._watcher.getRect()}},t.setStatus=function(e){this.setRect(e.rect),this.setContentSize(this.getContentSize())},t.setContentSize=function(e){var t,n=this.options.horizontal?"width":"height";this.setRect(p(p({},this.getRect()),((t={})[n]=e,t))),this.container.style[n]=e+"px"},t.destroy=function(e){void 0===e&&(e={}),this._watcher.destroy(),e.preserveUI||(this.container.style.cssText=this.orgCSSText)},t._init=function(){var e=this.container,t=window.getComputedStyle(e);this.orgCSSText=e.style.cssText,"static"===t.position&&(e.style.position="relative");t=this.options;this._watcher=new j(e,{useWindowResize:t.autoResize,useResizeObserver:t.useResizeObserver,resizeDebounce:t.resizeDebounce,maxResizeDebounce:t.maxResizeDebounce,watchDirection:!!t.useResizeObserver&&this._names.inlineSize}).listen(this._onResize)},Object.defineProperty(t,"_names",{get:function(){return d[this.options.horizontal?"horizontal":"vertical"]},enumerable:!1,configurable:!0}),e}(n),Y=function(e,t){return(Y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function W(e,t){function n(){this.constructor=e}Y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var H=function(){return(H=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};var q="undefined"!=typeof window,B=q?window.navigator.userAgent:"",V=q&&!!("getComputedStyle"in window),K=/MSIE|Trident|Windows Phone|Edge/.test(B),X=q&&!!("addEventListener"in document),J="width",$="height";function Q(e,t){return e.getAttribute(t)||""}function Z(e){return[].slice.call(e)}function ee(e,t){return void 0===t&&(t="data-"),"loading"in e&&"lazy"===e.getAttribute("loading")||!!e.getAttribute(t+"lazy")}function te(e,t,n){X?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function ne(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function ie(e,t){var n=e["client"+t]||e["offset"+t];return parseFloat(n||(e=e,((V?window.getComputedStyle(e):e.currentStyle)||{})[t.toLowerCase()]))||0}function re(e,t,n){var i=Z(e.querySelectorAll(function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),r=0,t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i}(["["+n+"skip] ["+n+"width]"],t.map(function(e){return["["+n+"skip] "+e,e+"["+n+"skip]","["+n+"width] "+e].join(", ")})).join(", ")));return Z(e.querySelectorAll("["+n+"width], "+t.join(", "))).filter(function(e){return-1===i.indexOf(e)})}var oe=[];function se(e,t){oe.length||te(window,"resize",ue),e.__PREFIX__=t,oe.push(e),ae(e)}function ae(e,t){void 0===t&&(t="data-");var n,i=e.__PREFIX__||t,r=parseInt(Q(e,""+i+J),10)||0,t=parseInt(Q(e,""+i+$),10)||0;Q(e,i+"fixed")===$?(n=ie(e,"Height")||t,e.style[J]=r/t*n+"px"):(n=ie(e,"Width")||r,e.style[$]=t/r*n+"px")}function ue(){oe.forEach(function(e){ae(e)})}var ce=function(r){function e(e,t){void 0===t&&(t={});var n=r.call(this)||this;n.isReady=!1,n.isPreReady=!1,n.hasDataSize=!1,n.hasLoading=!1,n.isSkip=!1,n.onCheck=function(e){n.clear(),e&&"error"===e.type&&n.onError(n.element),n.hasLoading&&n.checkElement()||(e=!n.hasDataSize&&!n.hasLoading,n.onReady(e))},n.options=H({prefix:"data-"},t),n.element=e;var i=n.options.prefix;return n.hasDataSize=(t=i,!!e.getAttribute((t=void 0===t?"data-":t)+"width")),n.isSkip=(t=i,!!e.getAttribute((t=void 0===t?"data-":t)+"skip")),n.hasLoading=ee(e,i),n}W(e,r);var t=e.prototype;return t.check=function(){return this.isSkip||!this.checkElement()?(this.onAlreadyReady(!0),!1):(this.hasDataSize&&se(this.element,this.options.prefix),(this.hasDataSize||this.hasLoading)&&this.onAlreadyPreReady(),!0)},t.addEvents=function(){var t=this,n=this.element;this.constructor.EVENTS.forEach(function(e){te(n,e,t.onCheck)})},t.clear=function(){var t=this,n=this.element;this.constructor.EVENTS.forEach(function(e){ne(n,e,t.onCheck)}),this.removeAutoSizer()},t.destroy=function(){this.clear(),this.off()},t.removeAutoSizer=function(){var e,t,n;this.hasDataSize&&(n=this.options.prefix,e=this.element,t=n,(n=oe.indexOf(e))<0||(t=Q(e,t+"fixed"),delete e.__PREFIX__,e.style[t===$?J:$]="",oe.splice(n,1),oe.length||ne(window,"resize",ue)))},t.onError=function(e){this.trigger("error",{element:this.element,target:e})},t.onPreReady=function(){this.isPreReady||(this.isPreReady=!0,this.trigger("preReady",{element:this.element,hasLoading:this.hasLoading,isSkip:this.isSkip}))},t.onReady=function(e){this.isReady||((e=!this.isPreReady&&e)&&(this.isPreReady=!0),this.removeAutoSizer(),this.isReady=!0,this.trigger("ready",{element:this.element,withPreReady:e,hasLoading:this.hasLoading,isSkip:this.isSkip}))},t.onAlreadyError=function(e){var t=this;setTimeout(function(){t.onError(e)})},t.onAlreadyPreReady=function(){var e=this;setTimeout(function(){e.onPreReady()})},t.onAlreadyReady=function(e){var t=this;setTimeout(function(){t.onReady(e)})},e.EVENTS=[],e}(n),he=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}W(t,e);var n=t.prototype;return n.setHasLoading=function(e){this.hasLoading=e},n.check=function(){return this.isSkip?(this.onAlreadyReady(!0),!1):(this.hasDataSize?(se(this.element,this.options.prefix),this.onAlreadyPreReady()):this.trigger("requestChildren"),!0)},n.checkElement=function(){return!0},n.destroy=function(){this.clear(),this.trigger("requestDestroy"),this.off()},n.onAlreadyPreReady=function(){e.prototype.onAlreadyPreReady.call(this),this.trigger("reqeustReadyChildren")},t.EVENTS=[],t}(ce),B=function(n){function e(e){void 0===e&&(e={});var t=n.call(this)||this;return t.readyCount=0,t.preReadyCount=0,t.totalCount=0,t.totalErrorCount=0,t.isPreReadyOver=!0,t.elementInfos=[],t.options=H({loaders:{},prefix:"data-"},e),t}W(e,n);var t=e.prototype;return t.check=function(e){var o=this,n=this.options.prefix;this.clear(),this.elementInfos=Z(e).map(function(e,r){var t=o.getLoader(e,{prefix:n});return t.check(),t.on("error",function(e){o.onError(r,e.target)}).on("preReady",function(e){var t=o.elementInfos[r];t.hasLoading=e.hasLoading,t.isSkip=e.isSkip;e=o.checkPreReady(r);o.onPreReadyElement(r),e&&o.onPreReady()}).on("ready",function(e){var t=e.withPreReady,n=e.hasLoading,i=e.isSkip,e=o.elementInfos[r];e.hasLoading=n,e.isSkip=i;e=t&&o.checkPreReady(r),i=o.checkReady(r);t&&o.onPreReadyElement(r),o.onReadyElement(r),e&&o.onPreReady(),i&&o.onReady()}),{loader:t,element:e,hasLoading:!1,hasError:!1,isPreReady:!1,isReady:!1,isSkip:!1}});e=this.elementInfos.length;return(this.totalCount=e)||setTimeout(function(){o.onPreReady(),o.onReady()}),this},t.getTotalCount=function(){return this.totalCount},t.isPreReady=function(){return this.elementInfos.every(function(e){return e.isPreReady})},t.isReady=function(){return this.elementInfos.every(function(e){return e.isReady})},t.hasError=function(){return 0<this.totalErrorCount},t.clear=function(){this.isPreReadyOver=!1,this.totalCount=0,this.preReadyCount=0,this.readyCount=0,this.totalErrorCount=0,this.elementInfos.forEach(function(e){!e.isReady&&e.loader&&e.loader.destroy()}),this.elementInfos=[]},t.destroy=function(){this.clear(),this.off()},t.getLoader=function(t,e){var n=this,i=t.tagName.toLowerCase(),r=this.options.loaders,o=e.prefix,s=Object.keys(r);if(r[i])return new r[i](t,e);var a=new he(t,e),u=Z(t.querySelectorAll(s.join(", ")));a.setHasLoading(u.some(function(e){return ee(e,o)}));var c=!1,h=this.clone().on("error",function(e){a.onError(e.target)}).on("ready",function(){a.onReady(c)});return a.on("requestChildren",function(){var e=re(t,s,n.options.prefix);h.check(e).on("preReady",function(e){(c=e.isReady)||a.onPreReady()})}).on("reqeustReadyChildren",function(){h.check(u)}).on("requestDestroy",function(){h.destroy()}),a},t.clone=function(){return new e(H({},this.options))},t.checkPreReady=function(e){return this.elementInfos[e].isPreReady=!0,++this.preReadyCount,!(this.preReadyCount<this.totalCount)},t.checkReady=function(e){return this.elementInfos[e].isReady=!0,++this.readyCount,!(this.readyCount<this.totalCount)},t.onError=function(e,t){var n=this.elementInfos[e];n.hasError=!0,this.trigger(new c("error",{element:n.element,index:e,target:t,errorCount:this.getErrorCount(),totalErrorCount:++this.totalErrorCount}))},t.onPreReadyElement=function(e){var t=this.elementInfos[e];this.trigger(new c("preReadyElement",{element:t.element,index:e,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:t.hasLoading,isSkip:t.isSkip}))},t.onPreReady=function(){this.isPreReadyOver=!0,this.trigger(new c("preReady",{readyCount:this.readyCount,totalCount:this.totalCount,isReady:this.isReady(),hasLoading:this.hasLoading()}))},t.onReadyElement=function(e){var t=this.elementInfos[e];this.trigger(new c("readyElement",{index:e,element:t.element,hasError:t.hasError,errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:t.hasLoading,isPreReadyOver:this.isPreReadyOver,isSkip:t.isSkip}))},t.onReady=function(){this.trigger(new c("ready",{errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,totalCount:this.totalCount}))},t.getErrorCount=function(){return this.elementInfos.filter(function(e){return e.hasError}).length},t.hasLoading=function(){return this.elementInfos.some(function(e){return e.hasLoading})},e}(n),le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return W(t,e),t.prototype.checkElement=function(){var e=this.element,t=e.getAttribute("src");if(e.complete){if(t)return e.naturalWidth||this.onAlreadyError(e),!1;this.onAlreadyPreReady()}return this.addEvents(),K&&e.setAttribute("src",t),!0},t.EVENTS=["load","error"],t}(ce),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return W(t,e),t.prototype.checkElement=function(){var e=this.element;return!(1<=e.readyState)&&(e.error?(this.onAlreadyError(e),!1):(this.addEvents(),!0))},t.EVENTS=["loadedmetadata","error"],t}(ce),de=function(t){function e(e){return t.call(this,H({loaders:{img:le,video:fe}},e=void 0===e?{}:e))||this}return W(e,t),e}(B),pe=function(){function e(e){this.initialRects={},this.sizePercetage=!1,this.posPercetage=!1,this.options=p({attributePrefix:f.attributePrefix,useTransform:f.useTransform,horizontal:f.horizontal,percentage:f.percentage,isEqualSize:f.isEqualSize,isConstantSize:f.isConstantSize,useRoundedSize:f.useRoundedSize},e),this._init()}var t=e.prototype;return t.resize=function(){this.initialRects={}},t.renderItems=function(e){var t=this;e.forEach(function(e){t._renderItem(e)})},t.getInlineSize=function(){return this.containerRect[this.options.horizontal?"height":"width"]},t.setContainerRect=function(e){this.containerRect=e},t.updateEqualSizeItems=function(t,e){var n=this;this.updateItems(t);var i=t.some(function(e){return e.attributes.sizeGroup});(this.options.isEqualSize||i)&&t.some(function(e){return e.updateState===R.UPDATED})&&e.forEach(function(e){-1===t.indexOf(e)&&n.updateItem(e,!0)})},t.updateItems=function(e){var t=this;e.forEach(function(e){t.updateItem(e)})},t.getStatus=function(){return{initialRects:this.initialRects}},t.setStatus=function(e){this.initialRects=e.initialRects},t._init=function(){var e=this.options.percentage,t=!1,n=!1;!0===e?n=t=!0:e&&(-1<e.indexOf("position")&&(n=!0),-1<e.indexOf("size")&&(t=!0)),this.posPercetage=n,this.sizePercetage=t},t.updateItem=function(e,t){var n=this.options,i=n.isEqualSize,r=n.isConstantSize,o=n.useRoundedSize,s=this.initialRects,a=e.orgRect,u=e.element,c=e.updateState===R.WAIT_LOADING,h=a&&a.width&&a.height,l=u?function(e,t){for(var n={},i=e.attributes,r=i.length,o=0;o<r;++o){var s=i[o],a=s.name,s=s.value;-1!==a.indexOf(t)&&(n[a.replace(t,"").replace(/[\s-_]([a-z])/g,function(e,t){return t.toUpperCase()})]=s)}return n}(u,this.options.attributePrefix):e.attributes,n=null!==(f=l.sizeGroup)&&void 0!==f?f:"",f=l.notEqualSize;if(""!==n&&s[n])d=s[n];else if(i&&!f&&!n&&s[""])d=s[""];else if(r&&h&&!c&&e.isFirstUpdate)d=a;else{if(t||!u)return;var d={left:u.offsetLeft,top:u.offsetTop,width:0,height:0};o?(d.width=u.offsetWidth,d.height=u.offsetHeight):(u=u.getBoundingClientRect(),d.width=u.width,d.height=u.height)}return e.attributes=l,e.shouldReupdate=!1,e.isFirstUpdate&&h||(e.orgRect=p({},d)),e.rect=p({},d),t||(e.element&&(e.mountState=g.MOUNTED),e.updateState===R.NEED_UPDATE&&(e.updateState=R.UPDATED,e.isFirstUpdate=!0),c||f||s[n]||(s[n]=p({},d))),d},t._renderItem=function(e){var t,n,i,r,o,s,a,u,c=e.element,h=e.cssRect;c&&h&&(u=(a=this.options).horizontal,t=a.useTransform,n=this.posPercetage,i=this.sizePercetage,e=["position: absolute;"],r=(a=d[u?"horizontal":"vertical"]).inlineSize,o=a.inlinePos,s=this.getInlineSize(),u=h,u=0<(a=Object.keys(u)).length,t&&(a=a.filter(function(e){return"top"!==e&&"left"!==e}),e.push("transform: translate("+(h.left||0)+"px, "+(h.top||0)+"px);")),e.push.apply(e,a.map(function(e){var t=h[e];return e===r&&i||e===o&&n?e+": "+t/s*100+"%;":e+": "+t+"px;"})),u&&(c.style.cssText+=e.join("")))},e}(),ge=function(){function e(e,t){void 0===t&&(t={}),this.horizontal=e,this.isUpdating=!1,this.shouldReupdate=!1,this.hasTransition=!1,this.transitionDuration="",this.isRestoreOrgCSSText=!0;var n,e=t.element,i=p({key:"",index:0,orgRect:{left:0,top:0,width:0,height:0},rect:{left:0,top:0,width:0,height:0},cssRect:{},attributes:{},data:{},isFirstUpdate:!1,mountState:g.UNCHECKED,updateState:R.NEED_UPDATE,element:e||null,orgCSSText:null!==(e=null==e?void 0:e.style.cssText)&&void 0!==e?e:"",gridData:{}},t);for(n in i)this[n]=i[n]}var t=e.prototype;return Object.defineProperty(t,"orgInlineSize",{get:function(){var e=this._names.inlineSize;return this.orgRect[e]||this.rect[e]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"orgContentSize",{get:function(){var e=this._names.contentSize;return this.orgRect[e]||this.rect[e]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"inlineSize",{get:function(){return this.rect[this._names.inlineSize]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"contentSize",{get:function(){return this.rect[this._names.contentSize]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssInlineSize",{get:function(){return this.cssRect[this._names.inlineSize]},set:function(e){this.cssRect[this._names.inlineSize]=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssContentSize",{get:function(){return this.cssRect[this._names.contentSize]},set:function(e){this.cssRect[this._names.contentSize]=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssInlinePos",{get:function(){return this.cssRect[this._names.inlinePos]},set:function(e){this.cssRect[this._names.inlinePos]=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cssContentPos",{get:function(){return this.cssRect[this._names.contentPos]},set:function(e){this.cssRect[this._names.contentPos]=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"computedInlineSize",{get:function(){var e=this._names.inlineSize;return this.cssRect[e]||this.rect[e]||this.orgRect[e]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"computedContentSize",{get:function(){var e=this._names.contentSize;return this.cssRect[e]||this.rect[e]||this.orgRect[e]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"computedInlinePos",{get:function(){var e,t=this._names.inlinePos;return null!==(e=this.cssRect[t])&&void 0!==e?e:this.rect[t]},enumerable:!1,configurable:!0}),Object.defineProperty(t,"computedContentPos",{get:function(){var e,t=this._names.contentPos;return null!==(e=this.cssRect[t])&&void 0!==e?e:this.rect[t]},enumerable:!1,configurable:!0}),t.setCSSGridRect=function(e){var t,n=d[this.horizontal?"horizontal":"vertical"],i={};for(t in e)i[n[t]]=e[t];this.cssRect=i},t.addCSSGridRect=function(e){var t,n=d[this.horizontal?"horizontal":"vertical"],i=this.cssRect;for(t in e)i[n[t]]=e[t]},t.getStatus=function(){return{index:this.index,mountState:this.mountState,updateState:this.updateState,attributes:this.attributes,orgCSSText:this.orgCSSText,isFirstUpdate:this.isFirstUpdate,element:null,key:this.key,orgRect:this.orgRect,rect:this.rect,cssRect:this.cssRect,gridData:this.gridData,data:this.data}},t.getMinimizedStatus=function(){var e={orgRect:this.orgRect,rect:this.rect,cssRect:this.cssRect,attributes:this.attributes,gridData:this.gridData},t=this,n=t.key,i=t.mountState,r=t.updateState,o=t.isFirstUpdate,t=t.orgCSSText;return void 0!==n&&(e.key=n),i!==g.UNCHECKED&&(e.mountState=i),r!==R.NEED_UPDATE&&(e.updateState=r),o&&(e.isFirstUpdate=!0),t&&(e.orgCSSText=t),e},Object.defineProperty(t,"_names",{get:function(){return this.horizontal?d.horizontal:d.vertical},enumerable:!1,configurable:!0}),e}(),me=function(d){function e(e,t){void 0===t&&(t={});var n=d.call(this)||this;n.items=[],n.outlines={start:[],end:[]},n._renderTimer=0,n._onResize=function(e){e.isResizeContainer?n._renderItems({useResize:!0},!0):0<(e=b(n.items,e.childEntries)).length&&n.updateItems(e)},n.options=p(p({},n.constructor.defaultOptions),t),n.containerElement=x(e)?document.querySelector(e):e;var i=n.options,r=i.isEqualSize,o=i.isConstantSize,s=i.useTransform,a=i.horizontal,u=i.percentage,c=i.externalContainerManager,h=i.externalItemRenderer,l=i.resizeDebounce,f=i.maxResizeDebounce,t=i.autoResize,e=i.useRoundedSize,i=i.useResizeObserver;return n.containerManager=c||new G(n.containerElement,{horizontal:a,resizeDebounce:l,maxResizeDebounce:f,autoResize:t,useResizeObserver:i}).on("resize",n._onResize),n.itemRenderer=h||new pe({useTransform:s,isEqualSize:r,isConstantSize:o,percentage:u,useRoundedSize:e}),n._init(),n}r(e,d);var t=e.prototype;return t.getContainerElement=function(){return this.containerElement},t.getItems=function(){return this.items},t.getChildren=function(){return[].slice.call(this.containerElement.children)},t.setItems=function(e){e.forEach(function(e,t){e.index=t});var t=this.options;return t.useResizeObserver&&t.observeChildren&&((t=this.containerManager).unobserveChildren(I(this.items)),t.observeChildren(I(e))),this.items=e,this},t.getContainerInlineSize=function(){return this.containerManager.getInlineSize()},t.getOutlines=function(){return this.outlines},t.setOutlines=function(e){return this.outlines=e,this},t.syncElements=function(e){void 0===e&&(e={});var n=this.items,t=this.options.horizontal,i=this.getChildren(),r=C(this.items.map(function(e){return e.element}),i),o=r.added,s=r.maintained,a=r.changed,r=r.removed,u=[];return s.forEach(function(e){var t=e[0],e=e[1];u[e]=n[t]}),o.forEach(function(e){u[e]=new ge(t,{element:i[e]})}),this.setItems(u),(o.length||r.length||a.length)&&this.renderItems(e),this},t.updateItems=function(e,t){void 0===e&&(e=this.items);var n=(t=void 0===t?{}:t).useOrgResize;return e.forEach(function(e){var t;n&&((t=e.orgRect).width=0,t.height=0),e.updateState=R.NEED_UPDATE}),this.checkReady(t),this},t.renderItems=function(e){return this._renderItems(e=void 0===e?{}:e),this},t.getStatus=function(t){return{outlines:this.outlines,items:this.items.map(function(e){return t?e.getMinimizedStatus():e.getStatus()}),containerManager:this.containerManager.getStatus(),itemRenderer:this.itemRenderer.getStatus()}},t.setStatus=function(e){var t=this,n=this.options.horizontal,i=this.containerManager,r=i.getInlineSize(),o=this.getChildren();return this.itemRenderer.setStatus(e.itemRenderer),i.setStatus(e.containerManager),this.outlines=e.outlines,this.items=e.items.map(function(e,t){return new ge(n,p(p({},e),{element:o[t]}))}),this.itemRenderer.renderItems(this.items),r!==i.getInlineSize()?this.renderItems({useResize:!0}):window.setTimeout(function(){t._renderComplete({direction:t.defaultDirection,mounted:t.items,updated:[],isResize:!1})}),this},t.getComputedOutlineSize=function(e){return void 0===e&&(e=this.items),this.options.outlineSize||this.getContainerInlineSize()},t.getComputedOutlineLength=function(e){return void 0===e&&(e=this.items),this.options.outlineLength||1},t.destroy=function(e){var e=(e=void 0===e?{}:e).preserveUI,e=void 0===e?this.options.preserveUIOnDestroy:e;this.containerManager.destroy({preserveUI:e}),e||this.items.forEach(function(e){var t=e.element,e=e.orgCSSText;t&&(t.style.cssText=e)}),null!==(e=this._im)&&void 0!==e&&e.destroy()},t.getInlineGap=function(){return this._getDirectionalGap("inline")},t.getContentGap=function(){return this._getDirectionalGap("content")},t.checkReady=function(i){var r=this,o=(i=void 0===i?{}:i).useOrgResize,e=this.items,s=e.filter(function(e){var t;return(null===(t=e.element)||void 0===t?void 0:t.parentNode)&&e.updateState!==R.UPDATED}),t=e.filter(function(e){var t;return(null===(t=e.element)||void 0===t?void 0:t.parentNode)&&e.mountState!==g.MOUNTED}),n=[];t.filter(function(e){if(e.hasTransition)return!0;var t=e.element;return 0<parseFloat(getComputedStyle(t).transitionDuration)&&(e.hasTransition=!0,e.transitionDuration=t.style.transitionDuration,!0)}).forEach(function(e){e.element.style.transitionDuration="0s"}),null!==(e=this._im)&&void 0!==e&&e.destroy(),this._im=new de({prefix:this.options.attributePrefix}).on("preReadyElement",function(e){s[e.index].updateState=R.WAIT_LOADING}).on("preReady",function(){s.forEach(function(e){var t=!e.isFirstUpdate||!e.orgRect.width||!e.orgRect.height,n=e.cssRect.width||e.cssRect.height;(t||o)&&n&&(e.element.style.cssText=e.orgCSSText)}),r._updateItems(s),r.readyItems(t,s,i)}).on("readyElement",function(e){var t,n=s[e.index];n.updateState=R.NEED_UPDATE,e.isPreReadyOver&&(t=!n.isFirstUpdate||!n.orgRect.width||!n.orgRect.height,e=n.cssRect.width||n.cssRect.height,(n.isRestoreOrgCSSText||(t||o)&&e)&&(n.element.style.cssText=n.orgCSSText),r._updateItems([n]),r.readyItems([],[n],i))}).on("error",function(e){var t=s[e.index];r.trigger("contentError",{element:e.element,target:e.target,item:t,update:function(){n.push(t)}})}).on("ready",function(){n.length&&r.updateItems(n)}).check(s.map(function(e){return e.element}))},t.scheduleRender=function(){var e=this;this._clearRenderTimer(),this._renderTimer=window.setTimeout(function(){e.renderItems()})},t.fitOutlines=function(e){void 0===e&&(e=this.useFit);var t=this.outlines,n=t.start,i=t.end,r=n.length?Math.min.apply(Math,n):0;!e&&0<r||(t.start=n.map(function(e){return e-r}),t.end=i.map(function(e){return e-r}),this.items.forEach(function(e){var t=e.cssContentPos;w(t)&&(e.cssContentPos=t-r)}))},t.readyItems=function(e,t,n){var i=this.outlines,r=n.direction||this.options.defaultDirection,o=n.outline||i["end"===r?"start":"end"],s=this.items,i={start:m([],o),end:m([],o)};e.forEach(function(e){e.mountState=g.MOUNTED}),t.forEach(function(e){e.isUpdating=!0}),s.length&&(i=this.applyGrid(this.items,r,o)),t.forEach(function(e){e.isUpdating=!1}),this.setOutlines(i),this.fitOutlines(),this.itemRenderer.renderItems(this.items),this._refreshContainerContentSize();i=e.filter(function(e){return e.hasTransition});i.length&&(this.containerManager.resize(),i.forEach(function(e){e.element.style.transitionDuration=e.transitionDuration})),this._renderComplete({direction:r,mounted:e,updated:t,isResize:!!n.useResize});t=t.filter(function(e){return e.shouldReupdate});t.length&&this.updateItems(t)},t._isObserverEnabled=function(){return this.containerManager.isObserverEnabled()},t._updateItems=function(e){this.itemRenderer.updateEqualSizeItems(e,this.getItems())},t._getDirectionalGap=function(e){var t=this.options.horizontal,n=this.options.gap;return"number"==typeof n||null!==(n=t&&"inline"===e||!t&&"content"===e?n.vertical:n.horizontal)&&void 0!==n?n:f.gap},t._renderComplete=function(e){this.trigger("renderComplete",e)},t._clearRenderTimer=function(){clearTimeout(this._renderTimer),this._renderTimer=0},t._refreshContainerContentSize=function(){var e=this.outlines,t=e.start,n=e.end,e=this.getContentGap(),n=n.length?Math.max.apply(Math,n):0,t=t.length?Math.max.apply(Math,t):0,e=Math.max(t,n-e);this.containerManager.setContentSize(e)},t._resizeContainer=function(){this.containerManager.resize(),this.itemRenderer.setContainerRect(this.containerManager.getRect())},t._init=function(){this._resizeContainer()},t._renderItems=function(e,t){void 0===e&&(e={}),this._clearRenderTimer();var n=e.useResize||e.useOrgResize;n&&!t&&(this._resizeContainer(),this.itemRenderer.resize()),!this.getItems().length&&this.getChildren().length?this.syncElements(e):n?this.updateItems(this.items,e):this.checkReady(e)},e.defaultOptions=f,e.propertyTypes=z,o([M],e)}(n);function Re(e,t,n,i){return Math[i].apply(Math,e.slice(t,t+n))}q=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(S,e,t){S.forEach(function(e){e.isRestoreOrgCSSText=!1});var n,v=this.getComputedOutlineSize(S),y=this.getComputedOutlineLength(S),i=this.options,r=i.align,E=i.observeChildren,_=i.columnSizeRatio,o=i.contentAlign,s=i.stretchOutline,P=this.getInlineGap(),C=this.getContentGap(),i=t.length,b=S.length,O=this._getAlignPoses(y,v),I="end"===e,x=I?"min":"max",T=I?"max":"min",a=[0],w=(a=i===y?t.slice():(n=i?Math[T].apply(Math,t):0,U(y).map(function(){return n}))).slice(),D=1<y?O[1]-O[0]:0,M="stretch"===r,N=I&&"start"===o,k=U(a.length).map(function(){return[]}),A=I?-1/0:1/0;N&&(A=Math.min.apply(Math,w));for(var u,c=function(e){var t,n,i,r,o,s=I?e:b-1-e,a=S[s],u=parseInt(a.attributes.column||"1",10),c=parseInt(a.attributes.maxColumn||"1",10),h=a.contentSize,l=Math.min(y,u||Math.max(1,Math.ceil((a.inlineSize+P)/D))),f=Math.min(y,Math.max(l,c)),d=(n=l,i=x,r=A,e=(t=w).length-n+1,o="max"===i?"min":"max",c="max"===i?"lastIndexOf":"indexOf",(e=U(e).map(function(e){e=Re(t,e,n,o);return Math[o](r,e)}))[c](Math[i].apply(Math,e))),p=Re(w,d,l,T);for(N&&A!==p&&(A=Math.max.apply(Math,w),w=w.map(function(){return A}),p=A,d=0);l<f;){var g=d+l,m=d-1;if(I&&(y<=g||w[g]>p))break;if(!I&&(m<0||w[m]<p))break;I||--d,++l}d=Math.max(0,d),l=Math.min(y-d,l),k[d].push(s),(0<u&&1<l||M)&&(u=(l-1)*D+v,L._isObserverEnabled()&&E||a.cssInlineSize===u||(a.shouldReupdate=!0),a.cssInlineSize=u),!0===_?(R=a.orgContentSize/a.orgInlineSize,h=a.computedInlineSize*R,a.cssContentSize=h):_&&0<_&&(h=a.computedInlineSize/_,a.cssContentSize=h);var R=O[d],p=I?p:p-C-h;a.cssInlinePos=R,a.cssContentPos=p;var z=I?p+h+C:p;U(l).forEach(function(e){w[d+e]=z})},L=this,h=0;h<b;++h)c(h);return s&&S.length&&(u=0,u="scale-up"===s?Math.max.apply(Math,w):"scale-center"===s?(Math.max.apply(Math,w)+Math.min.apply(Math,w))/2:Math.min.apply(Math,w),I&&(u-=C),w.forEach(function(e,t){var i,r,n=(k[t].length-1)*C,o=a[t],s=(Math.abs(u-o)-n)/(Math.abs(e-o)-(I?C:0)-n);1!=s&&isFinite(s)&&(w[t]=I?u+C:u,i=k[t].length,r=I?a[t]:a[t]-C,k[t].forEach(function(e,t){var n=S[e],e=n.computedContentSize*s;n.addCSSGridRect({contentPos:I?r:r-e,contentSize:e}),r=I?n.cssContentPos+n.cssContentSize+C:n.cssContentPos-C,t===i-1&&(t=e=0,I?t=(.5<=n.cssContentPos%1?1:0)+(.5<=n.cssContentSize%1?1:0)+(.5<=u%1?-1:0):e=(n.cssContentPos%1<.5?-1:0)+(u%1<.5?1:0),n.addCSSGridRect({contentPos:n.cssContentPos-e,contentSize:n.cssContentSize-t}))}))})),N&&A!==Math.min.apply(Math,w)&&(A=Math.max.apply(Math,w),w=w.map(function(){return A})),{start:I?a:w,end:I?w:a}},n.getComputedOutlineSize=function(e){void 0===e&&(e=this.items);var t=this.options.align,n=this.getInlineGap(),i=this.getContainerInlineSize(),r=this.columnSize||this.outlineSize,o=this.column||this.outlineLength,s=o||1,a=0;if("stretch"===t)o||(o=this.maxStretchColumnSize||1/0,s=Math.max(1,Math.ceil((i+n)/(o+n)))),a=(i+n)/(s||1)-n;else if(r)a=r;else if(e.length){for(var u=e[0],c=0,h=e;c<h.length;c++){var l=h[c],f=l.attributes,d=parseInt(f.column||"1",10),f=parseInt(f.maxColumn||"1",10);if(l.updateState===R.UPDATED&&l.inlineSize&&1===d&&1===f){u=l;break}}a=u.inlineSize||0}else a=i;return a||0},n.getComputedOutlineLength=function(e){void 0===e&&(e=this.items);var t=this.getInlineGap(),n=this.column||this.outlineLength,i=this.columnCalculationThreshold;return n||(n=this.getComputedOutlineSize(e),Math.min(e.length,Math.max(1,Math.floor((this.getContainerInlineSize()+t)/(n-i+t)))))},n._getAlignPoses=function(e,t){var n,i=this.options.align,r=this.getInlineGap(),o=this.getContainerInlineSize(),s=U(e),a=0,u=0;return"justify"===i||"stretch"===i?(u=(n=e-1)?Math.max((o-t)/n,t+r):0,a=Math.min(0,o/2-(n*u+t)/2)):(t=(e-1)*(u=t+r)+t,"center"===i?a=(o-t)/2:"end"===i&&(a=o-t)),s.map(function(e){return a+e*u})},t.propertyTypes=p(p({},me.propertyTypes),{column:a.RENDER_PROPERTY,columnSize:a.RENDER_PROPERTY,columnSizeRatio:a.RENDER_PROPERTY,align:a.RENDER_PROPERTY,columnCalculationThreshold:a.RENDER_PROPERTY,maxStretchColumnSize:a.RENDER_PROPERTY,contentAlign:a.RENDER_PROPERTY,stretchOutline:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},me.defaultOptions),{align:"justify",column:0,columnSize:0,columnSizeRatio:0,columnCalculationThreshold:.5,maxStretchColumnSize:1/0,contentAlign:"masonry",stretchOutline:""}),o([M],t)}(me);function ze(e,t,n){return function(e,t){for(var n=[],i=t;i;)n.push(i),i=e[i];return n.reverse(),n}(function(e,t,n){var i={},r={};r[t]=0;var o,s,a,u,c,h,l=new Se(function(e){return e.cost});for(l.push({value:t,cost:0});l.size();)for(var f in s=(o=l.pop()).value,a=o.cost,u=e(s)||{})c=a+u[f],h=r[f],(void 0===r[f]||c<h)&&(r[f]=c,l.push({value:f,cost:c}),i[f]=s);if(void 0!==r[n])return i;throw n=["Could not find a path from ",t," to ",n,"."].join(""),new Error(n)}(e,t,n),n)}var Se=function(){function e(e){this.content=[],this.scoreFunction=e}var t=e.prototype;return t.push=function(e){this.content.push(e),this.bubbleUp(this.content.length-1)},t.pop=function(){var e=this.content[0],t=this.content.pop();return 0<this.content.length&&(this.content[0]=t,this.sinkDown(0)),e},t.size=function(){return this.content.length},t.bubbleUp=function(e){for(var t=e,n=this.content[t];0<t;){var i=Math.floor((t+1)/2)-1,r=this.content[i];if(!(this.scoreFunction(n)<this.scoreFunction(r)))break;this.content[i]=n,this.content[t]=r,t=i}},t.sinkDown=function(e){for(var t=this.content.length,n=this.content[e],i=this.scoreFunction(n);;){var r,o=2*(e+1),s=o-1,a=null;if(s<t&&(r=this.content[s],(r=this.scoreFunction(r))<i&&(a=s)),o<t&&(s=this.content[o],this.scoreFunction(s)<(null==a?i:r)&&(a=o)),null===a)break;this.content[e]=this.content[a],this.content[a]=n,e=a}},e}();function ve(e,t){if(w(t))return t;var n=t.charAt(0),i="+"===n?1:"-"===n?-1:0,n=parseFloat(t);return t.match(/%$/g)&&(n*=e/100),i?e+n:n}function ye(e,t){var n=e.orgInlineSize,i=e.orgContentSize,r=e.gridData.inlineOffset||0,e=e.gridData.contentOffset||0;return n&&i?(i<=e?1:(n-r)/(i-e))*(t-e)+r:t}ce=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(e,t,n){var s=this,i=this.options,a=i.attributePrefix,u=i.horizontal;e.forEach(function(e){var t,n,i,r,o;e.isUpdating&&(t=e.element,r=e.attributes,n=e.gridData,i=parseFloat(r.inlineOffset),o=parseFloat(r.contentOffset),isNaN(i)&&(i=s.inlineOffset||n.inlineOffset||0),isNaN(o)&&(o=s.contentOffset||0|n.contentOffset),!t||"inlineOffset"in r||"contentOffset"in r||e.mountState!==g.MOUNTED||(r=t.querySelector("["+a+"maintained-target]"))&&(e=t.offsetWidth-t.clientWidth+t.scrollWidth-r.clientWidth,r=t.offsetHeight-t.clientHeight+t.scrollHeight-r.clientHeight,o=u?(i=r,e):(i=e,r)),n.inlineOffset=i,n.contentOffset=o)});var r=this.options.rowRange,o=[],i="end"===t;return e.length&&(o=r?this._getRowPath(e,i):this._getPath(e,i)),this._setStyle(e,o,n,"end"===t)},n._getRowPath=function(e,t){var n=this._getColumnRange(),i=this._getRowRange(),t=this._getRowLink(e,{path:[0],cost:0,length:0,currentNode:0},n,i,t);return null!==(t=null==t?void 0:t.path.map(function(e){return""+e}))&&void 0!==t?t:[]},n._getRowLink=function(e,t,n,i,r){var o=n[0],s=i[0],a=i[1],u=e.length,c=t.path,h=t.length,l=t.cost,f=t.currentNode;if(f<u&&(a<=h||u<f+o)){o=k(u-f,n)*Math.abs(this._getCost(e,f,u,r));return p(p({},t),{length:h+1,path:m(m([],c),[u]),currentNode:u,cost:l+o,isOver:!0})}return u<=f?p(p({},t),{currentNode:u,isOver:h<s||a<h}):this._searchRowLink(e,t,u,n,i,r)},n._searchRowLink=function(e,t,n,i,r,o){for(var s,a=i[0],u=i[1],c=t.currentNode,h=t.path,l=t.length,f=t.cost,d=Math.min(n,c+u),p=[],g=c+a;g<=d;++g)g!==c&&(s=Math.abs(this._getCost(e,c,g,o)),(s=this._getRowLink(e,{path:m(m([],h),[g]),length:l+1,cost:f+s,currentNode:g},i,r,o))&&p.push(s));return p.sort(function(e,t){var n=e.isOver;return n!==t.isOver?n?1:-1:k(e.length,r)-k(t.length,r)||e.cost-t.cost}),p[0]},n._getExpectedRowSize=function(i,e){var t=this.getContainerInlineSize()-this.getInlineGap()*(i.length-1),r=t,o=0,s=0;if(i.forEach(function(e){var t,n=e.orgInlineSize,i=e.orgContentSize;n&&i?(t=e.gridData.inlineOffset||0,e=e.gridData.contentOffset||0,o+=i=i<=e?1:(n-t)/(i-e),s+=e*i,r-=t):o+=1}),o){var n=(r+s)/o;if(this.stretch){var a=this._getSizeRange(),u=A(n,a[0],a[1]);if(e)return u;var c=this.stretchRange,a=i.map(function(e){return ye(e,u)}),e=a.reduce(function(e,t,n){return e+ve(t,i[n].attributes.minStretch||c[0])},0),a=a.reduce(function(e,t,n){return e+ve(t,i[n].attributes.maxStretch||c[1])},0);if(e<=t&&t<=a)return u}return n}return 0},n._getExpectedInlineSizes=function(e,o){var t=this.options,s=t.stretch,a=t.stretchRange;return e.map(function(e){var t=s?ve(e.orgInlineSize,e.attributes.minStretch||a[0]):-1/0,n=s?ve(e.orgInlineSize,e.attributes.maxStretch||a[1]):1/0,i=ye(e,o),r=!1,e=!1;return n<=i?r=!0:i<=t&&(e=!0),{minSize:t,maxSize:n,size:A(i,t,n),originalSize:i,isMax:r,isMin:e}})},n._getStretchItemInfos=function(e,t){var n=e.length,i=this.getContainerInlineSize()-this.getInlineGap()*(Math.max(1,n)-1),e=this._getExpectedInlineSizes(e,t),t=D(e.map(function(e){return e.size})),t=i-t,r=i/D(e.map(function(e){return e.originalSize})),o=e.map(function(e){return p(p({},e),{passed:!1,size:e.originalSize*r})});if(0==t)return{infos:o,cost:0};for(var s=0<t,a=o.length,u=0;u<a;++u)if("break"===function(){var e=D(o.map(function(e){return e.passed?e.size:0})),t=D(o.map(function(e){return e.passed?0:e.originalSize})),n=(i-e)/t;if(o.forEach(function(e){e.passed||(s?e.size>e.maxSize&&(n=Math.min(n,e.maxSize/e.originalSize)):e.size<e.minSize&&(n=Math.max(n,e.minSize/e.originalSize)))}),o.forEach(function(e){e.passed||(e.size=A(e.originalSize*n,e.minSize,e.maxSize),(s&&!L(e.size-e.maxSize,.001)||!s&&!L(e.size-e.minSize,.001))&&(e.passed=!0))}),o.every(function(e){return e.passed}))return"break"}())break;var c=i/D(o.map(function(e){return e.size}));return L(c-1,.001)&&o.forEach(function(e){e.size*=c}),{infos:o,cost:D(o.map(function(e){var t=1;(e.size>e.maxSize||e.size<e.minSize)&&(t=2);var n=e.originalSize,n=s?Math.max(n,e.minSize):Math.min(n,e.maxSize);return Math.abs(e.size-n)*t}))}},n._getExpectedInlineSize=function(e,t){var n=this.getInlineGap(),t=this._getExpectedInlineSizes(e,t);return t.length?D(t.map(function(e){return e.size}))+n*(e.length-1):0},n._getCost=function(e,t,n,i){var r=e.slice(t,n),o=this.getContainerInlineSize(),s=this._getExpectedRowSize(r),a=this._getSizeRange(),u=a[0],c=a[1];if(this.isCroppedSize){if(u<=s&&s<=c)return 0;var h=this._getExpectedInlineSize(r,s<u?u:c);return Math.pow(h-o,2)}var l=0;if(this.stretch){s<u?s=u:c<s&&(s=c);a=Math.abs(s-u),h=this._getExpectedInlineSize(r,s);return(l=!this.passUnstretchRow||(i?n!==e.length:0!==t)||o<=h?this._getStretchItemInfos(r,s).cost:l)+a}if(isFinite(c)){if(s<u)return Math.pow(s-u,2)+Math.pow(c,2)+l;if(c<s)return Math.pow(s-c,2)+Math.pow(c,2)+l}else if(s<u)return Math.max(Math.pow(u,2),Math.pow(s,2))+Math.pow(c,2)+l;return s-u+l},n._getPath=function(o,s){var a=this,u=o.length,e=this.options.columnRange,e=T(e)?e:[e,e],c=e[0],h=e[1];return ze(function(e){for(var t={},n=parseInt(e,10),i=Math.min(n+c,u);i<=u&&!(h<i-n);++i){var r=a._getCost(o,n,i,s);r<0&&i===u&&(r=0),t[""+i]=Math.pow(r,2)}return t},"0",""+u)},n._setStyle=function(e,t,n,l){var f=this;void 0===n&&(n=[]);var d,p,i=this.options,g=i.isCroppedSize,m=i.displayedRow,R=i.stretch,z=i.passUnstretchRow,S=e.length,v=this._getSizeRange(),n=n[0]||0,y=this.getContainerInlineSize(),E=this.getInlineGap(),_=this.getContentGap(),t=function(e,t){for(var n=t.length,i=[],r=0;r<n-1;++r){var o=parseInt(t[r],10),s=parseInt(t[r+1],10);i.push(e.slice(o,s))}return i}(e,t),P=t.length,C=n,b=0;if(t.forEach(function(o,e){var n=o.length,s=f._getExpectedRowSize(o,!0);g&&(s=Math.max(v[0],Math.min(s,v[1])));var i,r,t=E*(length-1),a=o.map(function(e,t){var n=ye(e,s);return{index:t,item:e,inlineSize:n,orgInlineSize:n,maxInlineSize:n,minInlineSize:n}}),u=f._getExpectedInlineSize(o,s),c=(y-t)/(u-t),h=u-t,t=y-t;R&&u&&t!=h&&(z&&h<t&&(l?e===P-1:0===e)?(p=[C],d=o.map(function(e,t){return S-n+t}),i=f._getExpectedInlineSizes(o,s),a.forEach(function(e,t){e.minInlineSize=i[t].minSize,e.maxInlineSize=i[t].maxSize,e.inlineSize=A(e.inlineSize,e.minInlineSize,e.maxInlineSize)})):(r=f._getStretchItemInfos(o,s).infos,a.forEach(function(e,t){e.inlineSize=r[t].size,e.minInlineSize=r[t].minSize,e.maxInlineSize=r[t].maxSize}))),a.forEach(function(e,t){var n=e.item,i=e.inlineSize,r=o[t-1],t=r?r.cssInlinePos+r.cssInlineSize+E:0;g&&(i*=c);r=n.gridData;r.orgInlineSize=e.orgInlineSize,r.orgContentSize=s,r.minInlineSize=e.minInlineSize,r.maxInlineSize=e.maxInlineSize,n.setCSSGridRect({inlinePos:t,contentPos:C,inlineSize:i,contentSize:s})}),C+=_+s,(m<0||e<m)&&(b=C)}),l)return{start:[n],end:[b],passedItems:d,passed:p};var r=C-n;return e.forEach(function(e){e.cssContentPos-=r}),{passedItems:d,passed:p?[p[0]-r]:null,start:[n-r],end:[n]}},n.getComputedOutlineLength=function(){return 1},n.getComputedOutlineSize=function(){return this.getContainerInlineSize()},n._getRowRange=function(){var e=this.rowRange;return T(e)?e:[e,e]},n._getColumnRange=function(){var e=this.columnRange;return T(e)?e:[e,e]},n._getSizeRange=function(){var e=this.sizeRange;return T(e)?e:[e,e]},t.propertyTypes=p(p({},me.propertyTypes),{columnRange:a.RENDER_PROPERTY,rowRange:a.RENDER_PROPERTY,sizeRange:a.RENDER_PROPERTY,isCroppedSize:a.RENDER_PROPERTY,displayedRow:a.RENDER_PROPERTY,stretch:a.RENDER_PROPERTY,stretchRange:a.RENDER_PROPERTY,passUnstretchRow:a.RENDER_PROPERTY,inlineMargin:a.RENDER_PROPERTY,contentMargin:a.RENDER_PROPERTY,inlineOffset:a.RENDER_PROPERTY,contentOffset:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},me.defaultOptions),{columnRange:[1,8],rowRange:0,sizeRange:[0,1/0],displayedRow:-1,isCroppedSize:!1,stretch:!1,passUnstretchRow:!0,stretchRange:["-20%","+20%"],inlineOffset:0,contentOffset:0}),o([M],t)}(me);function Ee(e){var t=-1/0;return e.forEach(function(e){isFinite(e)&&(t=Math.max(t,e))}),isFinite(t)?t:0}function _e(e,t,n){return Ee(e)+function(e,t,n){var i=e.length;if(!i)return 0;var r=function(e){var t=1/0;return e.forEach(function(e){isFinite(e)&&(t=Math.min(t,e))}),isFinite(t)?t:0}(t),o=Ee(e),s=0;if(!n)return 0;for(var a=0;a<i;++a){var u=e[a],c=t[a];isFinite(u)&&isFinite(c)&&(u=u-o,c=c-r,s=a?Math.max(s,s+u-c):u-c)}return s}(e,t,n)}function Pe(e,t,n){for(var i=n.inlinePos,r=n.inlineSize,o=n.contentPos,s=n.contentSize,a=i;a<i+r;++a)e[a]=Math.min(e[a],o),t[a]=Math.max(t[a],o+s)}var B=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(e,t,n){var i=this._getFrame(),r=i.inlineSize,o=i.contentSize,s=i.rects,a=this.options.useFrameFill,u=this.getRectSize(r),c=u.inlineSize,h=u.contentSize,l=this.getInlineGap(),f=this.getContentGap(),d=e.length;if(!d||!r||!o)return{start:n,end:n};for(var p=s.length,g=U(r).map(function(){return 1/0}),m=U(r).map(function(){return-1/0}),R=i.outline.map(function(e){return e*(h+f)}),z=0;z<d;z+=p)for(var S=_e(m,R,a),v=0;v<p&&z+v<d;++v){var y=e[z+v],E=s[v],_=E.contentPos,P=E.inlinePos,C=E.contentSize,b=E.inlineSize,O=S+_*(h+f),E=P*(c+l),_=C*(h+f)-f,C=b*(c+l)-l;Pe(g,m,{inlinePos:P,inlineSize:b,contentPos:O,contentSize:_+f}),y.setCSSGridRect({inlinePos:E,contentPos:O,inlineSize:C,contentSize:_})}var I,t="end"===t,n=n.length?n:[0];n.length!==r&&(I=(t?Math.max:Math.min).apply(Math,n),n=U(r).map(function(){return I}));var g=g.map(function(e){return isFinite(e)?e:0}),m=m.map(function(e){return isFinite(e)?e:0}),x=t?_e(n,g,a):_e(m,n,a);return e.forEach(function(e){e.cssContentPos+=x}),{start:g.map(function(e){return e+x}),end:m.map(function(e){return e+x})}},n.getComputedOutlineLength=function(){var e=this.options.frame;return e.length?e[0].length:0},n.getComputedOutlineSize=function(){var e=this.options.rectSize;if("object"==typeof e)return e.inlineSize;var t=this.getInlineGap();return e||(this.getContainerInlineSize()+t)/this.getComputedOutlineLength()-t},n.getRectSize=function(e){var t=this.options.rectSize;if("object"==typeof t)return t;var n=this.getInlineGap(),n=t||(this.getContainerInlineSize()+n)/e-n;return{inlineSize:n,contentSize:n}},n._getFrame=function(){for(var e=this.options.frame,t=e.length,n=t?e[0].length:0,i=[],r={},o=U(n).map(function(){return 1/0}),s=U(n).map(function(){return-1/0}),a=0;a<t;++a)for(var u=0;u<n;++u){var c=e[a][u];c&&(r[a+","+u]||(Pe(o,s,c=this._findRect(r,c,a,u,n,t)),i.push(c)))}return i.sort(function(e,t){return e.type<t.type?-1:1}),{rects:i,inlineSize:n,contentSize:t,outline:o}},n._findRect=function(e,t,n,i,r,o){for(var s=this.options.frame,a=1,u=1,c=i;c<r&&s[n][c]===t;++c)u=c-i+1;for(var h=n;h<o&&s[h][i]===t;++h)a=h-n+1;for(var l=n;l<n+a;++l)for(var f=i;f<i+u;++f)e[l+","+f]=!0;return{type:t,inlinePos:i,contentPos:n,inlineSize:u,contentSize:a}},t.propertyTypes=p(p({},me.propertyTypes),{frame:a.RENDER_PROPERTY,useFrameFill:a.RENDER_PROPERTY,rectSize:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},me.defaultOptions),{frame:[],rectSize:0,useFrameFill:!0}),o([M],t)}(me),Ce=function(){function e(e){var t,n=p({orgInlineSize:0,orgContentSize:0,inlineSize:0,contentSize:0,inlinePos:0,contentPos:0,items:[]},e);for(t in n)this[t]=n[t]}var t=e.prototype;return t.scaleTo=function(e,t){var n=this.inlineSize?e/this.inlineSize:0,i=this.contentSize?t/this.contentSize:0;this.items.forEach(function(e){0!=n&&(e.inlinePos*=n,e.inlineSize*=n),0!=i&&(e.contentPos*=i,e.contentSize*=i)}),this.inlineSize=e,this.contentSize=t},t.push=function(e){this.items.push(e)},t.getOrgSizeWeight=function(){return this.orgInlineSize*this.orgContentSize},t.getSize=function(){return this.inlineSize*this.contentSize},t.getOrgRatio=function(){return 0===this.orgContentSize?0:this.orgInlineSize/this.orgContentSize},t.getRatio=function(){return 0===this.contentSize?0:this.inlineSize/this.contentSize},e}();function be(e,t){t=e/t;return(t=t<1?1/t:t)-1}var Oe,Ie={__proto__:null,default:me,GetterSetter:M,withGridMethods:F,withMethods:N,getMountedElements:I,getUpdatedItems:b,MasonryGrid:q,JustifiedGrid:ce,FrameGrid:B,PackingGrid:function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(e,t,n){var i=this,r=this.options.aspectRatio,o=this.getContainerInlineSize(),s=o/r,a=this.getInlineGap(),u=this.getContentGap(),n=n.length?n:[0],c="end"===t?Math.max.apply(Math,n):Math.min.apply(Math,n)-s-u,n=c+s+u,h=new Ce({});return e.forEach(function(e){e=new Ce({inlineSize:e.orgInlineSize,contentSize:e.orgContentSize,orgInlineSize:e.orgInlineSize,orgContentSize:e.orgContentSize});i._findBestFitArea(h,e),h.push(e),h.scaleTo(o+a,s+u)}),e.forEach(function(e,t){var n=h.items[t],i=n.inlineSize-a,r=n.contentSize-u,t=c+n.contentPos,n=n.inlinePos;e.setCSSGridRect({inlinePos:n,contentPos:t,inlineSize:i,contentSize:r})}),{start:[c],end:[n]}},n._findBestFitArea=function(e,p){if(0===e.getRatio())return e.orgInlineSize=p.inlineSize,e.orgContentSize=p.contentSize,e.inlineSize=p.inlineSize,void(e.contentSize=p.contentSize);var g,t,n,i,r,m=1/0,R=!1,z={inlineSize:0,contentSize:0},S={inlineSize:0,contentSize:0},v=this._getWeight("size"),y=this._getWeight("ratio");e.items.forEach(function(e){for(var t=be(e.getOrgSizeWeight(),e.getSize())*v,n=be(e.getOrgRatio(),e.getRatio())*y,i=e.inlineSize,r=e.contentSize,o=0;o<2;++o){var s=void 0,a=void 0,u=void 0,c=void 0;0===o?(u=s=i,c=r-(a=r*(p.contentSize/(e.orgContentSize+p.contentSize)))):(c=a=r,u=i-(s=i*(p.inlineSize/(e.orgInlineSize+p.inlineSize))));var h=s*a,l=s/a,f=u*c,d=c/c,h=be(p.getSize(),h)*v;h+=be(p.getRatio(),l)*y,h+=be(e.getOrgSizeWeight(),f)*v-t,(h+=be(e.getOrgRatio(),d)*y-n)===Math.min(h,m)&&(m=h,g=e,R=0===o,z.inlineSize=s,z.contentSize=a,S.inlineSize=u,S.contentSize=c)}}),t=g,n=z,i=S,r=R,(e=p).contentSize=n.contentSize,e.inlineSize=n.inlineSize,t.contentSize=i.contentSize,t.inlineSize=i.inlineSize,r?(e.contentPos=t.contentPos+t.contentSize,e.inlinePos=t.inlinePos):(e.inlinePos=t.inlinePos+t.inlineSize,e.contentPos=t.contentPos)},n.getComputedOutlineLength=function(){return 1},n.getComputedOutlineSize=function(){return this.getContainerInlineSize()},n._getWeight=function(e){var t=this.options,n=t.weightPriority;return n===e?100:"custom"===n?t[e+"Weight"]:1},t.propertyTypes=p(p({},me.propertyTypes),{aspectRatio:a.RENDER_PROPERTY,sizeWeight:a.RENDER_PROPERTY,ratioWeight:a.RENDER_PROPERTY,weightPriority:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},me.defaultOptions),{aspectRatio:1,sizeWeight:1,ratioWeight:1,weightPriority:"custom"}),o([M],t)}(me),ItemRenderer:pe,GridItem:ge,ContainerManager:G,ResizeWatcher:j,DEFAULT_GRID_OPTIONS:f,get PROPERTY_TYPE(){return a},get MOUNT_STATE(){return g},get UPDATE_STATE(){return R},GRID_PROPERTY_TYPES:z,GRID_METHODS:e,GRID_EVENTS:["renderComplete","contentError"],RECT_NAMES:d};for(Oe in Ie)me[Oe]=Ie[Oe];return me});
//# sourceMappingURL=grid.min.js.map
{
"name": "@egjs/grid",
"version": "1.16.0",
"version": "1.17.0-beta.0",
"description": "A component that can arrange items according to the type of grids",

@@ -5,0 +5,0 @@ "main": "dist/grid.cjs.js",

@@ -334,2 +334,3 @@ /**

// Grid: renderItems => checkReady => readyItems => applyGrid
const useOrgResize = options.useOrgResize;
const items = this.items;

@@ -365,6 +366,6 @@ const updated = items.filter((item) => item.element?.parentNode && item.updateState !== UPDATE_STATE.UPDATED);

updated.forEach((item) => {
const hasOrgSize = item.orgRect.width && item.orgRect.height;
const isInitialState = !item.isFirstUpdate || !item.orgRect.width || !item.orgRect.height;
const hasCSSSize = item.cssRect.width || item.cssRect.height;
if (!hasOrgSize && hasCSSSize) {
if ((isInitialState || useOrgResize) && hasCSSSize) {
item.element!.style.cssText = item.orgCSSText;

@@ -381,5 +382,9 @@ }

if (e.isPreReadyOver) {
if (item.isRestoreOrgCSSText) {
const isInitialState = !item.isFirstUpdate || !item.orgRect.width || !item.orgRect.height;
const hasCSSSize = item.cssRect.width || item.cssRect.height;
if (item.isRestoreOrgCSSText || (isInitialState || useOrgResize) && hasCSSSize) {
item.element!.style.cssText = item.orgCSSText;
}
this._updateItems([item]);

@@ -386,0 +391,0 @@ this.readyItems([], [item], options);

@@ -213,3 +213,3 @@ /**

/**
* Set CSS Rect through GridRect.
* Set CSS rect through GridRect.
* @ko GridRect을 통해 CSS Rect를 설정한다.

@@ -229,2 +229,16 @@ * @param - The style for setting CSS rect. <ko>CSS rect를 설정하기 위한 스타일.</ko>

/**
* Add CSS part of rect through GridRect.
* @ko GridRect을 통해 CSS Rect의 일부를 추가한다..
* @param - The style for setting CSS rect. <ko>CSS rect를 설정하기 위한 스타일.</ko>
*/
public addCSSGridRect(gridRect: GridRect) {
const names = RECT_NAMES[this.horizontal ? "horizontal" : "vertical"];
const rect: DOMRect = this.cssRect;
for (const name in gridRect) {
rect[names[name]] = gridRect[name];
}
}
/**
* Returns the status of the item.

@@ -231,0 +245,0 @@ * @ko 아이템의 상태를 반환한다.

@@ -59,7 +59,7 @@ /**

/**
* The size ratio(inlineSize / contentSize) of the columns. 0 is not set.
* <ko>열의 사이즈 비율(inlineSize / contentSize). 0은 미설정이다.</ko>
* The size ratio(inlineSize / contentSize) of the columns. 0 is not set. `true` is automatically calculated as orgInlineSize / orgContentSize.
* <ko>열의 사이즈 비율(inlineSize / contentSize). 0은 미설정이다. `true` 는 orgInlineSize / orgContentSize로 자동 계산이 된다.</ko>
* @default 0
*/
columnSizeRatio?: number;
columnSizeRatio?: number | boolean;
/**

@@ -90,2 +90,8 @@ * Align of the position of the items. If you want to use `stretch`, be sure to set `column`, `columnSize` or `maxStretchColumnSize` option. ("start", "center", "end", "justify", "stretch")

maxStretchColumnSize?: number;
/**
* <ko>여러 칼럼들에 배치된 아이템들의 contentSize를 조절하여 outline을 동등하게 한다.</ko>
* @default ""
*/
stretchOutline?: "scale-down" | "scale-up" | "scale-center" | "";
}

@@ -111,2 +117,3 @@

contentAlign: PROPERTY_TYPE.RENDER_PROPERTY,
stretchOutline: PROPERTY_TYPE.RENDER_PROPERTY,
};

@@ -122,2 +129,3 @@ public static defaultOptions: Required<MasonryGridOptions> = {

contentAlign: "masonry",
stretchOutline: "",
};

@@ -137,4 +145,5 @@

contentAlign,
stretchOutline,
} = this.options;
const inlineGap = this.getContentGap();
const inlineGap = this.getInlineGap();
const contentGap = this.getContentGap();

@@ -147,2 +156,3 @@ const outlineLength = outline.length;

const pointCalculationName = isEndDirection ? "max" : "min";
let startOutline = [0];

@@ -161,4 +171,6 @@

const isStartContentAlign = isEndDirection && contentAlign === "start";
const itemIndexes: number[][] = range(startOutline.length).map(() => []);
let startPos = isEndDirection ? -Infinity : Infinity;

@@ -173,3 +185,4 @@

for (let i = 0; i < itemsLength; ++i) {
const item = items[isEndDirection ? i : itemsLength - 1 - i];
const itemIndex = isEndDirection ? i : itemsLength - 1 - i;
const item = items[itemIndex];
const columnAttribute = parseInt(item.attributes.column || "1", 10);

@@ -212,2 +225,4 @@ const maxColumnAttribute = parseInt(item.attributes.maxColumn || "1", 10);

itemIndexes[columnIndex].push(itemIndex);
// stretch mode or data-grid-column > "1"

@@ -222,3 +237,8 @@ if ((columnAttribute > 0 && columnCount > 1) || isStretch) {

}
if (columnSizeRatio > 0) {
if (columnSizeRatio === true) {
const ratio = item.orgContentSize / item.orgInlineSize;
contentSize = item.computedInlineSize * ratio;
item.cssContentSize = contentSize;
} else if (columnSizeRatio && columnSizeRatio > 0) {
contentSize = item.computedInlineSize / columnSizeRatio;

@@ -239,2 +259,75 @@ item.cssContentSize = contentSize;

if (stretchOutline && items.length) {
let scalePoint = 0;
if (stretchOutline === "scale-up") {
scalePoint = Math.max(...endOutline);
} else if (stretchOutline === "scale-center") {
scalePoint = (Math.max(...endOutline) + Math.min(...endOutline)) / 2;
} else {
// scale-down
scalePoint = Math.min(...endOutline);
}
if (isEndDirection) {
scalePoint -= contentGap;
}
endOutline.forEach((point, i) => {
const totalGap = (itemIndexes[i].length - 1) * contentGap;
const startPoint = startOutline[i];
const scale = (Math.abs(scalePoint - startPoint) - totalGap)
/ (Math.abs(point - startPoint) - (isEndDirection ? contentGap : 0) - totalGap);
if (scale === 1 || !isFinite(scale)) {
return;
}
if (isEndDirection) {
endOutline[i] = scalePoint + contentGap;
} else {
endOutline[i] = scalePoint;
}
const length = itemIndexes[i].length;
let prevPoint = isEndDirection ? startOutline[i]: startOutline[i] - contentGap;
itemIndexes[i].forEach((itemIndex, j) => {
const item = items[itemIndex];
const prevSize = item.computedContentSize;
const nextSize = prevSize * scale;
item.addCSSGridRect({
contentPos: isEndDirection ? prevPoint : prevPoint - nextSize,
contentSize: nextSize,
});
if (isEndDirection) {
prevPoint = item.cssContentPos! + item.cssContentSize! + contentGap;
} else {
prevPoint = item.cssContentPos! - contentGap;
}
if (j === length - 1) {
let posOffset = 0;
let sizeOffset = 0;
if (isEndDirection) {
sizeOffset = (item.cssContentPos! % 1 >= 0.5 ? 1 : 0)
+ (item.cssContentSize! % 1 >= 0.5 ? 1 : 0)
+ (scalePoint % 1 >= 0.5 ? -1 : 0);
} else {
posOffset = (item.cssContentPos! % 1 < 0.5 ? -1 : 0)
+ (scalePoint % 1 < 0.5 ? 1 : 0);
}
// Offset position and size need to be adjusted because they are rounded.
item.addCSSGridRect({
contentPos: item.cssContentPos! - posOffset,
contentSize: item.cssContentSize! - sizeOffset,
});
}
});
});
}
// Finally, check whether startPos and min of the outline match.

@@ -317,3 +410,3 @@ // If different, endOutline is updated.

(this.getContainerInlineSize() + inlineGap) /
(columnSize - columnCalculationThreshold + inlineGap)
(columnSize - columnCalculationThreshold + inlineGap)
)

@@ -320,0 +413,0 @@ )

@@ -128,3 +128,3 @@ /**

rect = initialRects[""];
} else if (isConstantSize && hasOrgSize && !isLoading) {
} else if (isConstantSize && hasOrgSize && !isLoading && item.isFirstUpdate) {
rect = orgRect;

@@ -131,0 +131,0 @@ } else if (checkSizeGroup || !element) {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc