{"version":3,"sources":["webpack:///./node_modules/@ionic/core/dist/esm-es5/ion-virtual-scroll.entry.js"],"names":["CELL_TYPE_ITEM","CELL_TYPE_HEADER","CELL_TYPE_FOOTER","NODE_CHANGE_NONE","NODE_CHANGE_POSITION","NODE_CHANGE_CELL","MIN_READS","updateVDom","dom","heightIndex","cells","range","_i","dom_1","length","node","change","d","toMutate","end","offset","_loop_1","i","cell","find","n","top","push","pool","filter","_loop_2","type","index","visible","_a","toMutate_1","forEach","doRender","el","nodeRender","updateCellHeight","child","children","Array","from","tagName","childrenNu","newChild","createNode","classList","add","appendChild","style","transform","remove","reads","template","getTemplate","ownerDocument","importNode","content","querySelector","getViewport","scrollTop","vierportHeight","margin","Math","max","bottom","getRange","viewport","buffer","topPos","bottomPos","min","getShouldUpdate","dirtyIndex","currentRange","findCellIndex","findIndex","c","inplaceUpdate","dst","src","calcCells","items","itemHeight","headerHeight","footerHeight","headerFn","footerFn","approxHeaderHeight","approxFooterHeight","approxItemHeight","j","len","item","value","height","calcHeightIndex","buf","acum","resizeBuffer","Uint32Array","newBuf","set","subarray","positionForIndex","VirtualScroll","class_1","hostRef","_this","this","viewportHeight","virtualDom","isEnabled","viewportOffset","currentScrollTop","indexDirty","lastItemLen","totalHeight","onScroll","updateVirtualScroll","prototype","itemsChanged","connectedCallback","contentEl","_b","label","closest","getScrollElement","console","error","scrollEl","sent","updateState","componentDidUpdate","disconnectedCallback","undefined","onResize","positionForItem","Promise","resolve","getHeightIndex","checkRange","cellIndex","scheduleUpdate","checkEnd","timerUpdate","clearTimeout","readVS","bind","writeVS","topOffset","offsetTop","parentElement","offsetHeight","shouldUpdate","domRender","renderItem","forceUpdate","update","window","getComputedStyle","parseFloat","getPropertyValue","setCellHeight","componentOnReady","then","setTimeout","shouldEnable","enableScrollEvents","Infinity","shouldListen","rmEvent","addEventListener","removeEventListener","renderVirtualNode","renderHeader","renderFooter","render","VirtualProxy","map","Object","defineProperty","get","enumerable","configurable","utils","vattrs","classes","class","assign"],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AAS,CAAC,kBAGlBC,YAAY,EACZC,cAAc,IAElBJ,OAAOC,eAAe3E,EAAS,QAAS,CACpC4E,IAAK,WAAc,MAAO,kZAC1BC,YAAY,EACZC,cAAc,IAEX9E,EA1TuB,GA4T9BwE,EAAe,SAAUnJ,EAAIQ,EAAUkJ,GACvC,IAAIpL,EAAM0B,EAAG1B,IACb,OAAOoL,EAAMN,IAAI5I,GAAU,SAAUD,EAAOnB,GACxC,IAAIP,EAAOP,EAAIc,GACXuK,EAASpJ,EAAMoJ,QAAU,GACzBC,EAAUD,EAAOE,OAAS,GAK9B,OAJAD,GAAW,gBACN/K,EAAKkB,UACN6J,GAAW,mBAERP,OAAOS,OAAOT,OAAOS,OAAO,GAAIvJ,GAAQ,CAAEoJ,OAAQN,OAAOS,OAAOT,OAAOS,OAAO,GAAIH,GAAS,CAAEE,MAAOD,EAAS1I,MAAOmI,OAAOS,OAAOT,OAAOS,OAAO,GAAIH,EAAOzI,OAAQ,CAAEC,UAAW,iBAAmBtC,EAAKW,IAAM","file":"js/chunk-2d0d43da.3efec507.js","sourcesContent":["import { __awaiter, __generator } from \"tslib\";\nimport { r as registerInstance, f as readTask, w as writeTask, h, H as Host, e as getElement } from './core-feeeff0d.js';\nimport './config-3c7f3790.js';\nvar CELL_TYPE_ITEM = 'item';\nvar CELL_TYPE_HEADER = 'header';\nvar CELL_TYPE_FOOTER = 'footer';\nvar NODE_CHANGE_NONE = 0;\nvar NODE_CHANGE_POSITION = 1;\nvar NODE_CHANGE_CELL = 2;\nvar MIN_READS = 2;\nvar updateVDom = function (dom, heightIndex, cells, range) {\n // reset dom\n for (var _i = 0, dom_1 = dom; _i < dom_1.length; _i++) {\n var node = dom_1[_i];\n node.change = NODE_CHANGE_NONE;\n node.d = true;\n }\n // try to match into exisiting dom\n var toMutate = [];\n var end = range.offset + range.length;\n var _loop_1 = function (i) {\n var cell = cells[i];\n var node = dom.find(function (n) { return n.d && n.cell === cell; });\n if (node) {\n var top = heightIndex[i];\n if (top !== node.top) {\n node.top = top;\n node.change = NODE_CHANGE_POSITION;\n }\n node.d = false;\n }\n else {\n toMutate.push(cell);\n }\n };\n for (var i = range.offset; i < end; i++) {\n _loop_1(i);\n }\n // needs to append\n var pool = dom.filter(function (n) { return n.d; });\n var _loop_2 = function (cell) {\n var node = pool.find(function (n) { return n.d && n.cell.type === cell.type; });\n var index = cell.i;\n if (node) {\n node.d = false;\n node.change = NODE_CHANGE_CELL;\n node.cell = cell;\n node.top = heightIndex[index];\n }\n else {\n dom.push({\n d: false,\n cell: cell,\n visible: true,\n change: NODE_CHANGE_CELL,\n top: heightIndex[index],\n });\n }\n };\n for (var _a = 0, toMutate_1 = toMutate; _a < toMutate_1.length; _a++) {\n var cell = toMutate_1[_a];\n _loop_2(cell);\n }\n dom\n .filter(function (n) { return n.d && n.top !== -9999; })\n .forEach(function (n) {\n n.change = NODE_CHANGE_POSITION;\n n.top = -9999;\n });\n};\nvar doRender = function (el, nodeRender, dom, updateCellHeight) {\n var children = Array.from(el.children).filter(function (n) { return n.tagName !== 'TEMPLATE'; });\n var childrenNu = children.length;\n var child;\n for (var i = 0; i < dom.length; i++) {\n var node = dom[i];\n var cell = node.cell;\n // the cell change, the content must be updated\n if (node.change === NODE_CHANGE_CELL) {\n if (i < childrenNu) {\n child = children[i];\n nodeRender(child, cell, i);\n }\n else {\n var newChild = createNode(el, cell.type);\n child = nodeRender(newChild, cell, i) || newChild;\n child.classList.add('virtual-item');\n el.appendChild(child);\n }\n child['$ionCell'] = cell;\n }\n else {\n child = children[i];\n }\n // only update position when it changes\n if (node.change !== NODE_CHANGE_NONE) {\n child.style.transform = \"translate3d(0,\" + node.top + \"px,0)\";\n }\n // update visibility\n var visible = cell.visible;\n if (node.visible !== visible) {\n if (visible) {\n child.classList.remove('virtual-loading');\n }\n else {\n child.classList.add('virtual-loading');\n }\n node.visible = visible;\n }\n // dynamic height\n if (cell.reads > 0) {\n updateCellHeight(cell, child);\n cell.reads--;\n }\n }\n};\nvar createNode = function (el, type) {\n var template = getTemplate(el, type);\n if (template && el.ownerDocument) {\n return el.ownerDocument.importNode(template.content, true).children[0];\n }\n return null;\n};\nvar getTemplate = function (el, type) {\n switch (type) {\n case CELL_TYPE_ITEM: return el.querySelector('template:not([name])');\n case CELL_TYPE_HEADER: return el.querySelector('template[name=header]');\n case CELL_TYPE_FOOTER: return el.querySelector('template[name=footer]');\n }\n};\nvar getViewport = function (scrollTop, vierportHeight, margin) {\n return {\n top: Math.max(scrollTop - margin, 0),\n bottom: scrollTop + vierportHeight + margin\n };\n};\nvar getRange = function (heightIndex, viewport, buffer) {\n var topPos = viewport.top;\n var bottomPos = viewport.bottom;\n // find top index\n var i = 0;\n for (; i < heightIndex.length; i++) {\n if (heightIndex[i] > topPos) {\n break;\n }\n }\n var offset = Math.max(i - buffer - 1, 0);\n // find bottom index\n for (; i < heightIndex.length; i++) {\n if (heightIndex[i] >= bottomPos) {\n break;\n }\n }\n var end = Math.min(i + buffer, heightIndex.length);\n var length = end - offset;\n return { offset: offset, length: length };\n};\nvar getShouldUpdate = function (dirtyIndex, currentRange, range) {\n var end = range.offset + range.length;\n return (dirtyIndex <= end ||\n currentRange.offset !== range.offset ||\n currentRange.length !== range.length);\n};\nvar findCellIndex = function (cells, index) {\n var max = cells.length > 0 ? cells[cells.length - 1].index : 0;\n if (index === 0) {\n return 0;\n }\n else if (index === max + 1) {\n return cells.length;\n }\n else {\n return cells.findIndex(function (c) { return c.index === index; });\n }\n};\nvar inplaceUpdate = function (dst, src, offset) {\n if (offset === 0 && src.length >= dst.length) {\n return src;\n }\n for (var i = 0; i < src.length; i++) {\n dst[i + offset] = src[i];\n }\n return dst;\n};\nvar calcCells = function (items, itemHeight, headerHeight, footerHeight, headerFn, footerFn, approxHeaderHeight, approxFooterHeight, approxItemHeight, j, offset, len) {\n var cells = [];\n var end = len + offset;\n for (var i = offset; i < end; i++) {\n var item = items[i];\n if (headerFn) {\n var value = headerFn(item, i, items);\n if (value != null) {\n cells.push({\n i: j++,\n type: CELL_TYPE_HEADER,\n value: value,\n index: i,\n height: headerHeight ? headerHeight(value, i) : approxHeaderHeight,\n reads: headerHeight ? 0 : MIN_READS,\n visible: !!headerHeight,\n });\n }\n }\n cells.push({\n i: j++,\n type: CELL_TYPE_ITEM,\n value: item,\n index: i,\n height: itemHeight ? itemHeight(item, i) : approxItemHeight,\n reads: itemHeight ? 0 : MIN_READS,\n visible: !!itemHeight,\n });\n if (footerFn) {\n var value = footerFn(item, i, items);\n if (value != null) {\n cells.push({\n i: j++,\n type: CELL_TYPE_FOOTER,\n value: value,\n index: i,\n height: footerHeight ? footerHeight(value, i) : approxFooterHeight,\n reads: footerHeight ? 0 : MIN_READS,\n visible: !!footerHeight,\n });\n }\n }\n }\n return cells;\n};\nvar calcHeightIndex = function (buf, cells, index) {\n var acum = buf[index];\n for (var i = index; i < buf.length; i++) {\n buf[i] = acum;\n acum += cells[i].height;\n }\n return acum;\n};\nvar resizeBuffer = function (buf, len) {\n if (!buf) {\n return new Uint32Array(len);\n }\n if (buf.length === len) {\n return buf;\n }\n else if (len > buf.length) {\n var newBuf = new Uint32Array(len);\n newBuf.set(buf);\n return newBuf;\n }\n else {\n return buf.subarray(0, len);\n }\n};\nvar positionForIndex = function (index, cells, heightIndex) {\n var cell = cells.find(function (c) { return c.type === CELL_TYPE_ITEM && c.index === index; });\n if (cell) {\n return heightIndex[cell.i];\n }\n return -1;\n};\nvar VirtualScroll = /** @class */ (function () {\n function class_1(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n this.range = { offset: 0, length: 0 };\n this.viewportHeight = 0;\n this.cells = [];\n this.virtualDom = [];\n this.isEnabled = false;\n this.viewportOffset = 0;\n this.currentScrollTop = 0;\n this.indexDirty = 0;\n this.lastItemLen = 0;\n this.totalHeight = 0;\n /**\n * It is important to provide this\n * if virtual item height will be significantly larger than the default\n * The approximate height of each virtual item template's cell.\n * This dimension is used to help determine how many cells should\n * be created when initialized, and to help calculate the height of\n * the scrollable area. This height value can only use `px` units.\n * Note that the actual rendered size of each cell comes from the\n * app's CSS, whereas this approximation is used to help calculate\n * initial dimensions before the item has been rendered.\n */\n this.approxItemHeight = 45;\n /**\n * The approximate height of each header template's cell.\n * This dimension is used to help determine how many cells should\n * be created when initialized, and to help calculate the height of\n * the scrollable area. This height value can only use `px` units.\n * Note that the actual rendered size of each cell comes from the\n * app's CSS, whereas this approximation is used to help calculate\n * initial dimensions before the item has been rendered.\n */\n this.approxHeaderHeight = 30;\n /**\n * The approximate width of each footer template's cell.\n * This dimension is used to help determine how many cells should\n * be created when initialized, and to help calculate the height of\n * the scrollable area. This height value can only use `px` units.\n * Note that the actual rendered size of each cell comes from the\n * app's CSS, whereas this approximation is used to help calculate\n * initial dimensions before the item has been rendered.\n */\n this.approxFooterHeight = 30;\n this.onScroll = function () {\n _this.updateVirtualScroll();\n };\n }\n class_1.prototype.itemsChanged = function () {\n this.calcCells();\n this.updateVirtualScroll();\n };\n class_1.prototype.connectedCallback = function () {\n return __awaiter(this, void 0, void 0, function () {\n var contentEl, _a;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n contentEl = this.el.closest('ion-content');\n if (!contentEl) {\n console.error(' must be used inside an ');\n return [2 /*return*/];\n }\n _a = this;\n return [4 /*yield*/, contentEl.getScrollElement()];\n case 1:\n _a.scrollEl = _b.sent();\n this.contentEl = contentEl;\n this.calcCells();\n this.updateState();\n return [2 /*return*/];\n }\n });\n });\n };\n class_1.prototype.componentDidUpdate = function () {\n this.updateState();\n };\n class_1.prototype.disconnectedCallback = function () {\n this.scrollEl = undefined;\n };\n class_1.prototype.onResize = function () {\n this.calcCells();\n this.updateVirtualScroll();\n };\n /**\n * Returns the position of the virtual item at the given index.\n */\n class_1.prototype.positionForItem = function (index) {\n return Promise.resolve(positionForIndex(index, this.cells, this.getHeightIndex()));\n };\n /**\n * This method marks a subset of items as dirty, so they can be re-rendered. Items should be marked as\n * dirty any time the content or their style changes.\n *\n * The subset of items to be updated can are specifing by an offset and a length.\n */\n class_1.prototype.checkRange = function (offset, len) {\n if (len === void 0) { len = -1; }\n return __awaiter(this, void 0, void 0, function () {\n var length, cellIndex, cells;\n return __generator(this, function (_a) {\n // TODO: kind of hacky how we do in-place updated of the cells\n // array. this part needs a complete refactor\n if (!this.items) {\n return [2 /*return*/];\n }\n length = (len === -1)\n ? this.items.length - offset\n : len;\n cellIndex = findCellIndex(this.cells, offset);\n cells = calcCells(this.items, this.itemHeight, this.headerHeight, this.footerHeight, this.headerFn, this.footerFn, this.approxHeaderHeight, this.approxFooterHeight, this.approxItemHeight, cellIndex, offset, length);\n this.cells = inplaceUpdate(this.cells, cells, cellIndex);\n this.lastItemLen = this.items.length;\n this.indexDirty = Math.max(offset - 1, 0);\n this.scheduleUpdate();\n return [2 /*return*/];\n });\n });\n };\n /**\n * This method marks the tail the items array as dirty, so they can be re-rendered.\n *\n * It's equivalent to calling:\n *\n * ```js\n * virtualScroll.checkRange(lastItemLen);\n * ```\n */\n class_1.prototype.checkEnd = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (this.items) {\n this.checkRange(this.lastItemLen);\n }\n return [2 /*return*/];\n });\n });\n };\n class_1.prototype.updateVirtualScroll = function () {\n // do nothing if virtual-scroll is disabled\n if (!this.isEnabled || !this.scrollEl) {\n return;\n }\n // unschedule future updates\n if (this.timerUpdate) {\n clearTimeout(this.timerUpdate);\n this.timerUpdate = undefined;\n }\n // schedule DOM operations into the stencil queue\n readTask(this.readVS.bind(this));\n writeTask(this.writeVS.bind(this));\n };\n class_1.prototype.readVS = function () {\n var _a = this, contentEl = _a.contentEl, scrollEl = _a.scrollEl, el = _a.el;\n var topOffset = 0;\n var node = el;\n while (node && node !== contentEl) {\n topOffset += node.offsetTop;\n node = node.parentElement;\n }\n this.viewportOffset = topOffset;\n if (scrollEl) {\n this.viewportHeight = scrollEl.offsetHeight;\n this.currentScrollTop = scrollEl.scrollTop;\n }\n };\n class_1.prototype.writeVS = function () {\n var dirtyIndex = this.indexDirty;\n // get visible viewport\n var scrollTop = this.currentScrollTop - this.viewportOffset;\n var viewport = getViewport(scrollTop, this.viewportHeight, 100);\n // compute lazily the height index\n var heightIndex = this.getHeightIndex();\n // get array bounds of visible cells base in the viewport\n var range = getRange(heightIndex, viewport, 2);\n // fast path, do nothing\n var shouldUpdate = getShouldUpdate(dirtyIndex, this.range, range);\n if (!shouldUpdate) {\n return;\n }\n this.range = range;\n // in place mutation of the virtual DOM\n updateVDom(this.virtualDom, heightIndex, this.cells, range);\n // Write DOM\n // Different code paths taken depending of the render API used\n if (this.nodeRender) {\n doRender(this.el, this.nodeRender, this.virtualDom, this.updateCellHeight.bind(this));\n }\n else if (this.domRender) {\n this.domRender(this.virtualDom);\n }\n else if (this.renderItem) {\n this.el.forceUpdate();\n }\n };\n class_1.prototype.updateCellHeight = function (cell, node) {\n var _this = this;\n var update = function () {\n if (node['$ionCell'] === cell) {\n var style = window.getComputedStyle(node);\n var height = node.offsetHeight + parseFloat(style.getPropertyValue('margin-bottom'));\n _this.setCellHeight(cell, height);\n }\n };\n if (node && node.componentOnReady) {\n node.componentOnReady().then(update);\n }\n else {\n update();\n }\n };\n class_1.prototype.setCellHeight = function (cell, height) {\n var index = cell.i;\n // the cell might changed since the height update was scheduled\n if (cell !== this.cells[index]) {\n return;\n }\n if (cell.height !== height || cell.visible !== true) {\n cell.visible = true;\n cell.height = height;\n this.indexDirty = Math.min(this.indexDirty, index);\n this.scheduleUpdate();\n }\n };\n class_1.prototype.scheduleUpdate = function () {\n var _this = this;\n clearTimeout(this.timerUpdate);\n this.timerUpdate = setTimeout(function () { return _this.updateVirtualScroll(); }, 100);\n };\n class_1.prototype.updateState = function () {\n var shouldEnable = !!(this.scrollEl &&\n this.cells);\n if (shouldEnable !== this.isEnabled) {\n this.enableScrollEvents(shouldEnable);\n if (shouldEnable) {\n this.updateVirtualScroll();\n }\n }\n };\n class_1.prototype.calcCells = function () {\n if (!this.items) {\n return;\n }\n this.lastItemLen = this.items.length;\n this.cells = calcCells(this.items, this.itemHeight, this.headerHeight, this.footerHeight, this.headerFn, this.footerFn, this.approxHeaderHeight, this.approxFooterHeight, this.approxItemHeight, 0, 0, this.lastItemLen);\n this.indexDirty = 0;\n };\n class_1.prototype.getHeightIndex = function () {\n if (this.indexDirty !== Infinity) {\n this.calcHeightIndex(this.indexDirty);\n }\n return this.heightIndex;\n };\n class_1.prototype.calcHeightIndex = function (index) {\n if (index === void 0) { index = 0; }\n // TODO: optimize, we don't need to calculate all the cells\n this.heightIndex = resizeBuffer(this.heightIndex, this.cells.length);\n this.totalHeight = calcHeightIndex(this.heightIndex, this.cells, index);\n this.indexDirty = Infinity;\n };\n class_1.prototype.enableScrollEvents = function (shouldListen) {\n var _this = this;\n if (this.rmEvent) {\n this.rmEvent();\n this.rmEvent = undefined;\n }\n var scrollEl = this.scrollEl;\n if (scrollEl) {\n this.isEnabled = shouldListen;\n scrollEl.addEventListener('scroll', this.onScroll);\n this.rmEvent = function () {\n scrollEl.removeEventListener('scroll', _this.onScroll);\n };\n }\n };\n class_1.prototype.renderVirtualNode = function (node) {\n var _a = node.cell, type = _a.type, value = _a.value, index = _a.index;\n switch (type) {\n case CELL_TYPE_ITEM: return this.renderItem(value, index);\n case CELL_TYPE_HEADER: return this.renderHeader(value, index);\n case CELL_TYPE_FOOTER: return this.renderFooter(value, index);\n }\n };\n class_1.prototype.render = function () {\n var _this = this;\n return (h(Host, { style: {\n height: this.totalHeight + \"px\"\n } }, this.renderItem && (h(VirtualProxy, { dom: this.virtualDom }, this.virtualDom.map(function (node) { return _this.renderVirtualNode(node); })))));\n };\n Object.defineProperty(class_1.prototype, \"el\", {\n get: function () { return getElement(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1, \"watchers\", {\n get: function () {\n return {\n \"itemHeight\": [\"itemsChanged\"],\n \"headerHeight\": [\"itemsChanged\"],\n \"footerHeight\": [\"itemsChanged\"],\n \"items\": [\"itemsChanged\"]\n };\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1, \"style\", {\n get: function () { return \"ion-virtual-scroll{display:block;position:relative;width:100%;contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ion-virtual-scroll>.virtual-loading{opacity:0}ion-virtual-scroll>.virtual-item{position:absolute!important;top:0!important;right:0!important;left:0!important;-webkit-transition-duration:0ms;transition-duration:0ms;will-change:transform}\"; },\n enumerable: true,\n configurable: true\n });\n return class_1;\n}());\nvar VirtualProxy = function (_a, children, utils) {\n var dom = _a.dom;\n return utils.map(children, function (child, i) {\n var node = dom[i];\n var vattrs = child.vattrs || {};\n var classes = vattrs.class || '';\n classes += 'virtual-item ';\n if (!node.visible) {\n classes += 'virtual-loading';\n }\n return Object.assign(Object.assign({}, child), { vattrs: Object.assign(Object.assign({}, vattrs), { class: classes, style: Object.assign(Object.assign({}, vattrs.style), { transform: \"translate3d(0,\" + node.top + \"px,0)\" }) }) });\n });\n};\nexport { VirtualScroll as ion_virtual_scroll };\n"],"sourceRoot":""}