@egjs/grid
Advanced tools
Comparing version 1.16.0-beta.12 to 1.16.0
@@ -142,2 +142,4 @@ /** | ||
destroy(options?: DestroyOptions): void; | ||
protected getInlineGap(): number; | ||
protected getContentGap(): number; | ||
protected checkReady(options?: RenderOptions): void; | ||
@@ -149,2 +151,3 @@ protected scheduleRender(): void; | ||
protected _updateItems(items: GridItem[]): void; | ||
private _getDirectionalGap; | ||
private _renderComplete; | ||
@@ -151,0 +154,0 @@ private _clearRenderTimer; |
@@ -35,17 +35,2 @@ /** | ||
/** | ||
* 아이템의 inlineSize를 stretch 할지 여부 | ||
* @default false | ||
*/ | ||
stretch?: boolean; | ||
/** | ||
* string 값으로 `-`, `+`, `%`이 붙으면 원본 크기에 대한 상대값이며 number 값으로 들어오면 절대 값으로 stretch 범위를 설정할 수 있습니다. | ||
* 낱개로 설정하고 싶다면 각 Element 또는 JSX로 data-grid-min-stretch="-10%", data-grid-max-stretch="+10%"로 설정할 수 있다. | ||
* @default ["-10%", "+10%"] | ||
*/ | ||
stretchRange?: Array<string | number>; | ||
/** | ||
* 마지막 열에 stretch 범위에 벗어난 경우 다음 InfiniteGrid | ||
*/ | ||
passUnstretchRow?: boolean; | ||
/** | ||
* Maximum number of rows to be counted for container size. You can hide it on the screen by setting overflow: hidden. -1 is not set. | ||
@@ -63,13 +48,34 @@ * <ko>컨테이너 크기에 계산될 최대 row 개수. overflow: hidden을 설정하면 화면에 가릴 수 있다. -1은 미설정이다.</ko> | ||
/** | ||
* test contentMargin | ||
* The ratio is maintained except for the offset value in the inline direction. If 'data-grid-inline-offset' is set in the element of each item, it will be applied first. | ||
* <ko>inline 방향의 offset 수치 만큼 제외하고 비율을 유지한다. 각 아이템의 element에 'data-grid-inline-offset' 을 설정하면 우선 적용한다.</ko> | ||
* @default 0 | ||
*/ | ||
contentMargin?: number; | ||
inlineOffset?: number; | ||
/** | ||
* test inlineOffset | ||
* The ratio is maintained except for the offset value in the content direction. If 'data-grid-content-offset' is set in the element or JSX of each item, it will be applied first. | ||
* <ko>content 방향의 offset 수치 만큼 제외하고 비율을 유지한다. 각 아이템의 Element 또는 JSX에 'data-grid-content-offset' 을 설정하면 우선 적용한다.</ko> | ||
* @default 0 | ||
*/ | ||
inlineOffset?: number; | ||
contentOffset?: number; | ||
/** | ||
* test contentOffset | ||
* it is possible to basically break the proportion of the item and stretch the inline size to fill the container. | ||
* If you set the `sizeRange` range narrowly, you can stretch well. | ||
* <ko>기본적으로 아이템의 비율을 깨서 inline size를 stretch하여 container를 꽉 채우게 가능하다. sizeRange의 범위를 좁게 설정하면 stretch가 잘 될 수 있다. </ko> | ||
* @default false | ||
*/ | ||
contentOffset?: number; | ||
stretch?: boolean; | ||
/** | ||
* If `-`, `+`, or `%` are added as a string value, it is a relative value to the original size. If it is a number value, the stretch range can be set as an absolute value. | ||
* If `data-grid-min-stretch` and `data-grid-max-stretch` are set in the Element or JSX of each item, they will be applied first. | ||
* <ko>string 값으로 `-`, `+`, `%`이 붙으면 원본 크기에 대한 상대값이며 number 값으로 들어오면 절대 값으로 stretch 범위를 설정할 수 있습니다. | ||
* 각 아이템의 Element 또는 JSX에 `data-grid-min-stretch`, `data-grid-max-stretch`을 설정하면 우선 적용한다.</ko> | ||
* @ | ||
* @default ["-10%", "+10%"] | ||
*/ | ||
stretchRange?: Array<string | number>; | ||
/** | ||
* Items placed in the last row are not stretched and are drawn maintaining their proportions. When using InfiniteGrid, it is calculated and re-rendered as follows: | ||
* <ko>마지막 row에 배치되는 아이템들 경우 stretch되지 않고 비율유지한채로 그려진다. InfiniteGrid를 사용하는 경우 다음 그룹과 같이 계산되어 재렌더링한다.</ko> | ||
*/ | ||
passUnstretchRow?: boolean; | ||
} | ||
@@ -76,0 +82,0 @@ /** |
@@ -45,3 +45,6 @@ /** | ||
*/ | ||
gap?: number; | ||
gap?: number | { | ||
horizontal?: number; | ||
vertical?: number; | ||
}; | ||
/** | ||
@@ -48,0 +51,0 @@ * The prefix to use element's data attribute. |
@@ -7,5 +7,5 @@ /* | ||
repository: https://github.com/naver/egjs-grid | ||
version: 1.16.0-beta.11 | ||
version: 1.16.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 b(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 C(n,i){var e=O(n);return b(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 x(e){return O(e).map(function(e){return e.element})}function I(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 k(e){for(var t=[],n=0;n<e;++n)t.push(n);return t}function A(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=I(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}(),Y=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),W=function(e,t){return(W=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 G(e,t){function n(){this.constructor=e}W(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}G(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}G(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}G(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 G(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 G(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 G(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=C(n.items,e.childEntries)).length&&n.updateItems(e)},n.options=p(p({},n.constructor.defaultOptions),t),n.containerElement=I(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 Y(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(x(this.items)),t.observeChildren(x(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=b(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.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._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.options.gap,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,y=i.gap,r=i.align,E=i.observeChildren,_=i.columnSizeRatio,o=i.contentAlign,i=t.length,P=z.length,b=this._getAlignPoses(S,v),C="end"===e,O=C?"min":"max",x=C?"max":"min",e=[0],I=(e=i===S?t.slice():(n=i?Math[x].apply(Math,t):0,k(S).map(function(){return n}))).slice(),T=1<S?b[1]-b[0]:0,w="stretch"===r,D=C&&"start"===o,M=C?-1/0:1/0;D&&(M=Math.min.apply(Math,I));for(var s=function(e){var t,n,i,r,o,s=z[C?e:P-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+y)/T))),l=Math.min(S,Math.max(h,u)),f=(n=h,i=O,r=M,e=(t=I).length-n+1,o="max"===i?"min":"max",u="max"===i?"lastIndexOf":"indexOf",(e=k(e).map(function(e){e=Re(t,e,n,o);return Math[o](r,e)}))[u](Math[i].apply(Math,e))),d=Re(I,f,h,x);for(D&&M!==d&&(M=Math.max.apply(Math,I),I=I.map(function(){return M}),d=M,f=0);h<l;){var p=f+h,g=f-1;if(C&&(S<=p||I[p]>d))break;if(!C&&(g<0||I[g]<d))break;C||--f,++h}f=Math.max(0,f),h=Math.min(S-f,h),(0<a&&1<h||w)&&(m=(h-1)*T+v,N._isObserverEnabled()&&E||s.cssInlineSize===m||(s.shouldReupdate=!0),s.cssInlineSize=m),0<_&&(c=s.computedInlineSize/_,s.cssContentSize=c);var m=b[f],d=C?d:d-y-c;s.cssInlinePos=m,s.cssContentPos=d;var R=C?d+c+y:d;k(h).forEach(function(e){I[f+e]=R})},N=this,a=0;a<P;++a)s(a);return D&&M!==Math.min.apply(Math,I)&&(M=Math.max.apply(Math,I),I=I.map(function(){return M})),{start:C?e:I,end:C?I:e}},n.getComputedOutlineSize=function(e){void 0===e&&(e=this.items);var t=this.options,n=t.gap,i=t.align,r=this.getContainerInlineSize(),o=this.columnSize||this.outlineSize,s=this.column||this.outlineLength,a=s||1,t=0;if("stretch"===i)s||(s=this.maxStretchColumnSize||1/0,a=Math.max(1,Math.ceil((r+n)/(s+n)))),t=(r+n)/(a||1)-n;else if(o)t=o;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}}t=u.inlineSize||0}else t=r;return t||0},n.getComputedOutlineLength=function(e){void 0===e&&(e=this.items);var t=this.gap,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=this.options,i=n.align,r=n.gap,o=this.getContainerInlineSize(),s=k(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,o=e.gridData.contentOffset||0,e=e.gridData.contentMargin||0;return n&&i?(i<=o?1:(n-r)/(i-o))*(t-e-o)+r:t-e}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 a=this,i=this.options,u=i.attributePrefix,c=i.horizontal;e.forEach(function(e){var t,n,i,r,o,s;e.isUpdating&&(t=e.element,o=e.attributes,n=e.gridData,i=parseFloat(o.inlineOffset),s=parseFloat(o.contentOffset),r=parseFloat(o.contentMargin),isNaN(i)&&(i=a.inlineOffset||n.inlineOffset||0),isNaN(s)&&(s=a.contentOffset||0|n.contentOffset),isNaN(r)&&(r=a.contentMargin||0|n.contentMargin),!t||"inlineOffset"in o||"contentOffset"in o||e.mountState!==g.MOUNTED||(o=t.querySelector("["+u+"maintained-target]"))&&(e=t.offsetWidth-t.clientWidth+t.scrollWidth-o.clientWidth,o=t.offsetHeight-t.clientHeight+t.scrollHeight-o.clientHeight,s=c?(i=o,e):(i=e,o)),n.inlineOffset=i,n.contentOffset=s,n.contentMargin=r)});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=A(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:A(e.length,r)-A(t.length,r)||e.cost-t.cost}),p[0]},n._getExpectedRowSize=function(i,e){var t=this.options.gap,n=this.getContainerInlineSize()-t*(i.length-1),o=n,s=0,a=0;if(i.forEach(function(e){var t,n,i=e.orgInlineSize,r=e.orgContentSize;i&&r?(t=e.gridData.inlineOffset||0,n=e.gridData.contentOffset||0,e=e.gridData.contentMargin||0,s+=r=r<=n?1:(i-t)/(r-n),a+=(n+e)*r,o-=t):s+=1}),s){var r=(o+a)/s;if(this.stretch){var t=this._getSizeRange(),u=L(r,t[0],t[1]);if(e)return u;var c=this.stretchRange,t=i.map(function(e){return ye(e,u)}),e=t.reduce(function(e,t,n){return e+Se(t,i[n].attributes.minStretch||c[0])},0),t=t.reduce(function(e,t,n){return e+Se(t,i[n].attributes.maxStretch||c[1])},0);if(e<=n&&n<=t)return u}return r}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=this.options.gap,i=e.length,r=this.getContainerInlineSize()-n*(Math.max(1,i)-1),e=this._getExpectedInlineSizes(e,t),t=D(e.map(function(e){return e.size})),t=r-t,o=r/D(e.map(function(e){return e.originalSize})),s=e.map(function(e){return p(p({},e),{passed:!1,size:e.originalSize*o})});if(0==t)return{infos:s,cost:0};for(var a=0<t,u=s.length,c=0;c<u;++c)if("break"===function(){var e=D(s.map(function(e){return e.passed?e.size:0})),t=D(s.map(function(e){return e.passed?0:e.originalSize})),n=(r-e)/t;if(s.forEach(function(e){e.passed||(a?e.size>e.maxSize&&(n=Math.min(n,e.maxSize/e.originalSize)):e.size<e.minSize&&(n=Math.max(n,e.minSize/e.originalSize)))}),s.forEach(function(e){e.passed||(e.size=L(e.originalSize*n,e.minSize,e.maxSize),(a&&!U(e.size-e.maxSize,.001)||!a&&!U(e.size-e.minSize,.001))&&(e.passed=!0))}),s.every(function(e){return e.passed}))return"break"}())break;var h=r/D(s.map(function(e){return e.size}));return U(h-1,.001)&&s.forEach(function(e){e.size*=h}),{infos:s,cost:D(s.map(function(e){var t=1;(e.size>e.maxSize||e.size<e.minSize)&&(t=2);var n=e.originalSize,n=a?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.options.gap,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)}a=0;if(this.stretch){s<u?s=u:c<s&&(s=c);h=this._getExpectedInlineSize(r,s);return a=!this.passUnstretchRow||(i?n!==e.length:0!==t)||o<=h?this._getStretchItemInfos(r,s).cost:a}if(isFinite(c)){if(s<u)return Math.pow(s-u,2)+Math.pow(c,2)+a;if(c<s)return Math.pow(s-c,2)+Math.pow(c,2)+a}else if(s<u)return Math.max(Math.pow(u,2),Math.pow(s,2))+Math.pow(c,2)+a;return s-u+a},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.gap,m=i.isCroppedSize,R=i.displayedRow,z=i.stretch,v=i.passUnstretchRow,S=e.length,y=this._getSizeRange(),n=n[0]||0,E=this.getContainerInlineSize(),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),_=t.length,P=n,b=0;if(t.forEach(function(o,e){var n=o.length,s=f._getExpectedRowSize(o,!0);m&&(s=Math.max(y[0],Math.min(s,y[1])));var i,r,t=g*(n-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=(E-t)/(u-t),h=u-t,t=E-t;z&&u&&t!=h&&(v&&h<t&&(l?e===_-1:0===e)?(p=[P],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=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+g:0;m&&(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:P,inlineSize:i,contentSize:s})}),P+=g+s,(R<0||e<R)&&(b=P)}),l)return{start:[n],end:[b],passedItems:d,passed:p};var r=P-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:!1,stretchRange:["-20%","+20%"],contentMargin:0,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,u=a.gap,c=a.useFrameFill,a=this.getRectSize(r),h=a.inlineSize,l=a.contentSize,f=e.length;if(!f||!r||!o)return{start:n,end:n};for(var d=s.length,p=k(r).map(function(){return 1/0}),g=k(r).map(function(){return-1/0}),m=i.outline.map(function(e){return e*(l+u)}),R=0;R<f;R+=d)for(var z=_e(g,m,c),v=0;v<d&&R+v<f;++v){var S=e[R+v],y=s[v],E=y.contentPos,_=y.inlinePos,P=y.contentSize,b=y.inlineSize,C=z+E*(l+u),y=_*(h+u),E=P*(l+u)-u,P=b*(h+u)-u;Pe(p,g,{inlinePos:_,inlineSize:b,contentPos:C,contentSize:E+u}),S.setCSSGridRect({inlinePos:y,contentPos:C,inlineSize:P,contentSize:E})}var O,t="end"===t,n=n.length?n:[0];n.length!==r&&(O=(t?Math.max:Math.min).apply(Math,n),n=k(r).map(function(){return O}));var p=p.map(function(e){return isFinite(e)?e:0}),g=g.map(function(e){return isFinite(e)?e:0}),x=t?_e(n,p,c):_e(g,n,c);return e.forEach(function(e){e.cssContentPos+=x}),{start:p.map(function(e){return e+x}),end:g.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,t=e.gap,e=e.rectSize;return"object"==typeof e?e.inlineSize:e||(this.getContainerInlineSize()+t)/this.getComputedOutlineLength()-t},n.getRectSize=function(e){var t=this.options,n=t.gap,t=t.rectSize;if("object"==typeof t)return t;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=k(n).map(function(){return 1/0}),s=k(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),be=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 Ce(e,t){t=e/t;return(t=t<1?1/t:t)-1}var Oe,xe={__proto__:null,default:me,GetterSetter:M,withGridMethods:j,withMethods:N,getMountedElements:x,getUpdatedItems:C,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,o=r.aspectRatio,s=r.gap,a=this.getContainerInlineSize(),u=a/o,n=n.length?n:[0],c="end"===t?Math.max.apply(Math,n):Math.min.apply(Math,n)-u-s,n=c+u+s,h=new be({});return e.forEach(function(e){e=new be({inlineSize:e.orgInlineSize,contentSize:e.orgContentSize,orgInlineSize:e.orgInlineSize,orgContentSize:e.orgContentSize});i._findBestFitArea(h,e),h.push(e),h.scaleTo(a+s,u+s)}),e.forEach(function(e,t){var n=h.items[t],i=n.inlineSize-s,r=n.contentSize-s,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=Ce(e.getOrgSizeWeight(),e.getSize())*S,n=Ce(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=Ce(p.getSize(),h)*S;h+=Ce(p.getRatio(),l)*y,h+=Ce(e.getOrgSizeWeight(),f)*S-t,(h+=Ce(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:Y,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 xe)me[Oe]=xe[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"}},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}); | ||
//# sourceMappingURL=grid.min.js.map |
{ | ||
"name": "@egjs/grid", | ||
"version": "1.16.0-beta.12", | ||
"version": "1.16.0", | ||
"description": "A component that can arrange items according to the type of grids", | ||
@@ -5,0 +5,0 @@ "main": "dist/grid.cjs.js", |
@@ -326,3 +326,8 @@ /** | ||
} | ||
protected getInlineGap(): number { | ||
return this._getDirectionalGap('inline'); | ||
} | ||
protected getContentGap(): number { | ||
return this._getDirectionalGap('content'); | ||
} | ||
protected checkReady(options: RenderOptions = {}) { | ||
@@ -335,3 +340,3 @@ // Grid: renderItems => checkReady => readyItems => applyGrid | ||
const transitionMounted = mounted.filter((item) => { | ||
mounted.filter((item) => { | ||
if (item.hasTransition) { | ||
@@ -350,8 +355,5 @@ return true; | ||
return false; | ||
}); | ||
transitionMounted.forEach((item) => { | ||
}).forEach((item) => { | ||
item.element!.style.transitionDuration = "0s"; | ||
}); | ||
this._im?.destroy(); | ||
@@ -499,2 +501,9 @@ this._im = new ImReady({ | ||
} | ||
private _getDirectionalGap(direction: 'inline' | 'content'): number { | ||
const horizontal = this.options.horizontal!; | ||
const gap = this.options.gap!; | ||
if (typeof gap === 'number') return gap; | ||
const isVerticalGap = horizontal && direction === 'inline' || !horizontal && direction === 'content'; | ||
return (isVerticalGap ? (gap as any).vertical : (gap as any).horizontal) ?? (DEFAULT_GRID_OPTIONS["gap"] as number); | ||
} | ||
private _renderComplete(e: OnRenderComplete) { | ||
@@ -524,7 +533,7 @@ /** | ||
} = this.outlines; | ||
const gap = this.options.gap!; | ||
const contentGap = this.getContentGap(); | ||
const endPoint = endOutline.length ? Math.max(...endOutline) : 0; | ||
const startPoint = startOutline.length ? Math.max(...startOutline) : 0; | ||
const contentSize = Math.max(startPoint, endPoint - gap); | ||
const contentSize = Math.max(startPoint, endPoint - contentGap); | ||
@@ -531,0 +540,0 @@ this.containerManager.setContentSize(contentSize); |
@@ -150,3 +150,2 @@ /** | ||
const { | ||
gap, | ||
useFrameFill, | ||
@@ -159,2 +158,4 @@ } = this.options; | ||
} = this.getRectSize(frameInlineSize); | ||
const inlineGap = this.getInlineGap(); | ||
const contentGap = this.getContentGap(); | ||
@@ -170,3 +171,3 @@ | ||
let endOutline = range(frameInlineSize).map(() => -Infinity); | ||
const frameOutline = frame.outline.map((point) => point * (rectContentSize + gap)); | ||
const frameOutline = frame.outline.map((point) => point * (rectContentSize + contentGap)); | ||
@@ -185,6 +186,6 @@ for (let startIndex = 0; startIndex < itemsLength; startIndex += rectsLength) { | ||
} = frameRects[rectIndex]; | ||
const contentPos = startPoint + frameRectContentPos * (rectContentSize + gap); | ||
const inlinePos = frameRectInlinePos * (rectInlineSize + gap); | ||
const contentSize = frameRectContentSize * (rectContentSize + gap) - gap; | ||
const inlineSize = frameRectInlineSize * (rectInlineSize + gap) - gap; | ||
const contentPos = startPoint + frameRectContentPos * (rectContentSize + contentGap); | ||
const inlinePos = frameRectInlinePos * (rectInlineSize + inlineGap); | ||
const contentSize = frameRectContentSize * (rectContentSize + contentGap) - contentGap; | ||
const inlineSize = frameRectInlineSize * (rectInlineSize + inlineGap) - inlineGap; | ||
@@ -195,3 +196,3 @@ fillOutlines(startOutline, endOutline, { | ||
contentPos: contentPos, | ||
contentSize: contentSize + gap, | ||
contentSize: contentSize + contentGap, | ||
}); | ||
@@ -236,6 +237,3 @@ item.setCSSGridRect({ | ||
public getComputedOutlineSize() { | ||
const { | ||
gap, | ||
rectSize: rectSizeOption, | ||
} = this.options; | ||
const { rectSize: rectSizeOption } = this.options; | ||
@@ -245,9 +243,10 @@ if (typeof rectSizeOption === "object") { | ||
} | ||
return rectSizeOption || ((this.getContainerInlineSize()! + gap) / this.getComputedOutlineLength() - gap); | ||
const inlineGap = this.getInlineGap(); | ||
return ( | ||
rectSizeOption || | ||
(this.getContainerInlineSize()! + inlineGap) / this.getComputedOutlineLength() - inlineGap | ||
); | ||
} | ||
protected getRectSize(frameInlineSize: number) { | ||
const { | ||
gap, | ||
rectSize: rectSizeOption, | ||
} = this.options; | ||
const { rectSize: rectSizeOption } = this.options; | ||
@@ -257,5 +256,6 @@ if (typeof rectSizeOption === "object") { | ||
} | ||
const inlineGap = this.getInlineGap(); | ||
const rectSizeValue = rectSizeOption | ||
? rectSizeOption | ||
: (this.getContainerInlineSize()! + gap) / frameInlineSize - gap; | ||
: (this.getContainerInlineSize()! + inlineGap) / frameInlineSize - inlineGap; | ||
@@ -262,0 +262,0 @@ return { inlineSize: rectSizeValue, contentSize: rectSizeValue }; |
@@ -57,6 +57,5 @@ /** | ||
const contentOffset = item.gridData.contentOffset || 0; | ||
const contentMargin = item.gridData.contentMargin || 0; | ||
if (!inlineSize || !contentSize) { | ||
return rowSize - contentMargin; | ||
return rowSize; | ||
} | ||
@@ -66,3 +65,3 @@ | ||
return ratio * (rowSize - contentMargin - contentOffset) + inlineOffset; | ||
return ratio * (rowSize - contentOffset) + inlineOffset; | ||
} | ||
@@ -95,17 +94,2 @@ | ||
/** | ||
* 아이템의 inlineSize를 stretch 할지 여부 | ||
* @default false | ||
*/ | ||
stretch?: boolean; | ||
/** | ||
* string 값으로 `-`, `+`, `%`이 붙으면 원본 크기에 대한 상대값이며 number 값으로 들어오면 절대 값으로 stretch 범위를 설정할 수 있습니다. | ||
* 낱개로 설정하고 싶다면 각 Element 또는 JSX로 data-grid-min-stretch="-10%", data-grid-max-stretch="+10%"로 설정할 수 있다. | ||
* @default ["-10%", "+10%"] | ||
*/ | ||
stretchRange?: Array<string | number>; | ||
/** | ||
* 마지막 열에 stretch 범위에 벗어난 경우 다음 InfiniteGrid | ||
*/ | ||
passUnstretchRow?: boolean; | ||
/** | ||
* Maximum number of rows to be counted for container size. You can hide it on the screen by setting overflow: hidden. -1 is not set. | ||
@@ -123,13 +107,34 @@ * <ko>컨테이너 크기에 계산될 최대 row 개수. overflow: hidden을 설정하면 화면에 가릴 수 있다. -1은 미설정이다.</ko> | ||
/** | ||
* test contentMargin | ||
* The ratio is maintained except for the offset value in the inline direction. If 'data-grid-inline-offset' is set in the element of each item, it will be applied first. | ||
* <ko>inline 방향의 offset 수치 만큼 제외하고 비율을 유지한다. 각 아이템의 element에 'data-grid-inline-offset' 을 설정하면 우선 적용한다.</ko> | ||
* @default 0 | ||
*/ | ||
contentMargin?: number; | ||
inlineOffset?: number; | ||
/** | ||
* test inlineOffset | ||
* The ratio is maintained except for the offset value in the content direction. If 'data-grid-content-offset' is set in the element or JSX of each item, it will be applied first. | ||
* <ko>content 방향의 offset 수치 만큼 제외하고 비율을 유지한다. 각 아이템의 Element 또는 JSX에 'data-grid-content-offset' 을 설정하면 우선 적용한다.</ko> | ||
* @default 0 | ||
*/ | ||
inlineOffset?: number; | ||
contentOffset?: number; | ||
/** | ||
* test contentOffset | ||
* it is possible to basically break the proportion of the item and stretch the inline size to fill the container. | ||
* If you set the `sizeRange` range narrowly, you can stretch well. | ||
* <ko>기본적으로 아이템의 비율을 깨서 inline size를 stretch하여 container를 꽉 채우게 가능하다. sizeRange의 범위를 좁게 설정하면 stretch가 잘 될 수 있다. </ko> | ||
* @default false | ||
*/ | ||
contentOffset?: number; | ||
stretch?: boolean; | ||
/** | ||
* If `-`, `+`, or `%` are added as a string value, it is a relative value to the original size. If it is a number value, the stretch range can be set as an absolute value. | ||
* If `data-grid-min-stretch` and `data-grid-max-stretch` are set in the Element or JSX of each item, they will be applied first. | ||
* <ko>string 값으로 `-`, `+`, `%`이 붙으면 원본 크기에 대한 상대값이며 number 값으로 들어오면 절대 값으로 stretch 범위를 설정할 수 있습니다. | ||
* 각 아이템의 Element 또는 JSX에 `data-grid-min-stretch`, `data-grid-max-stretch`을 설정하면 우선 적용한다.</ko> | ||
* @ | ||
* @default ["-10%", "+10%"] | ||
*/ | ||
stretchRange?: Array<string | number>; | ||
/** | ||
* Items placed in the last row are not stretched and are drawn maintaining their proportions. When using InfiniteGrid, it is calculated and re-rendered as follows: | ||
* <ko>마지막 row에 배치되는 아이템들 경우 stretch되지 않고 비율유지한채로 그려진다. InfiniteGrid를 사용하는 경우 다음 그룹과 같이 계산되어 재렌더링한다.</ko> | ||
*/ | ||
passUnstretchRow?: boolean; | ||
} | ||
@@ -173,5 +178,4 @@ | ||
stretch: false, | ||
passUnstretchRow: false, | ||
passUnstretchRow: true, | ||
stretchRange: ["-20%", "+20%"], | ||
contentMargin: 0, | ||
inlineOffset: 0, | ||
@@ -195,3 +199,3 @@ contentOffset: 0, | ||
let contentOffset = parseFloat(attributes.contentOffset); | ||
let contentMargin = parseFloat(attributes.contentMargin); | ||
// let contentMargin = parseFloat(attributes.contentMargin); | ||
@@ -204,5 +208,5 @@ if (isNaN(inlineOffset)) { | ||
} | ||
if (isNaN(contentMargin)) { | ||
contentMargin = this.contentMargin || gridData.contentMargin | 0; | ||
} | ||
// if (isNaN(contentMargin)) { | ||
// contentMargin = this.contentMargin || gridData.contentMargin | 0; | ||
// } | ||
@@ -232,3 +236,3 @@ if ( | ||
gridData.contentOffset = contentOffset; | ||
gridData.contentMargin = contentMargin; | ||
// gridData.contentMargin = contentMargin; | ||
}); | ||
@@ -352,6 +356,3 @@ const rowRange = this.options.rowRange; | ||
private _getExpectedRowSize(items: GridItem[], forceStretch?: boolean) { | ||
const { | ||
gap, | ||
} = this.options; | ||
const containerInlineSize = this.getContainerInlineSize()! - gap * (items.length - 1); | ||
const containerInlineSize = this.getContainerInlineSize()! - this.getInlineGap() * (items.length - 1); | ||
let fixedContainerInsize = containerInlineSize; | ||
@@ -372,3 +373,3 @@ let ratioSum = 0; | ||
const contentOffset = item.gridData.contentOffset || 0; | ||
const contentMargin = item.gridData.contentMargin || 0; | ||
// const contentMargin = item.gridData.contentMargin || 0; | ||
@@ -379,3 +380,4 @@ const maintainedRatio = contentSize <= contentOffset ? 1 | ||
ratioSum += maintainedRatio; | ||
inlineSum += (contentOffset + contentMargin) * maintainedRatio; | ||
// inlineSum += (contentOffset + contentMargin) * maintainedRatio; | ||
inlineSum += contentOffset * maintainedRatio; | ||
fixedContainerInsize -= inlineOffset; | ||
@@ -449,7 +451,4 @@ }); | ||
private _getStretchItemInfos(items: GridItem[], rowSize: number) { | ||
const { | ||
gap, | ||
} = this.options; | ||
const itemsLength = items.length; | ||
const containerInlineSize = this.getContainerInlineSize() - gap * (Math.max(1, itemsLength) - 1); | ||
const containerInlineSize = this.getContainerInlineSize() - this.getInlineGap() * (Math.max(1, itemsLength) - 1); | ||
const itemInfos = this._getExpectedInlineSizes(items, rowSize); | ||
@@ -545,9 +544,6 @@ const firstItemsSize = sum(itemInfos.map((info) => info.size)); | ||
private _getExpectedInlineSize(items: GridItem[], rowSize: number) { | ||
const { | ||
gap, | ||
} = this.options; | ||
const inlineGap = this.getInlineGap(); | ||
const itemInfos = this._getExpectedInlineSizes(items, rowSize); | ||
return itemInfos.length ? sum(itemInfos.map((info) => info.size)) + gap * (items.length - 1) : 0; | ||
return itemInfos.length ? sum(itemInfos.map((info) => info.size)) + inlineGap * (items.length - 1) : 0; | ||
} | ||
@@ -584,2 +580,3 @@ private _getCost( | ||
} | ||
const sizeCost = Math.abs(rowSize - minSize); | ||
@@ -601,3 +598,3 @@ const expectedInlineSize = this._getExpectedInlineSize( | ||
return extraCost; | ||
return extraCost + sizeCost; | ||
} | ||
@@ -657,3 +654,2 @@ | ||
const { | ||
gap, | ||
isCroppedSize, | ||
@@ -668,2 +664,4 @@ displayedRow, | ||
const containerInlineSize = this.getContainerInlineSize(); | ||
const inlineGap = this.getInlineGap(); | ||
const contentGap = this.getContentGap(); | ||
const groups = splitItems(items, path); | ||
@@ -683,3 +681,3 @@ let passedItems!: number[]; | ||
} | ||
const allGap = gap * (groupItemslength - 1); | ||
const allGap = inlineGap * (length - 1); | ||
const itemInfos = groupItems.map((item, index) => { | ||
@@ -717,2 +715,3 @@ const itemInlineSize = getExpectedItemInlineSize(item, rowSize); | ||
info.inlineSize = between(info.inlineSize, info.minInlineSize, info.maxInlineSize); | ||
}); | ||
@@ -739,3 +738,3 @@ } else { | ||
const inlinePos = prevItem | ||
? prevItem.cssInlinePos! + prevItem.cssInlineSize! + gap | ||
? prevItem.cssInlinePos! + prevItem.cssInlineSize! + inlineGap | ||
: 0; | ||
@@ -762,3 +761,3 @@ | ||
}); | ||
contentPos += gap + rowSize; | ||
contentPos += contentGap + rowSize; | ||
if (displayedRow < 0 || rowIndex < displayedRow) { | ||
@@ -765,0 +764,0 @@ displayedSize = contentPos; |
@@ -129,3 +129,2 @@ /** | ||
const { | ||
gap, | ||
align, | ||
@@ -136,2 +135,4 @@ observeChildren, | ||
} = this.options; | ||
const inlineGap = this.getContentGap(); | ||
const contentGap = this.getContentGap(); | ||
const outlineLength = outline.length; | ||
@@ -173,3 +174,3 @@ const itemsLength = items.length; | ||
column, | ||
columnAttribute || Math.max(1, Math.ceil((item.inlineSize + gap) / columnDist)), | ||
columnAttribute || Math.max(1, Math.ceil((item.inlineSize + inlineGap) / columnDist)), | ||
); | ||
@@ -220,7 +221,7 @@ const maxColumnCount = Math.min(column, Math.max(columnCount, maxColumnAttribute)); | ||
const inlinePos = alignPoses[columnIndex]; | ||
contentPos = isEndDirection ? contentPos : contentPos - gap - contentSize; | ||
contentPos = isEndDirection ? contentPos : contentPos - contentGap - contentSize; | ||
item.cssInlinePos = inlinePos; | ||
item.cssContentPos = contentPos; | ||
const nextOutlinePoint = isEndDirection ? contentPos + contentSize + gap : contentPos; | ||
const nextOutlinePoint = isEndDirection ? contentPos + contentSize + contentGap : contentPos; | ||
@@ -247,6 +248,4 @@ range(columnCount).forEach((indexOffset) => { | ||
public getComputedOutlineSize(items = this.items) { | ||
const { | ||
gap, | ||
align, | ||
} = this.options; | ||
const { align } = this.options; | ||
const inlineGap = this.getInlineGap(); | ||
const containerInlineSize = this.getContainerInlineSize(); | ||
@@ -263,5 +262,5 @@ const columnSizeOption = this.columnSize || this.outlineSize; | ||
column = Math.max(1, Math.ceil((containerInlineSize + gap) / (maxStretchColumnSize + gap))); | ||
column = Math.max(1, Math.ceil((containerInlineSize + inlineGap) / (maxStretchColumnSize + inlineGap))); | ||
} | ||
columnSize = (containerInlineSize + gap) / (column || 1) - gap; | ||
columnSize = (containerInlineSize + inlineGap) / (column || 1) - inlineGap; | ||
} else if (columnSizeOption) { | ||
@@ -297,3 +296,3 @@ columnSize = columnSizeOption; | ||
public getComputedOutlineLength(items = this.items) { | ||
const gap = this.gap; | ||
const inlineGap = this.getInlineGap(); | ||
const columnOption = this.column || this.outlineLength; | ||
@@ -310,4 +309,9 @@ const columnCalculationThreshold = this.columnCalculationThreshold; | ||
items.length, | ||
Math.max(1, Math.floor((this.getContainerInlineSize() + gap) | ||
/ (columnSize - columnCalculationThreshold + gap))), | ||
Math.max( | ||
1, | ||
Math.floor( | ||
(this.getContainerInlineSize() + inlineGap) / | ||
(columnSize - columnCalculationThreshold + inlineGap) | ||
) | ||
) | ||
); | ||
@@ -318,6 +322,4 @@ } | ||
private _getAlignPoses(column: number, columnSize: number) { | ||
const { | ||
align, | ||
gap, | ||
} = this.options; | ||
const { align } = this.options; | ||
const inlineGap = this.getInlineGap(); | ||
const containerSize = this.getContainerInlineSize(); | ||
@@ -332,6 +334,6 @@ const indexes = range(column); | ||
dist = countDist ? Math.max((containerSize - columnSize) / countDist, columnSize + gap) : 0; | ||
dist = countDist ? Math.max((containerSize - columnSize) / countDist, columnSize + inlineGap) : 0; | ||
offset = Math.min(0, containerSize / 2 - (countDist * dist + columnSize) / 2); | ||
} else { | ||
dist = columnSize + gap; | ||
dist = columnSize + inlineGap; | ||
const totalColumnSize = (column - 1) * dist + columnSize; | ||
@@ -338,0 +340,0 @@ |
@@ -110,10 +110,12 @@ /** | ||
public applyGrid(items: GridItem[], direction: "start" | "end", outline: number[]): GridOutlines { | ||
const { aspectRatio, gap } = this.options; | ||
const { aspectRatio } = this.options; | ||
const containerInlineSize = this.getContainerInlineSize(); | ||
const containerContentSize = containerInlineSize / aspectRatio; | ||
const inlineGap = this.getInlineGap(); | ||
const contentGap = this.getContentGap(); | ||
const prevOutline = outline.length ? outline : [0]; | ||
const startPoint = direction === "end" | ||
? Math.max(...prevOutline) | ||
: Math.min(...prevOutline) - containerContentSize - gap; | ||
const endPoint = startPoint + containerContentSize + gap; | ||
: Math.min(...prevOutline) - containerContentSize - contentGap; | ||
const endPoint = startPoint + containerContentSize + contentGap; | ||
const container = new BoxModel({}); | ||
@@ -131,8 +133,8 @@ | ||
container.push(model); | ||
container.scaleTo(containerInlineSize + gap, containerContentSize + gap); | ||
container.scaleTo(containerInlineSize + inlineGap, containerContentSize + contentGap); | ||
}); | ||
items.forEach((item, i) => { | ||
const boxItem = container.items[i]; | ||
const inlineSize = boxItem.inlineSize - gap; | ||
const contentSize = boxItem.contentSize - gap; | ||
const inlineSize = boxItem.inlineSize - inlineGap; | ||
const contentSize = boxItem.contentSize - contentGap; | ||
const contentPos = startPoint + boxItem.contentPos; | ||
@@ -139,0 +141,0 @@ const inlinePos = boxItem.inlinePos; |
@@ -47,3 +47,3 @@ /** | ||
*/ | ||
gap?: number; | ||
gap?: number | { horizontal?: number; vertical?: number }; | ||
/** | ||
@@ -50,0 +50,0 @@ * The prefix to use element's data attribute. |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1689602
18365
1