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

@egjs/grid

Package Overview
Dependencies
Maintainers
9
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@egjs/grid - npm Package Compare versions

Comparing version 1.12.0-beta.1 to 1.12.0-beta.2

5

declaration/ContainerManager.d.ts

@@ -8,3 +8,3 @@ /**

import { DestroyOptions, SizeRect } from "./types";
import { ResizeWatcherResizeEvent } from "./ResizeWatcher";
import { ResizeWatcherResizeEvent, ResizeWatcher } from "./ResizeWatcher";
export interface ContainerManagerOptions {

@@ -27,5 +27,6 @@ horizontal?: boolean;

protected orgCSSText: string;
private _watcher;
protected _watcher: ResizeWatcher;
constructor(container: HTMLElement, options: ContainerManagerOptions);
resize(): void;
isObserverEnabled(): boolean;
getRect(): SizeRect;

@@ -32,0 +33,0 @@ observeChildren(children: Element[]): void;

1

declaration/Grid.d.ts

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

protected readyItems(mounted: GridItem[], updated: GridItem[], options: RenderOptions): void;
protected _isObserverEnabled(): boolean;
protected _requestUpdateSize(item: GridItem): void;

@@ -149,0 +150,0 @@ private _renderComplete;

@@ -17,10 +17,21 @@ /**

* @extends Grid.GridOptions
* @property - The shape of the grid. You can set the shape and order of items with a 2d array ([contentPos][inlinePos]). You can place items as many times as you fill the array with numbers, and zeros and spaces are empty spaces. The order of the items is arranged in ascending order of the numeric values that fill the array. (default: [])
* <ko>Grid의 모양. 2d 배열([contentPos][inlinePos])로 아이템의 모양과 순서를 설정할 수 있다. 숫자로 배열을 채운만큼 아이템을 배치할 수 있으며 0과 공백은 빈 공간이다. 아이템들의 순서는 배열을 채운 숫자값의 오름차순대로 배치가 된다. (default: [])</ko>
* @property - Make sure that the frame can be attached after the previous frame. (default: true) <ko> 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다.</ko>
* @property - 1x1 rect size. If it is 0, it is determined by the number of columns in the frame. (default: 0) <ko>1x1 직사각형 크기. 0이면 frame의 column의 개수에 의해 결정된다. (default: 0)</ko>
*/
export interface FrameGridOptions extends GridOptions {
/**
* The shape of the grid. You can set the shape and order of items with a 2d array ([contentPos][inlinePos]). You can place items as many times as you fill the array with numbers, and zeros and spaces are empty spaces. The order of the items is arranged in ascending order of the numeric values that fill the array.
* <ko>Grid의 모양. 2d 배열([contentPos][inlinePos])로 아이템의 모양과 순서를 설정할 수 있다. 숫자로 배열을 채운만큼 아이템을 배치할 수 있으며 0과 공백은 빈 공간이다. 아이템들의 순서는 배열을 채운 숫자값의 오름차순대로 배치가 된다. (default: [])</ko>
* @default []
*/
frame?: number[][];
/**
* Make sure that the frame can be attached after the previous frame.
* <ko> 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다.</ko>
* @default true
*/
useFrameFill?: boolean;
/**
* 1x1 rect size. If it is 0, it is determined by the number of columns in the frame.
* <ko>1x1 직사각형 크기. 0이면 frame의 column의 개수에 의해 결정된다.</ko>
* @default 0
*/
rectSize?: number | {

@@ -27,0 +38,0 @@ inlineSize: number;

@@ -14,13 +14,33 @@ /**

* @extends Grid.GridOptions
* @property - The minimum and maximum number of items per line. (default: [1, 8]) <ko> 한 줄에 들어가는 아이템의 최소, 최대 개수. (default: [1, 8]) </ko>
* @property - The minimum and maximum number of rows in a group, 0 is not set. (default: 0) <ko> 한 그룹에 들어가는 행의 최소, 최대 개수, 0은 미설정이다. (default: 0) </ko>
* @property - The minimum and maximum size by which the item is adjusted. If it is not calculated, it may deviate from the minimum and maximum sizes. (default: [0, Infinity]) <ko>아이템이 조정되는 최소, 최대 사이즈. 계산이 되지 않는 경우 최소, 최대 사이즈를 벗어날 수 있다. (default: [0, Infinity])</ko>
* @property - 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. (default: -1)<ko>컨테이너 크기에 계산될 최대 row 개수. overflow: hidden을 설정하면 화면에 가릴 수 있다. -1은 미설정이다. (default: -1)</ko>
* @property - Whether to crop when the row size is out of sizeRange. If set to true, this ratio can be broken. (default: false) <ko>row사이즈가 sizeRange에 벗어나면 크롭할지 여부. true로 설정하면 비율이 깨질 수 있다. (default: false)</ko>
*/
export interface JustifiedGridOptions extends GridOptions {
/**
* The minimum and maximum number of items per line.
* <ko> 한 줄에 들어가는 아이템의 최소, 최대 개수.</ko>
* @default [1, 8]
*/
columnRange?: number | number[];
/**
* The minimum and maximum number of rows in a group, 0 is not set.
* <ko> 한 그룹에 들어가는 행의 최소, 최대 개수, 0은 미설정이다.</ko>
* @default 0
*/
rowRange?: number | number[];
/**
* The minimum and maximum size by which the item is adjusted. If it is not calculated, it may deviate from the minimum and maximum sizes.
* <ko>아이템이 조정되는 최소, 최대 사이즈. 계산이 되지 않는 경우 최소, 최대 사이즈를 벗어날 수 있다.</ko>
* @default [0, Infinity]
*/
sizeRange?: number | number[];
/**
* 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.
* <ko>컨테이너 크기에 계산될 최대 row 개수. overflow: hidden을 설정하면 화면에 가릴 수 있다. -1은 미설정이다.</ko>
* @default -1
*/
displayedRow?: number;
/**
* Whether to crop when the row size is out of sizeRange. If set to true, this ratio can be broken.
* <ko>row사이즈가 sizeRange에 벗어나면 크롭할지 여부. true로 설정하면 비율이 깨질 수 있다.</ko>
* @default false
*/
isCroppedSize?: boolean;

@@ -27,0 +47,0 @@ }

@@ -14,15 +14,39 @@ /**

* @extends Grid.GridOptions
* @property - The number of columns. If the number of columns is 0, it is automatically calculated according to the size of the container. Can be used instead of outlineLength. (default: 0)<ko>열의 개수. 열의 개수가 0이라면, 컨테이너의 사이즈에 의해 계산이 된다. outlineLength 대신 사용할 수 있다.(default: 0) </ko>
* @property - The size of the columns. If it is 0, it is calculated as the size of the first item in items. Can be used instead of outlineSize. (default: 0) <ko> 열의 사이즈. 만약 열의 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. outlineSize 대신 사용할 수 있다.(default: 0) </ko>
* @property - The size ratio(inlineSize / contentSize) of the columns. 0 is not set. (default: 0) <ko>열의 사이즈 비율(inlineSize / contentSize). 0은 미설정이다. </ko>
* @property - Align of the position of the items. If you want to use `stretch`, be sure to set `column`, `columnSize` or `maxStretchColumnSize` option. ("start", "center", "end", "justify", "stretch") (default: "justify") <ko>아이템들의 위치의 정렬. `stretch`를 사용하고 싶다면 `column`, `columnSize` 또는 `maxStretchColumnSize` 옵션을 설정해라. ("start", "center", "end", "justify", "stretch") (default: "justify")</ko>
* @property - Difference Threshold for Counting Columns. Since offsetSize is calculated by rounding, the number of columns may not be accurate. (default: 1) <ko>칼럼 개수를 계산하기 위한 차이 임계값. offset 사이즈는 반올림으로 게산하기 때문에 정확하지 않을 수 있다. (default: 1)</ko>
* @property - If stretch is used, the column can be automatically calculated by setting the maximum size of the column that can be stretched. (default: Infinity) <ko>stretch를 사용한 경우 최대로 늘릴 수 있는 column의 사이즈를 설정하여 column을 자동 계산할 수 있다. (default: Infinity)</ko>
*/
export interface MasonryGridOptions extends GridOptions {
/**
* The number of columns. If the number of columns is 0, it is automatically calculated according to the size of the container. Can be used instead of outlineLength.
* <ko>열의 개수. 열의 개수가 0이라면, 컨테이너의 사이즈에 의해 계산이 된다. outlineLength 대신 사용할 수 있다.</ko>
* @default 0
*/
column?: number;
/**
* The size of the columns. If it is 0, it is calculated as the size of the first item in items. Can be used instead of outlineSize.
* <ko>열의 사이즈. 만약 열의 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. outlineSize 대신 사용할 수 있다.</ko>
* @default 0
*/
columnSize?: number;
/**
* The size ratio(inlineSize / contentSize) of the columns. 0 is not set.
* <ko>열의 사이즈 비율(inlineSize / contentSize). 0은 미설정이다.</ko>
* @default 0
*/
columnSizeRatio?: number;
/**
* Align of the position of the items. If you want to use `stretch`, be sure to set `column`, `columnSize` or `maxStretchColumnSize` option. ("start", "center", "end", "justify", "stretch")
* <ko>아이템들의 위치의 정렬. `stretch`를 사용하고 싶다면 `column`, `columnSize` 또는 `maxStretchColumnSize` 옵션을 설정해라. ("start", "center", "end", "justify", "stretch")</ko>
* @default "justify"
*/
align?: GridAlign;
/**
* Difference Threshold for Counting Columns. Since offsetSize is calculated by rounding, the number of columns may not be accurate.
* <ko>칼럼 개수를 계산하기 위한 차이 임계값. offset 사이즈는 반올림으로 게산하기 때문에 정확하지 않을 수 있다.</ko>
* @default 1
*/
columnCalculationThreshold?: number;
/**
* If stretch is used, the column can be automatically calculated by setting the maximum size of the column that can be stretched.
* <ko>stretch를 사용한 경우 최대로 늘릴 수 있는 column의 사이즈를 설정하여 column을 자동 계산할 수 있다.</ko>
* @default Infinity
*/
maxStretchColumnSize?: number;

@@ -29,0 +53,0 @@ }

@@ -14,13 +14,28 @@ /**

* @extends Grid.GridOptions
* @property - The aspect ratio (inlineSize / contentSize) of the container with items. (default: 1) <ko>아이템들을 가진 컨테이너의 종횡비(inlineSize / contentSize). (default: 1)</ko>
* @property - The size weight when placing items. (default: 1)<ko>아이템들을 배치하는데 사이즈 가중치. (default: 1)</ko>
* @property - The weight to keep ratio when placing items. (default: 1)<ko>아이템들을 배치하는데 비율을 유지하는 가중치. (default: 1)</ko>
* @property - The priority that determines the weight of the item. (default: "custom"), "size" = (sizeWieght: 100, ratioWeight: 1), "ratio" = (sizeWeight: 1, ratioWeight; 100), "custom" = (set sizeWeight, ratioWeight)
* item's weight = item's ratio(inlineSize / contentSize) change * `ratioWeight` + size(inlineSize * contentSize) change * `sizeWeight`.
* <ko> 아이템의 가중치를 결정하는 우선수치. (default: "custom"), "size" = (sizeWieght: 100, ratioWeight: 1), "ratio" = (sizeWeight: 1, ratioWeight; 100), "custom" = (set sizeWeight, ratioWeight). 아이템의 가중치 = ratio(inlineSize / contentSize)의 변화량 * `ratioWeight` + size(inlineSize * contentSize)의 변화량 * `sizeWeight`.</ko>
*/
export interface PackingGridOptions extends GridOptions {
/**
* The aspect ratio (inlineSize / contentSize) of the container with items.
* <ko>아이템들을 가진 컨테이너의 종횡비(inlineSize / contentSize).</ko>
* @default 1
*/
aspectRatio?: number;
/**
* The size weight when placing items.
* <ko>아이템들을 배치하는데 사이즈 가중치.</ko>
* @default 1
*/
sizeWeight?: number;
/**
* The weight to keep ratio when placing items.
* <ko>아이템들을 배치하는데 비율을 유지하는 가중치.</ko>
* @default 1
*/
ratioWeight?: number;
/**
* The priority that determines the weight of the item. "size" = (sizeWieght: 100, ratioWeight: 1), "ratio" = (sizeWeight: 1, ratioWeight; 100), "custom" = (set sizeWeight, ratioWeight)
* item's weight = item's ratio(inlineSize / contentSize) change * `ratioWeight` + size(inlineSize * contentSize) change * `sizeWeight`.
* <ko> 아이템의 가중치를 결정하는 우선수치. "size" = (sizeWieght: 100, ratioWeight: 1), "ratio" = (sizeWeight: 1, ratioWeight; 100), "custom" = (set sizeWeight, ratioWeight). 아이템의 가중치 = ratio(inlineSize / contentSize)의 변화량 * `ratioWeight` + size(inlineSize * contentSize)의 변화량 * `sizeWeight`.</ko>
* @default "custom"
*/
weightPriority?: "size" | "ratio" | "custom";

@@ -27,0 +42,0 @@ }

@@ -34,2 +34,3 @@ import { SizeRect } from "./types";

setRect(rect: SizeRect): void;
isObserverEnabled(): boolean;
resize(): void;

@@ -36,0 +37,0 @@ observeChildren(children: Element[]): void;

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

repository: https://github.com/naver/egjs-grid
version: 1.12.0-beta.1
version: 1.12.0-beta.0
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Grid=t()}(this,function(){"use strict";var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var p=function(){return(p=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function o(e,t,n,i){var r,o=arguments.length,s=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(s=(o<3?r(s):3<o?r(t,n,s):r(t,n))||s);return 3<o&&s&&Object.defineProperty(t,n,s),s}function g(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,f,m,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,R={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};(Y=a=a||{})[Y.PROPERTY=1]="PROPERTY",Y[Y.RENDER_PROPERTY=2]="RENDER_PROPERTY",(W=f=f||{})[W.UNCHECKED=1]="UNCHECKED",W[W.UNMOUNTED=2]="UNMOUNTED",W[W.MOUNTED=3]="MOUNTED",(oe=m=m||{})[oe.NEED_UPDATE=1]="NEED_UPDATE",oe[oe.WAIT_LOADING=2]="WAIT_LOADING",oe[oe.UPDATED=3]="UPDATED";var v={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"}},z=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:z,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 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 T(e){return O(e).map(function(e){return e.element})}function w(e){return"string"==typeof e}function x(e){return"object"==typeof e}function I(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 D(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 M(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}var N=D(e),A=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=w(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.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){n.observe(e,{box:t})}))},t.unobserveChildren=function(e){var t=this._observer;t&&e.forEach(function(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}(),L=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:R.horizontal,autoResize:R.autoResize,resizeDebounce:R.resizeDebounce,maxResizeDebounce:R.maxResizeDebounce,useResizeObserver:R.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.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 A(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),U=function(e,t){return(U=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 j(e,t){function n(){this.constructor=e}U(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var F=function(){return(F=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 Y="undefined"!=typeof window,W=Y?window.navigator.userAgent:"",H=Y&&!!("getComputedStyle"in window),G=/MSIE|Trident|Windows Phone|Edge/.test(W),q=Y&&!!("addEventListener"in document),B="width",V="height";function K(e,t){return e.getAttribute(t)||""}function X(e){return[].slice.call(e)}function J(e,t){return void 0===t&&(t="data-"),"loading"in e&&"lazy"===e.getAttribute("loading")||!!e.getAttribute(t+"lazy")}function Q(e,t,n){q?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function Z(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function $(e,t){var n=e["client"+t]||e["offset"+t];return parseFloat(n||(e=e,((H?window.getComputedStyle(e):e.currentStyle)||{})[t.toLowerCase()]))||0}function ee(e,t,n){var i=X(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 X(e.querySelectorAll("["+n+"width], "+t.join(", "))).filter(function(e){return-1===i.indexOf(e)})}var te=[];function ne(e,t){te.length||Q(window,"resize",re),e.__PREFIX__=t,te.push(e),ie(e)}function ie(e,t){void 0===t&&(t="data-");var n,i=e.__PREFIX__||t,r=parseInt(K(e,""+i+B),10)||0,t=parseInt(K(e,""+i+V),10)||0;K(e,i+"fixed")===V?(n=$(e,"Height")||t,e.style[B]=r/t*n+"px"):(n=$(e,"Width")||r,e.style[V]=t/r*n+"px")}function re(){te.forEach(function(e){ie(e)})}var oe=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=F({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=J(e,i),n}j(e,r);var t=e.prototype;return t.check=function(){return this.isSkip||!this.checkElement()?(this.onAlreadyReady(!0),!1):(this.hasDataSize&&ne(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){Q(n,e,t.onCheck)})},t.clear=function(){var t=this,n=this.element;this.constructor.EVENTS.forEach(function(e){Z(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=te.indexOf(e))<0||(t=K(e,t+"fixed"),delete e.__PREFIX__,e.style[t===V?B:V]="",te.splice(n,1),te.length||Z(window,"resize",re)))},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),se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}j(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?(ne(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}(oe),W=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=F({loaders:{},prefix:"data-"},e),t}j(e,n);var t=e.prototype;return t.check=function(e){var o=this,n=this.options.prefix;this.clear(),this.elementInfos=X(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 se(t,e),u=X(t.querySelectorAll(s.join(", ")));a.setHasLoading(u.some(function(e){return J(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=ee(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(F({},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),ae=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(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(),G&&e.setAttribute("src",t),!0},t.EVENTS=["load","error"],t}(oe),ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(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}(oe),ce=function(t){function e(e){return t.call(this,F({loaders:{img:ae,video:ue}},e=void 0===e?{}:e))||this}return j(e,t),e}(W),he=function(){function e(e){this.initialRect=null,this.sizePercetage=!1,this.posPercetage=!1,this.options=p({attributePrefix:R.attributePrefix,useTransform:R.useTransform,horizontal:R.horizontal,percentage:R.percentage,isEqualSize:R.isEqualSize,isConstantSize:R.isConstantSize,useRoundedSize:R.useRoundedSize},e),this._init()}var t=e.prototype;return t.resize=function(){this.initialRect=null},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.updateItems=function(e){var t=this;e.forEach(function(e){t._updateItem(e)})},t.getStatus=function(){return{initialRect:this.initialRect}},t.setStatus=function(e){this.initialRect=e.initialRect},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){var t=this.options,n=t.isEqualSize,i=t.isConstantSize,r=t.useRoundedSize,o=this.initialRect,s=e.orgRect,a=e.element,u=e.updateState===m.WAIT_LOADING,t=s&&s.width&&s.height;if(n&&o)c=o;else if(i&&t&&!u)c=s;else{if(!a)return;var c={left:a.offsetLeft,top:a.offsetTop,width:0,height:0};r?(c.width=a.offsetWidth,c.height=a.offsetHeight):(r=a.getBoundingClientRect(),c.width=r.width,c.height=r.height)}return e.isFirstUpdate&&t||(e.orgRect=p({},c)),e.rect=p({},c),e.element&&(e.mountState=f.MOUNTED),e.updateState===m.NEED_UPDATE&&(e.updateState=m.UPDATED,e.isFirstUpdate=!0),e.attributes=a?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}(a,this.options.attributePrefix):{},u||this.initialRect||(this.initialRect=p({},c)),c},t._renderItem=function(e){var n,i,t,r,o,s,a,u=e.element,c=e.cssRect;u&&c&&(a=(t=this.options).horizontal,e=t.useTransform,n=this.posPercetage,i=this.sizePercetage,t=["position: absolute;"],r=(a=d[a?"horizontal":"vertical"]).inlineSize,o=a.inlinePos,s=this.getInlineSize(),a=c,a=Object.keys(a),e&&(a=a.filter(function(e){return"top"!==e&&"left"!==e}),t.push("transform: translate("+(c.left||0)+"px, "+(c.top||0)+"px);")),t.push.apply(t,a.map(function(e){var t=c[e];return e===r&&i||e===o&&n?e+": "+t/s*100+"%;":e+": "+t+"px;"})),u.style.cssText+=t.join(""))},e}(),le=function(){function e(e,t){void 0===t&&(t={}),this.horizontal=e,this.isUpdate=!1,this.hasTransition=!1,this.transitionDuration="",this.isRestoreOrgCSSText=!0;var n,e=t.element,i=p({key:"",orgRect:{left:0,top:0,width:0,height:0},rect:{left:0,top:0,width:0,height:0},cssRect:{},attributes:{},data:{},isFirstUpdate:!1,mountState:f.UNCHECKED,updateState:m.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{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!==f.UNCHECKED&&(e.mountState=i),r!==m.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}(),fe=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._requestedUpdateItems=[],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=w(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 L(n.containerElement,{horizontal:a,resizeDebounce:l,maxResizeDebounce:f,autoResize:t,useResizeObserver:i}).on("resize",n._onResize),n.itemRenderer=h||new he({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){var t=this.options;return t.useResizeObserver&&t.observeChildren&&((t=this.containerManager).unobserveChildren(T(this.items)),t.observeChildren(T(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 le(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=m.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 le(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!==m.UPDATED}),t=e.filter(function(e){var t;return(null===(t=e.element)||void 0===t?void 0:t.parentNode)&&e.mountState!==f.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 ce({prefix:this.options.attributePrefix}).on("preReadyElement",function(e){r[e.index].updateState=m.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.isRestoreOrgCSSText&&(e.element.style.cssText=e.orgCSSText)}),i.itemRenderer.updateItems(r),i.readyItems(t,r,n)}).on("readyElement",function(e){var t=r[e.index];t.updateState=m.NEED_UPDATE,e.isPreReadyOver&&(t.isRestoreOrgCSSText&&(t.element.style.cssText=t.orgCSSText),i.itemRenderer.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;"number"==typeof 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:g([],o),end:g([],o)};e.forEach(function(e){e.mountState=f.MOUNTED}),t.forEach(function(e){e.isUpdate=!0}),s.length&&(i=this.applyGrid(this.items,r,o)),t.forEach(function(e){e.isUpdate=!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,e.hasTransition=!1})),this._renderComplete({direction:r,mounted:e,updated:t,isResize:!!n.useResize});n=this._requestedUpdateItems;n.length&&(this.updateItems(n),this._requestedUpdateItems=[])},t._requestUpdateSize=function(e){this._requestedUpdateItems.push(e)},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=R,e.propertyTypes=v,o([I],e)}(n);function de(e,t,n,i){return Math[i].apply(Math,e.slice(t,t+n))}Y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(R,e,t){R.forEach(function(e){e.isRestoreOrgCSSText=!1});for(var n,v=this.getComputedOutlineSize(R),z=this.getComputedOutlineLength(R),i=this.options,S=i.gap,r=i.align,y=i.columnSizeRatio,E=i.useResizeObserver,i=t.length,_=R.length,P=this._getAlignPoses(z,v),C="end"===e,b=C?"min":"max",O=C?"max":"min",e=[0],T=(e=i===z?t.slice():(n=i?Math[O].apply(Math,t):0,M(z).map(function(){return n}))).slice(),w=1<z?P[1]-P[0]:0,x="stretch"===r,o=function(e){for(var t,n,i,r,o=R[C?e:_-1-e],s=parseInt(o.attributes.column||"1",10),a=parseInt(o.attributes.maxColumn||"1",10),u=o.contentSize,c=Math.min(z,s||Math.max(1,Math.ceil((o.inlineSize+S)/w))),h=Math.min(z,Math.max(c,a)),l=(n=c,i=b,e=(t=T).length-n+1,r="max"===i?"min":"max",a="max"===i?"lastIndexOf":"indexOf",(e=M(e).map(function(e){return de(t,e,n,r)}))[a](Math[i].apply(Math,e))),f=de(T,l,c,O);c<h;){var d=l+c,p=l-1;if(C&&(z<=d||T[d]>f))break;if(!C&&(p<0||T[p])<f)break;C||--l,++c}l=Math.max(0,l),c=Math.min(z-l,c),(0<s&&1<c||x)&&(g=(c-1)*w+v,E||o.cssInlineSize===g||I._requestUpdateSize(o),o.cssInlineSize=g),0<y&&(u=o.computedInlineSize/y,o.cssContentSize=u);var g=P[l],f=C?f:f-S-u;o.cssInlinePos=g,o.cssContentPos=f;var m=C?f+u+S:f;M(c).forEach(function(e){T[l+e]=m})},I=this,s=0;s<_;++s)o(s);return{start:C?e:T,end:C?T: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;if(l.updateState===m.UPDATED&&l.inlineSize&&!f.column&&!f.maxColumnCount){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=M(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({},fe.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}),t.defaultOptions=p(p({},fe.defaultOptions),{align:"justify",column:0,columnSize:0,columnSizeRatio:0,columnCalculationThreshold:.5,maxStretchColumnSize:1/0}),o([I],t)}(fe);function pe(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 ge(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 ge=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 me(e,t){var n=e.orgInlineSize,i=e.orgContentSize;if(!n||!i)return t;var r=parseFloat(e.gridData.inlineOffset)||0,e=parseFloat(e.gridData.contentOffset)||0;return(i<=e?1:(n-r)/(i-e))*(t-e)+r}oe=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.options,s=i.attributePrefix,a=i.horizontal;e.forEach(function(e){var t,n,i,r,o;e.isUpdate&&(t=e.element,r=e.attributes,n=e.gridData,i=parseFloat(r.inlineOffset)||n.inlineOffset||0,o=parseFloat(r.contentOffset)||0|n.contentOffset,!t||"inlineOffset"in r||"contentOffset"in r||e.mountState!==f.MOUNTED||(r=t.querySelector("["+s+"maintained-target]"))&&(e=t.offsetWidth-t.clientWidth+t.scrollWidth-r.clientWidth,r=t.offsetHeight-t.clientHeight+t.scrollHeight-r.clientHeight,o=a?(i=r,e):(i=e,r)),n.inlineOffset=i,n.contentOffset=o)});var r=this.options.rowRange,i=[];return e.length&&(i=r?this._getRowPath(e):this._getPath(e)),this._setStyle(e,i,n,"end"===t)},n._getRowPath=function(e){var t=this._getColumnRange(),n=this._getRowRange(),n=this._getRowLink(e,{path:[0],cost:0,length:0,currentNode:0},t,n);return null!==(n=null==n?void 0:n.path.map(function(e){return""+e}))&&void 0!==n?n:[]},n._getRowLink=function(e,t,n,i){var r=n[0],o=i[0],s=i[1],a=e.length,u=t.path,c=t.length,h=t.cost,l=t.currentNode;if(l<a&&(s<=c||a<l+r)){r=k(a-l,n)*Math.abs(this._getCost(e,l,a));return p(p({},t),{length:c+1,path:g(g([],u),[a]),currentNode:a,cost:h+r,isOver:!0})}return a<=l?p(p({},t),{currentNode:a,isOver:c<o||s<c}):this._searchRowLink(e,t,a,n,i)},n._searchRowLink=function(e,t,n,i,r){for(var o,s=i[0],a=i[1],u=t.currentNode,c=t.path,h=t.length,l=t.cost,f=Math.min(n,u+a),d=[],p=u+s;p<=f;++p)p!==u&&(o=Math.abs(this._getCost(e,u,p)),(o=this._getRowLink(e,{path:g(g([],c),[p]),length:h+1,cost:l+o,currentNode:p},i,r))&&d.push(o));return d.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}),d[0]},n._getExpectedRowSize=function(e){var t=this.options.gap,r=this.getContainerInlineSize()-t*(e.length-1),o=0,s=0;return e.forEach(function(e){var t,n=e.orgInlineSize,i=e.orgContentSize;n&&i?(t=parseFloat(e.gridData.inlineOffset)||0,e=parseFloat(e.gridData.contentOffset)||0,o+=i=i<=e?1:(n-t)/(i-e),s+=e*i,r-=t):o+=1}),o?(r+s)/o:0},n._getExpectedInlineSize=function(e,n){var t=this.options.gap,i=e.reduce(function(e,t){return e+me(t,n)},0);return i?i+t*(e.length-1):0},n._getCost=function(e,t,n){var i=e.slice(t,n),e=this._getExpectedRowSize(i),t=this._getSizeRange(),n=t[0],t=t[1];if(this.isCroppedSize){if(n<=e&&e<=t)return 0;i=this._getExpectedInlineSize(i,e<n?n:t);return Math.pow(i-this.getContainerInlineSize(),2)}if(isFinite(t)){if(e<n)return Math.pow(e-n,2)+Math.pow(t,2);if(t<e)return Math.pow(e-t,2)+Math.pow(t,2)}else if(e<n)return Math.max(Math.pow(n,2),Math.pow(e,2))+Math.pow(t,2);return e-n},n._getPath=function(o){var s=this,a=o.length,e=this.options.columnRange,e=x(e)?e:[e,e],u=e[0],c=e[1];return pe(function(e){for(var t={},n=parseInt(e,10),i=Math.min(n+u,a);i<=a&&!(c<i-n);++i){var r=s._getCost(o,n,i);r<0&&i===a&&(r=0),t[""+i]=Math.pow(r,2)}return t},"0",""+a)},n._setStyle=function(e,t,n,i){var s=this;void 0===n&&(n=[]);var r=this.options,a=r.gap,u=r.isCroppedSize,c=r.displayedRow,h=this._getSizeRange(),n=n[0]||0,l=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),f=n,d=0;if(t.forEach(function(i,e){var t=i.length,r=s._getExpectedRowSize(i);u&&(r=Math.max(h[0],Math.min(r,h[1])));var n=s._getExpectedInlineSize(i,r),t=a*(t-1),o=(l-t)/(n-t);i.forEach(function(e,t){var n=me(e,r),t=i[t-1],t=t?t.cssInlinePos+t.cssInlineSize+a:0;u&&(n*=o),e.setCSSGridRect({inlinePos:t,contentPos:f,inlineSize:n,contentSize:r})}),f+=a+r,(c<0||e<c)&&(d=f)}),i)return{start:[n],end:[d]};var o=f-n;return e.forEach(function(e){e.cssContentPos-=o}),{start:[n-o],end:[n]}},n.getComputedOutlineLength=function(){return 1},n.getComputedOutlineSize=function(){return this.getContainerInlineSize()},n._getRowRange=function(){var e=this.rowRange;return x(e)?e:[e,e]},n._getColumnRange=function(){var e=this.columnRange;return x(e)?e:[e,e]},n._getSizeRange=function(){var e=this.sizeRange;return x(e)?e:[e,e]},t.propertyTypes=p(p({},fe.propertyTypes),{columnRange:a.RENDER_PROPERTY,rowRange:a.RENDER_PROPERTY,sizeRange:a.RENDER_PROPERTY,isCroppedSize:a.RENDER_PROPERTY,displayedRow:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},fe.defaultOptions),{columnRange:[1,8],rowRange:0,sizeRange:[0,1/0],displayedRow:-1,isCroppedSize:!1}),o([I],t)}(fe);function Re(e){var t=-1/0;return e.forEach(function(e){isFinite(e)&&(t=Math.max(t,e))}),isFinite(t)?t:0}function ve(e,t,n){return Re(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=Re(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 ze(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 W=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=M(r).map(function(){return 1/0}),g=M(r).map(function(){return-1/0}),m=i.outline.map(function(e){return e*(l+u)}),R=0;R<f;R+=d)for(var v=ve(g,m,c),z=0;z<d&&R+z<f;++z){var S=e[R+z],y=s[z],E=y.contentPos,_=y.inlinePos,P=y.contentSize,C=y.inlineSize,b=v+E*(l+u),y=_*(h+u),E=P*(l+u)-u,P=C*(h+u)-u;ze(p,g,{inlinePos:_,inlineSize:C,contentPos:b,contentSize:E+u}),S.setCSSGridRect({inlinePos:y,contentPos:b,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=M(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}),T=t?ve(n,p,c):ve(g,n,c);return e.forEach(function(e){e.cssContentPos+=T}),{start:p.map(function(e){return e+T}),end:g.map(function(e){return e+T})}},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=M(n).map(function(){return 1/0}),s=M(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]||(ze(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({},fe.propertyTypes),{frame:a.RENDER_PROPERTY,useFrameFill:a.RENDER_PROPERTY,rectSize:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},fe.defaultOptions),{frame:[],rectSize:0,useFrameFill:!0}),o([I],t)}(fe),Se=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 ye(e,t){t=e/t;return(t=t<1?1/t:t)-1}var Ee,_e={__proto__:null,default:fe,GetterSetter:I,withGridMethods:N,withMethods:D,getMountedElements:T,getUpdatedItems:b,MasonryGrid:Y,JustifiedGrid:oe,FrameGrid:W,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 Se({});return e.forEach(function(e){e=new Se({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,v={inlineSize:0,contentSize:0},z={inlineSize:0,contentSize:0},S=this._getWeight("size"),y=this._getWeight("ratio");e.items.forEach(function(e){for(var t=ye(e.getOrgSizeWeight(),e.getSize())*S,n=ye(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=ye(p.getSize(),h)*S;h+=ye(p.getRatio(),l)*y,h+=ye(e.getOrgSizeWeight(),f)*S-t,(h+=ye(e.getOrgRatio(),d)*y-n)===Math.min(h,m)&&(m=h,g=e,R=0===o,v.inlineSize=s,v.contentSize=a,z.inlineSize=u,z.contentSize=c)}}),t=g,n=v,i=z,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({},fe.propertyTypes),{aspectRatio:a.RENDER_PROPERTY,sizeWeight:a.RENDER_PROPERTY,ratioWeight:a.RENDER_PROPERTY,weightPriority:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},fe.defaultOptions),{aspectRatio:1,sizeWeight:1,ratioWeight:1,weightPriority:"custom"}),o([I],t)}(fe),ItemRenderer:he,GridItem:le,ContainerManager:L,ResizeWatcher:A,DEFAULT_GRID_OPTIONS:R,get PROPERTY_TYPE(){return a},get MOUNT_STATE(){return f},get UPDATE_STATE(){return m},GRID_PROPERTY_TYPES:v,GRID_METHODS:e,GRID_EVENTS:["renderComplete","contentError"],RECT_NAMES:d};for(Ee in _e)fe[Ee]=_e[Ee];return fe});
!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 g(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,f,m,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,R={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};(Y=a=a||{})[Y.PROPERTY=1]="PROPERTY",Y[Y.RENDER_PROPERTY=2]="RENDER_PROPERTY",(W=f=f||{})[W.UNCHECKED=1]="UNCHECKED",W[W.UNMOUNTED=2]="UNMOUNTED",W[W.MOUNTED=3]="MOUNTED",(oe=m=m||{})[oe.NEED_UPDATE=1]="NEED_UPDATE",oe[oe.WAIT_LOADING=2]="WAIT_LOADING",oe[oe.UPDATED=3]="UPDATED";var v={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"}},z=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:z,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 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 T(e){return O(e).map(function(e){return e.element})}function w(e){return"string"==typeof e}function x(e){return"object"==typeof e}function I(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 D(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 M(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}var N=D(e),A=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=w(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){n.observe(e,{box:t})}))},t.unobserveChildren=function(e){var t=this._observer;t&&e.forEach(function(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}(),L=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:R.horizontal,autoResize:R.autoResize,resizeDebounce:R.resizeDebounce,maxResizeDebounce:R.maxResizeDebounce,useResizeObserver:R.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 A(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),U=function(e,t){return(U=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 j(e,t){function n(){this.constructor=e}U(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var F=function(){return(F=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 Y="undefined"!=typeof window,W=Y?window.navigator.userAgent:"",H=Y&&!!("getComputedStyle"in window),G=/MSIE|Trident|Windows Phone|Edge/.test(W),q=Y&&!!("addEventListener"in document),B="width",V="height";function K(e,t){return e.getAttribute(t)||""}function X(e){return[].slice.call(e)}function J(e,t){return void 0===t&&(t="data-"),"loading"in e&&"lazy"===e.getAttribute("loading")||!!e.getAttribute(t+"lazy")}function Q(e,t,n){q?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function Z(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function $(e,t){var n=e["client"+t]||e["offset"+t];return parseFloat(n||(e=e,((H?window.getComputedStyle(e):e.currentStyle)||{})[t.toLowerCase()]))||0}function ee(e,t,n){var i=X(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 X(e.querySelectorAll("["+n+"width], "+t.join(", "))).filter(function(e){return-1===i.indexOf(e)})}var te=[];function ne(e,t){te.length||Q(window,"resize",re),e.__PREFIX__=t,te.push(e),ie(e)}function ie(e,t){void 0===t&&(t="data-");var n,i=e.__PREFIX__||t,r=parseInt(K(e,""+i+B),10)||0,t=parseInt(K(e,""+i+V),10)||0;K(e,i+"fixed")===V?(n=$(e,"Height")||t,e.style[B]=r/t*n+"px"):(n=$(e,"Width")||r,e.style[V]=t/r*n+"px")}function re(){te.forEach(function(e){ie(e)})}var oe=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=F({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=J(e,i),n}j(e,r);var t=e.prototype;return t.check=function(){return this.isSkip||!this.checkElement()?(this.onAlreadyReady(!0),!1):(this.hasDataSize&&ne(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){Q(n,e,t.onCheck)})},t.clear=function(){var t=this,n=this.element;this.constructor.EVENTS.forEach(function(e){Z(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=te.indexOf(e))<0||(t=K(e,t+"fixed"),delete e.__PREFIX__,e.style[t===V?B:V]="",te.splice(n,1),te.length||Z(window,"resize",re)))},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),se=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}j(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?(ne(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}(oe),W=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=F({loaders:{},prefix:"data-"},e),t}j(e,n);var t=e.prototype;return t.check=function(e){var o=this,n=this.options.prefix;this.clear(),this.elementInfos=X(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 se(t,e),u=X(t.querySelectorAll(s.join(", ")));a.setHasLoading(u.some(function(e){return J(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=ee(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(F({},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),ae=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(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(),G&&e.setAttribute("src",t),!0},t.EVENTS=["load","error"],t}(oe),ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return j(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}(oe),ce=function(t){function e(e){return t.call(this,F({loaders:{img:ae,video:ue}},e=void 0===e?{}:e))||this}return j(e,t),e}(W),he=function(){function e(e){this.initialRect=null,this.sizePercetage=!1,this.posPercetage=!1,this.options=p({attributePrefix:R.attributePrefix,useTransform:R.useTransform,horizontal:R.horizontal,percentage:R.percentage,isEqualSize:R.isEqualSize,isConstantSize:R.isConstantSize,useRoundedSize:R.useRoundedSize},e),this._init()}var t=e.prototype;return t.resize=function(){this.initialRect=null},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.updateItems=function(e){var t=this;e.forEach(function(e){t._updateItem(e)})},t.getStatus=function(){return{initialRect:this.initialRect}},t.setStatus=function(e){this.initialRect=e.initialRect},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){var t=this.options,n=t.isEqualSize,i=t.isConstantSize,r=t.useRoundedSize,o=this.initialRect,s=e.orgRect,a=e.element,u=e.updateState===m.WAIT_LOADING,t=s&&s.width&&s.height;if(n&&o)c=o;else if(i&&t&&!u)c=s;else{if(!a)return;var c={left:a.offsetLeft,top:a.offsetTop,width:0,height:0};r?(c.width=a.offsetWidth,c.height=a.offsetHeight):(r=a.getBoundingClientRect(),c.width=r.width,c.height=r.height)}return e.isFirstUpdate&&t||(e.orgRect=p({},c)),e.rect=p({},c),e.element&&(e.mountState=f.MOUNTED),e.updateState===m.NEED_UPDATE&&(e.updateState=m.UPDATED,e.isFirstUpdate=!0),e.attributes=a?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}(a,this.options.attributePrefix):{},u||this.initialRect||(this.initialRect=p({},c)),c},t._renderItem=function(e){var n,i,t,r,o,s,a,u=e.element,c=e.cssRect;u&&c&&(a=(t=this.options).horizontal,e=t.useTransform,n=this.posPercetage,i=this.sizePercetage,t=["position: absolute;"],r=(a=d[a?"horizontal":"vertical"]).inlineSize,o=a.inlinePos,s=this.getInlineSize(),a=c,a=Object.keys(a),e&&(a=a.filter(function(e){return"top"!==e&&"left"!==e}),t.push("transform: translate("+(c.left||0)+"px, "+(c.top||0)+"px);")),t.push.apply(t,a.map(function(e){var t=c[e];return e===r&&i||e===o&&n?e+": "+t/s*100+"%;":e+": "+t+"px;"})),u.style.cssText+=t.join(""))},e}(),le=function(){function e(e,t){void 0===t&&(t={}),this.horizontal=e,this.isUpdate=!1,this.hasTransition=!1,this.transitionDuration="",this.isRestoreOrgCSSText=!0;var n,e=t.element,i=p({key:"",orgRect:{left:0,top:0,width:0,height:0},rect:{left:0,top:0,width:0,height:0},cssRect:{},attributes:{},data:{},isFirstUpdate:!1,mountState:f.UNCHECKED,updateState:m.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{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!==f.UNCHECKED&&(e.mountState=i),r!==m.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}(),fe=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._requestedUpdateItems=[],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=w(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 L(n.containerElement,{horizontal:a,resizeDebounce:l,maxResizeDebounce:f,autoResize:t,useResizeObserver:i}).on("resize",n._onResize),n.itemRenderer=h||new he({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){var t=this.options;return t.useResizeObserver&&t.observeChildren&&((t=this.containerManager).unobserveChildren(T(this.items)),t.observeChildren(T(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 le(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=m.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 le(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!==m.UPDATED}),t=e.filter(function(e){var t;return(null===(t=e.element)||void 0===t?void 0:t.parentNode)&&e.mountState!==f.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 ce({prefix:this.options.attributePrefix}).on("preReadyElement",function(e){r[e.index].updateState=m.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.itemRenderer.updateItems(r),i.readyItems(t,r,n)}).on("readyElement",function(e){var t=r[e.index];t.updateState=m.NEED_UPDATE,e.isPreReadyOver&&(t.isRestoreOrgCSSText&&(t.element.style.cssText=t.orgCSSText),i.itemRenderer.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;"number"==typeof 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:g([],o),end:g([],o)};e.forEach(function(e){e.mountState=f.MOUNTED}),t.forEach(function(e){e.isUpdate=!0}),s.length&&(i=this.applyGrid(this.items,r,o)),t.forEach(function(e){e.isUpdate=!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});n=this._requestedUpdateItems;n.length&&(this.updateItems(n),this._requestedUpdateItems=[])},t._isObserverEnabled=function(){return this.containerManager.isObserverEnabled()},t._requestUpdateSize=function(e){this._requestedUpdateItems.push(e)},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=R,e.propertyTypes=v,o([I],e)}(n);function de(e,t,n,i){return Math[i].apply(Math,e.slice(t,t+n))}Y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}r(t,e);var n=t.prototype;return n.applyGrid=function(R,e,t){R.forEach(function(e){e.isRestoreOrgCSSText=!1});for(var n,v=this.getComputedOutlineSize(R),z=this.getComputedOutlineLength(R),i=this.options,S=i.gap,r=i.align,y=i.observeChildren,E=i.columnSizeRatio,i=t.length,_=R.length,P=this._getAlignPoses(z,v),C="end"===e,b=C?"min":"max",O=C?"max":"min",e=[0],T=(e=i===z?t.slice():(n=i?Math[O].apply(Math,t):0,M(z).map(function(){return n}))).slice(),w=1<z?P[1]-P[0]:0,x="stretch"===r,o=function(e){for(var t,n,i,r,o=R[C?e:_-1-e],s=parseInt(o.attributes.column||"1",10),a=parseInt(o.attributes.maxColumn||"1",10),u=o.contentSize,c=Math.min(z,s||Math.max(1,Math.ceil((o.inlineSize+S)/w))),h=Math.min(z,Math.max(c,a)),l=(n=c,i=b,e=(t=T).length-n+1,r="max"===i?"min":"max",a="max"===i?"lastIndexOf":"indexOf",(e=M(e).map(function(e){return de(t,e,n,r)}))[a](Math[i].apply(Math,e))),f=de(T,l,c,O);c<h;){var d=l+c,p=l-1;if(C&&(z<=d||T[d]>f))break;if(!C&&(p<0||T[p])<f)break;C||--l,++c}l=Math.max(0,l),c=Math.min(z-l,c),(0<s&&1<c||x)&&(g=(c-1)*w+v,I._isObserverEnabled()&&y||o.cssInlineSize===g||I._requestUpdateSize(o),o.cssInlineSize=g),0<E&&(u=o.computedInlineSize/E,o.cssContentSize=u);var g=P[l],f=C?f:f-S-u;o.cssInlinePos=g,o.cssContentPos=f;var m=C?f+u+S:f;M(c).forEach(function(e){T[l+e]=m})},I=this,s=0;s<_;++s)o(s);return{start:C?e:T,end:C?T: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;if(l.updateState===m.UPDATED&&l.inlineSize&&!f.column&&!f.maxColumnCount){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=M(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({},fe.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}),t.defaultOptions=p(p({},fe.defaultOptions),{align:"justify",column:0,columnSize:0,columnSizeRatio:0,columnCalculationThreshold:.5,maxStretchColumnSize:1/0}),o([I],t)}(fe);function pe(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 ge(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 ge=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 me(e,t){var n=e.orgInlineSize,i=e.orgContentSize;if(!n||!i)return t;var r=parseFloat(e.gridData.inlineOffset)||0,e=parseFloat(e.gridData.contentOffset)||0;return(i<=e?1:(n-r)/(i-e))*(t-e)+r}oe=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.options,s=i.attributePrefix,a=i.horizontal;e.forEach(function(e){var t,n,i,r,o;e.isUpdate&&(t=e.element,r=e.attributes,n=e.gridData,i=parseFloat(r.inlineOffset)||n.inlineOffset||0,o=parseFloat(r.contentOffset)||0|n.contentOffset,!t||"inlineOffset"in r||"contentOffset"in r||e.mountState!==f.MOUNTED||(r=t.querySelector("["+s+"maintained-target]"))&&(e=t.offsetWidth-t.clientWidth+t.scrollWidth-r.clientWidth,r=t.offsetHeight-t.clientHeight+t.scrollHeight-r.clientHeight,o=a?(i=r,e):(i=e,r)),n.inlineOffset=i,n.contentOffset=o)});var r=this.options.rowRange,i=[];return e.length&&(i=r?this._getRowPath(e):this._getPath(e)),this._setStyle(e,i,n,"end"===t)},n._getRowPath=function(e){var t=this._getColumnRange(),n=this._getRowRange(),n=this._getRowLink(e,{path:[0],cost:0,length:0,currentNode:0},t,n);return null!==(n=null==n?void 0:n.path.map(function(e){return""+e}))&&void 0!==n?n:[]},n._getRowLink=function(e,t,n,i){var r=n[0],o=i[0],s=i[1],a=e.length,u=t.path,c=t.length,h=t.cost,l=t.currentNode;if(l<a&&(s<=c||a<l+r)){r=k(a-l,n)*Math.abs(this._getCost(e,l,a));return p(p({},t),{length:c+1,path:g(g([],u),[a]),currentNode:a,cost:h+r,isOver:!0})}return a<=l?p(p({},t),{currentNode:a,isOver:c<o||s<c}):this._searchRowLink(e,t,a,n,i)},n._searchRowLink=function(e,t,n,i,r){for(var o,s=i[0],a=i[1],u=t.currentNode,c=t.path,h=t.length,l=t.cost,f=Math.min(n,u+a),d=[],p=u+s;p<=f;++p)p!==u&&(o=Math.abs(this._getCost(e,u,p)),(o=this._getRowLink(e,{path:g(g([],c),[p]),length:h+1,cost:l+o,currentNode:p},i,r))&&d.push(o));return d.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}),d[0]},n._getExpectedRowSize=function(e){var t=this.options.gap,r=this.getContainerInlineSize()-t*(e.length-1),o=0,s=0;return e.forEach(function(e){var t,n=e.orgInlineSize,i=e.orgContentSize;n&&i?(t=parseFloat(e.gridData.inlineOffset)||0,e=parseFloat(e.gridData.contentOffset)||0,o+=i=i<=e?1:(n-t)/(i-e),s+=e*i,r-=t):o+=1}),o?(r+s)/o:0},n._getExpectedInlineSize=function(e,n){var t=this.options.gap,i=e.reduce(function(e,t){return e+me(t,n)},0);return i?i+t*(e.length-1):0},n._getCost=function(e,t,n){var i=e.slice(t,n),e=this._getExpectedRowSize(i),t=this._getSizeRange(),n=t[0],t=t[1];if(this.isCroppedSize){if(n<=e&&e<=t)return 0;i=this._getExpectedInlineSize(i,e<n?n:t);return Math.pow(i-this.getContainerInlineSize(),2)}if(isFinite(t)){if(e<n)return Math.pow(e-n,2)+Math.pow(t,2);if(t<e)return Math.pow(e-t,2)+Math.pow(t,2)}else if(e<n)return Math.max(Math.pow(n,2),Math.pow(e,2))+Math.pow(t,2);return e-n},n._getPath=function(o){var s=this,a=o.length,e=this.options.columnRange,e=x(e)?e:[e,e],u=e[0],c=e[1];return pe(function(e){for(var t={},n=parseInt(e,10),i=Math.min(n+u,a);i<=a&&!(c<i-n);++i){var r=s._getCost(o,n,i);r<0&&i===a&&(r=0),t[""+i]=Math.pow(r,2)}return t},"0",""+a)},n._setStyle=function(e,t,n,i){var s=this;void 0===n&&(n=[]);var r=this.options,a=r.gap,u=r.isCroppedSize,c=r.displayedRow,h=this._getSizeRange(),n=n[0]||0,l=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),f=n,d=0;if(t.forEach(function(i,e){var t=i.length,r=s._getExpectedRowSize(i);u&&(r=Math.max(h[0],Math.min(r,h[1])));var n=s._getExpectedInlineSize(i,r),t=a*(t-1),o=(l-t)/(n-t);i.forEach(function(e,t){var n=me(e,r),t=i[t-1],t=t?t.cssInlinePos+t.cssInlineSize+a:0;u&&(n*=o),e.setCSSGridRect({inlinePos:t,contentPos:f,inlineSize:n,contentSize:r})}),f+=a+r,(c<0||e<c)&&(d=f)}),i)return{start:[n],end:[d]};var o=f-n;return e.forEach(function(e){e.cssContentPos-=o}),{start:[n-o],end:[n]}},n.getComputedOutlineLength=function(){return 1},n.getComputedOutlineSize=function(){return this.getContainerInlineSize()},n._getRowRange=function(){var e=this.rowRange;return x(e)?e:[e,e]},n._getColumnRange=function(){var e=this.columnRange;return x(e)?e:[e,e]},n._getSizeRange=function(){var e=this.sizeRange;return x(e)?e:[e,e]},t.propertyTypes=p(p({},fe.propertyTypes),{columnRange:a.RENDER_PROPERTY,rowRange:a.RENDER_PROPERTY,sizeRange:a.RENDER_PROPERTY,isCroppedSize:a.RENDER_PROPERTY,displayedRow:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},fe.defaultOptions),{columnRange:[1,8],rowRange:0,sizeRange:[0,1/0],displayedRow:-1,isCroppedSize:!1}),o([I],t)}(fe);function Re(e){var t=-1/0;return e.forEach(function(e){isFinite(e)&&(t=Math.max(t,e))}),isFinite(t)?t:0}function ve(e,t,n){return Re(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=Re(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 ze(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 W=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=M(r).map(function(){return 1/0}),g=M(r).map(function(){return-1/0}),m=i.outline.map(function(e){return e*(l+u)}),R=0;R<f;R+=d)for(var v=ve(g,m,c),z=0;z<d&&R+z<f;++z){var S=e[R+z],y=s[z],E=y.contentPos,_=y.inlinePos,P=y.contentSize,C=y.inlineSize,b=v+E*(l+u),y=_*(h+u),E=P*(l+u)-u,P=C*(h+u)-u;ze(p,g,{inlinePos:_,inlineSize:C,contentPos:b,contentSize:E+u}),S.setCSSGridRect({inlinePos:y,contentPos:b,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=M(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}),T=t?ve(n,p,c):ve(g,n,c);return e.forEach(function(e){e.cssContentPos+=T}),{start:p.map(function(e){return e+T}),end:g.map(function(e){return e+T})}},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=M(n).map(function(){return 1/0}),s=M(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]||(ze(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({},fe.propertyTypes),{frame:a.RENDER_PROPERTY,useFrameFill:a.RENDER_PROPERTY,rectSize:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},fe.defaultOptions),{frame:[],rectSize:0,useFrameFill:!0}),o([I],t)}(fe),Se=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 ye(e,t){t=e/t;return(t=t<1?1/t:t)-1}var Ee,_e={__proto__:null,default:fe,GetterSetter:I,withGridMethods:N,withMethods:D,getMountedElements:T,getUpdatedItems:b,MasonryGrid:Y,JustifiedGrid:oe,FrameGrid:W,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 Se({});return e.forEach(function(e){e=new Se({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,v={inlineSize:0,contentSize:0},z={inlineSize:0,contentSize:0},S=this._getWeight("size"),y=this._getWeight("ratio");e.items.forEach(function(e){for(var t=ye(e.getOrgSizeWeight(),e.getSize())*S,n=ye(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=ye(p.getSize(),h)*S;h+=ye(p.getRatio(),l)*y,h+=ye(e.getOrgSizeWeight(),f)*S-t,(h+=ye(e.getOrgRatio(),d)*y-n)===Math.min(h,m)&&(m=h,g=e,R=0===o,v.inlineSize=s,v.contentSize=a,z.inlineSize=u,z.contentSize=c)}}),t=g,n=v,i=z,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({},fe.propertyTypes),{aspectRatio:a.RENDER_PROPERTY,sizeWeight:a.RENDER_PROPERTY,ratioWeight:a.RENDER_PROPERTY,weightPriority:a.RENDER_PROPERTY}),t.defaultOptions=p(p({},fe.defaultOptions),{aspectRatio:1,sizeWeight:1,ratioWeight:1,weightPriority:"custom"}),o([I],t)}(fe),ItemRenderer:he,GridItem:le,ContainerManager:L,ResizeWatcher:A,DEFAULT_GRID_OPTIONS:R,get PROPERTY_TYPE(){return a},get MOUNT_STATE(){return f},get UPDATE_STATE(){return m},GRID_PROPERTY_TYPES:v,GRID_METHODS:e,GRID_EVENTS:["renderComplete","contentError"],RECT_NAMES:d};for(Ee in _e)fe[Ee]=_e[Ee];return fe});
//# sourceMappingURL=grid.min.js.map
{
"name": "@egjs/grid",
"version": "1.12.0-beta.1",
"version": "1.12.0-beta.2",
"description": "A component that can arrange items according to the type of grids",

@@ -82,3 +82,3 @@ "main": "dist/grid.cjs.js",

"@codeceptjs/ui": "^0.4.3",
"@daybrush/jsdoc": "^0.3.9",
"@daybrush/jsdoc": "^0.4.4",
"@egjs/build-helper": "^0.1.2",

@@ -85,0 +85,0 @@ "@egjs/release-helper": "0.0.3",

@@ -6,3 +6,3 @@ <p align="middle" ><img src="https://naver.github.io/egjs-grid/images/logo.png" /></p>

<img src="https://img.shields.io/badge/language-typescript-blue.svg?style=flat-square" />&nbsp;
<a href="https://github.com/naver/egjs-grid/actions" target="_blank"><img alt="Github actions" src="https://img.shields.io/github/workflow/status/naver/egjs-grid/Run%20tests?style=flat-square" /></a>&nbsp;
<a href="https://github.com/naver/egjs-grid/actions" target="_blank"><img alt="Github actions" src="https://img.shields.io/github/actions/workflow/status/naver/egjs-grid/run-e2e.yml?branch=main&style=flat-square" /></a>&nbsp;
<a href="https://coveralls.io/github/naver/egjs-grid?branch=main&style=flat-square" target="_blank"><img alt="Coveralls github" src="https://img.shields.io/coveralls/github/naver/egjs-grid.svg?style=flat-square&label=%E2%9C%85%20coverage" /></a>&nbsp;

@@ -9,0 +9,0 @@ <a href="https://github.com/naver/egjs-grid/blob/main/LICENSE" target="_blank"><img src="https://img.shields.io/static/v1?style=flat-square&label=license&message=MIT&color=08CE5D" /></a>&nbsp;

@@ -28,3 +28,3 @@ /**

protected orgCSSText: string;
private _watcher: ResizeWatcher;
protected _watcher!: ResizeWatcher;

@@ -52,2 +52,5 @@ constructor(protected container: HTMLElement, options: ContainerManagerOptions) {

}
public isObserverEnabled() {
return this._watcher.isObserverEnabled();
}
public getRect() {

@@ -54,0 +57,0 @@ return this._watcher.getRect();

@@ -360,3 +360,3 @@ /**

if (!hasOrgSize && hasCSSSize && item.isRestoreOrgCSSText) {
if (!hasOrgSize && hasCSSSize) {
item.element!.style.cssText = item.orgCSSText;

@@ -371,3 +371,2 @@ }

item.updateState = UPDATE_STATE.NEED_UPDATE;
// after preReady

@@ -474,6 +473,4 @@ if (e.isPreReadyOver) {

element.style.transitionDuration = item.transitionDuration;
item.hasTransition = false;
});
}
this._renderComplete({

@@ -493,2 +490,5 @@ direction,

}
protected _isObserverEnabled() {
return this.containerManager.isObserverEnabled();
}
protected _requestUpdateSize(item: GridItem) {

@@ -495,0 +495,0 @@ this._requestedUpdateItems.push(item);

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

public isRestoreOrgCSSText = true;
/**

@@ -51,0 +52,0 @@ * @constructor

@@ -98,10 +98,21 @@ /**

* @extends Grid.GridOptions
* @property - The shape of the grid. You can set the shape and order of items with a 2d array ([contentPos][inlinePos]). You can place items as many times as you fill the array with numbers, and zeros and spaces are empty spaces. The order of the items is arranged in ascending order of the numeric values that fill the array. (default: [])
* <ko>Grid의 모양. 2d 배열([contentPos][inlinePos])로 아이템의 모양과 순서를 설정할 수 있다. 숫자로 배열을 채운만큼 아이템을 배치할 수 있으며 0과 공백은 빈 공간이다. 아이템들의 순서는 배열을 채운 숫자값의 오름차순대로 배치가 된다. (default: [])</ko>
* @property - Make sure that the frame can be attached after the previous frame. (default: true) <ko> 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다.</ko>
* @property - 1x1 rect size. If it is 0, it is determined by the number of columns in the frame. (default: 0) <ko>1x1 직사각형 크기. 0이면 frame의 column의 개수에 의해 결정된다. (default: 0)</ko>
*/
export interface FrameGridOptions extends GridOptions {
/**
* The shape of the grid. You can set the shape and order of items with a 2d array ([contentPos][inlinePos]). You can place items as many times as you fill the array with numbers, and zeros and spaces are empty spaces. The order of the items is arranged in ascending order of the numeric values that fill the array.
* <ko>Grid의 모양. 2d 배열([contentPos][inlinePos])로 아이템의 모양과 순서를 설정할 수 있다. 숫자로 배열을 채운만큼 아이템을 배치할 수 있으며 0과 공백은 빈 공간이다. 아이템들의 순서는 배열을 채운 숫자값의 오름차순대로 배치가 된다. (default: [])</ko>
* @default []
*/
frame?: number[][];
/**
* Make sure that the frame can be attached after the previous frame.
* <ko> 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다.</ko>
* @default true
*/
useFrameFill?: boolean;
/**
* 1x1 rect size. If it is 0, it is determined by the number of columns in the frame.
* <ko>1x1 직사각형 크기. 0이면 frame의 column의 개수에 의해 결정된다.</ko>
* @default 0
*/
rectSize?: number | { inlineSize: number, contentSize: number };

@@ -108,0 +119,0 @@ }

@@ -52,13 +52,33 @@ /**

* @extends Grid.GridOptions
* @property - The minimum and maximum number of items per line. (default: [1, 8]) <ko> 한 줄에 들어가는 아이템의 최소, 최대 개수. (default: [1, 8]) </ko>
* @property - The minimum and maximum number of rows in a group, 0 is not set. (default: 0) <ko> 한 그룹에 들어가는 행의 최소, 최대 개수, 0은 미설정이다. (default: 0) </ko>
* @property - The minimum and maximum size by which the item is adjusted. If it is not calculated, it may deviate from the minimum and maximum sizes. (default: [0, Infinity]) <ko>아이템이 조정되는 최소, 최대 사이즈. 계산이 되지 않는 경우 최소, 최대 사이즈를 벗어날 수 있다. (default: [0, Infinity])</ko>
* @property - 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. (default: -1)<ko>컨테이너 크기에 계산될 최대 row 개수. overflow: hidden을 설정하면 화면에 가릴 수 있다. -1은 미설정이다. (default: -1)</ko>
* @property - Whether to crop when the row size is out of sizeRange. If set to true, this ratio can be broken. (default: false) <ko>row사이즈가 sizeRange에 벗어나면 크롭할지 여부. true로 설정하면 비율이 깨질 수 있다. (default: false)</ko>
*/
export interface JustifiedGridOptions extends GridOptions {
/**
* The minimum and maximum number of items per line.
* <ko> 한 줄에 들어가는 아이템의 최소, 최대 개수.</ko>
* @default [1, 8]
*/
columnRange?: number | number[];
/**
* The minimum and maximum number of rows in a group, 0 is not set.
* <ko> 한 그룹에 들어가는 행의 최소, 최대 개수, 0은 미설정이다.</ko>
* @default 0
*/
rowRange?: number | number[];
/**
* The minimum and maximum size by which the item is adjusted. If it is not calculated, it may deviate from the minimum and maximum sizes.
* <ko>아이템이 조정되는 최소, 최대 사이즈. 계산이 되지 않는 경우 최소, 최대 사이즈를 벗어날 수 있다.</ko>
* @default [0, Infinity]
*/
sizeRange?: number | number[];
/**
* 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.
* <ko>컨테이너 크기에 계산될 최대 row 개수. overflow: hidden을 설정하면 화면에 가릴 수 있다. -1은 미설정이다.</ko>
* @default -1
*/
displayedRow?: number;
/**
* Whether to crop when the row size is out of sizeRange. If set to true, this ratio can be broken.
* <ko>row사이즈가 sizeRange에 벗어나면 크롭할지 여부. true로 설정하면 비율이 깨질 수 있다.</ko>
* @default false
*/
isCroppedSize?: boolean;

@@ -65,0 +85,0 @@ }

@@ -37,15 +37,39 @@ /**

* @extends Grid.GridOptions
* @property - The number of columns. If the number of columns is 0, it is automatically calculated according to the size of the container. Can be used instead of outlineLength. (default: 0)<ko>열의 개수. 열의 개수가 0이라면, 컨테이너의 사이즈에 의해 계산이 된다. outlineLength 대신 사용할 수 있다.(default: 0) </ko>
* @property - The size of the columns. If it is 0, it is calculated as the size of the first item in items. Can be used instead of outlineSize. (default: 0) <ko> 열의 사이즈. 만약 열의 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. outlineSize 대신 사용할 수 있다.(default: 0) </ko>
* @property - The size ratio(inlineSize / contentSize) of the columns. 0 is not set. (default: 0) <ko>열의 사이즈 비율(inlineSize / contentSize). 0은 미설정이다. </ko>
* @property - Align of the position of the items. If you want to use `stretch`, be sure to set `column`, `columnSize` or `maxStretchColumnSize` option. ("start", "center", "end", "justify", "stretch") (default: "justify") <ko>아이템들의 위치의 정렬. `stretch`를 사용하고 싶다면 `column`, `columnSize` 또는 `maxStretchColumnSize` 옵션을 설정해라. ("start", "center", "end", "justify", "stretch") (default: "justify")</ko>
* @property - Difference Threshold for Counting Columns. Since offsetSize is calculated by rounding, the number of columns may not be accurate. (default: 1) <ko>칼럼 개수를 계산하기 위한 차이 임계값. offset 사이즈는 반올림으로 게산하기 때문에 정확하지 않을 수 있다. (default: 1)</ko>
* @property - If stretch is used, the column can be automatically calculated by setting the maximum size of the column that can be stretched. (default: Infinity) <ko>stretch를 사용한 경우 최대로 늘릴 수 있는 column의 사이즈를 설정하여 column을 자동 계산할 수 있다. (default: Infinity)</ko>
*/
export interface MasonryGridOptions extends GridOptions {
/**
* The number of columns. If the number of columns is 0, it is automatically calculated according to the size of the container. Can be used instead of outlineLength.
* <ko>열의 개수. 열의 개수가 0이라면, 컨테이너의 사이즈에 의해 계산이 된다. outlineLength 대신 사용할 수 있다.</ko>
* @default 0
*/
column?: number;
/**
* The size of the columns. If it is 0, it is calculated as the size of the first item in items. Can be used instead of outlineSize.
* <ko>열의 사이즈. 만약 열의 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. outlineSize 대신 사용할 수 있다.</ko>
* @default 0
*/
columnSize?: number;
/**
* The size ratio(inlineSize / contentSize) of the columns. 0 is not set.
* <ko>열의 사이즈 비율(inlineSize / contentSize). 0은 미설정이다.</ko>
* @default 0
*/
columnSizeRatio?: number;
/**
* Align of the position of the items. If you want to use `stretch`, be sure to set `column`, `columnSize` or `maxStretchColumnSize` option. ("start", "center", "end", "justify", "stretch")
* <ko>아이템들의 위치의 정렬. `stretch`를 사용하고 싶다면 `column`, `columnSize` 또는 `maxStretchColumnSize` 옵션을 설정해라. ("start", "center", "end", "justify", "stretch")</ko>
* @default "justify"
*/
align?: GridAlign;
/**
* Difference Threshold for Counting Columns. Since offsetSize is calculated by rounding, the number of columns may not be accurate.
* <ko>칼럼 개수를 계산하기 위한 차이 임계값. offset 사이즈는 반올림으로 게산하기 때문에 정확하지 않을 수 있다.</ko>
* @default 1
*/
columnCalculationThreshold?: number;
/**
* If stretch is used, the column can be automatically calculated by setting the maximum size of the column that can be stretched.
* <ko>stretch를 사용한 경우 최대로 늘릴 수 있는 column의 사이즈를 설정하여 column을 자동 계산할 수 있다.</ko>
* @default Infinity
*/
maxStretchColumnSize?: number;

@@ -92,4 +116,4 @@ }

align,
observeChildren,
columnSizeRatio,
useResizeObserver,
} = this.options;

@@ -151,3 +175,3 @@ const outlineLength = outline.length;

if (!useResizeObserver && item.cssInlineSize !== nextInlineSize) {
if ((!this._isObserverEnabled() || !observeChildren) && item.cssInlineSize !== nextInlineSize) {
this._requestUpdateSize(item);

@@ -154,0 +178,0 @@ }

@@ -49,13 +49,28 @@ /**

* @extends Grid.GridOptions
* @property - The aspect ratio (inlineSize / contentSize) of the container with items. (default: 1) <ko>아이템들을 가진 컨테이너의 종횡비(inlineSize / contentSize). (default: 1)</ko>
* @property - The size weight when placing items. (default: 1)<ko>아이템들을 배치하는데 사이즈 가중치. (default: 1)</ko>
* @property - The weight to keep ratio when placing items. (default: 1)<ko>아이템들을 배치하는데 비율을 유지하는 가중치. (default: 1)</ko>
* @property - The priority that determines the weight of the item. (default: "custom"), "size" = (sizeWieght: 100, ratioWeight: 1), "ratio" = (sizeWeight: 1, ratioWeight; 100), "custom" = (set sizeWeight, ratioWeight)
* item's weight = item's ratio(inlineSize / contentSize) change * `ratioWeight` + size(inlineSize * contentSize) change * `sizeWeight`.
* <ko> 아이템의 가중치를 결정하는 우선수치. (default: "custom"), "size" = (sizeWieght: 100, ratioWeight: 1), "ratio" = (sizeWeight: 1, ratioWeight; 100), "custom" = (set sizeWeight, ratioWeight). 아이템의 가중치 = ratio(inlineSize / contentSize)의 변화량 * `ratioWeight` + size(inlineSize * contentSize)의 변화량 * `sizeWeight`.</ko>
*/
export interface PackingGridOptions extends GridOptions {
/**
* The aspect ratio (inlineSize / contentSize) of the container with items.
* <ko>아이템들을 가진 컨테이너의 종횡비(inlineSize / contentSize).</ko>
* @default 1
*/
aspectRatio?: number;
/**
* The size weight when placing items.
* <ko>아이템들을 배치하는데 사이즈 가중치.</ko>
* @default 1
*/
sizeWeight?: number;
/**
* The weight to keep ratio when placing items.
* <ko>아이템들을 배치하는데 비율을 유지하는 가중치.</ko>
* @default 1
*/
ratioWeight?: number;
/**
* The priority that determines the weight of the item. "size" = (sizeWieght: 100, ratioWeight: 1), "ratio" = (sizeWeight: 1, ratioWeight; 100), "custom" = (set sizeWeight, ratioWeight)
* item's weight = item's ratio(inlineSize / contentSize) change * `ratioWeight` + size(inlineSize * contentSize) change * `sizeWeight`.
* <ko> 아이템의 가중치를 결정하는 우선수치. "size" = (sizeWieght: 100, ratioWeight: 1), "ratio" = (sizeWeight: 1, ratioWeight; 100), "custom" = (set sizeWeight, ratioWeight). 아이템의 가중치 = ratio(inlineSize / contentSize)의 변화량 * `ratioWeight` + size(inlineSize * contentSize)의 변화량 * `sizeWeight`.</ko>
* @default "custom"
*/
weightPriority?: "size" | "ratio" | "custom";

@@ -62,0 +77,0 @@ }

@@ -56,2 +56,5 @@ import Component from "@egjs/component";

}
public isObserverEnabled() {
return !!this._observer;
}
public resize() {

@@ -58,0 +61,0 @@ const container = this.container;

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc