{"version":3,"file":"infinitegrid.squarelayout.js","sources":["../node_modules/@egjs/component/dist/component.esm.js","../src/browser.ts","../src/consts.ts","../src/utils.ts","../src/ItemManager.ts","../src/DOMRenderer.ts","../src/Watcher.ts","../src/Infinite.ts","../src/AutoSizer.ts","../src/ImageLoaded.ts","../src/LayoutManager.ts","../src/InfiniteGrid.ts","../src/layouts/FrameLayout.ts","../src/layouts/SquareLayout.ts","../src/index.squarelayout.ts"],"sourcesContent":["/*\nCopyright (c) 2017 NAVER Corp.\n@egjs/component project is licensed under the MIT license\n\n@egjs/component JavaScript library\nhttps://naver.github.io/egjs-component\n\n@version 2.1.2\n*/\n/**\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\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 var Component =\n /*#__PURE__*/\n function () {\n /**\n * Version info string\n * @ko 버전정보 문자열\n * @name VERSION\n * @static\n * @type {String}\n * @example\n * eg.Component.VERSION; // ex) 2.0.0\n * @memberof eg.Component\n */\n\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 this._eventHandler = {};\n this.options = {};\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 * @return {Boolean} 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 class Some extends eg.Component {\n some(){\n \tif(this.trigger(\"beforeHi\")){ // When event call to stop return false.\n \tthis.trigger(\"hi\");// fire hi event.\n \t}\n }\n }\n const some = new Some();\n some.on(\"beforeHi\", (e) => {\n if(condition){\n \te.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 var _proto = Component.prototype;\n\n _proto.trigger = function trigger(eventName, customEvent) {\n if (customEvent === void 0) {\n customEvent = {};\n }\n\n var handlerList = this._eventHandler[eventName] || [];\n var hasHandlerList = handlerList.length > 0;\n\n if (!hasHandlerList) {\n return true;\n } // If detach method call in handler in first time then handler list calls.\n\n\n handlerList = handlerList.concat();\n customEvent.eventType = eventName;\n var isCanceled = false;\n var arg = [customEvent];\n var i = 0;\n\n customEvent.stop = function () {\n isCanceled = true;\n };\n\n customEvent.currentTarget = this;\n\n for (var _len = arguments.length, restParam = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n restParam[_key - 2] = arguments[_key];\n }\n\n if (restParam.length >= 1) {\n arg = arg.concat(restParam);\n }\n\n for (i = 0; handlerList[i]; i++) {\n handlerList[i].apply(this, arg);\n }\n\n return !isCanceled;\n };\n /**\n * Executed event just one time.\n * @ko 이벤트가 한번만 실행된다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\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 _proto.once = function once(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var i;\n\n for (i in eventHash) {\n this.once(i, eventHash[i]);\n }\n\n return this;\n } else if (typeof eventName === \"string\" && typeof handlerToAttach === \"function\") {\n var self = this;\n this.on(eventName, function listener() {\n for (var _len2 = arguments.length, arg = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n arg[_key2] = arguments[_key2];\n }\n\n handlerToAttach.apply(self, arg);\n self.off(eventName, listener);\n });\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 class Some extends eg.Component {\n some() {\n this.hasOn(\"hi\");// check hi event.\n }\n }\n */\n\n\n _proto.hasOn = function hasOn(eventName) {\n return !!this._eventHandler[eventName];\n };\n /**\n * Attaches an event to a component.\n * @ko 컴포넌트에 이벤트를 등록한다.\n * @param {eventName} eventName The name of the event to be attached 등록할 이벤트의 이름\n * @param {Function} handlerToAttach The handler function of the event to be attached 등록할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself컴포넌트 자신의 인스턴스\n * @example\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 _proto.on = function on(eventName, handlerToAttach) {\n if (typeof eventName === \"object\" && isUndefined(handlerToAttach)) {\n var eventHash = eventName;\n var name;\n\n for (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 {eventName} eventName The name of the event to be detached 해제할 이벤트의 이름\n * @param {Function} handlerToDetach The handler function of the event to be detached 해제할 이벤트의 핸들러 함수\n * @return {eg.Component} An instance of a component itself 컴포넌트 자신의 인스턴스\n * @example\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 _proto.off = function off(eventName, handlerToDetach) {\n // All event detach.\n if (isUndefined(eventName)) {\n this._eventHandler = {};\n return this;\n } // All handler of specific event detach.\n\n\n if (isUndefined(handlerToDetach)) {\n if (typeof eventName === \"string\") {\n this._eventHandler[eventName] = undefined;\n return this;\n } else {\n var eventHash = eventName;\n var name;\n\n for (name in eventHash) {\n this.off(name, eventHash[name]);\n }\n\n return this;\n }\n } // The handler of specific event detach.\n\n\n var handlerList = this._eventHandler[eventName];\n\n if (handlerList) {\n var k;\n var handlerFunction;\n\n for (k = 0; (handlerFunction = handlerList[k]) !== undefined; k++) {\n if (handlerFunction === handlerToDetach) {\n handlerList = handlerList.splice(k, 1);\n break;\n }\n }\n }\n\n return this;\n };\n\n return Component;\n }();\n\n Component.VERSION = \"2.1.2\";\n return Component;\n}();\n\nexport default Component;\n//# sourceMappingURL=component.esm.js.map\n","import { WindowMockType } from \"./types\";\n\nlet win: WindowMockType;\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};\n} else {\n\twin = window;\n}\n\nexport { win as window };\nexport const document = win.document;\n","import { window, document } from \"./browser\";\nimport { IAlign } 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\tdocument.addEventListener(\"test\", null, Object.defineProperty({},\n\t\t\t\t\"passive\", {\n\t\t\t\t\tget() {\n\t\t\t\t\t\tsupportsPassiveOption = true;\n\t\t\t\t\t},\n\t\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 APPEND = true;\nexport const PREPEND = false;\nexport const VERTICAL = \"vertical\";\nexport const HORIZONTAL = \"horizontal\";\nexport const CACHE = true;\nexport const NO_CACHE = false;\nexport const TRUSTED = true;\nexport const NO_TRUSTED = false;\nexport const MULTI = true;\nexport const SINGLE = false;\nexport const DUMMY_POSITION = -100000;\nexport const GROUPKEY_ATT = \"data-groupkey\";\n\nexport const DEFAULT_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\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","\nimport { window, document } from \"./browser\";\nimport {\n\tSUPPORT_COMPUTEDSTYLE,\n\tSUPPORT_ADDEVENTLISTENER,\n\tSUPPORT_PASSIVE,\n\tVERTICAL,\n\tHORIZONTAL,\n\tDEFAULT_OPTIONS,\n} from \"./consts\";\nimport { IJQuery, IRectlProperties, InnerSizeType, ClientSizeType, ScrollSizeType, OffsetSizeType, WindowMockType } from \"./types\";\n\nexport function toArray(nodes: HTMLCollection): HTMLElement[];\nexport function toArray(nodes: T[] | NodeListOf): T[];\nexport function toArray(nodes: T[] | NodeListOf | HTMLCollection) {\n\t// SCRIPT5014 in IE8\n\tconst array = [];\n\n\tif (nodes) {\n\t\tfor (let i = 0, len = nodes.length; i < len; 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: WindowMockType, multi?: false): WindowMockType;\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 | WindowMockType | IJQuery,\n\tmulti?: false,\n): HTMLElement | WindowMockType;\nexport function $(\n\tparam: string | WindowMockType | HTMLElement | Array | IJQuery,\n\tmulti = false,\n): HTMLElement | WindowMockType | HTMLElement[] {\n\tlet el: WindowMockType | HTMLElement | HTMLElement[] | NodeListOf;\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}\n\treturn el;\n}\nexport function addEvent(\n\telement: Element | WindowMockType,\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 | WindowMockType,\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 | WindowMockType, 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: WindowMockType | 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: WindowMockType | 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 getStyles(el: Element) {\n\treturn (SUPPORT_COMPUTEDSTYLE ?\n\t\twindow.getComputedStyle(el) : (el as any).currentStyle) || {};\n}\nfunction _getSize(el: WindowMockType | 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\treturn parseFloat(size || getStyles(el)[name.toLowerCase()]) || 0;\n\t}\n}\n\nexport function innerWidth(el: WindowMockType | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", false);\n}\nexport function innerHeight(el: WindowMockType | Document | HTMLElement) {\n\treturn _getSize(el, \"Height\", false);\n}\nexport function outerWidth(el: WindowMockType | Document | HTMLElement) {\n\treturn _getSize(el, \"Width\", true);\n}\nexport function outerHeight(el: WindowMockType | 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_OPTIONS & A & B {\n\treturn assign({},\n\t\tDEFAULT_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 WindowMockType {\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","import { MULTI, GROUPKEY_ATT, IGNORE_CLASSNAME, DUMMY_POSITION } from \"./consts\";\nimport { $, toArray, isUndefined, assign } from \"./utils\";\nimport { CursorType, IJQuery, IInfiniteGridGroup, IInfiniteGridItem, IItemManagerStatus } from \"./types\";\n\nexport default class ItemManager {\n\tpublic static from(\n\t\telements: HTMLElement[] | string | string[] | IJQuery, selector: string,\n\t\t{ groupKey }: { groupKey: string | number }) {\n\t\tconst filted = ItemManager.selectItems($(elements, MULTI), selector);\n\n\t\t// Item Structure\n\t\treturn toArray(filted).map(el => ({\n\t\t\tel,\n\t\t\tgroupKey,\n\t\t\tcontent: el.outerHTML,\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}));\n\t}\n\tpublic static selectItems(elements: HTMLElement[], selector?: string) {\n\t\treturn elements.filter(v => {\n\t\t\tconst classNames = v.className.split(\" \");\n\n\t\t\tif (classNames.some(c => c === IGNORE_CLASSNAME)) {\n\t\t\t\treturn false;\n\t\t\t} else if (!selector || selector === \"*\") {\n\t\t\t\treturn v;\n\t\t\t} else {\n\t\t\t\treturn classNames.some(c => c === selector);\n\t\t\t}\n\t\t});\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\tpublic _data: IInfiniteGridGroup[];\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\tpublic getStatus(startKey?: string | number, endKey?: string | number): IItemManagerStatus {\n\t\tconst datas = this._data;\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 = assign({}, item);\n\n\t\t\t\t\tdelete item2.el;\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.set(data);\n\t}\n\tpublic size() {\n\t\treturn this._data.length;\n\t}\n\tpublic fit(base: number, horizontal: boolean) {\n\t\tif (!this._data.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst property = horizontal ? \"left\" : \"top\";\n\n\t\tif (base !== 0) {\n\t\t\tthis._data = this._data.map(v => {\n\t\t\t\tv.items = v.items.map(item => {\n\t\t\t\t\titem.rect[property] -= base;\n\t\t\t\t\treturn item;\n\t\t\t\t});\n\t\t\t\tv.outlines.start = v.outlines.start.map(start => start - base);\n\t\t\t\tv.outlines.end = v.outlines.end.map(end => end - base);\n\t\t\t\treturn v;\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._data :\n\t\t\tthis._data.slice(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._data[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 outlines = this.pluck(\"outlines\", this.getEdgeIndex(cursor, start, end))\n\t\t\t.reduce((acc, v) => acc.concat(v[cursor]), []);\n\n\t\treturn outlines.length ? Math[cursor === \"start\" ? \"min\" : \"max\"](...outlines) : 0;\n\t}\n\tpublic clearOutlines(startCursor = -1, endCursor = -1) {\n\t\tconst datas = this.get();\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.get();\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 append(layouted: IInfiniteGridGroup) {\n\t\tthis._data.push(layouted);\n\t\treturn layouted.items;\n\t}\n\tpublic prepend(layouted: IInfiniteGridGroup) {\n\t\tthis._data.unshift(layouted);\n\t\treturn layouted.items;\n\t}\n\tpublic clear() {\n\t\tthis._data = [];\n\t}\n\tpublic remove(element: HTMLElement, start: number, end: number) {\n\t\tlet items: IInfiniteGridItem[] = [];\n\t\tlet groups: IInfiniteGridGroup[] = [];\n\t\tconst key = element.getAttribute(GROUPKEY_ATT);\n\t\tconst datas = this.get(start, end)\n\t\t\t.filter(v => String(v.groupKey) === key);\n\n\t\tif (!datas.length) {\n\t\t\treturn { items, groups };\n\t\t}\n\t\tconst data = datas[0];\n\n\t\tconst length = data.items.length;\n\t\tlet idx = -1;\n\n\t\tfor (let i = 0; i < length; i++) {\n\t\t\tif (data.items[i].el === element) {\n\t\t\t\tidx = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (idx >= 0) {\n\t\t\t// remove item information\n\t\t\titems = data.items.splice(idx, 1);\n\n\t\t\tif (!data.items.length) {\n\t\t\t\tthis._data.splice(this.indexOf(data), 1);\n\t\t\t\tgroups = [data];\n\t\t\t} else {\n\t\t\t\tthis.set(data, key);\n\t\t\t}\n\t\t}\n\t\treturn { items, groups };\n\t}\n\tpublic indexOf(data: IInfiniteGridGroup | string | number) {\n\t\tconst groupKey = typeof data === \"object\" ? data.groupKey : data;\n\t\tconst datas = this._data;\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 get(start?: number, end?: number) {\n\t\treturn isUndefined(start) ? this._data :\n\t\t\tthis._data.slice(start, (isUndefined(end) ? start : end) + 1);\n\t}\n\tpublic set(data: IInfiniteGridGroup | IInfiniteGridGroup[], key?: string | number) {\n\t\tif (!Array.isArray(data)) {\n\t\t\tif (!isUndefined(key)) {\n\t\t\t\tconst len = this._data.length;\n\t\t\t\tlet idx = -1;\n\n\t\t\t\tfor (let i = 0; i < len; i++) {\n\t\t\t\t\tif (this._data[i].groupKey === key) {\n\t\t\t\t\t\tidx = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tidx > 0 && (this._data[idx] = data);\n\t\t\t}\n\t\t} else {\n\t\t\tthis._data = data.concat();\n\t\t}\n\t}\n\tpublic getData(index: number) {\n\t\treturn this._data[index];\n\t}\n}\n","import {\n\tAPPEND,\n\tPREPEND,\n\tDUMMY_POSITION,\n\tMULTI,\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\tgetStyles,\n\taddOnceEvent,\n\tassign,\n} from \"./utils\";\nimport { RectType, IPosition, ISize, IJQuery, IInfiniteGridItem, WindowMockType, IDOMRendererStatus, IDOMRendererSize } from \"./types\";\n\nexport function resetSize(item: IInfiniteGridItem) {\n\titem.orgSize = null;\n\titem.size = null;\n}\nexport interface IDOMRendererOptions {\n\tisEqualSize: boolean;\n\tisConstantSize: boolean;\n\thorizontal: boolean;\n\tcontainer: boolean | HTMLElement;\n}\n\nexport interface IDOMRendererOrgStyle {\n\tposition?: CSSStyleDeclaration[\"position\"];\n\toverflowX?: CSSStyleDeclaration[\"overflowX\"];\n\toverflowY?: CSSStyleDeclaration[\"overflowY\"];\n}\n\nfunction createContainer(element: HTMLElement) {\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}\nfunction render(properties: RectType[], rect: IInfiniteGridItem[\"rect\"], styles: HTMLElement[\"style\"]) {\n\tproperties.forEach(p => {\n\t\t(p in rect) && (styles[p] = `${rect[p]}px`);\n\t});\n}\nfunction setTransition(styles: HTMLElement[\"style\"], transitionDuration?: number, pos1?: IPosition, pos2?: IPosition) {\n\tstyles[`${TRANSITION}-property`] = transitionDuration ? `${TRANSFORM},width,height` : \"\";\n\tstyles[`${TRANSITION}-duration`] = transitionDuration ? `${transitionDuration}s` : \"\";\n\tstyles[`${TRANSITION}-delay`] = transitionDuration ? `0s` : \"\";\n\tstyles[TRANSFORM] = transitionDuration ? `translate(${pos1.left - pos2.left}px,${pos1.top - pos2.top}px)` : \"\";\n}\n\nexport default class DOMRenderer {\n\tpublic static 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 styles = el.style;\n\n\t\t// for debugging\n\t\tel.setAttribute(GROUPKEY_ATT, `${item.groupKey}`);\n\t\tstyles.position = \"absolute\";\n\t\trender([\"width\", \"height\"], rect, styles);\n\t\tif (transitionDuration && TRANSITION && prevRect) {\n\t\t\tsetTransition(styles, transitionDuration, rect as IPosition, prevRect as IPosition);\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\tsetTransition(styles);\n\t\t\t\trender([\"left\", \"top\"], itemRect, styles);\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\trender([\"left\", \"top\"], rect, styles);\n\t\t\titem.prevRect = rect;\n\t\t}\n\t}\n\tpublic static renderItems(items: IInfiniteGridItem[], transitionDuration?: number) {\n\t\titems.forEach(item => {\n\t\t\tDOMRenderer.renderItem(item, item.rect, transitionDuration);\n\t\t});\n\t}\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 = $(noElementItems.map(({ content }) =>\n\t\t\tcontent.replace(/^[\\s\\uFEFF]+|[\\s\\uFEFF]+$/g, \"\")).join(\"\"), MULTI);\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: WindowMockType | HTMLElement;\n\tpublic options: IDOMRendererOptions = {\n\t\tisEqualSize: false,\n\t\tisConstantSize: false,\n\t\thorizontal: false,\n\t\tcontainer: 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\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 && assign({}, item.orgSize)) ||\n\t\t\t\tgetSize(item.el);\n\t\t\tif (!item.orgSize) {\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 append(items: IInfiniteGridItem[]) {\n\t\tthis._insert(items, APPEND, {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t});\n\t}\n\tpublic prepend(items: IInfiniteGridItem[]) {\n\t\tthis._insert(items, PREPEND, {\n\t\t\ttop: DUMMY_POSITION,\n\t\t\tleft: DUMMY_POSITION,\n\t\t});\n\t}\n\tpublic createAndInsert(items: IInfiniteGridItem[], isAppend?: boolean) {\n\t\tDOMRenderer.createElements(items);\n\n\t\tDOMRenderer.renderItems(items);\n\t\tthis._insert(items, isAppend);\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 isResize = this.isNeededResize();\n\n\t\tif (isResize) {\n\t\t\tthis._size = {\n\t\t\t\tviewport: this._calcSize(),\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\n\t\tfor (const p in this._orgStyle) {\n\t\t\t(this[container ? \"view\" : \"container\"] as HTMLElement).style[p as keyof IDOMRendererOrgStyle] =\n\t\t\t\tthis._orgStyle[p as keyof IDOMRendererOrgStyle];\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 = getStyles(element);\n\t\tconst { container, horizontal } = this.options;\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, styles?: IInfiniteGridItem[\"rect\"]) {\n\t\tconst container = this.container;\n\t\tconst df = document.createDocumentFragment();\n\n\t\titems.forEach(item => {\n\t\t\tstyles && DOMRenderer.renderItem(item, styles);\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}\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 { WindowMockType, IWatchStatus } from \"./types\";\n\nexport interface IWatcherOptions {\n\tcontainer: HTMLElement;\n\tisOverflowScroll: boolean;\n\thorizontal: boolean;\n\tresize: () => void;\n\tcheck: (e?: {\n\t\tisForward: boolean,\n\t\tscrollPos: number,\n\t\torgScrollPos: number,\n\t\thorizontal: boolean,\n\t}) => void;\n}\n\nexport default class Watcher {\n\tpublic options: IWatcherOptions;\n\tprivate _timer: {\n\t\tresize: any;\n\t};\n\tprivate _containerOffset: number;\n\tprivate _view: WindowMockType | HTMLElement;\n\tprivate _isScrollIssue: boolean;\n\tprivate _prevPos: number;\n\tconstructor(view: WindowMockType | 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}, options);\n\t\tthis._timer = {\n\t\t\tresize: null,\n\t\t};\n\t\tthis.reset();\n\t\tthis._containerOffset = 0;\n\t\tthis._view = view;\n\t\tthis._isScrollIssue = IS_IOS;\n\t\tthis._onCheck = this._onCheck.bind(this);\n\t\tthis._onResize = this._onResize.bind(this);\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\tlet rawPos = pos;\n\n\t\tif (typeof pos === \"undefined\") {\n\t\t\trawPos = this.getOrgScrollPos();\n\t\t}\n\t\tthis._prevPos = rawPos - 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 _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 _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 _onResize() {\n\t\tif (this._timer.resize) {\n\t\t\tclearTimeout(this._timer.resize);\n\t\t}\n\t\tthis._timer.resize = setTimeout(() => {\n\t\t\tthis.resize();\n\t\t\tthis.options.resize();\n\t\t\tthis._timer.resize = null;\n\t\t\tthis.reset();\n\t\t}, 100);\n\t}\n\n}\n","import ItemManager from \"./ItemManager\";\nimport { assign } from \"./utils\";\nimport { CursorType, IInfiniteGridItem, IInfiniteGridGroup, IInfiniteStatus } from \"./types\";\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\nexport interface IInfiniteOptions {\n\tuseRecycle?: boolean;\n\tthreshold?: number;\n\tappend?: (e?: { cache: IInfiniteGridGroup[] }) => void;\n\tprepend?: (e?: { cache: IInfiniteGridGroup[] }) => void;\n\trecycle?: (e?: { start: number, end: number }) => void;\n}\nclass Infinite {\n\tpublic options: Required;\n\tprivate _items: 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._items = itemManger;\n\t\tthis.clear();\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._status.size = size;\n\t}\n\tpublic recycle(scrollPos: number, isForward?: boolean) {\n\t\tif (!this.options.useRecycle) {\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._items.get(startCursor, endCursor)\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\trecycle({ start, end });\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}\n\tpublic scroll(scrollPos: number) {\n\t\tconst startCursor = this.getCursor(\"start\");\n\t\tconst endCursor = this.getCursor(\"end\");\n\t\tconst items = this._items;\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.get();\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 if (endScrollPos >= endEdgePos - threshold) {\n\t\t\tappend({ cache: datas.slice(endCursor + 1, endCursor + 2) });\n\t\t} else if (scrollPos <= startEdgePos + threshold) {\n\t\t\tprepend({ cache: datas.slice(startCursor - 1, startCursor) });\n\t\t}\n\t}\n\tpublic setCursor(cursor: CursorType, index: number) {\n\t\tconst status = this._status;\n\t\tconst items = this._items;\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._items.indexOf(startKey), 0);\n\t\tconst endIndex = (this._items.indexOf(endKey) + 1 || this._items.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._items.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() {\n\t\treturn this._items.pluck(\"items\", this._status.startCursor, this._status.endCursor);\n\t}\n\tpublic getCursor(cursor: CursorType) {\n\t\treturn this._status[cursor === \"start\" ? \"startCursor\" : \"endCursor\"];\n\t}\n\tpublic getVisibleData() {\n\t\treturn this._items.get(this._status.startCursor, this._status.endCursor);\n\t}\n\tpublic remove(element: HTMLElement): {\n\t\titems: IInfiniteGridItem[],\n\t\tgroups: IInfiniteGridGroup[],\n\t} {\n\t\tconst { startCursor, endCursor } = this._status;\n\t\tconst result =\n\t\t\tthis._items.remove(element, startCursor, endCursor);\n\n\t\tif (result.groups.length) {\n\t\t\tthis.setCursor(\"end\", endCursor - 1);\n\t\t}\n\t\tif (!this._items.size()) {\n\t\t\tthis._status.startCursor = -1;\n\t\t\tthis._status.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","import { window } from \"./browser\";\nimport { addEvent, removeEvent, innerWidth, innerHeight } from \"./utils\";\n\nconst elements: HTMLElement[] = [];\n\nfunction onResize() {\n\tAutoSizer.resizeAll();\n}\nexport interface IAutoSizierElemenet extends HTMLElement {\n\t__PREFIX__?: string;\n}\nexport default class AutoSizer {\n\tpublic static add(element: IAutoSizierElemenet, prefix = \"data-\") {\n\t\tif (!elements.length) {\n\t\t\taddEvent(window, \"resize\", onResize);\n\t\t}\n\t\telement.__PREFIX__ = prefix;\n\t\telements.push(element);\n\t\tAutoSizer.resize(element);\n\t}\n\tpublic static remove(element: IAutoSizierElemenet, isFixed = false) {\n\t\tconst fixed = element.getAttribute(`${element.__PREFIX__}fixed`) || \"width\";\n\n\t\tif (!isFixed) {\n\t\t\telement.style[fixed === \"width\" ? \"height\" : \"width\"] = \"\";\n\t\t}\n\t\tconst index = elements.indexOf(element);\n\n\t\tif (index < 0) {\n\t\t\treturn;\n\t\t}\n\t\telements.splice(index, 1);\n\t\tif (!elements.length) {\n\t\t\tremoveEvent(window, \"reisze\", onResize);\n\t\t}\n\t}\n\tpublic static resize(element: IAutoSizierElemenet, prefix = \"data-\") {\n\t\tconst elementPrefix = typeof element.__PREFIX__ === \"string\" ? element.__PREFIX__ : prefix;\n\t\tconst dataWidth = parseInt(element.getAttribute(`${elementPrefix}width`), 10) || 0;\n\t\tconst dataHeight = parseInt(element.getAttribute(`${elementPrefix}height`), 10) || 0;\n\t\tconst fixed = element.getAttribute(`${elementPrefix}fixed`);\n\n\t\tif (fixed === \"height\") {\n\t\t\tconst size = innerHeight(element) || dataHeight;\n\n\t\t\telement.style.width = `${dataWidth / dataHeight * size}px`;\n\t\t} else {\n\t\t\tconst size = innerWidth(element) || dataWidth;\n\n\t\t\telement.style.height = `${dataHeight / dataWidth * size}px`;\n\t\t}\n\t}\n\tpublic static resizeAll() {\n\t\telements.forEach(element => AutoSizer.resize(element));\n\t}\n}\n","import { IS_IE } from \"./consts\";\nimport { addEvent, removeEvent, toArray } from \"./utils\";\nimport AutoSizer from \"./AutoSizer\";\n\nexport const CHECK_ALL: 1 = 1;\nexport const CHECK_ONLY_ERROR: 2 = 2;\n\nexport interface IImageLoadedOptions {\n\tprefix?: string;\n\tlength?: number;\n\ttype?: 1 | 2;\n\tcomplete?: () => void;\n\tend?: () => void;\n\terror?: (e: { target: LoadingImageElement, itemIndex: number }) => void;\n}\nexport interface LoadingImageElement extends HTMLImageElement {\n\t__ITEM_INDEX__?: number;\n}\n\nfunction isDataAttribute(target: HTMLElement, prefix: string) {\n\treturn !!target.getAttribute(`${prefix}width`);\n}\n\nclass ImageLoaded {\n\tpublic static CHECK_ALL = 1;\n\tpublic static CHECK_ONLY_ERROR = 2;\n\tpublic static waitImageLoaded(\n\t\tchecklist: LoadingImageElement[][],\n\t\t{ prefix = \"\", length, type, complete, error, end }: IImageLoadedOptions,\n\t) {\n\t\tlet checkCount = 0;\n\t\tlet endCount = length;\n\n\t\tif (type !== CHECK_ONLY_ERROR) {\n\t\t\tcheckCount = endCount;\n\t\t}\n\t\tconst checkEnd = () => {\n\t\t\tif (--endCount !== 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tend && end();\n\t\t};\n\t\tconst checkImage = () => {\n\t\t\tcheckCount--;\n\t\t\tif (checkCount !== 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcomplete && complete();\n\t\t};\n\t\tconst onError = (target: LoadingImageElement, itemIndex = target.__ITEM_INDEX__) => {\n\t\t\terror && error({\n\t\t\t\ttarget,\n\t\t\t\titemIndex,\n\t\t\t});\n\t\t};\n\t\tconst onCheck = (e: Event) => {\n\t\t\tconst target = (e.target || e.srcElement) as LoadingImageElement;\n\n\t\t\tremoveEvent(target, \"error\", onCheck);\n\t\t\tremoveEvent(target, \"load\", onCheck);\n\n\t\t\tif (type === CHECK_ALL && isDataAttribute(target, prefix)) {\n\t\t\t\tAutoSizer.remove(target, e.type === \"error\");\n\t\t\t} else {\n\t\t\t\tcheckImage();\n\t\t\t}\n\t\t\tif (e.type === \"error\") {\n\t\t\t\tonError(target);\n\t\t\t}\n\t\t\tdelete target.__ITEM_INDEX__;\n\t\t\tcheckEnd();\n\t\t};\n\n\t\tchecklist.forEach((images, i) => {\n\t\t\timages.forEach(v => {\n\t\t\t\t// workaround for IE\n\t\t\t\tif (v.complete && (!IS_IE || (IS_IE && v.naturalWidth))) {\n\t\t\t\t\tif (!v.naturalWidth) {\n\t\t\t\t\t\tonError(v, i);\n\t\t\t\t\t}\n\t\t\t\t\tcheckImage();\n\t\t\t\t\tcheckEnd();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tv.__ITEM_INDEX__ = i;\n\t\t\t\tif (type === CHECK_ALL && isDataAttribute(v, prefix)) {\n\t\t\t\t\tAutoSizer.add(v, prefix);\n\t\t\t\t\tcheckImage();\n\t\t\t\t}\n\t\t\t\taddEvent(v, \"load\", onCheck);\n\t\t\t\taddEvent(v, \"error\", onCheck);\n\n\t\t\t\tIS_IE && v.setAttribute(\"src\", v.getAttribute(\"src\"));\n\t\t\t});\n\t\t});\n\t}\n\tpublic static checkImageLoaded(el: HTMLElement) {\n\t\tif (el.tagName === \"IMG\") {\n\t\t\treturn (el as HTMLImageElement).complete ? [] : [(el as HTMLImageElement)];\n\t\t} else {\n\t\t\treturn toArray(el.querySelectorAll(\"img\"));\n\t\t}\n\t}\n\tpublic static check(\n\t\telements: HTMLElement[],\n\t\t{ prefix, type = CHECK_ALL, complete, error, end }: IImageLoadedOptions,\n\t) {\n\t\tconst images = elements.map(element => this.checkImageLoaded(element));\n\t\tconst length = images.reduce((sum, element) => sum + element.length, 0);\n\n\t\tif (type === CHECK_ONLY_ERROR || length === 0) {\n\t\t\t// convert to async\n\t\t\tsetTimeout(() => {\n\t\t\t\tcomplete && complete();\n\t\t\t\tif (length === 0) {\n\t\t\t\t\tend && end();\n\t\t\t\t}\n\t\t\t}, 0);\n\t\t}\n\t\tif (length > 0) {\n\t\t\tsetTimeout(() => {\n\t\t\t\tthis.waitImageLoaded(images, { prefix, length, type, complete, error, end });\n\t\t\t}, 0);\n\t\t}\n\t}\n}\n\nexport default ImageLoaded;\n","import AutoSizer from \"./AutoSizer\";\nimport ImageLoaded, { CHECK_ALL, CHECK_ONLY_ERROR } from \"./ImageLoaded\";\nimport ItemManager from \"./ItemManager\";\nimport { matchHTML, $, assign } from \"./utils\";\nimport { DUMMY_POSITION } from \"./consts\";\nimport DOMRenderer from \"./DOMRenderer\";\nimport { ILayout, ILayoutResult, IInfiniteGridItem, IInfiniteGridGroup, IErrorCallbackOptions } from \"./types\";\n\nfunction hasTarget(target: T[], value: T) {\n\treturn ~target.indexOf(value);\n}\n\nexport interface ILayoutManagerOptions {\n\tattributePrefix?: string;\n\tisEqualSize?: boolean;\n\tisConstantSize?: boolean;\n\thorizontal?: boolean;\n}\n\nexport interface ICompleteCallbackOptions {\n\tgroups?: ILayoutResult[];\n\titems?: IInfiniteGridItem[];\n\tisAppend?: boolean;\n}\nexport interface IEndCallbackOptions {\n\tremove: HTMLElement[];\n\tlayout?: boolean;\n}\nexport interface ILayoutManagerCallbacks {\n\tcomplete: (e: ICompleteCallbackOptions) => void;\n\terror: (e: IErrorCallbackOptions) => void;\n\tend: (e: IEndCallbackOptions) => void;\n}\n\nexport default class LayoutMananger {\n\tpublic options: Required;\n\tpublic _items: ItemManager;\n\tpublic _renderer: DOMRenderer;\n\tpublic _layout: ILayout;\n\tconstructor(items: ItemManager, renderer: DOMRenderer, options: ILayoutManagerOptions = {}) {\n\t\tassign(this.options = {\n\t\t\tattributePrefix: \"data-\",\n\t\t\tisEqualSize: false,\n\t\t\tisConstantSize: false,\n\t\t\thorizontal: false,\n\t\t}, options);\n\n\t\tthis._items = items;\n\t\tthis._renderer = renderer;\n\t\tthis._layout = null;\n\t}\n\tpublic setLayout(layout: ILayout) {\n\t\tthis._layout = layout;\n\t}\n\tpublic setSize(size: number) {\n\t\tthis._layout.setSize(size);\n\t}\n\tpublic append(\n\t\t{\n\t\t\tgroups,\n\t\t\titems,\n\t\t\tisUpdate,\n\t\t}: {\n\t\t\tgroups: IInfiniteGridGroup[],\n\t\t\titems: IInfiniteGridItem[],\n\t\t\tisUpdate?: boolean,\n\t\t},\n\t\tcallbacks: Partial,\n\t) {\n\t\tthis._insert({ groups, items, isUpdate, isAppend: true }, callbacks);\n\t}\n\tpublic prepend(\n\t\t{\n\t\t\tgroups,\n\t\t\titems,\n\t\t\tisUpdate,\n\t\t}: {\n\t\t\tgroups: IInfiniteGridGroup[],\n\t\t\titems: IInfiniteGridItem[],\n\t\t\tisUpdate?: boolean,\n\t\t},\n\t\tcallbacks: Partial,\n\t) {\n\t\tthis._insert({ groups, items, isUpdate, isAppend: false }, callbacks);\n\t}\n\tpublic layout(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\treturn layoutGroups;\n\t}\n\tpublic destroy() {\n\t\tthis._items = null;\n\t\tthis._renderer = null;\n\t}\n\tprivate _complete(\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tisAppend: boolean,\n\t\tisUpdate: boolean,\n\t\tcallback: ILayoutManagerCallbacks[\"complete\"],\n\t) {\n\t\tconst itemManager = this._items;\n\t\tconst cursor = isAppend ? \"end\" : \"start\";\n\t\tconst groupIndex = itemManager.indexOf(groups[0]);\n\t\tconst prevGroup = itemManager.getData(groupIndex + (isAppend ? -1 : 1));\n\t\tlet outline = prevGroup ? prevGroup.outlines[cursor] : [0];\n\n\t\tthis._renderer.updateSize(items);\n\n\t\tconst groupInfos = groups.map(group => {\n\t\t\tconst groupOutline = group.outlines[isAppend ? \"start\" : \"end\"];\n\t\t\tconst isRelayout = isUpdate || !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\tDOMRenderer.renderItems(group.items);\n\t\t\t\treturn group;\n\t\t\t}\n\t\t\tconst groupItems = group.items;\n\t\t\tconst groupInfo = this._layout[isAppend ? \"append\" : \"prepend\"](groupItems, outline, true);\n\n\t\t\tassign(group, groupInfo);\n\t\t\tDOMRenderer.renderItems(groupInfo.items);\n\t\t\toutline = groupInfo.outlines[isAppend ? \"end\" : \"start\"];\n\n\t\t\treturn groupInfo;\n\t\t});\n\n\t\tcallback({\n\t\t\tgroups: groupInfos,\n\t\t\titems,\n\t\t\tisAppend,\n\t\t});\n\t}\n\tprivate _error(\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\ttarget: HTMLImageElement,\n\t\titems: IInfiniteGridItem[],\n\t\terrorIndex: number,\n\t\tcallback: ILayoutManagerCallbacks[\"error\"],\n\t) {\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 {\n\t\t\t\t\ttarget.src = src;\n\t\t\t\t\tif (target.getAttribute(`${prefix}width`)) {\n\t\t\t\t\t\tAutoSizer.remove(target);\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\n\t\tcallback({\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});\n\t}\n\tprivate _end(\n\t\tremoveTarget: HTMLElement[],\n\t\treplaceTarget: number[],\n\t\titems: IInfiniteGridItem[],\n\t\tcallback: ILayoutManagerCallbacks[\"end\"],\n\t) {\n\t\tconst { attributePrefix } = this.options;\n\n\t\tconst removeTargetLength = removeTarget.length;\n\t\tconst replaceTargetLength = replaceTarget.length;\n\n\t\tif (!removeTargetLength && !replaceTargetLength) {\n\t\t\tcallback({ 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\tcallback({ remove: removeTarget, layout: true });\n\t\t\treturn;\n\t\t}\n\t\t// wait layoutComplete beacause of error event.\n\t\tImageLoaded.check(layoutedItems.map(v => v.el), {\n\t\t\tprefix: attributePrefix,\n\t\t\tcomplete: () => {\n\t\t\t\tthis._renderer.updateSize(layoutedItems);\n\t\t\t\tcallback({ remove: removeTarget, layout: true });\n\t\t\t},\n\t\t});\n\t}\n\tprivate _insert(\n\t\t{\n\t\t\tgroups,\n\t\t\titems = ItemManager.pluck(groups, \"items\"),\n\t\t\tisAppend,\n\t\t\tisUpdate,\n\t\t}: {\n\t\t\tgroups: IInfiniteGridGroup[],\n\t\t\titems: IInfiniteGridItem[],\n\t\t\tisAppend: boolean,\n\t\t\tisUpdate: boolean,\n\t\t},\n\t\t{\n\t\t\terror = () => void 0,\n\t\t\tcomplete = () => void 0,\n\t\t\tend = () => void 0,\n\t\t}: Partial,\n\t) {\n\t\tif (!groups.length) {\n\t\t\treturn;\n\t\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 type = this.options.isEqualSize && this._renderer._size.item ? CHECK_ONLY_ERROR : CHECK_ALL;\n\t\tconst prefix = this.options.attributePrefix;\n\n\t\tImageLoaded.check(elements, {\n\t\t\tprefix,\n\t\t\ttype,\n\t\t\tcomplete: () => {\n\t\t\t\tif (!this._items) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._complete(checkGroups, items, isAppend, isUpdate, complete);\n\t\t\t},\n\t\t\terror: ({ target, itemIndex }) => {\n\t\t\t\tif (!this._items) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._error(removeTarget, replaceTarget, target, items, itemIndex, error);\n\t\t\t},\n\t\t\tend: () => {\n\t\t\t\tif (!this._items) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._end(removeTarget, replaceTarget, items, end);\n\t\t\t},\n\t\t});\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, { resetSize } from \"./DOMRenderer\";\nimport Watcher from \"./Watcher\";\nimport {\n\tAPPEND,\n\tPREPEND,\n\tCACHE,\n\tNO_CACHE,\n\tTRUSTED,\n\tNO_TRUSTED,\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} from \"./consts\";\nimport Infinite from \"./Infinite\";\nimport { toArray, $, outerHeight, outerWidth, assign } from \"./utils\";\nimport LayoutMananger from \"./LayoutManager\";\nimport {\n\tIJQuery, ILayout,\n\tCursorType, StyleType,\n\tIItemManagerStatus, IInfiniteGridItem,\n\tIInfiniteGridGroup, IErrorCallbackOptions, IDOMRendererStatus, IWatchStatus, IInfiniteStatus, IInfiniteGridStatus\n} from \"./types\";\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\nexport interface IInfiniteGridOptions {\n\titemSelector: string;\n\tisOverflowScroll: boolean;\n\tthreshold: number;\n\tisEqualSize: boolean;\n\tisConstantSize: boolean;\n\tuseRecycle: boolean;\n\thorizontal: boolean;\n\ttransitionDuration: number;\n\tuseFit: boolean;\n\tattributePrefix: string;\n}\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 _items: ItemManager;\n\tprivate _renderer: DOMRenderer;\n\tprivate _manager: LayoutMananger;\n\tprivate _watcher: Watcher;\n\tprivate _infinite: Infinite;\n\tprivate _status: IInfiniteGridStatus[\"_status\"];\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 */\n\tconstructor(element: HTMLElement | string | IJQuery, options?: Partial) {\n\t\tsuper();\n\t\tassign(this.options = {\n\t\t\titemSelector: \"*\",\n\t\t\tisOverflowScroll: false,\n\t\t\tthreshold: 100,\n\t\t\tisEqualSize: false,\n\t\t\tisConstantSize: false,\n\t\t\tuseRecycle: true,\n\t\t\thorizontal: false,\n\t\t\ttransitionDuration: 0,\n\t\t\tuseFit: true,\n\t\t\tattributePrefix: \"data-\",\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\t\tthis._loadingBar = {};\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} = this.options;\n\n\t\tthis._items = 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});\n\t\tthis._watcher = new Watcher(\n\t\t\tthis._renderer.view,\n\t\t\t{\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._items, {\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\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 {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트의 배열\n\t * @param {Number|String} [groupKey] 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._manager && this._insert({\n\t\t\telements,\n\t\t\tisAppend: APPEND,\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 {Array|jQuery} elements Array of the card elements to be added 추가할 카드 엘리먼트 배열\n\t * @param {Number|String} [groupKey] 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._manager && this._insert({\n\t\t\telements,\n\t\t\tisAppend: PREPEND,\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 { isEqualSize, isConstantSize, attributePrefix, horizontal } = this.options;\n\n\t\tif (!this._manager) {\n\t\t\tthis._manager = new LayoutMananger(this._items, this._renderer, {\n\t\t\t\tattributePrefix,\n\t\t\t\tisEqualSize,\n\t\t\t\tisConstantSize,\n\t\t\t});\n\t\t}\n\t\tif (typeof LayoutKlass === \"function\") {\n\t\t\tthis._manager.setLayout(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._manager.setLayout(LayoutKlass);\n\t\t}\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._items.pluck(\"items\") : this._infinite.getVisibleItems();\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._manager) {\n\t\t\treturn this;\n\t\t}\n\t\tconst renderer = this._renderer;\n\t\tconst itemManager = this._items;\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\tif (isRelayout) {\n\t\t\tthis._watcher.resize();\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 (!size || !items.length) {\n\t\t\tconst children = toArray(renderer.container.children);\n\n\t\t\tif (children.length) {\n\t\t\t\tthis._insert({\n\t\t\t\t\telements: children,\n\t\t\t\t\tisAppend: true,\n\t\t\t\t\tisChildren: true,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (renderer.getContainerSize()) {\n\t\t\t\t\trenderer.setContainerSize(0);\n\t\t\t\t}\n\t\t\t\tthis._requestAppend({});\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t\t// layout datas\n\t\tconst startCursor = infinite.getCursor(\"start\");\n\t\tconst endCursor = infinite.getCursor(\"end\");\n\t\tconst data = isLayoutAll || !(isRelayout && isResize) ? itemManager.get() :\n\t\t\titemManager.get(startCursor, endCursor);\n\n\t\t// LayoutManger interface\n\t\tthis._manager.layout(isRelayout, data, isResize ? items : []);\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\tDOMRenderer.renderItems(items, transitionDuration);\n\t\tisRelayout && this._watcher.setScrollPos();\n\t\tthis._onLayoutComplete({\n\t\t\titems,\n\t\t\tisAppend: APPEND,\n\t\t\tfromCache: CACHE,\n\t\t\tisTrusted: NO_TRUSTED,\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 element on a grid layout.\n\t * @ko 그리드 레이아웃의 카드 엘리먼트를 삭제한다.\n\t * @param {HTMLElement} item element to be removed 삭제될 아이템 엘리먼트\n\t * @return {Object} Removed item element 삭제된 아이템 엘리먼트 정보\n\t */\n\tpublic remove(element: HTMLElement, isLayout = true) {\n\t\tif (element) {\n\t\t\tconst {items, groups} = this._infinite.remove(element);\n\n\t\t\titems && DOMRenderer.removeElement(element);\n\t\t\tisLayout && this.layout(groups.length > 0);\n\t\t\treturn items;\n\t\t}\n\t\treturn null;\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._items.get() : 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_items: this._items.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) {\n\t\tif (!status) {\n\t\t\treturn this;\n\t\t}\n\t\tconst { _status, _renderer, _items, _watcher, _infinite } = status;\n\n\t\tif (!_status ||\n\t\t\t!_renderer || !_items || !_watcher || !_infinite) {\n\t\t\treturn this;\n\t\t}\n\t\tconst items = this._items;\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(_items);\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\trenderer.createAndInsert(visibleItems, true);\n\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._items.clearOutlines();\n\t\t\t\tthis._postLayout({\n\t\t\t\t\tfromCache: true,\n\t\t\t\t\tgroups: isEqualSize ? items.get() : 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._items.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\tprepepnd?: 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\tfor (const type in loadingBarObj) {\n\t\t\tloadingBar[type as \"append\" | \"prepend\"] = $(loadingBarObj[type as \"append\" | \"prepend\"]);\n\t\t\tloadingBar[type as \"append\" | \"prepend\"].className += ` ${IGNORE_CLASSNAME}`;\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 * 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\t\tthis._renderLoading(userStyle);\n\t\tthis._status.loadingStyle = userStyle;\n\t\tif (!isAppend) {\n\t\t\tthis._fit();\n\t\t} else {\n\t\t\tthis._setContainerSize(this._getEdgeValue(\"end\") + this._status.loadingSize);\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 as keyof StyleType] = 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}\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 = 0, itemIndex?: number): IInfiniteGridItem {\n\t\tif (itemIndex == null && typeof groupIndex === \"object\") {\n\t\t\tif (!groupIndex) {\n\t\t\t\treturn undefined;\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._items.getData(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._items.getData(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 = infinite.getCursor(\"start\");\n\t\tconst endCursor = infinite.getCursor(\"end\");\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\tmoveCache: true,\n\t\t\t\tmoveItem: itemIndex,\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\tmoveItem: itemIndex,\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._manager.destroy();\n\t\tthis._reset();\n\t\tthis._items.clear();\n\t\tthis._renderer.destroy();\n\t}\n\tprivate _setContainerSize(size: number) {\n\t\tthis._renderer.setContainerSize(Math.max(this._items.getMaxEdgeValue(), size));\n\t}\n\tprivate _appendLoadingBar() {\n\t\tconst loadingBar = this._loadingBar;\n\t\tconst container = this._renderer.container;\n\n\t\tfor (const type in loadingBar) {\n\t\t\tcontainer.appendChild(loadingBar[type as \"append\" | \"prepend\"]);\n\t\t}\n\t}\n\tprivate _setSize(size: number) {\n\t\tthis._infinite.setSize(this._renderer.getViewSize());\n\t\tthis._manager.setSize(size);\n\t}\n\tprivate _fitItems(base: number, margin = 0) {\n\t\tbase > 0 && this._watcher.scrollBy(-base);\n\t\tthis._items.fit(base, this.options.horizontal);\n\t\tDOMRenderer.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 _isLoading() {\n\t\treturn this._getLoadingStatus() > 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\tisChildren,\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\tisChildren?: 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.from(elements, this.options.itemSelector, {\n\t\t\tgroupKey,\n\t\t});\n\n\t\tif (!items.length) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst group: IInfiniteGridGroup = {\n\t\t\tgroupKey,\n\t\t\titems,\n\t\t\toutlines: { start: [], end: [] },\n\t\t};\n\t\tconst method = isAppend ? \"append\" : \"prepend\";\n\n\t\tthis._items[method](group);\n\n\t\tif (!isAppend) {\n\t\t\tconst infinite = this._infinite;\n\t\t\tconst startCursor = infinite.getCursor(\"start\");\n\t\t\tconst endCursor = infinite.getCursor(\"end\");\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: NO_CACHE,\n\t\t\tgroups: [group],\n\t\t\titems,\n\t\t\tnewItems: items,\n\t\t\tisAppend,\n\t\t\tisChildren,\n\t\t\tisTrusted: NO_TRUSTED,\n\t\t});\n\t}\n\t// add items, and remove items for recycling\n\tprivate _recycle({ start, end }: { start: number, end: number }) {\n\t\tif (!this.options.useRecycle) {\n\t\t\treturn;\n\t\t}\n\t\tDOMRenderer.removeItems(this._items.pluck(\"items\", start, end));\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 as keyof StyleType] = 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 _onImageError(e: IErrorCallbackOptions) {\n\t\t/**\n\t\t * This event is fired when an error occurs in the image.\n\t\t * @ko 이미지 로드에 에러가 날 때 발생하는 이벤트.\n\t\t * @event eg.InfiniteGrid#imageError\n\t\t * @param {eg.InfiniteGrid.IErrorCallbackOptions} e The object of data to be sent to an event 이벤트에 전달되는 데이터 객체\n\t\t * @example\n\tig.on(\"imageError\", e => {\n\t e.remove();\n\t e.removeItem();\n\t e.replace(\"http://...jpg\");\n\t e.replace(imageElement);\n\t e.replaceItem(\"item html\");\n\t});\n\t\t */\n\t\tthis.trigger(\"imageError\", assign(e, { element: e.item.el }));\n\t}\n\tprivate _postCache({\n\t\tcache,\n\t\tisAppend,\n\t\tisTrusted = true,\n\t\tmoveItem = -1,\n\t}: {\n\t\tcache: IInfiniteGridGroup[],\n\t\tisAppend?: boolean,\n\t\tisTrusted?: boolean,\n\t\tmoveItem?: number,\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) {\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\tthis._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\tmoveItem,\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\tisChildren,\n\t\tisTrusted,\n\t\tmoveCache,\n\t\tmoveItem = -2,\n\t}: {\n\t\tfromCache: boolean,\n\t\tgroups: IInfiniteGridGroup[],\n\t\titems: IInfiniteGridItem[],\n\t\tnewItems?: IInfiniteGridItem[],\n\t\tisAppend: boolean,\n\t\tisChildren?: boolean,\n\t\tisTrusted?: boolean,\n\t\tmoveCache?: boolean,\n\t\tmoveItem?: number,\n\t}) {\n\t\tthis._process(PROCESSING);\n\t\tconst method = isAppend ? \"append\" : \"prepend\";\n\t\tconst itemManager = this._items;\n\t\tconst horizontal = this.options.horizontal;\n\n\t\t// If container has children, it does not render first.\n\t\tif (!isChildren) {\n\t\t\tDOMRenderer.createElements(items);\n\t\t\tthis._renderer[method](items);\n\t\t}\n\t\tthis._manager[method]({\n\t\t\tgroups,\n\t\t\titems: newItems,\n\t\t}, {\n\t\t\t\tcomplete: () => {\n\t\t\t\t\tconst infinite = this._infinite;\n\t\t\t\t\tconst startCursor = Math.max(infinite.getCursor(\"start\"), 0);\n\t\t\t\t\tconst endCursor = Math.max(infinite.getCursor(\"end\"), 0);\n\t\t\t\t\tlet requestStartCursor = itemManager.indexOf(groups[0].groupKey);\n\t\t\t\t\tlet requestEndCursor = itemManager.indexOf(groups[groups.length - 1].groupKey);\n\t\t\t\t\tlet isInCursor = true;\n\n\t\t\t\t\tif (requestStartCursor > endCursor + 1 || requestEndCursor < startCursor - 1) {\n\t\t\t\t\t\tisInCursor = false;\n\t\t\t\t\t}\n\t\t\t\t\tif (isInCursor) {\n\t\t\t\t\t\tif (isAppend) {\n\t\t\t\t\t\t\trequestStartCursor = startCursor;\n\t\t\t\t\t\t\trequestEndCursor = Math.max(endCursor, requestEndCursor);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trequestStartCursor = Math.max(Math.min(startCursor, requestStartCursor), 0);\n\t\t\t\t\t\t\trequestEndCursor = endCursor;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t!isInCursor && this._recycle({ start: startCursor, end: endCursor });\n\t\t\t\t\tinfinite.setCursor(\"start\", requestStartCursor);\n\t\t\t\t\tinfinite.setCursor(\"end\", requestEndCursor);\n\n\t\t\t\t\tif (moveItem > -1) {\n\t\t\t\t\t\tconst pos = items[moveItem].rect[horizontal ? \"left\" : \"top\"];\n\n\t\t\t\t\t\tif (!isInCursor && !moveCache) {\n\t\t\t\t\t\t\titemManager.clearOutlines(requestStartCursor, requestEndCursor);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._scrollTo(pos);\n\t\t\t\t\t\tthis._setScrollPos(pos);\n\t\t\t\t\t}\n\t\t\t\t\tthis._onLayoutComplete({\n\t\t\t\t\t\titems,\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},\n\t\t\t\terror: e => this._onImageError(e),\n\t\t\t\tend: ({ 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 watcher = this._watcher;\n\t\t\t\t\t\tconst scrollPos = watcher.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\t});\n\t\treturn this;\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: APPEND });\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: TRUSTED,\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.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: PREPEND });\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: TRUSTED,\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 _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 (scrollPos > 0) {\n\t\t\t\t!IS_IOS && this._scrollTo(scrollPos);\n\t\t\t}\n\t\t}\n\t\t!isLayout && this._process(PROCESSING, false);\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,\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 { APPEND, PREPEND, 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, APPEND);\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, APPEND, 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, PREPEND, 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};\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, 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 = 0;\n\n\tif (item.el) {\n\t\tconst dataset = item.el.dataset;\n\n\t\tif (dataset) {\n\t\t\tcolumn = parseInt(dataset.column, 10) || 1;\n\t\t} else {\n\t\t\tcolumn = parseInt(item.el.getAttribute(\"column\"), 10) || 1;\n\t\t}\n\t} else {\n\t\tcolumn = 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. 아이템의 사이즈. 만약 아이템 사이즈가 0이면, 아이템들의 첫번째 아이템의 사이즈로 계산이 된다. \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 _checkItemSize() {\n\t\tconst column = this.options.column;\n\n\t\tif (!column) {\n\t\t\tsuper._checkItemSize();\n\t\t\treturn;\n\t\t}\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) / column - margin;\n\t}\n\tprotected _layout(\n\t\titems: IInfiniteGridItem[],\n\t\toutline: number[] = [],\n\t\tisAppend?: boolean,\n\t) {\n\t\tconst itemSize = this._getItemSize() 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, 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}\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":["isUndefined","value","Component","_eventHandler","options","_proto","prototype","trigger","eventName","customEvent","handlerList","hasHandlerList","length","concat","eventType","isCanceled","arg","i","stop","currentTarget","_len","arguments","restParam","Array","_key","apply","once","handlerToAttach","eventHash","self","on","listener","_len2","_key2","off","hasOn","name","push","handlerToDetach","undefined","k","handlerFunction","splice","VERSION","win","window","document","navigator","userAgent","ua","SUPPORT_COMPUTEDSTYLE","SUPPORT_ADDEVENTLISTENER","SUPPORT_PASSIVE","supportsPassiveOption","Object","defineProperty","addEventListener","get","e","IS_IE","test","IS_IOS","IS_ANDROID2","CONTAINER_CLASSNAME","IGNORE_CLASSNAME","TRANSITION_NAME","APPEND","PREPEND","VERTICAL","HORIZONTAL","CACHE","NO_CACHE","TRUSTED","NO_TRUSTED","MULTI","DUMMY_POSITION","GROUPKEY_ATT","DEFAULT_OPTIONS","horizontal","margin","agent","toLowerCase","isMobile","IDLE","LOADING_APPEND","LOADING_PREPEND","PROCESSING","webkit","exec","WEBKIT_VERSION","parseInt","DEFENSE_BROWSER","TRANSFORM","TRANSITION","TRANSITION_END","nodes","array","len","html","match","param","multi","el","matchHTML","dummy","createElement","innerHTML","childNodes","querySelectorAll","toArray","isWindow","isJQuery","$","isArray","map","v","nodeName","nodeType","element","type","handler","eventListenerOptions","attachEvent","removeEventListener","detachEvent","callback","removeEvent","addEvent","prop","body","documentElement","x","y","scroll","scrollLeft","scrollTop","scrollBy","getComputedStyle","currentStyle","isOffset","isDocument","doc","Math","max","size","clientRect","getBoundingClientRect","right","left","bottom","top","parseFloat","getStyles","_getSize","width","outerWidth","height","outerHeight","STYLE","vertical","startPos1","endPos1","size1","startPos2","endPos2","size2","isHorizontal","target","_i","sources","forEach","source","key","defaultOptions","assign","items","item","jQuery","constructor","jquery","arr","clear","ItemManager","elements","selector","_a","groupKey","filted","selectItems","content","outerHTML","rect","filter","classNames","className","split","some","c","data","property","reduce","acc","startKey","endKey","datas","_data","startIndex","indexOf","endIndex","slice","item2","data2","status","set","base","outlines","start","end","pluck","index","cursor","targetValue","Infinity","getOutline","getEdgeIndex","startCursor","endCursor","group","groups","pos","layouted","unshift","getAttribute","String","idx","orgSize","container","style","position","children","appendChild","properties","styles","p","transitionDuration","pos1","pos2","isEqualSize","isConstantSize","view","viewport","_init","resize","DOMRenderer","prevRect","setAttribute","render","setTransition","addOnceEvent","itemRect","renderItem","removeElement","parentNode","removeChild","noElementItems","replace","join","cssText","_size","getSize","_insert","isAppend","createElements","renderItems","isResize","isNeededResize","_calcSize","innerWidth","innerHeight","_orgStyle","overflowX","overflowY","createContainer","df","createDocumentFragment","insertBefore","firstChild","check","isOverflowScroll","_timer","reset","_containerOffset","_view","_isScrollIssue","_onCheck","bind","_onResize","setScrollPos","_prevPos","scrollPos","getOrgScrollPos","applyScrollPos","scrollTo","arrPos","rawPos","getContainerOffset","_getOffset","prevPos","getScrollPos","orgScrollPos","isForward","clearTimeout","setTimeout","_this","threshold","endScrollPos","min","itemManger","useRecycle","append","prepend","recycle","_items","_status","_b","visibles","isVisible","lastIndexOf","setCursor","getCursor","startEdgePos","endEdgePos","startPos","endPos","cache","getEdgeOutline","result","remove","AutoSizer","resizeAll","prefix","onResize","__PREFIX__","isFixed","fixed","elementPrefix","dataWidth","dataHeight","CHECK_ALL","CHECK_ONLY_ERROR","ImageLoaded","checklist","complete","error","checkCount","endCount","checkEnd","checkImage","onError","itemIndex","__ITEM_INDEX__","onCheck","srcElement","isDataAttribute","images","naturalWidth","add","tagName","checkImageLoaded","sum","waitImageLoaded","renderer","attributePrefix","_renderer","_layout","layout","setSize","callbacks","isUpdate","isRelayout","layoutGroups","outline","updateSize","itemManager","groupIndex","prevGroup","getData","groupInfos","groupOutline","every","groupItems","groupInfo","removeTarget","replaceTarget","errorIndex","removeItem","hasTarget","src","removeAttribute","replaceItem","removeTargetLength","replaceTargetLength","layoutedItems","_c","_d","_e","_f","checkGroups","reverse","_complete","_error","_end","tslib_1","_super","itemSelector","useFit","_reset","_loadingBar","_watcher","Watcher","_infinite","Infinite","_requestAppend","_requestPrepend","_recycle","_manager","LayoutKlass","LayoutMananger","setLayout","_setSize","getViewportSize","includeCached","getVisibleItems","infinite","getItems","isLayoutAll","isChildren","getContainerSize","setContainerSize","_fit","clearOutlines","_onLayoutComplete","fromCache","isTrusted","isLayout","getVisibleData","getStatus","watcher","processingStatus","setStatus","visibleItems","createAndInsert","isReLayout","_postLayout","newItems","_appendLoadingBar","userLoadingBar","loadingBarObj","loadingSize","loadingStyle","loadingBar","_isProcessing","_isLoading","_getLoadingStatus","userStyle","display","_process","_renderLoading","_setContainerSize","_getEdgeValue","_fitItems","isProcessing","getItem","_updateItem","isInCursor","fit","_scrollTo","moveCache","moveItem","_postCache","destroy","getMaxEdgeValue","getViewSize","getEdgeValue","isAdd","from","method","removeItems","posName","resetSize","requestStartCursor","requestEndCursor","_setScrollPos","_onImageError","getGroupKeys","pop","startLoading","endLoading","shift","viewSize","isScroll","InfiniteGrid","frame","j","disableFrame","shapes","searchShapeInFrame","sort","a","b","assignOptions","itemSize","frameFill","row","_itemSize","_shapes","getShapes","_style","getStyleNames","point","_checkItemSize","size1Name","size2Name","pos1Name","pos2Name","_getItemSize","isItemObject","itemSize2","itemSize1","shapesSize","shapesLength","startOutline","fill","endOutline","dist","shape","shapePos1","shapePos2","shapeSize1","shapeSize2","targetOutline","prevOutlineEnd","prevOutlineDist","clone","cloneItems","columnLength","l","floor","column","dataset","makeShapeOutline","pointCaculateName","sign","columnWidth","getColumn","columnCount","shape1","shape2","item1pos1","item1pos2","item2pos1","item2pos2","FrameLayout","SquareLayout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;;;;;;;;;;IASA;;;;IAIA,SAASA,WAAT,CAAqBC,KAArB,EAA4B;IAC1B,SAAO,OAAOA,KAAP,KAAiB,WAAxB;IACD;IACD;;;;;;;IAOA,IAAIC,SAAS;IACb;IACA,YAAY;IACV,MAAIA,SAAS;IACb;IACA,cAAY;IACV;;;;;;;;;;;IAWA;;;IAGA,aAASA,SAAT,GAAqB;IACnB,WAAKC,aAAL,GAAqB,EAArB;IACA,WAAKC,OAAL,GAAe,EAAf;IACD;IACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BA,QAAIC,MAAM,GAAGH,SAAS,CAACI,SAAvB;;IAEAD,IAAAA,MAAM,CAACE,OAAP,GAAiB,SAASA,OAAT,CAAiBC,SAAjB,EAA4BC,WAA5B,EAAyC;IACxD,UAAIA,WAAW,KAAK,KAAK,CAAzB,EAA4B;IAC1BA,QAAAA,WAAW,GAAG,EAAd;IACD;;IAED,UAAIC,WAAW,GAAG,KAAKP,aAAL,CAAmBK,SAAnB,KAAiC,EAAnD;IACA,UAAIG,cAAc,GAAGD,WAAW,CAACE,MAAZ,GAAqB,CAA1C;;IAEA,UAAI,CAACD,cAAL,EAA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