{"version":3,"file":"infinitegrid.squarelayout.js","sources":["../node_modules/@egjs/component/dist/component.esm.js","../node_modules/@egjs/list-differ/dist/list-differ.esm.js","../src/browser.ts","../src/consts.ts","../src/utils.ts","../src/ItemManager.ts","../src/DOMRenderer.ts","../src/Infinite.ts","../node_modules/@egjs/imready/dist/imready.esm.js","../src/RenderManager.ts","../src/Watcher.ts","../src/InfiniteGrid.ts","../src/layouts/FrameLayout.ts","../src/layouts/SquareLayout.ts","../src/index.squarelayout.ts"],"sourcesContent":["/*\nCopyright (c) NAVER Corp.\nname: @egjs/component\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-component\nversion: 2.2.2\n*/\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\nfunction __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator,\n m = s && o[s],\n i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\n/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\n\nfunction isUndefined(value) {\n return typeof value === \"undefined\";\n}\n/**\n * A class used to manage events in a component\n * @ko 컴포넌트의 이벤트을 관리할 수 있게 하는 클래스\n * @alias eg.Component\n */\n\n\nvar Component =\n/*#__PURE__*/\nfunction () {\n /**\n * @support {\"ie\": \"7+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n */\n function Component() {\n /**\n * @deprecated\n * @private\n */\n this.options = {};\n this._eventHandler = {};\n }\n /**\n * Triggers a custom event.\n * @ko 커스텀 이벤트를 발생시킨다\n * @param {string} eventName The name of the custom event to be triggered 발생할 커스텀 이벤트의 이름\n * @param {object} customEvent Event data to be sent when triggering a custom event 커스텀 이벤트가 발생할 때 전달할 데이터\n * @param {any[]} restParam Additional parameters when triggering a custom event 커스텀 이벤트가 발생할 때 필요시 추가적으로 전달할 데이터\n * @return Indicates whether the event has occurred. If the stop() method is called by a custom event handler, it will return false and prevent the event from occurring. Ref 이벤트 발생 여부. 커스텀 이벤트 핸들러에서 stop() 메서드를 호출하면 'false'를 반환하고 이벤트 발생을 중단한다. 참고\n * @example\n * ```\n * class Some extends eg.Component {\n * some(){\n * if(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n * this.trigger(\"hi\");// fire hi event.\n * }\n * }\n * }\n *\n * const some = new Some();\n * some.on(\"beforeHi\", (e) => {\n * if(condition){\n * e.stop(); // When event call to stop, `hi` event not call.\n * }\n * });\n * some.on(\"hi\", (e) => {\n * // `currentTarget` is component instance.\n * console.log(some === e.currentTarget); // true\n * });\n * // If you want to more know event design. You can see article.\n * // https://github.com/naver/egjs-component/wiki/How-to-make-Component-event-design%3F\n * ```\n */\n\n\n var __proto = Component.prototype;\n\n __proto.trigger = function (eventName) {\n var _this = this;\n\n var params = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n params[_i - 1] = arguments[_i];\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n }\n\n var customEvent = params[0] || {};\n var restParams = params.slice(1); // If detach method call in handler in first time then handler list calls.\n\n handlerList = handlerList.concat();\n var isCanceled = false; // This should be done like this to pass previous tests\n\n customEvent.eventType = eventName;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n var arg = [customEvent];\n\n if (restParams.length >= 1) {\n arg = arg.concat(restParams);\n }\n\n handlerList.forEach(function (handler) {\n handler.apply(_this, arg);\n });\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {string} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n * ```\n * class Some extends eg.Component {\n * hi() {\n * alert(\"hi\");\n * }\n * thing() {\n * this.once(\"hi\", this.hi);\n * }\n *\n * var some = new Some();\n * some.thing();\n * some.trigger(\"hi\");\n * // fire alert(\"hi\");\n * some.trigger(\"hi\");\n * // Nothing happens\n * ```\n */\n\n\n __proto.once = function (eventName, handlerToAttach) {\n var _this = this;\n\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n\n for (var key in eventHash) {\n this.once(key, eventHash[key]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var listener_1 = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n handlerToAttach.apply(_this, args);\n\n _this.off(eventName, listener_1);\n };\n\n this.on(eventName, listener_1);\n }\n\n return this;\n };\n /**\n * Checks whether an event has been attached to a component.\n * @ko 컴포넌트에 이벤트가 등록됐는지 확인한다.\n * @param {string} eventName The name of the event to be attached 등록 여부를 확인할 이벤트의 이름\n * @return {boolean} Indicates whether the event is attached. 이벤트 등록 여부\n * @example\n * ```\n * class Some extends eg.Component {\n * some() {\n * this.hasOn(\"hi\");// check hi event.\n * }\n * }\n * ```\n */\n\n\n __proto.hasOn = function (eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {string} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\n * ```\n * class Some extends eg.Component {\n * hi() {\n * console.log(\"hi\");\n * }\n * some() {\n * this.on(\"hi\",this.hi); //attach event\n * }\n * }\n * ```\n */\n\n\n __proto.on = function (eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n\n for (var name in eventHash) {\n this.on(name, eventHash[name]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var handlerList = this._eventHandler[eventName];\n\n if (isUndefined(handlerList)) {\n this._eventHandler[eventName] = [];\n handlerList = this._eventHandler[eventName];\n }\n\n handlerList.push(handlerToAttach);\n }\n\n return this;\n };\n /**\n * Detaches an event from the component.\n * @ko 컴포넌트에 등록된 이벤트를 해제한다\n * @param {string} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\n * ```\n * class Some extends eg.Component {\n * hi() {\n * console.log(\"hi\");\n * }\n * some() {\n * this.off(\"hi\",this.hi); //detach event\n * }\n * }\n * ```\n */\n\n\n __proto.off = function (eventName, handlerToDetach) {\n var e_1, _a; // Detach all event handlers.\n\n\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // Detach all handlers for eventname or detach event handlers by object.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n delete this._eventHandler[eventName];\n return this;\n } else {\n var eventHash = eventName;\n\n for (var name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // Detach single event handler\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var idx = 0;\n\n try {\n for (var handlerList_1 = __values(handlerList), handlerList_1_1 = handlerList_1.next(); !handlerList_1_1.done; handlerList_1_1 = handlerList_1.next()) {\n var handlerFunction = handlerList_1_1.value;\n\n if (handlerFunction === handlerToDetach) {\n handlerList.splice(idx, 1);\n break;\n }\n\n idx++;\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (handlerList_1_1 && !handlerList_1_1.done && (_a = handlerList_1.return)) _a.call(handlerList_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n }\n\n return this;\n };\n /**\n * Version info string\n * @ko 버전정보 문자열\n * @name VERSION\n * @static\n * @example\n * eg.Component.VERSION; // ex) 2.0.0\n * @memberof eg.Component\n */\n\n\n Component.VERSION = \"2.2.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","/*\nCopyright (c) 2019-present NAVER Corp.\nname: @egjs/list-differ\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-list-differ\nversion: 1.0.0\n*/\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar PolyMap =\n/*#__PURE__*/\nfunction () {\n function PolyMap() {\n this.keys = [];\n this.values = [];\n }\n\n var __proto = PolyMap.prototype;\n\n __proto.get = function (key) {\n return this.values[this.keys.indexOf(key)];\n };\n\n __proto.set = function (key, value) {\n var keys = this.keys;\n var values = this.values;\n var prevIndex = keys.indexOf(key);\n var index = prevIndex === -1 ? keys.length : prevIndex;\n keys[index] = key;\n values[index] = value;\n };\n\n return PolyMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar HashMap =\n/*#__PURE__*/\nfunction () {\n function HashMap() {\n this.object = {};\n }\n\n var __proto = HashMap.prototype;\n\n __proto.get = function (key) {\n return this.object[key];\n };\n\n __proto.set = function (key, value) {\n this.object[key] = value;\n };\n\n return HashMap;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar SUPPORT_MAP = typeof Map === \"function\";\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\nvar Link =\n/*#__PURE__*/\nfunction () {\n function Link() {}\n\n var __proto = Link.prototype;\n\n __proto.connect = function (prevLink, nextLink) {\n this.prev = prevLink;\n this.next = nextLink;\n prevLink && (prevLink.next = this);\n nextLink && (nextLink.prev = this);\n };\n\n __proto.disconnect = function () {\n // In double linked list, diconnect the interconnected relationship.\n var prevLink = this.prev;\n var nextLink = this.next;\n prevLink && (prevLink.next = nextLink);\n nextLink && (nextLink.prev = prevLink);\n };\n\n __proto.getIndex = function () {\n var link = this;\n var index = -1;\n\n while (link) {\n link = link.prev;\n ++index;\n }\n\n return index;\n };\n\n return Link;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nfunction orderChanged(changed, fixed) {\n // It is roughly in the order of these examples.\n // 4, 6, 0, 2, 1, 3, 5, 7\n var fromLinks = []; // 0, 1, 2, 3, 4, 5, 6, 7\n\n var toLinks = [];\n changed.forEach(function (_a) {\n var from = _a[0],\n to = _a[1];\n var link = new Link();\n fromLinks[from] = link;\n toLinks[to] = link;\n }); // `fromLinks` are connected to each other by double linked list.\n\n fromLinks.forEach(function (link, i) {\n link.connect(fromLinks[i - 1]);\n });\n return changed.filter(function (_, i) {\n return !fixed[i];\n }).map(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n\n if (from === to) {\n return [0, 0];\n }\n\n var fromLink = fromLinks[from];\n var toLink = toLinks[to - 1];\n var fromIndex = fromLink.getIndex(); // Disconnect the link connected to `fromLink`.\n\n fromLink.disconnect(); // Connect `fromLink` to the right of `toLink`.\n\n if (!toLink) {\n fromLink.connect(undefined, fromLinks[0]);\n } else {\n fromLink.connect(toLink, toLink.next);\n }\n\n var toIndex = fromLink.getIndex();\n return [fromIndex, toIndex];\n });\n}\n\nvar Result =\n/*#__PURE__*/\nfunction () {\n function Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed) {\n this.prevList = prevList;\n this.list = list;\n this.added = added;\n this.removed = removed;\n this.changed = changed;\n this.maintained = maintained;\n this.changedBeforeAdded = changedBeforeAdded;\n this.fixed = fixed;\n }\n\n var __proto = Result.prototype;\n Object.defineProperty(__proto, \"ordered\", {\n get: function () {\n if (!this.cacheOrdered) {\n this.caculateOrdered();\n }\n\n return this.cacheOrdered;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(__proto, \"pureChanged\", {\n get: function () {\n if (!this.cachePureChanged) {\n this.caculateOrdered();\n }\n\n return this.cachePureChanged;\n },\n enumerable: true,\n configurable: true\n });\n\n __proto.caculateOrdered = function () {\n var ordered = orderChanged(this.changedBeforeAdded, this.fixed);\n var changed = this.changed;\n var pureChanged = [];\n this.cacheOrdered = ordered.filter(function (_a, i) {\n var from = _a[0],\n to = _a[1];\n var _b = changed[i],\n fromBefore = _b[0],\n toBefore = _b[1];\n\n if (from !== to) {\n pureChanged.push([fromBefore, toBefore]);\n return true;\n }\n });\n this.cachePureChanged = pureChanged;\n };\n\n return Result;\n}();\n\n/**\n *\n * @memberof eg.ListDiffer\n * @static\n * @function\n * @param - Previous List 이전 목록 \n * @param - List to Update 업데이트 할 목록 \n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @return - Returns the diff between `prevList` and `list` `prevList`와 `list`의 다른 점을 반환한다.\n * @example\n * import { diff } from \"@egjs/list-differ\";\n * // script => eg.ListDiffer.diff\n * const result = diff([0, 1, 2, 3, 4, 5], [7, 8, 0, 4, 3, 6, 2, 1], e => e);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n\nfunction diff(prevList, list, findKeyCallback) {\n var mapClass = SUPPORT_MAP ? Map : findKeyCallback ? HashMap : PolyMap;\n\n var callback = findKeyCallback || function (e) {\n return e;\n };\n\n var added = [];\n var removed = [];\n var maintained = [];\n var prevKeys = prevList.map(callback);\n var keys = list.map(callback);\n var prevKeyMap = new mapClass();\n var keyMap = new mapClass();\n var changedBeforeAdded = [];\n var fixed = [];\n var removedMap = {};\n var changed = [];\n var addedCount = 0;\n var removedCount = 0; // Add prevKeys and keys to the hashmap.\n\n prevKeys.forEach(function (key, prevListIndex) {\n prevKeyMap.set(key, prevListIndex);\n });\n keys.forEach(function (key, listIndex) {\n keyMap.set(key, listIndex);\n }); // Compare `prevKeys` and `keys` and add them to `removed` if they are not in `keys`.\n\n prevKeys.forEach(function (key, prevListIndex) {\n var listIndex = keyMap.get(key); // In prevList, but not in list, it is removed.\n\n if (typeof listIndex === \"undefined\") {\n ++removedCount;\n removed.push(prevListIndex);\n } else {\n removedMap[listIndex] = removedCount;\n }\n }); // Compare `prevKeys` and `keys` and add them to `added` if they are not in `prevKeys`.\n\n keys.forEach(function (key, listIndex) {\n var prevListIndex = prevKeyMap.get(key); // In list, but not in prevList, it is added.\n\n if (typeof prevListIndex === \"undefined\") {\n added.push(listIndex);\n ++addedCount;\n } else {\n maintained.push([prevListIndex, listIndex]);\n removedCount = removedMap[listIndex] || 0;\n changedBeforeAdded.push([prevListIndex - removedCount, listIndex - addedCount]);\n fixed.push(listIndex === prevListIndex);\n\n if (prevListIndex !== listIndex) {\n changed.push([prevListIndex, listIndex]);\n }\n }\n }); // Sort by ascending order of 'to(list's index).\n\n removed.reverse();\n return new Result(prevList, list, added, removed, changed, maintained, changedBeforeAdded, fixed);\n}\n\n/**\n * A module that checks diff when values are added, removed, or changed in an array.\n * @ko 배열 또는 오브젝트에서 값이 추가되거나 삭제되거나 순서가 변경사항을 체크하는 모듈입니다.\n * @memberof eg\n */\n\nvar ListDiffer =\n/*#__PURE__*/\nfunction () {\n /**\n * @param - Initializing Data Array. 초기 설정할 데이터 배열.\n * @param - This callback function returns the key of the item. 아이템의 키를 반환하는 콜백 함수입니다.\n * @example\n * import ListDiffer from \"@egjs/list-differ\";\n * // script => eg.ListDiffer\n * const differ = new ListDiffer([0, 1, 2, 3, 4, 5], e => e);\n * const result = differ.update([7, 8, 0, 4, 3, 6, 2, 1]);\n * // List before update\n * // [1, 2, 3, 4, 5]\n * console.log(result.prevList);\n * // Updated list\n * // [4, 3, 6, 2, 1]\n * console.log(result.list);\n * // Index array of values added to `list`.\n * // [0, 1, 5]\n * console.log(result.added);\n * // Index array of values removed in `prevList`.\n * // [5]\n * console.log(result.removed);\n * // An array of index pairs of `prevList` and `list` with different indexes from `prevList` and `list`.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.changed);\n * // The subset of `changed` and an array of index pairs that moved data directly. Indicate an array of absolute index pairs of `ordered`.(Formatted by: Array<[index of prevList, index of list]>)\n * // [[4, 3], [3, 4], [2, 6]]\n * console.log(result.pureChanged);\n * // An array of index pairs to be `ordered` that can synchronize `list` before adding data. (Formatted by: Array<[prevIndex, nextIndex]>)\n * // [[4, 1], [4, 2], [4, 3]]\n * console.log(result.ordered);\n * // An array of index pairs of `prevList` and `list` that have not been added/removed so data is preserved.\n * // [[0, 2], [4, 3], [3, 4], [2, 6], [1, 7]]\n * console.log(result.maintained);\n */\n function ListDiffer(list, findKeyCallback) {\n if (list === void 0) {\n list = [];\n }\n\n this.findKeyCallback = findKeyCallback;\n this.list = [].slice.call(list);\n }\n /**\n * Update list.\n * @ko 리스트를 업데이트를 합니다.\n * @param - List to update 업데이트할 리스트 \n * @return - Returns the results of an update from `prevList` to `list`. `prevList`에서 `list`로 업데이트한 결과를 반환한다. \n */\n\n\n var __proto = ListDiffer.prototype;\n\n __proto.update = function (list) {\n var newData = [].slice.call(list);\n var result = diff(this.list, newData, this.findKeyCallback);\n this.list = newData;\n return result;\n };\n\n return ListDiffer;\n}();\n\n/*\negjs-list-differ\nCopyright (c) 2019-present NAVER Corp.\nMIT license\n*/\n\nexport default ListDiffer;\nexport { diff };\n//# sourceMappingURL=list-differ.esm.js.map\n","let win: Window;\n\nif (typeof window === \"undefined\") {\n\t// window is undefined in node.js\n\twin = {\n\t\tdocument: {},\n\t\tnavigator: {\n\t\t\tuserAgent: \"\",\n\t\t},\n\t} as Window;\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign, InfiniteGridMethodsKeys } from \"./types\";\n\nconst ua = window.navigator.userAgent;\n\nexport const SUPPORT_COMPUTEDSTYLE = !!(\"getComputedStyle\" in window);\nexport const SUPPORT_ADDEVENTLISTENER = !!(\"addEventListener\" in document);\nexport const SUPPORT_PASSIVE = (() => {\n\tlet supportsPassiveOption = false;\n\n\ttry {\n\t\tif (SUPPORT_ADDEVENTLISTENER && Object.defineProperty) {\n\t\t\t// tslint:disable-next-line: no-empty\n\t\t\tdocument.addEventListener(\"test\", () => { }, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\tget() {\n\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t},\n\t\t\t}));\n\t\t}\n\t} catch (e) {\n\t\t//\n\t}\n\treturn supportsPassiveOption;\n})();\n\nexport const IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nexport const IS_IOS = /iPhone|iPad/.test(ua);\nexport const IS_ANDROID2 = /Android 2\\./.test(ua);\nexport const CONTAINER_CLASSNAME = \"_eg-infinitegrid-container_\";\nexport const IGNORE_CLASSNAME = \"_eg-infinitegrid-ignore_\";\nexport const TRANSITION_NAME = \"_INFINITEGRID_TRANSITION\";\n\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\n\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_OPTIONS = {\n\titemSelector: \"*\",\n\tisOverflowScroll: false,\n\tthreshold: 100,\n\tisEqualSize: false,\n\tisConstantSize: false,\n\tuseRecycle: true,\n\thorizontal: false,\n\ttransitionDuration: 0,\n\tuseFit: true,\n\tattributePrefix: \"data-\",\n\trenderExternal: false,\n\tresizeDebounce: 100,\n\tmaxResizeDebounce: 0,\n\tpercentage: false,\n};\n\nexport const DEFAULT_LAYOUT_OPTIONS = {\n\thorizontal: false,\n\tmargin: 0,\n};\n\nexport const agent = ua.toLowerCase();\nexport const isMobile = /mobi|ios|android/.test(agent);\n\nexport const ALIGN: IAlign = {\n\tSTART: \"start\",\n\tCENTER: \"center\",\n\tEND: \"end\",\n\tJUSTIFY: \"justify\",\n};\n\nexport const IDLE = 0;\nexport const LOADING_APPEND = 1;\nexport const LOADING_PREPEND = 2;\nexport const PROCESSING = 4;\n\nconst webkit = /applewebkit\\/([\\d|.]*)/g.exec(agent);\n\nexport const WEBKIT_VERSION = (webkit && parseInt(webkit[1], 10)) || 0;\nexport const DEFENSE_BROWSER = (WEBKIT_VERSION && WEBKIT_VERSION < 537);\n\nexport const ITEM_KEYS = [\"content\", \"groupKey\", \"itemKey\", \"orgSize\", \"mounted\", \"prevRect\", \"rect\", \"size\"];\ninterface ITransitionEnd {\n\ttransitionend: string;\n\twebkitTransitionEnd: string;\n\tMSTransitionEnd: string;\n\toTransitionEnd: string;\n\tmozTransitionEnd: string;\n}\n\nexport const [TRANSFORM, TRANSITION, TRANSITION_END] = (() => {\n\tconst properties: ITransitionEnd = {\n\t\ttransitionend: \"\",\n\t\twebkitTransitionEnd: \"-webkit-\",\n\t\tMSTransitionEnd: \"-ms-\",\n\t\toTransitionEnd: \"-o-\",\n\t\tmozTransitionEnd: \"-moz-\",\n\t};\n\n\tfor (const property in properties) {\n\t\tconst prefix = properties[property as keyof ITransitionEnd];\n\n\t\tif (`on${property.toLowerCase()}` in window) {\n\t\t\treturn [`${prefix}transform`, `${prefix}transition`, property];\n\t\t}\n\t}\n\treturn [];\n})() as [\"transform\", \"transition\", \"transitionend\"];\n\nexport const INFINITEGRID_EVENTS = [\"append\", \"prepend\", \"imageError\", \"change\", \"layoutComplete\"];\n\n// It's for making mistakes.\n// Whenever you add a public method, you must add the corresponding method name to an array or object.\n// An additional error may occur if not added.\nexport const INFINITEGRID_METHODS: { [key in InfiniteGridMethodsKeys]: true } = {\n\tgetLoadingBar: true,\n\tgetItem: true,\n\tgetItems: true,\n\tlayout: true,\n\tgetGroupKeys: true,\n\tgetStatus: true,\n\tsetStatus: true,\n\tisProcessing: true,\n\tstartLoading: true,\n\tendLoading: true,\n\tisLoading: true,\n\tupdateItem: true,\n\tupdateItems: true,\n\tmoveTo: true,\n};\n","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_LAYOUT_OPTIONS,\n\tDUMMY_POSITION,\n\tINFINITEGRID_METHODS,\n} from \"./consts\";\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, IItem, IGroup, IArrayFormat, IInfiniteGridItem } from \"./types\";\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: IArrayFormat): T[];\nexport function toArray(nodes: IArrayFormat): T[] {\n\t// SCRIPT5014 in IE8\n\tconst array: T[] = [];\n\n\tif (nodes) {\n\t\tconst length = nodes.length;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tarray.push(nodes[i]);\n\t\t}\n\t}\n\treturn array;\n}\nexport function matchHTML(html: string) {\n\treturn html.match(/^<([A-z]+)\\s*([^>]*)>/);\n}\n/**\n * Select or create element\n * @param {String|HTMLElement|jQuery} param\n * when string given is as HTML tag, then create element\n * otherwise it returns selected elements\n * @param {Boolean} multi\n * @returns {HTMLElement}\n */\nexport function $(param: Window, multi?: false): Window;\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti: true,\n): HTMLElement[];\nexport function $(\n\tparam: string | HTMLElement | Array | IJQuery,\n\tmulti?: false,\n): HTMLElement;\nexport function $(\n\tparam: string | HTMLElement | Window | IJQuery,\n\tmulti?: false,\n): HTMLElement | Window;\nexport function $(\n\tparam: string | Window | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | Window | HTMLElement[] {\n\tlet el: Window | HTMLElement | HTMLElement[] | NodeListOf | undefined;\n\n\tif (typeof param === \"string\") { // String (HTML, Selector)\n\t\t// check if string is HTML tag format\n\t\tconst match = matchHTML(param);\n\n\t\t// creating element\n\t\tif (match) { // HTML\n\t\t\tconst dummy = document.createElement(\"div\");\n\n\t\t\tdummy.innerHTML = param;\n\t\t\tel = dummy.childNodes as NodeListOf;\n\t\t} else { // Selector\n\t\t\tel = document.querySelectorAll(param);\n\t\t}\n\t\tif (multi) {\n\t\t\treturn toArray(el as NodeListOf);\n\t\t} else {\n\t\t\treturn el && (el as NodeListOf)[0];\n\t\t}\n\t} else if (isWindow(param)) { // window\n\t\tel = param;\n\t} else if (isJQuery(param)) { // jQuery\n\t\tel = multi ? $(param.toArray(), true) :\n\t\t\t$(param.get(0), false);\n\t} else if (Array.isArray(param)) {\n\t\tel = param.map(v => $(v));\n\t\tif (!multi) {\n\t\t\tel = el.length >= 1 ? (el as HTMLElement[])[0] : undefined;\n\t\t}\n\t} else if (param.nodeName &&\n\t\t(param.nodeType === 1 || param.nodeType === 9)) { // HTMLElement, Document\n\t\tel = param;\n\t} else {\n\t\tel = [].slice.call(el);\n\t}\n\treturn el as Window | HTMLElement | HTMLElement[];\n}\nexport function addEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tif (SUPPORT_ADDEVENTLISTENER) {\n\t\tlet options = eventListenerOptions || false;\n\n\t\tif (typeof eventListenerOptions === \"object\") {\n\t\t\toptions = SUPPORT_PASSIVE ? eventListenerOptions : false;\n\t\t}\n\t\telement.addEventListener(type, handler, options);\n\t} else if ((element as any).attachEvent) {\n\t\t(element as any).attachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = handler;\n\t}\n}\nexport function removeEvent(\n\telement: Element | Window,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n) {\n\tif (element.removeEventListener) {\n\t\telement.removeEventListener(type, handler, false);\n\t} else if ((element as any).detachEvent) {\n\t\t(element as any).detachEvent(`on${type}`, handler);\n\t} else {\n\t\t(element as any)[`on${type}`] = null;\n\t}\n}\nexport function addOnceEvent(\n\telement: Element,\n\ttype: string,\n\thandler: (...args: any[]) => any,\n\teventListenerOptions?: boolean | { [key: string]: any },\n) {\n\tconst callback = (e: any) => {\n\t\tremoveEvent(element, type, callback);\n\t\thandler(e);\n\t};\n\n\taddEvent(element, type, callback, eventListenerOptions);\n}\nexport function scroll(el: HTMLElement | Window, horizontal = false) {\n\tconst prop = `scroll${horizontal ? \"Left\" : \"Top\"}` as \"scrollLeft\" | \"scrollTop\";\n\n\tif (isWindow(el)) {\n\t\treturn window[horizontal ? \"pageXOffset\" : \"pageYOffset\"] || document.body[prop] || document.documentElement[prop];\n\t} else {\n\t\treturn el[prop];\n\t}\n}\nexport function scrollTo(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scroll(x, y);\n\t} else {\n\t\tel.scrollLeft = x;\n\t\tel.scrollTop = y;\n\t}\n}\nexport function scrollBy(el: Window | Element, x: number, y: number) {\n\tif (isWindow(el)) {\n\t\tel.scrollBy(x, y);\n\t} else {\n\t\tel.scrollLeft += x;\n\t\tel.scrollTop += y;\n\t}\n}\nexport function getStyle(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: Window | Document | HTMLElement, name: \"Width\" | \"Height\", isOffset?: boolean) {\n\tif (isWindow(el)) { // WINDOW\n\t\treturn window[`inner${name}` as InnerSizeType] || document.body[`client${name}` as ClientSizeType];\n\t} else if (isDocument(el)) { // DOCUMENT_NODE\n\t\tconst doc = (el as Document).documentElement;\n\t\tconst body = (el as Document).body;\n\n\t\treturn Math.max(\n\t\t\tbody[`scroll${name}` as ScrollSizeType], doc[`scroll${name}` as ScrollSizeType],\n\t\t\tbody[`offset${name}` as OffsetSizeType], doc[`offset${name}` as OffsetSizeType],\n\t\t\tdoc[`client${name}` as ClientSizeType],\n\t\t);\n\t} else { // NODE\n\t\tlet size = 0;\n\n\t\tif (isOffset) {\n\t\t\tconst clientRect = el.getBoundingClientRect();\n\n\t\t\tsize = name === \"Width\" ? clientRect.right - clientRect.left : clientRect.bottom - clientRect.top;\n\t\t} else {\n\t\t\tsize = el[`client${name}` as ClientSizeType] || el[`offset${name}` as OffsetSizeType];\n\t\t}\n\t\tif (size) {\n\t\t\treturn size;\n\t\t}\n\t\tconst cssSize = getStyle(el)[name.toLowerCase()];\n\n\t\treturn (~cssSize.indexOf(\"px\") && parseFloat(cssSize)) || 0;\n\t}\n}\n\nexport function innerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: Window | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", true);\n}\nexport function getSize(el: HTMLElement) {\n\treturn {\n\t\twidth: outerWidth(el),\n\t\theight: outerHeight(el),\n\t};\n}\nexport const STYLE: {\n\tvertical: IRectlProperties,\n\thorizontal: IRectlProperties,\n} = {\n\tvertical: {\n\t\tstartPos1: \"top\",\n\t\tendPos1: \"bottom\",\n\t\tsize1: \"height\",\n\t\tstartPos2: \"left\",\n\t\tendPos2: \"right\",\n\t\tsize2: \"width\",\n\t},\n\thorizontal: {\n\t\tstartPos1: \"left\",\n\t\tendPos1: \"right\",\n\t\tsize1: \"width\",\n\t\tstartPos2: \"top\",\n\t\tendPos2: \"bottom\",\n\t\tsize2: \"height\",\n\t},\n};\n\nexport function getStyleNames(isHorizontal: boolean): IRectlProperties {\n\treturn STYLE[isHorizontal ? HORIZONTAL : VERTICAL];\n}\nexport function assign(target: A, source: B): A & B;\nexport function assign(target: A, source1: B, source2: C): A & B & C;\nexport function assign(target: A, source1: B, source2: C, source3: D): A & B & C & D;\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>): { [key: string]: any };\nexport function assign(target: { [key: string]: any }, ...sources: Array<{ [key: string]: any }>) {\n\tsources.forEach(source => {\n\t\tfor (const key in source) {\n\t\t\ttarget[key] = source[key];\n\t\t}\n\t});\n\treturn target;\n}\nexport function assignOptions(\n\tdefaultOptions: A, options: B): typeof DEFAULT_LAYOUT_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_LAYOUT_OPTIONS,\n\t\tdefaultOptions,\n\t\toptions);\n}\n\nexport function toZeroArray(outline?: number[]) {\n\tif (!outline || !outline.length) {\n\t\treturn [0];\n\t}\n\treturn outline;\n}\nexport function cloneItems(items: T[]) {\n\treturn items.map(item => assign({}, item));\n}\nexport function isJQuery(el: any): el is IJQuery {\n\treturn (typeof (window as any).jQuery === \"function\" && el instanceof (window as any).jQuery) ||\n\t\tel.constructor.prototype.jquery && el.toArray;\n}\nexport function isWindow(el: any): el is Window {\n\treturn el === window;\n}\nexport function isDocument(el: Node): el is Document {\n\treturn el.nodeType === 9;\n}\n\nexport function fill(arr: T[], value: T) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tarr[i] = value;\n\t}\n\n\treturn arr;\n}\n\nexport function isUndefined(target: any): target is undefined {\n\treturn typeof target === \"undefined\";\n}\n\nexport function find(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = 0; i < length; ++i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function findLast(arr: T[], callback: (target: T) => any) {\n\tconst length = arr.length;\n\n\tfor (let i = length - 1; i >= 0; --i) {\n\t\tif (callback(arr[i])) {\n\t\t\treturn arr[i];\n\t\t}\n\t}\n\treturn null;\n}\nexport function categorize(newItems: IItem[]) {\n\tconst newGroups: IGroup[] = [];\n\tconst groupKeys: { [key: string]: IGroup } = {};\n\n\tnewItems.forEach(item => {\n\t\tconst { groupKey } = item;\n\t\tlet group = groupKeys[groupKey];\n\n\t\tif (!group) {\n\t\t\tgroup = {\n\t\t\t\tgroupKey,\n\t\t\t\titems: [],\n\t\t\t};\n\t\t\tgroupKeys[groupKey] = group;\n\t\t\tnewGroups.push(group);\n\t\t}\n\n\t\tgroup.items.push(item);\n\t});\n\n\treturn newGroups;\n}\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\n\nexport function makeItem(groupKey: string | number, el?: HTMLElement) {\n\treturn {\n\t\tel,\n\t\tgroupKey,\n\t\tmounted: false,\n\t\tneedUpdate: true,\n\t\tcontent: el ? el.outerHTML : \"\",\n\t\trect: {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t},\n\t};\n}\n\n/**\n * Decorator that makes the method of infinitegrid available in the framework.\n * @ko 프레임워크에서 인피니트그리드의 메소드를 사용할 수 있게 하는 데코레이터.\n * @memberof eg.InfiniteGrid\n * @private\n * @example\n * ```js\n * import NativeInfiniteGrid, { withInfiniteGridMethods } from \"@egjs/infinitegrid\";\n *\n * class InfiniteGrid extends React.Component> {\n * @withInfiniteGridMethods\n * private infinitegrid: NativeInfiniteGrid;\n * }\n * ```\n */\nexport function withInfiniteGridMethods(prototype: any, infinitegridName: string) {\n\tObject.keys(INFINITEGRID_METHODS).forEach((name: keyof InfiniteGrid) => {\n\t\tif (prototype[name]) {\n\t\t\treturn;\n\t\t}\n\t\tprototype[name] = function(...args) {\n\t\t\tconst result = this[infinitegridName][name](...args);\n\n\t\t\t// fix `this` type to return your own `infinitegrid` instance to the instance using the decorator.\n\t\t\tif (result === this[infinitegridName]) {\n\t\t\t\treturn this;\n\t\t\t} else {\n\t\t\t\treturn result;\n\t\t\t}\n\t\t};\n\t});\n}\n\nexport function hasClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\treturn element.classList.contains(className);\n\t}\n\treturn !!element.className.match(new RegExp(`(\\\\s|^)${className}(\\\\s|$)`));\n}\n\nexport function addClass(element: HTMLElement, className: string) {\n\tif (element.classList) {\n\t\telement.classList.add(className);\n\t} else {\n\t\telement.className += ` ${className}`;\n\t}\n}\n","import { diff, DiffResult } from \"@egjs/list-differ\";\nimport { GROUPKEY_ATT, DUMMY_POSITION, ITEM_KEYS } from \"./consts\";\nimport { isUndefined, assign, categorize, makeItem } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus, IItem, IGroup } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static toItems(elements: HTMLElement[], groupKey: string | number): IInfiniteGridItem[] {\n\t\treturn elements.map(el => makeItem(groupKey, el));\n\t}\n\tpublic static pluck(data: A[], property: B):\n\t\tA[B] extends any[] ? A[B] : Array {\n\t\treturn data.reduce((acc, v) => acc.concat(v[property]), []) as any;\n\t}\n\t// groups\n\tprivate _groups: IInfiniteGridGroup[] = [];\n\t// group keys\n\tprivate _groupKeys: { [key: string]: IInfiniteGridGroup } = {};\n\n\tpublic clear() {\n\t\tthis._groups = [];\n\t\tthis._groupKeys = {};\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._groups;\n\t\tconst startIndex = Math.max(this.indexOf(startKey), 0);\n\t\tconst endIndex = this.indexOf(endKey) + 1 || datas.length;\n\n\t\treturn {\n\t\t\t_data: datas.slice(startIndex, endIndex).map(data => {\n\t\t\t\tconst items = data.items.map(item => {\n\t\t\t\t\tconst item2 = {} as IInfiniteGridItem;\n\n\t\t\t\t\tITEM_KEYS.forEach(key => {\n\t\t\t\t\t\tif (key in item) {\n\t\t\t\t\t\t\titem2[key] = item[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\treturn item2;\n\t\t\t\t});\n\t\t\t\tconst data2 = assign({}, data);\n\n\t\t\t\tdata2.items = items;\n\t\t\t\treturn data2;\n\t\t\t}),\n\t\t};\n\t}\n\tpublic setStatus(status: IItemManagerStatus) {\n\t\tconst data = status._data;\n\n\t\tthis.clear();\n\n\t\tdata.forEach((group, i) => {\n\t\t\tthis.insertGroup(group, i);\n\t\t});\n\t}\n\tpublic size() {\n\t\treturn this._groups.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tconst groups = this._groups;\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tgroups.forEach(group => {\n\t\t\t\tconst { items, outlines } = group;\n\n\t\t\t\titems.forEach(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t});\n\t\t\t\toutlines.start = outlines.start.map(start => start - base);\n\t\t\t\toutlines.end = outlines.end.map(end => end - base);\n\t\t\t});\n\t\t}\n\t}\n\tpublic pluck(property: T, start?: number, end?: number) {\n\t\tconst data = isUndefined(start) ? this._groups : this.sliceGroups(start, (isUndefined(end) ? start : end) + 1);\n\n\t\treturn ItemManager.pluck(data, property);\n\t}\n\tpublic getOutline(index: number, property: keyof IInfiniteGridGroup[\"outlines\"]) {\n\t\tconst data = this._groups[index];\n\n\t\treturn data ? data.outlines[property] : [];\n\t}\n\tpublic getEdgeIndex(cursor: CursorType, start: number, end: number) {\n\t\tconst prop = cursor === \"start\" ? \"min\" : \"max\";\n\t\tlet index = -1;\n\t\tlet targetValue = cursor === \"start\" ? Infinity : -Infinity;\n\n\t\tfor (let i = start; i <= end; i++) {\n\t\t\tconst value = Math[prop](...this.getOutline(i, cursor));\n\n\t\t\tif ((cursor === \"start\" && targetValue > value) ||\n\t\t\t\t(cursor === \"end\" && targetValue < value)) {\n\t\t\t\ttargetValue = value;\n\t\t\t\tindex = i;\n\t\t\t}\n\t\t}\n\t\treturn index;\n\t}\n\tpublic getEdgeValue(cursor: CursorType, start: number, end: number) {\n\t\tconst group = this.getGroup(this.getEdgeIndex(cursor, start, end));\n\n\t\tif (group) {\n\t\t\tconst outlines = group.outlines[cursor];\n\n\t\t\tif (outlines.length) {\n\t\t\t\treturn Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines);\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.getGroups();\n\n\t\tdatas.forEach((group, cursor) => {\n\t\t\tif (startCursor <= cursor && cursor <= endCursor) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tgroup.items.forEach(item => {\n\t\t\t\titem.rect.top = DUMMY_POSITION;\n\t\t\t\titem.rect.left = DUMMY_POSITION;\n\t\t\t});\n\t\t\tgroup.outlines.start = [];\n\t\t\tgroup.outlines.end = [];\n\t\t});\n\t}\n\tpublic getMaxEdgeValue() {\n\t\tconst groups = this._groups;\n\t\tconst length = groups.length;\n\n\t\tfor (let i = length - 1; i >= 0; --i) {\n\t\t\tconst end = groups[i].outlines.end;\n\n\t\t\tif (end.length) {\n\t\t\t\tconst pos = Math.max(...end);\n\n\t\t\t\treturn pos;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}\n\tpublic prependGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, 0);\n\t}\n\tpublic appendGroup(group: IGroup): IInfiniteGridGroup | null {\n\t\treturn this.insertGroup(group, this._groups.length);\n\t}\n\tpublic insertGroup(group: IGroup, groupIndex: number): IInfiniteGridGroup | null {\n\t\tif (groupIndex < 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst prevItems: IItem[] = group.items || [];\n\t\tconst newGroup: IInfiniteGridGroup = {\n\t\t\toutlines: {\n\t\t\t\tstart: [],\n\t\t\t\tend: [],\n\t\t\t},\n\t\t\t...group,\n\t\t\titems: [],\n\t\t};\n\t\tthis._groups.splice(groupIndex, 0, newGroup);\n\t\tthis._groupKeys[newGroup.groupKey] = newGroup;\n\n\t\tprevItems.forEach((item, i) => {\n\t\t\tthis.insert(item, groupIndex, i);\n\t\t});\n\t\treturn newGroup;\n\t}\n\tpublic sync(items: IItem[]): DiffResult {\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst newGroups = categorize(items);\n\t\tconst result = diff(groups, newGroups, group => group.groupKey);\n\t\tconst {\n\t\t\tremoved,\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = result;\n\n\t\tremoved.forEach(removedIndex => {\n\t\t\tconst group = groups[removedIndex];\n\n\t\t\tif (!group) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdelete groupKeys[group.groupKey];\n\t\t});\n\t\tconst nextGroups: IInfiniteGridGroup[] = [];\n\t\tmaintained.forEach(([fromIndex]) => {\n\t\t\tnextGroups.push(groups[fromIndex]);\n\t\t});\n\t\tthis._groups = nextGroups;\n\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insertGroup(newGroups[addedIndex], addedIndex);\n\t\t});\n\t\tmaintained.reverse().forEach(([, toIndex]) => {\n\t\t\tthis.syncItems(toIndex, newGroups[toIndex].items);\n\t\t});\n\t\treturn result;\n\t}\n\tpublic insert(newItem: IItem, groupIndex = -1, itemIndex = -1): IInfiniteGridItem | null {\n\t\tconst { groupKey } = newItem;\n\t\tconst groups = this._groups;\n\t\tconst groupKeys = this._groupKeys;\n\t\tconst group = (groupIndex > -1 ? groups[groupIndex] : groupKeys[groupKey])\n\t\t\t|| this.insertGroup({ groupKey }, groupIndex);\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tconst groupItem: IInfiniteGridItem = {\n\t\t\tcontent: \"\",\n\t\t\tmounted: false,\n\t\t\tneedUpdate: true,\n\t\t\trect: {\n\t\t\t\ttop: DUMMY_POSITION,\n\t\t\t\tleft: DUMMY_POSITION,\n\t\t\t},\n\t\t\t...newItem,\n\t\t};\n\t\tconst groupItems = group.items;\n\n\t\tif (itemIndex === -1) {\n\t\t\tgroupItems.push(groupItem);\n\t\t} else {\n\t\t\tgroupItems.splice(itemIndex, 0, groupItem);\n\t\t}\n\n\t\treturn groupItem;\n\t}\n\tpublic removeGroup(groupIndex: number): IInfiniteGridGroup | null {\n\t\tconst group = this._groups.splice(groupIndex, 1)[0];\n\n\t\tif (!group) {\n\t\t\treturn null;\n\t\t}\n\t\tdelete this._groupKeys[group.groupKey];\n\n\t\treturn group;\n\t}\n\tpublic remove(groupIndex: number, itemIndex: number) {\n\t\tconst data = this.getGroup(groupIndex);\n\t\tlet group: IInfiniteGridGroup | null = null;\n\t\tlet items: IInfiniteGridItem[] = [];\n\n\t\tif (!data) {\n\t\t\treturn { items, group };\n\t\t}\n\t\t// remove item information\n\t\titems = data.items.splice(itemIndex, 1);\n\n\t\tif (!data.items.length) {\n\t\t\tgroup = this.removeGroup(groupIndex);\n\t\t}\n\t\treturn { items, group };\n\t}\n\tpublic indexOf(data: { groupKey: string | number } | string | number | undefined) {\n\t\tif (typeof data === \"undefined\") {\n\t\t\treturn -1;\n\t\t}\n\t\tconst groupKey = `${typeof data === \"object\" ? data.groupKey : data}`;\n\t\tconst datas = this._groups;\n\t\tconst length = datas.length;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tif (groupKey === `${datas[i].groupKey}`) {\n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}\n\tpublic indexesOfElement(element: HTMLElement) {\n\t\tconst groupKey = element.getAttribute(GROUPKEY_ATT)!;\n\t\tconst groupIndex = this.indexOf({ groupKey });\n\t\tlet itemIndex = -1;\n\n\t\tif (groupIndex > -1) {\n\t\t\tconst data = this.getGroup(groupIndex);\n\n\t\t\tconst length = data.items.length;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (data.items[i].el === element) {\n\t\t\t\t\titemIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { groupIndex, itemIndex };\n\t}\n\tpublic sliceGroups(start?: number, end?: number) {\n\t\treturn this._groups.slice(start, end);\n\t}\n\tpublic getGroups() {\n\t\treturn this._groups;\n\t}\n\tpublic getGroupByKey(key: number | string) {\n\t\treturn this._groupKeys[key];\n\t}\n\tpublic getGroup(index: number) {\n\t\treturn this._groups[index];\n\t}\n\tprivate syncItems(groupIndex: number, newItems: IItem[]) {\n\t\tif (!newItems.length) {\n\t\t\tthis.removeGroup(groupIndex);\n\t\t\treturn;\n\t\t}\n\t\tconst items = this.getGroup(groupIndex).items;\n\t\tconst {\n\t\t\tadded,\n\t\t\tmaintained,\n\t\t} = diff(items, newItems, item => item.itemKey);\n\n\t\tconst group = this._groups[groupIndex];\n\t\tconst nextItems: IInfiniteGridItem[] = [];\n\t\tmaintained.forEach(([fromIndex, nextIndex]) => {\n\t\t\tconst item = items[fromIndex];\n\t\t\tconst newItem = newItems[nextIndex];\n\n\t\t\tassign(item, newItem);\n\t\t\tnextItems.push(item);\n\t\t});\n\n\t\tgroup.items = nextItems;\n\t\tadded.forEach(addedIndex => {\n\t\t\tthis.insert(newItems[addedIndex], groupIndex, addedIndex);\n\t\t});\n\n\t}\n}\n","import {\n\tGROUPKEY_ATT,\n\tCONTAINER_CLASSNAME,\n\tTRANSITION_NAME,\n\tTRANSITION,\n\tTRANSITION_END,\n\tTRANSFORM,\n} from \"./consts\";\nimport { window, document } from \"./browser\";\nimport {\n\t$,\n\tinnerHeight,\n\tinnerWidth,\n\tgetSize,\n\tgetStyle,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, IJQuery, IInfiniteGridItem, IDOMRendererStatus, IDOMRendererSize, IDOMRendererOptions, IDOMRendererOrgStyle } from \"./types\";\n\nfunction removeTransition(style: HTMLElement[\"style\"]) {\n\tstyle[`${TRANSITION}-property`] = \"\";\n\tstyle[`${TRANSITION}-duration`] = \"\";\n\tstyle[TRANSFORM] = \"\";\n}\nfunction setTransition(style: HTMLElement[\"style\"], transitionDuration: number, pos1: IPosition, pos2: IPosition) {\n\tif (!transitionDuration) {\n\t\tremoveTransition(style);\n\t\treturn false;\n\t}\n\tif (pos1.left === pos2.left && pos1.top === pos2.top) {\n\t\treturn false;\n\t}\n\tstyle[`${TRANSITION}-property`] = `${TRANSFORM},width,height`;\n\tstyle[`${TRANSITION}-duration`] = `${transitionDuration}s`;\n\tstyle[TRANSFORM] = `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)`;\n\treturn true;\n}\n\nfunction createContainer(element: HTMLElement) {\n\tconst selectContainer = element.querySelector(`.${CONTAINER_CLASSNAME}`);\n\n\tif (selectContainer) {\n\t\tselectContainer.style.position = \"relative\";\n\t\tselectContainer.style.height = \"100%\";\n\n\t\treturn selectContainer;\n\t}\n\tconst container = document.createElement(\"div\");\n\n\tcontainer.className = CONTAINER_CLASSNAME;\n\tcontainer.style.position = \"relative\";\n\tcontainer.style.height = \"100%\";\n\n\tconst children = element.children;\n\tconst length = children.length;\t// for IE8\n\n\tfor (let i = 0; i < length; i++) {\n\t\tcontainer.appendChild(children[0]);\n\t}\n\telement.appendChild(container);\n\treturn container;\n}\n\nexport default class DOMRenderer {\n\tpublic static removeItems(items: IInfiniteGridItem[]) {\n\t\titems.forEach(item => {\n\t\t\tif (item.el) {\n\t\t\t\tDOMRenderer.removeElement(item.el);\n\t\t\t\titem.el = null;\n\t\t\t}\n\t\t});\n\t}\n\tpublic static removeElement(element: HTMLElement) {\n\t\tconst parentNode = element && element.parentNode;\n\n\t\tif (!parentNode) {\n\t\t\treturn;\n\t\t}\n\t\tparentNode.removeChild(element);\n\t}\n\tpublic static createElements(items: IInfiniteGridItem[]) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst noElementItems = items.filter(item => !item.el);\n\n\t\tif (!noElementItems.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst elements = $(\n\t\t\tnoElementItems.map(({ content }) => content.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"),\n\t\t\ttrue,\n\t\t);\n\n\t\tnoElementItems.forEach((item, index) => {\n\t\t\titem.el = elements[index];\n\t\t});\n\t}\n\tpublic container: HTMLElement;\n\tpublic view: Window | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: false,\n\t\tpercentage: false,\n\t};\n\tpublic _size: IDOMRendererSize = {\n\t\tcontainer: -1,\n\t\tview: -1,\n\t\tviewport: -1,\n\t\titem: null,\n\t};\n\tpublic _orgStyle: IDOMRendererOrgStyle = {};\n\tprivate _isSizePercentage: boolean = false;\n\tprivate _isPosPercentage: boolean = false;\n\tconstructor(element: string | HTMLElement | IJQuery, options: IDOMRendererOptions) {\n\t\tassign(this.options, options);\n\t\tthis._init(element);\n\t\tthis.resize();\n\t}\n\tpublic getStatus() {\n\t\treturn {\n\t\t\tcssText: this.container.style.cssText,\n\t\t\t_size: assign({}, this._size),\n\t\t};\n\t}\n\tpublic setStatus(status: IDOMRendererStatus) {\n\t\tthis.container.style.cssText = status.cssText;\n\t\tassign(this._size, status._size);\n\t}\n\tpublic updateSize(items: IInfiniteGridItem[]) {\n\t\tconst { isEqualSize, isConstantSize } = this.options;\n\t\tconst size = this._size;\n\n\t\treturn items.map(item => {\n\t\t\tif (!item.el) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (isEqualSize && !size.item) {\n\t\t\t\tsize.item = getSize(item.el);\n\t\t\t}\n\t\t\titem.size = (isEqualSize && assign({}, size.item)) ||\n\t\t\t\t(isConstantSize && item.orgSize && item.orgSize.width && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize || !item.orgSize.width || !item.orgSize.height) {\n\t\t\t\titem.orgSize = assign({}, item.size);\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tthis.renderItems(items);\n\t\tthis._insert(items, isAppend);\n\t}\n\tpublic renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tthis.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\n\tpublic renderItem(item: IInfiniteGridItem, rect: IInfiniteGridItem[\"rect\"], transitionDuration?: number) {\n\t\tif (!item.el) {\n\t\t\treturn;\n\t\t}\n\t\tconst { el, prevRect } = item;\n\t\tconst style = el.style;\n\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyle.position = \"absolute\";\n\t\tthis._render([\"width\", \"height\"], rect, style);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(style, transitionDuration, rect, prevRect);\n\t\t\tif ((el as any)[TRANSITION_NAME]) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tel[TRANSITION_NAME] = true;\n\t\t\taddOnceEvent(el, TRANSITION_END, () => {\n\t\t\t\tconst itemRect = item.rect;\n\n\t\t\t\tremoveTransition(style);\n\t\t\t\tthis._render([\"left\", \"top\"], itemRect, style);\n\t\t\t\titem.prevRect = itemRect;\n\t\t\t\tel[TRANSITION_NAME] = false;\n\t\t\t});\n\t\t} else {\n\t\t\tthis._render([\"left\", \"top\"], rect, style);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic getViewSize() {\n\t\treturn this._size.view;\n\t}\n\tpublic getViewportSize() {\n\t\treturn this._size.viewport;\n\t}\n\tpublic getContainerSize() {\n\t\treturn this._size.container;\n\t}\n\tpublic setContainerSize(size: number) {\n\t\tthis._size.container = size;\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = `${size}px`;\n\t}\n\tpublic resize() {\n\t\tconst horizontal = this.options.horizontal;\n\t\tconst view = this.view;\n\t\tconst size = this._calcSize();\n\n\t\tif (size === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst isResize = size !== this._size.viewport;\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tview: -1,\n\t\t\t\tcontainer: -1,\n\t\t\t\tviewport: size,\n\t\t\t\titem: null,\n\t\t\t};\n\t\t}\n\t\tthis._size.view = horizontal ? innerWidth(view) : innerHeight(view);\n\t\treturn isResize;\n\t}\n\tpublic isNeededResize() {\n\t\treturn this._calcSize() !== this._size.viewport;\n\t}\n\tpublic clear() {\n\t\tthis.container.innerHTML = \"\";\n\t\tthis.container.style[this.options.horizontal ? \"width\" : \"height\"] = \"\";\n\n\t\tthis._size = {\n\t\t\titem: null,\n\t\t\tviewport: -1,\n\t\t\tcontainer: -1,\n\t\t\tview: -1,\n\t\t};\n\t}\n\tpublic destroy() {\n\t\tthis.clear();\n\t\tconst container = this.options.container;\n\t\tlet property: keyof IDOMRendererOrgStyle;\n\n\t\tfor (property in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[property] = this._orgStyle[property]!;\n\t\t}\n\t\tcontainer && this.container.parentNode!.removeChild(this.container);\n\t}\n\tprivate _init(el: HTMLElement | IJQuery | string) {\n\t\tconst element = $(el);\n\t\tconst style = getStyle(element);\n\t\tconst { container, horizontal, percentage } = this.options;\n\n\t\tif (percentage) {\n\t\t\tthis._isSizePercentage = percentage === true || percentage.indexOf(\"size\") > -1;\n\t\t\tthis._isPosPercentage = percentage === true || percentage.indexOf(\"position\") > -1;\n\t\t}\n\n\t\tif (style.position === \"static\") {\n\t\t\tthis._orgStyle.position = element.style.position;\n\t\t\telement.style.position = \"relative\";\n\t\t}\n\t\tif (container) {\n\t\t\tconst target = horizontal ? [\"X\", \"Y\"] : [\"Y\", \"X\"];\n\n\t\t\tthis._orgStyle.overflowX = element.style.overflowX;\n\t\t\tthis._orgStyle.overflowY = element.style.overflowY;\n\t\t\telement.style[`overflow${target[0]}` as \"overflowX\" | \"overflowY\"] = \"scroll\";\n\t\t\telement.style[`overflow${target[1]}` as \"overflowX\" | \"overflowY\"] = \"hidden\";\n\t\t\tthis.view = element;\n\t\t\tthis.container = container === true ? createContainer(this.view as HTMLElement) : container;\n\t\t} else {\n\t\t\tthis.view = window;\n\t\t\tthis.container = element;\n\t\t}\n\t}\n\tprivate _insert(items: IInfiniteGridItem[], isAppend?: boolean, style?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyle && this.renderItem(item, style);\n\t\t\tisAppend ? df.appendChild(item.el!) : df.insertBefore(item.el!, df.firstChild);\n\t\t});\n\t\tisAppend ?\n\t\t\tcontainer.appendChild(df) :\n\t\t\tcontainer.insertBefore(df, container.firstChild);\n\t}\n\tprivate _calcSize() {\n\t\treturn this.options.horizontal ?\n\t\t\tinnerHeight(this.container) : innerWidth(this.container);\n\t}\n\tprivate _render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], style: HTMLElement[\"style\"]) {\n\t\tconst isSizePercentage = this._isSizePercentage;\n\t\tconst isPosPercentage = this._isPosPercentage;\n\t\tconst viewportSize = this.getViewportSize();\n\t\tconst horizontal = this.options.horizontal;\n\n\t\tproperties.forEach(p => {\n\t\t\tif (!(p in rect)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst isHorizontalPercentage\n\t\t\t\t= horizontal && ((isSizePercentage && p === \"height\") || (isPosPercentage && p === \"top\"));\n\t\t\tconst isVerticalPercentage\n\t\t\t\t= !horizontal && ((isSizePercentage && p === \"width\") || (isPosPercentage && p === \"left\"));\n\n\t\t\tstyle[p] = isHorizontalPercentage || isVerticalPercentage\n\t\t\t\t? `${rect[p]! / viewportSize * 100}%`\n\t\t\t\t: `${rect[p]}px`;\n\t\t});\n\t}\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign, find, findLast } from \"./utils\";\nimport { CursorType, IInfiniteGridGroup, IInfiniteStatus, IRemoveResult, IItem, IInfiniteOptions, IInfiniteGridItem } from \"./types\";\nimport { diff } from \"@egjs/list-differ\";\n\nfunction isVisible(group: IInfiniteGridGroup, threshold: number, scrollPos: number, endScrollPos: number) {\n\tconst { items, outlines } = group;\n\tconst start = outlines.start;\n\tconst end = outlines.end;\n\n\tif (start.length === 0 || end.length === 0 || !items.length || !items[0].el) {\n\t\treturn 2;\n\t}\n\tconst min = Math.min(...start);\n\tconst max = Math.max(...end);\n\n\tif ((endScrollPos + threshold < min)) {\n\t\treturn +1;\n\t} else if ((scrollPos - threshold > max)) {\n\t\treturn -1;\n\t}\n\treturn 0;\n}\n\nclass Infinite {\n\tpublic options: Required;\n\tprivate _itemManager: ItemManager;\n\tprivate _status: IInfiniteStatus;\n\tconstructor(itemManger: ItemManager, options: IInfiniteOptions) {\n\t\tthis.options = assign({\n\t\t\tuseRecycle: true,\n\t\t\tthreshold: 100,\n\t\t\tappend: () => void 0,\n\t\t\tprepend: () => void 0,\n\t\t\trecycle: () => void 0,\n\t\t}, options);\n\n\t\tthis._itemManager = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic sync(items: IItem[]) {\n\t\tconst status = this._status;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst itemManager = this._itemManager;\n\t\tconst prevVisisbleGroups = itemManager.sliceGroups(startCursor, endCursor + 1);\n\t\tconst prevVisibleItems = ItemManager.pluck(prevVisisbleGroups, \"items\");\n\t\tconst result = itemManager.sync(items);\n\t\tconst startGroup = find(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tconst endGroup = findLast(\n\t\t\tprevVisisbleGroups,\n\t\t\t({ groupKey }) => itemManager.getGroupByKey(groupKey),\n\t\t);\n\t\tlet nextStartCursor = startGroup ? itemManager.indexOf(startGroup) : -1;\n\t\tlet nextEndCursor = endGroup ? itemManager.indexOf(endGroup) : -1;\n\n\t\tif (nextStartCursor > -1 && nextEndCursor > -1) {\n\t\t\t// This is when the arrangement is inverted.\n\t\t\t// prevVisisbleGroups is [0, 1, 2, 3]\n\t\t\t// but currentGroups is [3, 2, 1, 0]\n\t\t\t// so, nextStartCursor is 3, and nextEndCursor is 0\n\t\t\tconst minCursor = Math.min(nextStartCursor, nextEndCursor);\n\t\t\tconst maxCursor = Math.max(nextStartCursor, nextEndCursor);\n\n\t\t\tnextStartCursor = minCursor;\n\t\t\tnextEndCursor = maxCursor;\n\t\t} else if (nextEndCursor > -1) {\n\t\t\tnextStartCursor = nextEndCursor;\n\t\t} else if (nextStartCursor > -1) {\n\t\t\tnextEndCursor = nextStartCursor;\n\t\t}\n\n\t\tstatus.startCursor = nextStartCursor;\n\t\tstatus.endCursor = nextEndCursor;\n\n\t\tif (result.removed.length > 0) {\n\t\t\treturn \"relayout\";\n\t\t} else {\n\t\t\tconst nextVisibleItems = itemManager.pluck(\"items\", startCursor, endCursor);\n\t\t\tconst visibleDiffResult = diff(prevVisibleItems, nextVisibleItems, ({ itemKey }) => itemKey);\n\n\t\t\tif (visibleDiffResult.removed.length > 0) {\n\t\t\t\treturn \"layout\";\n\t\t\t} else {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t}\n\t}\n\tpublic recycle(scrollPos: number | null, isForward?: boolean) {\n\t\tif (!this.options.useRecycle || typeof scrollPos !== \"number\") {\n\t\t\treturn;\n\t\t}\n\t\tconst { startCursor, endCursor, size } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn;\n\t\t}\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst { threshold, recycle } = this.options;\n\t\tconst visibles = this._itemManager.sliceGroups(startCursor, endCursor + 1)\n\t\t\t.map(group => isVisible(group, threshold, scrollPos, endScrollPos));\n\t\tconst length = visibles.length;\n\t\tlet start = isForward ? 0 : visibles.lastIndexOf(0);\n\t\tlet end = isForward ? visibles.indexOf(0) - 1 : visibles.length - 1;\n\n\t\tif (!isForward && start !== -1) {\n\t\t\tstart += 1;\n\t\t}\n\t\tif (start < 0 || end < 0 || start > end || end - start + 1 >= length) {\n\t\t\treturn;\n\t\t}\n\t\tstart = startCursor + start;\n\t\tend = startCursor + end;\n\n\t\tif (isForward) {\n\t\t\tthis.setCursor(\"start\", end + 1);\n\t\t} else {\n\t\t\tthis.setCursor(\"end\", start - 1);\n\t\t}\n\t\trecycle({ start, end });\n\t}\n\tpublic scroll(scrollPos: number | null) {\n\t\tconst [startCursor, endCursor] = this.getCursors();\n\t\tconst items = this._itemManager;\n\n\t\tif (typeof scrollPos !== \"number\" || startCursor === -1 ||\n\t\t\tendCursor === -1 || !items.size()) {\n\t\t\treturn;\n\t\t}\n\t\tconst size = this._status.size;\n\t\tconst { threshold, append, prepend } = this.options;\n\t\tconst datas = items.getGroups();\n\t\tconst endScrollPos = scrollPos + size;\n\t\tconst startEdgePos = Math.max(...datas[startCursor].outlines.start);\n\t\tconst endEdgePos = Math.min(...datas[endCursor].outlines.end);\n\t\tconst visibles = datas.map((group, i) => {\n\t\t\tconst { start, end } = group.outlines;\n\n\t\t\tif (!start.length || !end.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst startPos = Math.min(...start);\n\t\t\tconst endPos = Math.max(...end);\n\n\t\t\tif (startPos - threshold <= endScrollPos && scrollPos <= endPos + threshold) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t});\n\t\tconst startIndex = visibles.indexOf(true);\n\t\tconst endIndex = visibles.lastIndexOf(true);\n\n\t\tif (~startIndex && startIndex < startCursor) {\n\t\t\tprepend({ cache: datas.slice(startIndex, Math.min(startCursor, endIndex + 1)) });\n\t\t} else if (endCursor < endIndex) {\n\t\t\tappend({ cache: datas.slice(Math.max(startIndex, endCursor + 1), endIndex + 1) });\n\t\t} else {\n\t\t\t// if you have data(no cachedAppendData, has cachedPrependData) to pepend, request it.\n\t\t\tconst cachedAppendData = datas.slice(endCursor + 1, endCursor + 2);\n\t\t\tconst cachedPrependData = datas.slice(startCursor - 1, startCursor);\n\t\t\tconst isPrepend = scrollPos <= startEdgePos + threshold;\n\n\t\t\tif (\n\t\t\t\tendScrollPos >= endEdgePos - threshold\n\t\t\t\t&& (!isPrepend || cachedAppendData.length || !cachedPrependData.length)\n\t\t\t) {\n\t\t\t\tappend({ cache: cachedAppendData });\n\t\t\t} else if (isPrepend) {\n\t\t\t\tprepend({ cache: cachedPrependData });\n\t\t\t}\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst size = items.size();\n\n\t\tif (!this.options.useRecycle) {\n\t\t\tstatus.startCursor = 0;\n\t\t\tif (items.getOutline(size - 1, \"end\").length) {\n\t\t\t\tstatus.endCursor = size - 1;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (cursor !== \"end\") {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (cursor === \"start\") {\n\t\t\tstatus.startCursor = index;\n\t\t} else {\n\t\t\tstatus.endCursor = Math.min(size - 1, index);\n\t\t}\n\t\tstatus.startCursor = Math.max(0, status.startCursor);\n\t}\n\tpublic setStatus(status: IInfiniteStatus) {\n\t\tthis._status = assign(this._status, status);\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteStatus {\n\t\tconst { startCursor, endCursor, size } = this._status;\n\t\tconst startIndex = Math.max(this._itemManager.indexOf(startKey), 0);\n\t\tconst endIndex = (this._itemManager.indexOf(endKey) + 1 || this._itemManager.size()) - 1;\n\t\tconst start = Math.max(startCursor - startIndex, ~startCursor ? 0 : -1);\n\t\tconst end = Math.max(Math.min(endCursor - startIndex, endIndex - startIndex), start);\n\n\t\treturn {\n\t\t\tstartCursor: start,\n\t\t\tendCursor: end,\n\t\t\tsize,\n\t\t};\n\t}\n\tpublic getEdgeOutline(cursor: CursorType) {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\tif (startCursor === -1 || endCursor === -1) {\n\t\t\treturn [];\n\t\t}\n\t\treturn this._itemManager.getOutline(cursor === \"start\" ? startCursor : endCursor, cursor);\n\t}\n\tpublic getEdgeValue(cursor: CursorType) {\n\t\tconst outlines = this.getEdgeOutline(cursor);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic getVisibleItems(): IInfiniteGridItem[] {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.pluck(\"items\", startCursor, endCursor);\n\t}\n\tpublic getCursors() {\n\t\tconst status = this._status;\n\n\t\treturn [\n\t\t\tstatus.startCursor,\n\t\t\tstatus.endCursor,\n\t\t];\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\tconst { startCursor, endCursor } = this._status;\n\n\t\treturn this._itemManager.sliceGroups(startCursor, endCursor + 1);\n\t}\n\n\tpublic remove(groupIndex: number, itemIndex: number): IRemoveResult {\n\t\tconst status = this._status;\n\t\tconst items = this._itemManager;\n\t\tconst { startCursor, endCursor } = status;\n\t\tconst result = items.remove(groupIndex, itemIndex);\n\n\t\tif (result.group) {\n\t\t\tif (groupIndex < startCursor) {\n\t\t\t\tthis.setCursor(\"start\", startCursor - 1);\n\t\t\t}\n\t\t\tif (groupIndex <= endCursor) {\n\t\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t\t}\n\t\t}\n\t\tif (!items.size()) {\n\t\t\tstatus.startCursor = -1;\n\t\t\tstatus.endCursor = -1;\n\t\t}\n\t\treturn result;\n\t}\n\tpublic clear() {\n\t\tthis._status = {\n\t\t\tstartCursor: -1,\n\t\t\tendCursor: -1,\n\t\t\tsize: -1,\n\t\t};\n\t}\n}\n\nexport default Infinite;\n","/*\nCopyright (c) 2020-present NAVER Corp.\nname: @egjs/imready\nlicense: MIT\nauthor: NAVER Corp.\nrepository: https://github.com/naver/egjs-imready\nversion: 1.1.2\n*/\nimport Component from '@egjs/component';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\n\n/* global Reflect, Promise */\nvar extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n\n return extendStatics(d, b);\n};\n\nfunction __extends(d, b) {\n extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\nvar __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\nfunction __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n\n return r;\n}\n\n/*\negjs-imready\nCopyright (c) 2020-present NAVER Corp.\nMIT license\n*/\nvar isWindow = typeof window !== \"undefined\";\nvar ua = isWindow ? window.navigator.userAgent : \"\";\nvar SUPPORT_COMPUTEDSTYLE = isWindow ? !!(\"getComputedStyle\" in window) : false;\nvar IS_IE = /MSIE|Trident|Windows Phone|Edge/.test(ua);\nvar SUPPORT_ADDEVENTLISTENER = isWindow ? !!(\"addEventListener\" in document) : false;\nvar WIDTH = \"width\";\nvar HEIGHT = \"height\";\n\nfunction getAttribute(el, name) {\n return el.getAttribute(name) || \"\";\n}\nfunction toArray(arr) {\n return [].slice.call(arr);\n}\nfunction hasSizeAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"width\");\n}\nfunction hasLoadingAttribute(target) {\n return \"loading\" in target && target.getAttribute(\"loading\") === \"lazy\";\n}\nfunction hasSkipAttribute(target, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n return !!target.getAttribute(prefix + \"skip\");\n}\nfunction addEvent(element, type, handler) {\n if (SUPPORT_ADDEVENTLISTENER) {\n element.addEventListener(type, handler, false);\n } else if (element.attachEvent) {\n element.attachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = handler;\n }\n}\nfunction removeEvent(element, type, handler) {\n if (element.removeEventListener) {\n element.removeEventListener(type, handler, false);\n } else if (element.detachEvent) {\n element.detachEvent(\"on\" + type, handler);\n } else {\n element[\"on\" + type] = null;\n }\n}\nfunction innerWidth(el) {\n return getSize(el, \"Width\");\n}\nfunction innerHeight(el) {\n return getSize(el, \"Height\");\n}\nfunction getStyles(el) {\n return (SUPPORT_COMPUTEDSTYLE ? window.getComputedStyle(el) : el.currentStyle) || {};\n}\n\nfunction getSize(el, name) {\n var size = el[\"client\" + name] || el[\"offset\" + name];\n return parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n}\n\nfunction getContentElements(element, tags, prefix) {\n var skipElements = toArray(element.querySelectorAll(__spreadArrays([\"[\" + prefix + \"skip] [\" + prefix + \"width]\"], tags.map(function (tag) {\n return [\"[\" + prefix + \"skip] \" + tag, tag + \"[\" + prefix + \"skip]\", \"[\" + prefix + \"width] \" + tag].join(\", \");\n })).join(\", \")));\n return toArray(element.querySelectorAll(\"[\" + prefix + \"width], \" + tags.join(\", \"))).filter(function (el) {\n return skipElements.indexOf(el) === -1;\n });\n}\n\n/*\negjs-imready\nCopyright (c) 2020-present NAVER Corp.\nMIT license\n*/\nvar elements = [];\nfunction addAutoSizer(element, prefix) {\n !elements.length && addEvent(window, \"resize\", resizeAllAutoSizers);\n element.__PREFIX__ = prefix;\n elements.push(element);\n resize(element);\n}\nfunction removeAutoSizer(element, prefix) {\n var index = elements.indexOf(element);\n\n if (index < 0) {\n return;\n }\n\n var fixed = getAttribute(element, prefix + \"fixed\");\n delete element.__PREFIX__;\n element.style[fixed === HEIGHT ? WIDTH : HEIGHT] = \"\";\n elements.splice(index, 1);\n !elements.length && removeEvent(window, \"resize\", resizeAllAutoSizers);\n}\n\nfunction resize(element, prefix) {\n if (prefix === void 0) {\n prefix = \"data-\";\n }\n\n var elementPrefix = element.__PREFIX__ || prefix;\n var dataWidth = parseInt(getAttribute(element, \"\" + elementPrefix + WIDTH), 10) || 0;\n var dataHeight = parseInt(getAttribute(element, \"\" + elementPrefix + HEIGHT), 10) || 0;\n var fixed = getAttribute(element, elementPrefix + \"fixed\");\n\n if (fixed === HEIGHT) {\n var size = innerHeight(element) || dataHeight;\n element.style[WIDTH] = dataWidth / dataHeight * size + \"px\";\n } else {\n var size = innerWidth(element) || dataWidth;\n element.style[HEIGHT] = dataHeight / dataWidth * size + \"px\";\n }\n}\n\nfunction resizeAllAutoSizers() {\n elements.forEach(function (element) {\n resize(element);\n });\n}\n\nvar Loader =\n/*#__PURE__*/\nfunction (_super) {\n __extends(Loader, _super);\n\n function Loader(element, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _this = _super.call(this) || this;\n\n _this.isReady = false;\n _this.isPreReady = false;\n _this.hasDataSize = false;\n _this.hasLoading = false;\n _this.isSkip = false;\n\n _this.onCheck = function (e) {\n _this.clear();\n\n if (e && e.type === \"error\") {\n _this.onError(_this.element);\n } // I'm pre-ready and ready!\n\n\n var withPreReady = !_this.hasDataSize && !_this.hasLoading;\n\n _this.onReady(withPreReady);\n };\n\n _this.options = __assign({\n prefix: \"data-\"\n }, options);\n _this.element = element;\n _this.hasDataSize = hasSizeAttribute(element, _this.options.prefix);\n _this.hasLoading = hasLoadingAttribute(element);\n _this.isSkip = hasSkipAttribute(_this.element);\n return _this;\n }\n\n var __proto = Loader.prototype;\n\n __proto.check = function () {\n if (this.isSkip || !this.checkElement()) {\n // I'm Ready\n this.onAlreadyReady(true);\n return false;\n }\n\n if (this.hasDataSize) {\n addAutoSizer(this.element, this.options.prefix);\n }\n\n if (this.hasDataSize || this.hasLoading) {\n // I'm Pre Ready\n this.onAlreadyPreReady();\n } // Wati Pre Ready, Ready\n\n\n return true;\n };\n\n __proto.addEvents = function () {\n var _this = this;\n\n var element = this.element;\n this.constructor.EVENTS.forEach(function (name) {\n addEvent(element, name, _this.onCheck);\n });\n };\n\n __proto.clear = function () {\n var _this = this;\n\n var element = this.element;\n this.constructor.EVENTS.forEach(function (name) {\n removeEvent(element, name, _this.onCheck);\n });\n this.removeAutoSizer();\n };\n\n __proto.destroy = function () {\n this.clear();\n this.off();\n };\n\n __proto.removeAutoSizer = function () {\n if (this.hasDataSize) {\n // I'm already ready.\n var prefix = this.options.prefix;\n removeAutoSizer(this.element, prefix);\n }\n };\n\n __proto.onError = function (target) {\n this.trigger(\"error\", {\n element: this.element,\n target: target\n });\n };\n\n __proto.onPreReady = function () {\n if (this.isPreReady) {\n return;\n }\n\n this.isPreReady = true;\n this.trigger(\"preReady\", {\n element: this.element,\n hasLoading: this.hasLoading,\n isSkip: this.isSkip\n });\n };\n\n __proto.onReady = function (withPreReady) {\n if (this.isReady) {\n return;\n }\n\n if (withPreReady) {\n this.isPreReady = true;\n }\n\n this.removeAutoSizer();\n this.isReady = true;\n this.trigger(\"ready\", {\n element: this.element,\n withPreReady: withPreReady,\n hasLoading: this.hasLoading,\n isSkip: this.isSkip\n });\n };\n\n __proto.onAlreadyError = function (target) {\n var _this = this;\n\n setTimeout(function () {\n _this.onError(target);\n });\n };\n\n __proto.onAlreadyPreReady = function () {\n var _this = this;\n\n setTimeout(function () {\n _this.onPreReady();\n });\n };\n\n __proto.onAlreadyReady = function (withPreReady) {\n var _this = this;\n\n setTimeout(function () {\n _this.onReady(withPreReady);\n });\n };\n\n Loader.EVENTS = [];\n return Loader;\n}(Component);\n\nvar ElementLoader =\n/*#__PURE__*/\nfunction (_super) {\n __extends(ElementLoader, _super);\n\n function ElementLoader() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n var __proto = ElementLoader.prototype;\n\n __proto.setHasLoading = function (hasLoading) {\n this.hasLoading = hasLoading;\n };\n\n __proto.check = function () {\n if (this.isSkip) {\n // I'm Ready\n this.onAlreadyReady(true);\n return false;\n }\n\n if (this.hasDataSize) {\n addAutoSizer(this.element, this.options.prefix);\n this.onAlreadyPreReady();\n } else {\n // has not data size\n this.trigger(\"requestChildren\");\n }\n\n return true;\n };\n\n __proto.checkElement = function () {\n return true;\n };\n\n __proto.destroy = function () {\n this.clear();\n this.trigger(\"requestDestroy\");\n this.off();\n };\n\n __proto.onAlreadyPreReady = function () {\n // has data size\n _super.prototype.onAlreadyPreReady.call(this);\n\n this.trigger(\"reqeustReadyChildren\");\n };\n\n ElementLoader.EVENTS = [];\n return ElementLoader;\n}(Loader);\n\n/**\n * @alias eg.ImReady\n * @extends eg.Component\n */\n\nvar ImReadyManager =\n/*#__PURE__*/\nfunction (_super) {\n __extends(ImReadyManager, _super);\n /**\n * @param - ImReady's options\n */\n\n\n function ImReadyManager(options) {\n if (options === void 0) {\n options = {};\n }\n\n var _this = _super.call(this) || this;\n\n _this.readyCount = 0;\n _this.preReadyCount = 0;\n _this.totalCount = 0;\n _this.totalErrorCount = 0;\n _this.isPreReadyOver = true;\n _this.elementInfos = [];\n _this.options = __assign({\n loaders: {},\n prefix: \"data-\"\n }, options);\n return _this;\n }\n /**\n * Checks whether elements are in the ready state.\n * @ko 엘리먼트가 준비 상태인지 체크한다.\n * @elements - Elements to check ready status. 준비 상태를 체크할 엘리먼트들.\n * @example\n * ```html\n * \n * ```\n * ## Javascript\n * ```js\n * import ImReady from \"@egjs/imready\";\n *\n * const im = new ImReady(); // umd: eg.ImReady\n * im.check(document.querySelectorAll(\"img\")).on({\n * preReadyElement: e => {\n * // 1, 3\n * // 2, 3\n * // 3, 3\n * console.log(e.preReadyCount, e.totalCount),\n * },\n * });\n * ```\n */\n\n\n var __proto = ImReadyManager.prototype;\n\n __proto.check = function (elements) {\n var _this = this;\n\n var prefix = this.options.prefix;\n this.clear();\n this.elementInfos = toArray(elements).map(function (element, index) {\n var loader = _this.getLoader(element, {\n prefix: prefix\n });\n\n loader.check();\n loader.on(\"error\", function (e) {\n _this.onError(index, e.target);\n }).on(\"preReady\", function (e) {\n var info = _this.elementInfos[index];\n info.hasLoading = e.hasLoading;\n info.isSkip = e.isSkip;\n\n var isPreReady = _this.checkPreReady(index);\n\n _this.onPreReadyElement(index);\n\n isPreReady && _this.onPreReady();\n }).on(\"ready\", function (_a) {\n var withPreReady = _a.withPreReady,\n hasLoading = _a.hasLoading,\n isSkip = _a.isSkip;\n var info = _this.elementInfos[index];\n info.hasLoading = hasLoading;\n info.isSkip = isSkip;\n\n var isPreReady = withPreReady && _this.checkPreReady(index);\n\n var isReady = _this.checkReady(index); // Pre-ready and ready occur simultaneously\n\n\n withPreReady && _this.onPreReadyElement(index);\n\n _this.onReadyElement(index);\n\n isPreReady && _this.onPreReady();\n isReady && _this.onReady();\n });\n return {\n loader: loader,\n element: element,\n hasLoading: false,\n hasError: false,\n isPreReady: false,\n isReady: false,\n isSkip: false\n };\n });\n var length = this.elementInfos.length;\n this.totalCount = length;\n\n if (!length) {\n setTimeout(function () {\n _this.onPreReady();\n\n _this.onReady();\n });\n }\n\n return this;\n };\n /**\n * Gets the total count of elements to be checked.\n * @ko 체크하는 element의 총 개수를 가져온다.\n */\n\n\n __proto.getTotalCount = function () {\n return this.totalCount;\n };\n /**\n * Whether the elements are all pre-ready. (all sizes are known)\n * @ko 엘리먼트들이 모두 사전 준비가 됐는지 (사이즈를 전부 알 수 있는지) 여부.\n */\n\n\n __proto.isPreReady = function () {\n return this.elementInfos.every(function (info) {\n return info.isPreReady;\n });\n };\n /**\n * Whether the elements are all ready.\n * @ko 엘리먼트들이 모두 준비가 됐는지 여부.\n */\n\n\n __proto.isReady = function () {\n return this.elementInfos.every(function (info) {\n return info.isReady;\n });\n };\n /**\n * Whether an error has occurred in the elements in the current state.\n * @ko 현재 상태에서 엘리먼트들이 에러가 발생했는지 여부.\n */\n\n\n __proto.hasError = function () {\n return this.totalErrorCount > 0;\n };\n /**\n * Clears events of elements being checked.\n * @ko 체크 중인 엘리먼트들의 이벤트를 해제 한다.\n */\n\n\n __proto.clear = function () {\n this.isPreReadyOver = false;\n this.totalCount = 0;\n this.preReadyCount = 0;\n this.readyCount = 0;\n this.totalErrorCount = 0;\n this.elementInfos.forEach(function (info) {\n if (!info.isReady && info.loader) {\n info.loader.destroy();\n }\n });\n this.elementInfos = [];\n };\n /**\n * Destory all events.\n * @ko 모든 이벤트를 해제 한다.\n */\n\n\n __proto.destroy = function () {\n this.clear();\n this.off();\n };\n\n __proto.getLoader = function (element, options) {\n var _this = this;\n\n var tagName = element.tagName.toLowerCase();\n var loaders = this.options.loaders;\n var tags = Object.keys(loaders);\n\n if (loaders[tagName]) {\n return new loaders[tagName](element, options);\n }\n\n var loader = new ElementLoader(element, options);\n var children = toArray(element.querySelectorAll(tags.join(\", \")));\n loader.setHasLoading(children.some(function (el) {\n return hasLoadingAttribute(el);\n }));\n var withPreReady = false;\n var childrenImReady = this.clone().on(\"error\", function (e) {\n loader.onError(e.target);\n }).on(\"ready\", function () {\n loader.onReady(withPreReady);\n });\n loader.on(\"requestChildren\", function () {\n // has not data size\n var contentElements = getContentElements(element, tags, _this.options.prefix);\n childrenImReady.check(contentElements).on(\"preReady\", function (e) {\n withPreReady = e.isReady;\n\n if (!withPreReady) {\n loader.onPreReady();\n }\n });\n }).on(\"reqeustReadyChildren\", function () {\n // has data size\n // loader call preReady\n // check only video, image elements\n childrenImReady.check(children);\n }).on(\"requestDestroy\", function () {\n childrenImReady.destroy();\n });\n return loader;\n };\n\n __proto.clone = function () {\n return new ImReadyManager(__assign({}, this.options));\n };\n\n __proto.checkPreReady = function (index) {\n this.elementInfos[index].isPreReady = true;\n ++this.preReadyCount;\n\n if (this.preReadyCount < this.totalCount) {\n return false;\n }\n\n return true;\n };\n\n __proto.checkReady = function (index) {\n this.elementInfos[index].isReady = true;\n ++this.readyCount;\n\n if (this.readyCount < this.totalCount) {\n return false;\n }\n\n return true;\n };\n\n __proto.onError = function (index, target) {\n var info = this.elementInfos[index];\n info.hasError = true;\n /**\n * An event occurs if the image, video fails to load.\n * @ko 이미지, 비디오가 로딩에 실패하면 이벤트가 발생한다.\n * @event eg.ImReady#error\n * @param {eg.ImReady.OnError} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.element] - The element with error images.오류난 이미지가 있는 엘리먼트\n * @param {number} [e.index] - The item's index with error images. 오류난 이미지가 있는 엘리먼트의 인덱스\n * @param {HTMLElement} [e.target] - Error image target in element 엘리먼트의 오류난 이미지 타겟\n * @param {number} [e.errorCount] - The number of elements with errors 에러가 있는 엘리먼트들의 개수\n * @param {number} [e.totalErrorCount] - The total number of targets with errors 에러가 있는 타겟들의 총 개수\n * @example\n * ```html\n * \n * ```\n * ## Javascript\n * ```js\n * import ImReady from \"@egjs/imready\";\n *\n * const im = new ImReady(); // umd: eg.ImReady\n * im.check([document.querySelector(\"div\")]).on({\n * error: e => {\n * // ...
, 0, \n * console.log(e.element, e.index, e.target),\n * },\n * });\n * ```\n */\n\n this.trigger(\"error\", {\n element: info.element,\n index: index,\n target: target,\n errorCount: this.getErrorCount(),\n totalErrorCount: ++this.totalErrorCount\n });\n };\n\n __proto.onPreReadyElement = function (index) {\n var info = this.elementInfos[index];\n /**\n * An event occurs when the element is pre-ready (when the loading attribute is applied or the size is known)\n * @ko 해당 엘리먼트가 사전 준비되었을 때(loading 속성이 적용되었거나 사이즈를 알 수 있을 때) 이벤트가 발생한다.\n * @event eg.ImReady#preReadyElement\n * @param {eg.ImReady.OnPreReadyElement} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.element] - The pre-ready element.사전 준비된 엘리먼트\n * @param {number} [e.index] - The index of the pre-ready element. 사전 준비된 엘리먼트의 인덱스\n * @param {number} [e.preReadyCount] - Number of elements pre-ready 사전 준비된 엘리먼트들의 개수\n * @param {number} [e.readyCount] - Number of elements ready 준비된 엘리먼트들의 개수\n * @param {number} [e.totalCount] - Total number of elements 엘리먼트들의 총 개수\n * @param {boolean} [e.isPreReady] - Whether all elements are pre-ready 모든 엘리먼트가 사전 준비가 끝났는지 여부\n * @param {boolean} [e.isReady] - Whether all elements are ready 모든 엘리먼트가 준비가 끝났는지 여부\n * @param {boolean} [e.hasLoading] - Whether the loading attribute has been applied loading 속성이 적용되었는지 여부\n * @param {boolean} [e.isSkip] - Whether the check is omitted due to skip attribute skip 속성으로 인하여 체크가 생략됐는지 여부\n * @example\n * ```html\n * \n * ```\n * ## Javascript\n * ```js\n * import ImReady from \"@egjs/imready\";\n *\n * const im = new ImReady(); // umd: eg.ImReady\n * im.check(document.querySelectorAll(\"img\")).on({\n * preReadyElement: e => {\n * // 1, 3\n * // 2, 3\n * // 3, 3\n * console.log(e.preReadyCount, e.totalCount),\n * },\n * });\n * ```\n */\n\n this.trigger(\"preReadyElement\", {\n element: info.element,\n index: index,\n preReadyCount: this.preReadyCount,\n readyCount: this.readyCount,\n totalCount: this.totalCount,\n isPreReady: this.isPreReady(),\n isReady: this.isReady(),\n hasLoading: info.hasLoading,\n isSkip: info.isSkip\n });\n };\n\n __proto.onPreReady = function () {\n this.isPreReadyOver = true;\n /**\n * An event occurs when all element are pre-ready (When all elements have the loading attribute applied or the size is known)\n * @ko 모든 엘리먼트들이 사전 준비된 경우 (모든 엘리먼트들이 loading 속성이 적용되었거나 사이즈를 알 수 있는 경우) 이벤트가 발생한다.\n * @event eg.ImReady#preReady\n * @param {eg.ImReady.OnPreReady} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {number} [e.readyCount] - Number of elements ready 준비된 엘리먼트들의 개수\n * @param {number} [e.totalCount] - Total number of elements 엘리먼트들의 총 개수\n * @param {boolean} [e.isReady] - Whether all elements are ready 모든 엘리먼트가 준비가 끝났는지 여부\n * @param {boolean} [e.hasLoading] - Whether the loading attribute has been applied loading 속성이 적용되었는지 여부\n * @example\n * ```html\n * \n * ```\n * ## Javascript\n * ```js\n * import ImReady from \"@egjs/imready\";\n *\n * const im = new ImReady(); // umd: eg.ImReady\n * im.check(document.querySelectorAll(\"img\")).on({\n * preReady: e => {\n * // 0, 3\n * console.log(e.readyCount, e.totalCount),\n * },\n * });\n * ```\n */\n\n this.trigger(\"preReady\", {\n readyCount: this.readyCount,\n totalCount: this.totalCount,\n isReady: this.isReady(),\n hasLoading: this.hasLoading()\n });\n };\n\n __proto.onReadyElement = function (index) {\n var info = this.elementInfos[index];\n /**\n * An event occurs when the element is ready\n * @ko 해당 엘리먼트가 준비가 되었을 때 이벤트가 발생한다.\n * @event eg.ImReady#readyElement\n * @param {eg.ImReady.OnReadyElement} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {HTMLElement} [e.element] - The ready element.준비된 엘리먼트\n * @param {number} [e.index] - The index of the ready element. 준비된 엘리먼트의 인덱스\n * @param {boolean} [e.hasError] - Whether there is an error in the element 해당 엘리먼트에 에러가 있는지 여부\n * @param {number} [e.errorCount] - The number of elements with errors 에러가 있는 엘리먼트들의 개수\n * @param {number} [e.totalErrorCount] - The total number of targets with errors 에러가 있는 타겟들의 총 개수\n * @param {number} [e.preReadyCount] - Number of elements pre-ready 사전 준비된 엘리먼트들의 개수\n * @param {number} [e.readyCount] - Number of elements ready 준비된 엘리먼트들의 개수\n * @param {number} [e.totalCount] - Total number of elements 엘리먼트들의 총 개수\n * @param {boolean} [e.isPreReady] - Whether all elements are pre-ready 모든 엘리먼트가 사전 준비가 끝났는지 여부\n * @param {boolean} [e.isReady] - Whether all elements are ready 모든 엘리먼트가 준비가 끝났는지 여부\n * @param {boolean} [e.hasLoading] - Whether the loading attribute has been applied loading 속성이 적용되었는지 여부\n * @param {boolean} [e.isPreReadyOver] - Whether pre-ready is over 사전 준비가 끝났는지 여부\n * @param {boolean} [e.isSkip] - Whether the check is omitted due to skip attribute skip 속성으로 인하여 체크가 생략됐는지 여부\n * @example\n * ```html\n * \n * ```\n * ## Javascript\n * ```js\n * import ImReady from \"@egjs/imready\";\n *\n * const im = new ImReady(); // umd: eg.ImReady\n * im.check(document.querySelectorAll(\"img\")).on({\n * readyElement: e => {\n * // 1, 0, false, 3\n * // 2, 1, false, 3\n * // 3, 2, true, 3\n * console.log(e.readyCount, e.index, e.hasError, e.totalCount),\n * },\n * });\n * ```\n */\n\n this.trigger(\"readyElement\", {\n index: index,\n element: info.element,\n hasError: info.hasError,\n errorCount: this.getErrorCount(),\n totalErrorCount: this.totalErrorCount,\n preReadyCount: this.preReadyCount,\n readyCount: this.readyCount,\n totalCount: this.totalCount,\n isPreReady: this.isPreReady(),\n isReady: this.isReady(),\n hasLoading: info.hasLoading,\n isPreReadyOver: this.isPreReadyOver,\n isSkip: info.isSkip\n });\n };\n\n __proto.onReady = function () {\n /**\n * An event occurs when all element are ready\n * @ko 모든 엘리먼트들이 준비된 경우 이벤트가 발생한다.\n * @event eg.ImReady#ready\n * @param {eg.ImReady.OnReady} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n * @param {number} [e.errorCount] - The number of elements with errors 에러가 있는 엘리먼트들의 개수\n * @param {number} [e.totalErrorCount] - The total number of targets with errors 에러가 있는 타겟들의 총 개수\n * @param {number} [e.totalCount] - Total number of elements 엘리먼트들의 총 개수\n * @example\n * ```html\n * \n * ```\n * ## Javascript\n * ```js\n * import ImReady from \"@egjs/imready\";\n *\n * const im = new ImReady(); // umd: eg.ImReady\n * im.check(document.querySelectorAll(\"img\")).on({\n * preReady: e => {\n * // 0, 3\n * console.log(e.readyCount, e.totalCount),\n * },\n * ready: e => {\n * // 1, 3\n * console.log(e.errorCount, e.totalCount),\n * },\n * });\n * ```\n */\n this.trigger(\"ready\", {\n errorCount: this.getErrorCount(),\n totalErrorCount: this.totalErrorCount,\n totalCount: this.totalCount\n });\n };\n\n __proto.getErrorCount = function () {\n return this.elementInfos.filter(function (info) {\n return info.hasError;\n }).length;\n };\n\n __proto.hasLoading = function () {\n return this.elementInfos.some(function (info) {\n return info.hasLoading;\n });\n };\n\n return ImReadyManager;\n}(Component);\n\nvar ImageLoader =\n/*#__PURE__*/\nfunction (_super) {\n __extends(ImageLoader, _super);\n\n function ImageLoader() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n var __proto = ImageLoader.prototype;\n\n __proto.checkElement = function () {\n var element = this.element;\n var src = element.getAttribute(\"src\");\n\n if (element.complete && src) {\n if (!element.naturalWidth) {\n this.onAlreadyError(element);\n }\n\n return false;\n }\n\n this.addEvents();\n IS_IE && element.setAttribute(\"src\", src);\n return true;\n };\n\n ImageLoader.EVENTS = [\"load\", \"error\"];\n return ImageLoader;\n}(Loader);\n\nvar VideoLoader =\n/*#__PURE__*/\nfunction (_super) {\n __extends(VideoLoader, _super);\n\n function VideoLoader() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n var __proto = VideoLoader.prototype;\n\n __proto.checkElement = function () {\n var element = this.element; // HAVE_NOTHING: 0, no information whether or not the audio/video is ready\n // HAVE_METADATA: 1, HAVE_METADATA - metadata for the audio/video is ready\n // HAVE_CURRENT_DATA: 2, data for the current playback position is available, but not enough data to play next frame/millisecond\n // HAVE_FUTURE_DATA: 3, data for the current and at least the next frame is available\n // HAVE_ENOUGH_DATA: 4, enough data available to start playing\n\n if (element.readyState >= 1) {\n return false;\n }\n\n if (element.error) {\n this.onAlreadyError(element);\n return false;\n }\n\n this.addEvents();\n return true;\n };\n\n VideoLoader.EVENTS = [\"loadedmetadata\", \"error\"];\n return VideoLoader;\n}(Loader);\n\nvar ImReady =\n/*#__PURE__*/\nfunction (_super) {\n __extends(ImReady, _super);\n\n function ImReady(options) {\n if (options === void 0) {\n options = {};\n }\n\n return _super.call(this, __assign({\n loaders: {\n img: ImageLoader,\n video: VideoLoader\n }\n }, options)) || this;\n }\n\n return ImReady;\n}(ImReadyManager);\n\n/*\negjs-imready\nCopyright (c) 2020-present NAVER Corp.\nMIT license\n*/\n\nexport default ImReady;\nexport { ImageLoader, Loader, ImReadyManager as Manager, VideoLoader };\n//# sourceMappingURL=imready.esm.js.map\n","import ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, IInfiniteGridItem, IInfiniteGridGroup, RenderManagerEvents } from \"./types\";\nimport ImReady from \"@egjs/imready\";\nimport Infinite from \"./Infinite\";\nimport Component from \"@egjs/component\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport default class RenderManager {\n\tprivate _layout: ILayout;\n\tprivate im: ImReady;\n\tconstructor(\n\t\tprivate _infinite: Infinite,\n\t\tprivate _itemManager: ItemManager,\n\t\tprivate _renderer: DOMRenderer,\n\t\tprivate options: {\n\t\t\tattributePrefix: string;\n\t\t\tisEqualSize: boolean;\n\t\t\tisConstantSize: boolean;\n\t\t\thorizontal: boolean;\n\t\t},\n\t) { }\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic render(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst checkGroups = isAppend ? groups : groups.reverse();\n\t\tconst replaceTarget: number[] = [];\n\t\tconst removeTarget: HTMLElement[] = [];\n\t\tconst elements = items.map(item => item.el!);\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tconst im = new ImReady({\n\t\t\tprefix,\n\t\t});\n\n\t\tthis.im = im;\n\t\tim.check(elements);\n\t\tim.on(\"preReady\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._preReady(callbackComponent, checkGroups, items, isAppend);\n\t\t}).on(\"error\", ({\n\t\t\ttarget,\n\t\t\tindex,\n\t\t}) => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._error(callbackComponent, removeTarget, replaceTarget, target, items, index);\n\t\t}).on(\"readyElement\", e => {\n\t\t\tconst item = items[e.index];\n\n\t\t\titem.needUpdate = false;\n\t\t\tif (e.hasLoading && e.isPreReadyOver) {\n\t\t\t\tthis._readyElement(callbackComponent, items[e.index]);\n\t\t\t}\n\t\t}).on(\"ready\", () => {\n\t\t\tif (!this._itemManager) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._ready(callbackComponent, removeTarget, replaceTarget, items);\n\t\t});\n\n\t\treturn callbackComponent;\n\t}\n\tpublic destroy() {\n\t\tthis.im && this.im.destroy();\n\t}\n\tprivate _preReady(\n\t\tcallbackComponent: Component,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst infinite = this._infinite;\n\t\tconst layout = this._layout;\n\t\tconst itemManager = this._itemManager;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getGroup(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\t\tgroups.forEach(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = !outline.length || (outline.length === groupOutline.length ?\n\t\t\t\t!outline.every((v, index) => v === groupOutline[index]) : true);\n\n\t\t\tif (!isRelayout) {\n\t\t\t\toutline = group.outlines[isAppend ? \"end\" : \"start\"];\n\t\t\t\tthis._renderer.renderItems(group.items);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tthis._renderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\t\t});\n\n\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\tlet isInCursor = true;\n\n\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\tisInCursor = false;\n\t\t}\n\t\tif (isInCursor) {\n\t\t\tif (isAppend) {\n\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t} else {\n\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\trequestEndCursor = endCursor;\n\t\t\t}\n\t\t}\n\t\tif (requestStartCursor > requestEndCursor) {\n\t\t\tconst tempCursor = requestStartCursor;\n\n\t\t\trequestStartCursor = requestEndCursor;\n\t\t\trequestEndCursor = tempCursor;\n\t\t}\n\t\tcallbackComponent.trigger(\"renderComplete\", {\n\t\t\tstart: requestStartCursor,\n\t\t\tend: requestEndCursor,\n\t\t});\n\t\tcallbackComponent.trigger(\"layoutComplete\", {\n\t\t\titems: ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend: !!isAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst item = items[errorIndex];\n\t\tconst element = item.el!;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\t// remove item\n\t\tconst removeItem = () => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tremoveTarget.push(element);\n\t\t\tconst index = replaceTarget.indexOf(errorIndex);\n\n\t\t\tindex !== -1 && replaceTarget.splice(index, 1);\n\t\t};\n\t\t// remove image\n\t\tconst remove = () => {\n\t\t\tif (target === element) {\n\t\t\t\tremoveItem();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttarget.parentNode!.removeChild(target);\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace image\n\t\tconst replace = (src?: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (src) {\n\t\t\t\tif (matchHTML(src) || typeof src === \"object\") {\n\t\t\t\t\tconst parentNode = target.parentNode!;\n\n\t\t\t\t\tparentNode.insertBefore($(src), target);\n\t\t\t\t\tparentNode.removeChild(target);\n\t\t\t\t\titem.content = element.outerHTML;\n\t\t\t\t} else if (target instanceof HTMLImageElement) {\n\t\t\t\t\t(target as HTMLImageElement).src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}width`);\n\t\t\t\t\t\ttarget.removeAttribute(`${prefix}height`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\t// replace item\n\t\tconst replaceItem = (content: string) => {\n\t\t\tif (hasTarget(removeTarget, element)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telement.innerHTML = content;\n\t\t\titem.content = element.outerHTML;\n\t\t\tif (hasTarget(replaceTarget, errorIndex)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceTarget.push(errorIndex);\n\t\t};\n\t\tconst totalIndex = itemManager.pluck(\"items\").indexOf(item);\n\n\t\tif (target instanceof HTMLImageElement) {\n\t\t\tcallbackComponent.trigger(\"imageError\", {\n\t\t\t\ttarget,\n\t\t\t\telement,\n\t\t\t\titems,\n\t\t\t\titem,\n\t\t\t\titemIndex: errorIndex,\n\t\t\t\treplace,\n\t\t\t\treplaceItem,\n\t\t\t\tremove,\n\t\t\t\tremoveItem,\n\t\t\t\ttotalIndex,\n\t\t\t});\n\t\t}\n\t\tcallbackComponent.trigger(\"contentError\", {\n\t\t\ttarget,\n\t\t\telement,\n\t\t\titems,\n\t\t\titem,\n\t\t\titemIndex: errorIndex,\n\t\t\treplace,\n\t\t\treplaceItem,\n\t\t\tremove,\n\t\t\tremoveItem,\n\t\t\ttotalIndex,\n\t\t});\n\t}\n\tprivate _readyElement(\n\t\tcallbackComponent: Component,\n\t\titem: IInfiniteGridItem,\n\t) {\n\t\tcallbackComponent.trigger(\"readyElement\", {\n\t\t\titem,\n\t\t});\n\t}\n\tprivate _ready(\n\t\tcallbackComponent: Component,\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"ready\", { remove: [] });\n\t\t\treturn;\n\t\t}\n\t\tconst layoutedItems = replaceTarget.map(itemIndex => items[itemIndex]);\n\n\t\tif (!replaceTargetLength) {\n\t\t\tcallbackComponent.trigger(\"ready\", { remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tnew ImReady({\n\t\t\tprefix: attributePrefix,\n\t\t}).check(layoutedItems.map(v => v.el!)).on(\"ready\", () => {\n\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\tcallbackComponent.trigger(\"ready\", { remove: removeTarget, layout: true });\n\t\t});\n\t}\n}\n","import {\n\tIS_IOS,\n} from \"./consts\";\nimport {\n\twindow,\n} from \"./browser\";\nimport {\n\taddEvent,\n\tremoveEvent,\n\tscroll,\n\tscrollTo,\n\tscrollBy,\n\tassign,\n} from \"./utils\";\nimport { IWatchStatus, IWatcherOptions } from \"./types\";\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _resizeTimer = 0;\n\tprivate _maxResizeDebounceTimer = 0;\n\tprivate _containerOffset: number = 0;\n\tprivate _view: Window | HTMLElement;\n\tprivate _isScrollIssue: boolean = IS_IOS;\n\t// When InfiniteGrid is initialized.\n\t// The initial value is null to block the scroll event when returning from browser behavior.\n\tprivate _prevPos: number | null = null;\n\tconstructor(view: Window | HTMLElement, options: Partial = {}) {\n\t\tassign(this.options = {\n\t\t\tcontainer: view as HTMLElement,\n\t\t\tresize: () => void 0,\n\t\t\tcheck: () => void 0,\n\t\t\tisOverflowScroll: false,\n\t\t\thorizontal: false,\n\t\t\tresizeDebounce: 100,\n\t\t\tmaxResizeDebounce: 0,\n\t\t}, options);\n\t\tthis._view = view;\n\t\tthis.attachEvent();\n\t\tthis.resize();\n\t\tthis.setScrollPos();\n\t}\n\tpublic getStatus(): IWatchStatus {\n\t\treturn {\n\t\t\t_prevPos: this._prevPos,\n\t\t\tscrollPos: this.getOrgScrollPos(),\n\t\t};\n\t}\n\tpublic setStatus(status: IWatchStatus, applyScrollPos = true) {\n\t\tthis._prevPos = status._prevPos;\n\t\tapplyScrollPos && this.scrollTo(status.scrollPos);\n\t}\n\tpublic scrollBy(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollBy(this._view, arrPos[0], arrPos[1]);\n\t\tthis.setScrollPos();\n\t}\n\tpublic scrollTo(pos: number) {\n\t\tconst arrPos = this.options.horizontal ? [pos, 0] : [0, pos];\n\n\t\tscrollTo(this._view, arrPos[0], arrPos[1]);\n\t}\n\tpublic getScrollPos() {\n\t\treturn this._prevPos;\n\t}\n\tpublic setScrollPos(pos = this.getOrgScrollPos()) {\n\t\tthis._prevPos = pos - this.getContainerOffset();\n\t}\n\tpublic attachEvent() {\n\t\taddEvent(this._view, \"scroll\", this._onCheck);\n\t\taddEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic getOrgScrollPos() {\n\t\treturn scroll(this._view, this.options.horizontal);\n\t}\n\tpublic reset() {\n\t\tthis._prevPos = null;\n\t}\n\tpublic getContainerOffset() {\n\t\treturn this._containerOffset;\n\t}\n\tpublic resize() {\n\t\tthis._containerOffset = this.options.isOverflowScroll ? 0 : this._getOffset();\n\t}\n\tpublic detachEvent() {\n\t\tremoveEvent(this._view, \"scroll\", this._onCheck);\n\t\tremoveEvent(window, \"resize\", this._onResize);\n\t}\n\tpublic destroy() {\n\t\tthis.detachEvent();\n\t\tthis.reset();\n\t}\n\tprivate _getOffset() {\n\t\tconst { container, horizontal } = this.options;\n\t\tconst rect = container.getBoundingClientRect();\n\n\t\treturn rect[horizontal ? \"left\" : \"top\"] + this.getOrgScrollPos();\n\t}\n\tprivate _onCheck = () => {\n\t\tconst prevPos = this.getScrollPos();\n\t\tconst orgScrollPos = this.getOrgScrollPos();\n\n\t\tthis.setScrollPos(orgScrollPos);\n\t\tconst scrollPos = this.getScrollPos()!;\n\n\t\tif (prevPos === null || (this._isScrollIssue && orgScrollPos === 0) || prevPos === scrollPos) {\n\t\t\torgScrollPos && (this._isScrollIssue = false);\n\t\t\treturn;\n\t\t}\n\t\tthis._isScrollIssue = false;\n\t\tthis.options.check({\n\t\t\tisForward: prevPos < scrollPos,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t\thorizontal: this.options.horizontal,\n\t\t});\n\t}\n\tprivate _onResize = () => {\n\t\tconst {\n\t\t\tresizeDebounce,\n\t\t\tmaxResizeDebounce,\n\t\t} = this.options;\n\n\t\tconst onResize = () => {\n\t\t\tclearTimeout(this._resizeTimer);\n\t\t\tclearTimeout(this._maxResizeDebounceTimer);\n\n\t\t\tthis._maxResizeDebounceTimer = 0;\n\t\t\tthis._resizeTimer = 0;\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t};\n\t\tif (!this._maxResizeDebounceTimer && maxResizeDebounce >= resizeDebounce) {\n\t\t\tthis._maxResizeDebounceTimer = window.setTimeout(onResize, maxResizeDebounce);\n\t\t}\n\t\tif (this._resizeTimer) {\n\t\t\tclearTimeout(this._resizeTimer);\n\t\t\tthis._resizeTimer = 0;\n\t\t}\n\t\tthis._resizeTimer = window.setTimeout(onResize, resizeDebounce);\n\t}\n}\n","/**\n * Copyright (c) 2017 NAVER Corp.\n * egjs projects are licensed under the MIT license\n*/\nimport Component from \"@egjs/component\";\nimport ItemManager from \"./ItemManager\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport {\n\tIS_ANDROID2,\n\tIDLE,\n\tLOADING_APPEND,\n\tLOADING_PREPEND,\n\tPROCESSING,\n\tDEFENSE_BROWSER,\n\tIGNORE_CLASSNAME,\n\tDUMMY_POSITION,\n\tIS_IOS,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign, resetSize, hasClass, addClass } from \"./utils\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIInfiniteGridItem,\n\tIInfiniteGridGroup, IInfiniteGridStatus, IItem, IArrayFormat, IInfiniteGridOptions, RenderManagerEvents, InfiniteGridEvents\n} from \"./types\";\nimport RenderManager from \"./RenderManager\";\nimport Watcher from \"./Watcher\";\n\n// IE8\n// https://stackoverflow.com/questions/43216659/babel-ie8-inherit-issue-with-object-create\n/* eslint-disable */\n// if (typeof Object.create !== \"function\") {\n// // tslint:disable\n// Object.create = (o: any, properties: any) => {\n// if (typeof o !== \"object\" && typeof o !== \"function\") {\n// throw new TypeError(\"Object prototype may only be an Object: \" + o);\n// } else if (o === null) {\n// throw new Error(\"This browser's implementation of Object.create is a shim and doesn't support 'null' as the first argument.\");\n// }\n// function F() { }\n// F.prototype = o;\n// return new F();\n// };\n// // tslint:enable\n// }\n/* eslint-enable */\n\n/**\n * A module used to arrange card elements including content infinitely according to layout type. With this module, you can implement various layouts composed of different card elements whose sizes vary. It guarantees performance by maintaining the number of DOMs the module is handling under any circumstance\n * @ko 콘텐츠가 있는 카드 엘리먼트를 레이아웃 타입에 따라 무한으로 배치하는 모듈. 다양한 크기의 카드 엘리먼트를 다양한 레이아웃으로 배치할 수 있다. 카드 엘리먼트의 개수가 계속 늘어나도 모듈이 처리하는 DOM의 개수를 일정하게 유지해 최적의 성능을 보장한다\n * @alias eg.InfiniteGrid\n * @extends eg.Component\n *\n * @example\n```\n\n - \n
test1
\n \n - \n
test2
\n \n - \n
test3
\n \n - \n
test4
\n \n - \n
test5
\n \n - \n
test6
\n \n
\n\n```\n *\n * @support {\"ie\": \"8+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.1+ (except 3.x)\"}\n **/\nclass InfiniteGrid extends Component {\n\t/**\n\t * Version info string\n\t * @ko 버전정보 문자열\n\t * @name VERSION\n\t * @static\n\t * @type {String}\n\t * @example\n\t * eg.InfiniteGrid.VERSION; // ex) 3.3.3\n\t * @memberof eg.InfiniteGrid\n\t */\n\tpublic static VERSION = \"#__VERSION__#\";\n\n\tpublic options: IInfiniteGridOptions;\n\tprivate _loadingBar: {\n\t\tappend?: HTMLElement,\n\t\tprepend?: HTMLElement,\n\t} = {};\n\tprivate _itemManager: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _renderManager: RenderManager;\n\tprivate _layout: ILayout;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\n\tprivate _requestGroups: IInfiniteGridGroup[] = [];\n\n\t/**\n\t * @param {HTMLElement|string|jQuery} element A base element for a module 모듈을 적용할 기준 엘리먼트\n\t * @param {object} [options] The option object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 옵션 객체\n\t * @param {string} [options.itemSelector] A selector to select card elements that make up the layout레이아웃을 구성하는 카드 엘리먼트를 선택할 선택자(selector)\n\t * @param {boolean} [options.useRecycle=true] Indicates whether keep the number of DOMs is maintained. If the useRecycle value is 'true', keep the number of DOMs is maintained. If the useRecycle value is 'false', the number of DOMs will increase as card elements are added. DOM의 수를 유지할지 여부를 나타낸다. useRecycle 값이 'true'이면 DOM 개수를 일정하게 유지한다. useRecycle 값이 'false' 이면 카드 엘리먼트가 추가될수록 DOM 개수가 계속 증가한다.\n\t * @param {boolean} [options.isOverflowScroll=false] Indicates whether overflow:scroll is appliedoverflow:scroll 적용여부를 결정한다.\n\t * @param {boolean} [options.horizontal=false] Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향)\n\t * @param {boolean} [options.useFit=true] The useFit option scrolls upwards so that no space is visible until an item is added 위로 스크롤할 시 아이템을 추가하는 동안 보이는 빈 공간을 안보이게 한다.\n\t * @param {boolean} [options.isEqualSize=false] Indicates whether sizes of all card elements are equal to one another. If sizes of card elements to be arranged are all equal and this option is set to \"true\", the performance of layout arrangement can be improved. 카드 엘리먼트의 크기가 동일한지 여부. 배치될 카드 엘리먼트의 크기가 모두 동일할 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {boolean} [options.isConstantSize=false] Indicates whether sizes of all card elements does not change, the performance of layout arrangement can be improved. 모든 카드 엘리먼트의 크기가 불변일 때 이 옵션을 'true'로 설정하면 레이아웃 배치 성능을 높일 수 있다\n\t * @param {number} [options.transitionDruation=0] Indicates how many seconds a transition effect takes to complete. 트랜지션 효과를 완료하는데 걸리는 시간을 나타낸다.\n\t * @param {number} [options.threshold=100] The threshold size of an event area where card elements are added to a layout.레이아웃에 카드 엘리먼트를 추가하는 이벤트가 발생하는 기준 영역의 크기.\n\t * @param {string} [options.attributePrefix=\"data-\"] The prefix to use element's data attribute.엘리먼트의 데이타 속성에 사용할 접두사.\n\t * @param {number} [options.resizeDebounce=100] Debounce time to set in the resize event. 리사이즈 이벤트에 설정할 디바운스 시간.\n\t * @param {number} [options.maxResizeDebounce=0] Maximum time to debounce the resize event(0 is not set). 리사이즈 이벤트를 디바운스할 수 있는 최대 시간(0은 미설정이다).\n\t * @param {boolean} [options.renderExternal=false] Whether to use external rendering. It will delegate DOM manipulation and can synchronize the rendered state by calling `sync()` method. You can use this option to use in frameworks like React, Vue, Angular, which has its states and rendering methods.외부 렌더링을 사용할 지의 여부. 이 옵션을 사용시 렌더링을 외부에 위임할 수 있고, `sync()`를 호출하여 그 상태를 동기화할 수 있다. 이 옵션을 사용하여, React, Vue, Angular 등 자체적인 상태와 렌더링 방법을 갖는 프레임워크에 대응할 수 있다.\n\t * @param {boolean | Array<\"size\" | \"position\">} [options.percentage=false] Whether to set the css size and position of the item to %.item의 css size와 position를 %로 설정할지 여부.\n\t */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t}, options);\n\t\tDEFENSE_BROWSER && (this.options.useFit = false);\n\t\tIS_ANDROID2 && (this.options.isOverflowScroll = false);\n\t\tthis._reset();\n\n\t\tconst {\n\t\t\tisOverflowScroll,\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tthreshold,\n\t\t\tuseRecycle,\n\t\t\tattributePrefix,\n\t\t\tresizeDebounce,\n\t\t\tmaxResizeDebounce,\n\t\t\tpercentage,\n\t\t} = this.options;\n\n\t\tthis._itemManager = new ItemManager();\n\t\tthis._renderer = new DOMRenderer(element, {\n\t\t\tisEqualSize,\n\t\t\tisConstantSize,\n\t\t\thorizontal,\n\t\t\tcontainer: isOverflowScroll,\n\t\t\tpercentage,\n\t\t});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\n\t\t\t\tresizeDebounce,\n\t\t\t\tmaxResizeDebounce,\n\t\t\t\tisOverflowScroll,\n\t\t\t\thorizontal,\n\t\t\t\tcontainer: this._renderer.container,\n\t\t\t\tresize: () => this._onResize(),\n\t\t\t\tcheck: param => this._onCheck(param),\n\t\t\t});\n\n\t\tthis._infinite = new Infinite(this._itemManager, {\n\t\t\tuseRecycle,\n\t\t\tthreshold,\n\t\t\tappend: param => this._requestAppend(param),\n\t\t\tprepend: param => this._requestPrepend(param),\n\t\t\trecycle: param => this._recycle([param]),\n\t\t});\n\n\t\tthis._renderManager = new RenderManager(\n\t\t\tthis._infinite,\n\t\t\tthis._itemManager,\n\t\t\tthis._renderer,\n\t\t\t{\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t\thorizontal,\n\t\t\t},\n\t\t);\n\t}\n\t/**\n\t * Adds a card element at the bottom of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃 아래에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * 이 메소드는 isProcessing()의 반환값이 false일 경우에만 사용 가능하다.\n\t * @param - elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param - The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.append(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.append([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.append([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.append(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic append(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: true,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Adds a card element at the top of a layout. This method is available only if the isProcessing() method returns false.\n\t * @ko 카드 엘리먼트를 레이아웃의 위에 추가한다. isProcessing() 메서드의 반환값이 'false'일 때만 이 메서드를 사용할 수 있다\n\t * @param - elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param - The group key to be configured in a card element. It is automatically generated by default.\n\t * 추가할 카드 엘리먼트에 설정할 그룹 키. 생략하면 값이 자동으로 생성된다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.prepend(\"<div class='item'>test1</div><div class='item'>test2</div>\");\n\t * infinitegrid.prepend([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]);\n\t * infinitegrid.prepend([HTMLElement1, HTMLElement2]);\n\t * infinitegrid.prepend(jQuery([\"<div class='item'>test1</div>\", \"<div class='item'>test2</div>\"]));\n\t */\n\tpublic prepend(elements: HTMLElement[] | IJQuery | string[] | string, groupKey?: string | number) {\n\t\tthis._layout && this._insert({\n\t\t\telements,\n\t\t\tisAppend: false,\n\t\t\tgroupKey,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Layout class to use.\n\t * @ko 사용할 Layout 클래스를 지정한다.\n\t * @param {Class|Object} LayoutKlass The Layout class to use or an instance of a layout moudle사용할 Layout 클래스 또는 레이아웃 모듈의 인스턴스\n\t * @param {Object} options Options to apply to the Layout.Layout에 적용할 옵션\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * infinitegrid.setLayout(eg.InfiniteGrid.GridLayout, {\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.JustifiedLayout, {\n\t * margin: 10,\n\t * minSize: 100,\n\t * maxSize: 200\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.SquareLayout, {\n\t * margin: 10,\n\t * column: 2\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.FrameLayout, {\n\t * margin: 10,\n\t * frame: [\n\t * [1, 2],\n\t * [4, 3],\n\t * ]\n\t * });\n\t * infinitegrid.setLayout(eg.InfiniteGrid.PackingLayout, {\n\t * margin: 10,\n\t * aspectRatio: 1.5\n\t * });\n\t * var layout = new eg.InfiniteGrid.GridLayout({\n\t * margin: 10,\n\t * align: \"start\"\n\t * });\n\t * infinitegrid.setLayout(layout);\n\t */\n\tpublic setLayout(LayoutKlass: ILayout | (new (...args: any[]) => ILayout), options = {}) {\n\t\tconst { horizontal } = this.options;\n\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._layout = new LayoutKlass(assign(options, {\n\t\t\t\thorizontal,\n\t\t\t}));\n\t\t} else {\n\t\t\tLayoutKlass.options.horizontal = horizontal;\n\t\t\tthis._layout = LayoutKlass;\n\t\t}\n\n\t\tthis._renderManager.setLayout(this._layout);\n\t\tthis._renderer.resize();\n\t\tthis._setSize(this._renderer.getViewportSize());\n\t\treturn this;\n\t}\n\t/**\n\t * Returns the layouted items.\n\t * @ko 레이아웃된 아이템들을 반환한다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached items. 캐싱된 아이템을 포함할지 여부를 나타낸다.\n\t * @returns List of items 아이템의 목록\n\t */\n\tpublic getItems(includeCached = false): IInfiniteGridItem[] {\n\t\treturn includeCached ? this._itemManager.pluck(\"items\") : this._infinite.getVisibleItems();\n\t}\n\t/**\n\t * @param - Get items to render on screen.\n * @ko 화면에 렌더될 아이템들 가져온다.\n * @private\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t * @return - The items to be rendered on screen. 화면레 렌더될 아이템들.\n */\n\tpublic getRenderingItems(): IInfiniteGridItem[] {\n\t\tconst items = this.getItems();\n\t\tconst itemKeys: { [key: string]: any } = {};\n\n\t\titems.forEach(item => {\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t});\n\t\tconst nextVisisbleItems = ItemManager.pluck(this._requestGroups, \"items\").filter(item => {\n\t\t\tif (itemKeys[item.itemKey!]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\titemKeys[item.itemKey!] = true;\n\t\t\treturn true;\n\t\t});\n\n\t\treturn items.concat(nextVisisbleItems);\n\t}\n\t/**\n * Synchronize info of items with info given by external rendering.\n * @ko 외부 렌더링 방식에 의해 아이템의 정보들을 동기화한다.\n * @private\n * @param - all item infos to synchronize 동기화할 전체 아이템 정보들.\n */\n\tpublic beforeSync(items: IItem[]) {\n\t\treturn this._infinite.sync(items);\n\t}\n\t/**\n\t * Synchronize info of items with DOM info given by external rendering.\n\t * @ko 외부 렌더링 방식에 의해 입력받은 DOM의 정보와 현재 아이템 정보를 동기화 한다.\n\t * @private\n\t * @param - The DOM elements that are currently visible.현재 보여지고 있는 DOM 엘리먼트들.\n\t * @param - The groups currently being added by request.요청에 의해 지금 추가중인 그룹들.\n\t */\n\tpublic sync(elements: IArrayFormat) {\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst items = this.getRenderingItems();\n\n\t\titems.forEach((item, i) => {\n\t\t\tconst isChange = item.el !== elements[i];\n\t\t\titem.el = elements[i];\n\n\t\t\tif (isChange) {\n\t\t\t\tthis._renderer.renderItem(item, item.rect);\n\t\t\t}\n\t\t});\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tconst newItems = items.filter(item => item.needUpdate || !item.orgSize || !item.orgSize.width);\n\n\t\tif (newItems.length) {\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: false,\n\t\t\t\tgroups: infinite.getVisibleData(),\n\t\t\t\tnewItems,\n\t\t\t\tisAppend: true,\n\t\t\t\tisTrusted: false,\n\t\t\t});\n\t\t} else {\n\t\t\tconst size = itemManager.size();\n\n\t\t\tif (!size) {\n\t\t\t\tthis._requestAppend({});\n\t\t\t} else if (infinite.getCursor(\"start\") < 0) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren: false,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tthis._infinite.scroll(this._watcher.getScrollPos());\n\t\t\t}\n\t\t}\n\t}\n\t/**\n\t * Rearranges a layout.\n\t * @ko 레이아웃을 다시 배치한다.\n\t * @param {Boolean} [isRelayout=true] Indicates whether a card element is being relayouted 카드 엘리먼트 재배치 여부\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic layout(isRelayout = true) {\n\t\tif (!this._layout) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._itemManager;\n\t\tconst infinite = this._infinite;\n\t\tconst isResize = renderer.resize();\n\t\tconst items = this.getItems();\n\t\tconst { isEqualSize, isConstantSize, transitionDuration } = this.options;\n\t\tconst isLayoutAll = isRelayout && (isEqualSize || isConstantSize);\n\t\tconst size = itemManager.size();\n\n\t\tthis._watcher.resize();\n\n\t\tif (isRelayout) {\n\t\t\tif (isResize) {\n\t\t\t\tthis._setSize(renderer.getViewportSize());\n\t\t\t}\n\t\t}\n\t\t// check childElement\n\t\tif (!items.length) {\n\t\t\tconst children = toArray(renderer.container.children).filter(el => {\n\t\t\t\treturn el.className.indexOf(IGNORE_CLASSNAME) === -1;\n\t\t\t});\n\t\t\tconst hasChildren = children.length > 0;\n\n\t\t\tif (size) {\n\t\t\t\tconst firstGroup = itemManager.getGroup(0);\n\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tfirstGroup.items.forEach((item, i) => {\n\t\t\t\t\t\titem.el = children[i];\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t// has items, no visible items\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tgroups: [firstGroup],\n\t\t\t\t\thasChildren,\n\t\t\t\t\tfromCache: false,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t// no items, no visible items\n\t\t\t\tif (hasChildren) {\n\t\t\t\t\tlet groupKey: string | null | undefined = children[0].getAttribute(\"data-groupkey\");\n\n\t\t\t\t\tif (typeof groupKey !== \"string\") {\n\t\t\t\t\t\tgroupKey = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tthis._insert({\n\t\t\t\t\t\telements: children,\n\t\t\t\t\t\tisAppend: true,\n\t\t\t\t\t\thasChildren: true,\n\t\t\t\t\t\tgroupKey,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t\t}\n\t\t\t\t\tthis._requestAppend({});\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\t// layout datas\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.getGroups() :\n\t\t\titemManager.sliceGroups(startCursor, endCursor + 1);\n\n\t\t// LayoutManger interface\n\t\tthis._relayout(isRelayout, data, isResize ? items : []);\n\n\t\tif (isLayoutAll) {\n\t\t\tthis._fit();\n\t\t} else if (isRelayout && isResize) {\n\t\t\titemManager.clearOutlines(startCursor, endCursor);\n\t\t}\n\t\tthis._renderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: true,\n\t\t\tfromCache: true,\n\t\t\tisTrusted: false,\n\t\t\tuseRecycle: false,\n\t\t\tisLayout: true,\n\t\t});\n\t\treturn this;\n\t}\n\t/**\n\t * Removes a item corresponding to an index on a grid layout.\n\t * @ko 그리드 레이아웃에서 인덱스에 해당하는 아이템 삭제한다.\n\t * @param - Index of group corresponding to item to remove 삭제할 아이템에 해당하는 그룹의 인덱스\n\t * @param - Index of item to remove on group 그룹에서 삭제할 아이템의 인덱스\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic removeByIndex(groupIndex: number, itemIndex: number, isLayout = true) {\n\t\tconst { items, group } = this._infinite.remove(groupIndex, itemIndex);\n\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.removeElement(item.el!);\n\t\t});\n\n\t\tif (items.length) {\n\t\t\tisLayout && this.layout(!!group);\n\n\t\t\treturn items;\n\t\t}\n\t\treturn [];\n\t}\n\t/**\n\t * Removes a item element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed items information 삭제된 아이템들 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tconst { groupIndex, itemIndex } = this._itemManager.indexesOfElement(element);\n\n\t\treturn this.removeByIndex(groupIndex, itemIndex, isLayout);\n\t}\n\t/**\n\t * Returns the list of group keys which belongs to card elements currently being maintained. You can use the append() or prepend() method to configure group keys so that multiple card elements can be managed at once. If you do not use these methods to configure group keys, groupkey is automatically generated.\n\t * @ko 현재 유지하고 있는 카드 엘리먼트의 그룹 키 목록을 반환한다. 여러 개의 카드 엘리먼트를 묶어서 관리할 수 있도록 append() 메서드나 prepend() 메서드에서 그룹 키를 지정할 수 있다. append() 메서드나 prepend() 메서드에서 그룹 키를 지정하지 않았다면 자동으로 그룹키가 생성된다.\n\t * @param {Boolean} includeCached Indicates whether to include the cached groups. 캐싱된 그룹을 포함할지 여부를 나타낸다.\n\t * @return {Array} List of group keys 그룹 키의 목록\n\t */\n\tpublic getGroupKeys(includeCached?: boolean) {\n\t\tconst data = includeCached ?\n\t\t\tthis._itemManager.getGroups() : this._infinite.getVisibleData();\n\n\t\treturn data.map(v => v.groupKey);\n\t}\n\t/**\n\t * Returns the current state of a module such as location information. You can use the setStatus() method to restore the information returned through a call to this method.\n\t * @ko 카드의 위치 정보 등 모듈의 현재 상태 정보를 반환한다. 이 메서드가 반환한 정보를 저장해 두었다가 setStatus() 메서드로 복원할 수 있다\n\t * @return {Object} State object of the eg.InfiniteGrid moduleeg.InfiniteGrid 모듈의 상태 객체\n\t */\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IInfiniteGridStatus {\n\t\treturn {\n\t\t\t_status: assign({}, this._status),\n\t\t\t_itemManager: this._itemManager.getStatus(startKey, endKey),\n\t\t\t_renderer: this._renderer.getStatus(),\n\t\t\t_watcher: this._watcher.getStatus(),\n\t\t\t_infinite: this._infinite.getStatus(startKey, endKey),\n\t\t};\n\t}\n\t/**\n\t * Sets the state of the eg.InfiniteGrid module with the information returned through a call to the getStatue() method.\n\t * @ko getStatue() 메서드가 저장한 정보로 eg.InfiniteGrid 모듈의 상태를 설정한다.\n\t * @param {Object} status State object of the eg.InfiniteGrid module eg.InfiniteGrid 모듈의 상태 객체\n\t * @param {boolean} [applyScrollPos=true] Checks whether to scroll스크롤의 위치를 복원할지 결정한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setStatus(status: IInfiniteGridStatus, applyScrollPos = true, syncElements?: HTMLElement[]) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _itemManager, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_itemManager || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst items = this._itemManager;\n\t\tconst renderer = this._renderer;\n\t\tconst watcher = this._watcher;\n\t\tconst infinite = this._infinite;\n\n\t\twatcher.detachEvent();\n\t\tassign(this._status, _status);\n\t\tthis._status.processingStatus = IDLE;\n\t\titems.setStatus(_itemManager);\n\t\trenderer.setStatus(_renderer);\n\t\tinfinite.setStatus(_infinite);\n\n\t\tconst visibleItems = this.getItems();\n\t\tconst length = visibleItems.length;\n\n\t\tif (renderExternal) {\n\t\t\tvisibleItems.forEach((item, i) => {\n\t\t\t\titem.el = syncElements![i];\n\t\t\t});\n\t\t\tthis._renderer.renderItems(visibleItems);\n\t\t} else {\n\t\t\trenderer.createAndInsert(visibleItems, true);\n\t\t}\n\t\tconst isReLayout = renderer.isNeededResize();\n\n\t\twatcher.setStatus(_watcher, applyScrollPos);\n\t\twatcher.attachEvent();\n\n\t\tconst { isConstantSize, isEqualSize } = this.options;\n\n\t\tif (!length) {\n\t\t\tthis._requestAppend({ cache: [] });\n\t\t} else if (isReLayout) {\n\t\t\trenderer.resize();\n\t\t\tthis._setSize(renderer.getViewportSize());\n\n\t\t\tif (isConstantSize) {\n\t\t\t\tthis.layout(true);\n\t\t\t} else {\n\t\t\t\tthis._itemManager.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.getGroups() : infinite.getVisibleData(),\n\t\t\t\t\titems: visibleItems,\n\t\t\t\t\tnewItems: visibleItems,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisTrusted: false,\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tthis.layout(false);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Clears added card elements and data.\n\t * @ko 추가된 카드 엘리먼트와 데이터를 모두 지운다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic clear() {\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.clear();\n\t\tthis._infinite.clear();\n\t\tthis._reset();\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Specifies the Loading Bar to use for append or prepend items.\n\t * @ko 아이템을 append 또는 prepend 하기 위해 사용할 로딩 바를 지정한다.\n\t * @param {String|Object} [userLoadingBar={}] The loading bar HTML markup or element or element selector 로딩 바 HTML 또는 element 또는 selector \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic setLoadingBar(userLoadingBar: {\n\t\tappend?: string | HTMLElement,\n\t\tprepend?: string | HTMLElement,\n\t} | string = {}) {\n\t\tconst loadingBarObj: {\n\t\t\tappend?: string | HTMLElement,\n\t\t\tprepend?: string | HTMLElement,\n\t\t} = typeof userLoadingBar === \"object\" ? userLoadingBar : {\n\t\t\tappend: userLoadingBar,\n\t\t\tprepend: userLoadingBar,\n\t\t};\n\n\t\tthis._status.loadingSize = 0;\n\t\tthis._status.loadingStyle = {};\n\t\tconst loadingBar = this._loadingBar;\n\n\t\tlet isChangeLoadingBar = false;\n\n\t\tfor (const type in loadingBarObj) {\n\t\t\tconst loadingElement = $(loadingBarObj[type as \"append\" | \"prepend\"]!);\n\n\t\t\tif (loadingBar[type as \"append\" | \"prepend\"] !== loadingElement) {\n\t\t\t\tloadingBar[type as \"append\" | \"prepend\"] = loadingElement;\n\t\t\t\tisChangeLoadingBar = true;\n\t\t\t}\n\n\t\t\tif (!hasClass(loadingElement, IGNORE_CLASSNAME)) {\n\t\t\t\taddClass(loadingElement, IGNORE_CLASSNAME);\n\t\t\t}\n\t\t}\n\t\tif (isChangeLoadingBar) {\n\t\t\tthis._renderLoading();\n\t\t}\n\t\tthis._appendLoadingBar();\n\t\treturn this;\n\t}\n\t/**\n\t * Checks whether a card element or data is being added.\n\t * @ko 카드 엘리먼트 추가 또는 데이터 로딩이 진행 중인지 확인한다\n\t * @return {Boolean} Indicates whether a card element or data is being added 카드 엘리먼트 추가 또는 데이터 로딩 진행 중 여부\n\t */\n\tpublic isProcessing() {\n\t\treturn this._isProcessing() || this.isLoading();\n\t}\n\t/**\n\t * Checks whether data is loading.\n\t * @ko 데이터 로딩 중인지 확인한다\n\t * @return {Boolean} Indicates whether data is loading 데이터 로딩 진행 중 여부\n\t */\n\tpublic isLoading() {\n\t\treturn this._getLoadingStatus() > 0;\n\t}\n\t/**\n\t * Returns the element of loading bar.\n\t * @ko 로딩 바의 element를 반환한다.\n\t * @param {Boolean} [isAppend=currentLoadingBar|true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @return {Element} The element of loading bar. 로딩 바의 element\n\t */\n\tpublic getLoadingBar(isAppend = this._getLoadingStatus() !== LOADING_PREPEND) {\n\t\treturn this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\t}\n\t/**\n\t * Start loading for append/prepend during loading data.\n\t * @ko 데이터가 로딩되는 동안 append/prepend하길 위해 로딩을 시작한다.\n\t * @param {Boolean} [isAppend=true] Checks whether the card element is added to the append () method. 카드 엘리먼트가 append() 메서드로 추가 할 것인지 확인한다.\n\t * @param {Object} [userStyle = {display: \"block\"}] custom style to apply to this loading bar for start. 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic startLoading(isAppend?: boolean, userStyle: StyleType = { display: \"block\" }) {\n\t\tif (this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._process(isAppend ? LOADING_APPEND : LOADING_PREPEND);\n\t\tif (!this._loadingBar[type]) {\n\t\t\treturn this;\n\t\t}\n\n\t\tconst next = () => {\n\t\t\tthis._renderLoading(userStyle);\n\t\t\tthis._status.loadingStyle = userStyle;\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fit();\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\n\t\t\t}\n\t\t};\n\t\tif (this.options.renderExternal) {\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext,\n\t\t\t});\n\t\t} else {\n\t\t\tnext();\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * End loading after startLoading() for append/prepend\n\t * @ko append/prepend하길 위해 startLoading() 호출해선 걸었던 로딩을 끝낸다.\n\t * @param {Object} [userStyle = {display: \"none\"}] custom style to apply to this loading bar for end 로딩 시작을 위한 로딩 바에 적용할 커스텀 스타일 \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic endLoading(userStyle: StyleType = { display: \"none\" }) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst type = isAppend ? \"append\" : \"prepend\";\n\t\tconst el = this._loadingBar[type];\n\t\tconst status = this._status;\n\t\tconst size = status.loadingSize;\n\n\t\tthis._process(LOADING_APPEND | LOADING_PREPEND, false);\n\t\tstatus.loadingSize = 0;\n\t\tstatus.loadingStyle = {};\n\t\tif (el) {\n\t\t\tconst style: StyleType = assign({\n\t\t\t\t[this.options.horizontal ? \"left\" : \"top\"]: `${-size}px`,\n\t\t\t}, userStyle);\n\n\t\t\tfor (const property in style) {\n\t\t\t\tel.style[property] = style[property as keyof StyleType];\n\t\t\t}\n\t\t\tif (!isAppend) {\n\t\t\t\tthis._fitItems(size);\n\t\t\t} else {\n\t\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\"));\n\t\t\t}\n\t\t\tif (this.options.renderExternal) {\n\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\tnext: () => { },\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tif (this.options.useRecycle && !this.isProcessing()) {\n\t\t\tthis._infinite.recycle(this._watcher.getScrollPos(), isAppend);\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Retrieves the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 가져온다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return The item containing the content, size and position,etccontent, size, position 등이 담겨있는 item 정보\n\t * @example\n\n\t ig.getItem(0, 0);\n\t ig.getItem(element);\n\n\t {\n\t el: HTMLElement,\n\t content: \"...
\",\n\t size: {width: ..., height: ...},\n\t rect: {top: ..., left: ..., width: ..., height: ...},\n\t }\n\t */\n\tpublic getItem(groupIndex: HTMLElement | number = 0, itemIndex?: number): IInfiniteGridItem | undefined {\n\t\tif (typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this.getItems();\n\t\t\tconst length = items.length;\n\n\t\t\tfor (let i = 0; i < length; ++i) {\n\t\t\t\tif (items[i].el === groupIndex) {\n\t\t\t\t\treturn items[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn undefined;\n\t\t} else {\n\t\t\tconst group = this._itemManager.getGroup(groupIndex);\n\n\t\t\treturn group && group.items[itemIndex || 0];\n\t\t}\n\t}\n\t/**\n\t * Updates the item via index or the element.\n\t * @ko index 또는 element를 통해 아이템을 업데이트한다.\n\t * @param {number | HTMLElement} [groupIndex=0] The element corresponding to item or the index of the group where the item is in position item에 해당하는 element 또는 해당 item이 있는 group의 index\n\t * @param {number} [itemIndex] If groupIndex is used, the index of the item in the group groupIndex를 사용할 경우 해당 group에 있는 Item의 index \n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\tig.updateItem(element);\n\tig.updateItem(0, 0);\n\t */\n\tpublic updateItem(groupIndex?: number, itemIndex?: number) {\n\t\tconst item = this.getItem(groupIndex, itemIndex);\n\n\t\tthis._updateItem(item) && this.layout(false);\n\n\t\treturn this;\n\t}\n\t/**\n\t * Update the currently displayed items.\n\t * @ko 현재보여주는 아이템들을 업데이트한다.\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\telement.innerHTML = \"2\";\n\telement.style.height = \"400px\";\n\n\telement2.innerHTML = \"2\";\n\telement2.style.height = \"400px\";\n\n\tig.updateItems();\n\t */\n\tpublic updateItems() {\n\t\tthis.getItems().forEach(item => {\n\t\t\tthis._updateItem(item);\n\t\t});\n\t\tthis.layout(false);\n\t\treturn this;\n\t}\n\t/**\n\t * Move to some group or item position.\n\t * @ko 해당하는 그룹 또는 아이템의 위치로 이동한다.\n\t * @param {Number} [index] group's index 그룹의 index\n\t * @param {Number} [itemIndex=-1] item's index 그룹의 index\n\t * @return {eg.InfiniteGrid} An instance of a module itself모듈 자신의 인스턴스\n\t */\n\tpublic moveTo(index: number, itemIndex = 0) {\n\t\tif (this.isProcessing()) {\n\t\t\treturn this;\n\t\t}\n\t\tconst data = this._itemManager.getGroup(index);\n\n\t\tif (!data) {\n\t\t\treturn this;\n\t\t}\n\t\tconst infinite = this._infinite;\n\t\tconst outlines = data.outlines;\n\t\tconst items = data.items;\n\t\tconst item = items[itemIndex];\n\t\tconst isResize = outlines.start && (outlines.start.length === 0);\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tconst isInCursor = startCursor <= index && index <= endCursor;\n\t\tconst { useRecycle, horizontal } = this.options;\n\n\t\tif (isInCursor || !useRecycle || !isResize) {\n\t\t\tlet pos = item ? item.rect[horizontal ? \"left\" : \"top\"] : Math.max(...outlines.start);\n\t\t\tconst fit = Math.min(...outlines.start);\n\n\t\t\tif (fit < 0) {\n\t\t\t\t// base < 0\n\t\t\t\tthis._fitItems(fit, 0);\n\t\t\t\tpos -= fit;\n\t\t\t}\n\t\t\tconst isAppend = index > startCursor;\n\n\t\t\tif (isInCursor || isAppend) {\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tthis._postLayout({\n\t\t\t\tfromCache: true,\n\t\t\t\tgroups: [data],\n\t\t\t\titems,\n\t\t\t\tnewItems: [],\n\t\t\t\tisAppend,\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst scrollPos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\tif (!isInCursor) {\n\t\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\t}\n\t\t\t\tthis._scrollTo(scrollPos);\n\t\t\t\tthis._setScrollPos(scrollPos);\n\t\t\t});\n\t\t\treturn this;\n\t\t} else {\n\t\t\tconst isAppend = index > endCursor || index < startCursor - 1;\n\n\t\t\tthis._postCache({\n\t\t\t\tisAppend,\n\t\t\t\tcache: [data],\n\t\t\t\tisTrusted: false,\n\t\t\t})!.on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\tconst itemManager = this._itemManager;\n\n\t\t\t\tif (!itemManager) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst pos = items[itemIndex].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\titemManager.clearOutlines(start, end);\n\t\t\t\tthis._scrollTo(pos);\n\t\t\t\tthis._setScrollPos(pos);\n\t\t\t});\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n * Destroys elements, properties, and events used on a grid layout.\n * @ko 그리드 레이아웃에 사용한 엘리먼트와 속성, 이벤트를 해제한다\n */\n\tpublic destroy() {\n\t\tthis._infinite.clear();\n\t\tthis._watcher.destroy();\n\t\tthis._reset();\n\t\tthis._itemManager.clear();\n\t\tthis._renderer.destroy();\n\t\tthis._renderManager.destroy();\n\t}\n\tprivate _relayout(isRelayout: boolean, groups: IInfiniteGridGroup[], items: IInfiniteGridItem[]) {\n\t\tconst renderer = this._renderer;\n\t\tconst { isEqualSize, isConstantSize } = renderer.options;\n\t\tconst layoutGroups = groups.filter(group => {\n\t\t\tconst item = group.items[0];\n\n\t\t\treturn item.orgSize && item.rect.top > DUMMY_POSITION / 10;\n\t\t});\n\n\t\tif (!layoutGroups.length) {\n\t\t\treturn [];\n\t\t}\n\t\tlet outline = layoutGroups[0].outlines.start;\n\n\t\tif (isRelayout) {\n\t\t\toutline = [outline.length ? Math.min(...outline) : 0];\n\t\t\tif (!isConstantSize && items.length) {\n\t\t\t\trenderer.updateSize(items);\n\n\t\t\t\t// update invisible items' size\n\t\t\t\tif (isEqualSize && items[0].size) {\n\t\t\t\t\tItemManager.pluck(layoutGroups, \"items\").forEach(item => {\n\t\t\t\t\t\titem.size = assign({}, items[0].size);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._layout.layout(layoutGroups, outline);\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._itemManager.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tif (!this.options.renderExternal) {\n\t\t\tconst loadingBar = this._loadingBar;\n\t\t\tconst container = this._renderer.container;\n\n\t\t\tfor (const type in loadingBar) {\n\t\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]!);\n\t\t\t}\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._layout.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._itemManager.fit(base, this.options.horizontal);\n\t\tthis._renderer.renderItems(this.getItems());\n\t\tthis._setContainerSize(this._getEdgeValue(\"end\") || margin);\n\t\tbase < 0 && this._watcher.scrollBy(-base);\n\t}\n\t// called by visible\n\tprivate _fit(useFit = this.options.useFit) {\n\t\tlet base = this._getEdgeValue(\"start\");\n\t\tconst margin = (this._getLoadingStatus() === LOADING_PREPEND && this._status.loadingSize) || 0;\n\t\tconst { isConstantSize, isEqualSize, useRecycle } = this.options;\n\n\t\tif (!useRecycle || !useFit || isConstantSize || isEqualSize) {\n\t\t\tif (base < margin) {\n\t\t\t\tthis._fitItems(base - margin, margin);\n\t\t\t}\n\t\t\tbase = 0;\n\t\t} else if (base !== 0 || margin) {\n\t\t\tthis._fitItems(base - margin, margin);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t\tthis.isLoading() && this._renderLoading();\n\t\treturn base;\n\t}\n\tprivate _getEdgeValue(cursor: CursorType) {\n\t\treturn this._infinite.getEdgeValue(cursor);\n\t}\n\tprivate _isProcessing() {\n\t\treturn (this._status.processingStatus & PROCESSING) > 0;\n\t}\n\tprivate _getLoadingStatus() {\n\t\treturn this._status.processingStatus & (LOADING_APPEND | LOADING_PREPEND);\n\t}\n\tprivate _process(status: number, isAdd = true) {\n\t\tif (isAdd) {\n\t\t\tthis._status.processingStatus |= status;\n\t\t} else {\n\t\t\tthis._status.processingStatus -= this._status.processingStatus & status;\n\t\t}\n\t}\n\tprivate _insert({\n\t\telements,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\telements: string | string[] | HTMLElement[] | IJQuery,\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (this._isProcessing() || elements.length === 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst items = ItemManager.toItems($(elements, true), groupKey);\n\n\t\tthis._insertItems({\n\t\t\titems,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tgroupKey,\n\t\t});\n\t}\n\tprivate _insertItems({\n\t\titems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tgroupKey = new Date().getTime() + Math.floor(Math.random() * 1000),\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tgroupKey?: string | number,\n\t}) {\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst group = this._itemManager[isAppend ? \"appendGroup\" : \"prependGroup\"]({\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t})!;\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\n\t\t\tinfinite.setCursor(\"start\", startCursor + 1);\n\t\t\tinfinite.setCursor(\"end\", endCursor + 1);\n\t\t}\n\t\tthis._postLayout({\n\t\t\tfromCache: false,\n\t\t\tgroups: [group],\n\t\t\titems: group.items,\n\t\t\tnewItems: group.items,\n\t\t\tisAppend,\n\t\t\thasChildren,\n\t\t\tisTrusted: false,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle(ranges: Array<{ start: number, end: number }>) {\n\t\tconst { useRecycle, renderExternal } = this.options;\n\t\tif (!useRecycle) {\n\t\t\treturn false;\n\t\t}\n\t\tlet isRecycle = false;\n\t\tranges.forEach(({ start, end }) => {\n\t\t\tif (start === -1 || end === -1 || end < start) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst items = this._itemManager.pluck(\"items\", start, end);\n\n\t\t\tisRecycle = isRecycle || items.some(item => item.mounted);\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = false;\n\t\t\t});\n\t\t\tif (!renderExternal) {\n\t\t\t\tDOMRenderer.removeItems(items);\n\t\t\t}\n\t\t});\n\t\tif (isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t\treturn isRecycle;\n\t}\n\tprivate _renderLoading(userStyle = this._status.loadingStyle) {\n\t\tif (!this.isLoading()) {\n\t\t\treturn;\n\t\t}\n\t\tconst isAppend = this._getLoadingStatus() === LOADING_APPEND;\n\t\tconst el = this._loadingBar[isAppend ? \"append\" : \"prepend\"];\n\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\t\tconst style = assign({\n\t\t\tposition: \"absolute\",\n\t\t}, userStyle);\n\n\t\tfor (const property in style) {\n\t\t\tel.style[property] = style[property as keyof StyleType];\n\t\t}\n\t\tthis._status.loadingSize = this.options.horizontal ? outerWidth(el) : outerHeight(el);\n\t\tconst posName = this.options.horizontal ? \"left\" : \"top\";\n\n\t\tif (!(posName in style)) {\n\t\t\tconst pos = isAppend ? this._getEdgeValue(\"end\") : this._getEdgeValue(\"start\") - this._status.loadingSize;\n\n\t\t\tel.style[posName] = `${pos}px`;\n\t\t}\n\t}\n\tprivate _updateItem(item?: IInfiniteGridItem) {\n\t\tif (item && item.el) {\n\t\t\titem.content = item.el.outerHTML;\n\n\t\t\t!this.options.isEqualSize && resetSize(item);\n\t\t\tthis._renderer.updateSize([item]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\tprivate _setScrollPos(pos: number) {\n\t\tthis._watcher.setScrollPos(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _scrollTo(pos: number) {\n\t\tthis._watcher.scrollTo(this._watcher.getContainerOffset() + pos);\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tconst { isConstantSize } = this.options;\n\t\tconst items = ItemManager.pluck(cache, \"items\");\n\t\tlet fromCache = true;\n\t\tconst newItems = items.filter(item => {\n\t\t\tif (!item.orgSize || !item.orgSize.width) {\n\t\t\t\tfromCache = false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn !isConstantSize && item.rect.top < DUMMY_POSITION / 10;\n\t\t});\n\n\t\treturn this._postLayout({\n\t\t\tfromCache,\n\t\t\tgroups: cache,\n\t\t\titems,\n\t\t\tnewItems,\n\t\t\tisAppend,\n\t\t\tisTrusted,\n\t\t});\n\t}\n\tprivate _postLayout({\n\t\tfromCache,\n\t\tgroups,\n\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\tnewItems,\n\t\tisAppend,\n\t\thasChildren,\n\t\tisTrusted,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems?: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\thasChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t}) {\n\t\tthis._process(PROCESSING);\n\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst renderExternal = this.options.renderExternal;\n\t\tconst renderer = this._renderer;\n\t\tconst callbackComponent = new Component();\n\n\t\tconst next = () => {\n\t\t\titems.forEach(item => {\n\t\t\t\titem.mounted = true;\n\t\t\t});\n\t\t\tthis._renderManager\n\t\t\t\t.render(callbackComponent, groups, newItems, isAppend)\n\t\t\t\t.on(\"imageError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the image.\n\t\t\t\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#imageError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @param {HTMLElement} [e.element] - Appending card's image element.추가 되는 카드의 이미지 엘리먼트\n\t\t\t\t\t * @param {target} [e.target] - The item's element with error images.에러난 이미지를 가지고 있는 아이템의 엘리먼트\n\t\t\t\t\t * @param {Item[]} [e.items] - The items being added.화면에 추가중인 아이템들\n\t\t\t\t\t * @param {Item} [e.item] - The item with error images.에러난 이미지를 가지고 있는 아이템\n\t\t\t\t\t * @param {number} [e.index] - The item's index with error images.에러난 이미지를 가지고 있는 아이템의 인덱스\n\t\t\t\t\t * @param {number} [e.totalIndex] - The item's index with error images in all items.전체 아이템중 에러난 이미지를 가지고 있는 아이템의 인덱스\n\t\t\t\t\t * @param {function} [e.remove] - In the imageError event, this method expects to remove the error image.이미지 에러 이벤트에서 이 메서드는 에러난 이미지를 삭제한다.\n\t\t\t\t\t * @param {function} [e.removeItem] - In the imageError event, this method expects to remove the item with the error image.이미지 에러 이벤트에서 이 메서드는 에러난 이미지를 가지고 있는 아이템을 삭제한다.\n\t\t\t\t\t * @param {function} [e.replace] - In the imageError event, this method expects to replace the error image's source or element.이미지 에러 이벤트에서 이 메서드는 에러난 이미지의 주소 또는 엘리먼트를 교체한다.\n\t\t\t\t\t * @param {function} [e.replaceItem] - In the imageError event, this method expects to replace the item's contents with the error image.이미지 에러 이벤트에서 이 메서드는 에러난 이미지를 가지고 있는 아이템의 내용을 교체한다.\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"imageError\", e => {\n\t\t\t\t\t\te.remove();\n\t\t\t\t\t\te.removeItem();\n\t\t\t\t\t\te.replace(\"http://...jpg\");\n\t\t\t\t\t \te.replace(imageElement);\n\t\t\t\t\t \te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"imageError\", e);\n\t\t\t\t}).on(\"contentError\", e => {\n\t\t\t\t\t/**\n\t\t\t\t\t * This event is fired when an error occurs in the content.\n\t\t\t\t\t * @ko 콘텐츠 로드에 에러가 날 때 발생하는 이벤트.\n\t\t\t\t\t * @event eg.InfiniteGrid#contentError\n\t\t\t\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e - The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t\t\t * @param {HTMLElement} [e.element] - Appending card's image element.추가 되는 카드의 콘텐츠 엘리먼트\n\t\t\t\t\t * @param {target} [e.target] - The item's element with error images.에러난 콘텐츠를 가지고 있는 아이템의 엘리먼트\n\t\t\t\t\t * @param {Item[]} [e.items] - The items being added.화면에 추가중인 아이템들\n\t\t\t\t\t * @param {Item} [e.item] - The item with error images.에러난 콘텐츠를 가지고 있는 아이템\n\t\t\t\t\t * @param {number} [e.index] - The item's index with error images.에러난 콘텐츠를 가지고 있는 아이템의 인덱스\n\t\t\t\t\t * @param {number} [e.totalIndex] - The item's index with error images in all items.전체 아이템중 에러난 콘텐츠를 가지고 있는 아이템의 인덱스\n\t\t\t\t\t * @param {function} [e.remove] - In the contentError event, this method expects to remove the error image.콘텐츠 에러 이벤트에서 이 메서드는 에러난 콘텐츠를 삭제한다.\n\t\t\t\t\t * @param {function} [e.removeItem] - In the contentError event, this method expects to remove the item with the error image.콘텐츠 에러 이벤트에서 이 메서드는 에러난 콘텐츠를 가지고 있는 아이템을 삭제한다.\n\t\t\t\t\t * @param {function} [e.replace] - In the contentError event, this method expects to replace the error image's source or element. If the replacement was done externally, call replace().콘텐츠 에러 이벤트에서 이 메서드는 에러난 엘리먼트를 교체한다. 외부에서 교체를 했다면 replace()로 호출해라.\n\t\t\t\t\t * @param {function} [e.replaceItem] - In the contentError event, this method expects to replace the item's contents with the error image.콘텐츠 에러 이벤트에서 이 메서드는 에러난 콘텐츠를 가지고 있는 아이템의 내용을 교체한다.\n\t\t\t\t\t * @example\n\t\t\t\t\tig.on(\"contentError\", e => {\n\t\t\t\t\t\te.remove();\n\t\t\t\t\t\te.removeItem();\n\t\t\t\t\t\te.replace(imageElement);\n\t\t\t\t\t\t// If the replacement was done externally\n\t\t\t\t\t\te.replace();\n\t\t\t\t\t \te.replaceItem(\"item html\");\n\t\t\t\t\t});\n\t\t\t\t\t*/\n\t\t\t\t\tthis.trigger(\"contentError\", e);\n\t\t\t\t}).on(\"renderComplete\", ({ start, end }) => {\n\t\t\t\t\tthis._setCursor(start, end);\n\t\t\t\t}).on(\"layoutComplete\", ({\n\t\t\t\t\titems: layoutItems,\n\t\t\t\t}) => {\n\t\t\t\t\tthis._process(PROCESSING, false);\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems: layoutItems,\n\t\t\t\t\t\tisAppend,\n\t\t\t\t\t\tfromCache,\n\t\t\t\t\t\tisTrusted,\n\t\t\t\t\t\tuseRecycle: false,\n\t\t\t\t\t});\n\t\t\t\t}).on(\"readyElement\", e => {\n\t\t\t\t\tthis._updateItem(e.item) && this.layout(false);\n\t\t\t\t}).on(\"ready\", ({ remove, layout }) => {\n\t\t\t\t\tremove.forEach(el => this.remove(el, false));\n\t\t\t\t\tif (layout) {\n\t\t\t\t\t\tthis.layout(false);\n\t\t\t\t\t} else if (!this.isProcessing() && this.options.useRecycle) {\n\t\t\t\t\t\tconst scroller = this._watcher;\n\t\t\t\t\t\tconst scrollPos = scroller.getScrollPos();\n\n\t\t\t\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t};\n\n\t\tif (!hasChildren) {\n\t\t\tif (renderExternal) {\n\t\t\t\tif (items.every(item => item.mounted)) {\n\t\t\t\t\tnext();\n\t\t\t\t} else {\n\t\t\t\t\tthis._requestGroups = groups;\n\t\t\t\t\tthis.trigger(\"render\", {\n\t\t\t\t\t\tnext: () => {\n\t\t\t\t\t\t\t!hasChildren && this._renderer.renderItems(items);\n\t\t\t\t\t\t\tnext();\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn callbackComponent;\n\t\t\t} else {\n\t\t\t\t// If container has children, it does not render first.\n\t\t\t\trenderer.createAndInsert(items, isAppend);\n\t\t\t}\n\t\t}\n\t\tnext();\n\n\t\treturn callbackComponent;\n\t}\n\t// called by visible\n\tprivate _requestAppend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: true });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the bottom or right of a layout because there is no card to be displayed on screen when a user scrolls near bottom or right.\n\t\t\t * @ko 카드 엘리먼트가 레이아웃의 아래나 오른쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 아래나 오른쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다\n\t\t\t * @event eg.InfiniteGrid#append\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 마지막 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for append loading data. 뒷쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"append\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().pop() || \"\",\n\t\t\t\tstartLoading: (userStyle?: StyleType) => {\n\t\t\t\t\tthis.startLoading(true, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle?: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\t// called by visible\n\tprivate _requestPrepend({ cache }: { cache?: IInfiniteGridGroup[] }) {\n\t\tthis._fit(this.options.useFit || !cache || !cache.length);\n\t\tif (this._isProcessing()) {\n\t\t\treturn;\n\t\t}\n\t\tif (cache && cache.length) {\n\t\t\tthis._postCache({ cache, isAppend: false });\n\t\t} else {\n\t\t\t/**\n\t\t\t * This event is fired when a card element must be added at the top or left of a layout because there is no card to be displayed on screen when a user scrolls near top or left.\n\t\t\t * @ko 카드가 레이아웃의 위나 왼쪽에 추가돼야 할 때 발생하는 이벤트. 사용자가 위나 왼쪽으로 스크롤해서 화면에 표시될 카드가 없을 때 발생한다.\n\t\t\t * @event eg.InfiniteGrid#prepend\n\t\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t\t * @param {String|Number} groupKey The group key of the first group visible on the screen 화면에 보여지는 첫번째 그룹의 그룹키\n\t\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t\t * @param {Function} param.startLoading Start loading for prepend loading data. 앞쪽에 추가되는 데이터 로딩을 시작한다. \n\t\t\t * @param {Object} param.startLoading.userStyle The custom style to apply to this loading bar for start. 로딩을 시작할 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t\t */\n\t\t\tthis.trigger(\"prepend\", {\n\t\t\t\tisTrusted: true,\n\t\t\t\tgroupKey: this.getGroupKeys().shift(),\n\t\t\t\tstartLoading: (userStyle?: StyleType) => {\n\t\t\t\t\tthis.startLoading(false, userStyle);\n\t\t\t\t},\n\t\t\t\tendLoading: (userStyle?: StyleType) => {\n\t\t\t\t\tthis.endLoading(userStyle);\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onResize() {\n\t\tthis.layout(true);\n\t}\n\tprivate _setCursor(start: number, end: number) {\n\t\tconst infinite = this._infinite;\n\t\tconst [startCursor, endCursor] = infinite.getCursors();\n\t\tinfinite.setCursor(\"start\", start);\n\t\tinfinite.setCursor(\"end\", end);\n\n\t\tconst isRecycle = this._recycle([\n\t\t\t{ start: startCursor, end: start - 1 },\n\t\t\t{ start: end + 1, end: endCursor },\n\t\t]);\n\t\tif (!isRecycle) {\n\t\t\tthis._requestGroups = [];\n\t\t\tthis.trigger(\"render\", {\n\t\t\t\tnext: () => { },\n\t\t\t});\n\t\t}\n\t}\n\tprivate _onCheck({\n\t\tisForward,\n\t\tscrollPos,\n\t\thorizontal,\n\t\torgScrollPos,\n\t}: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\thorizontal: boolean,\n\t\torgScrollPos: number,\n\t}) {\n\t\t/**\n\t\t * This event is fired when the user scrolls.\n\t\t * @ko 사용자가 스크롤 할 경우 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#change\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Boolean} param.isForward Indicates whether the scroll progression direction is forward or backword. 스크롤 진행방향이 앞쪽으로 진행하는 지, 뒤쪽으로 진행하는지를 나타낸다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Boolean} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Boolean} options.horizontal Direction of the scroll movement (true: horizontal, false: vertical) 스크롤 이동 방향 (true 가로방향, false 세로방향\n\t\t */\n\t\tthis.trigger(\"change\", {\n\t\t\tisForward,\n\t\t\thorizontal,\n\t\t\tscrollPos,\n\t\t\torgScrollPos,\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _onLayoutComplete({\n\t\titems,\n\t\tisAppend,\n\t\tisTrusted = false,\n\t\tuseRecycle = this.options.useRecycle,\n\t\tfromCache = false,\n\t\tisLayout = false,\n\t}: {\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tuseRecycle: boolean,\n\t\tfromCache: boolean,\n\t\tisLayout?: boolean,\n\t}) {\n\t\tconst viewSize = this._renderer.getViewSize();\n\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis.isLoading() && this._renderLoading();\n\t\t}\n\n\t\tconst watcher = this._watcher;\n\t\tconst scrollPos = watcher.getScrollPos();\n\n\t\t// recycle after _fit beacause prepend and append are occured simultaneously by scroll.\n\t\tif (!isLayout && useRecycle && !this.isLoading()) {\n\t\t\tthis._infinite.recycle(scrollPos, isAppend);\n\t\t}\n\n\t\tconst size = this._getEdgeValue(\"end\");\n\n\t\tif (isAppend) {\n\t\t\tthis._setContainerSize(size + this._status.loadingSize || 0);\n\t\t\tif (typeof scrollPos === \"number\" && scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This event is fired when layout is successfully arranged through a call to the append(), prepend(), or layout() method.\n\t\t * @ko 레이아웃 배치가 완료됐을 때 발생하는 이벤트. append() 메서드나 prepend() 메서드, layout() 메서드 호출 후 카드의 배치가 완료됐을 때 발생한다\n\t\t * @event eg.InfiniteGrid#layoutComplete\n\t\t *\n\t\t * @param {Object} param The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @param {Array} param.target Rearranged card elements재배치된 카드 엘리먼트들\n\t\t * @param {Boolean} param.fromCache Check whether these items are cache or not 해당 아이템들이 캐시인지 아닌지 확인한다.\n\t\t * @param {Boolean} param.isLayout Returns true if this is an event called by resize event or layout method. Returns false if this is an event called by adding an item. 해당 이벤트가 리사이즈 이벤트 또는 layout() 메서드를 통해 호출됐으면 true, 아이템 추가로 호출됐으면 false를 반환한다.\n\t\t * @param {Boolean} param.isAppend Checks whether the append() method is used to add a card element. It returns true even though the layoutComplete event is fired after the layout() method is called. 카드 엘리먼트가 append() 메서드로 추가됐는지 확인한다. layout() 메서드가 호출된 후 layoutComplete 이벤트가 발생해도 'true'를 반환한다.\n\t\t * @param {Boolean} param.isScroll Checks whether scrolling has occurred after the append(), prepend(), ..., etc method is called append, prend 등 호출 후 스크롤이 생겼는지 확인한다.\n\t\t * @param {Number} param.scrollPos Current scroll position value relative to the infiniteGrid container element. infiniteGrid 컨테이너 엘리먼트 기준의 현재 스크롤 위치값\n\t\t * @param {Number} param.orgScrollPos Current position of the scroll 현재 스크롤 위치값\n\t\t * @param {Number} param.size The size of container element 컨테이너 엘리먼트의 크기\n\t\t * @param {Boolean} param.isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call 사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.\n\t\t * @param {Function} param.endLoading End loading after startLoading() for append/prepend loading data. 데이터 로딩을 위해 append/prepend startLoading() 호출 이후 로딩을 끝낸다.\n\t\t * @param {Object} param.endLoading.userStyle The custom style to apply to this loading bar for start. 로딩이 끝날 때 로딩 바에 적용될 사용자 스타일 \n\t\t */\n\t\tthis.trigger(\"layoutComplete\", {\n\t\t\ttarget: items.concat(),\n\t\t\tisAppend: !!isAppend,\n\t\t\tisTrusted,\n\t\t\tfromCache,\n\t\t\tisLayout,\n\t\t\tisScroll: viewSize < watcher.getContainerOffset() + size,\n\t\t\tscrollPos,\n\t\t\torgScrollPos: watcher.getOrgScrollPos(),\n\t\t\tsize,\n\t\t\tendLoading: (userStyle?: StyleType) => {\n\t\t\t\tthis.endLoading(userStyle);\n\t\t\t},\n\t\t});\n\t\tthis._infinite.scroll(scrollPos);\n\t}\n\tprivate _reset() {\n\t\tthis._status = {\n\t\t\tprocessingStatus: IDLE,\n\t\t\tloadingSize: 0,\n\t\t\tloadingStyle: {},\n\t\t};\n\t}\n}\n\nexport default InfiniteGrid;\n","import { DUMMY_POSITION } from \"../consts\";\nimport { getStyleNames, assignOptions, fill, cloneItems } from \"../utils\";\nimport { ILayout, IRectlProperties, ISize, IInfiniteGridGroup, IInfiniteGridItem } from \"../types\";\n\nexport type FrameType = number[][];\nexport interface IFrameShape {\n\tleft?: number;\n\ttop?: number;\n\ttype: any;\n\twidth: number;\n\theight: number;\n\tindex?: number;\n}\nexport interface IFrameLayoutInterface {\n\thorizontal: boolean;\n\tmargin: number;\n\tframe: FrameType;\n\tframeFill: boolean;\n\titemSize: number | ISize;\n\t[key: string]: any;\n}\n/*\nFrame\n[\n[1, 1, 1, 1, 1],\n[0, 0, 2, 2, 2],\n[0, 0, 2, 2, 2],\n[3, 4, 5, 5, 5],\n]\n*/\nfunction disableFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tfor (let i = top; i < top + height; ++i) {\n\t\tfor (let j = left; j < left + width; ++j) {\n\t\t\tif (type !== frame[i][j]) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tframe[i][j] = 0;\n\t\t}\n\t}\n}\nfunction searchShapeInFrame(\n\tframe: FrameType,\n\ttype: number,\n\ttop: number,\n\tleft: number,\n\twidth: number,\n\theight: number,\n) {\n\tconst size: IFrameShape = {\n\t\tleft,\n\t\ttop,\n\t\ttype,\n\t\twidth: 1,\n\t\theight: 1,\n\t};\n\n\tfor (let i = left; i < width; ++i) {\n\t\tif (frame[top][i] === type) {\n\t\t\tsize.width = i - left + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\tfor (let i = top; i < height; ++i) {\n\t\tif (frame[i][left] === type) {\n\t\t\tsize.height = i - top + 1;\n\t\t\tcontinue;\n\t\t}\n\t\tbreak;\n\t}\n\t// After finding the shape, it will not find again.\n\tdisableFrame(frame, type, top, left, size.width, size.height);\n\treturn size;\n}\nfunction getShapes(frame: FrameType) {\n\tconst height = frame.length;\n\tconst width = height ? frame[0].length : 0;\n\tconst shapes: IFrameShape[] = [];\n\n\tfor (let i = 0; i < height; ++i) {\n\t\tfor (let j = 0; j < width; ++j) {\n\t\t\tconst type = frame[i][j];\n\n\t\t\tif (!type) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Separate shapes with other numbers.\n\t\t\tshapes.push(searchShapeInFrame(frame, type, i, j, width, height));\n\t\t}\n\t}\n\tshapes.sort((a, b) => (a.type < b.type ? -1 : 1));\n\treturn {\n\t\tshapes,\n\t\twidth,\n\t\theight,\n\t};\n}\n/**\n * @classdesc FrameLayout is a layout that allows you to place cards in a given frame. It is a layout that corresponds to a level intermediate between the placement of the image directly by the designer and the layout using the algorithm.\n * @ko FrameLayout은 주어진 프레임에 맞춰 카드를 배치하는 레이아웃입니다. 디자이너가 직접 이미지를 배치하는 것과 알고리즘을 사용한 배치의 중간 정도 수준에 해당하는 레이아웃이다.\n * @class eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.FrameLayout module eg.InfiniteGrid.FrameLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frame=[]] The size of the items. If it is 0, it is calculated as the size of the first item in items. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \n * @param {Boolean} [options.frameFill=true] Make sure that the frame can be attached after the previous frame. 다음 프레임이 전 프레임에 이어 붙일 수 있는지 있는지 확인한다. \n * @example\n```\n\n```\n **/\nclass FrameLayout implements ILayout {\n\tpublic options: IFrameLayoutInterface;\n\tprotected _itemSize: number | ISize;\n\tprotected _shapes: {\n\t\tshapes: IFrameShape[],\n\t\twidth?: number,\n\t\theight?: number,\n\t};\n\tprotected _size: number;\n\tprotected _style: IRectlProperties;\n\n\tconstructor(options: Partial = {}) {\n\t\tthis.options = assignOptions({\n\t\t\tmargin: 0,\n\t\t\thorizontal: false,\n\t\t\titemSize: 0,\n\t\t\tframe: [],\n\t\t\tframeFill: true,\n\t\t}, options);\n\t\tconst frame = this.options.frame.map(row => row.slice());\n\n\t\tthis._itemSize = this.options.itemSize || 0;\n\t\t// divide frame into shapes.\n\t\tthis._shapes = getShapes(frame);\n\t\tthis._size = 0;\n\t\tthis._style = getStyleNames(this.options.horizontal);\n\t}\n\t/**\n\t * Adds items of groups at the bottom of a outline.\n\t * @ko 그룹들의 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#layout\n\t * @param {Array} groups Array of groups to be layouted 레이아웃할 그룹들의 배열\n\t * @param {Array} outline Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.layout(groups, [100, 200, 300, 400]);\n\t */\n\tpublic layout(groups: IInfiniteGridGroup[] = [], outline: number[] = []) {\n\t\tconst length = groups.length;\n\t\tlet point = outline;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst group = groups[i];\n\t\t\tconst outlines = this._layout(group.items, point, true);\n\n\t\t\tgroup.outlines = outlines;\n\t\t\tpoint = outlines.end;\n\t\t}\n\t\treturn this;\n\t}\n\t/**\n\t * Set the viewport size of the layout.\n\t * @ko 레이아웃의 가시 사이즈를 설정한다.\n\t * @method eg.InfiniteGrid.FrameLayout#setSize\n\t * @param {Number} size The viewport size of container area where items are added to a layout 레이아웃에 아이템을 추가하는 컨테이너 영역의 가시 사이즈\n\t * @return {eg.InfiniteGrid.FrameLayout} An instance of a module itself모듈 자신의 인스턴스\n\t * @example\n\t * layout.setSize(800);\n\t */\n\tpublic setSize(size: number) {\n\t\tthis._size = size;\n\t\treturn this;\n\t}\n\t/**\n\t * Adds items at the bottom of a outline.\n\t * @ko 아이템들을 아웃라인 아래에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#append\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic append(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, true, cache);\n\t}\n\t/**\n\t * Adds items at the top of a outline.\n\t * @ko 아이템을 아웃라인 위에 추가한다.\n\t * @method eg.InfiniteGrid.FrameLayout#prepend\n\t * @param {Array} items Array of items to be layouted 레이아웃할 아이템들의 배열\n\t * @param {Array} [outline=[]] Array of outline points to be reference points 기준점이 되는 아웃라인 점들의 배열\n\t * @return {Object} Layouted items and outline of start and end 레이아웃이 된 아이템과 시작과 끝의 아웃라인이 담긴 정보\n\t * @example\n\t * layout.prepend(items, [100]);\n\t */\n\tpublic prepend(items: IInfiniteGridItem[], outline?: number[], cache?: boolean) {\n\t\treturn this._insert(items, outline, false, cache);\n\t}\n\tprotected _getItemSize() {\n\t\tthis._checkItemSize();\n\n\t\treturn this._itemSize;\n\t}\n\tprotected _checkItemSize() {\n\t\tif (this.options.itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t\treturn;\n\t\t}\n\t\tconst style = this._style;\n\t\tconst size = style.size2;\n\t\tconst margin = this.options.margin;\n\n\t\t// if itemSize is not in options, caculate itemSize from size.\n\t\tthis._itemSize = (this._size + margin) / this._shapes[size]! - margin;\n\t}\n\tprotected _layout(items: IInfiniteGridItem[], outline: number[] = [], isAppend?: boolean) {\n\t\tconst length = items.length;\n\t\tconst style = this._style;\n\t\tconst { margin, frameFill } = this.options;\n\t\tconst size1Name = style.size1;\n\t\tconst size2Name = style.size2;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\t\tconst itemSize = this._getItemSize();\n\t\tconst isItemObject = typeof itemSize === \"object\";\n\t\tconst itemSize2 = isItemObject ? (itemSize as ISize)[size2Name] : itemSize as number;\n\t\tconst itemSize1 = isItemObject ? (itemSize as ISize)[size1Name] : itemSize as number;\n\t\tconst shapesSize = this._shapes[size2Name]!;\n\t\tconst shapes = this._shapes.shapes;\n\t\tconst shapesLength = shapes.length;\n\t\tconst startOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tconst endOutline = fill(new Array(shapesSize), DUMMY_POSITION);\n\t\tlet dist = 0;\n\t\tlet end = 0;\n\n\t\tif (!shapesLength) {\n\t\t\treturn { start: outline, end: outline };\n\t\t}\n\t\tfor (let i = 0; i < length; i += shapesLength) {\n\t\t\tfor (let j = 0; j < shapesLength && i + j < length; ++j) {\n\t\t\t\tconst item = items[i + j];\n\t\t\t\tconst shape = shapes[j];\n\t\t\t\tconst shapePos1 = shape[pos1Name]!;\n\t\t\t\tconst shapePos2 = shape[pos2Name]!;\n\t\t\t\tconst shapeSize1 = shape[size1Name]!;\n\t\t\t\tconst shapeSize2 = shape[size2Name]!;\n\t\t\t\tconst pos1 = end - dist + shapePos1 * (itemSize1 + margin);\n\t\t\t\tconst pos2 = shapePos2 * (itemSize2 + margin);\n\t\t\t\tconst size1 = shapeSize1 * (itemSize1 + margin) - margin;\n\t\t\t\tconst size2 = shapeSize2 * (itemSize2 + margin) - margin;\n\n\t\t\t\tfor (let k = shapePos2; k < shapePos2 + shapeSize2 && k < shapesSize; ++k) {\n\t\t\t\t\tif (startOutline[k] === DUMMY_POSITION) {\n\t\t\t\t\t\tstartOutline[k] = pos1;\n\t\t\t\t\t}\n\t\t\t\t\tstartOutline[k] = Math.min(startOutline[k], pos1);\n\t\t\t\t\tendOutline[k] = Math.max(endOutline[k], pos1 + size1 + margin);\n\t\t\t\t}\n\t\t\t\titem.rect = {\n\t\t\t\t\t[pos1Name]: pos1,\n\t\t\t\t\t[pos2Name]: pos2,\n\t\t\t\t\t[size1Name]: size1,\n\t\t\t\t\t[size2Name]: size2,\n\t\t\t\t} as any;\n\t\t\t}\n\t\t\tend = Math.max(...endOutline);\n\t\t\t// check dist once\n\t\t\tif (i !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// find & fill empty block\n\t\t\tif (!frameFill) {\n\t\t\t\tdist = 0;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdist = end;\n\n\t\t\tfor (let j = 0; j < shapesSize; ++j) {\n\t\t\t\tif (startOutline[j] === DUMMY_POSITION) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// the dist between frame's end outline and next frame's start outline\n\t\t\t\t// expect that next frame's start outline is startOutline[j] + end\n\t\t\t\tdist = Math.min(startOutline[j] + end - endOutline[j], dist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tif (startOutline[i] !== DUMMY_POSITION) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstartOutline[i] = Math.max(...startOutline);\n\t\t\tendOutline[i] = startOutline[i];\n\t\t}\n\t\t// The target outline is start outline when type is appending\n\t\tconst targetOutline = isAppend ? startOutline : endOutline;\n\t\tconst prevOutlineEnd = outline.length === 0 ? 0 : Math[isAppend ? \"max\" : \"min\"](...outline);\n\t\tlet prevOutlineDist = isAppend ? 0 : end;\n\n\t\tif (frameFill && outline.length === shapesSize) {\n\t\t\tprevOutlineDist = -DUMMY_POSITION;\n\t\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\t\tif (startOutline[i] === endOutline[i]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// if appending type is prepend(false), subtract dist from appending group's height.\n\n\t\t\t\tprevOutlineDist = Math.min(targetOutline[i] + prevOutlineEnd - outline[i], prevOutlineDist);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < shapesSize; ++i) {\n\t\t\tstartOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t\tendOutline[i] += prevOutlineEnd - prevOutlineDist;\n\t\t}\n\t\titems.forEach(item => {\n\t\t\titem.rect[pos1Name] += prevOutlineEnd - prevOutlineDist;\n\t\t});\n\t\treturn {\n\t\t\tstart: startOutline.map(point => parseInt(point, 10)),\n\t\t\tend: endOutline.map(point => parseInt(point, 10)),\n\t\t};\n\t}\n\tprivate _insert(items: IInfiniteGridItem[] = [], outline: number[] = [], isAppend?: boolean, cache?: boolean) {\n\t\t// this only needs the size of the item.\n\t\tconst clone = cache ? items : cloneItems(items);\n\n\t\treturn {\n\t\t\titems: clone,\n\t\t\toutlines: this._layout(clone, outline, isAppend),\n\t\t};\n\t}\n}\n\nexport default FrameLayout;\n","import FrameLayout, { IFrameLayoutInterface, IFrameShape } from \"./FrameLayout\";\nimport { fill } from \"../utils\";\nimport { IInfiniteGridItem } from \"../types\";\n\nfunction makeShapeOutline(\n\toutline: number[],\n\titemSize: number,\n\tcolumnLength: number,\n\tisAppend?: boolean,\n) {\n\tconst point = Math[isAppend ? \"min\" : \"max\"](...outline) || 0;\n\n\tif (outline.length !== columnLength) {\n\t\treturn fill(new Array(columnLength), 0);\n\t}\n\treturn outline.map(l => Math.floor((l - point) / itemSize));\n}\nfunction getColumn(item: IInfiniteGridItem) {\n\tif (item.column) {\n\t\treturn item.column;\n\t}\n\tlet column = 1;\n\n\tif (item.el) {\n\t\tcolumn = parseInt(item.el.getAttribute(\"data-column\")!, 10) || 1;\n\t}\n\titem.column = column;\n\treturn column;\n}\nexport interface ISquareLayoutOptions extends IFrameLayoutInterface {\n\tcolumn: number;\n}\n/**\n * @classdesc SquareLayout is a layout that places all cards like squares on a checkerboard, and important cards are n times larger. The main card can be enlarged, and then a small card can be placed to naturally show the relationship of the card.\n * @ko SquareLayout은 바둑판처럼 모든 카드를 정사각형으로 배치하고 중요한 카드는 크기를 N배로 키워서 보여주는 레이아웃이다. 주요 카드를 크게 표시하고, 그 다음에 작은 카드를 배치해 자연스럽게 카드의 관계를 나타낼 수 있습니다.\n * @class eg.InfiniteGrid.SquareLayout\n * @extends eg.InfiniteGrid.FrameLayout\n * @param {Object} [options] The option object of eg.InfiniteGrid.SquareLayout module eg.InfiniteGrid.SquareLayout 모듈의 옵션 객체\n * @param {String} [options.margin=0] Margin used to create space around items 아이템들 사이의 공간\n * @param {Boolean} [options.horizontal=false] Direction of the scroll movement (false: vertical, true: horizontal) 스크롤 이동 방향 (false: 세로방향, true: 가로방향)\n * @param {Boolean} [options.itemSize=0] The size of the items. If it is 0, it is calculated as the size of the first item in items. (priority: `column` > `itemSize` > element's size) 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @param {Boolean} [options.column=0] The number of columns in the layout. If it is 0, the column is returned by `itemSize`. (priority: `column` > `itemSize` > element's size) 레이아웃의 열의 개수. 만약 column이 0이면, `itemSize`로 열을 구합니다. (우선순위: `column` > `itemSize` > 엘리먼트의 사이즈) \n * @example\n```\n\n```\n **/\nexport default class SquareLayout extends FrameLayout {\n\tpublic options: ISquareLayoutOptions;\n\n\tconstructor(options: Partial = {}) {\n\t\tsuper(options);\n\t}\n\tprotected _layout(\n\t\titems: IInfiniteGridItem[],\n\t\toutline: number[] = [],\n\t\tisAppend: boolean = false,\n\t) {\n\t\tconst itemSize = this._getSquareSize(items[0]) as number;\n\t\tconst margin = this.options.margin;\n\t\tconst columnLength = this.options.column ||\n\t\t\tMath.floor((this._size + margin) / (itemSize + margin)) || 1;\n\t\tconst length = items.length;\n\t\tconst endOutline = makeShapeOutline(outline, Math.floor(itemSize), columnLength, isAppend);\n\t\tconst pointCaculateName = isAppend ? \"min\" : \"max\";\n\t\tconst shapes: IFrameShape[] = [];\n\t\tconst sign = isAppend ? 1 : -1;\n\t\tconst style = this._style;\n\t\tconst pos1Name = style.startPos1;\n\t\tconst pos2Name = style.startPos2;\n\n\t\tfor (let i = 0; i < length; ++i) {\n\t\t\tconst point = Math[pointCaculateName](...endOutline);\n\t\t\tlet index = endOutline[isAppend ? \"indexOf\" : \"lastIndexOf\"](point);\n\t\t\tconst item = items[i];\n\t\t\tconst columnWidth = item.columnWidth;\n\t\t\tconst column = (columnWidth && columnWidth[0] === columnLength &&\n\t\t\t\tcolumnWidth[1]) || getColumn(item);\n\t\t\tlet columnCount = 1;\n\n\t\t\tif (column > 1) {\n\t\t\t\tfor (let j = 1; j < column &&\n\t\t\t\t\t((isAppend && index + j < columnLength) || (!isAppend && index - j >= 0)); ++j) {\n\t\t\t\t\tif ((isAppend && endOutline[index + sign * j] <= point) ||\n\t\t\t\t\t\t(!isAppend && endOutline[index + sign * j] >= point)) {\n\t\t\t\t\t\t++columnCount;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (!isAppend) {\n\t\t\t\t\tindex -= columnCount - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.columnWidth = [columnLength, columnCount];\n\t\t\tshapes.push({\n\t\t\t\twidth: columnCount,\n\t\t\t\theight: columnCount,\n\t\t\t\t[pos1Name]: point - (!isAppend ? columnCount : 0),\n\t\t\t\t[pos2Name]: index,\n\t\t\t\ttype: i + 1,\n\t\t\t\tindex: i,\n\t\t\t});\n\t\t\tfor (let j = 0; j < columnCount; ++j) {\n\t\t\t\tendOutline[index + j] = point + sign * columnCount;\n\t\t\t}\n\t\t}\n\t\tthis._shapes = {\n\t\t\tshapes,\n\t\t\t[style.size2]: columnLength,\n\t\t};\n\n\t\tconst result = super._layout(items, outline, isAppend);\n\n\t\tif (!isAppend) {\n\t\t\tshapes.sort((shape1, shape2) => {\n\t\t\t\tconst item1pos1 = shape1[pos1Name]!;\n\t\t\t\tconst item1pos2 = shape1[pos2Name]!;\n\t\t\t\tconst item2pos1 = shape2[pos1Name]!;\n\t\t\t\tconst item2pos2 = shape2[pos2Name]!;\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t\titems.sort((a, b) => {\n\t\t\t\tconst item1pos1 = a.rect[pos1Name];\n\t\t\t\tconst item1pos2 = a.rect[pos2Name];\n\t\t\t\tconst item2pos1 = b.rect[pos1Name];\n\t\t\t\tconst item2pos2 = b.rect[pos2Name];\n\n\t\t\t\tif (item1pos1 - item2pos1) {\n\t\t\t\t\treturn item1pos1 - item2pos1;\n\t\t\t\t}\n\t\t\t\treturn item1pos2 - item2pos2;\n\t\t\t});\n\t\t}\n\t\treturn result;\n\t}\n\tprivate _getSquareSize(item: IInfiniteGridItem) {\n\t\tconst { column, margin, itemSize } = this.options;\n\n\t\tif (column) {\n\t\t\t// if column is in options, caculate itemSize from column.\n\t\t\tthis._itemSize = (this._size + margin) / column - margin;\n\t\t} else if (itemSize) {\n\t\t\tthis._itemSize = this.options.itemSize;\n\t\t} else {\n\t\t\tconst sizeName = this._style.size2;\n\t\t\t// if frameSize is 0, caculate frameSize from item.size.\n\t\t\tconst frameSize\n\t\t\t\t= this._shapes[sizeName]\n\t\t\t\t|| Math.floor((this._size + margin) / (item.size![sizeName]! + margin) / getColumn(item));\n\t\t\tthis._itemSize = (this._size + margin) / frameSize - margin;\n\t\t}\n\t\treturn this._itemSize;\n\t}\n}\n","/**\n * Copyright (c) NAVER Corp.\n * egjs-infinitegrid projects are licensed under the MIT license\n */\nimport InfiniteGrid from \"./InfiniteGrid\";\nimport SquareLayout from \"./layouts/SquareLayout\";\n\n(InfiniteGrid as any).SquareLayout = SquareLayout;\n\nexport default InfiniteGrid;\n"],"names":["__values","o","s","Symbol","iterator","m","i","call","length","next","value","done","TypeError","isUndefined","Component","options","_eventHandler","__proto","prototype","trigger","eventName","_this","params","_i","arguments","handlerList","hasHandlerList","customEvent","restParams","slice","concat","isCanceled","eventType","stop","currentTarget","arg","forEach","handler","apply","once","handlerToAttach","eventHash","key","listener_1","args","off","on","hasOn","name","push","handlerToDetach","e_1","_a","idx","handlerList_1","handlerList_1_1","handlerFunction","splice","e_1_1","error","return","VERSION","PolyMap","keys","values","get","indexOf","set","prevIndex","index","HashMap","object","SUPPORT_MAP","Map","Link","connect","prevLink","nextLink","prev","disconnect","getIndex","link","orderChanged","changed","fixed","fromLinks","toLinks","from","to","filter","_","map","fromLink","toLink","fromIndex","undefined","toIndex","Result","prevList","list","added","removed","maintained","changedBeforeAdded","Object","defineProperty","cacheOrdered","caculateOrdered","enumerable","configurable","cachePureChanged","ordered","pureChanged","_b","fromBefore","toBefore","diff","findKeyCallback","mapClass","callback","e","prevKeys","prevKeyMap","keyMap","removedMap","addedCount","removedCount","prevListIndex","listIndex","reverse","win","window","document","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","addEventListener","IS_IE","test","IS_IOS","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","VERTICAL","HORIZONTAL","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","itemSelector","isOverflowScroll","threshold","isEqualSize","isConstantSize","useRecycle","horizontal","transitionDuration","useFit","attributePrefix","renderExternal","resizeDebounce","maxResizeDebounce","percentage","DEFAULT_LAYOUT_OPTIONS","margin","agent","toLowerCase","isMobile","IDLE","LOADING_APPEND","LOADING_PREPEND","PROCESSING","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","ITEM_KEYS","TRANSFORM","properties","transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","mozTransitionEnd","property","prefix","TRANSITION","TRANSITION_END","toArray","nodes","array","matchHTML","html","match","$","param","multi","el","dummy","createElement","innerHTML","childNodes","querySelectorAll","isWindow","isJQuery","Array","isArray","v","nodeName","nodeType","addEvent","element","type","eventListenerOptions","attachEvent","removeEvent","removeEventListener","detachEvent","addOnceEvent","scroll","prop","body","documentElement","scrollTo","x","y","scrollLeft","scrollTop","scrollBy","getStyle","getComputedStyle","currentStyle","_getSize","isOffset","isDocument","doc","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","cssSize","parseFloat","innerWidth","innerHeight","outerWidth","outerHeight","getSize","width","height","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","getStyleNames","isHorizontal","assign","target","sources","source","assignOptions","defaultOptions","cloneItems","items","item","jQuery","constructor","jquery","fill","arr","find","findLast","categorize","newItems","newGroups","groupKeys","groupKey","group","resetSize","orgSize","makeItem","mounted","needUpdate","content","outerHTML","rect","hasClass","className","classList","contains","RegExp","addClass","add","ItemManager","elements","data","reduce","acc","_groups","_groupKeys","startKey","endKey","datas","startIndex","endIndex","_data","item2","data2","status","clear","insertGroup","base","groups","outlines","start","end","sliceGroups","pluck","cursor","targetValue","Infinity","getOutline","getGroup","getEdgeIndex","startCursor","endCursor","getGroups","pos","groupIndex","prevItems","newGroup","insert","result","removedIndex","nextGroups","addedIndex","syncItems","newItem","itemIndex","groupItem","groupItems","removeGroup","getAttribute","itemKey","nextItems","nextIndex","removeTransition","style","setTransition","pos1","pos2","createContainer","selectContainer","querySelector","position","container","children","appendChild","view","viewport","_init","resize","DOMRenderer","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","isAppend","createElements","renderItems","_insert","renderItem","prevRect","setAttribute","_render","itemRect","_calcSize","isResize","_orgStyle","_isSizePercentage","_isPosPercentage","overflowX","overflowY","df","createDocumentFragment","insertBefore","firstChild","isSizePercentage","isPosPercentage","viewportSize","getViewportSize","p","isHorizontalPercentage","isVerticalPercentage","isVisible","scrollPos","endScrollPos","min","itemManger","append","prepend","recycle","_itemManager","_status","itemManager","prevVisisbleGroups","prevVisibleItems","sync","startGroup","getGroupByKey","endGroup","nextStartCursor","nextEndCursor","minCursor","maxCursor","nextVisibleItems","visibleDiffResult","isForward","visibles","lastIndexOf","setCursor","getCursors","startEdgePos","endEdgePos","startPos","endPos","cache","cachedAppendData","cachedPrependData","isPrepend","getEdgeOutline","remove","extendStatics","d","b","setPrototypeOf","__proto__","hasOwnProperty","__extends","__","create","__assign","t","n","__spreadArrays","il","r","k","a","j","jl","WIDTH","HEIGHT","hasSizeAttribute","hasLoadingAttribute","hasSkipAttribute","getStyles","getContentElements","tags","skipElements","tag","addAutoSizer","resizeAllAutoSizers","__PREFIX__","removeAutoSizer","elementPrefix","dataWidth","dataHeight","Loader","_super","isReady","isPreReady","hasDataSize","hasLoading","isSkip","onCheck","onError","withPreReady","onReady","check","checkElement","onAlreadyReady","onAlreadyPreReady","addEvents","EVENTS","destroy","onPreReady","onAlreadyError","setTimeout","ElementLoader","setHasLoading","ImReadyManager","readyCount","preReadyCount","totalCount","totalErrorCount","isPreReadyOver","elementInfos","loaders","loader","getLoader","info","checkPreReady","onPreReadyElement","checkReady","onReadyElement","hasError","getTotalCount","every","tagName","some","childrenImReady","clone","contentElements","errorCount","getErrorCount","ImageLoader","src","complete","naturalWidth","VideoLoader","readyState","ImReady","img","video","hasTarget","_infinite","_renderer","layout","_layout","callbackComponent","checkGroups","replaceTarget","removeTarget","im","_preReady","_error","_readyElement","_ready","infinite","prevGroup","outline","updateSize","groupOutline","isRelayout","groupInfo","getCursor","requestStartCursor","requestEndCursor","isInCursor","tempCursor","errorIndex","removeItem","HTMLImageElement","removeAttribute","replaceItem","totalIndex","removeTargetLength","replaceTargetLength","layoutedItems","prevPos","getScrollPos","orgScrollPos","getOrgScrollPos","setScrollPos","_isScrollIssue","onResize","clearTimeout","_resizeTimer","_maxResizeDebounceTimer","_view","_prevPos","applyScrollPos","arrPos","getContainerOffset","_onCheck","_onResize","_containerOffset","_getOffset","reset","_reset","_watcher","Watcher","Infinite","_requestAppend","_requestPrepend","_recycle","_renderManager","RenderManager","LayoutKlass","setLayout","_setSize","includeCached","getVisibleItems","getItems","itemKeys","nextVisisbleItems","_requestGroups","getRenderingItems","isChange","_isProcessing","_postLayout","fromCache","getVisibleData","isTrusted","firstGroup","hasChildren","renderer","isLayoutAll","children_1","getContainerSize","setContainerSize","_relayout","_fit","clearOutlines","_onLayoutComplete","isLayout","indexesOfElement","removeByIndex","getStatus","syncElements","watcher","processingStatus","setStatus","visibleItems","createAndInsert","isReLayout","isNeededResize","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_loadingBar","isChangeLoadingBar","loadingElement","_renderLoading","isLoading","_getLoadingStatus","userStyle","display","_process","_setContainerSize","_getEdgeValue","_fitItems","isProcessing","getItem","_updateItem","fit","_scrollTo","_setScrollPos","_postCache","layoutGroups","getMaxEdgeValue","setSize","getViewSize","getEdgeValue","isAdd","Date","getTime","floor","random","toItems","_insertItems","_c","ranges","isRecycle","removeItems","posName","render","_setCursor","layoutItems","scroller","getGroupKeys","pop","startLoading","endLoading","shift","_d","_e","viewSize","isScroll","InfiniteGrid","disableFrame","frame","searchShapeInFrame","getShapes","shapes","sort","itemSize","frameFill","row","_itemSize","_shapes","_style","point","_checkItemSize","size1Name","size2Name","pos1Name","pos2Name","_getItemSize","isItemObject","itemSize2","itemSize1","shapesSize","shapesLength","startOutline","endOutline","dist","shape","shapePos1","shapePos2","shapeSize1","shapeSize2","targetOutline","prevOutlineEnd","prevOutlineDist","makeShapeOutline","columnLength","l","getColumn","column","_getSquareSize","pointCaculateName","sign","columnWidth","columnCount","shape1","shape2","item1pos1","item1pos2","item2pos1","item2pos2","sizeName","frameSize","FrameLayout","SquareLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;;;IAQA;;;;;;;;;;;;;;IAcA,SAASA,UAAT,CAAkBC,CAAlB,EAAqB;IACnB,MAAIC,CAAC,GAAG,OAAOC,MAAP,KAAkB,UAAlB,IAAgCA,MAAM,CAACC,QAA/C;IAAA,MACIC,CAAC,GAAGH,CAAC,IAAID,CAAC,CAACC,CAAD,CADd;IAAA,MAEII,CAAC,GAAG,CAFR;IAGA,MAAID,CAAJ,EAAO,OAAOA,CAAC,CAACE,IAAF,CAAON,CAAP,CAAP;IACP,MAAIA,CAAC,IAAI,OAAOA,CAAC,CAACO,MAAT,KAAoB,QAA7B,EAAuC,OAAO;IAC5CC,IAAAA,IAAI,EAAE,YAAY;IAChB,UAAIR,CAAC,IAAIK,CAAC,IAAIL,CAAC,CAACO,MAAhB,EAAwBP,CAAC,GAAG,KAAK,CAAT;IACxB,aAAO;IACLS,QAAAA,KAAK,EAAET,CAAC,IAAIA,CAAC,CAACK,CAAC,EAAF,CADR;IAEL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