(root node)\n * ├ --- RowHeadersRenderer\n * ├ | \\\n * ├ | \\\n * ├ | - CellsRenderer\n * ├ | /\n * └ | /.\n *\n * @class {CellsRenderer}\n */\n\nvar CellsRenderer = /*#__PURE__*/function (_BaseRenderer) {\n _inherits(CellsRenderer, _BaseRenderer);\n\n var _super = _createSuper(CellsRenderer);\n\n function CellsRenderer() {\n var _this;\n\n _classCallCheck(this, CellsRenderer);\n\n _this = _super.call(this, 'TD');\n /**\n * Cache for OrderView classes connected to specified node.\n *\n * @type {WeakMap}\n */\n\n _this.orderViews = new WeakMap();\n /**\n * Row index which specifies the row position of the processed cell.\n *\n * @type {number}\n */\n\n _this.sourceRowIndex = 0;\n return _this;\n }\n /**\n * Obtains the instance of the SharedOrderView class which is responsible for rendering the nodes to the root node.\n *\n * @param {HTMLTableRowElement} rootNode The TR element, which is root element for cells (TD).\n * @returns {SharedOrderView}\n */\n\n\n _createClass(CellsRenderer, [{\n key: \"obtainOrderView\",\n value: function obtainOrderView(rootNode) {\n var _this2 = this;\n\n var orderView;\n\n if (this.orderViews.has(rootNode)) {\n orderView = this.orderViews.get(rootNode);\n } else {\n orderView = new SharedOrderView(rootNode, function (sourceColumnIndex) {\n return _this2.nodesPool.obtain(_this2.sourceRowIndex, sourceColumnIndex);\n }, this.nodeType);\n this.orderViews.set(rootNode, orderView);\n }\n\n return orderView;\n }\n /**\n * Renders the cells.\n */\n\n }, {\n key: \"render\",\n value: function render() {\n var _this$table = this.table,\n rowsToRender = _this$table.rowsToRender,\n columnsToRender = _this$table.columnsToRender,\n rows = _this$table.rows,\n rowHeaders = _this$table.rowHeaders;\n\n for (var visibleRowIndex = 0; visibleRowIndex < rowsToRender; visibleRowIndex++) {\n var sourceRowIndex = this.table.renderedRowToSource(visibleRowIndex);\n var TR = rows.getRenderedNode(visibleRowIndex);\n this.sourceRowIndex = sourceRowIndex;\n var orderView = this.obtainOrderView(TR);\n var rowHeadersView = rowHeaders.obtainOrderView(TR); // @TODO(perf-tip): For cells other than \"visual 0\" generating diff leads/commands can be skipped. New order view\n // shoule share state between next orderViews.\n\n orderView.prependView(rowHeadersView).setSize(columnsToRender).setOffset(this.table.renderedColumnToSource(0)).start();\n\n for (var visibleColumnIndex = 0; visibleColumnIndex < columnsToRender; visibleColumnIndex++) {\n orderView.render();\n var TD = orderView.getCurrentNode();\n var sourceColumnIndex = this.table.renderedColumnToSource(visibleColumnIndex);\n\n if (!hasClass(TD, 'hide')) {\n // Workaround for hidden columns plugin\n TD.className = '';\n }\n\n TD.removeAttribute('style');\n this.table.cellRenderer(sourceRowIndex, sourceColumnIndex, TD);\n }\n\n orderView.end();\n }\n }\n }]);\n\n return CellsRenderer;\n}(BaseRenderer);\n\nexport { CellsRenderer as default };","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * TableRenderer class collects all renderers and properties necessary for table creation. It's\n * responsible for adjusting and rendering each renderer.\n *\n * Below is a diagram of the renderers together with an indication of what they are responisble for.\n * \n * \\ (root node)\n * \\\n * \\___ ColGroupRenderer\n * /\n * /\n * /\n * \\ (root node)\n * \\\n * \\\n * | \\____ ColumnHeadersRenderer\n * | /\n * | /\n * | /\n * /\n * ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯\\ (root node)\n * (root node) \\\n * --- RowHeadersRenderer\n * | \\ \\\n * | -- CellsRenderer \\\n * | / \\\n * | \\\n * (root node) \\\n * --- RowHeadersRenderer \\\n * | \\ \\___ RowsRenderer\n * | -- CellsRenderer /\n * | / /\n * | /\n * (root node) /\n * --- RowHeadersRenderer /\n * | \\ /\n * | -- CellsRenderer /\n * | / /\n * | /\n * ___________________/\n * .\n *\n * @class {RowsRenderer}\n */\nvar TableRenderer = /*#__PURE__*/function () {\n function TableRenderer(rootNode) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n cellRenderer = _ref.cellRenderer;\n\n _classCallCheck(this, TableRenderer);\n\n /**\n * Table element which will be used to render the children element.\n *\n * @type {HTMLTableElement}\n */\n this.rootNode = rootNode;\n /**\n * Document owner of the root node.\n *\n * @type {HTMLDocument}\n */\n\n this.rootDocument = this.rootNode.ownerDocument;\n /**\n * Renderer class responsible for rendering row headers.\n *\n * @type {RowsRenderer}\n */\n\n this.rowHeaders = null;\n /**\n * Renderer class responsible for rendering column headers.\n *\n * @type {ColumnHeadersRenderer}\n */\n\n this.columnHeaders = null;\n /**\n * Renderer class responsible for rendering col in colgroup.\n *\n * @type {ColGroupRenderer}\n */\n\n this.colGroup = null;\n /**\n * Renderer class responsible for rendering rows in tbody.\n *\n * @type {RowsRenderer}\n */\n\n this.rows = null;\n /**\n * Renderer class responsible for rendering cells.\n *\n * @type {CellsRenderer}\n */\n\n this.cells = null;\n /**\n * Row filter which contains all necessary information about row index transformation.\n *\n * @type {RowFilter}\n */\n\n this.rowFilter = null;\n /**\n * Column filter which contains all necessary information about column index transformation.\n *\n * @type {ColumnFilter}\n */\n\n this.columnFilter = null;\n /**\n * Row utils class which contains all necessary information about sizes of the rows.\n *\n * @type {RowUtils}\n */\n\n this.rowUtils = null;\n /**\n * Column utils class which contains all necessary information about sizes of the columns.\n *\n * @type {ColumnUtils}\n */\n\n this.columnUtils = null;\n /**\n * Indicates how much rows should be rendered to fill whole table viewport.\n *\n * @type {number}\n */\n\n this.rowsToRender = 0;\n /**\n * Indicates how much columns should be rendered to fill whole table viewport.\n *\n * @type {number}\n */\n\n this.columnsToRender = 0;\n /**\n * An array of functions to be used as a content factory to row headers.\n *\n * @type {Function[]}\n */\n\n this.rowHeaderFunctions = [];\n /**\n * Count of the function used to render row headers.\n *\n * @type {number}\n */\n\n this.rowHeadersCount = 0;\n /**\n * An array of functions to be used as a content factory to column headers.\n *\n * @type {Function[]}\n */\n\n this.columnHeaderFunctions = [];\n /**\n * Count of the function used to render column headers.\n *\n * @type {number}\n */\n\n this.columnHeadersCount = 0;\n /**\n * Cell renderer used to render cells content.\n *\n * @type {Function}\n */\n\n this.cellRenderer = cellRenderer;\n }\n /**\n * Set row and column util classes.\n *\n * @param {RowUtils} rowUtils RowUtils instance which provides useful methods related to row sizes.\n * @param {ColumnUtils} columnUtils ColumnUtils instance which provides useful methods related to row sizes.\n */\n\n\n _createClass(TableRenderer, [{\n key: \"setAxisUtils\",\n value: function setAxisUtils(rowUtils, columnUtils) {\n this.rowUtils = rowUtils;\n this.columnUtils = columnUtils;\n }\n /**\n * Sets viewport size of the table.\n *\n * @param {number} rowsCount An amount of rows to render.\n * @param {number} columnsCount An amount of columns to render.\n */\n\n }, {\n key: \"setViewportSize\",\n value: function setViewportSize(rowsCount, columnsCount) {\n this.rowsToRender = rowsCount;\n this.columnsToRender = columnsCount;\n }\n /**\n * Sets row and column filter instances.\n *\n * @param {RowFilter} rowFilter Row filter instance which contains all necessary information about row index transformation.\n * @param {ColumnFilter} columnFilter Cokumn filter instance which contains all necessary information about row index transformation.\n */\n\n }, {\n key: \"setFilters\",\n value: function setFilters(rowFilter, columnFilter) {\n this.rowFilter = rowFilter;\n this.columnFilter = columnFilter;\n }\n /**\n * Sets row and column header functions.\n *\n * @param {Function[]} rowHeaders Row header functions. Factories for creating content for row headers.\n * @param {Function[]} columnHeaders Column header functions. Factories for creating content for column headers.\n */\n\n }, {\n key: \"setHeaderContentRenderers\",\n value: function setHeaderContentRenderers(rowHeaders, columnHeaders) {\n this.rowHeaderFunctions = rowHeaders;\n this.rowHeadersCount = rowHeaders.length;\n this.columnHeaderFunctions = columnHeaders;\n this.columnHeadersCount = columnHeaders.length;\n }\n /**\n * Sets table renderers.\n *\n * @param {renderers} renderers The renderer units.\n * @param {RowHeadersRenderer} renderers.rowHeaders Row headers renderer.\n * @param {ColumnHeadersRenderer} renderers.columnHeaders Column headers renderer.\n * @param {ColGroupRenderer} renderers.colGroup Col group renderer.\n * @param {RowsRenderer} renderers.rows Rows renderer.\n * @param {CellsRenderer} renderers.cells Cells renderer.\n */\n\n }, {\n key: \"setRenderers\",\n value: function setRenderers() {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n rowHeaders = _ref2.rowHeaders,\n columnHeaders = _ref2.columnHeaders,\n colGroup = _ref2.colGroup,\n rows = _ref2.rows,\n cells = _ref2.cells;\n\n rowHeaders.setTable(this);\n columnHeaders.setTable(this);\n colGroup.setTable(this);\n rows.setTable(this);\n cells.setTable(this);\n this.rowHeaders = rowHeaders;\n this.columnHeaders = columnHeaders;\n this.colGroup = colGroup;\n this.rows = rows;\n this.cells = cells;\n }\n /**\n * Transforms visual/rendered row index to source index.\n *\n * @param {number} rowIndex Rendered index.\n * @returns {number}\n */\n\n }, {\n key: \"renderedRowToSource\",\n value: function renderedRowToSource(rowIndex) {\n return this.rowFilter.renderedToSource(rowIndex);\n }\n /**\n * Transforms visual/rendered column index to source index.\n *\n * @param {number} columnIndex Rendered index.\n * @returns {number}\n */\n\n }, {\n key: \"renderedColumnToSource\",\n value: function renderedColumnToSource(columnIndex) {\n return this.columnFilter.renderedToSource(columnIndex);\n }\n /**\n * Renders the table.\n */\n\n }, {\n key: \"render\",\n value: function render() {\n this.colGroup.adjust();\n this.columnHeaders.adjust();\n this.rows.adjust();\n this.rowHeaders.adjust();\n this.columnHeaders.render();\n this.rows.render();\n this.rowHeaders.render();\n this.cells.render(); // After the cells are rendered calculate columns width (or columns stretch width) to prepare proper values\n // for colGroup renderer (which renders COL elements).\n\n this.columnUtils.calculateWidths();\n this.colGroup.render();\n var rowsToRender = this.rowsToRender,\n rows = this.rows; // Fix for multi-line content and for supporting `rowHeights` option.\n\n for (var visibleRowIndex = 0; visibleRowIndex < rowsToRender; visibleRowIndex++) {\n var TR = rows.getRenderedNode(visibleRowIndex);\n\n if (TR.firstChild) {\n var sourceRowIndex = this.renderedRowToSource(visibleRowIndex);\n var rowHeight = this.rowUtils.getHeight(sourceRowIndex);\n\n if (rowHeight) {\n // Decrease height. 1 pixel will be \"replaced\" by 1px border top\n TR.firstChild.style.height = \"\".concat(rowHeight - 1, \"px\");\n } else {\n TR.firstChild.style.height = '';\n }\n }\n }\n }\n }]);\n\n return TableRenderer;\n}();\n\nexport { TableRenderer as default };","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport RowHeadersRenderer from \"./rowHeaders.mjs\";\nimport ColumnHeadersRenderer from \"./columnHeaders.mjs\";\nimport ColGroupRenderer from \"./colGroup.mjs\";\nimport RowsRenderer from \"./rows.mjs\";\nimport CellsRenderer from \"./cells.mjs\";\nimport TableRenderer from \"./table.mjs\";\n/**\n * Content renderer.\n *\n * @class Renderer\n */\n\nvar Renderer = /*#__PURE__*/function () {\n function Renderer() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n TABLE = _ref.TABLE,\n THEAD = _ref.THEAD,\n COLGROUP = _ref.COLGROUP,\n TBODY = _ref.TBODY,\n rowUtils = _ref.rowUtils,\n columnUtils = _ref.columnUtils,\n cellRenderer = _ref.cellRenderer;\n\n _classCallCheck(this, Renderer);\n\n /**\n * General renderer class used to render Walkontable content on screen.\n *\n * @type {TableRenderer}\n */\n this.renderer = new TableRenderer(TABLE, {\n cellRenderer: cellRenderer\n });\n this.renderer.setRenderers({\n rowHeaders: new RowHeadersRenderer(),\n columnHeaders: new ColumnHeadersRenderer(THEAD),\n colGroup: new ColGroupRenderer(COLGROUP),\n rows: new RowsRenderer(TBODY),\n cells: new CellsRenderer()\n });\n this.renderer.setAxisUtils(rowUtils, columnUtils);\n }\n /**\n * Sets filter calculators for newly calculated row and column position. The filters are used to transform visual\n * indexes (0 to N) to source indexes provided by Handsontable.\n *\n * @param {RowFilter} rowFilter The row filter instance.\n * @param {ColumnFilter} columnFilter The column filter instance.\n * @returns {Renderer}\n */\n\n\n _createClass(Renderer, [{\n key: \"setFilters\",\n value: function setFilters(rowFilter, columnFilter) {\n this.renderer.setFilters(rowFilter, columnFilter);\n return this;\n }\n /**\n * Sets the viewport size of the rendered table.\n *\n * @param {number} rowsCount An amount of rows to render.\n * @param {number} columnsCount An amount of columns to render.\n * @returns {Renderer}\n */\n\n }, {\n key: \"setViewportSize\",\n value: function setViewportSize(rowsCount, columnsCount) {\n this.renderer.setViewportSize(rowsCount, columnsCount);\n return this;\n }\n /**\n * Sets row and column header functions.\n *\n * @param {Function[]} rowHeaders Row header functions. Factories for creating content for row headers.\n * @param {Function[]} columnHeaders Column header functions. Factories for creating content for column headers.\n * @returns {Renderer}\n */\n\n }, {\n key: \"setHeaderContentRenderers\",\n value: function setHeaderContentRenderers(rowHeaders, columnHeaders) {\n this.renderer.setHeaderContentRenderers(rowHeaders, columnHeaders);\n return this;\n }\n /**\n * Adjusts the table (preparing for render).\n */\n\n }, {\n key: \"adjust\",\n value: function adjust() {\n this.renderer.adjust();\n }\n /**\n * Renders the table.\n */\n\n }, {\n key: \"render\",\n value: function render() {\n this.renderer.render();\n }\n }]);\n\n return Renderer;\n}();\n\nexport { RowHeadersRenderer, ColumnHeadersRenderer, ColGroupRenderer, RowsRenderer, CellsRenderer, TableRenderer, Renderer };","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { getScrollbarWidth } from \"./../../../../helpers/dom/element.mjs\";\n/**\n * Column utils class contains all necessary information about sizes of the columns.\n *\n * @class {ColumnUtils}\n */\n\nvar ColumnUtils = /*#__PURE__*/function () {\n function ColumnUtils(wot) {\n _classCallCheck(this, ColumnUtils);\n\n this.wot = wot;\n this.headerWidths = new Map();\n }\n /**\n * Returns column width based on passed source index.\n *\n * @param {number} sourceIndex Column source index.\n * @returns {number}\n */\n\n\n _createClass(ColumnUtils, [{\n key: \"getWidth\",\n value: function getWidth(sourceIndex) {\n var width = this.wot.wtSettings.settings.columnWidth;\n\n if (typeof width === 'function') {\n width = width(sourceIndex);\n } else if (_typeof(width) === 'object') {\n width = width[sourceIndex];\n }\n\n return width || this.wot.wtSettings.settings.defaultColumnWidth;\n }\n /**\n * Returns stretched column width based on passed source index.\n *\n * @param {number} sourceIndex Column source index.\n * @returns {number}\n */\n\n }, {\n key: \"getStretchedColumnWidth\",\n value: function getStretchedColumnWidth(sourceIndex) {\n var columnWidth = this.getWidth(sourceIndex);\n var calculator = this.wot.wtViewport.columnsRenderCalculator;\n var width = columnWidth !== null && columnWidth !== void 0 ? columnWidth : this.wot.wtSettings.settings.defaultColumnWidth;\n\n if (calculator) {\n var stretchedWidth = calculator.getStretchedColumnWidth(sourceIndex, width);\n\n if (stretchedWidth) {\n width = stretchedWidth;\n }\n }\n\n return width;\n }\n /**\n * Returns column header height based on passed header level.\n *\n * @param {number} level Column header level.\n * @returns {number}\n */\n\n }, {\n key: \"getHeaderHeight\",\n value: function getHeaderHeight(level) {\n var height = this.wot.wtSettings.settings.defaultRowHeight;\n var oversizedHeight = this.wot.wtViewport.oversizedColumnHeaders[level];\n\n if (oversizedHeight !== void 0) {\n height = height ? Math.max(height, oversizedHeight) : oversizedHeight;\n }\n\n return height;\n }\n /**\n * Returns column header width based on passed source index.\n *\n * @param {number} sourceIndex Column source index.\n * @returns {number}\n */\n\n }, {\n key: \"getHeaderWidth\",\n value: function getHeaderWidth(sourceIndex) {\n return this.headerWidths.get(this.wot.wtTable.columnFilter.sourceToRendered(sourceIndex));\n }\n /**\n * Calculates column header widths that can be retrieved from the cache.\n */\n\n }, {\n key: \"calculateWidths\",\n value: function calculateWidths() {\n var wot = this.wot;\n var wtTable = wot.wtTable,\n wtViewport = wot.wtViewport,\n cloneSource = wot.cloneSource;\n var mainHolder = cloneSource ? cloneSource.wtTable.holder : wtTable.holder;\n var scrollbarCompensation = mainHolder.offsetHeight < mainHolder.scrollHeight ? getScrollbarWidth() : 0;\n var rowHeaderWidthSetting = wot.getSetting('rowHeaderWidth');\n wtViewport.columnsRenderCalculator.refreshStretching(wtViewport.getViewportWidth() - scrollbarCompensation);\n rowHeaderWidthSetting = wot.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);\n\n if (rowHeaderWidthSetting !== null && rowHeaderWidthSetting !== void 0) {\n var rowHeadersCount = wot.getSetting('rowHeaders').length;\n var defaultColumnWidth = wot.getSetting('defaultColumnWidth');\n\n for (var visibleColumnIndex = 0; visibleColumnIndex < rowHeadersCount; visibleColumnIndex++) {\n var width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[visibleColumnIndex] : rowHeaderWidthSetting;\n width = width === null || width === void 0 ? defaultColumnWidth : width;\n this.headerWidths.set(visibleColumnIndex, width);\n }\n }\n }\n }]);\n\n return ColumnUtils;\n}();\n\nexport { ColumnUtils as default };","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n/**\n * Row utils class contains all necessary information about sizes of the rows.\n *\n * @class {RowUtils}\n */\nvar RowUtils = /*#__PURE__*/function () {\n function RowUtils(wot) {\n _classCallCheck(this, RowUtils);\n\n this.wot = wot;\n }\n /**\n * Returns row height based on passed source index.\n *\n * @param {number} sourceIndex Row source index.\n * @returns {number}\n */\n\n\n _createClass(RowUtils, [{\n key: \"getHeight\",\n value: function getHeight(sourceIndex) {\n var height = this.wot.wtSettings.settings.rowHeight(sourceIndex);\n var oversizedHeight = this.wot.wtViewport.oversizedRows[sourceIndex];\n\n if (oversizedHeight !== void 0) {\n height = height === void 0 ? oversizedHeight : Math.max(height, oversizedHeight);\n }\n\n return height;\n }\n }]);\n\n return RowUtils;\n}();\n\nexport { RowUtils as default };","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { hasClass, index, offset, removeClass, removeTextNodes, overlayContainsElement, closest, outerWidth, innerHeight, isVisible as _isVisible } from \"./../../../helpers/dom/element.mjs\";\nimport { isFunction } from \"./../../../helpers/function.mjs\";\nimport CellCoords from \"./cell/coords.mjs\";\nimport ColumnFilter from \"./filter/column.mjs\";\nimport RowFilter from \"./filter/row.mjs\";\nimport { Renderer } from \"./renderer/index.mjs\";\nimport ColumnUtils from \"./utils/column.mjs\";\nimport RowUtils from \"./utils/row.mjs\";\nimport { isOverlayTypeOf } from \"./overlay/registerer.mjs\";\nimport { CLONE_TOP, CLONE_BOTTOM, CLONE_LEFT, CLONE_TOP_LEFT_CORNER, CLONE_BOTTOM_LEFT_CORNER } from \"./overlay/constants.mjs\";\n/**\n *\n */\n\nvar Table = /*#__PURE__*/function () {\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n * @param {HTMLTableElement} table An element to the Walkontable generated table is injected.\n */\n function Table(wotInstance, table) {\n var _this = this;\n\n _classCallCheck(this, Table);\n\n /**\n * Indicates if this instance is of type `MasterTable` (i.e. It is NOT an overlay).\n *\n * @type {boolean}\n */\n this.isMaster = !wotInstance.cloneOverlay; // \"instanceof\" operator isn't used, because it caused a circular reference in Webpack\n\n this.wot = wotInstance; // legacy support\n\n this.instance = this.wot;\n this.TABLE = table;\n this.TBODY = null;\n this.THEAD = null;\n this.COLGROUP = null;\n this.tableOffset = 0;\n this.holderOffset = 0;\n /**\n * Indicates if the table has height bigger than 0px.\n *\n * @type {boolean}\n */\n\n this.hasTableHeight = true;\n /**\n * Indicates if the table has width bigger than 0px.\n *\n * @type {boolean}\n */\n\n this.hasTableWidth = true;\n /**\n * Indicates if the table is visible. By visible, it means that the holder\n * element has CSS 'display' property different than 'none'.\n *\n * @type {boolean}\n */\n\n this.isTableVisible = false;\n removeTextNodes(this.TABLE);\n this.spreader = this.createSpreader(this.TABLE);\n this.hider = this.createHider(this.spreader);\n this.holder = this.createHolder(this.hider);\n this.wtRootElement = this.holder.parentNode;\n\n if (this.isMaster) {\n this.alignOverlaysWithTrimmingContainer();\n }\n\n this.fixTableDomTree();\n this.rowFilter = null;\n this.columnFilter = null;\n this.correctHeaderWidth = false;\n var origRowHeaderWidth = this.wot.wtSettings.settings.rowHeaderWidth; // Fix for jumping row headers (https://github.com/handsontable/handsontable/issues/3850)\n\n this.wot.wtSettings.settings.rowHeaderWidth = function () {\n return _this._modifyRowHeaderWidth(origRowHeaderWidth);\n };\n\n this.rowUtils = new RowUtils(this.wot);\n this.columnUtils = new ColumnUtils(this.wot);\n this.tableRenderer = new Renderer({\n TABLE: this.TABLE,\n THEAD: this.THEAD,\n COLGROUP: this.COLGROUP,\n TBODY: this.TBODY,\n rowUtils: this.rowUtils,\n columnUtils: this.columnUtils,\n cellRenderer: this.wot.wtSettings.settings.cellRenderer\n });\n }\n /**\n * Returns a boolean that is true if this intance of Table represents a specific overlay, identified by the overlay name.\n * For MasterTable, it returns false.\n *\n * @param {string} overlayTypeName The overlay type.\n * @returns {boolean}\n */\n\n\n _createClass(Table, [{\n key: \"is\",\n value: function is(overlayTypeName) {\n return isOverlayTypeOf(this.wot.cloneOverlay, overlayTypeName);\n }\n /**\n *\n */\n\n }, {\n key: \"fixTableDomTree\",\n value: function fixTableDomTree() {\n var rootDocument = this.wot.rootDocument;\n this.TBODY = this.TABLE.querySelector('tbody');\n\n if (!this.TBODY) {\n this.TBODY = rootDocument.createElement('tbody');\n this.TABLE.appendChild(this.TBODY);\n }\n\n this.THEAD = this.TABLE.querySelector('thead');\n\n if (!this.THEAD) {\n this.THEAD = rootDocument.createElement('thead');\n this.TABLE.insertBefore(this.THEAD, this.TBODY);\n }\n\n this.COLGROUP = this.TABLE.querySelector('colgroup');\n\n if (!this.COLGROUP) {\n this.COLGROUP = rootDocument.createElement('colgroup');\n this.TABLE.insertBefore(this.COLGROUP, this.THEAD);\n }\n\n if (this.wot.getSetting('columnHeaders').length && !this.THEAD.childNodes.length) {\n this.THEAD.appendChild(rootDocument.createElement('TR'));\n }\n }\n /**\n * @param {HTMLTableElement} table An element to process.\n * @returns {HTMLElement}\n */\n\n }, {\n key: \"createSpreader\",\n value: function createSpreader(table) {\n var parent = table.parentNode;\n var spreader;\n\n if (!parent || parent.nodeType !== Node.ELEMENT_NODE || !hasClass(parent, 'wtHolder')) {\n spreader = this.wot.rootDocument.createElement('div');\n spreader.className = 'wtSpreader';\n\n if (parent) {\n // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it\n parent.insertBefore(spreader, table);\n }\n\n spreader.appendChild(table);\n }\n\n spreader.style.position = 'relative';\n return spreader;\n }\n /**\n * @param {HTMLElement} spreader An element to the hider element is injected.\n * @returns {HTMLElement}\n */\n\n }, {\n key: \"createHider\",\n value: function createHider(spreader) {\n var parent = spreader.parentNode;\n var hider;\n\n if (!parent || parent.nodeType !== Node.ELEMENT_NODE || !hasClass(parent, 'wtHolder')) {\n hider = this.wot.rootDocument.createElement('div');\n hider.className = 'wtHider';\n\n if (parent) {\n // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it\n parent.insertBefore(hider, spreader);\n }\n\n hider.appendChild(spreader);\n }\n\n return hider;\n }\n /**\n *\n * @param {HTMLElement} hider An element to the holder element is injected.\n * @returns {HTMLElement}\n */\n\n }, {\n key: \"createHolder\",\n value: function createHolder(hider) {\n var parent = hider.parentNode;\n var holder;\n\n if (!parent || parent.nodeType !== Node.ELEMENT_NODE || !hasClass(parent, 'wtHolder')) {\n holder = this.wot.rootDocument.createElement('div');\n holder.style.position = 'relative';\n holder.className = 'wtHolder';\n\n if (parent) {\n // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it\n parent.insertBefore(holder, hider);\n }\n\n if (this.isMaster) {\n holder.parentNode.className += 'ht_master handsontable';\n }\n\n holder.appendChild(hider);\n }\n\n return holder;\n }\n /**\n * Redraws the table.\n *\n * @param {boolean} [fastDraw=false] If TRUE, will try to avoid full redraw and only update the border positions.\n * If FALSE or UNDEFINED, will perform a full redraw.\n * @returns {Table}\n */\n\n }, {\n key: \"draw\",\n value: function draw() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var wot = this.wot;\n var wtOverlays = wot.wtOverlays,\n wtViewport = wot.wtViewport;\n var totalRows = wot.getSetting('totalRows');\n var totalColumns = wot.getSetting('totalColumns');\n var rowHeaders = wot.getSetting('rowHeaders');\n var rowHeadersCount = rowHeaders.length;\n var columnHeaders = wot.getSetting('columnHeaders');\n var columnHeadersCount = columnHeaders.length;\n var syncScroll = false;\n var runFastDraw = fastDraw;\n\n if (this.isMaster) {\n this.holderOffset = offset(this.holder);\n runFastDraw = wtViewport.createRenderCalculators(runFastDraw);\n\n if (rowHeadersCount && !wot.getSetting('fixedColumnsLeft')) {\n var leftScrollPos = wtOverlays.leftOverlay.getScrollPosition();\n var previousState = this.correctHeaderWidth;\n this.correctHeaderWidth = leftScrollPos > 0;\n\n if (previousState !== this.correctHeaderWidth) {\n runFastDraw = false;\n }\n }\n }\n\n if (this.isMaster) {\n syncScroll = wtOverlays.prepareOverlays();\n }\n\n if (runFastDraw) {\n if (this.isMaster) {\n // in case we only scrolled without redraw, update visible rows information in oldRowsCalculator\n wtViewport.createVisibleCalculators();\n }\n\n if (wtOverlays) {\n wtOverlays.refresh(true);\n }\n } else {\n if (this.isMaster) {\n this.tableOffset = offset(this.TABLE);\n } else {\n this.tableOffset = this.wot.cloneSource.wtTable.tableOffset;\n }\n\n var startRow = totalRows > 0 ? this.getFirstRenderedRow() : 0;\n var startColumn = totalColumns > 0 ? this.getFirstRenderedColumn() : 0;\n this.rowFilter = new RowFilter(startRow, totalRows, columnHeadersCount);\n this.columnFilter = new ColumnFilter(startColumn, totalColumns, rowHeadersCount);\n var performRedraw = true; // Only master table rendering can be skipped\n\n if (this.isMaster) {\n this.alignOverlaysWithTrimmingContainer();\n var skipRender = {};\n this.wot.getSetting('beforeDraw', true, skipRender);\n performRedraw = skipRender.skipRender !== true;\n }\n\n if (performRedraw) {\n this.tableRenderer.setHeaderContentRenderers(rowHeaders, columnHeaders);\n\n if (this.is(CLONE_BOTTOM) || this.is(CLONE_BOTTOM_LEFT_CORNER)) {\n // do NOT render headers on the bottom or bottom-left corner overlay\n this.tableRenderer.setHeaderContentRenderers(rowHeaders, []);\n }\n\n this.resetOversizedRows();\n this.tableRenderer.setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();\n var workspaceWidth;\n\n if (this.isMaster) {\n workspaceWidth = this.wot.wtViewport.getWorkspaceWidth();\n this.wot.wtViewport.containerWidth = null;\n this.markOversizedColumnHeaders();\n }\n\n this.adjustColumnHeaderHeights();\n\n if (this.isMaster || this.is(CLONE_BOTTOM)) {\n this.markOversizedRows();\n }\n\n if (this.isMaster) {\n this.wot.wtViewport.createVisibleCalculators();\n this.wot.wtOverlays.refresh(false);\n this.wot.wtOverlays.applyToDOM();\n var hiderWidth = outerWidth(this.hider);\n var tableWidth = outerWidth(this.TABLE);\n\n if (hiderWidth !== 0 && tableWidth !== hiderWidth) {\n // Recalculate the column widths, if width changes made in the overlays removed the scrollbar, thus changing the viewport width.\n this.columnUtils.calculateWidths();\n this.tableRenderer.renderer.colGroup.render();\n }\n\n if (workspaceWidth !== this.wot.wtViewport.getWorkspaceWidth()) {\n // workspace width changed though to shown/hidden vertical scrollbar. Let's reapply stretching\n this.wot.wtViewport.containerWidth = null;\n this.columnUtils.calculateWidths();\n this.tableRenderer.renderer.colGroup.render();\n }\n\n this.wot.getSetting('onDraw', true);\n } else if (this.is(CLONE_BOTTOM)) {\n this.wot.cloneSource.wtOverlays.adjustElementsSize();\n }\n }\n }\n\n if (this.isMaster) {\n var positionChanged = wtOverlays.topOverlay.resetFixedPosition();\n\n if (wtOverlays.bottomOverlay.clone) {\n positionChanged = wtOverlays.bottomOverlay.resetFixedPosition() || positionChanged;\n }\n\n positionChanged = wtOverlays.leftOverlay.resetFixedPosition() || positionChanged;\n\n if (wtOverlays.topLeftCornerOverlay) {\n wtOverlays.topLeftCornerOverlay.resetFixedPosition();\n }\n\n if (wtOverlays.bottomLeftCornerOverlay && wtOverlays.bottomLeftCornerOverlay.clone) {\n wtOverlays.bottomLeftCornerOverlay.resetFixedPosition();\n }\n\n if (positionChanged) {\n // It refreshes the cells borders caused by a 1px shift (introduced by overlays which add or\n // remove `innerBorderTop` and `innerBorderLeft` CSS classes to the DOM element. This happens\n // when there is a switch between rendering from 0 to N rows/columns and vice versa).\n wtOverlays.refreshAll();\n wtOverlays.adjustElementsSize();\n }\n }\n\n this.refreshSelections(runFastDraw);\n\n if (syncScroll) {\n wtOverlays.syncScrollWithMaster();\n }\n\n wot.drawn = true;\n return this;\n }\n /**\n * @param {number} col The visual column index.\n */\n\n }, {\n key: \"markIfOversizedColumnHeader\",\n value: function markIfOversizedColumnHeader(col) {\n var sourceColIndex = this.wot.wtTable.columnFilter.renderedToSource(col);\n var level = this.wot.getSetting('columnHeaders').length;\n var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;\n var previousColHeaderHeight;\n var currentHeader;\n var currentHeaderHeight;\n var columnHeaderHeightSetting = this.wot.getSetting('columnHeaderHeight') || [];\n\n while (level) {\n level -= 1;\n previousColHeaderHeight = this.wot.wtTable.getColumnHeaderHeight(level);\n currentHeader = this.wot.wtTable.getColumnHeader(sourceColIndex, level);\n\n if (!currentHeader) {\n /* eslint-disable no-continue */\n continue;\n }\n\n currentHeaderHeight = innerHeight(currentHeader);\n\n if (!previousColHeaderHeight && defaultRowHeight < currentHeaderHeight || previousColHeaderHeight < currentHeaderHeight) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = currentHeaderHeight;\n }\n\n if (Array.isArray(columnHeaderHeightSetting)) {\n if (columnHeaderHeightSetting[level] !== null && columnHeaderHeightSetting[level] !== void 0) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level];\n }\n } else if (!isNaN(columnHeaderHeightSetting)) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting;\n }\n\n if (this.wot.wtViewport.oversizedColumnHeaders[level] < (columnHeaderHeightSetting[level] || columnHeaderHeightSetting)) {\n this.wot.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level] || columnHeaderHeightSetting; // eslint-disable-line max-len\n }\n }\n }\n /**\n *\n */\n\n }, {\n key: \"adjustColumnHeaderHeights\",\n value: function adjustColumnHeaderHeights() {\n var wot = this.wot;\n var children = wot.wtTable.THEAD.childNodes;\n var oversizedColumnHeaders = wot.wtViewport.oversizedColumnHeaders;\n var columnHeaders = wot.getSetting('columnHeaders');\n\n for (var i = 0, len = columnHeaders.length; i < len; i++) {\n if (oversizedColumnHeaders[i]) {\n if (!children[i] || children[i].childNodes.length === 0) {\n return;\n }\n\n children[i].childNodes[0].style.height = \"\".concat(oversizedColumnHeaders[i], \"px\");\n }\n }\n }\n /**\n * Resets cache of row heights. The cache should be cached for each render cycle in a case\n * when new cell values have content which increases/decreases cell height.\n */\n\n }, {\n key: \"resetOversizedRows\",\n value: function resetOversizedRows() {\n var wot = this.wot;\n\n if (!this.isMaster && !this.is(CLONE_BOTTOM)) {\n return;\n }\n\n if (!wot.getSetting('externalRowCalculator')) {\n var rowsToRender = this.getRenderedRowsCount(); // Reset the oversized row cache for rendered rows\n\n for (var visibleRowIndex = 0; visibleRowIndex < rowsToRender; visibleRowIndex++) {\n var sourceRow = this.rowFilter.renderedToSource(visibleRowIndex);\n\n if (wot.wtViewport.oversizedRows && wot.wtViewport.oversizedRows[sourceRow]) {\n wot.wtViewport.oversizedRows[sourceRow] = void 0;\n }\n }\n }\n }\n /**\n * @param {string} className The CSS class name to remove from the table cells.\n */\n\n }, {\n key: \"removeClassFromCells\",\n value: function removeClassFromCells(className) {\n var nodes = this.TABLE.querySelectorAll(\".\".concat(className));\n\n for (var i = 0, len = nodes.length; i < len; i++) {\n removeClass(nodes[i], className);\n }\n }\n /**\n * Refresh the table selection by re-rendering Selection instances connected with that instance.\n *\n * @param {boolean} fastDraw If fast drawing is enabled than additionally className clearing is applied.\n */\n\n }, {\n key: \"refreshSelections\",\n value: function refreshSelections(fastDraw) {\n var wot = this.wot;\n\n if (!wot.selections) {\n return;\n }\n\n var highlights = Array.from(wot.selections);\n var len = highlights.length;\n\n if (fastDraw) {\n var classesToRemove = [];\n\n for (var i = 0; i < len; i++) {\n var _highlights$i$setting = highlights[i].settings,\n highlightHeaderClassName = _highlights$i$setting.highlightHeaderClassName,\n highlightRowClassName = _highlights$i$setting.highlightRowClassName,\n highlightColumnClassName = _highlights$i$setting.highlightColumnClassName;\n var classNames = highlights[i].classNames;\n var classNamesLength = classNames.length;\n\n for (var j = 0; j < classNamesLength; j++) {\n if (!classesToRemove.includes(classNames[j])) {\n classesToRemove.push(classNames[j]);\n }\n }\n\n if (highlightHeaderClassName && !classesToRemove.includes(highlightHeaderClassName)) {\n classesToRemove.push(highlightHeaderClassName);\n }\n\n if (highlightRowClassName && !classesToRemove.includes(highlightRowClassName)) {\n classesToRemove.push(highlightRowClassName);\n }\n\n if (highlightColumnClassName && !classesToRemove.includes(highlightColumnClassName)) {\n classesToRemove.push(highlightColumnClassName);\n }\n }\n\n var additionalClassesToRemove = wot.getSetting('onBeforeRemoveCellClassNames');\n\n if (Array.isArray(additionalClassesToRemove)) {\n for (var _i = 0; _i < additionalClassesToRemove.length; _i++) {\n classesToRemove.push(additionalClassesToRemove[_i]);\n }\n }\n\n var classesToRemoveLength = classesToRemove.length;\n\n for (var _i2 = 0; _i2 < classesToRemoveLength; _i2++) {\n // there was no rerender, so we need to remove classNames by ourselves\n this.removeClassFromCells(classesToRemove[_i2]);\n }\n }\n\n for (var _i3 = 0; _i3 < len; _i3++) {\n highlights[_i3].draw(wot, fastDraw);\n }\n }\n /**\n * Get cell element at coords.\n * Negative coords.row or coords.col are used to retrieve header cells. If there are multiple header levels, the\n * negative value corresponds to the distance from the working area. For example, when there are 3 levels of column\n * headers, coords.col=-1 corresponds to the most inner header element, while coords.col=-3 corresponds to the\n * outmost header element.\n *\n * In case an element for the coords is not rendered, the method returns an error code.\n * To produce the error code, the input parameters are validated in the order in which they\n * are given. Thus, if both the row and the column coords are out of the rendered bounds,\n * the method returns the error code for the row.\n *\n * @param {CellCoords} coords The cell coordinates.\n * @returns {HTMLElement|number} HTMLElement on success or Number one of the exit codes on error:\n * -1 row before viewport\n * -2 row after viewport\n * -3 column before viewport\n * -4 column after viewport.\n */\n\n }, {\n key: \"getCell\",\n value: function getCell(coords) {\n var row = coords.row;\n var column = coords.col;\n var hookResult = this.wot.getSetting('onModifyGetCellCoords', row, column);\n\n if (hookResult && Array.isArray(hookResult)) {\n var _hookResult = _slicedToArray(hookResult, 2);\n\n row = _hookResult[0];\n column = _hookResult[1];\n }\n\n if (this.isRowBeforeRenderedRows(row)) {\n // row before rendered rows\n return -1;\n } else if (this.isRowAfterRenderedRows(row)) {\n // row after rendered rows\n return -2;\n } else if (this.isColumnBeforeRenderedColumns(column)) {\n // column before rendered columns\n return -3;\n } else if (this.isColumnAfterRenderedColumns(column)) {\n // column after rendered columns\n return -4;\n }\n\n var TR;\n\n if (row < 0) {\n TR = this.THEAD.childNodes[this.rowFilter.sourceRowToVisibleColHeadedRow(row)];\n } else {\n TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];\n }\n\n if (!TR && row >= 0) {\n throw new Error('TR was expected to be rendered but is not');\n }\n\n var TD = TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(column)];\n\n if (!TD && column >= 0) {\n throw new Error('TD or TH was expected to be rendered but is not');\n }\n\n return TD;\n }\n /**\n * GetColumnHeader.\n *\n * @param {number} col Column index.\n * @param {number} [level=0] Header level (0 = most distant to the table).\n * @returns {object} HTMLElement on success or undefined on error.\n */\n\n }, {\n key: \"getColumnHeader\",\n value: function getColumnHeader(col) {\n var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var TR = this.THEAD.childNodes[level];\n return TR === null || TR === void 0 ? void 0 : TR.childNodes[this.columnFilter.sourceColumnToVisibleRowHeadedColumn(col)];\n }\n /**\n * Gets all columns headers (TH elements) from the table.\n *\n * @param {number} column A source column index.\n * @returns {HTMLTableCellElement[]}\n */\n\n }, {\n key: \"getColumnHeaders\",\n value: function getColumnHeaders(column) {\n var THs = [];\n var visibleColumn = this.columnFilter.sourceColumnToVisibleRowHeadedColumn(column);\n this.THEAD.childNodes.forEach(function (TR) {\n var TH = TR.childNodes[visibleColumn];\n\n if (TH) {\n THs.push(TH);\n }\n });\n return THs;\n }\n /**\n * GetRowHeader.\n *\n * @param {number} row Row index.\n * @param {number} [level=0] Header level (0 = most distant to the table).\n * @returns {HTMLElement} HTMLElement on success or Number one of the exit codes on error: `null table doesn't have row headers`.\n */\n\n }, {\n key: \"getRowHeader\",\n value: function getRowHeader(row) {\n var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0) === 0) {\n return;\n }\n\n var rowHeadersCount = this.wot.getSetting('rowHeaders').length;\n\n if (level >= rowHeadersCount) {\n return;\n }\n\n var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];\n return TR === null || TR === void 0 ? void 0 : TR.childNodes[level];\n }\n /**\n * Gets all rows headers (TH elements) from the table.\n *\n * @param {number} row A source row index.\n * @returns {HTMLTableCellElement[]}\n */\n\n }, {\n key: \"getRowHeaders\",\n value: function getRowHeaders(row) {\n if (this.columnFilter.sourceColumnToVisibleRowHeadedColumn(0) === 0) {\n return [];\n }\n\n var THs = [];\n var rowHeadersCount = this.wot.getSetting('rowHeaders').length;\n\n for (var renderedRowIndex = 0; renderedRowIndex < rowHeadersCount; renderedRowIndex++) {\n var TR = this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];\n var TH = TR === null || TR === void 0 ? void 0 : TR.childNodes[renderedRowIndex];\n\n if (TH) {\n THs.push(TH);\n }\n }\n\n return THs;\n }\n /**\n * Returns cell coords object for a given TD (or a child element of a TD element).\n *\n * @param {HTMLTableCellElement} TD A cell DOM element (or a child of one).\n * @returns {CellCoords|null} The coordinates of the provided TD element (or the closest TD element) or null, if the provided element is not applicable.\n */\n\n }, {\n key: \"getCoords\",\n value: function getCoords(TD) {\n var cellElement = TD;\n\n if (cellElement.nodeName !== 'TD' && cellElement.nodeName !== 'TH') {\n cellElement = closest(cellElement, ['TD', 'TH']);\n }\n\n if (cellElement === null) {\n return null;\n }\n\n var TR = cellElement.parentNode;\n var CONTAINER = TR.parentNode;\n var row = index(TR);\n var col = cellElement.cellIndex;\n\n if (overlayContainsElement(CLONE_TOP_LEFT_CORNER, cellElement, this.wtRootElement) || overlayContainsElement(CLONE_TOP, cellElement, this.wtRootElement)) {\n if (CONTAINER.nodeName === 'THEAD') {\n row -= CONTAINER.childNodes.length;\n }\n } else if (overlayContainsElement(CLONE_BOTTOM_LEFT_CORNER, cellElement, this.wtRootElement) || overlayContainsElement(CLONE_BOTTOM, cellElement, this.wtRootElement)) {\n var totalRows = this.wot.getSetting('totalRows');\n row = totalRows - CONTAINER.childNodes.length + row;\n } else if (CONTAINER === this.THEAD) {\n row = this.rowFilter.visibleColHeadedRowToSourceRow(row);\n } else {\n row = this.rowFilter.renderedToSource(row);\n }\n\n if (overlayContainsElement(CLONE_TOP_LEFT_CORNER, cellElement, this.wtRootElement) || overlayContainsElement(CLONE_LEFT, cellElement, this.wtRootElement) || overlayContainsElement(CLONE_BOTTOM_LEFT_CORNER, cellElement, this.wtRootElement)) {\n col = this.columnFilter.offsettedTH(col);\n } else {\n col = this.columnFilter.visibleRowHeadedColumnToSourceColumn(col);\n }\n\n return new CellCoords(row, col);\n }\n /**\n * Check if any of the rendered rows is higher than expected, and if so, cache them.\n */\n\n }, {\n key: \"markOversizedRows\",\n value: function markOversizedRows() {\n if (this.wot.getSetting('externalRowCalculator')) {\n return;\n }\n\n var rowCount = this.TBODY.childNodes.length;\n var expectedTableHeight = rowCount * this.wot.wtSettings.settings.defaultRowHeight;\n var actualTableHeight = innerHeight(this.TBODY) - 1;\n var previousRowHeight;\n var rowInnerHeight;\n var sourceRowIndex;\n var currentTr;\n var rowHeader;\n\n if (expectedTableHeight === actualTableHeight && !this.wot.getSetting('fixedRowsBottom')) {\n // If the actual table height equals rowCount * default single row height, no row is oversized -> no need to iterate over them\n return;\n }\n\n while (rowCount) {\n rowCount -= 1;\n sourceRowIndex = this.rowFilter.renderedToSource(rowCount);\n previousRowHeight = this.getRowHeight(sourceRowIndex);\n currentTr = this.getTrForRow(sourceRowIndex);\n rowHeader = currentTr.querySelector('th');\n\n if (rowHeader) {\n rowInnerHeight = innerHeight(rowHeader);\n } else {\n rowInnerHeight = innerHeight(currentTr) - 1;\n }\n\n if (!previousRowHeight && this.wot.wtSettings.settings.defaultRowHeight < rowInnerHeight || previousRowHeight < rowInnerHeight) {\n rowInnerHeight += 1;\n this.wot.wtViewport.oversizedRows[sourceRowIndex] = rowInnerHeight;\n }\n }\n }\n /**\n * @param {number} row The visual row index.\n * @returns {HTMLTableElement}\n */\n\n }, {\n key: \"getTrForRow\",\n value: function getTrForRow(row) {\n return this.TBODY.childNodes[this.rowFilter.sourceToRendered(row)];\n }\n /**\n * Checks if the column index (negative value from -1 to N) is rendered.\n *\n * @param {number} column The column index (negative value from -1 to N).\n * @returns {boolean}\n */\n\n }, {\n key: \"isColumnHeaderRendered\",\n value: function isColumnHeaderRendered(column) {\n if (column >= 0) {\n return false;\n }\n\n var rowHeaders = this.wot.getSetting('rowHeaders');\n var rowHeadersCount = rowHeaders.length;\n return Math.abs(column) <= rowHeadersCount;\n }\n /**\n * Checks if the row index (negative value from -1 to N) is rendered.\n *\n * @param {number} row The row index (negative value from -1 to N).\n * @returns {boolean}\n */\n\n }, {\n key: \"isRowHeaderRendered\",\n value: function isRowHeaderRendered(row) {\n if (row >= 0) {\n return false;\n }\n\n var columnHeaders = this.wot.getSetting('columnHeaders');\n var columnHeadersCount = columnHeaders.length;\n return Math.abs(row) <= columnHeadersCount;\n }\n /* eslint-disable jsdoc/require-description-complete-sentence */\n\n /**\n * Check if the given row index is lower than the index of the first row that\n * is currently rendered and return TRUE in that case, or FALSE otherwise.\n *\n * Negative row index is used to check the columns' headers.\n *\n * Headers\n * +--------------+ │\n * -3 │ │ │ │ │\n * +--------------+ │\n * -2 │ │ │ │ │ TRUE\n * +--------------+ │\n * -1 │ │ │ │ │\n * Cells +==================+ │\n * 0 ┇ ┇ ┇ ┇ <--- For fixedRowsTop: 1 │\n * +--------------+ the master overlay do ---+ first rendered row (index 1)\n * 1 │ A2 │ B2 │ C2 │ not render the first row. │\n * +--------------+ │ FALSE\n * 2 │ A3 │ B3 │ C3 │ │\n * +--------------+ ---+ last rendered row\n * │\n * │ FALSE\n *\n * @param {number} row The visual row index.\n * @memberof Table#\n * @function isRowBeforeRenderedRows\n * @returns {boolean}\n */\n\n /* eslint-enable jsdoc/require-description-complete-sentence */\n\n }, {\n key: \"isRowBeforeRenderedRows\",\n value: function isRowBeforeRenderedRows(row) {\n var first = this.getFirstRenderedRow(); // Check the headers only in case when the first rendered row is -1 or 0.\n // This is an indication that the overlay is placed on the most top position.\n\n if (row < 0 && first <= 0) {\n return !this.isRowHeaderRendered(row);\n }\n\n return row < first;\n }\n /* eslint-disable jsdoc/require-description-complete-sentence */\n\n /**\n * Check if the given column index is greater than the index of the last column that\n * is currently rendered and return TRUE in that case, or FALSE otherwise.\n *\n * The negative row index is used to check the columns' headers. However,\n * keep in mind that for negative indexes, the method always returns FALSE as\n * it is not possible to render headers partially. The \"after\" index can not be\n * lower than -1.\n *\n * Headers\n * +--------------+ │\n * -3 │ │ │ │ │\n * +--------------+ │\n * -2 │ │ │ │ │ FALSE\n * +--------------+ │\n * -1 │ │ │ │ │\n * Cells +==================+ │\n * 0 ┇ ┇ ┇ ┇ <--- For fixedRowsTop: 1 │\n * +--------------+ the master overlay do ---+ first rendered row (index 1)\n * 1 │ A2 │ B2 │ C2 │ not render the first rows │\n * +--------------+ │ FALSE\n * 2 │ A3 │ B3 │ C3 │ │\n * +--------------+ ---+ last rendered row\n * │\n * │ TRUE\n *\n * @param {number} row The visual row index.\n * @memberof Table#\n * @function isRowAfterRenderedRows\n * @returns {boolean}\n */\n\n /* eslint-enable jsdoc/require-description-complete-sentence */\n\n }, {\n key: \"isRowAfterRenderedRows\",\n value: function isRowAfterRenderedRows(row) {\n return row > this.getLastRenderedRow();\n }\n /* eslint-disable jsdoc/require-description-complete-sentence */\n\n /**\n * Check if the given column index is lower than the index of the first column that\n * is currently rendered and return TRUE in that case, or FALSE otherwise.\n *\n * Negative column index is used to check the rows' headers.\n *\n * For fixedColumnsLeft: 1 the master overlay\n * do not render this first columns.\n * Headers -3 -2 -1 |\n * +----+----+----║┄ ┄ +------+------+\n * │ │ │ ║ │ B1 │ C1 │\n * +--------------║┄ ┄ --------------│\n * │ │ │ ║ │ B2 │ C2 │\n * +--------------║┄ ┄ --------------│\n * │ │ │ ║ │ B3 │ C3 │\n * +----+----+----║┄ ┄ +------+------+\n * ╷ ╷\n * -------------------------+-------------+---------------->\n * TRUE first FALSE last FALSE\n * rendered rendered\n * column column\n *\n * @param {number} column The visual column index.\n * @memberof Table#\n * @function isColumnBeforeRenderedColumns\n * @returns {boolean}\n */\n\n /* eslint-enable jsdoc/require-description-complete-sentence */\n\n }, {\n key: \"isColumnBeforeRenderedColumns\",\n value: function isColumnBeforeRenderedColumns(column) {\n var first = this.getFirstRenderedColumn(); // Check the headers only in case when the first rendered column is -1 or 0.\n // This is an indication that the overlay is placed on the most left position.\n\n if (column < 0 && first <= 0) {\n return !this.isColumnHeaderRendered(column);\n }\n\n return column < first;\n }\n /* eslint-disable jsdoc/require-description-complete-sentence */\n\n /**\n * Check if the given column index is greater than the index of the last column that\n * is currently rendered and return TRUE in that case, or FALSE otherwise.\n *\n * The negative column index is used to check the rows' headers. However,\n * keep in mind that for negative indexes, the method always returns FALSE as\n * it is not possible to render headers partially. The \"after\" index can not be\n * lower than -1.\n *\n * For fixedColumnsLeft: 1 the master overlay\n * do not render this first columns.\n * Headers -3 -2 -1 |\n * +----+----+----║┄ ┄ +------+------+\n * │ │ │ ║ │ B1 │ C1 │\n * +--------------║┄ ┄ --------------│\n * │ │ │ ║ │ B2 │ C2 │\n * +--------------║┄ ┄ --------------│\n * │ │ │ ║ │ B3 │ C3 │\n * +----+----+----║┄ ┄ +------+------+\n * ╷ ╷\n * -------------------------+-------------+---------------->\n * FALSE first FALSE last TRUE\n * rendered rendered\n * column column\n *\n * @param {number} column The visual column index.\n * @memberof Table#\n * @function isColumnAfterRenderedColumns\n * @returns {boolean}\n */\n\n /* eslint-enable jsdoc/require-description-complete-sentence */\n\n }, {\n key: \"isColumnAfterRenderedColumns\",\n value: function isColumnAfterRenderedColumns(column) {\n return this.columnFilter && column > this.getLastRenderedColumn();\n }\n }, {\n key: \"isColumnAfterViewport\",\n value: function isColumnAfterViewport(column) {\n return this.columnFilter && column > this.getLastVisibleColumn();\n }\n }, {\n key: \"isRowAfterViewport\",\n value: function isRowAfterViewport(row) {\n return this.rowFilter && row > this.getLastVisibleRow();\n }\n }, {\n key: \"isColumnBeforeViewport\",\n value: function isColumnBeforeViewport(column) {\n return this.columnFilter && this.columnFilter.sourceToRendered(column) < 0 && column >= 0;\n }\n }, {\n key: \"isLastRowFullyVisible\",\n value: function isLastRowFullyVisible() {\n return this.getLastVisibleRow() === this.getLastRenderedRow();\n }\n }, {\n key: \"isLastColumnFullyVisible\",\n value: function isLastColumnFullyVisible() {\n return this.getLastVisibleColumn() === this.getLastRenderedColumn();\n }\n }, {\n key: \"allRowsInViewport\",\n value: function allRowsInViewport() {\n return this.wot.getSetting('totalRows') === this.getVisibleRowsCount();\n }\n }, {\n key: \"allColumnsInViewport\",\n value: function allColumnsInViewport() {\n return this.wot.getSetting('totalColumns') === this.getVisibleColumnsCount();\n }\n /**\n * Checks if any of the row's cells content exceeds its initial height, and if so, returns the oversized height.\n *\n * @param {number} sourceRow The physical row index.\n * @returns {number}\n */\n\n }, {\n key: \"getRowHeight\",\n value: function getRowHeight(sourceRow) {\n return this.rowUtils.getHeight(sourceRow);\n }\n /**\n * @param {number} level The column level.\n * @returns {number}\n */\n\n }, {\n key: \"getColumnHeaderHeight\",\n value: function getColumnHeaderHeight(level) {\n return this.columnUtils.getHeaderHeight(level);\n }\n /**\n * @param {number} sourceColumn The physical column index.\n * @returns {number}\n */\n\n }, {\n key: \"getColumnWidth\",\n value: function getColumnWidth(sourceColumn) {\n return this.columnUtils.getWidth(sourceColumn);\n }\n /**\n * @param {number} sourceColumn The physical column index.\n * @returns {number}\n */\n\n }, {\n key: \"getStretchedColumnWidth\",\n value: function getStretchedColumnWidth(sourceColumn) {\n return this.columnUtils.getStretchedColumnWidth(sourceColumn);\n }\n /**\n * Checks if the table has defined size. It returns `true` when the table has width and height\n * set bigger than `0px`.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"hasDefinedSize\",\n value: function hasDefinedSize() {\n return this.hasTableHeight && this.hasTableWidth;\n }\n /**\n * Checks if the table is visible. It returns `true` when the holder element (or its parents)\n * has CSS 'display' property different than 'none'.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isVisible\",\n value: function isVisible() {\n return _isVisible(this.TABLE);\n }\n /**\n * Modify row header widths provided by user in class contructor.\n *\n * @private\n * @param {Function} rowHeaderWidthFactory The function which can provide default width values for rows..\n * @returns {number}\n */\n\n }, {\n key: \"_modifyRowHeaderWidth\",\n value: function _modifyRowHeaderWidth(rowHeaderWidthFactory) {\n var widths = isFunction(rowHeaderWidthFactory) ? rowHeaderWidthFactory() : null;\n\n if (Array.isArray(widths)) {\n widths = _toConsumableArray(widths);\n widths[widths.length - 1] = this._correctRowHeaderWidth(widths[widths.length - 1]);\n } else {\n widths = this._correctRowHeaderWidth(widths);\n }\n\n return widths;\n }\n /**\n * Correct row header width if necessary.\n *\n * @private\n * @param {number} width The width to process.\n * @returns {number}\n */\n\n }, {\n key: \"_correctRowHeaderWidth\",\n value: function _correctRowHeaderWidth(width) {\n var rowHeaderWidth = width;\n\n if (typeof width !== 'number') {\n rowHeaderWidth = this.wot.getSetting('defaultColumnWidth');\n }\n\n if (this.correctHeaderWidth) {\n rowHeaderWidth += 1;\n }\n\n return rowHeaderWidth;\n }\n }]);\n\n return Table;\n}();\n\nexport default Table;","import { defineGetter } from \"../../../../../helpers/object.mjs\";\nvar MIXIN_NAME = 'stickyRowsBottom';\n/**\n * Mixin for the subclasses of `Table` with implementations of\n * helper methods that are related to rows.\n * This mixin is meant to be applied in the subclasses of `Table`\n * that use sticky rendering of the bottom rows in the vertical axis.\n *\n * @type {object}\n */\n\nvar stickyRowsBottom = {\n /**\n * Get the source index of the first rendered row. If no rows are rendered, returns an error code: -1.\n *\n * @returns {number}\n */\n getFirstRenderedRow: function getFirstRenderedRow() {\n var totalRows = this.wot.getSetting('totalRows');\n var fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');\n var index = totalRows - fixedRowsBottom;\n\n if (totalRows === 0 || fixedRowsBottom === 0) {\n return -1;\n }\n\n if (index < 0) {\n return 0;\n }\n\n return index;\n },\n\n /**\n * Get the source index of the first row fully visible in the viewport. If no rows are fully visible, returns an error code: -1.\n * Assumes that all rendered rows are fully visible.\n *\n * @returns {number}\n */\n getFirstVisibleRow: function getFirstVisibleRow() {\n return this.getFirstRenderedRow();\n },\n\n /**\n * Get the source index of the last rendered row. If no rows are rendered, returns an error code: -1.\n *\n * @returns {number}\n */\n getLastRenderedRow: function getLastRenderedRow() {\n return this.wot.getSetting('totalRows') - 1;\n },\n\n /**\n * Get the source index of the last row fully visible in the viewport. If no rows are fully visible, returns an error code: -1.\n * Assumes that all rendered rows are fully visible.\n *\n * @returns {number}\n */\n getLastVisibleRow: function getLastVisibleRow() {\n return this.getLastRenderedRow();\n },\n\n /**\n * Get the number of rendered rows.\n *\n * @returns {number}\n */\n getRenderedRowsCount: function getRenderedRowsCount() {\n var totalRows = this.wot.getSetting('totalRows');\n return Math.min(this.wot.getSetting('fixedRowsBottom'), totalRows);\n },\n\n /**\n * Get the number of fully visible rows in the viewport.\n * Assumes that all rendered rows are fully visible.\n *\n * @returns {number}\n */\n getVisibleRowsCount: function getVisibleRowsCount() {\n return this.getRenderedRowsCount();\n }\n};\ndefineGetter(stickyRowsBottom, 'MIXIN_NAME', MIXIN_NAME, {\n writable: false,\n enumerable: false\n});\nexport default stickyRowsBottom;","import { defineGetter } from \"../../../../../helpers/object.mjs\";\nvar MIXIN_NAME = 'stickyColumnsLeft';\n/**\n * Mixin for the subclasses of `Table` with implementations of\n * helper methods that are related to columns.\n * This mixin is meant to be applied in the subclasses of `Table`\n * that use sticky rendering of the first columns in the horizontal axis.\n *\n * @type {object}\n */\n\nvar stickyColumnsLeft = {\n /**\n * Get the source index of the first rendered column. If no columns are rendered, returns an error code: -1.\n *\n * @returns {number}\n */\n getFirstRenderedColumn: function getFirstRenderedColumn() {\n var totalColumns = this.wot.getSetting('totalColumns');\n\n if (totalColumns === 0) {\n return -1;\n }\n\n return 0;\n },\n\n /**\n * Get the source index of the first column fully visible in the viewport. If no columns are fully visible, returns an error code: -1.\n * Assumes that all rendered columns are fully visible.\n *\n * @returns {number}\n */\n getFirstVisibleColumn: function getFirstVisibleColumn() {\n return this.getFirstRenderedColumn();\n },\n\n /**\n * Get the source index of the last rendered column. If no columns are rendered, returns an error code: -1.\n *\n * @returns {number}\n */\n getLastRenderedColumn: function getLastRenderedColumn() {\n return this.getRenderedColumnsCount() - 1;\n },\n\n /**\n * Get the source index of the last column fully visible in the viewport. If no columns are fully visible, returns an error code: -1.\n * Assumes that all rendered columns are fully visible.\n *\n * @returns {number}\n */\n getLastVisibleColumn: function getLastVisibleColumn() {\n return this.getLastRenderedColumn();\n },\n\n /**\n * Get the number of rendered columns.\n *\n * @returns {number}\n */\n getRenderedColumnsCount: function getRenderedColumnsCount() {\n var totalColumns = this.wot.getSetting('totalColumns');\n return Math.min(this.wot.getSetting('fixedColumnsLeft'), totalColumns);\n },\n\n /**\n * Get the number of fully visible columns in the viewport.\n * Assumes that all rendered columns are fully visible.\n *\n * @returns {number}\n */\n getVisibleColumnsCount: function getVisibleColumnsCount() {\n return this.getRenderedColumnsCount();\n }\n};\ndefineGetter(stickyColumnsLeft, 'MIXIN_NAME', MIXIN_NAME, {\n writable: false,\n enumerable: false\n});\nexport default stickyColumnsLeft;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport Table from \"../table.mjs\";\nimport stickyRowsBottom from \"./mixin/stickyRowsBottom.mjs\";\nimport stickyColumnsLeft from \"./mixin/stickyColumnsLeft.mjs\";\nimport { mixin } from \"./../../../../helpers/object.mjs\";\n/**\n * Subclass of `Table` that provides the helper methods relevant to BottomLeftCornerOverlay, implemented through mixins.\n */\n\nvar BottomLeftCornerOverlayTable = /*#__PURE__*/function (_Table) {\n _inherits(BottomLeftCornerOverlayTable, _Table);\n\n var _super = _createSuper(BottomLeftCornerOverlayTable);\n\n function BottomLeftCornerOverlayTable() {\n _classCallCheck(this, BottomLeftCornerOverlayTable);\n\n return _super.apply(this, arguments);\n }\n\n return BottomLeftCornerOverlayTable;\n}(Table);\n\nmixin(BottomLeftCornerOverlayTable, stickyRowsBottom);\nmixin(BottomLeftCornerOverlayTable, stickyColumnsLeft);\nexport default BottomLeftCornerOverlayTable;","import \"core-js/modules/es.array.index-of.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { getScrollableElement, getTrimmingContainer } from \"./../../../../helpers/dom/element.mjs\";\nimport { defineGetter } from \"./../../../../helpers/object.mjs\";\nimport { arrayEach } from \"./../../../../helpers/array.mjs\";\nimport { warn } from \"./../../../../helpers/console.mjs\";\nimport EventManager from \"./../../../../eventManager.mjs\";\nimport { CLONE_TYPES, CLONE_TOP, CLONE_LEFT } from \"./constants.mjs\";\n/**\n * Creates an overlay over the original Walkontable instance. The overlay renders the clone of the original Walkontable\n * and (optionally) implements behavior needed for native horizontal and vertical scrolling.\n *\n * @class Overlay\n */\n\nexport var Overlay = /*#__PURE__*/function () {\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n */\n function Overlay(wotInstance) {\n _classCallCheck(this, Overlay);\n\n defineGetter(this, 'wot', wotInstance, {\n writable: false\n });\n var _this$wot$wtTable = this.wot.wtTable,\n TABLE = _this$wot$wtTable.TABLE,\n hider = _this$wot$wtTable.hider,\n spreader = _this$wot$wtTable.spreader,\n holder = _this$wot$wtTable.holder,\n wtRootElement = _this$wot$wtTable.wtRootElement; // legacy support, deprecated in the future\n\n this.instance = this.wot;\n this.type = '';\n this.mainTableScrollableElement = null;\n this.TABLE = TABLE;\n this.hider = hider;\n this.spreader = spreader;\n this.holder = holder;\n this.wtRootElement = wtRootElement;\n this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode);\n this.updateStateOfRendering();\n }\n /**\n * Update internal state of object with an information about the need of full rendering of the overlay.\n *\n * @returns {boolean} Returns `true` if the state has changed since the last check.\n */\n\n\n _createClass(Overlay, [{\n key: \"updateStateOfRendering\",\n value: function updateStateOfRendering() {\n var previousState = this.needFullRender;\n this.needFullRender = this.shouldBeRendered();\n var changed = previousState !== this.needFullRender;\n\n if (changed && !this.needFullRender) {\n this.reset();\n }\n\n return changed;\n }\n /**\n * Checks if overlay should be fully rendered.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"shouldBeRendered\",\n value: function shouldBeRendered() {\n return true;\n }\n /**\n * Update the trimming container.\n */\n\n }, {\n key: \"updateTrimmingContainer\",\n value: function updateTrimmingContainer() {\n this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode);\n }\n /**\n * Update the main scrollable element.\n */\n\n }, {\n key: \"updateMainScrollableElement\",\n value: function updateMainScrollableElement() {\n var _this$wot = this.wot,\n wtTable = _this$wot.wtTable,\n rootWindow = _this$wot.rootWindow;\n\n if (rootWindow.getComputedStyle(wtTable.wtRootElement.parentNode).getPropertyValue('overflow') === 'hidden') {\n this.mainTableScrollableElement = this.wot.wtTable.holder;\n } else {\n this.mainTableScrollableElement = getScrollableElement(wtTable.TABLE);\n }\n }\n /**\n * Calculates coordinates of the provided element, relative to the root Handsontable element.\n * NOTE: The element needs to be a child of the overlay in order for the method to work correctly.\n *\n * @param {HTMLElement} element The cell element to calculate the position for.\n * @param {number} rowIndex Visual row index.\n * @param {number} columnIndex Visual column index.\n * @returns {{top: number, left: number}|undefined}\n */\n\n }, {\n key: \"getRelativeCellPosition\",\n value: function getRelativeCellPosition(element, rowIndex, columnIndex) {\n if (this.clone.wtTable.holder.contains(element) === false) {\n warn(\"The provided element is not a child of the \".concat(this.type, \" overlay\"));\n return;\n }\n\n var windowScroll = this.mainTableScrollableElement === this.wot.rootWindow;\n var fixedColumn = columnIndex < this.wot.getSetting('fixedColumnsLeft');\n var fixedRowTop = rowIndex < this.wot.getSetting('fixedRowsTop');\n var fixedRowBottom = rowIndex >= this.wot.getSetting('totalRows') - this.wot.getSetting('fixedRowsBottom');\n var spreaderOffset = {\n left: this.clone.wtTable.spreader.offsetLeft,\n top: this.clone.wtTable.spreader.offsetTop\n };\n var elementOffset = {\n left: element.offsetLeft,\n top: element.offsetTop\n };\n var offsetObject = null;\n\n if (windowScroll) {\n offsetObject = this.getRelativeCellPositionWithinWindow(fixedRowTop, fixedColumn, elementOffset, spreaderOffset);\n } else {\n offsetObject = this.getRelativeCellPositionWithinHolder(fixedRowTop, fixedRowBottom, fixedColumn, elementOffset, spreaderOffset);\n }\n\n return offsetObject;\n }\n /**\n * Calculates coordinates of the provided element, relative to the root Handsontable element within a table with window\n * as a scrollable element.\n *\n * @private\n * @param {boolean} onFixedRowTop `true` if the coordinates point to a place within the top fixed rows.\n * @param {boolean} onFixedColumn `true` if the coordinates point to a place within the fixed columns.\n * @param {number} elementOffset Offset position of the cell element.\n * @param {number} spreaderOffset Offset position of the spreader element.\n * @returns {{top: number, left: number}}\n */\n\n }, {\n key: \"getRelativeCellPositionWithinWindow\",\n value: function getRelativeCellPositionWithinWindow(onFixedRowTop, onFixedColumn, elementOffset, spreaderOffset) {\n var absoluteRootElementPosition = this.wot.wtTable.wtRootElement.getBoundingClientRect();\n var horizontalOffset = 0;\n var verticalOffset = 0;\n\n if (!onFixedColumn) {\n horizontalOffset = spreaderOffset.left;\n } else {\n horizontalOffset = absoluteRootElementPosition.left <= 0 ? -1 * absoluteRootElementPosition.left : 0;\n }\n\n if (onFixedRowTop) {\n var absoluteOverlayPosition = this.clone.wtTable.TABLE.getBoundingClientRect();\n verticalOffset = absoluteOverlayPosition.top - absoluteRootElementPosition.top;\n } else {\n verticalOffset = spreaderOffset.top;\n }\n\n return {\n left: elementOffset.left + horizontalOffset,\n top: elementOffset.top + verticalOffset\n };\n }\n /**\n * Calculates coordinates of the provided element, relative to the root Handsontable element within a table with window\n * as a scrollable element.\n *\n * @private\n * @param {boolean} onFixedRowTop `true` if the coordinates point to a place within the top fixed rows.\n * @param {boolean} onFixedRowBottom `true` if the coordinates point to a place within the bottom fixed rows.\n * @param {boolean} onFixedColumn `true` if the coordinates point to a place within the fixed columns.\n * @param {number} elementOffset Offset position of the cell element.\n * @param {number} spreaderOffset Offset position of the spreader element.\n * @returns {{top: number, left: number}}\n */\n\n }, {\n key: \"getRelativeCellPositionWithinHolder\",\n value: function getRelativeCellPositionWithinHolder(onFixedRowTop, onFixedRowBottom, onFixedColumn, elementOffset, spreaderOffset) {\n var tableScrollPosition = {\n horizontal: this.clone.cloneSource.wtOverlays.leftOverlay.getScrollPosition(),\n vertical: this.clone.cloneSource.wtOverlays.topOverlay.getScrollPosition()\n };\n var horizontalOffset = 0;\n var verticalOffset = 0;\n\n if (!onFixedColumn) {\n horizontalOffset = tableScrollPosition.horizontal - spreaderOffset.left;\n }\n\n if (onFixedRowBottom) {\n var absoluteRootElementPosition = this.wot.wtTable.wtRootElement.getBoundingClientRect();\n var absoluteOverlayPosition = this.clone.wtTable.TABLE.getBoundingClientRect();\n verticalOffset = absoluteOverlayPosition.top * -1 + absoluteRootElementPosition.top;\n } else if (!onFixedRowTop) {\n verticalOffset = tableScrollPosition.vertical - spreaderOffset.top;\n }\n\n return {\n left: elementOffset.left - horizontalOffset,\n top: elementOffset.top - verticalOffset\n };\n }\n /**\n * Make a clone of table for overlay.\n *\n * @param {string} direction Can be `Overlay.CLONE_TOP`, `Overlay.CLONE_LEFT`,\n * `Overlay.CLONE_TOP_LEFT_CORNER`.\n * @returns {Walkontable}\n */\n\n }, {\n key: \"makeClone\",\n value: function makeClone(direction) {\n if (CLONE_TYPES.indexOf(direction) === -1) {\n throw new Error(\"Clone type \\\"\".concat(direction, \"\\\" is not supported.\"));\n }\n\n var _this$wot2 = this.wot,\n wtTable = _this$wot2.wtTable,\n rootDocument = _this$wot2.rootDocument,\n rootWindow = _this$wot2.rootWindow;\n var clone = rootDocument.createElement('DIV');\n var clonedTable = rootDocument.createElement('TABLE');\n var tableParent = wtTable.wtRootElement.parentNode;\n clone.className = \"ht_clone_\".concat(direction, \" handsontable\");\n clone.style.position = 'absolute';\n clone.style.top = 0;\n clone.style.left = 0;\n clone.style.overflow = 'visible';\n clonedTable.className = wtTable.TABLE.className;\n clone.appendChild(clonedTable);\n this.type = direction;\n tableParent.appendChild(clone);\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (preventOverflow === true || preventOverflow === 'horizontal' && this.type === CLONE_TOP || preventOverflow === 'vertical' && this.type === CLONE_LEFT) {\n this.mainTableScrollableElement = rootWindow;\n } else if (rootWindow.getComputedStyle(tableParent).getPropertyValue('overflow') === 'hidden') {\n this.mainTableScrollableElement = wtTable.holder;\n } else {\n this.mainTableScrollableElement = getScrollableElement(wtTable.TABLE);\n } // Create a new instance of the Walkontable class\n\n\n return new this.wot.constructor({\n cloneSource: this.wot,\n cloneOverlay: this,\n table: clonedTable\n });\n }\n /**\n * Refresh/Redraw overlay.\n *\n * @param {boolean} [fastDraw=false] When `true`, try to refresh only the positions of borders without rerendering\n * the data. It will only work if Table.draw() does not force\n * rendering anyway.\n */\n\n }, {\n key: \"refresh\",\n value: function refresh() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n // When hot settings are changed we allow to refresh overlay once before blocking\n var nextCycleRenderFlag = this.shouldBeRendered();\n\n if (this.clone && (this.needFullRender || nextCycleRenderFlag)) {\n this.clone.draw(fastDraw);\n }\n\n this.needFullRender = nextCycleRenderFlag;\n }\n /**\n * Reset overlay styles to initial values.\n */\n\n }, {\n key: \"reset\",\n value: function reset() {\n if (!this.clone) {\n return;\n }\n\n var holder = this.clone.wtTable.holder;\n var hider = this.clone.wtTable.hider;\n var holderStyle = holder.style;\n var hidderStyle = hider.style;\n var rootStyle = holder.parentNode.style;\n arrayEach([holderStyle, hidderStyle, rootStyle], function (style) {\n style.width = '';\n style.height = '';\n });\n }\n /**\n * Destroy overlay instance.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n new EventManager(this.clone).destroy();\n }\n }]);\n\n return Overlay;\n}();","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { getScrollbarWidth, outerHeight, outerWidth, resetCssTransform } from \"./../../../../helpers/dom/element.mjs\";\nimport BottomLeftCornerOverlayTable from \"./../table/bottomLeftCorner.mjs\";\nimport { Overlay } from \"./_base.mjs\";\nimport { CLONE_BOTTOM_LEFT_CORNER } from \"./constants.mjs\";\n/**\n * @class TopLeftCornerOverlay\n */\n\nexport var BottomLeftCornerOverlay = /*#__PURE__*/function (_Overlay) {\n _inherits(BottomLeftCornerOverlay, _Overlay);\n\n var _super = _createSuper(BottomLeftCornerOverlay);\n\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n */\n function BottomLeftCornerOverlay(wotInstance) {\n var _this;\n\n _classCallCheck(this, BottomLeftCornerOverlay);\n\n _this = _super.call(this, wotInstance);\n _this.clone = _this.makeClone(CLONE_BOTTOM_LEFT_CORNER);\n return _this;\n }\n /**\n * Factory method to create a subclass of `Table` that is relevant to this overlay.\n *\n * @see Table#constructor\n * @param {...*} args Parameters that will be forwarded to the `Table` constructor.\n * @returns {Table}\n */\n\n\n _createClass(BottomLeftCornerOverlay, [{\n key: \"createTable\",\n value: function createTable() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _construct(BottomLeftCornerOverlayTable, args);\n }\n /**\n * Checks if overlay should be fully rendered.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"shouldBeRendered\",\n value: function shouldBeRendered() {\n var wot = this.wot;\n return wot.getSetting('shouldRenderBottomOverlay') && wot.getSetting('shouldRenderLeftOverlay');\n }\n /**\n * Updates the corner overlay position.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"resetFixedPosition\",\n value: function resetFixedPosition() {\n var wot = this.wot;\n this.updateTrimmingContainer();\n\n if (!wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n overlayRoot.style.top = '';\n\n if (this.trimmingContainer === wot.rootWindow) {\n var _this$wot = this.wot,\n rootDocument = _this$wot.rootDocument,\n wtTable = _this$wot.wtTable;\n var hiderRect = wtTable.hider.getBoundingClientRect();\n var bottom = Math.ceil(hiderRect.bottom);\n var left = Math.ceil(hiderRect.left);\n var bodyHeight = rootDocument.documentElement.clientHeight;\n var finalLeft;\n var finalBottom;\n\n if (left < 0) {\n finalLeft = -left;\n } else {\n finalLeft = 0;\n }\n\n if (bottom > bodyHeight) {\n finalBottom = bottom - bodyHeight;\n } else {\n finalBottom = 0;\n }\n\n finalBottom += 'px';\n finalLeft += 'px';\n overlayRoot.style.left = finalLeft;\n overlayRoot.style.bottom = finalBottom;\n } else {\n resetCssTransform(overlayRoot);\n this.repositionOverlay();\n }\n\n var tableHeight = outerHeight(this.clone.wtTable.TABLE);\n var tableWidth = outerWidth(this.clone.wtTable.TABLE);\n\n if (!this.wot.wtTable.hasDefinedSize()) {\n tableHeight = 0;\n }\n\n overlayRoot.style.height = \"\".concat(tableHeight, \"px\");\n overlayRoot.style.width = \"\".concat(tableWidth, \"px\");\n return false;\n }\n /**\n * Reposition the overlay.\n */\n\n }, {\n key: \"repositionOverlay\",\n value: function repositionOverlay() {\n var _this$wot2 = this.wot,\n wtTable = _this$wot2.wtTable,\n rootDocument = _this$wot2.rootDocument;\n var cloneRoot = this.clone.wtTable.holder.parentNode;\n var scrollbarWidth = getScrollbarWidth(rootDocument);\n\n if (wtTable.holder.clientHeight === wtTable.holder.offsetHeight) {\n scrollbarWidth = 0;\n }\n\n cloneRoot.style.bottom = \"\".concat(scrollbarWidth, \"px\");\n }\n }], [{\n key: \"OVERLAY_NAME\",\n get: function get() {\n return CLONE_BOTTOM_LEFT_CORNER;\n }\n }]);\n\n return BottomLeftCornerOverlay;\n}(Overlay);","import { defineGetter } from \"../../../../../helpers/object.mjs\";\nvar MIXIN_NAME = 'calculatedColumns';\n/**\n * Mixin for the subclasses of `Table` with implementations of\n * helper methods that are related to columns.\n * This mixin is meant to be applied in the subclasses of `Table`\n * that use virtual rendering in the horizontal axis.\n *\n * @type {object}\n */\n\nvar calculatedColumns = {\n /**\n * Get the source index of the first rendered column. If no columns are rendered, returns an error code: -1.\n *\n * @returns {number}\n */\n getFirstRenderedColumn: function getFirstRenderedColumn() {\n var startColumn = this.wot.wtViewport.columnsRenderCalculator.startColumn;\n\n if (startColumn === null) {\n return -1;\n }\n\n return startColumn;\n },\n\n /**\n * Get the source index of the first column fully visible in the viewport. If no columns are fully visible, returns an error code: -1.\n *\n * @returns {number}\n */\n getFirstVisibleColumn: function getFirstVisibleColumn() {\n var startColumn = this.wot.wtViewport.columnsVisibleCalculator.startColumn;\n\n if (startColumn === null) {\n return -1;\n }\n\n return startColumn;\n },\n\n /**\n * Get the source index of the last rendered column. If no columns are rendered, returns an error code: -1.\n *\n * @returns {number}\n */\n getLastRenderedColumn: function getLastRenderedColumn() {\n var endColumn = this.wot.wtViewport.columnsRenderCalculator.endColumn;\n\n if (endColumn === null) {\n return -1;\n }\n\n return endColumn;\n },\n\n /**\n * Get the source index of the last column fully visible in the viewport. If no columns are fully visible, returns an error code: -1.\n *\n * @returns {number}\n */\n getLastVisibleColumn: function getLastVisibleColumn() {\n var endColumn = this.wot.wtViewport.columnsVisibleCalculator.endColumn;\n\n if (endColumn === null) {\n return -1;\n }\n\n return endColumn;\n },\n\n /**\n * Get the number of rendered columns.\n *\n * @returns {number}\n */\n getRenderedColumnsCount: function getRenderedColumnsCount() {\n return this.wot.wtViewport.columnsRenderCalculator.count;\n },\n\n /**\n * Get the number of fully visible columns in the viewport.\n *\n * @returns {number}\n */\n getVisibleColumnsCount: function getVisibleColumnsCount() {\n return this.wot.wtViewport.columnsVisibleCalculator.count;\n }\n};\ndefineGetter(calculatedColumns, 'MIXIN_NAME', MIXIN_NAME, {\n writable: false,\n enumerable: false\n});\nexport default calculatedColumns;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport Table from \"../table.mjs\";\nimport stickyRowsBottom from \"./mixin/stickyRowsBottom.mjs\";\nimport calculatedColumns from \"./mixin/calculatedColumns.mjs\";\nimport { mixin } from \"./../../../../helpers/object.mjs\";\n/**\n * Subclass of `Table` that provides the helper methods relevant to BottomOverlay, implemented through mixins.\n */\n\nvar BottomOverlayTable = /*#__PURE__*/function (_Table) {\n _inherits(BottomOverlayTable, _Table);\n\n var _super = _createSuper(BottomOverlayTable);\n\n function BottomOverlayTable() {\n _classCallCheck(this, BottomOverlayTable);\n\n return _super.apply(this, arguments);\n }\n\n return BottomOverlayTable;\n}(Table);\n\nmixin(BottomOverlayTable, stickyRowsBottom);\nmixin(BottomOverlayTable, calculatedColumns);\nexport default BottomOverlayTable;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { addClass, getScrollbarWidth, getScrollTop, getWindowScrollLeft, hasClass, outerHeight, removeClass } from \"./../../../../helpers/dom/element.mjs\";\nimport BottomOverlayTable from \"./../table/bottom.mjs\";\nimport { Overlay } from \"./_base.mjs\";\nimport { CLONE_BOTTOM } from \"./constants.mjs\";\n/**\n * @class BottomOverlay\n */\n\nexport var BottomOverlay = /*#__PURE__*/function (_Overlay) {\n _inherits(BottomOverlay, _Overlay);\n\n var _super = _createSuper(BottomOverlay);\n\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n */\n function BottomOverlay(wotInstance) {\n var _this;\n\n _classCallCheck(this, BottomOverlay);\n\n _this = _super.call(this, wotInstance);\n\n _defineProperty(_assertThisInitialized(_this), \"cachedFixedRowsBottom\", -1);\n\n _this.clone = _this.makeClone(CLONE_BOTTOM);\n _this.cachedFixedRowsBottom = _this.wot.getSetting('fixedRowsBottom');\n return _this;\n }\n /**\n * Factory method to create a subclass of `Table` that is relevant to this overlay.\n *\n * @see Table#constructor\n * @param {...*} args Parameters that will be forwarded to the `Table` constructor.\n * @returns {Table}\n */\n\n\n _createClass(BottomOverlay, [{\n key: \"createTable\",\n value: function createTable() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _construct(BottomOverlayTable, args);\n }\n /**\n * Checks if overlay should be fully rendered.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"shouldBeRendered\",\n value: function shouldBeRendered() {\n return this.wot.getSetting('shouldRenderBottomOverlay');\n }\n /**\n * Updates the top overlay position.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"resetFixedPosition\",\n value: function resetFixedPosition() {\n if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n overlayRoot.style.top = '';\n var headerPosition = 0;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === this.wot.rootWindow && (!preventOverflow || preventOverflow !== 'vertical')) {\n var _this$wot = this.wot,\n rootDocument = _this$wot.rootDocument,\n wtTable = _this$wot.wtTable;\n var hiderRect = wtTable.hider.getBoundingClientRect();\n var bottom = Math.ceil(hiderRect.bottom);\n var bodyHeight = rootDocument.documentElement.clientHeight;\n var finalLeft;\n var finalBottom;\n finalLeft = wtTable.hider.style.left;\n finalLeft = finalLeft === '' ? 0 : finalLeft;\n\n if (bottom > bodyHeight) {\n finalBottom = bottom - bodyHeight;\n } else {\n finalBottom = 0;\n }\n\n headerPosition = finalBottom;\n finalBottom += 'px';\n overlayRoot.style.left = finalLeft;\n overlayRoot.style.bottom = finalBottom;\n } else {\n headerPosition = this.getScrollPosition();\n this.repositionOverlay();\n }\n\n var positionChanged = this.adjustHeaderBordersPosition(headerPosition);\n this.adjustElementsSize();\n return positionChanged;\n }\n /**\n * Updates the bottom overlay position.\n */\n\n }, {\n key: \"repositionOverlay\",\n value: function repositionOverlay() {\n var _this$wot2 = this.wot,\n wtTable = _this$wot2.wtTable,\n rootDocument = _this$wot2.rootDocument;\n var cloneRoot = this.clone.wtTable.holder.parentNode;\n var scrollbarWidth = getScrollbarWidth(rootDocument);\n\n if (wtTable.holder.clientHeight === wtTable.holder.offsetHeight) {\n scrollbarWidth = 0;\n }\n\n cloneRoot.style.bottom = \"\".concat(scrollbarWidth, \"px\");\n }\n /**\n * Sets the main overlay's vertical scroll position.\n *\n * @param {number} pos The scroll position.\n * @returns {boolean}\n */\n\n }, {\n key: \"setScrollPosition\",\n value: function setScrollPosition(pos) {\n var rootWindow = this.wot.rootWindow;\n var result = false;\n\n if (this.mainTableScrollableElement === rootWindow) {\n rootWindow.scrollTo(getWindowScrollLeft(rootWindow), pos);\n result = true;\n } else if (this.mainTableScrollableElement.scrollTop !== pos) {\n this.mainTableScrollableElement.scrollTop = pos;\n result = true;\n }\n\n return result;\n }\n /**\n * Triggers onScroll hook callback.\n */\n\n }, {\n key: \"onScroll\",\n value: function onScroll() {\n this.wot.getSetting('onScrollHorizontally');\n }\n /**\n * Calculates total sum cells height.\n *\n * @param {number} from Row index which calculates started from.\n * @param {number} to Row index where calculation is finished.\n * @returns {number} Height sum.\n */\n\n }, {\n key: \"sumCellSizes\",\n value: function sumCellSizes(from, to) {\n var _this$wot3 = this.wot,\n wtTable = _this$wot3.wtTable,\n wtSettings = _this$wot3.wtSettings;\n var defaultRowHeight = wtSettings.settings.defaultRowHeight;\n var row = from;\n var sum = 0;\n\n while (row < to) {\n var height = wtTable.getRowHeight(row);\n sum += height === void 0 ? defaultRowHeight : height;\n row += 1;\n }\n\n return sum;\n }\n /**\n * Adjust overlay root element, childs and master table element sizes (width, height).\n *\n * @param {boolean} [force=false] When `true`, it adjusts the DOM nodes sizes for that overlay.\n */\n\n }, {\n key: \"adjustElementsSize\",\n value: function adjustElementsSize() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n this.updateTrimmingContainer();\n\n if (this.needFullRender || force) {\n this.adjustRootElementSize();\n this.adjustRootChildrenSize();\n }\n }\n /**\n * Adjust overlay root element size (width and height).\n */\n\n }, {\n key: \"adjustRootElementSize\",\n value: function adjustRootElementSize() {\n var _this$wot4 = this.wot,\n wtTable = _this$wot4.wtTable,\n wtViewport = _this$wot4.wtViewport,\n rootWindow = _this$wot4.rootWindow;\n var scrollbarWidth = getScrollbarWidth(this.wot.rootDocument);\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var overlayRootStyle = overlayRoot.style;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer !== rootWindow || preventOverflow === 'horizontal') {\n var width = wtViewport.getWorkspaceWidth();\n\n if (this.wot.wtOverlays.hasScrollbarRight) {\n width -= scrollbarWidth;\n }\n\n width = Math.min(width, wtTable.wtRootElement.scrollWidth);\n overlayRootStyle.width = \"\".concat(width, \"px\");\n } else {\n overlayRootStyle.width = '';\n }\n\n this.clone.wtTable.holder.style.width = overlayRootStyle.width;\n var tableHeight = outerHeight(this.clone.wtTable.TABLE);\n\n if (!this.wot.wtTable.hasDefinedSize()) {\n tableHeight = 0;\n }\n\n overlayRootStyle.height = \"\".concat(tableHeight, \"px\");\n }\n /**\n * Adjust overlay root childs size.\n */\n\n }, {\n key: \"adjustRootChildrenSize\",\n value: function adjustRootChildrenSize() {\n var holder = this.clone.wtTable.holder;\n this.clone.wtTable.hider.style.width = this.hider.style.width;\n holder.style.width = holder.parentNode.style.width;\n holder.style.height = holder.parentNode.style.height;\n }\n /**\n * Adjust the overlay dimensions and position.\n */\n\n }, {\n key: \"applyToDOM\",\n value: function applyToDOM() {\n var total = this.wot.getSetting('totalRows');\n\n if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {\n this.spreader.style.top = \"\".concat(this.wot.wtViewport.rowsRenderCalculator.startPosition, \"px\");\n } else if (total === 0) {\n // can happen if there are 0 rows\n this.spreader.style.top = '0';\n } else {\n throw new Error('Incorrect value of the rowsRenderCalculator');\n }\n\n this.spreader.style.bottom = '';\n\n if (this.needFullRender) {\n this.syncOverlayOffset();\n }\n }\n /**\n * Synchronize calculated left position to an element.\n */\n\n }, {\n key: \"syncOverlayOffset\",\n value: function syncOverlayOffset() {\n if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {\n this.clone.wtTable.spreader.style.left = \"\".concat(this.wot.wtViewport.columnsRenderCalculator.startPosition, \"px\");\n } else {\n this.clone.wtTable.spreader.style.left = '';\n }\n }\n /**\n * Scrolls vertically to a row.\n *\n * @param {number} sourceRow Row index which you want to scroll to.\n * @param {boolean} [bottomEdge=false] If `true`, scrolls according to the bottom edge (top edge is by default).\n */\n\n }, {\n key: \"scrollTo\",\n value: function scrollTo(sourceRow, bottomEdge) {\n var newY = this.getTableParentOffset();\n var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;\n var mainHolder = sourceInstance.wtTable.holder;\n var scrollbarCompensation = 0;\n\n if (bottomEdge && mainHolder.offsetHeight !== mainHolder.clientHeight) {\n scrollbarCompensation = getScrollbarWidth(this.wot.rootDocument);\n }\n\n if (bottomEdge) {\n newY += this.sumCellSizes(0, sourceRow + 1);\n newY -= this.wot.wtViewport.getViewportHeight(); // Fix 1 pixel offset when cell is selected\n\n newY += 1;\n } else {\n newY += this.sumCellSizes(this.wot.getSetting('fixedRowsBottom'), sourceRow);\n }\n\n newY += scrollbarCompensation;\n this.setScrollPosition(newY);\n }\n /**\n * Gets table parent top position.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getTableParentOffset\",\n value: function getTableParentOffset() {\n if (this.mainTableScrollableElement === this.wot.rootWindow) {\n return this.wot.wtTable.holderOffset.top;\n }\n\n return 0;\n }\n /**\n * Gets the main overlay's vertical scroll position.\n *\n * @returns {number} Main table's vertical scroll position.\n */\n\n }, {\n key: \"getScrollPosition\",\n value: function getScrollPosition() {\n return getScrollTop(this.mainTableScrollableElement, this.wot.rootWindow);\n }\n /**\n * Adds css classes to hide the header border's header (cell-selection border hiding issue).\n *\n * @param {number} position Header Y position if trimming container is window or scroll top if not.\n * @returns {boolean}\n */\n\n }, {\n key: \"adjustHeaderBordersPosition\",\n value: function adjustHeaderBordersPosition(position) {\n var fixedRowsBottom = this.wot.getSetting('fixedRowsBottom');\n var areFixedRowsBottomChanged = this.cachedFixedRowsBottom !== fixedRowsBottom;\n var columnHeaders = this.wot.getSetting('columnHeaders');\n var positionChanged = false;\n\n if ((areFixedRowsBottomChanged || fixedRowsBottom === 0) && columnHeaders.length > 0) {\n var masterParent = this.wot.wtTable.holder.parentNode;\n var previousState = hasClass(masterParent, 'innerBorderBottom');\n this.cachedFixedRowsBottom = this.wot.getSetting('fixedRowsBottom');\n\n if (position || this.wot.getSetting('totalRows') === 0) {\n addClass(masterParent, 'innerBorderBottom');\n positionChanged = !previousState;\n } else {\n removeClass(masterParent, 'innerBorderBottom');\n positionChanged = previousState;\n }\n }\n\n return positionChanged;\n }\n }], [{\n key: \"OVERLAY_NAME\",\n get: function get() {\n return CLONE_BOTTOM;\n }\n /**\n * Cached value which holds the previous value of the `fixedRowsBottom` option.\n * It is used as a comparison value that can be used to detect changes in that value.\n *\n * @type {number}\n */\n\n }]);\n\n return BottomOverlay;\n}(Overlay);","import { defineGetter } from \"../../../../../helpers/object.mjs\";\nvar MIXIN_NAME = 'calculatedRows';\n/**\n * Mixin for the subclasses of `Table` with implementations of\n * helper methods that are related to rows.\n * This mixin is meant to be applied in the subclasses of `Table`\n * that use virtual rendering in the vertical axis.\n *\n * @type {object}\n */\n\nvar calculatedRows = {\n /**\n * Get the source index of the first rendered row. If no rows are rendered, returns an error code: -1.\n *\n * @returns {number}\n */\n getFirstRenderedRow: function getFirstRenderedRow() {\n var startRow = this.wot.wtViewport.rowsRenderCalculator.startRow;\n\n if (startRow === null) {\n return -1;\n }\n\n return startRow;\n },\n\n /**\n * Get the source index of the first row fully visible in the viewport. If no rows are fully visible, returns an error code: -1.\n *\n * @returns {number}\n */\n getFirstVisibleRow: function getFirstVisibleRow() {\n var startRow = this.wot.wtViewport.rowsVisibleCalculator.startRow;\n\n if (startRow === null) {\n return -1;\n }\n\n return startRow;\n },\n\n /**\n * Get the source index of the last rendered row. If no rows are rendered, returns an error code: -1.\n *\n * @returns {number}\n */\n getLastRenderedRow: function getLastRenderedRow() {\n var endRow = this.wot.wtViewport.rowsRenderCalculator.endRow;\n\n if (endRow === null) {\n return -1;\n }\n\n return endRow;\n },\n\n /**\n * Get the source index of the last row fully visible in the viewport. If no rows are fully visible, returns an error code: -1.\n *\n * @returns {number}\n */\n getLastVisibleRow: function getLastVisibleRow() {\n var endRow = this.wot.wtViewport.rowsVisibleCalculator.endRow;\n\n if (endRow === null) {\n return -1;\n }\n\n return endRow;\n },\n\n /**\n * Get the number of rendered rows.\n *\n * @returns {number}\n */\n getRenderedRowsCount: function getRenderedRowsCount() {\n return this.wot.wtViewport.rowsRenderCalculator.count;\n },\n\n /**\n * Get the number of fully visible rows in the viewport.\n *\n * @returns {number}\n */\n getVisibleRowsCount: function getVisibleRowsCount() {\n return this.wot.wtViewport.rowsVisibleCalculator.count;\n }\n};\ndefineGetter(calculatedRows, 'MIXIN_NAME', MIXIN_NAME, {\n writable: false,\n enumerable: false\n});\nexport default calculatedRows;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport Table from \"../table.mjs\";\nimport calculatedRows from \"./mixin/calculatedRows.mjs\";\nimport stickyColumnsLeft from \"./mixin/stickyColumnsLeft.mjs\";\nimport { mixin } from \"./../../../../helpers/object.mjs\";\n/**\n * Subclass of `Table` that provides the helper methods relevant to LeftOverlay, implemented through mixins.\n */\n\nvar LeftOverlayTable = /*#__PURE__*/function (_Table) {\n _inherits(LeftOverlayTable, _Table);\n\n var _super = _createSuper(LeftOverlayTable);\n\n function LeftOverlayTable() {\n _classCallCheck(this, LeftOverlayTable);\n\n return _super.apply(this, arguments);\n }\n\n return LeftOverlayTable;\n}(Table);\n\nmixin(LeftOverlayTable, calculatedRows);\nmixin(LeftOverlayTable, stickyColumnsLeft);\nexport default LeftOverlayTable;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { addClass, getScrollbarWidth, getScrollLeft, getWindowScrollTop, hasClass, outerWidth, removeClass, setOverlayPosition, resetCssTransform } from \"./../../../../helpers/dom/element.mjs\";\nimport LeftOverlayTable from \"./../table/left.mjs\";\nimport { Overlay } from \"./_base.mjs\";\nimport { CLONE_LEFT } from \"./constants.mjs\";\n/**\n * @class LeftOverlay\n */\n\nexport var LeftOverlay = /*#__PURE__*/function (_Overlay) {\n _inherits(LeftOverlay, _Overlay);\n\n var _super = _createSuper(LeftOverlay);\n\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n */\n function LeftOverlay(wotInstance) {\n var _this;\n\n _classCallCheck(this, LeftOverlay);\n\n _this = _super.call(this, wotInstance);\n _this.clone = _this.makeClone(CLONE_LEFT);\n return _this;\n }\n /**\n * Factory method to create a subclass of `Table` that is relevant to this overlay.\n *\n * @see Table#constructor\n * @param {...*} args Parameters that will be forwarded to the `Table` constructor.\n * @returns {Table}\n */\n\n\n _createClass(LeftOverlay, [{\n key: \"createTable\",\n value: function createTable() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _construct(LeftOverlayTable, args);\n }\n /**\n * Checks if overlay should be fully rendered.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"shouldBeRendered\",\n value: function shouldBeRendered() {\n return this.wot.getSetting('shouldRenderLeftOverlay');\n }\n /**\n * Updates the left overlay position.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"resetFixedPosition\",\n value: function resetFixedPosition() {\n var wtTable = this.wot.wtTable;\n\n if (!this.needFullRender || !wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var headerPosition = 0;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === this.wot.rootWindow && (!preventOverflow || preventOverflow !== 'horizontal')) {\n var hiderRect = wtTable.hider.getBoundingClientRect();\n var left = Math.ceil(hiderRect.left);\n var right = Math.ceil(hiderRect.right);\n var finalLeft;\n var finalTop;\n finalTop = wtTable.hider.style.top;\n finalTop = finalTop === '' ? 0 : finalTop;\n\n if (left < 0 && right - overlayRoot.offsetWidth > 0) {\n finalLeft = -left;\n } else {\n finalLeft = 0;\n }\n\n headerPosition = finalLeft;\n finalLeft += 'px';\n setOverlayPosition(overlayRoot, finalLeft, finalTop);\n } else {\n headerPosition = this.getScrollPosition();\n resetCssTransform(overlayRoot);\n }\n\n var positionChanged = this.adjustHeaderBordersPosition(headerPosition);\n this.adjustElementsSize();\n return positionChanged;\n }\n /**\n * Sets the main overlay's horizontal scroll position.\n *\n * @param {number} pos The scroll position.\n * @returns {boolean}\n */\n\n }, {\n key: \"setScrollPosition\",\n value: function setScrollPosition(pos) {\n var rootWindow = this.wot.rootWindow;\n var result = false;\n\n if (this.mainTableScrollableElement === rootWindow && rootWindow.scrollX !== pos) {\n rootWindow.scrollTo(pos, getWindowScrollTop(rootWindow));\n result = true;\n } else if (this.mainTableScrollableElement.scrollLeft !== pos) {\n this.mainTableScrollableElement.scrollLeft = pos;\n result = true;\n }\n\n return result;\n }\n /**\n * Triggers onScroll hook callback.\n */\n\n }, {\n key: \"onScroll\",\n value: function onScroll() {\n this.wot.getSetting('onScrollVertically');\n }\n /**\n * Calculates total sum cells width.\n *\n * @param {number} from Column index which calculates started from.\n * @param {number} to Column index where calculation is finished.\n * @returns {number} Width sum.\n */\n\n }, {\n key: \"sumCellSizes\",\n value: function sumCellSizes(from, to) {\n var defaultColumnWidth = this.wot.wtSettings.defaultColumnWidth;\n var column = from;\n var sum = 0;\n\n while (column < to) {\n sum += this.wot.wtTable.getStretchedColumnWidth(column) || defaultColumnWidth;\n column += 1;\n }\n\n return sum;\n }\n /**\n * Adjust overlay root element, childs and master table element sizes (width, height).\n *\n * @param {boolean} [force=false] When `true`, it adjusts the DOM nodes sizes for that overlay.\n */\n\n }, {\n key: \"adjustElementsSize\",\n value: function adjustElementsSize() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n this.updateTrimmingContainer();\n\n if (this.needFullRender || force) {\n this.adjustRootElementSize();\n this.adjustRootChildrenSize();\n }\n }\n /**\n * Adjust overlay root element size (width and height).\n */\n\n }, {\n key: \"adjustRootElementSize\",\n value: function adjustRootElementSize() {\n var _this$wot = this.wot,\n wtTable = _this$wot.wtTable,\n rootDocument = _this$wot.rootDocument,\n rootWindow = _this$wot.rootWindow;\n var scrollbarHeight = getScrollbarWidth(rootDocument);\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var overlayRootStyle = overlayRoot.style;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer !== rootWindow || preventOverflow === 'vertical') {\n var height = this.wot.wtViewport.getWorkspaceHeight();\n\n if (this.wot.wtOverlays.hasScrollbarBottom) {\n height -= scrollbarHeight;\n }\n\n height = Math.min(height, wtTable.wtRootElement.scrollHeight);\n overlayRootStyle.height = \"\".concat(height, \"px\");\n } else {\n overlayRootStyle.height = '';\n }\n\n this.clone.wtTable.holder.style.height = overlayRootStyle.height;\n var tableWidth = outerWidth(this.clone.wtTable.TABLE);\n overlayRootStyle.width = \"\".concat(tableWidth, \"px\");\n }\n /**\n * Adjust overlay root childs size.\n */\n\n }, {\n key: \"adjustRootChildrenSize\",\n value: function adjustRootChildrenSize() {\n var _selections$getCell$g;\n\n var holder = this.clone.wtTable.holder;\n var selections = this.wot.selections;\n var selectionCornerOffset = Math.abs((_selections$getCell$g = selections === null || selections === void 0 ? void 0 : selections.getCell().getBorder(this.wot).cornerCenterPointOffset) !== null && _selections$getCell$g !== void 0 ? _selections$getCell$g : 0);\n this.clone.wtTable.hider.style.height = this.hider.style.height;\n holder.style.height = holder.parentNode.style.height; // Add selection corner protruding part to the holder total width to make sure that\n // borders' corner won't be cut after horizontal scroll (#6937).\n\n holder.style.width = \"\".concat(parseInt(holder.parentNode.style.width, 10) + selectionCornerOffset, \"px\");\n }\n /**\n * Adjust the overlay dimensions and position.\n */\n\n }, {\n key: \"applyToDOM\",\n value: function applyToDOM() {\n var total = this.wot.getSetting('totalColumns');\n\n if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {\n this.spreader.style.left = \"\".concat(this.wot.wtViewport.columnsRenderCalculator.startPosition, \"px\");\n } else if (total === 0) {\n this.spreader.style.left = '0';\n } else {\n throw new Error('Incorrect value of the columnsRenderCalculator');\n }\n\n this.spreader.style.right = '';\n\n if (this.needFullRender) {\n this.syncOverlayOffset();\n }\n }\n /**\n * Synchronize calculated top position to an element.\n */\n\n }, {\n key: \"syncOverlayOffset\",\n value: function syncOverlayOffset() {\n if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {\n this.clone.wtTable.spreader.style.top = \"\".concat(this.wot.wtViewport.rowsRenderCalculator.startPosition, \"px\");\n } else {\n this.clone.wtTable.spreader.style.top = '';\n }\n }\n /**\n * Scrolls horizontally to a column at the left edge of the viewport.\n *\n * @param {number} sourceCol Column index which you want to scroll to.\n * @param {boolean} [beyondRendered] If `true`, scrolls according to the bottom\n * edge (top edge is by default).\n * @returns {boolean}\n */\n\n }, {\n key: \"scrollTo\",\n value: function scrollTo(sourceCol, beyondRendered) {\n var newX = this.getTableParentOffset();\n var sourceInstance = this.wot.cloneSource ? this.wot.cloneSource : this.wot;\n var mainHolder = sourceInstance.wtTable.holder;\n var scrollbarCompensation = 0;\n\n if (beyondRendered && mainHolder.offsetWidth !== mainHolder.clientWidth) {\n scrollbarCompensation = getScrollbarWidth(this.wot.rootDocument);\n }\n\n if (beyondRendered) {\n newX += this.sumCellSizes(0, sourceCol + 1);\n newX -= this.wot.wtViewport.getViewportWidth();\n } else {\n newX += this.sumCellSizes(this.wot.getSetting('fixedColumnsLeft'), sourceCol);\n }\n\n newX += scrollbarCompensation;\n return this.setScrollPosition(newX);\n }\n /**\n * Gets table parent left position.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getTableParentOffset\",\n value: function getTableParentOffset() {\n var preventOverflow = this.wot.getSetting('preventOverflow');\n var offset = 0;\n\n if (!preventOverflow && this.trimmingContainer === this.wot.rootWindow) {\n offset = this.wot.wtTable.holderOffset.left;\n }\n\n return offset;\n }\n /**\n * Gets the main overlay's horizontal scroll position.\n *\n * @returns {number} Main table's vertical scroll position.\n */\n\n }, {\n key: \"getScrollPosition\",\n value: function getScrollPosition() {\n return getScrollLeft(this.mainTableScrollableElement, this.wot.rootWindow);\n }\n /**\n * Adds css classes to hide the header border's header (cell-selection border hiding issue).\n *\n * @param {number} position Header X position if trimming container is window or scroll top if not.\n * @returns {boolean}\n */\n\n }, {\n key: \"adjustHeaderBordersPosition\",\n value: function adjustHeaderBordersPosition(position) {\n var masterParent = this.wot.wtTable.holder.parentNode;\n var rowHeaders = this.wot.getSetting('rowHeaders');\n var fixedColumnsLeft = this.wot.getSetting('fixedColumnsLeft');\n var totalRows = this.wot.getSetting('totalRows');\n\n if (totalRows) {\n removeClass(masterParent, 'emptyRows');\n } else {\n addClass(masterParent, 'emptyRows');\n }\n\n var positionChanged = false;\n\n if (fixedColumnsLeft && !rowHeaders.length) {\n addClass(masterParent, 'innerBorderLeft');\n } else if (!fixedColumnsLeft && rowHeaders.length) {\n var previousState = hasClass(masterParent, 'innerBorderLeft');\n\n if (position) {\n addClass(masterParent, 'innerBorderLeft');\n positionChanged = !previousState;\n } else {\n removeClass(masterParent, 'innerBorderLeft');\n positionChanged = previousState;\n }\n }\n\n return positionChanged;\n }\n }], [{\n key: \"OVERLAY_NAME\",\n get: function get() {\n return CLONE_LEFT;\n }\n }]);\n\n return LeftOverlay;\n}(Overlay);","import { defineGetter } from \"../../../../../helpers/object.mjs\";\nvar MIXIN_NAME = 'stickyRowsTop';\n/**\n * Mixin for the subclasses of `Table` with implementations of\n * helper methods that are related to rows.\n * This mixin is meant to be applied in the subclasses of `Table`\n * that use sticky rendering of the top rows in the vertical axis.\n *\n * @type {object}\n */\n\nvar stickyRowsTop = {\n /**\n * Get the source index of the first rendered row. If no rows are rendered, returns an error code: -1.\n *\n * @returns {number}\n */\n getFirstRenderedRow: function getFirstRenderedRow() {\n var totalRows = this.wot.getSetting('totalRows');\n\n if (totalRows === 0) {\n return -1;\n }\n\n return 0;\n },\n\n /**\n * Get the source index of the first row fully visible in the viewport. If no rows are fully visible, returns an error code: -1.\n * Assumes that all rendered rows are fully visible.\n *\n * @returns {number}\n */\n getFirstVisibleRow: function getFirstVisibleRow() {\n return this.getFirstRenderedRow();\n },\n\n /**\n * Get the source index of the last rendered row. If no rows are rendered, returns an error code: -1.\n *\n * @returns {number}\n */\n getLastRenderedRow: function getLastRenderedRow() {\n return this.getRenderedRowsCount() - 1;\n },\n\n /**\n * Get the source index of the last row fully visible in the viewport. If no rows are fully visible, returns an error code: -1.\n * Assumes that all rendered rows are fully visible.\n *\n * @returns {number}\n */\n getLastVisibleRow: function getLastVisibleRow() {\n return this.getLastRenderedRow();\n },\n\n /**\n * Get the number of rendered rows.\n *\n * @returns {number}\n */\n getRenderedRowsCount: function getRenderedRowsCount() {\n var totalRows = this.wot.getSetting('totalRows');\n return Math.min(this.wot.getSetting('fixedRowsTop'), totalRows);\n },\n\n /**\n * Get the number of fully visible rows in the viewport.\n * Assumes that all rendered rows are fully visible.\n *\n * @returns {number}\n */\n getVisibleRowsCount: function getVisibleRowsCount() {\n return this.getRenderedRowsCount();\n }\n};\ndefineGetter(stickyRowsTop, 'MIXIN_NAME', MIXIN_NAME, {\n writable: false,\n enumerable: false\n});\nexport default stickyRowsTop;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport Table from \"../table.mjs\";\nimport stickyRowsTop from \"./mixin/stickyRowsTop.mjs\";\nimport stickyColumnsLeft from \"./mixin/stickyColumnsLeft.mjs\";\nimport { mixin } from \"./../../../../helpers/object.mjs\";\n/**\n * Subclass of `Table` that provides the helper methods relevant to TopLeftCornerOverlay, implemented through mixins.\n */\n\nvar TopLeftCornerOverlayTable = /*#__PURE__*/function (_Table) {\n _inherits(TopLeftCornerOverlayTable, _Table);\n\n var _super = _createSuper(TopLeftCornerOverlayTable);\n\n function TopLeftCornerOverlayTable() {\n _classCallCheck(this, TopLeftCornerOverlayTable);\n\n return _super.apply(this, arguments);\n }\n\n return TopLeftCornerOverlayTable;\n}(Table);\n\nmixin(TopLeftCornerOverlayTable, stickyRowsTop);\nmixin(TopLeftCornerOverlayTable, stickyColumnsLeft);\nexport default TopLeftCornerOverlayTable;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { outerHeight, outerWidth, setOverlayPosition, resetCssTransform } from \"./../../../../helpers/dom/element.mjs\";\nimport TopLeftCornerOverlayTable from \"./../table/topLeftCorner.mjs\";\nimport { Overlay } from \"./_base.mjs\";\nimport { CLONE_TOP_LEFT_CORNER } from \"./constants.mjs\";\n/**\n * @class TopLeftCornerOverlay\n */\n\nexport var TopLeftCornerOverlay = /*#__PURE__*/function (_Overlay) {\n _inherits(TopLeftCornerOverlay, _Overlay);\n\n var _super = _createSuper(TopLeftCornerOverlay);\n\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n */\n function TopLeftCornerOverlay(wotInstance) {\n var _this;\n\n _classCallCheck(this, TopLeftCornerOverlay);\n\n _this = _super.call(this, wotInstance);\n _this.clone = _this.makeClone(CLONE_TOP_LEFT_CORNER);\n return _this;\n }\n /**\n * Factory method to create a subclass of `Table` that is relevant to this overlay.\n *\n * @see Table#constructor\n * @param {...*} args Parameters that will be forwarded to the `Table` constructor.\n * @returns {Table}\n */\n\n\n _createClass(TopLeftCornerOverlay, [{\n key: \"createTable\",\n value: function createTable() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _construct(TopLeftCornerOverlayTable, args);\n }\n /**\n * Checks if overlay should be fully rendered.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"shouldBeRendered\",\n value: function shouldBeRendered() {\n var wot = this.wot;\n return wot.getSetting('shouldRenderTopOverlay') && wot.getSetting('shouldRenderLeftOverlay');\n }\n /**\n * Updates the corner overlay position.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"resetFixedPosition\",\n value: function resetFixedPosition() {\n this.updateTrimmingContainer();\n\n if (!this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer === this.wot.rootWindow) {\n var wtTable = this.wot.wtTable;\n var hiderRect = wtTable.hider.getBoundingClientRect();\n var top = Math.ceil(hiderRect.top);\n var left = Math.ceil(hiderRect.left);\n var bottom = Math.ceil(hiderRect.bottom);\n var right = Math.ceil(hiderRect.right);\n var finalLeft = '0';\n var finalTop = '0';\n\n if (!preventOverflow || preventOverflow === 'vertical') {\n if (left < 0 && right - overlayRoot.offsetWidth > 0) {\n finalLeft = \"\".concat(-left, \"px\");\n }\n }\n\n if (!preventOverflow || preventOverflow === 'horizontal') {\n if (top < 0 && bottom - overlayRoot.offsetHeight > 0) {\n finalTop = \"\".concat(-top, \"px\");\n }\n }\n\n setOverlayPosition(overlayRoot, finalLeft, finalTop);\n } else {\n resetCssTransform(overlayRoot);\n }\n\n var tableHeight = outerHeight(this.clone.wtTable.TABLE);\n var tableWidth = outerWidth(this.clone.wtTable.TABLE);\n\n if (!this.wot.wtTable.hasDefinedSize()) {\n tableHeight = 0;\n }\n\n overlayRoot.style.height = \"\".concat(tableHeight, \"px\");\n overlayRoot.style.width = \"\".concat(tableWidth, \"px\");\n return false;\n }\n }], [{\n key: \"OVERLAY_NAME\",\n get: function get() {\n return CLONE_TOP_LEFT_CORNER;\n }\n }]);\n\n return TopLeftCornerOverlay;\n}(Overlay);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport Table from \"../table.mjs\";\nimport stickyRowsTop from \"./mixin/stickyRowsTop.mjs\";\nimport calculatedColumns from \"./mixin/calculatedColumns.mjs\";\nimport { mixin } from \"./../../../../helpers/object.mjs\";\n/**\n * Subclass of `Table` that provides the helper methods relevant to TopOverlay, implemented through mixins.\n */\n\nvar TopOverlayTable = /*#__PURE__*/function (_Table) {\n _inherits(TopOverlayTable, _Table);\n\n var _super = _createSuper(TopOverlayTable);\n\n function TopOverlayTable() {\n _classCallCheck(this, TopOverlayTable);\n\n return _super.apply(this, arguments);\n }\n\n return TopOverlayTable;\n}(Table);\n\nmixin(TopOverlayTable, stickyRowsTop);\nmixin(TopOverlayTable, calculatedColumns);\nexport default TopOverlayTable;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { addClass, getScrollbarWidth, getScrollTop, getWindowScrollLeft, hasClass, outerHeight, removeClass, setOverlayPosition, resetCssTransform } from \"./../../../../helpers/dom/element.mjs\";\nimport TopOverlayTable from \"./../table/top.mjs\";\nimport { Overlay } from \"./_base.mjs\";\nimport { CLONE_TOP } from \"./constants.mjs\";\n/**\n * @class TopOverlay\n */\n\nexport var TopOverlay = /*#__PURE__*/function (_Overlay) {\n _inherits(TopOverlay, _Overlay);\n\n var _super = _createSuper(TopOverlay);\n\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n */\n function TopOverlay(wotInstance) {\n var _this;\n\n _classCallCheck(this, TopOverlay);\n\n _this = _super.call(this, wotInstance);\n\n _defineProperty(_assertThisInitialized(_this), \"cachedFixedRowsTop\", -1);\n\n _this.clone = _this.makeClone(CLONE_TOP);\n _this.cachedFixedRowsTop = _this.wot.getSetting('fixedRowsTop');\n return _this;\n }\n /**\n * Factory method to create a subclass of `Table` that is relevant to this overlay.\n *\n * @see Table#constructor\n * @param {...*} args Parameters that will be forwarded to the `Table` constructor.\n * @returns {Table}\n */\n\n\n _createClass(TopOverlay, [{\n key: \"createTable\",\n value: function createTable() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _construct(TopOverlayTable, args);\n }\n /**\n * Checks if overlay should be fully rendered.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"shouldBeRendered\",\n value: function shouldBeRendered() {\n return this.wot.getSetting('shouldRenderTopOverlay');\n }\n /**\n * Updates the top overlay position.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"resetFixedPosition\",\n value: function resetFixedPosition() {\n if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {\n // removed from DOM\n return;\n }\n\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n var headerPosition = 0;\n var skipInnerBorderAdjusting = false;\n\n if (this.trimmingContainer === this.wot.rootWindow && (!preventOverflow || preventOverflow !== 'vertical')) {\n var wtTable = this.wot.wtTable;\n var hiderRect = wtTable.hider.getBoundingClientRect();\n var top = Math.ceil(hiderRect.top);\n var bottom = Math.ceil(hiderRect.bottom);\n var rootHeight = overlayRoot.offsetHeight; // This checks if the overlay is going to an infinite loop caused by added (or removed)\n // `innerBorderTop` class name. Toggling the class name shifts the viewport by 1px and\n // triggers the `scroll` event. It causes the table to render. The new render cycle takes into,\n // account the shift and toggles the class name again. This causes the next loops. This\n // happens only on Chrome (#7256).\n //\n // When we detect that the table bottom position is the same as the overlay bottom,\n // do not toggle the class name.\n //\n // This workaround will be able to be cleared after merging the SVG borders, which introduces\n // frozen lines (no more `innerBorderTop` workaround).\n\n skipInnerBorderAdjusting = bottom === rootHeight;\n var finalLeft;\n var finalTop;\n finalLeft = wtTable.hider.style.left;\n finalLeft = finalLeft === '' ? 0 : finalLeft;\n\n if (top < 0 && bottom - rootHeight > 0) {\n finalTop = -top;\n } else {\n finalTop = 0;\n }\n\n headerPosition = finalTop;\n finalTop += 'px';\n setOverlayPosition(overlayRoot, finalLeft, finalTop);\n } else {\n headerPosition = this.getScrollPosition();\n resetCssTransform(overlayRoot);\n }\n\n var positionChanged = this.adjustHeaderBordersPosition(headerPosition, skipInnerBorderAdjusting);\n this.adjustElementsSize();\n return positionChanged;\n }\n /**\n * Sets the main overlay's vertical scroll position.\n *\n * @param {number} pos The scroll position.\n * @returns {boolean}\n */\n\n }, {\n key: \"setScrollPosition\",\n value: function setScrollPosition(pos) {\n var rootWindow = this.wot.rootWindow;\n var result = false;\n\n if (this.mainTableScrollableElement === rootWindow && rootWindow.scrollY !== pos) {\n rootWindow.scrollTo(getWindowScrollLeft(rootWindow), pos);\n result = true;\n } else if (this.mainTableScrollableElement.scrollTop !== pos) {\n this.mainTableScrollableElement.scrollTop = pos;\n result = true;\n }\n\n return result;\n }\n /**\n * Triggers onScroll hook callback.\n */\n\n }, {\n key: \"onScroll\",\n value: function onScroll() {\n this.wot.getSetting('onScrollHorizontally');\n }\n /**\n * Calculates total sum cells height.\n *\n * @param {number} from Row index which calculates started from.\n * @param {number} to Row index where calculation is finished.\n * @returns {number} Height sum.\n */\n\n }, {\n key: \"sumCellSizes\",\n value: function sumCellSizes(from, to) {\n var defaultRowHeight = this.wot.wtSettings.settings.defaultRowHeight;\n var row = from;\n var sum = 0;\n\n while (row < to) {\n var height = this.wot.wtTable.getRowHeight(row);\n sum += height === void 0 ? defaultRowHeight : height;\n row += 1;\n }\n\n return sum;\n }\n /**\n * Adjust overlay root element, childs and master table element sizes (width, height).\n *\n * @param {boolean} [force=false] When `true`, it adjusts the DOM nodes sizes for that overlay.\n */\n\n }, {\n key: \"adjustElementsSize\",\n value: function adjustElementsSize() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n this.updateTrimmingContainer();\n\n if (this.needFullRender || force) {\n this.adjustRootElementSize();\n this.adjustRootChildrenSize();\n }\n }\n /**\n * Adjust overlay root element size (width and height).\n */\n\n }, {\n key: \"adjustRootElementSize\",\n value: function adjustRootElementSize() {\n var _this$wot = this.wot,\n wtTable = _this$wot.wtTable,\n rootDocument = _this$wot.rootDocument,\n rootWindow = _this$wot.rootWindow;\n var scrollbarWidth = getScrollbarWidth(rootDocument);\n var overlayRoot = this.clone.wtTable.holder.parentNode;\n var overlayRootStyle = overlayRoot.style;\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (this.trimmingContainer !== rootWindow || preventOverflow === 'horizontal') {\n var width = this.wot.wtViewport.getWorkspaceWidth();\n\n if (this.wot.wtOverlays.hasScrollbarRight) {\n width -= scrollbarWidth;\n }\n\n width = Math.min(width, wtTable.wtRootElement.scrollWidth);\n overlayRootStyle.width = \"\".concat(width, \"px\");\n } else {\n overlayRootStyle.width = '';\n }\n\n this.clone.wtTable.holder.style.width = overlayRootStyle.width;\n var tableHeight = outerHeight(this.clone.wtTable.TABLE);\n\n if (!this.wot.wtTable.hasDefinedSize()) {\n tableHeight = 0;\n }\n\n overlayRootStyle.height = \"\".concat(tableHeight, \"px\");\n }\n /**\n * Adjust overlay root childs size.\n */\n\n }, {\n key: \"adjustRootChildrenSize\",\n value: function adjustRootChildrenSize() {\n var _selections$getCell$g;\n\n var holder = this.clone.wtTable.holder;\n var selections = this.wot.selections;\n var selectionCornerOffset = Math.abs((_selections$getCell$g = selections === null || selections === void 0 ? void 0 : selections.getCell().getBorder(this.wot).cornerCenterPointOffset) !== null && _selections$getCell$g !== void 0 ? _selections$getCell$g : 0);\n this.clone.wtTable.hider.style.width = this.hider.style.width;\n holder.style.width = holder.parentNode.style.width; // Add selection corner protruding part to the holder total height to make sure that\n // borders' corner won't be cut after vertical scroll (#6937).\n\n holder.style.height = \"\".concat(parseInt(holder.parentNode.style.height, 10) + selectionCornerOffset, \"px\");\n }\n /**\n * Adjust the overlay dimensions and position.\n */\n\n }, {\n key: \"applyToDOM\",\n value: function applyToDOM() {\n var total = this.wot.getSetting('totalRows');\n\n if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {\n this.spreader.style.top = \"\".concat(this.wot.wtViewport.rowsRenderCalculator.startPosition, \"px\");\n } else if (total === 0) {\n // can happen if there are 0 rows\n this.spreader.style.top = '0';\n } else {\n throw new Error('Incorrect value of the rowsRenderCalculator');\n }\n\n this.spreader.style.bottom = '';\n\n if (this.needFullRender) {\n this.syncOverlayOffset();\n }\n }\n /**\n * Synchronize calculated left position to an element.\n */\n\n }, {\n key: \"syncOverlayOffset\",\n value: function syncOverlayOffset() {\n if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {\n this.clone.wtTable.spreader.style.left = \"\".concat(this.wot.wtViewport.columnsRenderCalculator.startPosition, \"px\");\n } else {\n this.clone.wtTable.spreader.style.left = '';\n }\n }\n /**\n * Scrolls vertically to a row.\n *\n * @param {number} sourceRow Row index which you want to scroll to.\n * @param {boolean} [bottomEdge] If `true`, scrolls according to the bottom edge (top edge is by default).\n * @returns {boolean}\n */\n\n }, {\n key: \"scrollTo\",\n value: function scrollTo(sourceRow, bottomEdge) {\n var wot = this.wot;\n var sourceInstance = wot.cloneSource ? wot.cloneSource : wot;\n var mainHolder = sourceInstance.wtTable.holder;\n var newY = this.getTableParentOffset();\n var scrollbarCompensation = 0;\n\n if (bottomEdge && mainHolder.offsetHeight !== mainHolder.clientHeight) {\n scrollbarCompensation = getScrollbarWidth(wot.rootDocument);\n }\n\n if (bottomEdge) {\n var fixedRowsBottom = wot.getSetting('fixedRowsBottom');\n var totalRows = wot.getSetting('totalRows');\n newY += this.sumCellSizes(0, sourceRow + 1);\n newY -= wot.wtViewport.getViewportHeight() - this.sumCellSizes(totalRows - fixedRowsBottom, totalRows); // Fix 1 pixel offset when cell is selected\n\n newY += 1;\n } else {\n newY += this.sumCellSizes(wot.getSetting('fixedRowsTop'), sourceRow);\n }\n\n newY += scrollbarCompensation;\n return this.setScrollPosition(newY);\n }\n /**\n * Gets table parent top position.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getTableParentOffset\",\n value: function getTableParentOffset() {\n if (this.mainTableScrollableElement === this.wot.rootWindow) {\n return this.wot.wtTable.holderOffset.top;\n }\n\n return 0;\n }\n /**\n * Gets the main overlay's vertical scroll position.\n *\n * @returns {number} Main table's vertical scroll position.\n */\n\n }, {\n key: \"getScrollPosition\",\n value: function getScrollPosition() {\n return getScrollTop(this.mainTableScrollableElement, this.wot.rootWindow);\n }\n /**\n * Adds css classes to hide the header border's header (cell-selection border hiding issue).\n *\n * @param {number} position Header Y position if trimming container is window or scroll top if not.\n * @param {boolean} [skipInnerBorderAdjusting=false] If `true` the inner border adjusting will be skipped.\n * @returns {boolean}\n */\n\n }, {\n key: \"adjustHeaderBordersPosition\",\n value: function adjustHeaderBordersPosition(position) {\n var skipInnerBorderAdjusting = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var masterParent = this.wot.wtTable.holder.parentNode;\n var totalColumns = this.wot.getSetting('totalColumns');\n\n if (totalColumns) {\n removeClass(masterParent, 'emptyColumns');\n } else {\n addClass(masterParent, 'emptyColumns');\n }\n\n var positionChanged = false;\n\n if (!skipInnerBorderAdjusting) {\n var fixedRowsTop = this.wot.getSetting('fixedRowsTop');\n var areFixedRowsTopChanged = this.cachedFixedRowsTop !== fixedRowsTop;\n var columnHeaders = this.wot.getSetting('columnHeaders');\n\n if ((areFixedRowsTopChanged || fixedRowsTop === 0) && columnHeaders.length > 0) {\n var previousState = hasClass(masterParent, 'innerBorderTop');\n this.cachedFixedRowsTop = this.wot.getSetting('fixedRowsTop');\n\n if (position || this.wot.getSetting('totalRows') === 0) {\n addClass(masterParent, 'innerBorderTop');\n positionChanged = !previousState;\n } else {\n removeClass(masterParent, 'innerBorderTop');\n positionChanged = previousState;\n }\n }\n } // nasty workaround for double border in the header, TODO: find a pure-css solution\n\n\n if (this.wot.getSetting('rowHeaders').length === 0) {\n var secondHeaderCell = this.clone.wtTable.THEAD.querySelectorAll('th:nth-of-type(2)');\n\n if (secondHeaderCell) {\n for (var i = 0; i < secondHeaderCell.length; i++) {\n secondHeaderCell[i].style['border-left-width'] = 0;\n }\n }\n }\n\n return positionChanged;\n }\n }], [{\n key: \"OVERLAY_NAME\",\n get: function get() {\n return CLONE_TOP;\n }\n /**\n * Cached value which holds the previous value of the `fixedRowsTop` option.\n * It is used as a comparison value that can be used to detect changes in this value.\n *\n * @type {number}\n */\n\n }]);\n\n return TopOverlay;\n}(Overlay);","import \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/web.timers.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { getScrollableElement, getScrollbarWidth } from \"./../../../helpers/dom/element.mjs\";\nimport { arrayEach } from \"./../../../helpers/array.mjs\";\nimport { isKey } from \"./../../../helpers/unicode.mjs\";\nimport { isChrome } from \"./../../../helpers/browser.mjs\";\nimport EventManager from \"./../../../eventManager.mjs\";\nimport { CLONE_BOTTOM_LEFT_CORNER, CLONE_BOTTOM, CLONE_LEFT, CLONE_TOP_LEFT_CORNER, CLONE_TOP, LeftOverlay, TopOverlay, TopLeftCornerOverlay, BottomOverlay, BottomLeftCornerOverlay, registerOverlayOnce, createOverlay, hasOverlay } from \"./overlay/index.mjs\";\nregisterOverlayOnce(BottomLeftCornerOverlay);\nregisterOverlayOnce(BottomOverlay);\nregisterOverlayOnce(LeftOverlay);\nregisterOverlayOnce(TopLeftCornerOverlay);\nregisterOverlayOnce(TopOverlay);\n/**\n * @class Overlays\n */\n\nvar Overlays = /*#__PURE__*/function () {\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n */\n function Overlays(wotInstance) {\n _classCallCheck(this, Overlays);\n\n /**\n * Walkontable instance's reference.\n *\n * @private\n * @type {Walkontable}\n */\n this.wot = wotInstance;\n var _this$wot = this.wot,\n rootDocument = _this$wot.rootDocument,\n rootWindow = _this$wot.rootWindow,\n wtTable = _this$wot.wtTable;\n /**\n * Sometimes `line-height` might be set to 'normal'. In that case, a default `font-size` should be multiplied by roughly 1.2.\n * Https://developer.mozilla.org/pl/docs/Web/CSS/line-height#Values.\n */\n\n var BODY_LINE_HEIGHT = parseInt(rootWindow.getComputedStyle(rootDocument.body).lineHeight, 10);\n var FALLBACK_BODY_LINE_HEIGHT = parseInt(rootWindow.getComputedStyle(rootDocument.body).fontSize, 10) * 1.2; // legacy support\n\n this.instance = this.wot;\n this.eventManager = new EventManager(this.wot);\n this.scrollbarSize = getScrollbarWidth(rootDocument);\n this.wot.update('scrollbarWidth', this.scrollbarSize);\n this.wot.update('scrollbarHeight', this.scrollbarSize);\n var isOverflowHidden = rootWindow.getComputedStyle(wtTable.wtRootElement.parentNode).getPropertyValue('overflow') === 'hidden';\n this.scrollableElement = isOverflowHidden ? wtTable.holder : getScrollableElement(wtTable.TABLE);\n this.topOverlay = void 0;\n this.bottomOverlay = void 0;\n this.leftOverlay = void 0;\n this.topLeftCornerOverlay = void 0;\n this.bottomLeftCornerOverlay = void 0;\n this.prepareOverlays();\n this.hasScrollbarBottom = false;\n this.hasScrollbarRight = false;\n this.destroyed = false;\n this.keyPressed = false;\n this.spreaderLastSize = {\n width: null,\n height: null\n };\n this.verticalScrolling = false;\n this.horizontalScrolling = false;\n this.browserLineHeight = BODY_LINE_HEIGHT || FALLBACK_BODY_LINE_HEIGHT;\n this.registerListeners();\n this.lastScrollX = rootWindow.scrollX;\n this.lastScrollY = rootWindow.scrollY;\n }\n /**\n * Prepare overlays based on user settings.\n *\n * @returns {boolean} Returns `true` if changes applied to overlay needs scroll synchronization.\n */\n\n\n _createClass(Overlays, [{\n key: \"prepareOverlays\",\n value: function prepareOverlays() {\n var syncScroll = false;\n\n if (this.topOverlay) {\n syncScroll = this.topOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.topOverlay = createOverlay(CLONE_TOP, this.wot);\n }\n\n if (!hasOverlay(CLONE_BOTTOM)) {\n this.bottomOverlay = {\n needFullRender: false,\n updateStateOfRendering: function updateStateOfRendering() {\n return false;\n }\n };\n }\n\n if (!hasOverlay(CLONE_BOTTOM_LEFT_CORNER)) {\n this.bottomLeftCornerOverlay = {\n needFullRender: false,\n updateStateOfRendering: function updateStateOfRendering() {\n return false;\n }\n };\n }\n\n if (this.bottomOverlay) {\n syncScroll = this.bottomOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.bottomOverlay = createOverlay(CLONE_BOTTOM, this.wot);\n }\n\n if (this.leftOverlay) {\n syncScroll = this.leftOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.leftOverlay = createOverlay(CLONE_LEFT, this.wot);\n }\n\n if (this.topOverlay.needFullRender && this.leftOverlay.needFullRender) {\n if (this.topLeftCornerOverlay) {\n syncScroll = this.topLeftCornerOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.topLeftCornerOverlay = createOverlay(CLONE_TOP_LEFT_CORNER, this.wot);\n }\n }\n\n if (this.bottomOverlay.needFullRender && this.leftOverlay.needFullRender) {\n if (this.bottomLeftCornerOverlay) {\n syncScroll = this.bottomLeftCornerOverlay.updateStateOfRendering() || syncScroll;\n } else {\n this.bottomLeftCornerOverlay = createOverlay(CLONE_BOTTOM_LEFT_CORNER, this.wot);\n }\n }\n\n return syncScroll;\n }\n /**\n * Refresh and redraw table.\n */\n\n }, {\n key: \"refreshAll\",\n value: function refreshAll() {\n if (!this.wot.drawn) {\n return;\n }\n\n if (!this.wot.wtTable.holder.parentNode) {\n // Walkontable was detached from DOM, but this handler was not removed\n this.destroy();\n return;\n }\n\n this.wot.draw(true);\n\n if (this.verticalScrolling) {\n this.leftOverlay.onScroll();\n }\n\n if (this.horizontalScrolling) {\n this.topOverlay.onScroll();\n }\n\n this.verticalScrolling = false;\n this.horizontalScrolling = false;\n }\n /**\n * Register all necessary event listeners.\n */\n\n }, {\n key: \"registerListeners\",\n value: function registerListeners() {\n var _this = this;\n\n var _this$wot2 = this.wot,\n rootDocument = _this$wot2.rootDocument,\n rootWindow = _this$wot2.rootWindow;\n var topOverlayScrollableElement = this.topOverlay.mainTableScrollableElement;\n var leftOverlayScrollableElement = this.leftOverlay.mainTableScrollableElement;\n this.eventManager.addEventListener(rootDocument.documentElement, 'keydown', function (event) {\n return _this.onKeyDown(event);\n });\n this.eventManager.addEventListener(rootDocument.documentElement, 'keyup', function () {\n return _this.onKeyUp();\n });\n this.eventManager.addEventListener(rootDocument, 'visibilitychange', function () {\n return _this.onKeyUp();\n });\n this.eventManager.addEventListener(topOverlayScrollableElement, 'scroll', function (event) {\n return _this.onTableScroll(event);\n }, {\n passive: true\n });\n\n if (topOverlayScrollableElement !== leftOverlayScrollableElement) {\n this.eventManager.addEventListener(leftOverlayScrollableElement, 'scroll', function (event) {\n return _this.onTableScroll(event);\n }, {\n passive: true\n });\n }\n\n var isHighPixelRatio = rootWindow.devicePixelRatio && rootWindow.devicePixelRatio > 1;\n var isScrollOnWindow = this.scrollableElement === rootWindow;\n var preventWheel = this.wot.wtSettings.getSetting('preventWheel');\n var wheelEventOptions = {\n passive: isScrollOnWindow\n };\n\n if (preventWheel || isHighPixelRatio || !isChrome()) {\n this.eventManager.addEventListener(this.wot.wtTable.wtRootElement, 'wheel', function (event) {\n return _this.onCloneWheel(event, preventWheel);\n }, wheelEventOptions);\n }\n\n var overlays = [this.topOverlay, this.bottomOverlay, this.leftOverlay, this.topLeftCornerOverlay, this.bottomLeftCornerOverlay];\n overlays.forEach(function (overlay) {\n if (overlay && overlay.needFullRender) {\n var holder = overlay.clone.wtTable.holder;\n\n _this.eventManager.addEventListener(holder, 'wheel', function (event) {\n return _this.onCloneWheel(event, preventWheel);\n }, wheelEventOptions);\n }\n });\n var resizeTimeout;\n this.eventManager.addEventListener(rootWindow, 'resize', function () {\n clearTimeout(resizeTimeout);\n resizeTimeout = setTimeout(function () {\n _this.wot.getSetting('onWindowResize');\n }, 200);\n });\n }\n /**\n * Deregister all previously registered listeners.\n */\n\n }, {\n key: \"deregisterListeners\",\n value: function deregisterListeners() {\n this.eventManager.clearEvents(true);\n }\n /**\n * Scroll listener.\n *\n * @param {Event} event The mouse event object.\n */\n\n }, {\n key: \"onTableScroll\",\n value: function onTableScroll(event) {\n // There was if statement which controlled flow of this function. It avoided the execution of the next lines\n // on mobile devices. It was changed. Broader description of this case is included within issue #4856.\n var rootWindow = this.wot.rootWindow;\n var masterHorizontal = this.leftOverlay.mainTableScrollableElement;\n var masterVertical = this.topOverlay.mainTableScrollableElement;\n var target = event.target; // For key press, sync only master -> overlay position because while pressing Walkontable.render is triggered\n // by hot.refreshBorder\n\n if (this.keyPressed) {\n if (masterVertical !== rootWindow && target !== rootWindow && !event.target.contains(masterVertical) || masterHorizontal !== rootWindow && target !== rootWindow && !event.target.contains(masterHorizontal)) {\n return;\n }\n }\n\n this.syncScrollPositions(event);\n }\n /**\n * Wheel listener for cloned overlays.\n *\n * @param {Event} event The mouse event object.\n * @param {boolean} preventDefault If `true`, the `preventDefault` will be called on event object.\n */\n\n }, {\n key: \"onCloneWheel\",\n value: function onCloneWheel(event, preventDefault) {\n var rootWindow = this.wot.rootWindow; // There was if statement which controlled flow of this function. It avoided the execution of the next lines\n // on mobile devices. It was changed. Broader description of this case is included within issue #4856.\n\n var masterHorizontal = this.leftOverlay.mainTableScrollableElement;\n var masterVertical = this.topOverlay.mainTableScrollableElement;\n var target = event.target; // For key press, sync only master -> overlay position because while pressing Walkontable.render is triggered\n // by hot.refreshBorder\n\n var shouldNotWheelVertically = masterVertical !== rootWindow && target !== rootWindow && !target.contains(masterVertical);\n var shouldNotWheelHorizontally = masterHorizontal !== rootWindow && target !== rootWindow && !target.contains(masterHorizontal);\n\n if (this.keyPressed && (shouldNotWheelVertically || shouldNotWheelHorizontally)) {\n return;\n }\n\n var isScrollPossible = this.translateMouseWheelToScroll(event);\n\n if (preventDefault || this.scrollableElement !== rootWindow && isScrollPossible) {\n event.preventDefault();\n }\n }\n /**\n * Key down listener.\n *\n * @param {Event} event The keyboard event object.\n */\n\n }, {\n key: \"onKeyDown\",\n value: function onKeyDown(event) {\n this.keyPressed = isKey(event.keyCode, 'ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT');\n }\n /**\n * Key up listener.\n */\n\n }, {\n key: \"onKeyUp\",\n value: function onKeyUp() {\n this.keyPressed = false;\n }\n /**\n * Translate wheel event into scroll event and sync scroll overlays position.\n *\n * @private\n * @param {Event} event The mouse event object.\n * @returns {boolean}\n */\n\n }, {\n key: \"translateMouseWheelToScroll\",\n value: function translateMouseWheelToScroll(event) {\n var browserLineHeight = this.browserLineHeight;\n var deltaY = isNaN(event.deltaY) ? -1 * event.wheelDeltaY : event.deltaY;\n var deltaX = isNaN(event.deltaX) ? -1 * event.wheelDeltaX : event.deltaX;\n\n if (event.deltaMode === 1) {\n deltaX += deltaX * browserLineHeight;\n deltaY += deltaY * browserLineHeight;\n }\n\n var isScrollVerticallyPossible = this.scrollVertically(deltaY);\n var isScrollHorizontallyPossible = this.scrollHorizontally(deltaX);\n return isScrollVerticallyPossible || isScrollHorizontallyPossible;\n }\n /**\n * Scrolls main scrollable element horizontally.\n *\n * @param {number} delta Relative value to scroll.\n * @returns {boolean}\n */\n\n }, {\n key: \"scrollVertically\",\n value: function scrollVertically(delta) {\n var previousScroll = this.scrollableElement.scrollTop;\n this.scrollableElement.scrollTop += delta;\n return previousScroll !== this.scrollableElement.scrollTop;\n }\n /**\n * Scrolls main scrollable element horizontally.\n *\n * @param {number} delta Relative value to scroll.\n * @returns {boolean}\n */\n\n }, {\n key: \"scrollHorizontally\",\n value: function scrollHorizontally(delta) {\n var previousScroll = this.scrollableElement.scrollLeft;\n this.scrollableElement.scrollLeft += delta;\n return previousScroll !== this.scrollableElement.scrollLeft;\n }\n /**\n * Synchronize scroll position between master table and overlay table.\n *\n * @private\n */\n\n }, {\n key: \"syncScrollPositions\",\n value: function syncScrollPositions() {\n if (this.destroyed) {\n return;\n }\n\n var rootWindow = this.wot.rootWindow;\n var topHolder = this.topOverlay.clone.wtTable.holder;\n var leftHolder = this.leftOverlay.clone.wtTable.holder;\n var _ref = [this.scrollableElement.scrollLeft, this.scrollableElement.scrollTop],\n scrollLeft = _ref[0],\n scrollTop = _ref[1];\n this.horizontalScrolling = topHolder.scrollLeft !== scrollLeft || this.lastScrollX !== rootWindow.scrollX;\n this.verticalScrolling = leftHolder.scrollTop !== scrollTop || this.lastScrollY !== rootWindow.scrollY;\n this.lastScrollX = rootWindow.scrollX;\n this.lastScrollY = rootWindow.scrollY;\n\n if (this.horizontalScrolling) {\n topHolder.scrollLeft = scrollLeft;\n var bottomHolder = this.bottomOverlay.needFullRender ? this.bottomOverlay.clone.wtTable.holder : null;\n\n if (bottomHolder) {\n bottomHolder.scrollLeft = scrollLeft;\n }\n }\n\n if (this.verticalScrolling) {\n leftHolder.scrollTop = scrollTop;\n }\n\n this.refreshAll();\n }\n /**\n * Synchronize overlay scrollbars with the master scrollbar.\n */\n\n }, {\n key: \"syncScrollWithMaster\",\n value: function syncScrollWithMaster() {\n var master = this.topOverlay.mainTableScrollableElement;\n var scrollLeft = master.scrollLeft,\n scrollTop = master.scrollTop;\n\n if (this.topOverlay.needFullRender) {\n this.topOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;\n }\n\n if (this.bottomOverlay.needFullRender) {\n this.bottomOverlay.clone.wtTable.holder.scrollLeft = scrollLeft;\n }\n\n if (this.leftOverlay.needFullRender) {\n this.leftOverlay.clone.wtTable.holder.scrollTop = scrollTop;\n }\n }\n /**\n * Update the main scrollable elements for all the overlays.\n */\n\n }, {\n key: \"updateMainScrollableElements\",\n value: function updateMainScrollableElements() {\n this.deregisterListeners();\n this.leftOverlay.updateMainScrollableElement();\n this.topOverlay.updateMainScrollableElement();\n\n if (this.bottomOverlay.needFullRender) {\n this.bottomOverlay.updateMainScrollableElement();\n }\n\n var _this$wot3 = this.wot,\n rootWindow = _this$wot3.rootWindow,\n wtTable = _this$wot3.wtTable;\n\n if (rootWindow.getComputedStyle(wtTable.wtRootElement.parentNode).getPropertyValue('overflow') === 'hidden') {\n this.scrollableElement = wtTable.holder;\n } else {\n this.scrollableElement = getScrollableElement(wtTable.TABLE);\n }\n\n this.registerListeners();\n }\n /**\n *\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.eventManager.destroy();\n this.topOverlay.destroy();\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.destroy();\n }\n\n this.leftOverlay.destroy();\n\n if (this.topLeftCornerOverlay) {\n this.topLeftCornerOverlay.destroy();\n }\n\n if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {\n this.bottomLeftCornerOverlay.destroy();\n }\n\n this.destroyed = true;\n }\n /**\n * @param {boolean} [fastDraw=false] When `true`, try to refresh only the positions of borders without rerendering\n * the data. It will only work if Table.draw() does not force\n * rendering anyway.\n */\n\n }, {\n key: \"refresh\",\n value: function refresh() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var spreader = this.wot.wtTable.spreader;\n var width = spreader.clientWidth;\n var height = spreader.clientHeight;\n\n if (width !== this.spreaderLastSize.width || height !== this.spreaderLastSize.height) {\n this.spreaderLastSize.width = width;\n this.spreaderLastSize.height = height;\n this.adjustElementsSize();\n }\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.refresh(fastDraw);\n }\n\n this.leftOverlay.refresh(fastDraw);\n this.topOverlay.refresh(fastDraw);\n\n if (this.topLeftCornerOverlay) {\n this.topLeftCornerOverlay.refresh(fastDraw);\n }\n\n if (this.bottomLeftCornerOverlay && this.bottomLeftCornerOverlay.clone) {\n this.bottomLeftCornerOverlay.refresh(fastDraw);\n }\n }\n /**\n * Adjust overlays elements size and master table size.\n *\n * @param {boolean} [force=false] When `true`, it adjust the DOM nodes sizes for all overlays.\n */\n\n }, {\n key: \"adjustElementsSize\",\n value: function adjustElementsSize() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var _this$wot4 = this.wot,\n wtViewport = _this$wot4.wtViewport,\n wtTable = _this$wot4.wtTable;\n var totalColumns = this.wot.getSetting('totalColumns');\n var totalRows = this.wot.getSetting('totalRows');\n var headerRowSize = wtViewport.getRowHeaderWidth();\n var headerColumnSize = wtViewport.getColumnHeaderHeight();\n var hiderStyle = wtTable.hider.style;\n hiderStyle.width = \"\".concat(headerRowSize + this.leftOverlay.sumCellSizes(0, totalColumns), \"px\");\n hiderStyle.height = \"\".concat(headerColumnSize + this.topOverlay.sumCellSizes(0, totalRows) + 1, \"px\");\n\n if (this.scrollbarSize > 0) {\n var _wtTable$wtRootElemen = wtTable.wtRootElement,\n rootElemScrollHeight = _wtTable$wtRootElemen.scrollHeight,\n rootElemScrollWidth = _wtTable$wtRootElemen.scrollWidth;\n var _wtTable$holder = wtTable.holder,\n holderScrollHeight = _wtTable$holder.scrollHeight,\n holderScrollWidth = _wtTable$holder.scrollWidth;\n this.hasScrollbarRight = rootElemScrollHeight < holderScrollHeight;\n this.hasScrollbarBottom = rootElemScrollWidth < holderScrollWidth;\n\n if (this.hasScrollbarRight && wtTable.hider.scrollWidth + this.scrollbarSize > rootElemScrollWidth) {\n this.hasScrollbarBottom = true;\n } else if (this.hasScrollbarBottom && wtTable.hider.scrollHeight + this.scrollbarSize > rootElemScrollHeight) {\n this.hasScrollbarRight = true;\n }\n }\n\n this.topOverlay.adjustElementsSize(force);\n this.leftOverlay.adjustElementsSize(force);\n this.bottomOverlay.adjustElementsSize(force);\n }\n /**\n *\n */\n\n }, {\n key: \"applyToDOM\",\n value: function applyToDOM() {\n var wtTable = this.wot.wtTable;\n\n if (!wtTable.isVisible()) {\n return;\n }\n\n this.topOverlay.applyToDOM();\n\n if (this.bottomOverlay.clone) {\n this.bottomOverlay.applyToDOM();\n }\n\n this.leftOverlay.applyToDOM();\n }\n /**\n * Get the parent overlay of the provided element.\n *\n * @param {HTMLElement} element An element to process.\n * @returns {object|null}\n */\n\n }, {\n key: \"getParentOverlay\",\n value: function getParentOverlay(element) {\n if (!element) {\n return null;\n }\n\n var overlays = [this.topOverlay, this.leftOverlay, this.bottomOverlay, this.topLeftCornerOverlay, this.bottomLeftCornerOverlay];\n var result = null;\n arrayEach(overlays, function (elem) {\n if (!elem) {\n return;\n }\n\n if (elem.clone && elem.clone.wtTable.TABLE.contains(element)) {\n result = elem.clone;\n }\n });\n return result;\n }\n /**\n * Synchronize the class names between the main overlay table and the tables on the other overlays.\n *\n */\n\n }, {\n key: \"syncOverlayTableClassNames\",\n value: function syncOverlayTableClassNames() {\n var masterTable = this.instance.wtTable.TABLE;\n var overlays = [this.topOverlay, this.leftOverlay, this.bottomOverlay, this.topLeftCornerOverlay, this.bottomLeftCornerOverlay];\n arrayEach(overlays, function (elem) {\n if (!elem) {\n return;\n }\n\n elem.clone.wtTable.TABLE.className = masterTable.className;\n });\n }\n }]);\n\n return Overlays;\n}();\n\nexport default Overlays;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { innerHeight, innerWidth, getScrollLeft, getScrollTop, offset } from \"./../../../helpers/dom/element.mjs\";\n/**\n * @class Scroll\n */\n\nvar Scroll = /*#__PURE__*/function () {\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n */\n function Scroll(wotInstance) {\n _classCallCheck(this, Scroll);\n\n this.wot = wotInstance;\n }\n /**\n * Scrolls viewport to a cell.\n *\n * @param {CellCoords} coords The cell coordinates.\n * @param {boolean} [snapToTop] If `true`, viewport is scrolled to show the cell on the top of the table.\n * @param {boolean} [snapToRight] If `true`, viewport is scrolled to show the cell on the right of the table.\n * @param {boolean} [snapToBottom] If `true`, viewport is scrolled to show the cell on the bottom of the table.\n * @param {boolean} [snapToLeft] If `true`, viewport is scrolled to show the cell on the left of the table.\n * @returns {boolean}\n */\n\n\n _createClass(Scroll, [{\n key: \"scrollViewport\",\n value: function scrollViewport(coords, snapToTop, snapToRight, snapToBottom, snapToLeft) {\n if (coords.col < 0 || coords.row < 0) {\n return false;\n }\n\n var scrolledHorizontally = this.scrollViewportHorizontally(coords.col, snapToRight, snapToLeft);\n var scrolledVertically = this.scrollViewportVertically(coords.row, snapToTop, snapToBottom);\n return scrolledHorizontally || scrolledVertically;\n }\n /**\n * Scrolls viewport to a column.\n *\n * @param {number} column Visual column index.\n * @param {boolean} [snapToRight] If `true`, viewport is scrolled to show the cell on the right of the table.\n * @param {boolean} [snapToLeft] If `true`, viewport is scrolled to show the cell on the left of the table.\n * @returns {boolean}\n */\n\n }, {\n key: \"scrollViewportHorizontally\",\n value: function scrollViewportHorizontally(column, snapToRight, snapToLeft) {\n if (!this.wot.drawn) {\n return false;\n }\n\n var _this$_getVariables = this._getVariables(),\n fixedColumnsLeft = _this$_getVariables.fixedColumnsLeft,\n leftOverlay = _this$_getVariables.leftOverlay,\n totalColumns = _this$_getVariables.totalColumns;\n\n var result = false;\n\n if (column >= 0 && column <= Math.max(totalColumns - 1, 0)) {\n var firstVisibleColumn = this.getFirstVisibleColumn();\n var lastVisibleColumn = this.getLastVisibleColumn();\n\n if (column >= fixedColumnsLeft && firstVisibleColumn > -1 && (column < firstVisibleColumn || snapToLeft)) {\n result = leftOverlay.scrollTo(column);\n } else if (lastVisibleColumn === -1 || lastVisibleColumn > -1 && (column > lastVisibleColumn || snapToRight)) {\n result = leftOverlay.scrollTo(column, true);\n }\n }\n\n return result;\n }\n /**\n * Scrolls viewport to a row.\n *\n * @param {number} row Visual row index.\n * @param {boolean} [snapToTop] If `true`, viewport is scrolled to show the cell on the top of the table.\n * @param {boolean} [snapToBottom] If `true`, viewport is scrolled to show the cell on the bottom of the table.\n * @returns {boolean}\n */\n\n }, {\n key: \"scrollViewportVertically\",\n value: function scrollViewportVertically(row, snapToTop, snapToBottom) {\n if (!this.wot.drawn) {\n return false;\n }\n\n var _this$_getVariables2 = this._getVariables(),\n fixedRowsBottom = _this$_getVariables2.fixedRowsBottom,\n fixedRowsTop = _this$_getVariables2.fixedRowsTop,\n topOverlay = _this$_getVariables2.topOverlay,\n totalRows = _this$_getVariables2.totalRows;\n\n var result = false;\n\n if (row >= 0 && row <= Math.max(totalRows - 1, 0)) {\n var firstVisibleRow = this.getFirstVisibleRow();\n var lastVisibleRow = this.getLastVisibleRow();\n\n if (row >= fixedRowsTop && firstVisibleRow > -1 && (row < firstVisibleRow || snapToTop)) {\n result = topOverlay.scrollTo(row);\n } else if (lastVisibleRow === -1 || lastVisibleRow > -1 && (row > lastVisibleRow && row < totalRows - fixedRowsBottom || snapToBottom)) {\n result = topOverlay.scrollTo(row, true);\n }\n }\n\n return result;\n }\n /**\n * Get first visible row based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getFirstVisibleRow\",\n value: function getFirstVisibleRow() {\n var _this$_getVariables3 = this._getVariables(),\n topOverlay = _this$_getVariables3.topOverlay,\n wtTable = _this$_getVariables3.wtTable,\n wtViewport = _this$_getVariables3.wtViewport,\n totalRows = _this$_getVariables3.totalRows,\n fixedRowsTop = _this$_getVariables3.fixedRowsTop;\n\n var rootWindow = this.wot.rootWindow;\n var firstVisibleRow = wtTable.getFirstVisibleRow();\n\n if (topOverlay.mainTableScrollableElement === rootWindow) {\n var rootElementOffset = offset(wtTable.wtRootElement);\n var totalTableHeight = innerHeight(wtTable.hider);\n var windowHeight = innerHeight(rootWindow);\n var windowScrollTop = getScrollTop(rootWindow, rootWindow); // Only calculate firstVisibleRow when table didn't filled (from up) whole viewport space\n\n if (rootElementOffset.top + totalTableHeight - windowHeight <= windowScrollTop) {\n var rowsHeight = wtViewport.getColumnHeaderHeight();\n rowsHeight += topOverlay.sumCellSizes(0, fixedRowsTop);\n\n for (var row = totalRows; row > 0; row--) {\n rowsHeight += topOverlay.sumCellSizes(row - 1, row);\n\n if (rootElementOffset.top + totalTableHeight - rowsHeight <= windowScrollTop) {\n // Return physical row + 1\n firstVisibleRow = row;\n break;\n }\n }\n }\n }\n\n return firstVisibleRow;\n }\n /**\n * Get last visible row based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getLastVisibleRow\",\n value: function getLastVisibleRow() {\n var _this$_getVariables4 = this._getVariables(),\n topOverlay = _this$_getVariables4.topOverlay,\n wtTable = _this$_getVariables4.wtTable,\n wtViewport = _this$_getVariables4.wtViewport,\n totalRows = _this$_getVariables4.totalRows;\n\n var rootWindow = this.wot.rootWindow;\n var lastVisibleRow = wtTable.getLastVisibleRow();\n\n if (topOverlay.mainTableScrollableElement === rootWindow) {\n var rootElementOffset = offset(wtTable.wtRootElement);\n var windowScrollTop = getScrollTop(rootWindow, rootWindow); // Only calculate lastVisibleRow when table didn't filled (from bottom) whole viewport space\n\n if (rootElementOffset.top > windowScrollTop) {\n var windowHeight = innerHeight(rootWindow);\n var rowsHeight = wtViewport.getColumnHeaderHeight();\n\n for (var row = 1; row <= totalRows; row++) {\n rowsHeight += topOverlay.sumCellSizes(row - 1, row);\n\n if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) {\n // Return physical row - 1 (-2 because rangeEach gives row index + 1 - sumCellSizes requirements)\n lastVisibleRow = row - 2;\n break;\n }\n }\n }\n }\n\n return lastVisibleRow;\n }\n /**\n * Get first visible column based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getFirstVisibleColumn\",\n value: function getFirstVisibleColumn() {\n var _this$_getVariables5 = this._getVariables(),\n leftOverlay = _this$_getVariables5.leftOverlay,\n wtTable = _this$_getVariables5.wtTable,\n wtViewport = _this$_getVariables5.wtViewport,\n totalColumns = _this$_getVariables5.totalColumns;\n\n var rootWindow = this.wot.rootWindow;\n var firstVisibleColumn = wtTable.getFirstVisibleColumn();\n\n if (leftOverlay.mainTableScrollableElement === rootWindow) {\n var rootElementOffset = offset(wtTable.wtRootElement);\n var totalTableWidth = innerWidth(wtTable.hider);\n var windowWidth = innerWidth(rootWindow);\n var windowScrollLeft = getScrollLeft(rootWindow, rootWindow); // Only calculate firstVisibleColumn when table didn't filled (from left) whole viewport space\n\n if (rootElementOffset.left + totalTableWidth - windowWidth <= windowScrollLeft) {\n var columnsWidth = wtViewport.getRowHeaderWidth();\n\n for (var column = totalColumns; column > 0; column--) {\n columnsWidth += leftOverlay.sumCellSizes(column - 1, column);\n\n if (rootElementOffset.left + totalTableWidth - columnsWidth <= windowScrollLeft) {\n // Return physical column + 1\n firstVisibleColumn = column;\n break;\n }\n }\n }\n }\n\n return firstVisibleColumn;\n }\n /**\n * Get last visible column based on virtual dom and how table is visible in browser window viewport.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getLastVisibleColumn\",\n value: function getLastVisibleColumn() {\n var _this$_getVariables6 = this._getVariables(),\n leftOverlay = _this$_getVariables6.leftOverlay,\n wtTable = _this$_getVariables6.wtTable,\n wtViewport = _this$_getVariables6.wtViewport,\n totalColumns = _this$_getVariables6.totalColumns;\n\n var rootWindow = this.wot.rootWindow;\n var lastVisibleColumn = wtTable.getLastVisibleColumn();\n\n if (leftOverlay.mainTableScrollableElement === rootWindow) {\n var rootElementOffset = offset(wtTable.wtRootElement);\n var windowScrollLeft = getScrollLeft(rootWindow, rootWindow); // Only calculate lastVisibleColumn when table didn't filled (from right) whole viewport space\n\n if (rootElementOffset.left > windowScrollLeft) {\n var windowWidth = innerWidth(rootWindow);\n var columnsWidth = wtViewport.getRowHeaderWidth();\n\n for (var column = 1; column <= totalColumns; column++) {\n columnsWidth += leftOverlay.sumCellSizes(column - 1, column);\n\n if (rootElementOffset.left + columnsWidth - windowScrollLeft >= windowWidth) {\n // Return physical column - 1 (-2 because rangeEach gives column index + 1 - sumCellSizes requirements)\n lastVisibleColumn = column - 2;\n break;\n }\n }\n }\n }\n\n return lastVisibleColumn;\n }\n /**\n * Returns collection of variables used to rows and columns visibility calculations.\n *\n * @returns {object}\n * @private\n */\n\n }, {\n key: \"_getVariables\",\n value: function _getVariables() {\n var wot = this.wot;\n var topOverlay = wot.wtOverlays.topOverlay;\n var leftOverlay = wot.wtOverlays.leftOverlay;\n var wtTable = wot.wtTable;\n var wtViewport = wot.wtViewport;\n var totalRows = wot.getSetting('totalRows');\n var totalColumns = wot.getSetting('totalColumns');\n var fixedRowsTop = wot.getSetting('fixedRowsTop');\n var fixedRowsBottom = wot.getSetting('fixedRowsBottom');\n var fixedColumnsLeft = wot.getSetting('fixedColumnsLeft');\n return {\n topOverlay: topOverlay,\n leftOverlay: leftOverlay,\n wtTable: wtTable,\n wtViewport: wtViewport,\n totalRows: totalRows,\n totalColumns: totalColumns,\n fixedRowsTop: fixedRowsTop,\n fixedRowsBottom: fixedRowsBottom,\n fixedColumnsLeft: fixedColumnsLeft\n };\n }\n }]);\n\n return Scroll;\n}();\n\nexport default Scroll;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { fastInnerText } from \"./../../../helpers/dom/element.mjs\";\nimport { objectEach } from \"./../../../helpers/object.mjs\";\n/**\n * @class Settings\n */\n\nvar Settings = /*#__PURE__*/function () {\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n * @param {object} settings The user defined settings.\n */\n function Settings(wotInstance, settings) {\n var _this = this;\n\n _classCallCheck(this, Settings);\n\n this.wot = wotInstance; // legacy support\n\n this.instance = wotInstance; // default settings. void 0 means it is required, null means it can be empty\n\n this.defaults = {\n table: void 0,\n // Determines whether the Walkontable instance is used as dataset viewer. When its instance is used as\n // a context menu, autocomplete list, etc, the returned value is `false`.\n isDataViewInstance: true,\n // presentation mode\n externalRowCalculator: false,\n stretchH: 'none',\n // values: all, last, none\n currentRowClassName: null,\n currentColumnClassName: null,\n preventOverflow: function preventOverflow() {\n return false;\n },\n preventWheel: false,\n // data source\n data: void 0,\n freezeOverlays: false,\n // Number of renderable columns for the left overlay.\n fixedColumnsLeft: 0,\n // Number of renderable rows for the top overlay.\n fixedRowsTop: 0,\n // Number of renderable rows for the bottom overlay.\n fixedRowsBottom: 0,\n // Enable the left overlay when conditions are met.\n shouldRenderLeftOverlay: function shouldRenderLeftOverlay() {\n return _this.getSetting('fixedColumnsLeft') > 0 || _this.getSetting('rowHeaders').length > 0;\n },\n // Enable the top overlay when conditions are met.\n shouldRenderTopOverlay: function shouldRenderTopOverlay() {\n return _this.getSetting('fixedRowsTop') > 0 || _this.getSetting('columnHeaders').length > 0;\n },\n // Enable the bottom overlay when conditions are met.\n shouldRenderBottomOverlay: function shouldRenderBottomOverlay() {\n return _this.getSetting('fixedRowsBottom') > 0;\n },\n minSpareRows: 0,\n // this must be array of functions: [function (row, TH) {}]\n rowHeaders: function rowHeaders() {\n return [];\n },\n // this must be array of functions: [function (column, TH) {}]\n columnHeaders: function columnHeaders() {\n return [];\n },\n totalRows: void 0,\n totalColumns: void 0,\n cellRenderer: function cellRenderer(row, column, TD) {\n var cellData = _this.getSetting('data', row, column);\n\n fastInnerText(TD, cellData === void 0 || cellData === null ? '' : cellData);\n },\n // columnWidth: 50,\n columnWidth: function columnWidth() {// return undefined means use default size for the rendered cell content\n },\n rowHeight: function rowHeight() {// return undefined means use default size for the rendered cell content\n },\n defaultRowHeight: 23,\n defaultColumnWidth: 50,\n selections: null,\n hideBorderOnMouseDownOver: false,\n viewportRowCalculatorOverride: null,\n viewportColumnCalculatorOverride: null,\n // callbacks\n onCellMouseDown: null,\n onCellContextMenu: null,\n onCellMouseOver: null,\n onCellMouseOut: null,\n onCellMouseUp: null,\n // onCellMouseOut: null,\n onCellDblClick: null,\n onCellCornerMouseDown: null,\n onCellCornerDblClick: null,\n beforeDraw: null,\n onDraw: null,\n onBeforeRemoveCellClassNames: null,\n onAfterDrawSelection: null,\n onBeforeDrawBorders: null,\n onScrollVertically: null,\n onScrollHorizontally: null,\n onBeforeTouchScroll: null,\n onAfterMomentumScroll: null,\n onBeforeStretchingColumnWidth: function onBeforeStretchingColumnWidth(width) {\n return width;\n },\n onModifyRowHeaderWidth: null,\n onModifyGetCellCoords: null,\n onBeforeHighlightingRowHeader: function onBeforeHighlightingRowHeader(sourceRow) {\n return sourceRow;\n },\n onBeforeHighlightingColumnHeader: function onBeforeHighlightingColumnHeader(sourceCol) {\n return sourceCol;\n },\n onWindowResize: null,\n // constants\n scrollbarWidth: 10,\n scrollbarHeight: 10,\n renderAllRows: false,\n groups: false,\n rowHeaderWidth: null,\n columnHeaderHeight: null,\n headerClassName: null\n }; // reference to settings\n\n this.settings = {};\n objectEach(this.defaults, function (value, key) {\n if (settings[key] !== void 0) {\n _this.settings[key] = settings[key];\n } else if (value === void 0) {\n throw new Error(\"A required setting \\\"\".concat(key, \"\\\" was not provided\"));\n } else {\n _this.settings[key] = value;\n }\n });\n }\n /**\n * Update settings.\n *\n * @param {object} settings The singular settings to update or if passed as object to merge with.\n * @param {*} value The value to set if the first argument is passed as string.\n * @returns {Walkontable}\n */\n\n\n _createClass(Settings, [{\n key: \"update\",\n value: function update(settings, value) {\n var _this2 = this;\n\n if (value === void 0) {\n // settings is object\n objectEach(settings, function (settingValue, key) {\n _this2.settings[key] = settingValue;\n });\n } else {\n // if value is defined then settings is the key\n this.settings[settings] = value;\n }\n\n return this.wot;\n }\n /**\n * Get setting by name.\n *\n * @param {string} key The settings key to retrieve.\n * @param {*} [param1] Additional parameter passed to the options defined as function.\n * @param {*} [param2] Additional parameter passed to the options defined as function.\n * @param {*} [param3] Additional parameter passed to the options defined as function.\n * @param {*} [param4] Additional parameter passed to the options defined as function.\n * @returns {*}\n */\n\n }, {\n key: \"getSetting\",\n value: function getSetting(key, param1, param2, param3, param4) {\n if (typeof this.settings[key] === 'function') {\n // this is faster than .apply - https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n return this.settings[key](param1, param2, param3, param4);\n } else if (param1 !== void 0 && Array.isArray(this.settings[key])) {\n // perhaps this can be removed, it is only used in tests\n return this.settings[key][param1];\n }\n\n return this.settings[key];\n }\n /**\n * Checks if setting exists.\n *\n * @param {boolean} key The settings key to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"has\",\n value: function has(key) {\n return !!this.settings[key];\n }\n }]);\n\n return Settings;\n}();\n\nexport default Settings;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { getStyle, getComputedStyle, getTrimmingContainer, isVisible } from \"./../../../../helpers/dom/element.mjs\";\nimport Table from \"../table.mjs\";\nimport calculatedRows from \"./mixin/calculatedRows.mjs\";\nimport calculatedColumns from \"./mixin/calculatedColumns.mjs\";\nimport { mixin } from \"./../../../../helpers/object.mjs\";\n/**\n * Subclass of `Table` that provides the helper methods relevant to the master table (not overlays), implemented through mixins.\n */\n\nvar MasterTable = /*#__PURE__*/function (_Table) {\n _inherits(MasterTable, _Table);\n\n var _super = _createSuper(MasterTable);\n\n function MasterTable() {\n _classCallCheck(this, MasterTable);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(MasterTable, [{\n key: \"alignOverlaysWithTrimmingContainer\",\n value: function alignOverlaysWithTrimmingContainer() {\n var trimmingElement = getTrimmingContainer(this.wtRootElement);\n var rootWindow = this.wot.rootWindow;\n\n if (trimmingElement === rootWindow) {\n var preventOverflow = this.wot.getSetting('preventOverflow');\n\n if (!preventOverflow) {\n this.holder.style.overflow = 'visible';\n this.wtRootElement.style.overflow = 'visible';\n }\n } else {\n var trimmingElementParent = trimmingElement.parentElement;\n var trimmingHeight = getStyle(trimmingElement, 'height', rootWindow);\n var trimmingOverflow = getStyle(trimmingElement, 'overflow', rootWindow);\n var holderStyle = this.holder.style;\n var scrollWidth = trimmingElement.scrollWidth,\n scrollHeight = trimmingElement.scrollHeight;\n\n var _trimmingElement$getB = trimmingElement.getBoundingClientRect(),\n width = _trimmingElement$getB.width,\n height = _trimmingElement$getB.height;\n\n var overflow = ['auto', 'hidden', 'scroll'];\n\n if (trimmingElementParent && overflow.includes(trimmingOverflow)) {\n var cloneNode = trimmingElement.cloneNode(false); // Before calculating the height of the trimming element, set overflow: auto to hide scrollbars.\n // An issue occurred on Firefox, where an empty element with overflow: scroll returns an element height higher than 0px\n // despite an empty content within.\n\n cloneNode.style.overflow = 'auto';\n\n if (trimmingElement.nextElementSibling) {\n trimmingElementParent.insertBefore(cloneNode, trimmingElement.nextElementSibling);\n } else {\n trimmingElementParent.appendChild(cloneNode);\n }\n\n var cloneHeight = parseInt(getComputedStyle(cloneNode, rootWindow).height, 10);\n trimmingElementParent.removeChild(cloneNode);\n\n if (cloneHeight === 0) {\n height = 0;\n }\n }\n\n height = Math.min(height, scrollHeight);\n holderStyle.height = trimmingHeight === 'auto' ? 'auto' : \"\".concat(height, \"px\");\n width = Math.min(width, scrollWidth);\n holderStyle.width = \"\".concat(width, \"px\");\n holderStyle.overflow = '';\n this.hasTableHeight = holderStyle.height === 'auto' ? true : height > 0;\n this.hasTableWidth = width > 0;\n }\n\n this.isTableVisible = isVisible(this.TABLE);\n }\n }, {\n key: \"markOversizedColumnHeaders\",\n value: function markOversizedColumnHeaders() {\n var wot = this.wot;\n var overlayName = wot.getOverlayName();\n var columnHeaders = wot.getSetting('columnHeaders');\n var columnHeadersCount = columnHeaders.length;\n\n if (columnHeadersCount && !wot.wtViewport.hasOversizedColumnHeadersMarked[overlayName]) {\n var rowHeaders = wot.getSetting('rowHeaders');\n var rowHeaderCount = rowHeaders.length;\n var columnCount = this.getRenderedColumnsCount();\n\n for (var i = 0; i < columnHeadersCount; i++) {\n for (var renderedColumnIndex = -1 * rowHeaderCount; renderedColumnIndex < columnCount; renderedColumnIndex++) {\n // eslint-disable-line max-len\n this.markIfOversizedColumnHeader(renderedColumnIndex);\n }\n }\n\n wot.wtViewport.hasOversizedColumnHeadersMarked[overlayName] = true;\n }\n }\n }]);\n\n return MasterTable;\n}(Table);\n\nmixin(MasterTable, calculatedRows);\nmixin(MasterTable, calculatedColumns);\nexport default MasterTable;","/**\n * Render type calculation calculates how many DOM nodes should be created and where placed\n * based on `startRow` and `endRow` properties.\n *\n * @type {number}\n */\nexport var RENDER_TYPE = 1;\n/**\n * Fully visible type calculation calculates rows that are fully visible in the viewport.\n * This type of calculation is used in scrolling by arrow keys navigation.\n *\n * @type {number}\n */\n\nexport var FULLY_VISIBLE_TYPE = 2;\n/**\n * Partially visible type calculation calculates rows that are fully and partially visible in\n * the viewport. This type of calculation is used to check `endRow` (or `startRow`) with properties\n * calculated in render calculator. If checking met the criteria slow render is\n * performed (which render calculator with new data).\n *\n * @type {number}\n */\n\nexport var PARTIALLY_VISIBLE_TYPE = 3;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/es.weak-map.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport { RENDER_TYPE, FULLY_VISIBLE_TYPE } from \"./constants.mjs\";\nvar privatePool = new WeakMap();\n/**\n * Calculates indexes of rows to render OR rows that are visible.\n * To redo the calculation, you need to create a new calculator.\n *\n * @class ViewportRowsCalculator\n */\n\nvar ViewportRowsCalculator = /*#__PURE__*/function () {\n /**\n * @param {object} options Object with all options specified for row viewport calculation.\n * @param {number} options.viewportSize Height of the viewport.\n * @param {number} options.scrollOffset Current vertical scroll position of the viewport.\n * @param {number} options.totalItems Total number of rows.\n * @param {Function} options.itemSizeFn Function that returns the height of the row at a given index (in px).\n * @param {Function} options.overrideFn Function that changes calculated this.startRow, this.endRow (used by MergeCells plugin).\n * @param {string} options.calculationType String which describes types of calculation which will be performed.\n * @param {number} options.scrollbarHeight The scrollbar height.\n */\n function ViewportRowsCalculator() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n viewportSize = _ref.viewportSize,\n scrollOffset = _ref.scrollOffset,\n totalItems = _ref.totalItems,\n itemSizeFn = _ref.itemSizeFn,\n overrideFn = _ref.overrideFn,\n calculationType = _ref.calculationType,\n scrollbarHeight = _ref.scrollbarHeight;\n\n _classCallCheck(this, ViewportRowsCalculator);\n\n privatePool.set(this, {\n viewportHeight: viewportSize,\n scrollOffset: scrollOffset,\n totalRows: totalItems,\n rowHeightFn: itemSizeFn,\n overrideFn: overrideFn,\n calculationType: calculationType,\n horizontalScrollbarHeight: scrollbarHeight\n });\n /**\n * Number of rendered/visible rows.\n *\n * @type {number}\n */\n\n this.count = 0;\n /**\n * Index of the first rendered/visible row (can be overwritten using overrideFn).\n *\n * @type {number|null}\n */\n\n this.startRow = null;\n /**\n * Index of the last rendered/visible row (can be overwritten using overrideFn).\n *\n * @type {null}\n */\n\n this.endRow = null;\n /**\n * Position of the first rendered/visible row (in px).\n *\n * @type {number|null}\n */\n\n this.startPosition = null;\n this.calculate();\n }\n /**\n * Calculates viewport.\n */\n\n\n _createClass(ViewportRowsCalculator, [{\n key: \"calculate\",\n value: function calculate() {\n var sum = 0;\n var needReverse = true;\n var startPositions = [];\n var priv = privatePool.get(this);\n var calculationType = priv.calculationType;\n var overrideFn = priv.overrideFn;\n var rowHeightFn = priv.rowHeightFn;\n var scrollOffset = priv.scrollOffset;\n var totalRows = priv.totalRows;\n var viewportHeight = priv.viewportHeight;\n var horizontalScrollbarHeight = priv.horizontalScrollbarHeight || 0;\n var rowHeight; // Calculate the number (start and end index) of rows needed\n\n for (var i = 0; i < totalRows; i++) {\n rowHeight = rowHeightFn(i);\n\n if (isNaN(rowHeight)) {\n rowHeight = ViewportRowsCalculator.DEFAULT_HEIGHT;\n }\n\n if (sum <= scrollOffset && calculationType !== FULLY_VISIBLE_TYPE) {\n this.startRow = i;\n }\n\n if (sum >= scrollOffset && sum + (calculationType === FULLY_VISIBLE_TYPE ? rowHeight : 0) <= scrollOffset + viewportHeight - horizontalScrollbarHeight) {\n // eslint-disable-line max-len\n if (this.startRow === null) {\n this.startRow = i;\n }\n\n this.endRow = i;\n }\n\n startPositions.push(sum);\n sum += rowHeight;\n\n if (calculationType !== FULLY_VISIBLE_TYPE) {\n this.endRow = i;\n }\n\n if (sum >= scrollOffset + viewportHeight - horizontalScrollbarHeight) {\n needReverse = false;\n break;\n }\n } // If the estimation has reached the last row and there is still some space available in the viewport,\n // we need to render in reverse in order to fill the whole viewport with rows\n\n\n if (this.endRow === totalRows - 1 && needReverse) {\n this.startRow = this.endRow;\n\n while (this.startRow > 0) {\n // rowHeight is the height of the last row\n var viewportSum = startPositions[this.endRow] + rowHeight - startPositions[this.startRow - 1];\n\n if (viewportSum <= viewportHeight - horizontalScrollbarHeight || calculationType !== FULLY_VISIBLE_TYPE) {\n this.startRow -= 1;\n }\n\n if (viewportSum >= viewportHeight - horizontalScrollbarHeight) {\n break;\n }\n }\n }\n\n if (calculationType === RENDER_TYPE && this.startRow !== null && overrideFn) {\n overrideFn(this);\n }\n\n this.startPosition = startPositions[this.startRow];\n\n if (this.startPosition === void 0) {\n this.startPosition = null;\n } // If totalRows exceeded its total rows size set endRow to the latest item\n\n\n if (totalRows < this.endRow) {\n this.endRow = totalRows - 1;\n }\n\n if (this.startRow !== null) {\n this.count = this.endRow - this.startRow + 1;\n }\n }\n }], [{\n key: \"DEFAULT_HEIGHT\",\n get:\n /**\n * Default row height.\n *\n * @type {number}\n */\n function get() {\n return 23;\n }\n }]);\n\n return ViewportRowsCalculator;\n}();\n\nexport default ViewportRowsCalculator;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/es.weak-map.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport { RENDER_TYPE, FULLY_VISIBLE_TYPE } from \"./constants.mjs\";\nvar privatePool = new WeakMap();\n/**\n * Calculates indexes of columns to render OR columns that are visible.\n * To redo the calculation, you need to create a new calculator.\n *\n * @class ViewportColumnsCalculator\n */\n\nvar ViewportColumnsCalculator = /*#__PURE__*/function () {\n /**\n * @param {object} options Object with all options specified for column viewport calculation.\n * @param {number} options.viewportSize Width of the viewport.\n * @param {number} options.scrollOffset Current horizontal scroll position of the viewport.\n * @param {number} options.totalItems Total number of columns.\n * @param {Function} options.itemSizeFn Function that returns the width of the column at a given index (in px).\n * @param {Function} options.overrideFn Function that changes calculated this.startRow, this.endRow (used by MergeCells plugin).\n * @param {string} options.calculationType String which describes types of calculation which will be performed.\n * @param {string} [options.stretchMode] Stretch mode 'all' or 'last'.\n * @param {Function} [options.stretchingItemWidthFn] Function that returns the new width of the stretched column.\n */\n function ViewportColumnsCalculator() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n viewportSize = _ref.viewportSize,\n scrollOffset = _ref.scrollOffset,\n totalItems = _ref.totalItems,\n itemSizeFn = _ref.itemSizeFn,\n overrideFn = _ref.overrideFn,\n calculationType = _ref.calculationType,\n stretchMode = _ref.stretchMode,\n _ref$stretchingItemWi = _ref.stretchingItemWidthFn,\n stretchingItemWidthFn = _ref$stretchingItemWi === void 0 ? function (width) {\n return width;\n } : _ref$stretchingItemWi;\n\n _classCallCheck(this, ViewportColumnsCalculator);\n\n privatePool.set(this, {\n viewportWidth: viewportSize,\n scrollOffset: scrollOffset,\n totalColumns: totalItems,\n columnWidthFn: itemSizeFn,\n overrideFn: overrideFn,\n calculationType: calculationType,\n stretchingColumnWidthFn: stretchingItemWidthFn\n });\n /**\n * Number of rendered/visible columns.\n *\n * @type {number}\n */\n\n this.count = 0;\n /**\n * Index of the first rendered/visible column (can be overwritten using overrideFn).\n *\n * @type {number|null}\n */\n\n this.startColumn = null;\n /**\n * Index of the last rendered/visible column (can be overwritten using overrideFn).\n *\n * @type {null}\n */\n\n this.endColumn = null;\n /**\n * Position of the first rendered/visible column (in px).\n *\n * @type {number|null}\n */\n\n this.startPosition = null;\n this.stretchAllRatio = 0;\n this.stretchLastWidth = 0;\n this.stretch = stretchMode;\n this.totalTargetWidth = 0;\n this.needVerifyLastColumnWidth = true;\n this.stretchAllColumnsWidth = [];\n this.calculate();\n }\n /**\n * Calculates viewport.\n */\n\n\n _createClass(ViewportColumnsCalculator, [{\n key: \"calculate\",\n value: function calculate() {\n var sum = 0;\n var needReverse = true;\n var startPositions = [];\n var columnWidth;\n var priv = privatePool.get(this);\n var calculationType = priv.calculationType;\n var overrideFn = priv.overrideFn;\n var scrollOffset = priv.scrollOffset;\n var totalColumns = priv.totalColumns;\n var viewportWidth = priv.viewportWidth;\n\n for (var i = 0; i < totalColumns; i++) {\n columnWidth = this._getColumnWidth(i);\n\n if (sum <= scrollOffset && calculationType !== FULLY_VISIBLE_TYPE) {\n this.startColumn = i;\n } // +1 pixel for row header width compensation for horizontal scroll > 0\n\n\n var compensatedViewportWidth = scrollOffset > 0 ? viewportWidth + 1 : viewportWidth;\n\n if (sum >= scrollOffset && sum + (calculationType === FULLY_VISIBLE_TYPE ? columnWidth : 0) <= scrollOffset + compensatedViewportWidth) {\n // eslint-disable-line max-len\n if (this.startColumn === null || this.startColumn === void 0) {\n this.startColumn = i;\n }\n\n this.endColumn = i;\n }\n\n startPositions.push(sum);\n sum += columnWidth;\n\n if (calculationType !== FULLY_VISIBLE_TYPE) {\n this.endColumn = i;\n }\n\n if (sum >= scrollOffset + viewportWidth) {\n needReverse = false;\n break;\n }\n }\n\n if (this.endColumn === totalColumns - 1 && needReverse) {\n this.startColumn = this.endColumn;\n\n while (this.startColumn > 0) {\n var viewportSum = startPositions[this.endColumn] + columnWidth - startPositions[this.startColumn - 1];\n\n if (viewportSum <= viewportWidth || calculationType !== FULLY_VISIBLE_TYPE) {\n this.startColumn -= 1;\n }\n\n if (viewportSum > viewportWidth) {\n break;\n }\n }\n }\n\n if (calculationType === RENDER_TYPE && this.startColumn !== null && overrideFn) {\n overrideFn(this);\n }\n\n this.startPosition = startPositions[this.startColumn];\n\n if (this.startPosition === void 0) {\n this.startPosition = null;\n } // If totalColumns exceeded its total columns size set endColumn to the latest item\n\n\n if (totalColumns < this.endColumn) {\n this.endColumn = totalColumns - 1;\n }\n\n if (this.startColumn !== null) {\n this.count = this.endColumn - this.startColumn + 1;\n }\n }\n /**\n * Recalculate columns stretching.\n *\n * @param {number} totalWidth The total width of the table.\n */\n\n }, {\n key: \"refreshStretching\",\n value: function refreshStretching(totalWidth) {\n if (this.stretch === 'none') {\n return;\n }\n\n var totalColumnsWidth = totalWidth;\n this.totalTargetWidth = totalColumnsWidth;\n var priv = privatePool.get(this);\n var totalColumns = priv.totalColumns;\n var sumAll = 0;\n\n for (var i = 0; i < totalColumns; i++) {\n var columnWidth = this._getColumnWidth(i);\n\n var permanentColumnWidth = priv.stretchingColumnWidthFn(void 0, i);\n\n if (typeof permanentColumnWidth === 'number') {\n totalColumnsWidth -= permanentColumnWidth;\n } else {\n sumAll += columnWidth;\n }\n }\n\n var remainingSize = totalColumnsWidth - sumAll;\n\n if (this.stretch === 'all' && remainingSize > 0) {\n this.stretchAllRatio = totalColumnsWidth / sumAll;\n this.stretchAllColumnsWidth = [];\n this.needVerifyLastColumnWidth = true;\n } else if (this.stretch === 'last' && totalColumnsWidth !== Infinity) {\n var _columnWidth = this._getColumnWidth(totalColumns - 1);\n\n var lastColumnWidth = remainingSize + _columnWidth;\n this.stretchLastWidth = lastColumnWidth >= 0 ? lastColumnWidth : _columnWidth;\n }\n }\n /**\n * Get stretched column width based on stretchH (all or last) setting passed in handsontable instance.\n *\n * @param {number} column The visual column index.\n * @param {number} baseWidth The default column width.\n * @returns {number|null}\n */\n\n }, {\n key: \"getStretchedColumnWidth\",\n value: function getStretchedColumnWidth(column, baseWidth) {\n var result = null;\n\n if (this.stretch === 'all' && this.stretchAllRatio !== 0) {\n result = this._getStretchedAllColumnWidth(column, baseWidth);\n } else if (this.stretch === 'last' && this.stretchLastWidth !== 0) {\n result = this._getStretchedLastColumnWidth(column);\n }\n\n return result;\n }\n /**\n * @param {number} column The visual column index.\n * @param {number} baseWidth The default column width.\n * @returns {number}\n * @private\n */\n\n }, {\n key: \"_getStretchedAllColumnWidth\",\n value: function _getStretchedAllColumnWidth(column, baseWidth) {\n var sumRatioWidth = 0;\n var priv = privatePool.get(this);\n var totalColumns = priv.totalColumns;\n\n if (!this.stretchAllColumnsWidth[column]) {\n var stretchedWidth = Math.round(baseWidth * this.stretchAllRatio);\n var newStretchedWidth = priv.stretchingColumnWidthFn(stretchedWidth, column);\n\n if (newStretchedWidth === void 0) {\n this.stretchAllColumnsWidth[column] = stretchedWidth;\n } else {\n this.stretchAllColumnsWidth[column] = isNaN(newStretchedWidth) ? this._getColumnWidth(column) : newStretchedWidth;\n }\n }\n\n if (this.stretchAllColumnsWidth.length === totalColumns && this.needVerifyLastColumnWidth) {\n this.needVerifyLastColumnWidth = false;\n\n for (var i = 0; i < this.stretchAllColumnsWidth.length; i++) {\n sumRatioWidth += this.stretchAllColumnsWidth[i];\n }\n\n if (sumRatioWidth !== this.totalTargetWidth) {\n this.stretchAllColumnsWidth[this.stretchAllColumnsWidth.length - 1] += this.totalTargetWidth - sumRatioWidth;\n }\n }\n\n return this.stretchAllColumnsWidth[column];\n }\n /**\n * @param {number} column The visual column index.\n * @returns {number|null}\n * @private\n */\n\n }, {\n key: \"_getStretchedLastColumnWidth\",\n value: function _getStretchedLastColumnWidth(column) {\n var priv = privatePool.get(this);\n var totalColumns = priv.totalColumns;\n\n if (column === totalColumns - 1) {\n return this.stretchLastWidth;\n }\n\n return null;\n }\n /**\n * @param {number} column The visual column index.\n * @returns {number}\n * @private\n */\n\n }, {\n key: \"_getColumnWidth\",\n value: function _getColumnWidth(column) {\n var width = privatePool.get(this).columnWidthFn(column);\n\n if (isNaN(width)) {\n width = ViewportColumnsCalculator.DEFAULT_WIDTH;\n }\n\n return width;\n }\n }], [{\n key: \"DEFAULT_WIDTH\",\n get:\n /**\n * Default column width.\n *\n * @type {number}\n */\n function get() {\n return 50;\n }\n }]);\n\n return ViewportColumnsCalculator;\n}();\n\nexport default ViewportColumnsCalculator;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { getScrollbarWidth, getStyle, offset, outerHeight, outerWidth } from \"./../../../helpers/dom/element.mjs\";\nimport { objectEach } from \"./../../../helpers/object.mjs\";\nimport EventManager from \"./../../../eventManager.mjs\";\nimport { RENDER_TYPE, FULLY_VISIBLE_TYPE, ViewportColumnsCalculator, ViewportRowsCalculator } from \"./calculator/index.mjs\";\n/**\n * @class Viewport\n */\n\nvar Viewport = /*#__PURE__*/function () {\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n */\n function Viewport(wotInstance) {\n var _this = this;\n\n _classCallCheck(this, Viewport);\n\n this.wot = wotInstance; // legacy support\n\n this.instance = this.wot;\n this.oversizedRows = [];\n this.oversizedColumnHeaders = [];\n this.hasOversizedColumnHeadersMarked = {};\n this.clientHeight = 0;\n this.containerWidth = NaN;\n this.rowHeaderWidth = NaN;\n this.rowsVisibleCalculator = null;\n this.columnsVisibleCalculator = null;\n this.eventManager = new EventManager(this.wot);\n this.eventManager.addEventListener(this.wot.rootWindow, 'resize', function () {\n _this.clientHeight = _this.getWorkspaceHeight();\n });\n }\n /**\n * @returns {number}\n */\n\n\n _createClass(Viewport, [{\n key: \"getWorkspaceHeight\",\n value: function getWorkspaceHeight() {\n var currentDocument = this.wot.rootDocument;\n var trimmingContainer = this.instance.wtOverlays.topOverlay.trimmingContainer;\n var height = 0;\n\n if (trimmingContainer === this.wot.rootWindow) {\n height = currentDocument.documentElement.clientHeight;\n } else {\n var elemHeight = outerHeight(trimmingContainer); // returns height without DIV scrollbar\n\n height = elemHeight > 0 && trimmingContainer.clientHeight > 0 ? trimmingContainer.clientHeight : Infinity;\n }\n\n return height;\n }\n }, {\n key: \"getWorkspaceWidth\",\n value: function getWorkspaceWidth() {\n var wot = this.wot;\n var rootDocument = wot.rootDocument,\n rootWindow = wot.rootWindow;\n var trimmingContainer = this.instance.wtOverlays.leftOverlay.trimmingContainer;\n var docOffsetWidth = rootDocument.documentElement.offsetWidth;\n var totalColumns = wot.getSetting('totalColumns');\n var preventOverflow = wot.getSetting('preventOverflow');\n var width;\n var overflow;\n\n if (preventOverflow) {\n return outerWidth(this.instance.wtTable.wtRootElement);\n }\n\n if (wot.getSetting('freezeOverlays')) {\n width = Math.min(docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);\n } else {\n width = Math.min(this.getContainerFillWidth(), docOffsetWidth - this.getWorkspaceOffset().left, docOffsetWidth);\n }\n\n if (trimmingContainer === rootWindow && totalColumns > 0 && this.sumColumnWidths(0, totalColumns - 1) > width) {\n // in case sum of column widths is higher than available stylesheet width, let's assume using the whole window\n // otherwise continue below, which will allow stretching\n // this is used in `scroll_window.html`\n // TODO test me\n return rootDocument.documentElement.clientWidth;\n }\n\n if (trimmingContainer !== rootWindow) {\n overflow = getStyle(this.instance.wtOverlays.leftOverlay.trimmingContainer, 'overflow', rootWindow);\n\n if (overflow === 'scroll' || overflow === 'hidden' || overflow === 'auto') {\n // this is used in `scroll.html`\n // TODO test me\n return Math.max(width, trimmingContainer.clientWidth);\n }\n }\n\n var stretchSetting = wot.getSetting('stretchH');\n\n if (stretchSetting === 'none' || !stretchSetting) {\n // if no stretching is used, return the maximum used workspace width\n return Math.max(width, outerWidth(this.instance.wtTable.TABLE));\n } // if stretching is used, return the actual container width, so the columns can fit inside it\n\n\n return width;\n }\n /**\n * Checks if viewport has vertical scroll.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"hasVerticalScroll\",\n value: function hasVerticalScroll() {\n return this.getWorkspaceActualHeight() > this.getWorkspaceHeight();\n }\n /**\n * Checks if viewport has horizontal scroll.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"hasHorizontalScroll\",\n value: function hasHorizontalScroll() {\n return this.getWorkspaceActualWidth() > this.getWorkspaceWidth();\n }\n /**\n * @param {number} from The visual column index from the width sum is start calculated.\n * @param {number} length The length of the column to traverse.\n * @returns {number}\n */\n\n }, {\n key: \"sumColumnWidths\",\n value: function sumColumnWidths(from, length) {\n var wtTable = this.wot.wtTable;\n var sum = 0;\n var column = from;\n\n while (column < length) {\n sum += wtTable.getColumnWidth(column);\n column += 1;\n }\n\n return sum;\n }\n /**\n * @returns {number}\n */\n\n }, {\n key: \"getContainerFillWidth\",\n value: function getContainerFillWidth() {\n if (this.containerWidth) {\n return this.containerWidth;\n }\n\n var mainContainer = this.instance.wtTable.holder;\n var dummyElement = this.wot.rootDocument.createElement('div');\n dummyElement.style.width = '100%';\n dummyElement.style.height = '1px';\n mainContainer.appendChild(dummyElement);\n var fillWidth = dummyElement.offsetWidth;\n this.containerWidth = fillWidth;\n mainContainer.removeChild(dummyElement);\n return fillWidth;\n }\n /**\n * @returns {number}\n */\n\n }, {\n key: \"getWorkspaceOffset\",\n value: function getWorkspaceOffset() {\n return offset(this.wot.wtTable.TABLE);\n }\n /**\n * @returns {number}\n */\n\n }, {\n key: \"getWorkspaceActualHeight\",\n value: function getWorkspaceActualHeight() {\n return outerHeight(this.wot.wtTable.TABLE);\n }\n /**\n * @returns {number}\n */\n\n }, {\n key: \"getWorkspaceActualWidth\",\n value: function getWorkspaceActualWidth() {\n var wtTable = this.wot.wtTable;\n return outerWidth(wtTable.TABLE) || outerWidth(wtTable.TBODY) || outerWidth(wtTable.THEAD); // IE8 reports 0 as offsetWidth;\n }\n /**\n * @returns {number}\n */\n\n }, {\n key: \"getColumnHeaderHeight\",\n value: function getColumnHeaderHeight() {\n var columnHeaders = this.instance.getSetting('columnHeaders');\n\n if (!columnHeaders.length) {\n this.columnHeaderHeight = 0;\n } else if (isNaN(this.columnHeaderHeight)) {\n this.columnHeaderHeight = outerHeight(this.wot.wtTable.THEAD);\n }\n\n return this.columnHeaderHeight;\n }\n /**\n * @returns {number}\n */\n\n }, {\n key: \"getViewportHeight\",\n value: function getViewportHeight() {\n var containerHeight = this.getWorkspaceHeight();\n\n if (containerHeight === Infinity) {\n return containerHeight;\n }\n\n var columnHeaderHeight = this.getColumnHeaderHeight();\n\n if (columnHeaderHeight > 0) {\n containerHeight -= columnHeaderHeight;\n }\n\n return containerHeight;\n }\n /**\n * @returns {number}\n */\n\n }, {\n key: \"getRowHeaderWidth\",\n value: function getRowHeaderWidth() {\n var rowHeadersWidthSetting = this.instance.getSetting('rowHeaderWidth');\n var rowHeaders = this.instance.getSetting('rowHeaders');\n\n if (rowHeadersWidthSetting) {\n this.rowHeaderWidth = 0;\n\n for (var i = 0, len = rowHeaders.length; i < len; i++) {\n this.rowHeaderWidth += rowHeadersWidthSetting[i] || rowHeadersWidthSetting;\n }\n }\n\n if (this.wot.cloneSource) {\n return this.wot.cloneSource.wtViewport.getRowHeaderWidth();\n }\n\n if (isNaN(this.rowHeaderWidth)) {\n if (rowHeaders.length) {\n var TH = this.instance.wtTable.TABLE.querySelector('TH');\n this.rowHeaderWidth = 0;\n\n for (var _i = 0, _len = rowHeaders.length; _i < _len; _i++) {\n if (TH) {\n this.rowHeaderWidth += outerWidth(TH);\n TH = TH.nextSibling;\n } else {\n // yes this is a cheat but it worked like that before, just taking assumption from CSS instead of measuring.\n // TODO: proper fix\n this.rowHeaderWidth += 50;\n }\n }\n } else {\n this.rowHeaderWidth = 0;\n }\n }\n\n this.rowHeaderWidth = this.instance.getSetting('onModifyRowHeaderWidth', this.rowHeaderWidth) || this.rowHeaderWidth;\n return this.rowHeaderWidth;\n }\n /**\n * @returns {number}\n */\n\n }, {\n key: \"getViewportWidth\",\n value: function getViewportWidth() {\n var containerWidth = this.getWorkspaceWidth();\n\n if (containerWidth === Infinity) {\n return containerWidth;\n }\n\n var rowHeaderWidth = this.getRowHeaderWidth();\n\n if (rowHeaderWidth > 0) {\n return containerWidth - rowHeaderWidth;\n }\n\n return containerWidth;\n }\n /**\n * Creates:\n * - rowsRenderCalculator (before draw, to qualify rows for rendering)\n * - rowsVisibleCalculator (after draw, to measure which rows are actually visible).\n *\n * @param {number} calculationType The render type ID, which determines for what type of\n * calculation calculator is created.\n * @returns {ViewportRowsCalculator}\n */\n\n }, {\n key: \"createRowsCalculator\",\n value: function createRowsCalculator() {\n var calculationType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : RENDER_TYPE;\n var wot = this.wot;\n var wtSettings = wot.wtSettings,\n wtOverlays = wot.wtOverlays,\n wtTable = wot.wtTable,\n rootDocument = wot.rootDocument;\n var height;\n var scrollbarHeight;\n var fixedRowsHeight;\n this.rowHeaderWidth = NaN;\n\n if (wtSettings.settings.renderAllRows && calculationType === RENDER_TYPE) {\n height = Infinity;\n } else {\n height = this.getViewportHeight();\n }\n\n var pos = wtOverlays.topOverlay.getScrollPosition() - wtOverlays.topOverlay.getTableParentOffset();\n\n if (pos < 0) {\n pos = 0;\n }\n\n var fixedRowsTop = wot.getSetting('fixedRowsTop');\n var fixedRowsBottom = wot.getSetting('fixedRowsBottom');\n var totalRows = wot.getSetting('totalRows');\n\n if (fixedRowsTop) {\n fixedRowsHeight = wtOverlays.topOverlay.sumCellSizes(0, fixedRowsTop);\n pos += fixedRowsHeight;\n height -= fixedRowsHeight;\n }\n\n if (fixedRowsBottom && wtOverlays.bottomOverlay.clone) {\n fixedRowsHeight = wtOverlays.bottomOverlay.sumCellSizes(totalRows - fixedRowsBottom, totalRows);\n height -= fixedRowsHeight;\n }\n\n if (wtTable.holder.clientHeight === wtTable.holder.offsetHeight) {\n scrollbarHeight = 0;\n } else {\n scrollbarHeight = getScrollbarWidth(rootDocument);\n }\n\n return new ViewportRowsCalculator({\n viewportSize: height,\n scrollOffset: pos,\n totalItems: wot.getSetting('totalRows'),\n itemSizeFn: function itemSizeFn(sourceRow) {\n return wtTable.getRowHeight(sourceRow);\n },\n overrideFn: wtSettings.settings.viewportRowCalculatorOverride,\n calculationType: calculationType,\n scrollbarHeight: scrollbarHeight\n });\n }\n /**\n * Creates:\n * - columnsRenderCalculator (before draw, to qualify columns for rendering)\n * - columnsVisibleCalculator (after draw, to measure which columns are actually visible).\n *\n * @param {number} calculationType The render type ID, which determines for what type of\n * calculation calculator is created.\n * @returns {ViewportRowsCalculator}\n */\n\n }, {\n key: \"createColumnsCalculator\",\n value: function createColumnsCalculator() {\n var calculationType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : RENDER_TYPE;\n var wot = this.wot;\n var wtSettings = wot.wtSettings,\n wtOverlays = wot.wtOverlays,\n wtTable = wot.wtTable,\n rootDocument = wot.rootDocument;\n var width = this.getViewportWidth();\n var pos = wtOverlays.leftOverlay.getScrollPosition() - wtOverlays.leftOverlay.getTableParentOffset();\n this.columnHeaderHeight = NaN;\n\n if (pos < 0) {\n pos = 0;\n }\n\n var fixedColumnsLeft = wot.getSetting('fixedColumnsLeft');\n\n if (fixedColumnsLeft) {\n var fixedColumnsWidth = wtOverlays.leftOverlay.sumCellSizes(0, fixedColumnsLeft);\n pos += fixedColumnsWidth;\n width -= fixedColumnsWidth;\n }\n\n if (wtTable.holder.clientWidth !== wtTable.holder.offsetWidth) {\n width -= getScrollbarWidth(rootDocument);\n }\n\n return new ViewportColumnsCalculator({\n viewportSize: width,\n scrollOffset: pos,\n totalItems: wot.getSetting('totalColumns'),\n itemSizeFn: function itemSizeFn(sourceCol) {\n return wot.wtTable.getColumnWidth(sourceCol);\n },\n overrideFn: wtSettings.settings.viewportColumnCalculatorOverride,\n calculationType: calculationType,\n stretchMode: wot.getSetting('stretchH'),\n stretchingItemWidthFn: function stretchingItemWidthFn(stretchedWidth, column) {\n return wot.getSetting('onBeforeStretchingColumnWidth', stretchedWidth, column);\n }\n });\n }\n /**\n * Creates rowsRenderCalculator and columnsRenderCalculator (before draw, to determine what rows and\n * cols should be rendered).\n *\n * @param {boolean} fastDraw If `true`, will try to avoid full redraw and only update the border positions.\n * If `false` or `undefined`, will perform a full redraw.\n * @returns {boolean} The fastDraw value, possibly modified.\n */\n\n }, {\n key: \"createRenderCalculators\",\n value: function createRenderCalculators() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var runFastDraw = fastDraw;\n\n if (runFastDraw) {\n var proposedRowsVisibleCalculator = this.createRowsCalculator(FULLY_VISIBLE_TYPE);\n var proposedColumnsVisibleCalculator = this.createColumnsCalculator(FULLY_VISIBLE_TYPE);\n\n if (!(this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) && this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator))) {\n runFastDraw = false;\n }\n }\n\n if (!runFastDraw) {\n this.rowsRenderCalculator = this.createRowsCalculator(RENDER_TYPE);\n this.columnsRenderCalculator = this.createColumnsCalculator(RENDER_TYPE);\n } // delete temporarily to make sure that renderers always use rowsRenderCalculator, not rowsVisibleCalculator\n\n\n this.rowsVisibleCalculator = null;\n this.columnsVisibleCalculator = null;\n return runFastDraw;\n }\n /**\n * Creates rowsVisibleCalculator and columnsVisibleCalculator (after draw, to determine what are\n * the actually fully visible rows and columns).\n */\n\n }, {\n key: \"createVisibleCalculators\",\n value: function createVisibleCalculators() {\n this.rowsVisibleCalculator = this.createRowsCalculator(FULLY_VISIBLE_TYPE);\n this.columnsVisibleCalculator = this.createColumnsCalculator(FULLY_VISIBLE_TYPE);\n }\n /**\n * Returns information whether proposedRowsVisibleCalculator viewport\n * is contained inside rows rendered in previous draw (cached in rowsRenderCalculator).\n *\n * @param {ViewportRowsCalculator} proposedRowsVisibleCalculator The instance of the viewport calculator to compare with.\n * @returns {boolean} Returns `true` if all proposed visible rows are already rendered (meaning: redraw is not needed).\n * Returns `false` if at least one proposed visible row is not already rendered (meaning: redraw is needed).\n */\n\n }, {\n key: \"areAllProposedVisibleRowsAlreadyRendered\",\n value: function areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) {\n if (!this.rowsVisibleCalculator) {\n return false;\n }\n\n var startRow = proposedRowsVisibleCalculator.startRow,\n endRow = proposedRowsVisibleCalculator.endRow;\n var _this$rowsRenderCalcu = this.rowsRenderCalculator,\n renderedStartRow = _this$rowsRenderCalcu.startRow,\n renderedEndRow = _this$rowsRenderCalcu.endRow;\n\n if (startRow < renderedStartRow || startRow === renderedStartRow && startRow > 0) {\n return false;\n } else if (endRow > renderedEndRow || endRow === renderedEndRow && endRow < this.wot.getSetting('totalRows') - 1) {\n return false;\n }\n\n return true;\n }\n /**\n * Returns information whether proposedColumnsVisibleCalculator viewport\n * is contained inside column rendered in previous draw (cached in columnsRenderCalculator).\n *\n * @param {ViewportRowsCalculator} proposedColumnsVisibleCalculator The instance of the viewport calculator to compare with.\n * @returns {boolean} Returns `true` if all proposed visible columns are already rendered (meaning: redraw is not needed).\n * Returns `false` if at least one proposed visible column is not already rendered (meaning: redraw is needed).\n */\n\n }, {\n key: \"areAllProposedVisibleColumnsAlreadyRendered\",\n value: function areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator) {\n if (!this.columnsVisibleCalculator) {\n return false;\n }\n\n var startColumn = proposedColumnsVisibleCalculator.startColumn,\n endColumn = proposedColumnsVisibleCalculator.endColumn;\n var _this$columnsRenderCa = this.columnsRenderCalculator,\n renderedStartColumn = _this$columnsRenderCa.startColumn,\n renderedEndColumn = _this$columnsRenderCa.endColumn;\n\n if (startColumn < renderedStartColumn || startColumn === renderedStartColumn && startColumn > 0) {\n return false;\n } else if (endColumn > renderedEndColumn || endColumn === renderedEndColumn && endColumn < this.wot.getSetting('totalColumns') - 1) {\n return false;\n }\n\n return true;\n }\n /**\n * Resets values in keys of the hasOversizedColumnHeadersMarked object after updateSettings.\n */\n\n }, {\n key: \"resetHasOversizedColumnHeadersMarked\",\n value: function resetHasOversizedColumnHeadersMarked() {\n objectEach(this.hasOversizedColumnHeadersMarked, function (value, key, object) {\n object[key] = void 0;\n });\n }\n }]);\n\n return Viewport;\n}();\n\nexport default Viewport;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { addClass, fastInnerText, removeClass } from \"./../../../helpers/dom/element.mjs\";\nimport { objectEach } from \"./../../../helpers/object.mjs\";\nimport { randomString } from \"./../../../helpers/string.mjs\";\nimport Event from \"./event.mjs\";\nimport Overlays from \"./overlays.mjs\";\nimport Scroll from \"./scroll.mjs\";\nimport Settings from \"./settings.mjs\";\nimport MasterTable from \"./table/master.mjs\";\nimport Viewport from \"./viewport.mjs\";\n/**\n * @class Walkontable\n */\n\nvar Walkontable = /*#__PURE__*/function () {\n /**\n * @param {object} settings The Walkontable settings.\n */\n function Walkontable(settings) {\n _classCallCheck(this, Walkontable);\n\n var originalHeaders = []; // this is the namespace for global events\n\n this.guid = \"wt_\".concat(randomString());\n this.rootDocument = settings.table.ownerDocument;\n this.rootWindow = this.rootDocument.defaultView; // bootstrap from settings\n\n if (settings.cloneSource) {\n this.cloneSource = settings.cloneSource;\n this.cloneOverlay = settings.cloneOverlay;\n this.wtSettings = settings.cloneSource.wtSettings;\n this.wtTable = this.cloneOverlay.createTable(this, settings.table);\n this.wtScroll = new Scroll(this);\n this.wtViewport = settings.cloneSource.wtViewport;\n this.wtEvent = new Event(this);\n this.selections = this.cloneSource.selections;\n } else {\n this.wtSettings = new Settings(this, settings);\n this.wtTable = new MasterTable(this, settings.table);\n this.wtScroll = new Scroll(this);\n this.wtViewport = new Viewport(this);\n this.wtEvent = new Event(this);\n this.selections = this.getSetting('selections');\n this.wtOverlays = new Overlays(this);\n this.exportSettingsAsClassNames();\n } // find original headers\n\n\n if (this.wtTable.THEAD.childNodes.length && this.wtTable.THEAD.childNodes[0].childNodes.length) {\n for (var c = 0, clen = this.wtTable.THEAD.childNodes[0].childNodes.length; c < clen; c++) {\n originalHeaders.push(this.wtTable.THEAD.childNodes[0].childNodes[c].innerHTML);\n }\n\n if (!this.getSetting('columnHeaders').length) {\n this.update('columnHeaders', [function (column, TH) {\n fastInnerText(TH, originalHeaders[column]);\n }]);\n }\n }\n\n this.drawn = false;\n this.drawInterrupted = false;\n }\n /**\n * Force rerender of Walkontable.\n *\n * @param {boolean} [fastDraw=false] When `true`, try to refresh only the positions of borders without rerendering\n * the data. It will only work if Table.draw() does not force\n * rendering anyway.\n * @returns {Walkontable}\n */\n\n\n _createClass(Walkontable, [{\n key: \"draw\",\n value: function draw() {\n var fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n this.drawInterrupted = false;\n\n if (!fastDraw && !this.wtTable.isVisible()) {\n // draw interrupted because TABLE is not visible\n this.drawInterrupted = true;\n } else {\n this.wtTable.draw(fastDraw);\n }\n\n return this;\n }\n /**\n * Returns the TD at coords. If topmost is set to true, returns TD from the topmost overlay layer,\n * if not set or set to false, returns TD from the master table.\n *\n * @param {CellCoords} coords The cell coordinates.\n * @param {boolean} [topmost=false] If set to `true`, it returns the TD element from the topmost overlay. For example,\n * if the wanted cell is in the range of fixed rows, it will return a TD element\n * from the top overlay.\n * @returns {HTMLElement}\n */\n\n }, {\n key: \"getCell\",\n value: function getCell(coords) {\n var topmost = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!topmost) {\n return this.wtTable.getCell(coords);\n }\n\n var totalRows = this.wtSettings.getSetting('totalRows');\n var fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');\n var fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom');\n var fixedColumns = this.wtSettings.getSetting('fixedColumnsLeft');\n\n if (coords.row < fixedRowsTop && coords.col < fixedColumns) {\n return this.wtOverlays.topLeftCornerOverlay.clone.wtTable.getCell(coords);\n } else if (coords.row < fixedRowsTop) {\n return this.wtOverlays.topOverlay.clone.wtTable.getCell(coords);\n } else if (coords.col < fixedColumns && coords.row >= totalRows - fixedRowsBottom) {\n if (this.wtOverlays.bottomLeftCornerOverlay && this.wtOverlays.bottomLeftCornerOverlay.clone) {\n return this.wtOverlays.bottomLeftCornerOverlay.clone.wtTable.getCell(coords);\n }\n } else if (coords.col < fixedColumns) {\n return this.wtOverlays.leftOverlay.clone.wtTable.getCell(coords);\n } else if (coords.row < totalRows && coords.row >= totalRows - fixedRowsBottom) {\n if (this.wtOverlays.bottomOverlay && this.wtOverlays.bottomOverlay.clone) {\n return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords);\n }\n }\n\n return this.wtTable.getCell(coords);\n }\n /**\n * @param {object} settings The singular settings to update or if passed as object to merge with.\n * @param {*} value The value to set if the first argument is passed as string.\n * @returns {Walkontable}\n */\n\n }, {\n key: \"update\",\n value: function update(settings, value) {\n return this.wtSettings.update(settings, value);\n }\n /**\n * Scrolls the viewport to a cell (rerenders if needed).\n *\n * @param {CellCoords} coords The cell coordinates to scroll to.\n * @param {boolean} [snapToTop] If `true`, viewport is scrolled to show the cell on the top of the table.\n * @param {boolean} [snapToRight] If `true`, viewport is scrolled to show the cell on the right of the table.\n * @param {boolean} [snapToBottom] If `true`, viewport is scrolled to show the cell on the bottom of the table.\n * @param {boolean} [snapToLeft] If `true`, viewport is scrolled to show the cell on the left of the table.\n * @returns {boolean}\n */\n\n }, {\n key: \"scrollViewport\",\n value: function scrollViewport(coords, snapToTop, snapToRight, snapToBottom, snapToLeft) {\n if (coords.col < 0 || coords.row < 0) {\n return false;\n }\n\n return this.wtScroll.scrollViewport(coords, snapToTop, snapToRight, snapToBottom, snapToLeft);\n }\n /**\n * Scrolls the viewport to a column (rerenders if needed).\n *\n * @param {number} column Visual column index.\n * @param {boolean} [snapToRight] If `true`, viewport is scrolled to show the cell on the right of the table.\n * @param {boolean} [snapToLeft] If `true`, viewport is scrolled to show the cell on the left of the table.\n * @returns {boolean}\n */\n\n }, {\n key: \"scrollViewportHorizontally\",\n value: function scrollViewportHorizontally(column, snapToRight, snapToLeft) {\n if (column < 0) {\n return false;\n }\n\n return this.wtScroll.scrollViewportHorizontally(column, snapToRight, snapToLeft);\n }\n /**\n * Scrolls the viewport to a row (rerenders if needed).\n *\n * @param {number} row Visual row index.\n * @param {boolean} [snapToTop] If `true`, viewport is scrolled to show the cell on the top of the table.\n * @param {boolean} [snapToBottom] If `true`, viewport is scrolled to show the cell on the bottom of the table.\n * @returns {boolean}\n */\n\n }, {\n key: \"scrollViewportVertically\",\n value: function scrollViewportVertically(row, snapToTop, snapToBottom) {\n if (row < 0) {\n return false;\n }\n\n return this.wtScroll.scrollViewportVertically(row, snapToTop, snapToBottom);\n }\n /**\n * @returns {Array}\n */\n\n }, {\n key: \"getViewport\",\n value: function getViewport() {\n return [this.wtTable.getFirstVisibleRow(), this.wtTable.getFirstVisibleColumn(), this.wtTable.getLastVisibleRow(), this.wtTable.getLastVisibleColumn()];\n }\n /**\n * Get overlay name.\n *\n * @returns {string}\n */\n\n }, {\n key: \"getOverlayName\",\n value: function getOverlayName() {\n return this.cloneOverlay ? this.cloneOverlay.type : 'master';\n }\n /**\n * Export settings as class names added to the parent element of the table.\n */\n\n }, {\n key: \"exportSettingsAsClassNames\",\n value: function exportSettingsAsClassNames() {\n var _this = this;\n\n var toExport = {\n rowHeaders: 'htRowHeaders',\n columnHeaders: 'htColumnHeaders'\n };\n var allClassNames = [];\n var newClassNames = [];\n objectEach(toExport, function (className, key) {\n if (_this.getSetting(key).length) {\n newClassNames.push(className);\n }\n\n allClassNames.push(className);\n });\n removeClass(this.wtTable.wtRootElement.parentNode, allClassNames);\n addClass(this.wtTable.wtRootElement.parentNode, newClassNames);\n }\n /**\n * Get/Set Walkontable instance setting.\n *\n * @param {string} key The settings key to retrieve.\n * @param {*} [param1] Additional parameter passed to the options defined as function.\n * @param {*} [param2] Additional parameter passed to the options defined as function.\n * @param {*} [param3] Additional parameter passed to the options defined as function.\n * @param {*} [param4] Additional parameter passed to the options defined as function.\n * @returns {*}\n */\n\n }, {\n key: \"getSetting\",\n value: function getSetting(key, param1, param2, param3, param4) {\n // this is faster than .apply - https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n return this.wtSettings.getSetting(key, param1, param2, param3, param4);\n }\n /**\n * Checks if setting exists.\n *\n * @param {string} key The settings key to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"hasSetting\",\n value: function hasSetting(key) {\n return this.wtSettings.has(key);\n }\n /**\n * Destroy instance.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.wtOverlays.destroy();\n this.wtEvent.destroy();\n }\n }]);\n\n return Walkontable;\n}();\n\nexport default Walkontable;","import \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport { isRightClick as isRightClickEvent, isLeftClick as isLeftClickEvent } from \"./../helpers/dom/event.mjs\";\nimport { CellCoords } from \"./../3rdparty/walkontable/src/index.mjs\";\n/**\n * MouseDown handler.\n *\n * @param {object} options The handler options.\n * @param {boolean} options.isShiftKey The flag which indicates if the shift key is pressed.\n * @param {boolean} options.isLeftClick The flag which indicates if the left mouse button is pressed.\n * @param {boolean} options.isRightClick The flag which indicates if the right mouse button is pressed.\n * @param {CellRange} options.coords The CellCoords object with defined visual coordinates.\n * @param {Selection} options.selection The Selection class instance.\n * @param {object} options.controller An object with keys `row`, `column`, `cell` which indicate what\n * operation will be performed in later selection stages.\n */\n\nexport function mouseDown(_ref) {\n var isShiftKey = _ref.isShiftKey,\n isLeftClick = _ref.isLeftClick,\n isRightClick = _ref.isRightClick,\n coords = _ref.coords,\n selection = _ref.selection,\n controller = _ref.controller;\n var currentSelection = selection.isSelected() ? selection.getSelectedRange().current() : null;\n var selectedCorner = selection.isSelectedByCorner();\n var selectedRow = selection.isSelectedByRowHeader();\n\n if (isShiftKey && currentSelection) {\n if (coords.row >= 0 && coords.col >= 0 && !controller.cells) {\n selection.setRangeEnd(coords);\n } else if ((selectedCorner || selectedRow) && coords.row >= 0 && coords.col >= 0 && !controller.cells) {\n selection.setRangeEnd(new CellCoords(coords.row, coords.col));\n } else if (selectedCorner && coords.row < 0 && !controller.column) {\n selection.setRangeEnd(new CellCoords(currentSelection.to.row, coords.col));\n } else if (selectedRow && coords.col < 0 && !controller.row) {\n selection.setRangeEnd(new CellCoords(coords.row, currentSelection.to.col));\n } else if ((!selectedCorner && !selectedRow && coords.col < 0 || selectedCorner && coords.col < 0) && !controller.row) {\n selection.selectRows(Math.max(currentSelection.from.row, 0), coords.row, coords.col);\n } else if ((!selectedCorner && !selectedRow && coords.row < 0 || selectedRow && coords.row < 0) && !controller.column) {\n selection.selectColumns(Math.max(currentSelection.from.col, 0), coords.col, coords.row);\n }\n } else {\n var allowRightClickSelection = !selection.inInSelection(coords);\n var performSelection = isLeftClick || isRightClick && allowRightClickSelection; // clicked row header and when some column was selected\n\n if (coords.row < 0 && coords.col >= 0 && !controller.column) {\n if (performSelection) {\n selection.selectColumns(coords.col, coords.col, coords.row);\n } // clicked column header and when some row was selected\n\n } else if (coords.col < 0 && coords.row >= 0 && !controller.row) {\n if (performSelection) {\n selection.selectRows(coords.row, coords.row, coords.col);\n }\n } else if (coords.col >= 0 && coords.row >= 0 && !controller.cells) {\n if (performSelection) {\n selection.setRangeStart(coords);\n }\n } else if (coords.col < 0 && coords.row < 0) {\n selection.selectAll(true, true);\n }\n }\n}\n/**\n * MouseOver handler.\n *\n * @param {object} options The handler options.\n * @param {boolean} options.isLeftClick Indicates that event was fired using the left mouse button.\n * @param {CellRange} options.coords The CellCoords object with defined visual coordinates.\n * @param {Selection} options.selection The Selection class instance.\n * @param {object} options.controller An object with keys `row`, `column`, `cell` which indicate what\n * operation will be performed in later selection stages.\n */\n\nexport function mouseOver(_ref2) {\n var isLeftClick = _ref2.isLeftClick,\n coords = _ref2.coords,\n selection = _ref2.selection,\n controller = _ref2.controller;\n\n if (!isLeftClick) {\n return;\n }\n\n var selectedRow = selection.isSelectedByRowHeader();\n var selectedColumn = selection.isSelectedByColumnHeader();\n var countCols = selection.tableProps.countCols();\n var countRows = selection.tableProps.countRows();\n\n if (selectedColumn && !controller.column) {\n selection.setRangeEnd(new CellCoords(countRows - 1, coords.col));\n } else if (selectedRow && !controller.row) {\n selection.setRangeEnd(new CellCoords(coords.row, countCols - 1));\n } else if (!controller.cell) {\n selection.setRangeEnd(coords);\n }\n}\nvar handlers = new Map([['mousedown', mouseDown], ['mouseover', mouseOver], ['touchstart', mouseDown]]);\n/**\n * Mouse handler for selection functionality.\n *\n * @param {Event} event An native event to handle.\n * @param {object} options The handler options.\n * @param {CellRange} options.coords The CellCoords object with defined visual coordinates.\n * @param {Selection} options.selection The Selection class instance.\n * @param {object} options.controller An object with keys `row`, `column`, `cell` which indicate what\n * operation will be performed in later selection stages.\n */\n\nexport function handleMouseEvent(event, _ref3) {\n var coords = _ref3.coords,\n selection = _ref3.selection,\n controller = _ref3.controller;\n handlers.get(event.type)({\n coords: coords,\n selection: selection,\n controller: controller,\n isShiftKey: event.shiftKey,\n isLeftClick: isLeftClickEvent(event) || event.type === 'touchstart',\n isRightClick: isRightClickEvent(event)\n });\n}","import \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/es.weak-map.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nexport var holder = new WeakMap();\nexport var rootInstanceSymbol = Symbol('rootInstance');\n/**\n * Register an object as a root instance.\n *\n * @param {object} object An object to associate with root instance flag.\n */\n\nexport function registerAsRootInstance(object) {\n holder.set(object, true);\n}\n/**\n * Check if the source of the root indication call is valid.\n *\n * @param {symbol} rootSymbol A symbol as a source of truth.\n * @returns {boolean}\n */\n\nexport function hasValidParameter(rootSymbol) {\n return rootSymbol === rootInstanceSymbol;\n}\n/**\n * Check if passed an object was flagged as a root instance.\n *\n * @param {object} object An object to check.\n * @returns {boolean}\n */\n\nexport function isRootInstance(object) {\n return holder.has(object);\n}","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/es.weak-map.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.number.is-integer.js\";\nimport \"core-js/modules/es.number.constructor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport { addClass, clearTextSelection, empty, fastInnerHTML, fastInnerText, getScrollbarWidth, hasClass, isChildOf, isInput, isOutsideInput } from \"./helpers/dom/element.mjs\";\nimport EventManager from \"./eventManager.mjs\";\nimport { isImmediatePropagationStopped, isRightClick, isLeftClick } from \"./helpers/dom/event.mjs\";\nimport Walkontable, { CellCoords } from \"./3rdparty/walkontable/src/index.mjs\";\nimport { handleMouseEvent } from \"./selection/mouseEventHandler.mjs\";\nimport { isRootInstance } from \"./utils/rootInstance.mjs\";\nvar privatePool = new WeakMap();\n/**\n * @class TableView\n * @private\n */\n\nvar TableView = /*#__PURE__*/function () {\n /**\n * @param {Hanstontable} instance Instance of {@link Handsontable}.\n */\n function TableView(instance) {\n _classCallCheck(this, TableView);\n\n /**\n * Instance of {@link Handsontable}.\n *\n * @private\n * @type {Handsontable}\n */\n this.instance = instance;\n /**\n * Instance of {@link EventManager}.\n *\n * @private\n * @type {EventManager}\n */\n\n this.eventManager = new EventManager(instance);\n /**\n * Current Handsontable's GridSettings object.\n *\n * @private\n * @type {GridSettings}\n */\n\n this.settings = instance.getSettings();\n /**\n * Main element.\n *\n * @type {HTMLTableSectionElement}\n */\n\n this.THEAD = void 0;\n /**\n * Main element.\n *\n * @type {HTMLTableSectionElement}\n */\n\n this.TBODY = void 0;\n /**\n * Main Walkontable instance.\n *\n * @type {Walkontable}\n */\n\n this.wt = void 0;\n /**\n * Main Walkontable instance.\n *\n * @private\n * @type {Walkontable}\n */\n\n this.activeWt = void 0;\n /**\n * The flag determines if the `adjustElementsSize` method call was made during\n * the render suspending. If true, the method has to be triggered once after render\n * resuming.\n *\n * @private\n * @type {boolean}\n */\n\n this.postponedAdjustElementsSize = false;\n privatePool.set(this, {\n /**\n * Defines if the text should be selected during mousemove.\n *\n * @private\n * @type {boolean}\n */\n selectionMouseDown: false,\n\n /**\n * @private\n * @type {boolean}\n */\n mouseDown: void 0,\n\n /**\n * Main element.\n *\n * @private\n * @type {HTMLTableElement}\n */\n table: void 0,\n\n /**\n * Cached width of the rootElement.\n *\n * @type {number}\n */\n lastWidth: 0,\n\n /**\n * Cached height of the rootElement.\n *\n * @type {number}\n */\n lastHeight: 0\n });\n this.createElements();\n this.registerEvents();\n this.initializeWalkontable();\n }\n /**\n * Renders WalkontableUI.\n */\n\n\n _createClass(TableView, [{\n key: \"render\",\n value: function render() {\n if (!this.instance.isRenderSuspended()) {\n if (this.postponedAdjustElementsSize) {\n this.postponedAdjustElementsSize = false;\n this.adjustElementsSize(true);\n }\n\n this.wt.draw(!this.instance.forceFullRender);\n this.instance.forceFullRender = false;\n this.instance.renderCall = false;\n }\n }\n /**\n * Adjust overlays elements size and master table size.\n *\n * @param {boolean} [force=false] When `true`, it adjust the DOM nodes sizes for all overlays.\n */\n\n }, {\n key: \"adjustElementsSize\",\n value: function adjustElementsSize() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (this.instance.isRenderSuspended()) {\n this.postponedAdjustElementsSize = true;\n } else {\n this.wt.wtOverlays.adjustElementsSize(force);\n }\n }\n /**\n * Returns td object given coordinates.\n *\n * @param {CellCoords} coords Renderable cell coordinates.\n * @param {boolean} topmost Indicates whether the cell should be calculated from the topmost.\n * @returns {HTMLTableCellElement|null}\n */\n\n }, {\n key: \"getCellAtCoords\",\n value: function getCellAtCoords(coords, topmost) {\n var td = this.wt.getCell(coords, topmost);\n\n if (td < 0) {\n // there was an exit code (cell is out of bounds)\n return null;\n }\n\n return td;\n }\n /**\n * Scroll viewport to a cell.\n *\n * @param {CellCoords} coords Renderable cell coordinates.\n * @param {boolean} [snapToTop] If `true`, viewport is scrolled to show the cell on the top of the table.\n * @param {boolean} [snapToRight] If `true`, viewport is scrolled to show the cell on the right side of the table.\n * @param {boolean} [snapToBottom] If `true`, viewport is scrolled to show the cell on the bottom side of the table.\n * @param {boolean} [snapToLeft] If `true`, viewport is scrolled to show the cell on the left side of the table.\n * @returns {boolean}\n */\n\n }, {\n key: \"scrollViewport\",\n value: function scrollViewport(coords, snapToTop, snapToRight, snapToBottom, snapToLeft) {\n return this.wt.scrollViewport(coords, snapToTop, snapToRight, snapToBottom, snapToLeft);\n }\n /**\n * Scroll viewport to a column.\n *\n * @param {number} column Renderable column index.\n * @param {boolean} [snapToRight] If `true`, viewport is scrolled to show the cell on the right side of the table.\n * @param {boolean} [snapToLeft] If `true`, viewport is scrolled to show the cell on the left side of the table.\n * @returns {boolean}\n */\n\n }, {\n key: \"scrollViewportHorizontally\",\n value: function scrollViewportHorizontally(column, snapToRight, snapToLeft) {\n return this.wt.scrollViewportHorizontally(column, snapToRight, snapToLeft);\n }\n /**\n * Scroll viewport to a row.\n *\n * @param {number} row Renderable row index.\n * @param {boolean} [snapToTop] If `true`, viewport is scrolled to show the cell on the top of the table.\n * @param {boolean} [snapToBottom] If `true`, viewport is scrolled to show the cell on the bottom side of the table.\n * @returns {boolean}\n */\n\n }, {\n key: \"scrollViewportVertically\",\n value: function scrollViewportVertically(row, snapToTop, snapToBottom) {\n return this.wt.scrollViewportVertically(row, snapToTop, snapToBottom);\n }\n /**\n * Prepares DOMElements and adds correct className to the root element.\n *\n * @private\n */\n\n }, {\n key: \"createElements\",\n value: function createElements() {\n var priv = privatePool.get(this);\n var _this$instance = this.instance,\n rootElement = _this$instance.rootElement,\n rootDocument = _this$instance.rootDocument;\n var originalStyle = rootElement.getAttribute('style');\n\n if (originalStyle) {\n rootElement.setAttribute('data-originalstyle', originalStyle); // needed to retrieve original style in jsFiddle link generator in HT examples. may be removed in future versions\n }\n\n addClass(rootElement, 'handsontable');\n priv.table = rootDocument.createElement('TABLE');\n addClass(priv.table, 'htCore');\n\n if (this.instance.getSettings().tableClassName) {\n addClass(priv.table, this.instance.getSettings().tableClassName);\n }\n\n this.THEAD = rootDocument.createElement('THEAD');\n priv.table.appendChild(this.THEAD);\n this.TBODY = rootDocument.createElement('TBODY');\n priv.table.appendChild(this.TBODY);\n this.instance.table = priv.table;\n this.instance.container.insertBefore(priv.table, this.instance.container.firstChild);\n }\n /**\n * Attaches necessary listeners.\n *\n * @private\n */\n\n }, {\n key: \"registerEvents\",\n value: function registerEvents() {\n var _this = this;\n\n var priv = privatePool.get(this);\n var _this$instance2 = this.instance,\n rootElement = _this$instance2.rootElement,\n rootDocument = _this$instance2.rootDocument,\n selection = _this$instance2.selection;\n var documentElement = rootDocument.documentElement;\n this.eventManager.addEventListener(rootElement, 'mousedown', function (event) {\n priv.selectionMouseDown = true;\n\n if (!_this.isTextSelectionAllowed(event.target)) {\n var rootWindow = _this.instance.rootWindow;\n clearTextSelection(rootWindow);\n event.preventDefault();\n rootWindow.focus(); // make sure that window that contains HOT is active. Important when HOT is in iframe.\n }\n });\n this.eventManager.addEventListener(rootElement, 'mouseup', function () {\n priv.selectionMouseDown = false;\n });\n this.eventManager.addEventListener(rootElement, 'mousemove', function (event) {\n if (priv.selectionMouseDown && !_this.isTextSelectionAllowed(event.target)) {\n // Clear selection only when fragmentSelection is enabled, otherwise clearing selection breakes the IME editor.\n if (_this.settings.fragmentSelection) {\n clearTextSelection(_this.instance.rootWindow);\n }\n\n event.preventDefault();\n }\n });\n this.eventManager.addEventListener(documentElement, 'keyup', function (event) {\n if (selection.isInProgress() && !event.shiftKey) {\n selection.finish();\n }\n });\n this.eventManager.addEventListener(documentElement, 'mouseup', function (event) {\n if (selection.isInProgress() && isLeftClick(event)) {\n // is left mouse button\n selection.finish();\n }\n\n priv.mouseDown = false;\n\n if (isOutsideInput(rootDocument.activeElement) || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !isRightClick(event)) {\n _this.instance.unlisten();\n }\n });\n this.eventManager.addEventListener(documentElement, 'contextmenu', function (event) {\n if (selection.isInProgress() && isRightClick(event)) {\n selection.finish();\n priv.mouseDown = false;\n }\n });\n this.eventManager.addEventListener(documentElement, 'touchend', function () {\n if (selection.isInProgress()) {\n selection.finish();\n }\n\n priv.mouseDown = false;\n });\n this.eventManager.addEventListener(documentElement, 'mousedown', function (event) {\n var originalTarget = event.target;\n var eventX = event.x || event.clientX;\n var eventY = event.y || event.clientY;\n var next = event.target;\n\n if (priv.mouseDown || !rootElement || !_this.instance.view) {\n return; // it must have been started in a cell\n } // immediate click on \"holder\" means click on the right side of vertical scrollbar\n\n\n var holder = _this.instance.view.wt.wtTable.holder;\n\n if (next === holder) {\n var scrollbarWidth = getScrollbarWidth(rootDocument);\n\n if (rootDocument.elementFromPoint(eventX + scrollbarWidth, eventY) !== holder || rootDocument.elementFromPoint(eventX, eventY + scrollbarWidth) !== holder) {\n return;\n }\n } else {\n while (next !== documentElement) {\n if (next === null) {\n if (event.isTargetWebComponent) {\n break;\n } // click on something that was a row but now is detached (possibly because your click triggered a rerender)\n\n\n return;\n }\n\n if (next === rootElement) {\n // click inside container\n return;\n }\n\n next = next.parentNode;\n }\n } // function did not return until here, we have an outside click!\n\n\n var outsideClickDeselects = typeof _this.settings.outsideClickDeselects === 'function' ? _this.settings.outsideClickDeselects(originalTarget) : _this.settings.outsideClickDeselects;\n\n if (outsideClickDeselects) {\n _this.instance.deselectCell();\n } else {\n _this.instance.destroyEditor(false, false);\n }\n });\n this.eventManager.addEventListener(priv.table, 'selectstart', function (event) {\n if (_this.settings.fragmentSelection || isInput(event.target)) {\n return;\n } // https://github.com/handsontable/handsontable/issues/160\n // Prevent text from being selected when performing drag down.\n\n\n event.preventDefault();\n });\n }\n /**\n * Translate renderable cell coordinates to visual coordinates.\n *\n * @param {CellCoords} coords The cell coordinates.\n * @returns {CellCoords}\n */\n\n }, {\n key: \"translateFromRenderableToVisualCoords\",\n value: function translateFromRenderableToVisualCoords(_ref) {\n var row = _ref.row,\n col = _ref.col;\n // TODO: To consider an idea to reusing the CellCoords instance instead creating new one.\n return _construct(CellCoords, _toConsumableArray(this.translateFromRenderableToVisualIndex(row, col)));\n }\n /**\n * Translate renderable row and column indexes to visual row and column indexes.\n *\n * @param {number} renderableRow Renderable row index.\n * @param {number} renderableColumn Renderable columnIndex.\n * @returns {number[]}\n */\n\n }, {\n key: \"translateFromRenderableToVisualIndex\",\n value: function translateFromRenderableToVisualIndex(renderableRow, renderableColumn) {\n // TODO: Some helper may be needed.\n // We perform translation for indexes (without headers).\n var visualRow = renderableRow >= 0 ? this.instance.rowIndexMapper.getVisualFromRenderableIndex(renderableRow) : renderableRow;\n var visualColumn = renderableColumn >= 0 ? this.instance.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn) : renderableColumn;\n\n if (visualRow === null) {\n visualRow = renderableRow;\n }\n\n if (visualColumn === null) {\n visualColumn = renderableColumn;\n }\n\n return [visualRow, visualColumn];\n }\n /**\n * Returns the number of renderable indexes.\n *\n * @private\n * @param {IndexMapper} indexMapper The IndexMapper instance for specific axis.\n * @param {number} maxElements Maximum number of elements (rows or columns).\n *\n * @returns {number|*}\n */\n\n }, {\n key: \"countRenderableIndexes\",\n value: function countRenderableIndexes(indexMapper, maxElements) {\n var consideredElements = Math.min(indexMapper.getNotTrimmedIndexesLength(), maxElements); // Don't take hidden indexes into account. We are looking just for renderable indexes.\n\n var firstNotHiddenIndex = indexMapper.getFirstNotHiddenIndex(consideredElements - 1, -1); // There are no renderable indexes.\n\n if (firstNotHiddenIndex === null) {\n return 0;\n }\n\n return indexMapper.getRenderableFromVisualIndex(firstNotHiddenIndex) + 1;\n }\n /**\n * Returns the number of renderable columns.\n *\n * @returns {number}\n */\n\n }, {\n key: \"countRenderableColumns\",\n value: function countRenderableColumns() {\n return this.countRenderableIndexes(this.instance.columnIndexMapper, this.settings.maxCols);\n }\n /**\n * Returns the number of renderable rows.\n *\n * @returns {number}\n */\n\n }, {\n key: \"countRenderableRows\",\n value: function countRenderableRows() {\n return this.countRenderableIndexes(this.instance.rowIndexMapper, this.settings.maxRows);\n }\n /**\n * Returns number of not hidden row indexes counting from the passed starting index.\n * The counting direction can be controlled by `incrementBy` argument.\n *\n * @param {number} visualIndex The visual index from which the counting begins.\n * @param {number} incrementBy If `-1` then counting is backwards or forward when `1`.\n * @returns {number}\n */\n\n }, {\n key: \"countNotHiddenRowIndexes\",\n value: function countNotHiddenRowIndexes(visualIndex, incrementBy) {\n return this.countNotHiddenIndexes(visualIndex, incrementBy, this.instance.rowIndexMapper, this.countRenderableRows());\n }\n /**\n * Returns number of not hidden column indexes counting from the passed starting index.\n * The counting direction can be controlled by `incrementBy` argument.\n *\n * @param {number} visualIndex The visual index from which the counting begins.\n * @param {number} incrementBy If `-1` then counting is backwards or forward when `1`.\n * @returns {number}\n */\n\n }, {\n key: \"countNotHiddenColumnIndexes\",\n value: function countNotHiddenColumnIndexes(visualIndex, incrementBy) {\n return this.countNotHiddenIndexes(visualIndex, incrementBy, this.instance.columnIndexMapper, this.countRenderableColumns());\n }\n /**\n * Returns number of not hidden indexes counting from the passed starting index.\n * The counting direction can be controlled by `incrementBy` argument.\n *\n * @param {number} visualIndex The visual index from which the counting begins.\n * @param {number} incrementBy If `-1` then counting is backwards or forward when `1`.\n * @param {IndexMapper} indexMapper The IndexMapper instance for specific axis.\n * @param {number} renderableIndexesCount Total count of renderable indexes for specific axis.\n * @returns {number}\n */\n\n }, {\n key: \"countNotHiddenIndexes\",\n value: function countNotHiddenIndexes(visualIndex, incrementBy, indexMapper, renderableIndexesCount) {\n if (isNaN(visualIndex) || visualIndex < 0) {\n return 0;\n }\n\n var firstVisibleIndex = indexMapper.getFirstNotHiddenIndex(visualIndex, incrementBy);\n var renderableIndex = indexMapper.getRenderableFromVisualIndex(firstVisibleIndex);\n\n if (!Number.isInteger(renderableIndex)) {\n return 0;\n }\n\n var notHiddenIndexes = 0;\n\n if (incrementBy < 0) {\n // Zero-based numbering for renderable indexes corresponds to a number of not hidden indexes.\n notHiddenIndexes = renderableIndex + 1;\n } else if (incrementBy > 0) {\n notHiddenIndexes = renderableIndexesCount - renderableIndex;\n }\n\n return notHiddenIndexes;\n }\n /**\n * Defines default configuration and initializes WalkOnTable intance.\n *\n * @private\n */\n\n }, {\n key: \"initializeWalkontable\",\n value: function initializeWalkontable() {\n var _this2 = this;\n\n var priv = privatePool.get(this);\n var walkontableConfig = {\n externalRowCalculator: this.instance.getPlugin('autoRowSize') && this.instance.getPlugin('autoRowSize').isEnabled(),\n table: priv.table,\n isDataViewInstance: function isDataViewInstance() {\n return isRootInstance(_this2.instance);\n },\n preventOverflow: function preventOverflow() {\n return _this2.settings.preventOverflow;\n },\n preventWheel: function preventWheel() {\n return _this2.settings.preventWheel;\n },\n stretchH: function stretchH() {\n return _this2.settings.stretchH;\n },\n data: function data(renderableRow, renderableColumn) {\n var _this2$instance;\n\n return (_this2$instance = _this2.instance).getDataAtCell.apply(_this2$instance, _toConsumableArray(_this2.translateFromRenderableToVisualIndex(renderableRow, renderableColumn)));\n },\n totalRows: function totalRows() {\n return _this2.countRenderableRows();\n },\n totalColumns: function totalColumns() {\n return _this2.countRenderableColumns();\n },\n // Number of renderable columns for the left overlay.\n fixedColumnsLeft: function fixedColumnsLeft() {\n var countCols = _this2.instance.countCols();\n\n var visualFixedColumnsLeft = Math.min(parseInt(_this2.settings.fixedColumnsLeft, 10), countCols) - 1;\n return _this2.countNotHiddenColumnIndexes(visualFixedColumnsLeft, -1);\n },\n // Number of renderable rows for the top overlay.\n fixedRowsTop: function fixedRowsTop() {\n var countRows = _this2.instance.countRows();\n\n var visualFixedRowsTop = Math.min(parseInt(_this2.settings.fixedRowsTop, 10), countRows) - 1;\n return _this2.countNotHiddenRowIndexes(visualFixedRowsTop, -1);\n },\n // Number of renderable rows for the bottom overlay.\n fixedRowsBottom: function fixedRowsBottom() {\n var countRows = _this2.instance.countRows();\n\n var visualFixedRowsBottom = Math.max(countRows - parseInt(_this2.settings.fixedRowsBottom, 10), 0);\n return _this2.countNotHiddenRowIndexes(visualFixedRowsBottom, 1);\n },\n // Enable the left overlay when conditions are met.\n shouldRenderLeftOverlay: function shouldRenderLeftOverlay() {\n return _this2.settings.fixedColumnsLeft > 0 || walkontableConfig.rowHeaders().length > 0;\n },\n // Enable the top overlay when conditions are met.\n shouldRenderTopOverlay: function shouldRenderTopOverlay() {\n return _this2.settings.fixedRowsTop > 0 || walkontableConfig.columnHeaders().length > 0;\n },\n // Enable the bottom overlay when conditions are met.\n shouldRenderBottomOverlay: function shouldRenderBottomOverlay() {\n return _this2.settings.fixedRowsBottom > 0;\n },\n minSpareRows: function minSpareRows() {\n return _this2.settings.minSpareRows;\n },\n renderAllRows: this.settings.renderAllRows,\n rowHeaders: function rowHeaders() {\n var headerRenderers = [];\n\n if (_this2.instance.hasRowHeaders()) {\n headerRenderers.push(function (renderableRowIndex, TH) {\n // TODO: Some helper may be needed.\n // We perform translation for row indexes (without row headers).\n var visualRowIndex = renderableRowIndex >= 0 ? _this2.instance.rowIndexMapper.getVisualFromRenderableIndex(renderableRowIndex) : renderableRowIndex;\n\n _this2.appendRowHeader(visualRowIndex, TH);\n });\n }\n\n _this2.instance.runHooks('afterGetRowHeaderRenderers', headerRenderers);\n\n return headerRenderers;\n },\n columnHeaders: function columnHeaders() {\n var headerRenderers = [];\n\n if (_this2.instance.hasColHeaders()) {\n headerRenderers.push(function (renderedColumnIndex, TH) {\n // TODO: Some helper may be needed.\n // We perform translation for columns indexes (without column headers).\n var visualColumnsIndex = renderedColumnIndex >= 0 ? _this2.instance.columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex) : renderedColumnIndex;\n\n _this2.appendColHeader(visualColumnsIndex, TH);\n });\n }\n\n _this2.instance.runHooks('afterGetColumnHeaderRenderers', headerRenderers);\n\n return headerRenderers;\n },\n columnWidth: function columnWidth(renderedColumnIndex) {\n var visualIndex = _this2.instance.columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex); // It's not a bug that we can't find visual index for some handled by method indexes. The function is called also\n // for not displayed indexes (beyond the table boundaries), i.e. when `fixedColumnsLeft` > `startCols` (wrong config?) or\n // scrolling and dataset is empty (scroll should handle that?).\n\n\n return _this2.instance.getColWidth(visualIndex === null ? renderedColumnIndex : visualIndex);\n },\n rowHeight: function rowHeight(renderedRowIndex) {\n var visualIndex = _this2.instance.rowIndexMapper.getVisualFromRenderableIndex(renderedRowIndex);\n\n return _this2.instance.getRowHeight(visualIndex === null ? renderedRowIndex : visualIndex);\n },\n cellRenderer: function cellRenderer(renderedRowIndex, renderedColumnIndex, TD) {\n var _this2$translateFromR = _this2.translateFromRenderableToVisualIndex(renderedRowIndex, renderedColumnIndex),\n _this2$translateFromR2 = _slicedToArray(_this2$translateFromR, 2),\n visualRowIndex = _this2$translateFromR2[0],\n visualColumnIndex = _this2$translateFromR2[1]; // Coords may be modified. For example, by the `MergeCells` plugin. It should affect cell value and cell meta.\n\n\n var modifiedCellCoords = _this2.instance.runHooks('modifyGetCellCoords', visualRowIndex, visualColumnIndex);\n\n var visualRowToCheck = visualRowIndex;\n var visualColumnToCheck = visualColumnIndex;\n\n if (Array.isArray(modifiedCellCoords)) {\n var _modifiedCellCoords = _slicedToArray(modifiedCellCoords, 2);\n\n visualRowToCheck = _modifiedCellCoords[0];\n visualColumnToCheck = _modifiedCellCoords[1];\n }\n\n var cellProperties = _this2.instance.getCellMeta(visualRowToCheck, visualColumnToCheck);\n\n var prop = _this2.instance.colToProp(visualColumnToCheck);\n\n var value = _this2.instance.getDataAtRowProp(visualRowToCheck, prop);\n\n if (_this2.instance.hasHook('beforeValueRender')) {\n value = _this2.instance.runHooks('beforeValueRender', value, cellProperties);\n }\n\n _this2.instance.runHooks('beforeRenderer', TD, visualRowIndex, visualColumnIndex, prop, value, cellProperties);\n\n _this2.instance.getCellRenderer(cellProperties)(_this2.instance, TD, visualRowIndex, visualColumnIndex, prop, value, cellProperties);\n\n _this2.instance.runHooks('afterRenderer', TD, visualRowIndex, visualColumnIndex, prop, value, cellProperties);\n },\n selections: this.instance.selection.highlight,\n hideBorderOnMouseDownOver: function hideBorderOnMouseDownOver() {\n return _this2.settings.fragmentSelection;\n },\n onWindowResize: function onWindowResize() {\n if (!_this2.instance || _this2.instance.isDestroyed) {\n return;\n }\n\n _this2.instance.refreshDimensions();\n },\n onCellMouseDown: function onCellMouseDown(event, coords, TD, wt) {\n var visualCoords = _this2.translateFromRenderableToVisualCoords(coords);\n\n var blockCalculations = {\n row: false,\n column: false,\n cell: false\n };\n\n _this2.instance.listen();\n\n _this2.activeWt = wt;\n priv.mouseDown = true;\n\n _this2.instance.runHooks('beforeOnCellMouseDown', event, visualCoords, TD, blockCalculations);\n\n if (isImmediatePropagationStopped(event)) {\n return;\n }\n\n handleMouseEvent(event, {\n coords: visualCoords,\n selection: _this2.instance.selection,\n controller: blockCalculations\n });\n\n _this2.instance.runHooks('afterOnCellMouseDown', event, visualCoords, TD);\n\n _this2.activeWt = _this2.wt;\n },\n onCellContextMenu: function onCellContextMenu(event, coords, TD, wt) {\n var visualCoords = _this2.translateFromRenderableToVisualCoords(coords);\n\n _this2.activeWt = wt;\n priv.mouseDown = false;\n\n if (_this2.instance.selection.isInProgress()) {\n _this2.instance.selection.finish();\n }\n\n _this2.instance.runHooks('beforeOnCellContextMenu', event, visualCoords, TD);\n\n if (isImmediatePropagationStopped(event)) {\n return;\n }\n\n _this2.instance.runHooks('afterOnCellContextMenu', event, visualCoords, TD);\n\n _this2.activeWt = _this2.wt;\n },\n onCellMouseOut: function onCellMouseOut(event, coords, TD, wt) {\n var visualCoords = _this2.translateFromRenderableToVisualCoords(coords);\n\n _this2.activeWt = wt;\n\n _this2.instance.runHooks('beforeOnCellMouseOut', event, visualCoords, TD);\n\n if (isImmediatePropagationStopped(event)) {\n return;\n }\n\n _this2.instance.runHooks('afterOnCellMouseOut', event, visualCoords, TD);\n\n _this2.activeWt = _this2.wt;\n },\n onCellMouseOver: function onCellMouseOver(event, coords, TD, wt) {\n var visualCoords = _this2.translateFromRenderableToVisualCoords(coords);\n\n var blockCalculations = {\n row: false,\n column: false,\n cell: false\n };\n _this2.activeWt = wt;\n\n _this2.instance.runHooks('beforeOnCellMouseOver', event, visualCoords, TD, blockCalculations);\n\n if (isImmediatePropagationStopped(event)) {\n return;\n }\n\n if (priv.mouseDown) {\n handleMouseEvent(event, {\n coords: visualCoords,\n selection: _this2.instance.selection,\n controller: blockCalculations\n });\n }\n\n _this2.instance.runHooks('afterOnCellMouseOver', event, visualCoords, TD);\n\n _this2.activeWt = _this2.wt;\n },\n onCellMouseUp: function onCellMouseUp(event, coords, TD, wt) {\n var visualCoords = _this2.translateFromRenderableToVisualCoords(coords);\n\n _this2.activeWt = wt;\n\n _this2.instance.runHooks('beforeOnCellMouseUp', event, visualCoords, TD); // TODO: The second condition check is a workaround. Callback corresponding the method `updateSettings`\n // disable plugin and enable it again. Disabling plugin closes the menu. Thus, calling the\n // `updateSettings` in a body of any callback executed right after some context-menu action\n // breaks the table (#7231).\n\n\n if (isImmediatePropagationStopped(event) || _this2.instance.isDestroyed) {\n return;\n }\n\n _this2.instance.runHooks('afterOnCellMouseUp', event, visualCoords, TD);\n\n _this2.activeWt = _this2.wt;\n },\n onCellCornerMouseDown: function onCellCornerMouseDown(event) {\n event.preventDefault();\n\n _this2.instance.runHooks('afterOnCellCornerMouseDown', event);\n },\n onCellCornerDblClick: function onCellCornerDblClick(event) {\n event.preventDefault();\n\n _this2.instance.runHooks('afterOnCellCornerDblClick', event);\n },\n beforeDraw: function beforeDraw(force, skipRender) {\n return _this2.beforeRender(force, skipRender);\n },\n onDraw: function onDraw(force) {\n return _this2.onDraw(force);\n },\n onScrollVertically: function onScrollVertically() {\n return _this2.instance.runHooks('afterScrollVertically');\n },\n onScrollHorizontally: function onScrollHorizontally() {\n return _this2.instance.runHooks('afterScrollHorizontally');\n },\n onBeforeRemoveCellClassNames: function onBeforeRemoveCellClassNames() {\n return _this2.instance.runHooks('beforeRemoveCellClassNames');\n },\n onBeforeHighlightingRowHeader: function onBeforeHighlightingRowHeader(renderableRow, headerLevel, highlightMeta) {\n var rowMapper = _this2.instance.rowIndexMapper;\n var visualRow = rowMapper.getVisualFromRenderableIndex(renderableRow);\n\n var newVisualRow = _this2.instance.runHooks('beforeHighlightingRowHeader', visualRow, headerLevel, highlightMeta);\n\n return rowMapper.getRenderableFromVisualIndex(rowMapper.getFirstNotHiddenIndex(newVisualRow, 1));\n },\n onBeforeHighlightingColumnHeader: function onBeforeHighlightingColumnHeader(renderableColumn, headerLevel, highlightMeta) {\n var columnMapper = _this2.instance.columnIndexMapper;\n var visualColumn = columnMapper.getVisualFromRenderableIndex(renderableColumn);\n\n var newVisualColumn = _this2.instance.runHooks('beforeHighlightingColumnHeader', visualColumn, headerLevel, highlightMeta);\n\n return columnMapper.getRenderableFromVisualIndex(columnMapper.getFirstNotHiddenIndex(newVisualColumn, 1));\n },\n onAfterDrawSelection: function onAfterDrawSelection(currentRow, currentColumn, layerLevel) {\n var cornersOfSelection;\n\n var _this2$translateFromR3 = _this2.translateFromRenderableToVisualIndex(currentRow, currentColumn),\n _this2$translateFromR4 = _slicedToArray(_this2$translateFromR3, 2),\n visualRowIndex = _this2$translateFromR4[0],\n visualColumnIndex = _this2$translateFromR4[1];\n\n var selectedRange = _this2.instance.selection.getSelectedRange();\n\n var selectionRangeSize = selectedRange.size();\n\n if (selectionRangeSize > 0) {\n // Selection layers are stored from the \"oldest\" to the \"newest\". We should calculate the offset.\n // Please look at the `SelectedRange` class and it's method for getting selection's layer for more information.\n var selectionOffset = (layerLevel !== null && layerLevel !== void 0 ? layerLevel : 0) + 1 - selectionRangeSize;\n var selectionForLayer = selectedRange.peekByIndex(selectionOffset);\n cornersOfSelection = [selectionForLayer.from.row, selectionForLayer.from.col, selectionForLayer.to.row, selectionForLayer.to.col];\n }\n\n return _this2.instance.runHooks('afterDrawSelection', visualRowIndex, visualColumnIndex, cornersOfSelection, layerLevel);\n },\n onBeforeDrawBorders: function onBeforeDrawBorders(corners, borderClassName) {\n var _corners = _slicedToArray(corners, 4),\n startRenderableRow = _corners[0],\n startRenderableColumn = _corners[1],\n endRenderableRow = _corners[2],\n endRenderableColumn = _corners[3];\n\n var visualCorners = [_this2.instance.rowIndexMapper.getVisualFromRenderableIndex(startRenderableRow), _this2.instance.columnIndexMapper.getVisualFromRenderableIndex(startRenderableColumn), _this2.instance.rowIndexMapper.getVisualFromRenderableIndex(endRenderableRow), _this2.instance.columnIndexMapper.getVisualFromRenderableIndex(endRenderableColumn)];\n return _this2.instance.runHooks('beforeDrawBorders', visualCorners, borderClassName);\n },\n onBeforeTouchScroll: function onBeforeTouchScroll() {\n return _this2.instance.runHooks('beforeTouchScroll');\n },\n onAfterMomentumScroll: function onAfterMomentumScroll() {\n return _this2.instance.runHooks('afterMomentumScroll');\n },\n onBeforeStretchingColumnWidth: function onBeforeStretchingColumnWidth(stretchedWidth, renderedColumnIndex) {\n var visualColumnIndex = _this2.instance.columnIndexMapper.getVisualFromRenderableIndex(renderedColumnIndex);\n\n return _this2.instance.runHooks('beforeStretchingColumnWidth', stretchedWidth, visualColumnIndex);\n },\n onModifyRowHeaderWidth: function onModifyRowHeaderWidth(rowHeaderWidth) {\n return _this2.instance.runHooks('modifyRowHeaderWidth', rowHeaderWidth);\n },\n onModifyGetCellCoords: function onModifyGetCellCoords(renderableRowIndex, renderableColumnIndex, topmost) {\n var rowMapper = _this2.instance.rowIndexMapper;\n var columnMapper = _this2.instance.columnIndexMapper; // Callback handle also headers. We shouldn't translate them.\n\n var visualColumnIndex = renderableColumnIndex >= 0 ? columnMapper.getVisualFromRenderableIndex(renderableColumnIndex) : renderableColumnIndex;\n var visualRowIndex = renderableRowIndex >= 0 ? rowMapper.getVisualFromRenderableIndex(renderableRowIndex) : renderableRowIndex;\n\n var visualIndexes = _this2.instance.runHooks('modifyGetCellCoords', visualRowIndex, visualColumnIndex, topmost);\n\n if (Array.isArray(visualIndexes)) {\n var _visualIndexes = _slicedToArray(visualIndexes, 4),\n visualRowFrom = _visualIndexes[0],\n visualColumnFrom = _visualIndexes[1],\n visualRowTo = _visualIndexes[2],\n visualColumnTo = _visualIndexes[3]; // Result of the hook is handled by the Walkontable (renderable indexes).\n\n\n return [visualRowFrom >= 0 ? rowMapper.getRenderableFromVisualIndex(rowMapper.getFirstNotHiddenIndex(visualRowFrom, 1)) : visualRowFrom, visualColumnFrom >= 0 ? columnMapper.getRenderableFromVisualIndex(columnMapper.getFirstNotHiddenIndex(visualColumnFrom, 1)) : visualColumnFrom, visualRowTo >= 0 ? rowMapper.getRenderableFromVisualIndex(rowMapper.getFirstNotHiddenIndex(visualRowTo, -1)) : visualRowTo, visualColumnTo >= 0 ? columnMapper.getRenderableFromVisualIndex(columnMapper.getFirstNotHiddenIndex(visualColumnTo, -1)) : visualColumnTo];\n }\n },\n viewportRowCalculatorOverride: function viewportRowCalculatorOverride(calc) {\n var viewportOffset = _this2.settings.viewportRowRenderingOffset;\n\n if (viewportOffset === 'auto' && _this2.settings.fixedRowsTop) {\n viewportOffset = 10;\n }\n\n if (viewportOffset > 0 || viewportOffset === 'auto') {\n var renderableRows = _this2.countRenderableRows();\n\n var firstRenderedRow = calc.startRow;\n var lastRenderedRow = calc.endRow;\n\n if (typeof viewportOffset === 'number') {\n calc.startRow = Math.max(firstRenderedRow - viewportOffset, 0);\n calc.endRow = Math.min(lastRenderedRow + viewportOffset, renderableRows - 1);\n } else if (viewportOffset === 'auto') {\n var offset = Math.ceil(lastRenderedRow / renderableRows * 12);\n calc.startRow = Math.max(firstRenderedRow - offset, 0);\n calc.endRow = Math.min(lastRenderedRow + offset, renderableRows - 1);\n }\n }\n\n _this2.instance.runHooks('afterViewportRowCalculatorOverride', calc);\n },\n viewportColumnCalculatorOverride: function viewportColumnCalculatorOverride(calc) {\n var viewportOffset = _this2.settings.viewportColumnRenderingOffset;\n\n if (viewportOffset === 'auto' && _this2.settings.fixedColumnsLeft) {\n viewportOffset = 10;\n }\n\n if (viewportOffset > 0 || viewportOffset === 'auto') {\n var renderableColumns = _this2.countRenderableColumns();\n\n var firstRenderedColumn = calc.startColumn;\n var lastRenderedColumn = calc.endColumn;\n\n if (typeof viewportOffset === 'number') {\n calc.startColumn = Math.max(firstRenderedColumn - viewportOffset, 0);\n calc.endColumn = Math.min(lastRenderedColumn + viewportOffset, renderableColumns - 1);\n }\n\n if (viewportOffset === 'auto') {\n var offset = Math.ceil(lastRenderedColumn / renderableColumns * 6);\n calc.startColumn = Math.max(firstRenderedColumn - offset, 0);\n calc.endColumn = Math.min(lastRenderedColumn + offset, renderableColumns - 1);\n }\n }\n\n _this2.instance.runHooks('afterViewportColumnCalculatorOverride', calc);\n },\n rowHeaderWidth: function rowHeaderWidth() {\n return _this2.settings.rowHeaderWidth;\n },\n columnHeaderHeight: function columnHeaderHeight() {\n var columnHeaderHeight = _this2.instance.runHooks('modifyColumnHeaderHeight');\n\n return _this2.settings.columnHeaderHeight || columnHeaderHeight;\n }\n };\n this.instance.runHooks('beforeInitWalkontable', walkontableConfig);\n this.wt = new Walkontable(walkontableConfig);\n this.activeWt = this.wt;\n var spreader = this.wt.wtTable.spreader; // We have to cache width and height after Walkontable initialization.\n\n var _this$instance$rootEl = this.instance.rootElement.getBoundingClientRect(),\n width = _this$instance$rootEl.width,\n height = _this$instance$rootEl.height;\n\n this.setLastSize(width, height);\n this.eventManager.addEventListener(spreader, 'mousedown', function (event) {\n // right mouse button exactly on spreader means right click on the right hand side of vertical scrollbar\n if (event.target === spreader && event.which === 3) {\n event.stopPropagation();\n }\n });\n this.eventManager.addEventListener(spreader, 'contextmenu', function (event) {\n // right mouse button exactly on spreader means right click on the right hand side of vertical scrollbar\n if (event.target === spreader && event.which === 3) {\n event.stopPropagation();\n }\n });\n this.eventManager.addEventListener(this.instance.rootDocument.documentElement, 'click', function () {\n if (_this2.settings.observeDOMVisibility) {\n if (_this2.wt.drawInterrupted) {\n _this2.instance.forceFullRender = true;\n\n _this2.render();\n }\n }\n });\n }\n /**\n * Checks if it's possible to create text selection in element.\n *\n * @private\n * @param {HTMLElement} el The element to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"isTextSelectionAllowed\",\n value: function isTextSelectionAllowed(el) {\n if (isInput(el)) {\n return true;\n }\n\n var isChildOfTableBody = isChildOf(el, this.instance.view.wt.wtTable.spreader);\n\n if (this.settings.fragmentSelection === true && isChildOfTableBody) {\n return true;\n }\n\n if (this.settings.fragmentSelection === 'cell' && this.isSelectedOnlyCell() && isChildOfTableBody) {\n return true;\n }\n\n if (!this.settings.fragmentSelection && this.isCellEdited() && this.isSelectedOnlyCell()) {\n return true;\n }\n\n return false;\n }\n /**\n * Checks if user's been called mousedown.\n *\n * @private\n * @returns {boolean}\n */\n\n }, {\n key: \"isMouseDown\",\n value: function isMouseDown() {\n return privatePool.get(this).mouseDown;\n }\n /**\n * Check if selected only one cell.\n *\n * @private\n * @returns {boolean}\n */\n\n }, {\n key: \"isSelectedOnlyCell\",\n value: function isSelectedOnlyCell() {\n var _this$instance$getSel, _this$instance$getSel2;\n\n return (_this$instance$getSel = (_this$instance$getSel2 = this.instance.getSelectedRangeLast()) === null || _this$instance$getSel2 === void 0 ? void 0 : _this$instance$getSel2.isSingle()) !== null && _this$instance$getSel !== void 0 ? _this$instance$getSel : false;\n }\n /**\n * Checks if active cell is editing.\n *\n * @private\n * @returns {boolean}\n */\n\n }, {\n key: \"isCellEdited\",\n value: function isCellEdited() {\n var activeEditor = this.instance.getActiveEditor();\n return activeEditor && activeEditor.isOpened();\n }\n /**\n * `beforeDraw` callback.\n *\n * @private\n * @param {boolean} force If `true` rendering was triggered by a change of settings or data or `false` if\n * rendering was triggered by scrolling or moving selection.\n * @param {boolean} skipRender Indicates whether the rendering is skipped.\n */\n\n }, {\n key: \"beforeRender\",\n value: function beforeRender(force, skipRender) {\n if (force) {\n // this.instance.forceFullRender = did Handsontable request full render?\n this.instance.runHooks('beforeRender', this.instance.forceFullRender, skipRender);\n }\n }\n /**\n * `onDraw` callback.\n *\n * @private\n * @param {boolean} force If `true` rendering was triggered by a change of settings or data or `false` if\n * rendering was triggered by scrolling or moving selection.\n */\n\n }, {\n key: \"onDraw\",\n value: function onDraw(force) {\n if (force) {\n // this.instance.forceFullRender = did Handsontable request full render?\n this.instance.runHooks('afterRender', this.instance.forceFullRender);\n }\n }\n /**\n * Append row header to a TH element.\n *\n * @private\n * @param {number} visualRowIndex The visual row index.\n * @param {HTMLTableHeaderCellElement} TH The table header element.\n */\n\n }, {\n key: \"appendRowHeader\",\n value: function appendRowHeader(visualRowIndex, TH) {\n if (TH.firstChild) {\n var container = TH.firstChild;\n\n if (!hasClass(container, 'relative')) {\n empty(TH);\n this.appendRowHeader(visualRowIndex, TH);\n return;\n }\n\n this.updateCellHeader(container.querySelector('.rowHeader'), visualRowIndex, this.instance.getRowHeader);\n } else {\n var _this$instance3 = this.instance,\n rootDocument = _this$instance3.rootDocument,\n getRowHeader = _this$instance3.getRowHeader;\n var div = rootDocument.createElement('div');\n var span = rootDocument.createElement('span');\n div.className = 'relative';\n span.className = 'rowHeader';\n this.updateCellHeader(span, visualRowIndex, getRowHeader);\n div.appendChild(span);\n TH.appendChild(div);\n }\n\n this.instance.runHooks('afterGetRowHeader', visualRowIndex, TH);\n }\n /**\n * Append column header to a TH element.\n *\n * @private\n * @param {number} visualColumnIndex Visual column index.\n * @param {HTMLTableHeaderCellElement} TH The table header element.\n */\n\n }, {\n key: \"appendColHeader\",\n value: function appendColHeader(visualColumnIndex, TH) {\n if (TH.firstChild) {\n var container = TH.firstChild;\n\n if (hasClass(container, 'relative')) {\n this.updateCellHeader(container.querySelector('.colHeader'), visualColumnIndex, this.instance.getColHeader);\n } else {\n empty(TH);\n this.appendColHeader(visualColumnIndex, TH);\n }\n } else {\n var rootDocument = this.instance.rootDocument;\n var div = rootDocument.createElement('div');\n var span = rootDocument.createElement('span');\n div.className = 'relative';\n span.className = 'colHeader';\n this.updateCellHeader(span, visualColumnIndex, this.instance.getColHeader);\n div.appendChild(span);\n TH.appendChild(div);\n }\n\n this.instance.runHooks('afterGetColHeader', visualColumnIndex, TH);\n }\n /**\n * Updates header cell content.\n *\n * @since 0.15.0-beta4\n * @param {HTMLElement} element Element to update.\n * @param {number} index Row index or column index.\n * @param {Function} content Function which should be returns content for this cell.\n */\n\n }, {\n key: \"updateCellHeader\",\n value: function updateCellHeader(element, index, content) {\n var renderedIndex = index;\n var parentOverlay = this.wt.wtOverlays.getParentOverlay(element) || this.wt; // prevent wrong calculations from SampleGenerator\n\n if (element.parentNode) {\n if (hasClass(element, 'colHeader')) {\n renderedIndex = parentOverlay.wtTable.columnFilter.sourceToRendered(index);\n } else if (hasClass(element, 'rowHeader')) {\n renderedIndex = parentOverlay.wtTable.rowFilter.sourceToRendered(index);\n }\n }\n\n if (renderedIndex > -1) {\n fastInnerHTML(element, content(index));\n } else {\n // workaround for https://github.com/handsontable/handsontable/issues/1946\n fastInnerText(element, String.fromCharCode(160));\n addClass(element, 'cornerHeader');\n }\n }\n /**\n * Given a element's left position relative to the viewport, returns maximum element width until the right\n * edge of the viewport (before scrollbar).\n *\n * @private\n * @param {number} leftOffset The left offset.\n * @returns {number}\n */\n\n }, {\n key: \"maximumVisibleElementWidth\",\n value: function maximumVisibleElementWidth(leftOffset) {\n var workspaceWidth = this.wt.wtViewport.getWorkspaceWidth();\n var maxWidth = workspaceWidth - leftOffset;\n return maxWidth > 0 ? maxWidth : 0;\n }\n /**\n * Given a element's top position relative to the viewport, returns maximum element height until the bottom\n * edge of the viewport (before scrollbar).\n *\n * @private\n * @param {number} topOffset The top offset.\n * @returns {number}\n */\n\n }, {\n key: \"maximumVisibleElementHeight\",\n value: function maximumVisibleElementHeight(topOffset) {\n var workspaceHeight = this.wt.wtViewport.getWorkspaceHeight();\n var maxHeight = workspaceHeight - topOffset;\n return maxHeight > 0 ? maxHeight : 0;\n }\n /**\n * Sets new dimensions of the container.\n *\n * @param {number} width The table width.\n * @param {number} height The table height.\n */\n\n }, {\n key: \"setLastSize\",\n value: function setLastSize(width, height) {\n var priv = privatePool.get(this);\n var _ref2 = [width, height];\n priv.lastWidth = _ref2[0];\n priv.lastHeight = _ref2[1];\n }\n /**\n * Returns cached dimensions.\n *\n * @returns {object}\n */\n\n }, {\n key: \"getLastSize\",\n value: function getLastSize() {\n var priv = privatePool.get(this);\n return {\n width: priv.lastWidth,\n height: priv.lastHeight\n };\n }\n /**\n * Checks if master overlay is active.\n *\n * @private\n * @returns {boolean}\n */\n\n }, {\n key: \"mainViewIsActive\",\n value: function mainViewIsActive() {\n return this.wt === this.activeWt;\n }\n /**\n * Destroyes internal WalkOnTable's instance. Detaches all of the bonded listeners.\n *\n * @private\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.wt.destroy();\n this.eventManager.destroy();\n }\n }]);\n\n return TableView;\n}();\n\nexport default TableView;","import staticRegister from \"../utils/staticRegister.mjs\";\nimport { registerEditor } from \"../editors/registry.mjs\";\nimport { registerRenderer } from \"../renderers/registry.mjs\";\nimport { registerValidator } from \"../validators/registry.mjs\";\n\nvar _staticRegister = staticRegister('cellTypes'),\n register = _staticRegister.register,\n getItem = _staticRegister.getItem,\n hasItem = _staticRegister.hasItem,\n getNames = _staticRegister.getNames,\n getValues = _staticRegister.getValues;\n/**\n * Retrieve cell type object.\n *\n * @param {string} name Cell type identification.\n * @returns {object} Returns cell type object.\n */\n\n\nfunction _getItem(name) {\n if (!hasItem(name)) {\n throw Error(\"You declared cell type \\\"\".concat(name, \"\\\" as a string that is not mapped to a known object.\\n Cell type must be an object or a string mapped to an object registered by\\n \\\"Handsontable.cellTypes.registerCellType\\\" method\"));\n }\n\n return getItem(name);\n}\n/**\n * Register cell type under specified name.\n *\n * @param {string} name Cell type identification.\n * @param {object} type An object with contains keys (eq: `editor`, `renderer`, `validator`) which describes specified behaviour of the cell.\n */\n\n\nfunction _register(name, type) {\n if (typeof name !== 'string') {\n type = name;\n name = type.CELL_TYPE;\n }\n\n var _type = type,\n editor = _type.editor,\n renderer = _type.renderer,\n validator = _type.validator;\n\n if (editor) {\n registerEditor(name, editor);\n }\n\n if (renderer) {\n registerRenderer(name, renderer);\n }\n\n if (validator) {\n registerValidator(name, validator);\n }\n\n register(name, type);\n}\n\nexport { _register as registerCellType, _getItem as getCellType, hasItem as hasCellType, getNames as getRegisteredCellTypeNames, getValues as getRegisteredCellTypes };","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.object.keys.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport { getCellType } from \"./../cellTypes/registry.mjs\";\nimport { deepObjectSize, hasOwnProperty, isObject } from \"./object.mjs\";\nvar COLUMN_LABEL_BASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\nvar COLUMN_LABEL_BASE_LENGTH = COLUMN_LABEL_BASE.length;\n/**\n * Generates spreadsheet-like column names: A, B, C, ..., Z, AA, AB, etc.\n *\n * @param {number} index Column index.\n * @returns {string}\n */\n\nexport function spreadsheetColumnLabel(index) {\n var dividend = index + 1;\n var columnLabel = '';\n var modulo;\n\n while (dividend > 0) {\n modulo = (dividend - 1) % COLUMN_LABEL_BASE_LENGTH;\n columnLabel = String.fromCharCode(65 + modulo) + columnLabel;\n dividend = parseInt((dividend - modulo) / COLUMN_LABEL_BASE_LENGTH, 10);\n }\n\n return columnLabel;\n}\n/**\n * Generates spreadsheet-like column index from theirs labels: A, B, C ...., Z, AA, AB, etc.\n *\n * @param {string} label Column label.\n * @returns {number}\n */\n\nexport function spreadsheetColumnIndex(label) {\n var result = 0;\n\n if (label) {\n for (var i = 0, j = label.length - 1; i < label.length; i += 1, j -= 1) {\n result += Math.pow(COLUMN_LABEL_BASE_LENGTH, j) * (COLUMN_LABEL_BASE.indexOf(label[i]) + 1);\n }\n }\n\n result -= 1;\n return result;\n}\n/**\n * Creates 2D array of Excel-like values \"A1\", \"A2\", ...\n *\n * @param {number} rows Number of rows to generate.\n * @param {number} columns Number of columns to generate.\n * @returns {Array}\n */\n\nexport function createSpreadsheetData() {\n var rows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;\n var columns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;\n var _rows = [];\n var i;\n var j;\n\n for (i = 0; i < rows; i++) {\n var row = [];\n\n for (j = 0; j < columns; j++) {\n row.push(spreadsheetColumnLabel(j) + (i + 1));\n }\n\n _rows.push(row);\n }\n\n return _rows;\n}\n/**\n * Creates 2D array of Excel-like values \"A1\", \"A2\", as an array of objects.\n *\n * @param {number} rows Number of rows to generate.\n * @param {number} colCount Number of columns to generate.\n * @returns {Array}\n */\n\nexport function createSpreadsheetObjectData() {\n var rows = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 100;\n var colCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;\n var _rows = [];\n var i;\n var j;\n\n for (i = 0; i < rows; i++) {\n var row = {};\n\n for (j = 0; j < colCount; j++) {\n row[\"prop\".concat(j)] = spreadsheetColumnLabel(j) + (i + 1);\n }\n\n _rows.push(row);\n }\n\n return _rows;\n}\n/**\n * Generates an empty data object.\n *\n * @param {number} rows Number of rows to generate.\n * @param {number} columns Number of columns to generate.\n * @returns {Array}\n */\n\nexport function createEmptySpreadsheetData(rows, columns) {\n var data = [];\n var row;\n\n for (var i = 0; i < rows; i++) {\n row = [];\n\n for (var j = 0; j < columns; j++) {\n row.push('');\n }\n\n data.push(row);\n }\n\n return data;\n}\n/**\n * @param {Array} input The data to translate.\n * @returns {Array}\n */\n\nexport function translateRowsToColumns(input) {\n var output = [];\n var i;\n var ilen;\n var j;\n var jlen;\n var olen = 0;\n\n for (i = 0, ilen = input.length; i < ilen; i++) {\n for (j = 0, jlen = input[i].length; j < jlen; j++) {\n if (j === olen) {\n output.push([]);\n olen += 1;\n }\n\n output[j].push(input[i][j]);\n }\n }\n\n return output;\n}\n/**\n * Factory that produces a function for searching methods (or any properties) which could be defined directly in\n * table configuration or implicitly, within cell type definition.\n *\n * For example: renderer can be defined explicitly using \"renderer\" property in column configuration or it can be\n * defined implicitly using \"type\" property.\n *\n * Methods/properties defined explicitly always takes precedence over those defined through \"type\".\n *\n * If the method/property is not found in an object, searching is continued recursively through prototype chain, until\n * it reaches the Object.prototype.\n *\n * @param {string} methodName Name of the method/property to search (i.e. 'renderer', 'validator', 'copyable').\n * @param {boolean} [allowUndefined] If `false`, the search is continued if methodName has not been found in cell\n * \"type\".\n * @returns {Function}\n */\n\nexport function cellMethodLookupFactory(methodName, allowUndefined) {\n var isUndefinedAllowed = typeof allowUndefined === 'undefined' ? true : allowUndefined;\n return function cellMethodLookup(row, col) {\n return function getMethodFromProperties(properties) {\n if (!properties) {\n return; // method or property not found\n }\n\n if (hasOwnProperty(properties, methodName) && properties[methodName] !== void 0) {\n // check if it is own and is not empty\n return properties[methodName]; // method defined directly\n } else if (hasOwnProperty(properties, 'type') && properties.type) {\n // check if it is own and is not empty\n if (typeof properties.type !== 'string') {\n throw new Error('Cell \"type\" must be a string');\n }\n\n var type = getCellType(properties.type);\n\n if (hasOwnProperty(type, methodName)) {\n return type[methodName]; // method defined in type.\n } else if (isUndefinedAllowed) {\n return; // method does not defined in type (eg. validator), returns undefined\n }\n }\n\n return getMethodFromProperties(Object.getPrototypeOf(properties));\n }(typeof row === 'number' ? this.getCellMeta(row, col) : row);\n };\n}\n/**\n * Transform a data row (either an array or an object) or an array of data rows to array of changes in a form of `[row,\n * prop/col, value]`. Convenient to use with `setDataAtRowProp` and `setSourceDataAtCell` methods.\n *\n * @param {Array|object} dataRow Object of row data, array of row data or an array of either.\n * @param {number} rowOffset Row offset to be passed to the resulting change list. Defaults to `0`.\n * @returns {Array} Array of changes (in a form of an array).\n */\n\nexport function dataRowToChangesArray(dataRow) {\n var rowOffset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var dataRows = dataRow;\n var changesArray = [];\n\n if (!Array.isArray(dataRow) || !Array.isArray(dataRow[0])) {\n dataRows = [dataRow];\n }\n\n dataRows.forEach(function (row, rowIndex) {\n if (Array.isArray(row)) {\n row.forEach(function (value, column) {\n changesArray.push([rowIndex + rowOffset, column, value]);\n });\n } else {\n Object.keys(row).forEach(function (propName) {\n changesArray.push([rowIndex + rowOffset, propName, row[propName]]);\n });\n }\n });\n return changesArray;\n}\n/**\n * Count the number of keys (or, basically, columns when the data is an array or arrays) in the first row of the\n * provided dataset.\n *\n * @param {Array} data The dataset.\n * @returns {number} Number of keys in the first row of the dataset.\n */\n\nexport function countFirstRowKeys(data) {\n var result = 0;\n\n if (Array.isArray(data)) {\n if (data[0] && Array.isArray(data[0])) {\n result = data[0].length;\n } else if (data[0] && isObject(data[0])) {\n result = deepObjectSize(data[0]);\n }\n }\n\n return result;\n}\n/**\n * Check whether the provided dataset is a *non-empty* array of arrays.\n *\n * @param {Array} data Dataset to be checked.\n * @returns {boolean} `true` if data is an array of arrays, `false` otherwise.\n */\n\nexport function isArrayOfArrays(data) {\n return !!(Array.isArray(data) && data.length && data.every(function (el) {\n return Array.isArray(el);\n }));\n}\n/**\n * Check whether the provided dataset is a *non-empty* array of objects.\n *\n * @param {Array} data Dataset to be checked.\n * @returns {boolean} `true` if data is an array of objects, `false` otherwise.\n */\n\nexport function isArrayOfObjects(data) {\n return !!(Array.isArray(data) && data.length && data.every(function (el) {\n return _typeof(el) === 'object' && !Array.isArray(el) && el !== null;\n }));\n}","import \"core-js/modules/es.number.is-integer.js\";\nimport \"core-js/modules/es.number.constructor.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { createObjectPropListener, getProperty, isObject, objectEach, setProperty } from \"./helpers/object.mjs\";\nimport { countFirstRowKeys as _countFirstRowKeys } from \"./helpers/data.mjs\";\nimport { arrayEach } from \"./helpers/array.mjs\";\nimport { rangeEach } from \"./helpers/number.mjs\";\nimport { isFunction } from \"./helpers/function.mjs\";\n/**\n * @class DataSource\n * @private\n */\n\nvar DataSource = /*#__PURE__*/function () {\n function DataSource(hotInstance) {\n var dataSource = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n _classCallCheck(this, DataSource);\n\n /**\n * Instance of Handsontable.\n *\n * @type {Handsontable}\n */\n this.hot = hotInstance;\n /**\n * Data source.\n *\n * @type {Array}\n */\n\n this.data = dataSource;\n /**\n * Type of data source.\n *\n * @type {string}\n * @default 'array'\n */\n\n this.dataType = 'array';\n\n this.colToProp = function () {};\n\n this.propToCol = function () {};\n }\n /**\n * Run the `modifyRowData` hook and return either the modified or the source data for the provided row.\n *\n * @private\n * @param {number} rowIndex Row index.\n * @returns {Array|object} Source or modified row of data.\n */\n\n\n _createClass(DataSource, [{\n key: \"modifyRowData\",\n value: function modifyRowData(rowIndex) {\n var modifyRowData;\n\n if (this.hot.hasHook('modifyRowData')) {\n modifyRowData = this.hot.runHooks('modifyRowData', rowIndex);\n }\n\n return modifyRowData !== void 0 && !Number.isInteger(modifyRowData) ? modifyRowData : this.data[rowIndex];\n }\n /**\n * Get all data.\n *\n * @param {boolean} [toArray=false] If `true` return source data as an array of arrays even when source data was provided\n * in another format.\n * @returns {Array}\n */\n\n }, {\n key: \"getData\",\n value: function getData() {\n var toArray = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (!this.data || this.data.length === 0) {\n return this.data;\n }\n\n return this.getByRange(null, null, toArray);\n }\n /**\n * Set new data source.\n *\n * @param {Array} data The new data.\n */\n\n }, {\n key: \"setData\",\n value: function setData(data) {\n this.data = data;\n }\n /**\n * Returns array of column values from the data source. `column` is the index of the row in the data source.\n *\n * @param {number} column Visual column index.\n * @returns {Array}\n */\n\n }, {\n key: \"getAtColumn\",\n value: function getAtColumn(column) {\n var _this = this;\n\n var result = [];\n arrayEach(this.data, function (row, rowIndex) {\n var value = _this.getAtCell(rowIndex, column);\n\n result.push(value);\n });\n return result;\n }\n /**\n * Returns a single row of the data or a subset of its columns. If a column range or `toArray` arguments are provided, it\n * operates only on the columns declared by the `columns` setting or the data schema.\n *\n * @param {number} row Physical row index.\n * @param {number} [startColumn] Starting index for the column range (optional).\n * @param {number} [endColumn] Ending index for the column range (optional).\n * @param {boolean} [toArray=false] `true` if the returned value should be forced to be presented as an array.\n * @returns {Array|object}\n */\n\n }, {\n key: \"getAtRow\",\n value: function getAtRow(row, startColumn, endColumn) {\n var _this2 = this;\n\n var toArray = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var getAllProps = startColumn === void 0 && endColumn === void 0;\n var dataRow = null;\n var newDataRow = null;\n dataRow = this.modifyRowData(row);\n\n if (Array.isArray(dataRow)) {\n newDataRow = [];\n\n if (getAllProps) {\n dataRow.forEach(function (cell, column) {\n newDataRow[column] = _this2.getAtPhysicalCell(row, column, dataRow);\n });\n } else {\n // Only the columns from the provided range\n rangeEach(startColumn, endColumn, function (column) {\n newDataRow[column - startColumn] = _this2.getAtPhysicalCell(row, column, dataRow);\n });\n }\n } else if (isObject(dataRow) || isFunction(dataRow)) {\n if (toArray) {\n newDataRow = [];\n } else {\n newDataRow = {};\n }\n\n if (!getAllProps || toArray) {\n var rangeStart = 0;\n var rangeEnd = this.countFirstRowKeys() - 1;\n rangeEach(rangeStart, rangeEnd, function (column) {\n var prop = _this2.colToProp(column);\n\n if (column >= (startColumn || rangeStart) && column <= (endColumn || rangeEnd) && !Number.isInteger(prop)) {\n var cellValue = _this2.getAtPhysicalCell(row, prop, dataRow);\n\n if (toArray) {\n newDataRow.push(cellValue);\n } else {\n setProperty(newDataRow, prop, cellValue);\n }\n }\n });\n } else {\n objectEach(dataRow, function (value, prop) {\n setProperty(newDataRow, prop, _this2.getAtPhysicalCell(row, prop, dataRow));\n });\n }\n }\n\n return newDataRow;\n }\n /**\n * Set the provided value in the source data set at the provided coordinates.\n *\n * @param {number} row Physical row index.\n * @param {number|string} column Property name / physical column index.\n * @param {*} value The value to be set at the provided coordinates.\n */\n\n }, {\n key: \"setAtCell\",\n value: function setAtCell(row, column, value) {\n if (row >= this.countRows() || column >= this.countFirstRowKeys()) {\n // Not enough rows and/or columns.\n return;\n }\n\n if (this.hot.hasHook('modifySourceData')) {\n var valueHolder = createObjectPropListener(value);\n this.hot.runHooks('modifySourceData', row, this.propToCol(column), valueHolder, 'set');\n\n if (valueHolder.isTouched()) {\n value = valueHolder.value;\n }\n }\n\n if (!Number.isInteger(column)) {\n // column argument is the prop name\n setProperty(this.data[row], column, value);\n } else {\n this.data[row][column] = value;\n }\n }\n /**\n * Get data from the source data set using the physical indexes.\n *\n * @private\n * @param {number} row Physical row index.\n * @param {string|number|Function} column Physical column index / property / function.\n * @param {Array|object} dataRow A representation of a data row.\n * @returns {*} Value at the provided coordinates.\n */\n\n }, {\n key: \"getAtPhysicalCell\",\n value: function getAtPhysicalCell(row, column, dataRow) {\n var result = null;\n\n if (dataRow) {\n if (typeof column === 'string') {\n result = getProperty(dataRow, column);\n } else if (typeof column === 'function') {\n result = column(dataRow);\n } else {\n result = dataRow[column];\n }\n }\n\n if (this.hot.hasHook('modifySourceData')) {\n var valueHolder = createObjectPropListener(result);\n this.hot.runHooks('modifySourceData', row, this.colToProp(column), valueHolder, 'get');\n\n if (valueHolder.isTouched()) {\n result = valueHolder.value;\n }\n }\n\n return result;\n }\n /**\n * Returns a single value from the data.\n *\n * @param {number} row Physical row index.\n * @param {number} column Visual column index.\n * @returns {*}\n */\n\n }, {\n key: \"getAtCell\",\n value: function getAtCell(row, column) {\n var dataRow = this.modifyRowData(row);\n return this.getAtPhysicalCell(row, this.colToProp(column), dataRow);\n }\n /**\n * Returns source data by passed range.\n *\n * @param {object} [start] Object with physical `row` and `col` keys (or visual column index, if data type is an array of objects).\n * @param {object} [end] Object with physical `row` and `col` keys (or visual column index, if data type is an array of objects).\n * @param {boolean} [toArray=false] If `true` return source data as an array of arrays even when source data was provided\n * in another format.\n * @returns {Array}\n */\n\n }, {\n key: \"getByRange\",\n value: function getByRange() {\n var _this3 = this;\n\n var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var end = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var toArray = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var getAllProps = false;\n var startRow = null;\n var startCol = null;\n var endRow = null;\n var endCol = null;\n\n if (start === null || end === null) {\n getAllProps = true;\n startRow = 0;\n endRow = this.countRows() - 1;\n } else {\n startRow = Math.min(start.row, end.row);\n startCol = Math.min(start.col, end.col);\n endRow = Math.max(start.row, end.row);\n endCol = Math.max(start.col, end.col);\n }\n\n var result = [];\n rangeEach(startRow, endRow, function (currentRow) {\n result.push(getAllProps ? _this3.getAtRow(currentRow, void 0, void 0, toArray) : _this3.getAtRow(currentRow, startCol, endCol, toArray));\n });\n return result;\n }\n /**\n * Count number of rows.\n *\n * @returns {number}\n */\n\n }, {\n key: \"countRows\",\n value: function countRows() {\n if (this.hot.hasHook('modifySourceLength')) {\n var modifiedSourceLength = this.hot.runHooks('modifySourceLength');\n\n if (Number.isInteger(modifiedSourceLength)) {\n return modifiedSourceLength;\n }\n }\n\n return this.data.length;\n }\n /**\n * Count number of columns.\n *\n * @returns {number}\n */\n\n }, {\n key: \"countFirstRowKeys\",\n value: function countFirstRowKeys() {\n return _countFirstRowKeys(this.data);\n }\n /**\n * Destroy instance.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.data = null;\n this.hot = null;\n }\n }]);\n\n return DataSource;\n}();\n\nexport default DataSource;","import { arrayEach } from \"./../helpers/array.mjs\";\nimport { defineGetter } from \"./../helpers/object.mjs\";\nvar MIXIN_NAME = 'localHooks';\n/**\n * Mixin object to extend objects functionality for local hooks.\n *\n * @type {object}\n */\n\nvar localHooks = {\n /**\n * Internal hooks storage.\n */\n _localHooks: Object.create(null),\n\n /**\n * Add hook to the collection.\n *\n * @param {string} key The hook name.\n * @param {Function} callback The hook callback.\n * @returns {object}\n */\n addLocalHook: function addLocalHook(key, callback) {\n if (!this._localHooks[key]) {\n this._localHooks[key] = [];\n }\n\n this._localHooks[key].push(callback);\n\n return this;\n },\n\n /**\n * Run hooks.\n *\n * @param {string} key The hook name.\n * @param {*} params Additional parameters passed to callback function.\n */\n runLocalHooks: function runLocalHooks(key) {\n var _this = this;\n\n for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n params[_key - 1] = arguments[_key];\n }\n\n if (this._localHooks[key]) {\n arrayEach(this._localHooks[key], function (callback) {\n return callback.apply(_this, params);\n });\n }\n },\n\n /**\n * Clear all added hooks.\n *\n * @returns {object}\n */\n clearLocalHooks: function clearLocalHooks() {\n this._localHooks = {};\n return this;\n }\n};\ndefineGetter(localHooks, 'MIXIN_NAME', MIXIN_NAME, {\n writable: false,\n enumerable: false\n});\nexport default localHooks;","import \"core-js/modules/es.array.slice.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { rangeEach } from \"../../helpers/number.mjs\";\nimport { mixin } from \"../../helpers/object.mjs\";\nimport { isFunction } from \"../../helpers/function.mjs\";\nimport localHooks from \"../../mixins/localHooks.mjs\";\n/**\n * Map for storing mappings from an index to a value.\n */\n\nexport var IndexMap = /*#__PURE__*/function () {\n function IndexMap() {\n var initValueOrFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n _classCallCheck(this, IndexMap);\n\n /**\n * List of values for particular indexes.\n *\n * @private\n * @type {Array}\n */\n this.indexedValues = [];\n /**\n * Initial value or function for each existing index.\n *\n * @private\n * @type {*}\n */\n\n this.initValueOrFn = initValueOrFn;\n }\n /**\n * Get full list of values for particular indexes.\n *\n * @returns {Array}\n */\n\n\n _createClass(IndexMap, [{\n key: \"getValues\",\n value: function getValues() {\n return this.indexedValues;\n }\n /**\n * Get value for the particular index.\n *\n * @param {number} index Index for which value is got.\n * @returns {*}\n */\n\n }, {\n key: \"getValueAtIndex\",\n value: function getValueAtIndex(index) {\n var values = this.indexedValues;\n\n if (index < values.length) {\n return values[index];\n }\n }\n /**\n * Set new values for particular indexes.\n *\n * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately.\n *\n * @param {Array} values List of set values.\n */\n\n }, {\n key: \"setValues\",\n value: function setValues(values) {\n this.indexedValues = values.slice();\n this.runLocalHooks('change');\n }\n /**\n * Set new value for the particular index.\n *\n * @param {number} index The index.\n * @param {*} value The value to save.\n *\n * Note: Please keep in mind that it is not possible to set value beyond the map (not respecting already set\n * map's size). Please use the `setValues` method when you would like to extend the map.\n * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"setValueAtIndex\",\n value: function setValueAtIndex(index, value) {\n if (index < this.indexedValues.length) {\n this.indexedValues[index] = value;\n this.runLocalHooks('change');\n return true;\n }\n\n return false;\n }\n /**\n * Clear all values to the defaults.\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n this.setDefaultValues();\n }\n /**\n * Get length of the index map.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getLength\",\n value: function getLength() {\n return this.getValues().length;\n }\n /**\n * Set default values for elements from `0` to `n`, where `n` is equal to the handled variable.\n *\n * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately.\n *\n * @private\n * @param {number} [length] Length of list.\n */\n\n }, {\n key: \"setDefaultValues\",\n value: function setDefaultValues() {\n var _this = this;\n\n var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.indexedValues.length;\n this.indexedValues.length = 0;\n\n if (isFunction(this.initValueOrFn)) {\n rangeEach(length - 1, function (index) {\n return _this.indexedValues.push(_this.initValueOrFn(index));\n });\n } else {\n rangeEach(length - 1, function () {\n return _this.indexedValues.push(_this.initValueOrFn);\n });\n }\n\n this.runLocalHooks('change');\n }\n /**\n * Initialize list with default values for particular indexes.\n *\n * @private\n * @param {number} length New length of indexed list.\n * @returns {IndexMap}\n */\n\n }, {\n key: \"init\",\n value: function init(length) {\n this.setDefaultValues(length);\n this.runLocalHooks('init');\n return this;\n }\n /**\n * Add values to the list.\n *\n * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately.\n *\n * @private\n */\n\n }, {\n key: \"insert\",\n value: function insert() {\n this.runLocalHooks('change');\n }\n /**\n * Remove values from the list.\n *\n * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately.\n *\n * @private\n */\n\n }, {\n key: \"remove\",\n value: function remove() {\n this.runLocalHooks('change');\n }\n /**\n * Destroys the Map instance.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.clearLocalHooks();\n this.indexedValues = null;\n this.initValueOrFn = null;\n }\n }]);\n\n return IndexMap;\n}();\nmixin(IndexMap, localHooks);","import \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.string.includes.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.function.name.js\";\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { arrayFilter } from \"../../../helpers/array.mjs\";\n/**\n * Insert new items to the list.\n *\n * @private\n * @param {Array} indexedValues List of values for particular indexes.\n * @param {number} insertionIndex Position inside the actual list.\n * @param {Array} insertedIndexes List of inserted indexes.\n * @returns {Array} List with new mappings.\n */\n\nexport function getListWithInsertedItems(indexedValues, insertionIndex, insertedIndexes) {\n return [].concat(_toConsumableArray(indexedValues.slice(0, insertionIndex)), _toConsumableArray(insertedIndexes), _toConsumableArray(indexedValues.slice(insertionIndex)));\n}\n/**\n * Filter items from the list.\n *\n * @private\n * @param {Array} indexedValues List of values for particular indexes.\n * @param {Array} removedIndexes List of removed indexes.\n * @returns {Array} Reduced list of mappings.\n */\n\nexport function getListWithRemovedItems(indexedValues, removedIndexes) {\n return arrayFilter(indexedValues, function (index) {\n return removedIndexes.includes(index) === false;\n });\n}","import \"core-js/modules/es.array.filter.js\";\nimport { arrayMap } from \"../../../helpers/array.mjs\";\n/**\n * Transform mappings after removal.\n *\n * @private\n * @param {Array} indexedValues List of values for particular indexes.\n * @param {Array} removedIndexes List of removed indexes.\n * @returns {Array} List with decreased indexes.\n */\n\nexport function getDecreasedIndexes(indexedValues, removedIndexes) {\n return arrayMap(indexedValues, function (index) {\n return index - removedIndexes.filter(function (removedIndex) {\n return removedIndex < index;\n }).length;\n });\n}\n/**\n * Transform mappings after insertion.\n *\n * @private\n * @param {Array} indexedValues List of values for particular indexes.\n * @param {Array} insertedIndexes List of inserted indexes.\n * @returns {Array} List with increased indexes.\n */\n\nexport function getIncreasedIndexes(indexedValues, insertedIndexes) {\n var firstInsertedIndex = insertedIndexes[0];\n var amountOfIndexes = insertedIndexes.length;\n return arrayMap(indexedValues, function (index) {\n if (index >= firstInsertedIndex) {\n return index + amountOfIndexes;\n }\n\n return index;\n });\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { IndexMap } from \"./indexMap.mjs\";\nimport { getListWithRemovedItems, getListWithInsertedItems } from \"./utils/indexesSequence.mjs\";\nimport { getDecreasedIndexes, getIncreasedIndexes } from \"./utils/index.mjs\";\n/**\n * Map for storing mappings from an index to a physical index.\n *\n * It also updates the physical indexes (remaining in the map) on remove/add row or column action.\n */\n\nexport var IndexesSequence = /*#__PURE__*/function (_IndexMap) {\n _inherits(IndexesSequence, _IndexMap);\n\n var _super = _createSuper(IndexesSequence);\n\n function IndexesSequence() {\n _classCallCheck(this, IndexesSequence);\n\n // Not handling custom init function or init value.\n return _super.call(this, function (index) {\n return index;\n });\n }\n /**\n * Add values to list and reorganize.\n *\n * @private\n * @param {number} insertionIndex Position inside the list.\n * @param {Array} insertedIndexes List of inserted indexes.\n */\n\n\n _createClass(IndexesSequence, [{\n key: \"insert\",\n value: function insert(insertionIndex, insertedIndexes) {\n var listAfterUpdate = getIncreasedIndexes(this.indexedValues, insertedIndexes);\n this.indexedValues = getListWithInsertedItems(listAfterUpdate, insertionIndex, insertedIndexes);\n\n _get(_getPrototypeOf(IndexesSequence.prototype), \"insert\", this).call(this, insertionIndex, insertedIndexes);\n }\n /**\n * Remove values from the list and reorganize.\n *\n * @private\n * @param {Array} removedIndexes List of removed indexes.\n */\n\n }, {\n key: \"remove\",\n value: function remove(removedIndexes) {\n var listAfterUpdate = getListWithRemovedItems(this.indexedValues, removedIndexes);\n this.indexedValues = getDecreasedIndexes(listAfterUpdate, removedIndexes);\n\n _get(_getPrototypeOf(IndexesSequence.prototype), \"remove\", this).call(this, removedIndexes);\n }\n }]);\n\n return IndexesSequence;\n}(IndexMap);","import \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.array.map.js\";\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.string.includes.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.function.name.js\";\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { isFunction } from \"../../../helpers/function.mjs\";\nimport { arrayFilter } from \"../../../helpers/array.mjs\";\n/**\n * Insert new items to the list.\n *\n * @private\n * @param {Array} indexedValues List of values for particular indexes.\n * @param {number} insertionIndex Position inside the actual list.\n * @param {Array} insertedIndexes List of inserted indexes.\n * @param {*} insertedValuesMapping Mapping which may provide value or function returning value for the specific parameters.\n * @returns {Array} List with new mappings.\n */\n\nexport function getListWithInsertedItems(indexedValues, insertionIndex, insertedIndexes, insertedValuesMapping) {\n var firstInsertedIndex = insertedIndexes.length ? insertedIndexes[0] : void 0;\n return [].concat(_toConsumableArray(indexedValues.slice(0, firstInsertedIndex)), _toConsumableArray(insertedIndexes.map(function (insertedIndex, ordinalNumber) {\n if (isFunction(insertedValuesMapping)) {\n return insertedValuesMapping(insertedIndex, ordinalNumber);\n }\n\n return insertedValuesMapping;\n })), _toConsumableArray(firstInsertedIndex === void 0 ? [] : indexedValues.slice(firstInsertedIndex)));\n}\n/**\n * Filter items from the list.\n *\n * @private\n * @param {Array} indexedValues List of values for particular indexes.\n * @param {Array} removedIndexes List of removed indexes.\n * @returns {Array} Reduced list of mappings.\n */\n\nexport function getListWithRemovedItems(indexedValues, removedIndexes) {\n return arrayFilter(indexedValues, function (_, index) {\n return removedIndexes.includes(index) === false;\n });\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { IndexMap } from \"./indexMap.mjs\";\nimport { getListWithRemovedItems, getListWithInsertedItems } from \"./utils/physicallyIndexed.mjs\";\n/**\n * Map for storing mappings from an physical index to a value.\n *\n * Does not update stored values on remove/add row or column action.\n */\n\nexport var PhysicalIndexToValueMap = /*#__PURE__*/function (_IndexMap) {\n _inherits(PhysicalIndexToValueMap, _IndexMap);\n\n var _super = _createSuper(PhysicalIndexToValueMap);\n\n function PhysicalIndexToValueMap() {\n _classCallCheck(this, PhysicalIndexToValueMap);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(PhysicalIndexToValueMap, [{\n key: \"insert\",\n value:\n /**\n * Add values to list and reorganize.\n *\n * @private\n * @param {number} insertionIndex Position inside the list.\n * @param {Array} insertedIndexes List of inserted indexes.\n */\n function insert(insertionIndex, insertedIndexes) {\n this.indexedValues = getListWithInsertedItems(this.indexedValues, insertionIndex, insertedIndexes, this.initValueOrFn);\n\n _get(_getPrototypeOf(PhysicalIndexToValueMap.prototype), \"insert\", this).call(this, insertionIndex, insertedIndexes);\n }\n /**\n * Remove values from the list and reorganize.\n *\n * @private\n * @param {Array} removedIndexes List of removed indexes.\n */\n\n }, {\n key: \"remove\",\n value: function remove(removedIndexes) {\n this.indexedValues = getListWithRemovedItems(this.indexedValues, removedIndexes);\n\n _get(_getPrototypeOf(PhysicalIndexToValueMap.prototype), \"remove\", this).call(this, removedIndexes);\n }\n }]);\n\n return PhysicalIndexToValueMap;\n}(IndexMap);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { PhysicalIndexToValueMap } from \"./physicalIndexToValueMap.mjs\";\nimport { arrayReduce } from \"../../helpers/array.mjs\";\n/**\n * Map for storing mappings from an physical index to a boolean value. It stores information whether physical index is\n * included in a dataset, but skipped in the process of rendering.\n */\n\nexport var HidingMap = /*#__PURE__*/function (_PhysicalIndexToValue) {\n _inherits(HidingMap, _PhysicalIndexToValue);\n\n var _super = _createSuper(HidingMap);\n\n function HidingMap() {\n var initValueOrFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n _classCallCheck(this, HidingMap);\n\n return _super.call(this, initValueOrFn);\n }\n /**\n * Get physical indexes which are hidden.\n *\n * Note: Indexes marked as hidden are included in a {@link DataMap}, but aren't rendered.\n *\n * @returns {Array}\n */\n\n\n _createClass(HidingMap, [{\n key: \"getHiddenIndexes\",\n value: function getHiddenIndexes() {\n return arrayReduce(this.getValues(), function (indexesList, isHidden, physicalIndex) {\n if (isHidden) {\n indexesList.push(physicalIndex);\n }\n\n return indexesList;\n }, []);\n }\n }]);\n\n return HidingMap;\n}(PhysicalIndexToValueMap);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.array.map.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.string.includes.js\";\nimport \"core-js/modules/es.array.splice.js\";\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { IndexMap } from \"./indexMap.mjs\";\nimport { getListWithRemovedItems, getListWithInsertedItems } from \"./utils/physicallyIndexed.mjs\";\nimport { getListWithRemovedItems as getListWithoutIndexes } from \"./utils/indexesSequence.mjs\";\nimport { getDecreasedIndexes, getIncreasedIndexes } from \"./utils/actionsOnIndexes.mjs\";\nimport { isFunction } from \"../../helpers/function.mjs\";\n/**\n * Map for storing mappings from an physical index to a value. Those entries are linked and stored in a certain order.\n *\n * It does not update stored values on remove/add row or column action. Otherwise, order of entries is updated after\n * such changes.\n */\n\nexport var LinkedPhysicalIndexToValueMap = /*#__PURE__*/function (_IndexMap) {\n _inherits(LinkedPhysicalIndexToValueMap, _IndexMap);\n\n var _super = _createSuper(LinkedPhysicalIndexToValueMap);\n\n function LinkedPhysicalIndexToValueMap() {\n var _this;\n\n _classCallCheck(this, LinkedPhysicalIndexToValueMap);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"orderOfIndexes\", []);\n\n return _this;\n }\n\n _createClass(LinkedPhysicalIndexToValueMap, [{\n key: \"getValues\",\n value:\n /**\n * Get full list of ordered values for particular indexes.\n *\n * @returns {Array}\n */\n function getValues() {\n var _this2 = this;\n\n return this.orderOfIndexes.map(function (physicalIndex) {\n return _this2.indexedValues[physicalIndex];\n });\n }\n /**\n * Set new values for particular indexes. Entries are linked and stored in a certain order.\n *\n * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately.\n *\n * @param {Array} values List of set values.\n */\n\n }, {\n key: \"setValues\",\n value: function setValues(values) {\n this.orderOfIndexes = _toConsumableArray(Array(values.length).keys());\n\n _get(_getPrototypeOf(LinkedPhysicalIndexToValueMap.prototype), \"setValues\", this).call(this, values);\n }\n /**\n * Set value at index and add it to the linked list of entries. Entries are stored in a certain order.\n *\n * Note: Value will be added at the end of the queue.\n *\n * @param {number} index The index.\n * @param {*} value The value to save.\n * @param {number} position Position to which entry will be added.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"setValueAtIndex\",\n value: function setValueAtIndex(index, value) {\n var position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.orderOfIndexes.length;\n\n if (index < this.indexedValues.length) {\n this.indexedValues[index] = value;\n\n if (this.orderOfIndexes.includes(index) === false) {\n this.orderOfIndexes.splice(position, 0, index);\n }\n\n this.runLocalHooks('change');\n return true;\n }\n\n return false;\n }\n /**\n * Clear value for particular index.\n *\n * @param {number} physicalIndex Physical index.\n */\n\n }, {\n key: \"clearValue\",\n value: function clearValue(physicalIndex) {\n this.orderOfIndexes = getListWithoutIndexes(this.orderOfIndexes, [physicalIndex]);\n\n if (isFunction(this.initValueOrFn)) {\n _get(_getPrototypeOf(LinkedPhysicalIndexToValueMap.prototype), \"setValueAtIndex\", this).call(this, physicalIndex, this.initValueOrFn(physicalIndex));\n } else {\n _get(_getPrototypeOf(LinkedPhysicalIndexToValueMap.prototype), \"setValueAtIndex\", this).call(this, physicalIndex, this.initValueOrFn);\n }\n }\n /**\n * Get length of the index map.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getLength\",\n value: function getLength() {\n return this.orderOfIndexes.length;\n }\n /**\n * Set default values for elements from `0` to `n`, where `n` is equal to the handled variable.\n *\n * Note: Please keep in mind that `change` hook triggered by the method may not update cache of a collection immediately.\n *\n * @private\n * @param {number} [length] Length of list.\n */\n\n }, {\n key: \"setDefaultValues\",\n value: function setDefaultValues() {\n var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.indexedValues.length;\n this.orderOfIndexes.length = 0;\n\n _get(_getPrototypeOf(LinkedPhysicalIndexToValueMap.prototype), \"setDefaultValues\", this).call(this, length);\n }\n /**\n * Add values to list and reorganize. It updates list of indexes related to ordered values.\n *\n * @private\n * @param {number} insertionIndex Position inside the list.\n * @param {Array} insertedIndexes List of inserted indexes.\n */\n\n }, {\n key: \"insert\",\n value: function insert(insertionIndex, insertedIndexes) {\n this.indexedValues = getListWithInsertedItems(this.indexedValues, insertionIndex, insertedIndexes, this.initValueOrFn);\n this.orderOfIndexes = getIncreasedIndexes(this.orderOfIndexes, insertedIndexes);\n\n _get(_getPrototypeOf(LinkedPhysicalIndexToValueMap.prototype), \"insert\", this).call(this, insertionIndex, insertedIndexes);\n }\n /**\n * Remove values from the list and reorganize. It updates list of indexes related to ordered values.\n *\n * @private\n * @param {Array} removedIndexes List of removed indexes.\n */\n\n }, {\n key: \"remove\",\n value: function remove(removedIndexes) {\n this.indexedValues = getListWithRemovedItems(this.indexedValues, removedIndexes);\n this.orderOfIndexes = getListWithoutIndexes(this.orderOfIndexes, removedIndexes);\n this.orderOfIndexes = getDecreasedIndexes(this.orderOfIndexes, removedIndexes);\n\n _get(_getPrototypeOf(LinkedPhysicalIndexToValueMap.prototype), \"remove\", this).call(this, removedIndexes);\n }\n /**\n * Get every entry containing index and value, respecting order of indexes.\n *\n * @returns {Array}\n */\n\n }, {\n key: \"getEntries\",\n value: function getEntries() {\n var _this3 = this;\n\n return this.orderOfIndexes.map(function (physicalIndex) {\n return [physicalIndex, _this3.getValueAtIndex(physicalIndex)];\n });\n }\n }]);\n\n return LinkedPhysicalIndexToValueMap;\n}(IndexMap);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { PhysicalIndexToValueMap } from \"./physicalIndexToValueMap.mjs\";\nimport { arrayReduce } from \"../../helpers/array.mjs\";\n/**\n * Map for storing mappings from an physical index to a boolean value. It stores information whether physical index is\n * NOT included in a dataset and skipped in the process of rendering.\n */\n\nexport var TrimmingMap = /*#__PURE__*/function (_PhysicalIndexToValue) {\n _inherits(TrimmingMap, _PhysicalIndexToValue);\n\n var _super = _createSuper(TrimmingMap);\n\n function TrimmingMap() {\n var initValueOrFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n _classCallCheck(this, TrimmingMap);\n\n return _super.call(this, initValueOrFn);\n }\n /**\n * Get physical indexes which are trimmed.\n *\n * Note: Indexes marked as trimmed aren't included in a {@link DataMap} and aren't rendered.\n *\n * @returns {Array}\n */\n\n\n _createClass(TrimmingMap, [{\n key: \"getTrimmedIndexes\",\n value: function getTrimmedIndexes() {\n return arrayReduce(this.getValues(), function (indexesList, isTrimmed, physicalIndex) {\n if (isTrimmed) {\n indexesList.push(physicalIndex);\n }\n\n return indexesList;\n }, []);\n }\n }]);\n\n return TrimmingMap;\n}(PhysicalIndexToValueMap);","import \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport { HidingMap } from \"./hidingMap.mjs\";\nimport { IndexMap } from \"./indexMap.mjs\";\nimport { LinkedPhysicalIndexToValueMap } from \"./linkedPhysicalIndexToValueMap.mjs\";\nimport { PhysicalIndexToValueMap } from \"./physicalIndexToValueMap.mjs\";\nimport { TrimmingMap } from \"./trimmingMap.mjs\";\nexport * from \"./indexesSequence.mjs\";\nexport * from \"./utils/indexesSequence.mjs\";\nexport { HidingMap, IndexMap, LinkedPhysicalIndexToValueMap, PhysicalIndexToValueMap, TrimmingMap };\nvar availableIndexMapTypes = new Map([['hiding', HidingMap], ['index', IndexMap], ['linkedPhysicalIndexToValue', LinkedPhysicalIndexToValueMap], ['physicalIndexToValue', PhysicalIndexToValueMap], ['trimming', TrimmingMap]]);\n/**\n * Creates and returns new IndexMap instance.\n *\n * @param {string} mapType The type of the map.\n * @param {*} [initValueOrFn=null] Initial value or function for index map.\n * @returns {IndexMap}\n */\n\nexport function createIndexMap(mapType) {\n var initValueOrFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (!availableIndexMapTypes.has(mapType)) {\n throw new Error(\"The provided map type (\\\"\".concat(mapType, \"\\\") does not exist.\"));\n }\n\n return new (availableIndexMapTypes.get(mapType))(initValueOrFn);\n}","import \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.array.from.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { isUndefined, isDefined } from \"../../helpers/mixed.mjs\";\nimport { mixin } from \"../../helpers/object.mjs\";\nimport localHooks from \"../../mixins/localHooks.mjs\"; // Counter for checking if there is a memory leak.\n\nvar registeredMaps = 0;\n/**\n * Collection of index maps having unique names. It allow us to perform bulk operations such as init, remove, insert on all index maps that have been registered in the collection.\n */\n\nexport var MapCollection = /*#__PURE__*/function () {\n function MapCollection() {\n _classCallCheck(this, MapCollection);\n\n /**\n * Collection of index maps.\n *\n * @type {Map}\n */\n this.collection = new Map();\n }\n /**\n * Register custom index map.\n *\n * @param {string} uniqueName Unique name of the index map.\n * @param {IndexMap} indexMap Index map containing miscellaneous (i.e. Meta data, indexes sequence), updated after remove and insert data actions.\n */\n\n\n _createClass(MapCollection, [{\n key: \"register\",\n value: function register(uniqueName, indexMap) {\n var _this = this;\n\n if (this.collection.has(uniqueName) === false) {\n this.collection.set(uniqueName, indexMap);\n indexMap.addLocalHook('change', function () {\n return _this.runLocalHooks('change', indexMap);\n });\n registeredMaps += 1;\n }\n }\n /**\n * Unregister custom index map.\n *\n * @param {string} name Name of the index map.\n */\n\n }, {\n key: \"unregister\",\n value: function unregister(name) {\n var indexMap = this.collection.get(name);\n\n if (isDefined(indexMap)) {\n indexMap.destroy();\n this.collection.delete(name);\n this.runLocalHooks('change', indexMap);\n registeredMaps -= 1;\n }\n }\n /**\n * Unregisters and destroys all collected index map instances.\n */\n\n }, {\n key: \"unregisterAll\",\n value: function unregisterAll() {\n var _this2 = this;\n\n this.collection.forEach(function (indexMap, name) {\n return _this2.unregister(name);\n });\n this.collection.clear();\n }\n /**\n * Get index map for the provided name.\n *\n * @param {string} [name] Name of the index map.\n * @returns {Array|IndexMap}\n */\n\n }, {\n key: \"get\",\n value: function get(name) {\n if (isUndefined(name)) {\n return Array.from(this.collection.values());\n }\n\n return this.collection.get(name);\n }\n /**\n * Get collection size.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getLength\",\n value: function getLength() {\n return this.collection.size;\n }\n /**\n * Remove some indexes and corresponding mappings and update values of the others within all collection's index maps.\n *\n * @private\n * @param {Array} removedIndexes List of removed indexes.\n */\n\n }, {\n key: \"removeFromEvery\",\n value: function removeFromEvery(removedIndexes) {\n this.collection.forEach(function (indexMap) {\n indexMap.remove(removedIndexes);\n });\n }\n /**\n * Insert new indexes and corresponding mapping and update values of the others all collection's index maps.\n *\n * @private\n * @param {number} insertionIndex Position inside the actual list.\n * @param {Array} insertedIndexes List of inserted indexes.\n */\n\n }, {\n key: \"insertToEvery\",\n value: function insertToEvery(insertionIndex, insertedIndexes) {\n this.collection.forEach(function (indexMap) {\n indexMap.insert(insertionIndex, insertedIndexes);\n });\n }\n /**\n * Set default values to index maps within collection.\n *\n * @param {number} length Destination length for all stored maps.\n */\n\n }, {\n key: \"initEvery\",\n value: function initEvery(length) {\n this.collection.forEach(function (indexMap) {\n indexMap.init(length);\n });\n }\n }]);\n\n return MapCollection;\n}();\nmixin(MapCollection, localHooks);\n/**\n * @returns {number}\n */\n\nexport function getRegisteredMapsCounter() {\n return registeredMaps;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { MapCollection } from \"./mapCollection.mjs\";\nimport { arrayMap } from \"../../helpers/array.mjs\";\nimport { isDefined } from \"../../helpers/mixed.mjs\";\n/**\n * Collection of maps. This collection aggregate maps with the same type of values. Values from the registered maps\n * can be used to calculate a single result for particular index.\n */\n\nexport var AggregatedCollection = /*#__PURE__*/function (_MapCollection) {\n _inherits(AggregatedCollection, _MapCollection);\n\n var _super = _createSuper(AggregatedCollection);\n\n function AggregatedCollection(aggregationFunction, fallbackValue) {\n var _this;\n\n _classCallCheck(this, AggregatedCollection);\n\n _this = _super.call(this);\n /**\n * List of merged values. Value for each index is calculated using values inside registered maps.\n *\n * @type {Array}\n */\n\n _this.mergedValuesCache = [];\n /**\n * Function which do aggregation on the values for particular index.\n */\n\n _this.aggregationFunction = aggregationFunction;\n /**\n * Fallback value when there is no calculated value for particular index.\n */\n\n _this.fallbackValue = fallbackValue;\n return _this;\n }\n /**\n * Get merged values for all indexes.\n *\n * @param {boolean} [readFromCache=true] Determine if read results from the cache.\n * @returns {Array}\n */\n\n\n _createClass(AggregatedCollection, [{\n key: \"getMergedValues\",\n value: function getMergedValues() {\n var readFromCache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n if (readFromCache === true) {\n return this.mergedValuesCache;\n }\n\n if (this.getLength() === 0) {\n return [];\n } // Below variable stores values for every particular map. Example describing situation when we have 2 registered maps,\n // with length equal to 5.\n //\n // +---------+---------------------------------------------+\n // | | indexes |\n // +---------+---------------------------------------------+\n // | maps | 0 | 1 | 2 | 3 | 4 |\n // +---------+----------+-------+-------+-------+----------+\n // | 0 | [[ value, value, value, value, value ], |\n // | 1 | [ value, value, value, value, value ]] |\n // +---------+----------+-------+-------+-------+----------+\n\n\n var mapsValuesMatrix = arrayMap(this.get(), function (map) {\n return map.getValues();\n }); // Below variable stores values for every particular index. Example describing situation when we have 2 registered maps,\n // with length equal to 5.\n //\n // +---------+---------------------+\n // | | maps |\n // +---------+---------------------+\n // | indexes | 0 | 1 |\n // +---------+----------+----------+\n // | 0 | [[ value, value ], |\n // | 1 | [ value, value ], |\n // | 2 | [ value, value ], |\n // | 3 | [ value, value ], |\n // | 4 | [ value, value ]] |\n // +---------+----------+----------+\n\n var indexesValuesMatrix = [];\n var mapsLength = isDefined(mapsValuesMatrix[0]) && mapsValuesMatrix[0].length || 0;\n\n for (var index = 0; index < mapsLength; index += 1) {\n var valuesForIndex = [];\n\n for (var mapIndex = 0; mapIndex < this.getLength(); mapIndex += 1) {\n valuesForIndex.push(mapsValuesMatrix[mapIndex][index]);\n }\n\n indexesValuesMatrix.push(valuesForIndex);\n }\n\n return arrayMap(indexesValuesMatrix, this.aggregationFunction);\n }\n /**\n * Get merged value for particular index.\n *\n * @param {number} index Index for which we calculate single result.\n * @param {boolean} [readFromCache=true] Determine if read results from the cache.\n * @returns {*}\n */\n\n }, {\n key: \"getMergedValueAtIndex\",\n value: function getMergedValueAtIndex(index, readFromCache) {\n var valueAtIndex = this.getMergedValues(readFromCache)[index];\n return isDefined(valueAtIndex) ? valueAtIndex : this.fallbackValue;\n }\n /**\n * Rebuild cache for the collection.\n */\n\n }, {\n key: \"updateCache\",\n value: function updateCache() {\n this.mergedValuesCache = this.getMergedValues(false);\n }\n }]);\n\n return AggregatedCollection;\n}(MapCollection);","import \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/es.weak-map.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\n\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\n\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\n\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\n\nimport { mixin } from \"../../helpers/object.mjs\";\nimport localHooks from \"../../mixins/localHooks.mjs\";\n/**\n * The ChangesObserver module is an object that represents a disposable resource\n * provided by the ChangesObservable module.\n *\n * @class ChangesObserver\n */\n\nvar _currentInitialChanges = /*#__PURE__*/new WeakMap();\n\nexport var ChangesObserver = /*#__PURE__*/function () {\n function ChangesObserver() {\n _classCallCheck(this, ChangesObserver);\n\n _currentInitialChanges.set(this, {\n writable: true,\n value: []\n });\n }\n\n _createClass(ChangesObserver, [{\n key: \"subscribe\",\n value:\n /**\n * Subscribes to the observer.\n *\n * @param {Function} callback A function that will be called when the new changes will appear.\n * @returns {ChangesObserver}\n */\n function subscribe(callback) {\n this.addLocalHook('change', callback);\n\n this._write(_classPrivateFieldGet(this, _currentInitialChanges));\n\n return this;\n }\n /**\n * Unsubscribes all subscriptions. After the method call, the observer would not produce\n * any new events.\n *\n * @returns {ChangesObserver}\n */\n\n }, {\n key: \"unsubscribe\",\n value: function unsubscribe() {\n this.runLocalHooks('unsubscribe');\n this.clearLocalHooks();\n return this;\n }\n /**\n * The write method is executed by the ChangesObservable module. The module produces all\n * changes events that are distributed further by the observer.\n *\n * @private\n * @param {object} changes The chunk of changes produced by the ChangesObservable module.\n * @returns {ChangesObserver}\n */\n\n }, {\n key: \"_write\",\n value: function _write(changes) {\n if (changes.length > 0) {\n this.runLocalHooks('change', changes);\n }\n\n return this;\n }\n /**\n * The write method is executed by the ChangesObservable module. The module produces initial\n * changes that will be used to notify new subscribers.\n *\n * @private\n * @param {object} initialChanges The chunk of changes produced by the ChangesObservable module.\n */\n\n }, {\n key: \"_writeInitialChanges\",\n value: function _writeInitialChanges(initialChanges) {\n _classPrivateFieldSet(this, _currentInitialChanges, initialChanges);\n }\n }]);\n\n return ChangesObserver;\n}();\nmixin(ChangesObserver, localHooks);","/**\n * An array diff implementation. The function iterates through the arrays and depends\n * on the diff results, collect the changes as a list of the objects.\n *\n * Each object contains information about the differences in the indexes of the arrays.\n * The changes also contain data about the new and previous array values.\n *\n * @param {Array} baseArray The base array to diff from.\n * @param {Array} newArray The new array to compare with.\n * @returns {Array}\n */\nexport function arrayDiff(baseArray, newArray) {\n var changes = [];\n var i = 0;\n var j = 0;\n /* eslint-disable no-plusplus */\n\n for (; i < baseArray.length && j < newArray.length; i++, j++) {\n if (baseArray[i] !== newArray[j]) {\n changes.push({\n op: 'replace',\n index: j,\n oldValue: baseArray[i],\n newValue: newArray[j]\n });\n }\n }\n\n for (; i < newArray.length; i++) {\n changes.push({\n op: 'insert',\n index: i,\n oldValue: void 0,\n newValue: newArray[i]\n });\n }\n\n for (; j < baseArray.length; j++) {\n changes.push({\n op: 'remove',\n index: j,\n oldValue: baseArray[j],\n newValue: void 0\n });\n }\n\n return changes;\n}","import \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.set.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.fill.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.weak-map.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\n\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\n\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\n\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\n\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\nimport { ChangesObserver } from \"./observer.mjs\";\nimport { arrayDiff } from \"./utils.mjs\";\n/**\n * The ChangesObservable module is an object that represents a resource that provides\n * the ability to observe the changes that happened in the index map indexes during\n * the code running.\n *\n * @class ChangesObservable\n */\n\nvar _observers = /*#__PURE__*/new WeakMap();\n\nvar _indexMatrix = /*#__PURE__*/new WeakMap();\n\nvar _currentIndexState = /*#__PURE__*/new WeakMap();\n\nvar _isMatrixIndexesInitialized = /*#__PURE__*/new WeakMap();\n\nvar _initialIndexValue = /*#__PURE__*/new WeakMap();\n\nexport var ChangesObservable = /*#__PURE__*/function () {\n /**\n * The list of registered ChangesObserver instances.\n *\n * @type {ChangesObserver[]}\n */\n\n /**\n * An array with default values that act as a base array that will be compared with\n * the last saved index state. The changes are generated and immediately send through\n * the newly created ChangesObserver object. Thanks to that, the observer initially has\n * all information about what indexes are currently changed.\n *\n * @type {Array}\n */\n\n /**\n * An array that holds the indexes state that is currently valid. The value is changed on every\n * index mapper cache update.\n *\n * @type {Array}\n */\n\n /**\n * The flag determines if the observable is initialized or not. Not initialized object creates\n * index matrix once while emitting new changes.\n *\n * @type {boolean}\n */\n\n /**\n * The initial index value allows control from what value the index matrix array will be created.\n * Changing that value changes how the array diff generates the changes for the initial data\n * sent to the subscribers. For example, the changes can be triggered by detecting the changes\n * from `false` to `true` value or vice versa. Generally, it depends on which index map type\n * the Observable will work with. For \"hiding\" or \"trimming\" index types, it will be boolean\n * values. For various index maps, it can be anything, but I suspect that the most appropriate\n * initial value will be \"undefined\" in that case.\n *\n * @type {boolean}\n */\n function ChangesObservable() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n initialIndexValue = _ref.initialIndexValue;\n\n _classCallCheck(this, ChangesObservable);\n\n _observers.set(this, {\n writable: true,\n value: new Set()\n });\n\n _indexMatrix.set(this, {\n writable: true,\n value: []\n });\n\n _currentIndexState.set(this, {\n writable: true,\n value: []\n });\n\n _isMatrixIndexesInitialized.set(this, {\n writable: true,\n value: false\n });\n\n _initialIndexValue.set(this, {\n writable: true,\n value: false\n });\n\n _classPrivateFieldSet(this, _initialIndexValue, initialIndexValue !== null && initialIndexValue !== void 0 ? initialIndexValue : false);\n }\n /* eslint-disable jsdoc/require-description-complete-sentence */\n\n /**\n * Creates and returns a new instance of the ChangesObserver object. The resource\n * allows subscribing to the index changes that during the code running may change.\n * Changes are emitted as an array of the index change. Each change is represented\n * separately as an object with `op`, `index`, `oldValue`, and `newValue` props.\n *\n * For example:\n * ```\n * [\n * { op: 'replace', index: 1, oldValue: false, newValue: true },\n * { op: 'replace', index: 3, oldValue: false, newValue: true },\n * { op: 'insert', index: 4, oldValue: false, newValue: true },\n * ]\n * // or when the new index map changes have less indexes\n * [\n * { op: 'replace', index: 1, oldValue: false, newValue: true },\n * { op: 'remove', index: 4, oldValue: false, newValue: true },\n * ]\n * ```\n *\n * @returns {ChangesObserver}\n */\n\n /* eslint-enable jsdoc/require-description-complete-sentence */\n\n\n _createClass(ChangesObservable, [{\n key: \"createObserver\",\n value: function createObserver() {\n var _this = this;\n\n var observer = new ChangesObserver();\n\n _classPrivateFieldGet(this, _observers).add(observer);\n\n observer.addLocalHook('unsubscribe', function () {\n _classPrivateFieldGet(_this, _observers).delete(observer);\n });\n\n observer._writeInitialChanges(arrayDiff(_classPrivateFieldGet(this, _indexMatrix), _classPrivateFieldGet(this, _currentIndexState)));\n\n return observer;\n }\n /**\n * The method is an entry point for triggering new index map changes. Emitting the\n * changes triggers comparing algorithm which compares last saved state with a new\n * state. When there are some differences, the changes are sent to all subscribers.\n *\n * @param {Array} indexesState An array with index map state.\n */\n\n }, {\n key: \"emit\",\n value: function emit(indexesState) {\n var currentIndexState = _classPrivateFieldGet(this, _currentIndexState);\n\n if (!_classPrivateFieldGet(this, _isMatrixIndexesInitialized) || _classPrivateFieldGet(this, _indexMatrix).length !== indexesState.length) {\n if (indexesState.length === 0) {\n indexesState = new Array(currentIndexState.length).fill(_classPrivateFieldGet(this, _initialIndexValue));\n } else {\n _classPrivateFieldSet(this, _indexMatrix, new Array(indexesState.length).fill(_classPrivateFieldGet(this, _initialIndexValue)));\n }\n\n if (!_classPrivateFieldGet(this, _isMatrixIndexesInitialized)) {\n _classPrivateFieldSet(this, _isMatrixIndexesInitialized, true);\n\n currentIndexState = _classPrivateFieldGet(this, _indexMatrix);\n }\n }\n\n var changes = arrayDiff(currentIndexState, indexesState);\n\n _classPrivateFieldGet(this, _observers).forEach(function (observer) {\n return observer._write(changes);\n });\n\n _classPrivateFieldSet(this, _currentIndexState, indexesState);\n }\n }]);\n\n return ChangesObservable;\n}();","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.string.includes.js\";\nimport \"core-js/modules/es.array.fill.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { arrayMap } from \"../helpers/array.mjs\";\nimport { createIndexMap, getListWithInsertedItems, getListWithRemovedItems, HidingMap, IndexesSequence, TrimmingMap } from \"./maps/index.mjs\";\nimport { AggregatedCollection, MapCollection } from \"./mapCollections/index.mjs\";\nimport localHooks from \"../mixins/localHooks.mjs\";\nimport { mixin } from \"../helpers/object.mjs\";\nimport { isDefined } from \"../helpers/mixed.mjs\";\nimport { ChangesObservable } from \"./changesObservable/observable.mjs\";\n/**\n * @class IndexMapper\n * @description\n *\n * Index mapper stores, registers and manages the indexes on the basis of calculations collected from the subsidiary maps.\n * It should be seen as a single source of truth (regarding row and column indexes, for example, their sequence, information if they are skipped in the process of rendering (hidden or trimmed), values linked to them)\n * for any operation that considers CRUD actions such as **insertion**, **movement**, **removal** etc, and is used to properly calculate physical and visual indexes translations in both ways.\n * It has a built-in cache that is updated only when the data or structure changes.\n *\n * **Physical index** is a type of an index from the sequence of indexes assigned to the data source rows or columns\n * (from 0 to n, where n is number of the cells on the axis of data set).\n * **Visual index** is a type of an index from the sequence of indexes assigned to rows or columns existing in {@link data-map DataMap} (from 0 to n, where n is number of the cells on the axis of data set).\n * **Renderable index** is a type of an index from the sequence of indexes assigned to rows or columns whose may be rendered (when they are in a viewport; from 0 to n, where n is number of the cells renderable on the axis).\n *\n * There are different kinds of index maps which may be registered in the collections and can be used by a reference.\n * They also expose public API and trigger two local hooks such as `init` (on initialization) and `change` (on change).\n *\n * These are: {@link indexes-sequence IndexesSequence}, {@link physical-index-to-value-map PhysicalIndexToValueMap}, {@link hiding-map HidingMap}, and {@link trimming-map TrimmingMap}.\n */\n\nexport var IndexMapper = /*#__PURE__*/function () {\n function IndexMapper() {\n var _this = this;\n\n _classCallCheck(this, IndexMapper);\n\n /**\n * Map for storing the sequence of indexes.\n *\n * It is registered by default and may be used from API methods.\n *\n * @private\n * @type {IndexesSequence}\n */\n this.indexesSequence = new IndexesSequence();\n /**\n * Collection for different trimming maps. Indexes marked as trimmed in any map WILL NOT be included in\n * the {@link data-map DataMap} and won't be rendered.\n *\n * @private\n * @type {MapCollection}\n */\n\n this.trimmingMapsCollection = new AggregatedCollection(function (valuesForIndex) {\n return valuesForIndex.some(function (value) {\n return value === true;\n });\n }, false);\n /**\n * Collection for different hiding maps. Indexes marked as hidden in any map WILL be included in the {@link data-map DataMap},\n * but won't be rendered.\n *\n * @private\n * @type {MapCollection}\n */\n\n this.hidingMapsCollection = new AggregatedCollection(function (valuesForIndex) {\n return valuesForIndex.some(function (value) {\n return value === true;\n });\n }, false);\n /**\n * Collection for another kind of maps. There are stored mappings from indexes (visual or physical) to values.\n *\n * @private\n * @type {MapCollection}\n */\n\n this.variousMapsCollection = new MapCollection();\n /**\n * The class instance collects row and column index changes that happen while the Handsontable\n * is running. The object allows creating observers that you can subscribe. Each event represents\n * the index change (e.g., insert, removing, change index value), which can be consumed by a\n * developer to update its logic.\n *\n * @private\n * @type {ChangesObservable}\n */\n\n this.hidingChangesObservable = new ChangesObservable({\n initialIndexValue: false\n });\n /**\n * Cache for list of not trimmed indexes, respecting the indexes sequence (physical indexes).\n *\n * Note: Please keep in mind that trimmed index can be also hidden.\n *\n * @private\n * @type {Array}\n */\n\n this.notTrimmedIndexesCache = [];\n /**\n * Cache for list of not hidden indexes, respecting the indexes sequence (physical indexes).\n *\n * Note: Please keep in mind that hidden index can be also trimmed.\n *\n * @private\n * @type {Array}\n */\n\n this.notHiddenIndexesCache = [];\n /**\n * Flag determining whether actions performed on index mapper have been batched. It's used for cache management.\n *\n * @private\n * @type {boolean}\n */\n\n this.isBatched = false;\n /**\n * Flag determining whether any action on indexes sequence has been performed. It's used for cache management.\n *\n * @private\n * @type {boolean}\n */\n\n this.indexesSequenceChanged = false;\n /**\n * Flag determining whether any action on trimmed indexes has been performed. It's used for cache management.\n *\n * @private\n * @type {boolean}\n */\n\n this.trimmedIndexesChanged = false;\n /**\n * Flag determining whether any action on hidden indexes has been performed. It's used for cache management.\n *\n * @private\n * @type {boolean}\n */\n\n this.hiddenIndexesChanged = false;\n /**\n * Physical indexes (respecting the sequence of indexes) which may be rendered (when they are in a viewport).\n *\n * @private\n * @type {Array}\n */\n\n this.renderablePhysicalIndexesCache = [];\n /**\n * Visual indexes (native map's value) corresponding to physical indexes (native map's index).\n *\n * @private\n * @type {Map}\n */\n\n this.fromPhysicalToVisualIndexesCache = new Map();\n /**\n * Visual indexes (native map's value) corresponding to physical indexes (native map's index).\n *\n * @private\n * @type {Map}\n */\n\n this.fromVisualToRenderableIndexesCache = new Map();\n this.indexesSequence.addLocalHook('change', function () {\n _this.indexesSequenceChanged = true; // Sequence of stored indexes might change.\n\n _this.updateCache();\n\n _this.runLocalHooks('change', _this.indexesSequence, null);\n });\n this.trimmingMapsCollection.addLocalHook('change', function (changedMap) {\n _this.trimmedIndexesChanged = true; // Number of trimmed indexes might change.\n\n _this.updateCache();\n\n _this.runLocalHooks('change', changedMap, _this.trimmingMapsCollection);\n });\n this.hidingMapsCollection.addLocalHook('change', function (changedMap) {\n _this.hiddenIndexesChanged = true; // Number of hidden indexes might change.\n\n _this.updateCache();\n\n _this.runLocalHooks('change', changedMap, _this.hidingMapsCollection);\n });\n this.variousMapsCollection.addLocalHook('change', function (changedMap) {\n _this.runLocalHooks('change', changedMap, _this.variousMapsCollection);\n });\n }\n /**\n * Suspends the cache update for this map. The method is helpful to group multiple\n * operations, which affects the cache. In this case, the cache will be updated once after\n * calling the `resumeOperations` method.\n */\n\n\n _createClass(IndexMapper, [{\n key: \"suspendOperations\",\n value: function suspendOperations() {\n this.isBatched = true;\n }\n /**\n * Resumes the cache update for this map. It recalculates the cache and restores the\n * default behavior where each map modification updates the cache.\n */\n\n }, {\n key: \"resumeOperations\",\n value: function resumeOperations() {\n this.isBatched = false;\n this.updateCache();\n }\n /**\n * It creates and returns the new instance of the ChangesObserver object. The object\n * allows listening to the index changes that happen while the Handsontable is running.\n *\n * @param {string} indexMapType The index map type which we want to observe.\n * Currently, only the 'hiding' index map types are observable.\n * @returns {ChangesObserver}\n */\n\n }, {\n key: \"createChangesObserver\",\n value: function createChangesObserver(indexMapType) {\n if (indexMapType !== 'hiding') {\n throw new Error(\"Unsupported index map type \\\"\".concat(indexMapType, \"\\\".\"));\n }\n\n return this.hidingChangesObservable.createObserver();\n }\n /**\n * Creates and register the new IndexMap for specified IndexMapper instance.\n *\n * @param {string} indexName The uniq index name.\n * @param {string} mapType The index map type (e.q. \"hiding, \"trimming\", \"physicalIndexToValue\").\n * @param {*} [initValueOrFn] The initial value for the index map.\n * @returns {IndexMap}\n */\n\n }, {\n key: \"createAndRegisterIndexMap\",\n value: function createAndRegisterIndexMap(indexName, mapType, initValueOrFn) {\n return this.registerMap(indexName, createIndexMap(mapType, initValueOrFn));\n }\n /**\n * Register map which provide some index mappings. Type of map determining to which collection it will be added.\n *\n * @param {string} uniqueName Name of the index map. It should be unique.\n * @param {IndexMap} indexMap Registered index map updated on items removal and insertion.\n * @returns {IndexMap}\n */\n\n }, {\n key: \"registerMap\",\n value: function registerMap(uniqueName, indexMap) {\n if (this.trimmingMapsCollection.get(uniqueName) || this.hidingMapsCollection.get(uniqueName) || this.variousMapsCollection.get(uniqueName)) {\n throw Error(\"Map with name \\\"\".concat(uniqueName, \"\\\" has been already registered.\"));\n }\n\n if (indexMap instanceof TrimmingMap) {\n this.trimmingMapsCollection.register(uniqueName, indexMap);\n } else if (indexMap instanceof HidingMap) {\n this.hidingMapsCollection.register(uniqueName, indexMap);\n } else {\n this.variousMapsCollection.register(uniqueName, indexMap);\n }\n\n var numberOfIndexes = this.getNumberOfIndexes();\n /*\n We initialize map ony when we have full information about number of indexes and the dataset is not empty.\n Otherwise it's unnecessary. Initialization of empty array would not give any positive changes. After initializing\n it with number of indexes equal to 0 the map would be still empty. What's more there would be triggered\n not needed hook (no real change have occurred). Number of indexes is known after loading data (the `loadData`\n function from the `Core`).\n */\n\n if (numberOfIndexes > 0) {\n indexMap.init(numberOfIndexes);\n }\n\n return indexMap;\n }\n /**\n * Unregister a map with given name.\n *\n * @param {string} name Name of the index map.\n */\n\n }, {\n key: \"unregisterMap\",\n value: function unregisterMap(name) {\n this.trimmingMapsCollection.unregister(name);\n this.hidingMapsCollection.unregister(name);\n this.variousMapsCollection.unregister(name);\n }\n /**\n * Unregisters all collected index map instances from all map collection types.\n */\n\n }, {\n key: \"unregisterAll\",\n value: function unregisterAll() {\n this.trimmingMapsCollection.unregisterAll();\n this.hidingMapsCollection.unregisterAll();\n this.variousMapsCollection.unregisterAll();\n }\n /**\n * Get a physical index corresponding to the given visual index.\n *\n * @param {number} visualIndex Visual index.\n * @returns {number|null} Returns translated index mapped by passed visual index.\n */\n\n }, {\n key: \"getPhysicalFromVisualIndex\",\n value: function getPhysicalFromVisualIndex(visualIndex) {\n // Index in the table boundaries provided by the `DataMap`.\n var physicalIndex = this.notTrimmedIndexesCache[visualIndex];\n\n if (isDefined(physicalIndex)) {\n return physicalIndex;\n }\n\n return null;\n }\n /**\n * Get a physical index corresponding to the given renderable index.\n *\n * @param {number} renderableIndex Renderable index.\n * @returns {null|number}\n */\n\n }, {\n key: \"getPhysicalFromRenderableIndex\",\n value: function getPhysicalFromRenderableIndex(renderableIndex) {\n var physicalIndex = this.renderablePhysicalIndexesCache[renderableIndex]; // Index in the renderable table boundaries.\n\n if (isDefined(physicalIndex)) {\n return physicalIndex;\n }\n\n return null;\n }\n /**\n * Get a visual index corresponding to the given physical index.\n *\n * @param {number} physicalIndex Physical index to search.\n * @returns {number|null} Returns a visual index of the index mapper.\n */\n\n }, {\n key: \"getVisualFromPhysicalIndex\",\n value: function getVisualFromPhysicalIndex(physicalIndex) {\n var visualIndex = this.fromPhysicalToVisualIndexesCache.get(physicalIndex); // Index in the table boundaries provided by the `DataMap`.\n\n if (isDefined(visualIndex)) {\n return visualIndex;\n }\n\n return null;\n }\n /**\n * Get a visual index corresponding to the given renderable index.\n *\n * @param {number} renderableIndex Renderable index.\n * @returns {null|number}\n */\n\n }, {\n key: \"getVisualFromRenderableIndex\",\n value: function getVisualFromRenderableIndex(renderableIndex) {\n return this.getVisualFromPhysicalIndex(this.getPhysicalFromRenderableIndex(renderableIndex));\n }\n /**\n * Get a renderable index corresponding to the given visual index.\n *\n * @param {number} visualIndex Visual index.\n * @returns {null|number}\n */\n\n }, {\n key: \"getRenderableFromVisualIndex\",\n value: function getRenderableFromVisualIndex(visualIndex) {\n var renderableIndex = this.fromVisualToRenderableIndexesCache.get(visualIndex); // Index in the renderable table boundaries.\n\n if (isDefined(renderableIndex)) {\n return renderableIndex;\n }\n\n return null;\n }\n /**\n * Search for the first visible, not hidden index (represented by a visual index).\n *\n * @param {number} fromVisualIndex Visual start index. Starting point for finding destination index. Start point may be destination\n * point when handled index is NOT hidden.\n * @param {number} incrementBy We are searching for a next visible indexes by increasing (to be precise, or decreasing) indexes.\n * This variable represent indexes shift. We are looking for an index:\n * - for rows: from the left to the right (increasing indexes, then variable should have value 1) or\n * other way around (decreasing indexes, then variable should have the value -1)\n * - for columns: from the top to the bottom (increasing indexes, then variable should have value 1)\n * or other way around (decreasing indexes, then variable should have the value -1).\n * @param {boolean} searchAlsoOtherWayAround The argument determine if an additional other way around search should be\n * performed, when the search in the first direction had no effect in finding visual index.\n * @param {number} indexForNextSearch Visual index for next search, when the flag is truthy.\n *\n * @returns {number|null} Visual column index or `null`.\n */\n\n }, {\n key: \"getFirstNotHiddenIndex\",\n value: function getFirstNotHiddenIndex(fromVisualIndex, incrementBy) {\n var searchAlsoOtherWayAround = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var indexForNextSearch = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : fromVisualIndex - incrementBy;\n var physicalIndex = this.getPhysicalFromVisualIndex(fromVisualIndex); // First or next (it may be end of the table) index is beyond the table boundaries.\n\n if (physicalIndex === null) {\n // Looking for the next index in the opposite direction. This conditional won't be fulfilled when we STARTED\n // the search from the index beyond the table boundaries.\n if (searchAlsoOtherWayAround === true && indexForNextSearch !== fromVisualIndex - incrementBy) {\n return this.getFirstNotHiddenIndex(indexForNextSearch, -incrementBy, false, indexForNextSearch);\n }\n\n return null;\n }\n\n if (this.isHidden(physicalIndex) === false) {\n return fromVisualIndex;\n } // Looking for the next index, as the current isn't visible.\n\n\n return this.getFirstNotHiddenIndex(fromVisualIndex + incrementBy, incrementBy, searchAlsoOtherWayAround, indexForNextSearch);\n }\n /**\n * Set default values for all indexes in registered index maps.\n *\n * @param {number} [length] Destination length for all stored index maps.\n */\n\n }, {\n key: \"initToLength\",\n value: function initToLength() {\n var length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getNumberOfIndexes();\n this.notTrimmedIndexesCache = _toConsumableArray(new Array(length).keys());\n this.notHiddenIndexesCache = _toConsumableArray(new Array(length).keys());\n this.suspendOperations();\n this.indexesSequence.init(length);\n this.trimmingMapsCollection.initEvery(length);\n this.resumeOperations(); // We move initialization of hidden collection to next batch for purpose of working on sequence of already trimmed indexes.\n\n this.suspendOperations();\n this.hidingMapsCollection.initEvery(length); // It shouldn't reset the cache.\n\n this.variousMapsCollection.initEvery(length);\n this.resumeOperations();\n this.runLocalHooks('init');\n }\n /**\n * Get sequence of indexes.\n *\n * @returns {Array} Physical indexes.\n */\n\n }, {\n key: \"getIndexesSequence\",\n value: function getIndexesSequence() {\n return this.indexesSequence.getValues();\n }\n /**\n * Set completely new indexes sequence.\n *\n * @param {Array} indexes Physical indexes.\n */\n\n }, {\n key: \"setIndexesSequence\",\n value: function setIndexesSequence(indexes) {\n this.indexesSequence.setValues(indexes);\n }\n /**\n * Get all NOT trimmed indexes.\n *\n * Note: Indexes marked as trimmed aren't included in a {@link data-map DataMap} and aren't rendered.\n *\n * @param {boolean} [readFromCache=true] Determine if read indexes from cache.\n * @returns {Array} List of physical indexes. Index of this native array is a \"visual index\",\n * value of this native array is a \"physical index\".\n */\n\n }, {\n key: \"getNotTrimmedIndexes\",\n value: function getNotTrimmedIndexes() {\n var _this2 = this;\n\n var readFromCache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n if (readFromCache === true) {\n return this.notTrimmedIndexesCache;\n }\n\n var indexesSequence = this.getIndexesSequence();\n return indexesSequence.filter(function (physicalIndex) {\n return _this2.isTrimmed(physicalIndex) === false;\n });\n }\n /**\n * Get length of all NOT trimmed indexes.\n *\n * Note: Indexes marked as trimmed aren't included in a {@link data-map DataMap} and aren't rendered.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getNotTrimmedIndexesLength\",\n value: function getNotTrimmedIndexesLength() {\n return this.getNotTrimmedIndexes().length;\n }\n /**\n * Get all NOT hidden indexes.\n *\n * Note: Indexes marked as hidden are included in a {@link data-map DataMap}, but aren't rendered.\n *\n * @param {boolean} [readFromCache=true] Determine if read indexes from cache.\n * @returns {Array} List of physical indexes. Please keep in mind that index of this native array IS NOT a \"visual index\".\n */\n\n }, {\n key: \"getNotHiddenIndexes\",\n value: function getNotHiddenIndexes() {\n var _this3 = this;\n\n var readFromCache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n if (readFromCache === true) {\n return this.notHiddenIndexesCache;\n }\n\n var indexesSequence = this.getIndexesSequence();\n return indexesSequence.filter(function (physicalIndex) {\n return _this3.isHidden(physicalIndex) === false;\n });\n }\n /**\n * Get length of all NOT hidden indexes.\n *\n * Note: Indexes marked as hidden are included in a {@link data-map DataMap}, but aren't rendered.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getNotHiddenIndexesLength\",\n value: function getNotHiddenIndexesLength() {\n return this.getNotHiddenIndexes().length;\n }\n /**\n * Get list of physical indexes (respecting the sequence of indexes) which may be rendered (when they are in a viewport).\n *\n * @param {boolean} [readFromCache=true] Determine if read indexes from cache.\n * @returns {Array} List of physical indexes. Index of this native array is a \"renderable index\",\n * value of this native array is a \"physical index\".\n */\n\n }, {\n key: \"getRenderableIndexes\",\n value: function getRenderableIndexes() {\n var _this4 = this;\n\n var readFromCache = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n if (readFromCache === true) {\n return this.renderablePhysicalIndexesCache;\n }\n\n var notTrimmedIndexes = this.getNotTrimmedIndexes();\n return notTrimmedIndexes.filter(function (physicalIndex) {\n return _this4.isHidden(physicalIndex) === false;\n });\n }\n /**\n * Get length of all NOT trimmed and NOT hidden indexes.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getRenderableIndexesLength\",\n value: function getRenderableIndexesLength() {\n return this.getRenderableIndexes().length;\n }\n /**\n * Get number of all indexes.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getNumberOfIndexes\",\n value: function getNumberOfIndexes() {\n return this.getIndexesSequence().length;\n }\n /**\n * Move indexes in the index mapper.\n *\n * @param {number|Array} movedIndexes Visual index(es) to move.\n * @param {number} finalIndex Visual index being a start index for the moved elements.\n */\n\n }, {\n key: \"moveIndexes\",\n value: function moveIndexes(movedIndexes, finalIndex) {\n var _this5 = this;\n\n if (typeof movedIndexes === 'number') {\n movedIndexes = [movedIndexes];\n }\n\n var physicalMovedIndexes = arrayMap(movedIndexes, function (visualIndex) {\n return _this5.getPhysicalFromVisualIndex(visualIndex);\n });\n var notTrimmedIndexesLength = this.getNotTrimmedIndexesLength();\n var movedIndexesLength = movedIndexes.length; // Removing indexes without re-indexing.\n\n var listWithRemovedItems = getListWithRemovedItems(this.getIndexesSequence(), physicalMovedIndexes); // When item(s) are moved after the last visible item we assign the last possible index.\n\n var destinationPosition = notTrimmedIndexesLength - movedIndexesLength; // Otherwise, we find proper index for inserted item(s).\n\n if (finalIndex + movedIndexesLength < notTrimmedIndexesLength) {\n // Physical index at final index position.\n var physicalIndex = listWithRemovedItems.filter(function (index) {\n return _this5.isTrimmed(index) === false;\n })[finalIndex];\n destinationPosition = listWithRemovedItems.indexOf(physicalIndex);\n } // Adding indexes without re-indexing.\n\n\n this.setIndexesSequence(getListWithInsertedItems(listWithRemovedItems, destinationPosition, physicalMovedIndexes));\n }\n /**\n * Get whether index is trimmed. Index marked as trimmed isn't included in a {@link data-map DataMap} and isn't rendered.\n *\n * @param {number} physicalIndex Physical index.\n * @returns {boolean}\n */\n\n }, {\n key: \"isTrimmed\",\n value: function isTrimmed(physicalIndex) {\n return this.trimmingMapsCollection.getMergedValueAtIndex(physicalIndex);\n }\n /**\n * Get whether index is hidden. Index marked as hidden is included in a {@link data-map DataMap}, but isn't rendered.\n *\n * @param {number} physicalIndex Physical index.\n * @returns {boolean}\n */\n\n }, {\n key: \"isHidden\",\n value: function isHidden(physicalIndex) {\n return this.hidingMapsCollection.getMergedValueAtIndex(physicalIndex);\n }\n /**\n * Insert new indexes and corresponding mapping and update values of the others, for all stored index maps.\n *\n * @private\n * @param {number} firstInsertedVisualIndex First inserted visual index.\n * @param {number} amountOfIndexes Amount of inserted indexes.\n */\n\n }, {\n key: \"insertIndexes\",\n value: function insertIndexes(firstInsertedVisualIndex, amountOfIndexes) {\n var nthVisibleIndex = this.getNotTrimmedIndexes()[firstInsertedVisualIndex];\n var firstInsertedPhysicalIndex = isDefined(nthVisibleIndex) ? nthVisibleIndex : this.getNumberOfIndexes();\n var insertionIndex = this.getIndexesSequence().includes(nthVisibleIndex) ? this.getIndexesSequence().indexOf(nthVisibleIndex) : this.getNumberOfIndexes();\n var insertedIndexes = arrayMap(new Array(amountOfIndexes).fill(firstInsertedPhysicalIndex), function (nextIndex, stepsFromStart) {\n return nextIndex + stepsFromStart;\n });\n this.suspendOperations();\n this.indexesSequence.insert(insertionIndex, insertedIndexes);\n this.trimmingMapsCollection.insertToEvery(insertionIndex, insertedIndexes);\n this.hidingMapsCollection.insertToEvery(insertionIndex, insertedIndexes);\n this.variousMapsCollection.insertToEvery(insertionIndex, insertedIndexes);\n this.resumeOperations();\n }\n /**\n * Remove some indexes and corresponding mappings and update values of the others, for all stored index maps.\n *\n * @private\n * @param {Array} removedIndexes List of removed indexes.\n */\n\n }, {\n key: \"removeIndexes\",\n value: function removeIndexes(removedIndexes) {\n this.suspendOperations();\n this.indexesSequence.remove(removedIndexes);\n this.trimmingMapsCollection.removeFromEvery(removedIndexes);\n this.hidingMapsCollection.removeFromEvery(removedIndexes);\n this.variousMapsCollection.removeFromEvery(removedIndexes);\n this.resumeOperations();\n }\n /**\n * Rebuild cache for some indexes. Every action on indexes sequence or indexes skipped in the process of rendering\n * by default reset cache, thus batching some index maps actions is recommended.\n *\n * @private\n * @param {boolean} [force=false] Determine if force cache update.\n */\n\n }, {\n key: \"updateCache\",\n value: function updateCache() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var anyCachedIndexChanged = this.indexesSequenceChanged || this.trimmedIndexesChanged || this.hiddenIndexesChanged;\n\n if (force === true || this.isBatched === false && anyCachedIndexChanged === true) {\n this.trimmingMapsCollection.updateCache();\n this.hidingMapsCollection.updateCache();\n this.notTrimmedIndexesCache = this.getNotTrimmedIndexes(false);\n this.notHiddenIndexesCache = this.getNotHiddenIndexes(false);\n this.renderablePhysicalIndexesCache = this.getRenderableIndexes(false);\n this.cacheFromPhysicalToVisualIndexes();\n this.cacheFromVisualToRenderabIendexes(); // Currently there's support only for the \"hiding\" map type.\n\n if (this.hiddenIndexesChanged) {\n this.hidingChangesObservable.emit(this.hidingMapsCollection.getMergedValues());\n }\n\n this.runLocalHooks('cacheUpdated', {\n indexesSequenceChanged: this.indexesSequenceChanged,\n trimmedIndexesChanged: this.trimmedIndexesChanged,\n hiddenIndexesChanged: this.hiddenIndexesChanged\n });\n this.indexesSequenceChanged = false;\n this.trimmedIndexesChanged = false;\n this.hiddenIndexesChanged = false;\n }\n }\n /**\n * Update cache for translations from physical to visual indexes.\n *\n * @private\n */\n\n }, {\n key: \"cacheFromPhysicalToVisualIndexes\",\n value: function cacheFromPhysicalToVisualIndexes() {\n var nrOfNotTrimmedIndexes = this.getNotTrimmedIndexesLength();\n this.fromPhysicalToVisualIndexesCache.clear();\n\n for (var visualIndex = 0; visualIndex < nrOfNotTrimmedIndexes; visualIndex += 1) {\n var physicalIndex = this.getPhysicalFromVisualIndex(visualIndex); // Every visual index have corresponding physical index, but some physical indexes may don't have\n // corresponding visual indexes (physical indexes may represent trimmed indexes, beyond the table boundaries)\n\n this.fromPhysicalToVisualIndexesCache.set(physicalIndex, visualIndex);\n }\n }\n /**\n * Update cache for translations from visual to renderable indexes.\n *\n * @private\n */\n\n }, {\n key: \"cacheFromVisualToRenderabIendexes\",\n value: function cacheFromVisualToRenderabIendexes() {\n var nrOfRenderableIndexes = this.getRenderableIndexesLength();\n this.fromVisualToRenderableIndexesCache.clear();\n\n for (var renderableIndex = 0; renderableIndex < nrOfRenderableIndexes; renderableIndex += 1) {\n // Can't use getRenderableFromVisualIndex here because we're building the cache here\n var physicalIndex = this.getPhysicalFromRenderableIndex(renderableIndex);\n var visualIndex = this.getVisualFromPhysicalIndex(physicalIndex);\n this.fromVisualToRenderableIndexesCache.set(visualIndex, renderableIndex);\n }\n }\n }]);\n\n return IndexMapper;\n}();\nmixin(IndexMapper, localHooks);","var _templateObject;\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.object.freeze.js\";\nimport { isUndefined, isDefined } from \"./../helpers/mixed.mjs\";\nimport { objectEach } from \"./../helpers/object.mjs\";\nimport { error } from \"./../helpers/console.mjs\";\nimport { toSingleLine } from \"./../helpers/templateLiteralTag.mjs\";\n/**\n * Perform shallow extend of a target object with only this extension's properties which doesn't exist in the target.\n *\n * TODO: Maybe it should be moved to global helpers? It's changed `extend` function.\n *\n * @param {object} target An object that will receive the new properties.\n * @param {object} extension An object containing additional properties to merge into the target.\n * @returns {object}\n */\n\nexport function extendNotExistingKeys(target, extension) {\n objectEach(extension, function (value, key) {\n if (isUndefined(target[key])) {\n target[key] = value;\n }\n });\n return target;\n}\n/**\n * Create range of values basing on cell indexes. For example, it will create below ranges for specified function arguments:\n *\n * createCellHeadersRange(2, 7) => `2-7`\n * createCellHeadersRange(7, 2) => `2-7`\n * createCellHeadersRange(0, 4, 'A', 'D') => `A-D`\n * createCellHeadersRange(4, 0, 'D', 'A') => `A-D`.\n *\n * @param {number} firstRowIndex Index of \"first\" cell.\n * @param {number} nextRowIndex Index of \"next\" cell.\n * @param {*} fromValue Value which will represent \"first\" cell.\n * @param {*} toValue Value which will represent \"next\" cell.\n * @returns {string} Value representing range i.e. A-Z, 11-15.\n */\n\nexport function createCellHeadersRange(firstRowIndex, nextRowIndex) {\n var fromValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : firstRowIndex;\n var toValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : nextRowIndex;\n // Will swap `fromValue` with `toValue` if it's necessary.\n var from = fromValue,\n to = toValue;\n\n if (firstRowIndex > nextRowIndex) {\n var _ref = [to, from];\n from = _ref[0];\n to = _ref[1];\n }\n\n return \"\".concat(from, \"-\").concat(to);\n}\n/**\n * Normalize language code. It takes handled languageCode proposition and change it to proper languageCode.\n * For example, when it takes `eN-us` as parameter it return `en-US`.\n *\n * @param {string} languageCode Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.\n * @returns {string}\n */\n\nexport function normalizeLanguageCode(languageCode) {\n var languageCodePattern = /^([a-zA-Z]{2})-([a-zA-Z]{2})$/;\n var partsOfLanguageCode = languageCodePattern.exec(languageCode);\n\n if (partsOfLanguageCode) {\n return \"\".concat(partsOfLanguageCode[1].toLowerCase(), \"-\").concat(partsOfLanguageCode[2].toUpperCase());\n }\n\n return languageCode;\n}\n/**\n *\n * Warn user if there is no registered language.\n *\n * @param {string} languageCode Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.\n */\n\nexport function warnUserAboutLanguageRegistration(languageCode) {\n if (isDefined(languageCode)) {\n error(toSingleLine(_templateObject || (_templateObject = _taggedTemplateLiteral([\"Language with code \\\"\", \"\\\" was not found. You should register particular language \\n before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.\"], [\"Language with code \\\"\", \"\\\" was not found. You should register particular language\\\\x20\\n before using it. Read more about this issue at: https://docs.handsontable.com/i18n/missing-language-code.\"])), languageCode));\n }\n}","import \"core-js/modules/es.number.is-integer.js\";\nimport \"core-js/modules/es.number.constructor.js\";\n\n/**\n * Try to choose plural form from available phrase propositions.\n *\n * @param {Array} phrasePropositions List of phrases propositions.\n * @param {number} pluralForm Number determining which phrase form should be used.\n *\n * @returns {string|Array} One particular phrase if it's possible, list of unchanged phrase propositions otherwise.\n */\nexport default function pluralize(phrasePropositions, pluralForm) {\n var isPluralizable = Array.isArray(phrasePropositions) && Number.isInteger(pluralForm);\n\n if (isPluralizable) {\n return phrasePropositions[pluralForm];\n }\n\n return phrasePropositions;\n}","import staticRegister from \"./../../utils/staticRegister.mjs\";\nimport pluralizeFn from \"./pluralize.mjs\";\n\nvar _staticRegister = staticRegister('phraseFormatters'),\n registerGloballyPhraseFormatter = _staticRegister.register,\n getGlobalPhraseFormatters = _staticRegister.getValues;\n/**\n * Register phrase formatter.\n *\n * @param {string} name Name of formatter.\n * @param {Function} formatterFn Function which will be applied on phrase propositions. It will transform them if it's possible.\n */\n\n\nexport function register(name, formatterFn) {\n registerGloballyPhraseFormatter(name, formatterFn);\n}\n/**\n * Get all registered previously formatters.\n *\n * @returns {Array}\n */\n\nexport function getAll() {\n return getGlobalPhraseFormatters();\n}\nexport { register as registerPhraseFormatter, getAll as getPhraseFormatters };\nregister('pluralize', pluralizeFn);","/**\n * Constants for parts of translation.\n */\nexport var CONTEXT_MENU_ITEMS_NAMESPACE = 'ContextMenu:items';\nexport var CONTEXTMENU_ITEMS_NO_ITEMS = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".noItems\");\nexport var CONTEXTMENU_ITEMS_ROW_ABOVE = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".insertRowAbove\");\nexport var CONTEXTMENU_ITEMS_ROW_BELOW = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".insertRowBelow\");\nexport var CONTEXTMENU_ITEMS_INSERT_LEFT = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".insertColumnOnTheLeft\");\nexport var CONTEXTMENU_ITEMS_INSERT_RIGHT = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".insertColumnOnTheRight\");\nexport var CONTEXTMENU_ITEMS_REMOVE_ROW = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".removeRow\");\nexport var CONTEXTMENU_ITEMS_REMOVE_COLUMN = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".removeColumn\");\nexport var CONTEXTMENU_ITEMS_UNDO = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".undo\");\nexport var CONTEXTMENU_ITEMS_REDO = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".redo\");\nexport var CONTEXTMENU_ITEMS_READ_ONLY = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".readOnly\");\nexport var CONTEXTMENU_ITEMS_CLEAR_COLUMN = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".clearColumn\");\nexport var CONTEXTMENU_ITEMS_COPY = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".copy\");\nexport var CONTEXTMENU_ITEMS_CUT = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".cut\");\nexport var CONTEXTMENU_ITEMS_FREEZE_COLUMN = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".freezeColumn\");\nexport var CONTEXTMENU_ITEMS_UNFREEZE_COLUMN = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".unfreezeColumn\");\nexport var CONTEXTMENU_ITEMS_MERGE_CELLS = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".mergeCells\");\nexport var CONTEXTMENU_ITEMS_UNMERGE_CELLS = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".unmergeCells\");\nexport var CONTEXTMENU_ITEMS_ADD_COMMENT = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".addComment\");\nexport var CONTEXTMENU_ITEMS_EDIT_COMMENT = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".editComment\");\nexport var CONTEXTMENU_ITEMS_REMOVE_COMMENT = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".removeComment\");\nexport var CONTEXTMENU_ITEMS_READ_ONLY_COMMENT = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".readOnlyComment\");\nexport var CONTEXTMENU_ITEMS_ALIGNMENT = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".align\");\nexport var CONTEXTMENU_ITEMS_ALIGNMENT_LEFT = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".align.left\");\nexport var CONTEXTMENU_ITEMS_ALIGNMENT_CENTER = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".align.center\");\nexport var CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".align.right\");\nexport var CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".align.justify\");\nexport var CONTEXTMENU_ITEMS_ALIGNMENT_TOP = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".align.top\");\nexport var CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".align.middle\");\nexport var CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".align.bottom\");\nexport var CONTEXTMENU_ITEMS_BORDERS = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".borders\");\nexport var CONTEXTMENU_ITEMS_BORDERS_TOP = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".borders.top\");\nexport var CONTEXTMENU_ITEMS_BORDERS_RIGHT = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".borders.right\");\nexport var CONTEXTMENU_ITEMS_BORDERS_BOTTOM = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".borders.bottom\");\nexport var CONTEXTMENU_ITEMS_BORDERS_LEFT = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".borders.left\");\nexport var CONTEXTMENU_ITEMS_REMOVE_BORDERS = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".borders.remove\");\nexport var CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".nestedHeaders.insertChildRow\"); // eslint-disable-line max-len\n\nexport var CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".nestedHeaders.detachFromParent\"); // eslint-disable-line max-len\n\nexport var CONTEXTMENU_ITEMS_HIDE_COLUMN = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".hideColumn\");\nexport var CONTEXTMENU_ITEMS_SHOW_COLUMN = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".showColumn\");\nexport var CONTEXTMENU_ITEMS_HIDE_ROW = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".hideRow\");\nexport var CONTEXTMENU_ITEMS_SHOW_ROW = \"\".concat(CONTEXT_MENU_ITEMS_NAMESPACE, \".showRow\");\nexport var FILTERS_NAMESPACE = 'Filters:';\nexport var FILTERS_CONDITIONS_NAMESPACE = \"\".concat(FILTERS_NAMESPACE, \"conditions\");\nexport var FILTERS_CONDITIONS_NONE = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".none\");\nexport var FILTERS_CONDITIONS_EMPTY = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".isEmpty\");\nexport var FILTERS_CONDITIONS_NOT_EMPTY = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".isNotEmpty\");\nexport var FILTERS_CONDITIONS_EQUAL = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".isEqualTo\");\nexport var FILTERS_CONDITIONS_NOT_EQUAL = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".isNotEqualTo\");\nexport var FILTERS_CONDITIONS_BEGINS_WITH = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".beginsWith\");\nexport var FILTERS_CONDITIONS_ENDS_WITH = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".endsWith\");\nexport var FILTERS_CONDITIONS_CONTAINS = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".contains\");\nexport var FILTERS_CONDITIONS_NOT_CONTAIN = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".doesNotContain\");\nexport var FILTERS_CONDITIONS_BY_VALUE = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".byValue\");\nexport var FILTERS_CONDITIONS_GREATER_THAN = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".greaterThan\");\nexport var FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".greaterThanOrEqualTo\");\nexport var FILTERS_CONDITIONS_LESS_THAN = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".lessThan\");\nexport var FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".lessThanOrEqualTo\");\nexport var FILTERS_CONDITIONS_BETWEEN = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".isBetween\");\nexport var FILTERS_CONDITIONS_NOT_BETWEEN = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".isNotBetween\");\nexport var FILTERS_CONDITIONS_AFTER = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".after\");\nexport var FILTERS_CONDITIONS_BEFORE = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".before\");\nexport var FILTERS_CONDITIONS_TODAY = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".today\");\nexport var FILTERS_CONDITIONS_TOMORROW = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".tomorrow\");\nexport var FILTERS_CONDITIONS_YESTERDAY = \"\".concat(FILTERS_CONDITIONS_NAMESPACE, \".yesterday\");\nexport var FILTERS_DIVS_FILTER_BY_CONDITION = \"\".concat(FILTERS_NAMESPACE, \"labels.filterByCondition\");\nexport var FILTERS_DIVS_FILTER_BY_VALUE = \"\".concat(FILTERS_NAMESPACE, \"labels.filterByValue\");\nexport var FILTERS_LABELS_CONJUNCTION = \"\".concat(FILTERS_NAMESPACE, \"labels.conjunction\");\nexport var FILTERS_LABELS_DISJUNCTION = \"\".concat(FILTERS_NAMESPACE, \"labels.disjunction\");\nexport var FILTERS_VALUES_BLANK_CELLS = \"\".concat(FILTERS_NAMESPACE, \"values.blankCells\");\nexport var FILTERS_BUTTONS_SELECT_ALL = \"\".concat(FILTERS_NAMESPACE, \"buttons.selectAll\");\nexport var FILTERS_BUTTONS_CLEAR = \"\".concat(FILTERS_NAMESPACE, \"buttons.clear\");\nexport var FILTERS_BUTTONS_OK = \"\".concat(FILTERS_NAMESPACE, \"buttons.ok\");\nexport var FILTERS_BUTTONS_CANCEL = \"\".concat(FILTERS_NAMESPACE, \"buttons.cancel\");\nexport var FILTERS_BUTTONS_PLACEHOLDER_SEARCH = \"\".concat(FILTERS_NAMESPACE, \"buttons.placeholder.search\");\nexport var FILTERS_BUTTONS_PLACEHOLDER_VALUE = \"\".concat(FILTERS_NAMESPACE, \"buttons.placeholder.value\");\nexport var FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE = \"\".concat(FILTERS_NAMESPACE, \"buttons.placeholder.secondValue\");","var _dictionary;\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\n * @preserve\n * Authors: Handsoncode\n * Last updated: Nov 15, 2017\n *\n * Description: Definition file for English - United States language-country.\n */\nimport * as C from \"../constants.mjs\";\nvar dictionary = (_dictionary = {\n languageCode: 'en-US'\n}, _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_NO_ITEMS, 'No available options'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_ROW_ABOVE, 'Insert row above'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_ROW_BELOW, 'Insert row below'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_INSERT_LEFT, 'Insert column left'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_INSERT_RIGHT, 'Insert column right'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_REMOVE_ROW, ['Remove row', 'Remove rows']), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_REMOVE_COLUMN, ['Remove column', 'Remove columns']), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_UNDO, 'Undo'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_REDO, 'Redo'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_READ_ONLY, 'Read only'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_CLEAR_COLUMN, 'Clear column'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT, 'Alignment'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT, 'Left'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER, 'Center'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT, 'Right'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY, 'Justify'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_TOP, 'Top'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE, 'Middle'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM, 'Bottom'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_FREEZE_COLUMN, 'Freeze column'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN, 'Unfreeze column'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS, 'Borders'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS_TOP, 'Top'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS_RIGHT, 'Right'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS_BOTTOM, 'Bottom'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS_LEFT, 'Left'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_REMOVE_BORDERS, 'Remove border(s)'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_ADD_COMMENT, 'Add comment'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_EDIT_COMMENT, 'Edit comment'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_REMOVE_COMMENT, 'Delete comment'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT, 'Read-only comment'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_MERGE_CELLS, 'Merge cells'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_UNMERGE_CELLS, 'Unmerge cells'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_COPY, 'Copy'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_CUT, 'Cut'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD, 'Insert child row'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD, 'Detach from parent'), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_HIDE_COLUMN, ['Hide column', 'Hide columns']), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_SHOW_COLUMN, ['Show column', 'Show columns']), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_HIDE_ROW, ['Hide row', 'Hide rows']), _defineProperty(_dictionary, C.CONTEXTMENU_ITEMS_SHOW_ROW, ['Show row', 'Show rows']), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_NONE, 'None'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_EMPTY, 'Is empty'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_NOT_EMPTY, 'Is not empty'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_EQUAL, 'Is equal to'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_NOT_EQUAL, 'Is not equal to'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_BEGINS_WITH, 'Begins with'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_ENDS_WITH, 'Ends with'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_CONTAINS, 'Contains'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_NOT_CONTAIN, 'Does not contain'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_GREATER_THAN, 'Greater than'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL, 'Greater than or equal to'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_LESS_THAN, 'Less than'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL, 'Less than or equal to'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_BETWEEN, 'Is between'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_NOT_BETWEEN, 'Is not between'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_AFTER, 'After'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_BEFORE, 'Before'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_TODAY, 'Today'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_TOMORROW, 'Tomorrow'), _defineProperty(_dictionary, C.FILTERS_CONDITIONS_YESTERDAY, 'Yesterday'), _defineProperty(_dictionary, C.FILTERS_VALUES_BLANK_CELLS, 'Blank cells'), _defineProperty(_dictionary, C.FILTERS_DIVS_FILTER_BY_CONDITION, 'Filter by condition'), _defineProperty(_dictionary, C.FILTERS_DIVS_FILTER_BY_VALUE, 'Filter by value'), _defineProperty(_dictionary, C.FILTERS_LABELS_CONJUNCTION, 'And'), _defineProperty(_dictionary, C.FILTERS_LABELS_DISJUNCTION, 'Or'), _defineProperty(_dictionary, C.FILTERS_BUTTONS_SELECT_ALL, 'Select all'), _defineProperty(_dictionary, C.FILTERS_BUTTONS_CLEAR, 'Clear'), _defineProperty(_dictionary, C.FILTERS_BUTTONS_OK, 'OK'), _defineProperty(_dictionary, C.FILTERS_BUTTONS_CANCEL, 'Cancel'), _defineProperty(_dictionary, C.FILTERS_BUTTONS_PLACEHOLDER_SEARCH, 'Search'), _defineProperty(_dictionary, C.FILTERS_BUTTONS_PLACEHOLDER_VALUE, 'Value'), _defineProperty(_dictionary, C.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE, 'Second value'), _dictionary);\nexport default dictionary;","import { isObject, deepClone } from \"../helpers/object.mjs\";\nimport { arrayEach } from \"./../helpers/array.mjs\";\nimport { isUndefined } from \"../helpers/mixed.mjs\";\nimport { extendNotExistingKeys, normalizeLanguageCode, warnUserAboutLanguageRegistration } from \"./utils.mjs\";\nimport staticRegister from \"../utils/staticRegister.mjs\";\nimport { getPhraseFormatters } from \"./phraseFormatters/index.mjs\";\nimport DEFAULT_DICTIONARY from \"./languages/en-US.mjs\";\nimport * as _dictionaryKeys from \"./constants.mjs\";\nexport { _dictionaryKeys as dictionaryKeys };\nexport var DEFAULT_LANGUAGE_CODE = DEFAULT_DICTIONARY.languageCode;\n\nvar _staticRegister = staticRegister('languagesDictionaries'),\n registerGloballyLanguageDictionary = _staticRegister.register,\n getGlobalLanguageDictionary = _staticRegister.getItem,\n hasGlobalLanguageDictionary = _staticRegister.hasItem,\n getGlobalLanguagesDictionaries = _staticRegister.getValues;\n/**\n * Register automatically the default language dictionary.\n */\n\n\nregisterLanguageDictionary(DEFAULT_DICTIONARY);\n/**\n * Register language dictionary for specific language code.\n *\n * @param {string|object} languageCodeOrDictionary Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE' or object representing dictionary.\n * @param {object} dictionary Dictionary for specific language (optional if first parameter has already dictionary).\n * @returns {object}\n */\n\nexport function registerLanguageDictionary(languageCodeOrDictionary, dictionary) {\n var languageCode = languageCodeOrDictionary;\n var dictionaryObject = dictionary; // Dictionary passed as first argument.\n\n if (isObject(languageCodeOrDictionary)) {\n dictionaryObject = languageCodeOrDictionary;\n languageCode = dictionaryObject.languageCode;\n }\n\n extendLanguageDictionary(languageCode, dictionaryObject);\n registerGloballyLanguageDictionary(languageCode, deepClone(dictionaryObject)); // We do not allow user to work with dictionary by reference, it can cause lot of bugs.\n\n return deepClone(dictionaryObject);\n}\n/**\n * Extend handled dictionary by default language dictionary. As result, if any dictionary key isn't defined for specific language, it will be filled with default language value (\"dictionary gaps\" are supplemented).\n *\n * @private\n * @param {string} languageCode Language code.\n * @param {object} dictionary Dictionary which is extended.\n */\n\nfunction extendLanguageDictionary(languageCode, dictionary) {\n if (languageCode !== DEFAULT_LANGUAGE_CODE) {\n extendNotExistingKeys(dictionary, getGlobalLanguageDictionary(DEFAULT_LANGUAGE_CODE));\n }\n}\n/**\n * Get language dictionary for specific language code.\n *\n * @param {string} languageCode Language code.\n * @returns {object} Object with constants representing identifiers for translation (as keys) and corresponding translation phrases (as values).\n */\n\n\nexport function getLanguageDictionary(languageCode) {\n if (!hasLanguageDictionary(languageCode)) {\n return null;\n }\n\n return deepClone(getGlobalLanguageDictionary(languageCode));\n}\n/**\n *\n * Get if language with specified language code was registered.\n *\n * @param {string} languageCode Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.\n * @returns {boolean}\n */\n\nexport function hasLanguageDictionary(languageCode) {\n return hasGlobalLanguageDictionary(languageCode);\n}\n/**\n * Get default language dictionary.\n *\n * @returns {object} Object with constants representing identifiers for translation (as keys) and corresponding translation phrases (as values).\n */\n\nexport function getDefaultLanguageDictionary() {\n return DEFAULT_DICTIONARY;\n}\n/**\n * Get registered language dictionaries.\n *\n * @returns {Array}\n */\n\nexport function getLanguagesDictionaries() {\n return getGlobalLanguagesDictionaries();\n}\n/**\n * Get phrase for specified dictionary key.\n *\n * @param {string} languageCode Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.\n * @param {string} dictionaryKey Constant which is dictionary key.\n * @param {*} argumentsForFormatters Arguments which will be handled by formatters.\n *\n * @returns {string}\n */\n\nexport function getTranslatedPhrase(languageCode, dictionaryKey, argumentsForFormatters) {\n var languageDictionary = getLanguageDictionary(languageCode);\n\n if (languageDictionary === null) {\n return null;\n }\n\n var phrasePropositions = languageDictionary[dictionaryKey];\n\n if (isUndefined(phrasePropositions)) {\n return null;\n }\n\n var formattedPhrase = getFormattedPhrase(phrasePropositions, argumentsForFormatters);\n\n if (Array.isArray(formattedPhrase)) {\n return formattedPhrase[0];\n }\n\n return formattedPhrase;\n}\n/**\n * Get formatted phrase from phrases propositions for specified dictionary key.\n *\n * @private\n * @param {Array|string} phrasePropositions List of phrase propositions.\n * @param {*} argumentsForFormatters Arguments which will be handled by formatters.\n *\n * @returns {Array|string}\n */\n\nfunction getFormattedPhrase(phrasePropositions, argumentsForFormatters) {\n var formattedPhrasePropositions = phrasePropositions;\n arrayEach(getPhraseFormatters(), function (formatter) {\n formattedPhrasePropositions = formatter(phrasePropositions, argumentsForFormatters);\n });\n return formattedPhrasePropositions;\n}\n/**\n * Returns valid language code. If the passed language code doesn't exist default one will be used.\n *\n * @param {string} languageCode Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.\n * @returns {string}\n */\n\n\nexport function getValidLanguageCode(languageCode) {\n var normalizedLanguageCode = normalizeLanguageCode(languageCode);\n\n if (!hasLanguageDictionary(normalizedLanguageCode)) {\n normalizedLanguageCode = DEFAULT_LANGUAGE_CODE;\n warnUserAboutLanguageRegistration(languageCode);\n }\n\n return normalizedLanguageCode;\n}","import \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.set.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport EventManager from \"../eventManager.mjs\";\nimport { isCtrlMetaKey, isKey } from \"../helpers/unicode.mjs\";\nvar eventManager = new EventManager();\nvar pressedKeys = new Set();\nvar refCount = 0;\n/**\n * Begins observing keyboard keys states.\n *\n * @param {Document} rootDocument The document owner.\n */\n\nfunction startObserving(rootDocument) {\n if (refCount === 0) {\n eventManager.addEventListener(rootDocument, 'keydown', function (event) {\n if (!pressedKeys.has(event.keyCode)) {\n pressedKeys.add(event.keyCode);\n }\n });\n eventManager.addEventListener(rootDocument, 'keyup', function (event) {\n if (pressedKeys.has(event.keyCode)) {\n pressedKeys.delete(event.keyCode);\n }\n });\n eventManager.addEventListener(rootDocument, 'visibilitychange', function () {\n if (rootDocument.hidden) {\n pressedKeys.clear();\n }\n });\n eventManager.addEventListener(rootDocument.defaultView, 'blur', function () {\n pressedKeys.clear();\n });\n }\n\n refCount += 1;\n}\n/**\n * Stops observing keyboard keys states and clear all previously saved states.\n */\n\n\nfunction stopObserving() {\n if (refCount > 0) {\n refCount -= 1;\n }\n\n if (refCount === 0) {\n _resetState();\n }\n}\n/**\n * Remove all listeners attached to the DOM and clear all previously saved states.\n */\n\n\nfunction _resetState() {\n eventManager.clearEvents();\n pressedKeys.clear();\n refCount = 0;\n}\n/**\n * Checks if provided keyCode or keyCodes are pressed.\n *\n * @param {string} keyCodes The key codes passed as a string defined in helpers/unicode.js file delimited with '|'.\n * @returns {boolean}\n */\n\n\nfunction isPressed(keyCodes) {\n return Array.from(pressedKeys.values()).some(function (_keyCode) {\n return isKey(_keyCode, keyCodes);\n });\n}\n/**\n * Checks if ctrl keys are pressed.\n *\n * @returns {boolean}\n */\n\n\nfunction isPressedCtrlKey() {\n var values = Array.from(pressedKeys.values());\n return values.some(function (_keyCode) {\n return isCtrlMetaKey(_keyCode);\n });\n}\n/**\n * Returns reference count. Useful for debugging and testing purposes.\n *\n * @returns {number}\n */\n\n\nfunction _getRefCount() {\n return refCount;\n}\n\nexport { _getRefCount, _resetState, isPressed, isPressedCtrlKey, startObserving, stopObserving };","export var ACTIVE_HEADER_TYPE = 'active-header';\nexport var AREA_TYPE = 'area';\nexport var CELL_TYPE = 'cell';\nexport var FILL_TYPE = 'fill';\nexport var HEADER_TYPE = 'header';\nexport var CUSTOM_SELECTION_TYPE = 'custom-selection';","import \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.string.includes.js\";\nimport \"core-js/modules/es.array.index-of.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport CellCoords from \"./../cell/coords.mjs\";\n/**\n * CellRange holds cell coordinates as {@link CellCoords} instances. This object represent unit of the selection layer which\n * can contains multiple contiquous cells or single cell.\n *\n * @util\n */\n\nvar CellRange = /*#__PURE__*/function () {\n function CellRange(highlight) {\n var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : highlight;\n var to = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : highlight;\n\n _classCallCheck(this, CellRange);\n\n /**\n * Used to draw bold border around a cell where selection was started and to edit the cell\n * when you press Enter. The highlight cannot point to headers (negative values) so its\n * coordinates object is normalized while assigning.\n *\n * @type {CellCoords}\n */\n this.highlight = highlight.clone().normalize();\n /**\n * Usually the same as highlight, but in Excel there is distinction - one can change\n * highlight within a selection.\n *\n * @type {CellCoords}\n */\n\n this.from = from.clone();\n /**\n * End selection.\n *\n * @type {CellCoords}\n */\n\n this.to = to.clone();\n }\n /**\n * Set the new coordinates for highlighting selection.\n *\n * @param {CellCoords} coords Coordinates to use.\n * @returns {CellRange}\n */\n\n\n _createClass(CellRange, [{\n key: \"setHighlight\",\n value: function setHighlight(coords) {\n this.highlight = coords.clone().normalize();\n return this;\n }\n /**\n * Set the new coordinates where selection starts from.\n *\n * @param {CellCoords} coords Coordinates to use.\n * @returns {CellRange}\n */\n\n }, {\n key: \"setFrom\",\n value: function setFrom(coords) {\n this.from = coords.clone();\n return this;\n }\n /**\n * Set new coordinates where selection ends from.\n *\n * @param {CellCoords} coords Coordinates to use.\n * @returns {CellRange}\n */\n\n }, {\n key: \"setTo\",\n value: function setTo(coords) {\n this.to = coords.clone();\n return this;\n }\n /**\n * Checks if given coordinates are valid in context of a given Walkontable instance.\n *\n * @param {Walkontable} wot The Walkontable instance.\n * @returns {boolean}\n */\n\n }, {\n key: \"isValid\",\n value: function isValid(wot) {\n return this.from.isValid(wot) && this.to.isValid(wot);\n }\n /**\n * Checks if this cell range is restricted to one cell.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isSingle\",\n value: function isSingle() {\n return this.from.row >= 0 && this.from.row === this.to.row && this.from.col >= 0 && this.from.col === this.to.col;\n }\n /**\n * Returns selected range height (in number of rows including rows' headers).\n *\n * @returns {number}\n */\n\n }, {\n key: \"getOuterHeight\",\n value: function getOuterHeight() {\n return Math.max(this.from.row, this.to.row) - Math.min(this.from.row, this.to.row) + 1;\n }\n /**\n * Returns selected range width (in number of columns including columns' headers).\n *\n * @returns {number}\n */\n\n }, {\n key: \"getOuterWidth\",\n value: function getOuterWidth() {\n return Math.max(this.from.col, this.to.col) - Math.min(this.from.col, this.to.col) + 1;\n }\n /**\n * Returns selected range height (in number of rows excluding rows' headers).\n *\n * @returns {number}\n */\n\n }, {\n key: \"getHeight\",\n value: function getHeight() {\n var fromRow = Math.max(this.from.row, 0);\n var toRow = Math.max(this.to.row, 0);\n return Math.max(fromRow, toRow) - Math.min(fromRow, toRow) + 1;\n }\n /**\n * Returns selected range width (in number of columns excluding columns' headers).\n *\n * @returns {number}\n */\n\n }, {\n key: \"getWidth\",\n value: function getWidth() {\n var fromCol = Math.max(this.from.col, 0);\n var toCol = Math.max(this.to.col, 0);\n return Math.max(fromCol, toCol) - Math.min(fromCol, toCol) + 1;\n }\n /**\n * Checks if given cell coordinates are within `from` and `to` cell coordinates of this range.\n *\n * @param {CellCoords} cellCoords The cell coordinates to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"includes\",\n value: function includes(cellCoords) {\n var row = cellCoords.row,\n col = cellCoords.col;\n var topLeft = this.getOuterTopLeftCorner();\n var bottomRight = this.getOuterBottomRightCorner();\n return topLeft.row <= row && bottomRight.row >= row && topLeft.col <= col && bottomRight.col >= col;\n }\n /**\n * Checks if given range is within of this range.\n *\n * @param {CellRange} cellRange The cells range to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"includesRange\",\n value: function includesRange(cellRange) {\n return this.includes(cellRange.getOuterTopLeftCorner()) && this.includes(cellRange.getOuterBottomRightCorner());\n }\n /**\n * Checks if given range is equal to this range.\n *\n * @param {CellRange} cellRange The cells range to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"isEqual\",\n value: function isEqual(cellRange) {\n return Math.min(this.from.row, this.to.row) === Math.min(cellRange.from.row, cellRange.to.row) && Math.max(this.from.row, this.to.row) === Math.max(cellRange.from.row, cellRange.to.row) && Math.min(this.from.col, this.to.col) === Math.min(cellRange.from.col, cellRange.to.col) && Math.max(this.from.col, this.to.col) === Math.max(cellRange.from.col, cellRange.to.col);\n }\n /**\n * Checks if tested range overlaps with the range. Range A is considered to to be overlapping with range B\n * if intersection of A and B or B and A is not empty.\n *\n * @param {CellRange} cellRange The cells range to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"overlaps\",\n value: function overlaps(cellRange) {\n return cellRange.isSouthEastOf(this.getOuterTopLeftCorner()) && cellRange.isNorthWestOf(this.getOuterBottomRightCorner());\n }\n /**\n * Checks if tested coordinates are positioned in south-east from this cell range.\n *\n * @param {CellRange} cellRange The cells range to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"isSouthEastOf\",\n value: function isSouthEastOf(cellRange) {\n return this.getOuterTopLeftCorner().isSouthEastOf(cellRange) || this.getOuterBottomRightCorner().isSouthEastOf(cellRange);\n }\n /**\n * Checks if tested coordinates are positioned in north-west from this cell range.\n *\n * @param {CellRange} cellRange The cells range to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"isNorthWestOf\",\n value: function isNorthWestOf(cellRange) {\n return this.getOuterTopLeftCorner().isNorthWestOf(cellRange) || this.getOuterBottomRightCorner().isNorthWestOf(cellRange);\n }\n /**\n * Returns `true` if the provided range is overlapping the current range horizontally (e.g. The current range's last\n * column is 5 and the provided range's first column is 3).\n *\n * @param {CellRange} cellRange The cells range to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"isOverlappingHorizontally\",\n value: function isOverlappingHorizontally(cellRange) {\n return this.getOuterTopRightCorner().col >= cellRange.getOuterTopLeftCorner().col && this.getOuterTopRightCorner().col <= cellRange.getOuterTopRightCorner().col || this.getOuterTopLeftCorner().col <= cellRange.getOuterTopRightCorner().col && this.getOuterTopLeftCorner().col >= cellRange.getOuterTopLeftCorner().col;\n }\n /**\n * Returns `true` if the provided range is overlapping the current range vertically (e.g. The current range's last\n * row is 5 and the provided range's first row is 3).\n *\n * @param {CellRange} cellRange The cells range to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"isOverlappingVertically\",\n value: function isOverlappingVertically(cellRange) {\n return this.getOuterBottomRightCorner().row >= cellRange.getOuterTopRightCorner().row && this.getOuterBottomRightCorner().row <= cellRange.getOuterBottomRightCorner().row || this.getOuterTopRightCorner().row <= cellRange.getOuterBottomRightCorner().row && this.getOuterTopRightCorner().row >= cellRange.getOuterTopRightCorner().row;\n }\n /**\n * Adds a cell to a range (only if exceeds corners of the range). Returns information if range was expanded.\n *\n * @param {CellCoords} cellCoords The cell coordinates.\n * @returns {boolean}\n */\n\n }, {\n key: \"expand\",\n value: function expand(cellCoords) {\n var topLeft = this.getOuterTopLeftCorner();\n var bottomRight = this.getOuterBottomRightCorner();\n\n if (cellCoords.row < topLeft.row || cellCoords.col < topLeft.col || cellCoords.row > bottomRight.row || cellCoords.col > bottomRight.col) {\n this.from = new CellCoords(Math.min(topLeft.row, cellCoords.row), Math.min(topLeft.col, cellCoords.col));\n this.to = new CellCoords(Math.max(bottomRight.row, cellCoords.row), Math.max(bottomRight.col, cellCoords.col));\n return true;\n }\n\n return false;\n }\n /**\n * Expand the current object by the range passed in the first argument.\n *\n * @param {CellRange} expandingRange Object extending the range.\n * @returns {boolean}\n */\n\n }, {\n key: \"expandByRange\",\n value: function expandByRange(expandingRange) {\n if (this.includesRange(expandingRange) || !this.overlaps(expandingRange)) {\n return false;\n }\n\n var topLeft = this.getOuterTopLeftCorner();\n var bottomRight = this.getOuterBottomRightCorner();\n var initialDirection = this.getDirection();\n var expandingTopLeft = expandingRange.getOuterTopLeftCorner();\n var expandingBottomRight = expandingRange.getOuterBottomRightCorner();\n var resultTopRow = Math.min(topLeft.row, expandingTopLeft.row);\n var resultTopCol = Math.min(topLeft.col, expandingTopLeft.col);\n var resultBottomRow = Math.max(bottomRight.row, expandingBottomRight.row);\n var resultBottomCol = Math.max(bottomRight.col, expandingBottomRight.col);\n var finalFrom = new CellCoords(resultTopRow, resultTopCol);\n var finalTo = new CellCoords(resultBottomRow, resultBottomCol);\n this.from = finalFrom;\n this.to = finalTo;\n this.setDirection(initialDirection);\n\n if (this.highlight.row === this.getOuterBottomRightCorner().row && this.getVerticalDirection() === 'N-S') {\n this.flipDirectionVertically();\n }\n\n if (this.highlight.col === this.getOuterTopRightCorner().col && this.getHorizontalDirection() === 'W-E') {\n this.flipDirectionHorizontally();\n }\n\n return true;\n }\n /**\n * Gets the direction of the selection.\n *\n * @returns {string} Returns one of the values: `'NW-SE'`, `'NE-SW'`, `'SE-NW'`, `'SW-NE'`.\n */\n\n }, {\n key: \"getDirection\",\n value: function getDirection() {\n if (this.from.isNorthWestOf(this.to)) {\n // NorthWest - SouthEast\n return 'NW-SE';\n } else if (this.from.isNorthEastOf(this.to)) {\n // NorthEast - SouthWest\n return 'NE-SW';\n } else if (this.from.isSouthEastOf(this.to)) {\n // SouthEast - NorthWest\n return 'SE-NW';\n } else if (this.from.isSouthWestOf(this.to)) {\n // SouthWest - NorthEast\n return 'SW-NE';\n }\n }\n /**\n * Sets the direction of the selection.\n *\n * @param {string} direction One of the values: `'NW-SE'`, `'NE-SW'`, `'SE-NW'`, `'SW-NE'`.\n */\n\n }, {\n key: \"setDirection\",\n value: function setDirection(direction) {\n switch (direction) {\n case 'NW-SE':\n var _ref = [this.getOuterTopLeftCorner(), this.getOuterBottomRightCorner()];\n this.from = _ref[0];\n this.to = _ref[1];\n break;\n\n case 'NE-SW':\n var _ref2 = [this.getOuterTopRightCorner(), this.getOuterBottomLeftCorner()];\n this.from = _ref2[0];\n this.to = _ref2[1];\n break;\n\n case 'SE-NW':\n var _ref3 = [this.getOuterBottomRightCorner(), this.getOuterTopLeftCorner()];\n this.from = _ref3[0];\n this.to = _ref3[1];\n break;\n\n case 'SW-NE':\n var _ref4 = [this.getOuterBottomLeftCorner(), this.getOuterTopRightCorner()];\n this.from = _ref4[0];\n this.to = _ref4[1];\n break;\n\n default:\n break;\n }\n }\n /**\n * Gets the vertical direction of the range.\n *\n * @returns {string} Returns one of the values: `N-S` (north->south), `S-N` (south->north).\n */\n\n }, {\n key: \"getVerticalDirection\",\n value: function getVerticalDirection() {\n return ['NE-SW', 'NW-SE'].indexOf(this.getDirection()) > -1 ? 'N-S' : 'S-N';\n }\n /**\n * Gets the horizontal direction of the range.\n *\n * @returns {string} Returns one of the values: `W-E` (west->east), `E-W` (east->west).\n */\n\n }, {\n key: \"getHorizontalDirection\",\n value: function getHorizontalDirection() {\n return ['NW-SE', 'SW-NE'].indexOf(this.getDirection()) > -1 ? 'W-E' : 'E-W';\n }\n /**\n * Flip the direction vertically. (e.g. `NW-SE` changes to `SW-NE`).\n */\n\n }, {\n key: \"flipDirectionVertically\",\n value: function flipDirectionVertically() {\n var direction = this.getDirection();\n\n switch (direction) {\n case 'NW-SE':\n this.setDirection('SW-NE');\n break;\n\n case 'NE-SW':\n this.setDirection('SE-NW');\n break;\n\n case 'SE-NW':\n this.setDirection('NE-SW');\n break;\n\n case 'SW-NE':\n this.setDirection('NW-SE');\n break;\n\n default:\n break;\n }\n }\n /**\n * Flip the direction horizontally. (e.g. `NW-SE` changes to `NE-SW`).\n */\n\n }, {\n key: \"flipDirectionHorizontally\",\n value: function flipDirectionHorizontally() {\n var direction = this.getDirection();\n\n switch (direction) {\n case 'NW-SE':\n this.setDirection('NE-SW');\n break;\n\n case 'NE-SW':\n this.setDirection('NW-SE');\n break;\n\n case 'SE-NW':\n this.setDirection('SW-NE');\n break;\n\n case 'SW-NE':\n this.setDirection('SE-NW');\n break;\n\n default:\n break;\n }\n }\n /**\n * Gets the top left corner of this range. If the corner contains header coordinates\n * (negative values), the corner coordinates will be normalized to 0.\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: \"getTopLeftCorner\",\n value: function getTopLeftCorner() {\n return new CellCoords(Math.min(this.from.row, this.to.row), Math.min(this.from.col, this.to.col)).normalize();\n }\n /**\n * Gets the bottom right corner of this range. If the corner contains header coordinates\n * (negative values), the corner coordinates will be normalized to 0.\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: \"getBottomRightCorner\",\n value: function getBottomRightCorner() {\n return new CellCoords(Math.max(this.from.row, this.to.row), Math.max(this.from.col, this.to.col)).normalize();\n }\n /**\n * Gets the top right corner of this range. If the corner contains header coordinates\n * (negative values), the corner coordinates will be normalized to 0.\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: \"getTopRightCorner\",\n value: function getTopRightCorner() {\n return new CellCoords(Math.min(this.from.row, this.to.row), Math.max(this.from.col, this.to.col)).normalize();\n }\n /**\n * Gets the bottom left corner of this range. If the corner contains header coordinates\n * (negative values), the corner coordinates will be normalized to 0.\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: \"getBottomLeftCorner\",\n value: function getBottomLeftCorner() {\n return new CellCoords(Math.max(this.from.row, this.to.row), Math.min(this.from.col, this.to.col)).normalize();\n }\n /**\n * Gets the top left corner of this range. If the corner contains header coordinates\n * (negative values), then the top and left coordinates will be pointed to that header.\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: \"getOuterTopLeftCorner\",\n value: function getOuterTopLeftCorner() {\n return new CellCoords(Math.min(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));\n }\n /**\n * Gets the bottom right corner of this range.\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: \"getOuterBottomRightCorner\",\n value: function getOuterBottomRightCorner() {\n return new CellCoords(Math.max(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));\n }\n /**\n * Gets the top right corner of this range. If the corner contains header coordinates\n * (negative values), then the top coordinate will be pointed to that header.\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: \"getOuterTopRightCorner\",\n value: function getOuterTopRightCorner() {\n return new CellCoords(Math.min(this.from.row, this.to.row), Math.max(this.from.col, this.to.col));\n }\n /**\n * Gets the bottom left corner of this range. If the corner contains header coordinates\n * (negative values), then the left coordinate will be pointed to that header.\n *\n * @returns {CellCoords}\n */\n\n }, {\n key: \"getOuterBottomLeftCorner\",\n value: function getOuterBottomLeftCorner() {\n return new CellCoords(Math.max(this.from.row, this.to.row), Math.min(this.from.col, this.to.col));\n }\n /**\n * Checks if coordinates match to one of the 4th corners of this range.\n *\n * @param {CellCoords} coords Cell coordinates to check.\n * @param {CellRange} [expandedRange] The cells range to compare with.\n * @returns {boolean}\n */\n\n }, {\n key: \"isCorner\",\n value: function isCorner(coords, expandedRange) {\n if (expandedRange && expandedRange.includes(coords) && (this.getOuterTopLeftCorner().isEqual(new CellCoords(expandedRange.from.row, expandedRange.from.col)) || this.getOuterTopRightCorner().isEqual(new CellCoords(expandedRange.from.row, expandedRange.to.col)) || this.getOuterBottomLeftCorner().isEqual(new CellCoords(expandedRange.to.row, expandedRange.from.col)) || this.getOuterBottomRightCorner().isEqual(new CellCoords(expandedRange.to.row, expandedRange.to.col)))) {\n return true;\n }\n\n return coords.isEqual(this.getOuterTopLeftCorner()) || coords.isEqual(this.getOuterTopRightCorner()) || coords.isEqual(this.getOuterBottomLeftCorner()) || coords.isEqual(this.getOuterBottomRightCorner());\n }\n /**\n * Gets coordinates of the corner which is opposite to the matched. When the passed coordinates matched to the\n * bottom-right corner of this range then the coordinates for top-left will be returned.\n *\n * @param {CellCoords} coords Cell coordinates to check.\n * @param {CellRange} [expandedRange] The cells range to compare with.\n * @returns {CellCoords}\n */\n\n }, {\n key: \"getOppositeCorner\",\n value: function getOppositeCorner(coords, expandedRange) {\n if (!(coords instanceof CellCoords)) {\n return false;\n }\n\n if (expandedRange) {\n if (expandedRange.includes(coords)) {\n if (this.getOuterTopLeftCorner().isEqual(new CellCoords(expandedRange.from.row, expandedRange.from.col))) {\n return this.getOuterBottomRightCorner();\n }\n\n if (this.getOuterTopRightCorner().isEqual(new CellCoords(expandedRange.from.row, expandedRange.to.col))) {\n return this.getOuterBottomLeftCorner();\n }\n\n if (this.getOuterBottomLeftCorner().isEqual(new CellCoords(expandedRange.to.row, expandedRange.from.col))) {\n return this.getOuterTopRightCorner();\n }\n\n if (this.getOuterBottomRightCorner().isEqual(new CellCoords(expandedRange.to.row, expandedRange.to.col))) {\n return this.getOuterTopLeftCorner();\n }\n }\n }\n\n if (coords.isEqual(this.getOuterBottomRightCorner())) {\n return this.getOuterTopLeftCorner();\n } else if (coords.isEqual(this.getOuterTopLeftCorner())) {\n return this.getOuterBottomRightCorner();\n } else if (coords.isEqual(this.getOuterTopRightCorner())) {\n return this.getOuterBottomLeftCorner();\n } else if (coords.isEqual(this.getOuterBottomLeftCorner())) {\n return this.getOuterTopRightCorner();\n }\n }\n /**\n * @param {CellRange} range The cells range to compare with.\n * @returns {Array}\n */\n\n }, {\n key: \"getBordersSharedWith\",\n value: function getBordersSharedWith(range) {\n if (!this.includesRange(range)) {\n return [];\n }\n\n var thisBorders = {\n top: Math.min(this.from.row, this.to.row),\n bottom: Math.max(this.from.row, this.to.row),\n left: Math.min(this.from.col, this.to.col),\n right: Math.max(this.from.col, this.to.col)\n };\n var rangeBorders = {\n top: Math.min(range.from.row, range.to.row),\n bottom: Math.max(range.from.row, range.to.row),\n left: Math.min(range.from.col, range.to.col),\n right: Math.max(range.from.col, range.to.col)\n };\n var result = [];\n\n if (thisBorders.top === rangeBorders.top) {\n result.push('top');\n }\n\n if (thisBorders.right === rangeBorders.right) {\n result.push('right');\n }\n\n if (thisBorders.bottom === rangeBorders.bottom) {\n result.push('bottom');\n }\n\n if (thisBorders.left === rangeBorders.left) {\n result.push('left');\n }\n\n return result;\n }\n /**\n * Get inner selected cell coords defined by this range.\n *\n * @returns {Array}\n */\n\n }, {\n key: \"getInner\",\n value: function getInner() {\n var topLeft = this.getOuterTopLeftCorner();\n var bottomRight = this.getOuterBottomRightCorner();\n var out = [];\n\n for (var r = topLeft.row; r <= bottomRight.row; r++) {\n for (var c = topLeft.col; c <= bottomRight.col; c++) {\n if (!(this.from.row === r && this.from.col === c) && !(this.to.row === r && this.to.col === c)) {\n out.push(new CellCoords(r, c));\n }\n }\n }\n\n return out;\n }\n /**\n * Get all selected cell coords defined by this range.\n *\n * @returns {Array}\n */\n\n }, {\n key: \"getAll\",\n value: function getAll() {\n var topLeft = this.getOuterTopLeftCorner();\n var bottomRight = this.getOuterBottomRightCorner();\n var out = [];\n\n for (var r = topLeft.row; r <= bottomRight.row; r++) {\n for (var c = topLeft.col; c <= bottomRight.col; c++) {\n if (topLeft.row === r && topLeft.col === c) {\n out.push(topLeft);\n } else if (bottomRight.row === r && bottomRight.col === c) {\n out.push(bottomRight);\n } else {\n out.push(new CellCoords(r, c));\n }\n }\n }\n\n return out;\n }\n /**\n * Runs a callback function against all cells in the range. You can break the iteration by returning\n * `false` in the callback function.\n *\n * @param {Function} callback The callback function.\n */\n\n }, {\n key: \"forAll\",\n value: function forAll(callback) {\n var topLeft = this.getOuterTopLeftCorner();\n var bottomRight = this.getOuterBottomRightCorner();\n\n for (var r = topLeft.row; r <= bottomRight.row; r++) {\n for (var c = topLeft.col; c <= bottomRight.col; c++) {\n var breakIteration = callback(r, c);\n\n if (breakIteration === false) {\n return;\n }\n }\n }\n }\n /**\n * Clones the range coordinates.\n *\n * @returns {CellRange}\n */\n\n }, {\n key: \"clone\",\n value: function clone() {\n return new CellRange(this.highlight, this.from, this.to);\n }\n /**\n * Convert CellRange to literal object.\n *\n * @returns {object} Returns a literal object with `from` and `to` properties which each of that object\n * contains `row` and `col` keys.\n */\n\n }, {\n key: \"toObject\",\n value: function toObject() {\n return {\n from: this.from.toObject(),\n to: this.to.toObject()\n };\n }\n }]);\n\n return CellRange;\n}();\n\nexport default CellRange;","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport \"core-js/modules/es.array.join.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\nimport \"core-js/modules/es.array.from.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { addClass, hasClass, removeClass, getComputedStyle, getTrimmingContainer, innerWidth, innerHeight, offset, outerHeight, outerWidth } from \"./../../../helpers/dom/element.mjs\";\nimport { stopImmediatePropagation } from \"./../../../helpers/dom/event.mjs\";\nimport { objectEach } from \"./../../../helpers/object.mjs\";\nimport { isMobileBrowser } from \"./../../../helpers/browser.mjs\";\nimport EventManager from \"./../../../eventManager.mjs\";\nimport CellCoords from \"./cell/coords.mjs\";\n/**\n *\n */\n\nvar Border = /*#__PURE__*/function () {\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n * @param {object} settings The border settings.\n */\n function Border(wotInstance, settings) {\n _classCallCheck(this, Border);\n\n if (!settings) {\n return;\n }\n\n this.eventManager = new EventManager(wotInstance);\n this.instance = wotInstance;\n this.wot = wotInstance;\n this.settings = settings;\n this.mouseDown = false;\n this.main = null;\n this.top = null;\n this.left = null;\n this.bottom = null;\n this.right = null;\n this.topStyle = null;\n this.leftStyle = null;\n this.bottomStyle = null;\n this.rightStyle = null;\n this.cornerDefaultStyle = {\n width: '6px',\n height: '6px',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: '#FFF'\n }; // Offset to moving the corner to be centered relative to the grid.\n\n this.cornerCenterPointOffset = -(parseInt(this.cornerDefaultStyle.width, 10) / 2);\n this.corner = null;\n this.cornerStyle = null;\n this.createBorders(settings);\n this.registerListeners();\n }\n /**\n * Register all necessary events.\n */\n\n\n _createClass(Border, [{\n key: \"registerListeners\",\n value: function registerListeners() {\n var _this2 = this;\n\n var documentBody = this.wot.rootDocument.body;\n this.eventManager.addEventListener(documentBody, 'mousedown', function () {\n return _this2.onMouseDown();\n });\n this.eventManager.addEventListener(documentBody, 'mouseup', function () {\n return _this2.onMouseUp();\n });\n\n var _loop = function _loop(c, len) {\n var element = _this2.main.childNodes[c];\n\n _this2.eventManager.addEventListener(element, 'mouseenter', function (event) {\n return _this2.onMouseEnter(event, _this2.main.childNodes[c]);\n });\n };\n\n for (var c = 0, len = this.main.childNodes.length; c < len; c++) {\n _loop(c, len);\n }\n }\n /**\n * Mouse down listener.\n *\n * @private\n */\n\n }, {\n key: \"onMouseDown\",\n value: function onMouseDown() {\n this.mouseDown = true;\n }\n /**\n * Mouse up listener.\n *\n * @private\n */\n\n }, {\n key: \"onMouseUp\",\n value: function onMouseUp() {\n this.mouseDown = false;\n }\n /**\n * Mouse enter listener for fragment selection functionality.\n *\n * @private\n * @param {Event} event Dom event.\n * @param {HTMLElement} parentElement Part of border element.\n */\n\n }, {\n key: \"onMouseEnter\",\n value: function onMouseEnter(event, parentElement) {\n if (!this.mouseDown || !this.wot.getSetting('hideBorderOnMouseDownOver')) {\n return;\n }\n\n event.preventDefault();\n stopImmediatePropagation(event);\n\n var _this = this;\n\n var documentBody = this.wot.rootDocument.body;\n var bounds = parentElement.getBoundingClientRect(); // Hide border to prevents selection jumping when fragmentSelection is enabled.\n\n parentElement.style.display = 'none';\n /**\n * @param {Event} mouseEvent The mouse event object.\n * @returns {boolean}\n */\n\n function isOutside(mouseEvent) {\n if (mouseEvent.clientY < Math.floor(bounds.top)) {\n return true;\n }\n\n if (mouseEvent.clientY > Math.ceil(bounds.top + bounds.height)) {\n return true;\n }\n\n if (mouseEvent.clientX < Math.floor(bounds.left)) {\n return true;\n }\n\n if (mouseEvent.clientX > Math.ceil(bounds.left + bounds.width)) {\n return true;\n }\n }\n /**\n * @param {Event} handlerEvent The mouse event object.\n */\n\n\n function handler(handlerEvent) {\n if (isOutside(handlerEvent)) {\n _this.eventManager.removeEventListener(documentBody, 'mousemove', handler);\n\n parentElement.style.display = 'block';\n }\n }\n\n this.eventManager.addEventListener(documentBody, 'mousemove', handler);\n }\n /**\n * Create border elements.\n *\n * @param {object} settings The border settings.\n */\n\n }, {\n key: \"createBorders\",\n value: function createBorders(settings) {\n var rootDocument = this.wot.rootDocument;\n this.main = rootDocument.createElement('div');\n var borderDivs = ['top', 'left', 'bottom', 'right', 'corner'];\n var style = this.main.style;\n style.position = 'absolute';\n style.top = 0;\n style.left = 0;\n\n for (var i = 0; i < 5; i++) {\n var position = borderDivs[i];\n var div = rootDocument.createElement('div');\n div.className = \"wtBorder \".concat(this.settings.className || ''); // + borderDivs[i];\n\n if (this.settings[position] && this.settings[position].hide) {\n div.className += ' hidden';\n }\n\n style = div.style;\n style.backgroundColor = this.settings[position] && this.settings[position].color ? this.settings[position].color : settings.border.color;\n style.height = this.settings[position] && this.settings[position].width ? \"\".concat(this.settings[position].width, \"px\") : \"\".concat(settings.border.width, \"px\");\n style.width = this.settings[position] && this.settings[position].width ? \"\".concat(this.settings[position].width, \"px\") : \"\".concat(settings.border.width, \"px\");\n this.main.appendChild(div);\n }\n\n this.top = this.main.childNodes[0];\n this.left = this.main.childNodes[1];\n this.bottom = this.main.childNodes[2];\n this.right = this.main.childNodes[3];\n this.topStyle = this.top.style;\n this.leftStyle = this.left.style;\n this.bottomStyle = this.bottom.style;\n this.rightStyle = this.right.style;\n this.corner = this.main.childNodes[4];\n this.corner.className += ' corner';\n this.cornerStyle = this.corner.style;\n this.cornerStyle.width = this.cornerDefaultStyle.width;\n this.cornerStyle.height = this.cornerDefaultStyle.height;\n this.cornerStyle.border = [this.cornerDefaultStyle.borderWidth, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' ');\n\n if (isMobileBrowser()) {\n this.createMultipleSelectorHandles();\n }\n\n this.disappear();\n var wtTable = this.wot.wtTable;\n var bordersHolder = wtTable.bordersHolder;\n\n if (!bordersHolder) {\n bordersHolder = rootDocument.createElement('div');\n bordersHolder.className = 'htBorders';\n wtTable.bordersHolder = bordersHolder;\n wtTable.spreader.appendChild(bordersHolder);\n }\n\n bordersHolder.appendChild(this.main);\n }\n /**\n * Create multiple selector handler for mobile devices.\n */\n\n }, {\n key: \"createMultipleSelectorHandles\",\n value: function createMultipleSelectorHandles() {\n var _this3 = this;\n\n var rootDocument = this.wot.rootDocument;\n this.selectionHandles = {\n topLeft: rootDocument.createElement('DIV'),\n topLeftHitArea: rootDocument.createElement('DIV'),\n bottomRight: rootDocument.createElement('DIV'),\n bottomRightHitArea: rootDocument.createElement('DIV')\n };\n var width = 10;\n var hitAreaWidth = 40;\n this.selectionHandles.topLeft.className = 'topLeftSelectionHandle';\n this.selectionHandles.topLeftHitArea.className = 'topLeftSelectionHandle-HitArea';\n this.selectionHandles.bottomRight.className = 'bottomRightSelectionHandle';\n this.selectionHandles.bottomRightHitArea.className = 'bottomRightSelectionHandle-HitArea';\n this.selectionHandles.styles = {\n topLeft: this.selectionHandles.topLeft.style,\n topLeftHitArea: this.selectionHandles.topLeftHitArea.style,\n bottomRight: this.selectionHandles.bottomRight.style,\n bottomRightHitArea: this.selectionHandles.bottomRightHitArea.style\n };\n var hitAreaStyle = {\n position: 'absolute',\n height: \"\".concat(hitAreaWidth, \"px\"),\n width: \"\".concat(hitAreaWidth, \"px\"),\n 'border-radius': \"\".concat(parseInt(hitAreaWidth / 1.5, 10), \"px\")\n };\n objectEach(hitAreaStyle, function (value, key) {\n _this3.selectionHandles.styles.bottomRightHitArea[key] = value;\n _this3.selectionHandles.styles.topLeftHitArea[key] = value;\n });\n var handleStyle = {\n position: 'absolute',\n height: \"\".concat(width, \"px\"),\n width: \"\".concat(width, \"px\"),\n 'border-radius': \"\".concat(parseInt(width / 1.5, 10), \"px\"),\n background: '#F5F5FF',\n border: '1px solid #4285c8'\n };\n objectEach(handleStyle, function (value, key) {\n _this3.selectionHandles.styles.bottomRight[key] = value;\n _this3.selectionHandles.styles.topLeft[key] = value;\n });\n this.main.appendChild(this.selectionHandles.topLeft);\n this.main.appendChild(this.selectionHandles.bottomRight);\n this.main.appendChild(this.selectionHandles.topLeftHitArea);\n this.main.appendChild(this.selectionHandles.bottomRightHitArea);\n }\n /**\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @returns {boolean}\n */\n\n }, {\n key: \"isPartRange\",\n value: function isPartRange(row, col) {\n var areaSelection = this.wot.selections.createOrGetArea();\n\n if (areaSelection.cellRange) {\n if (row !== areaSelection.cellRange.to.row || col !== areaSelection.cellRange.to.col) {\n return true;\n }\n }\n\n return false;\n }\n /**\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number} top The top position of the handler.\n * @param {number} left The left position of the handler.\n * @param {number} width The width of the handler.\n * @param {number} height The height of the handler.\n */\n\n }, {\n key: \"updateMultipleSelectionHandlesPosition\",\n value: function updateMultipleSelectionHandlesPosition(row, col, top, left, width, height) {\n var handleWidth = parseInt(this.selectionHandles.styles.topLeft.width, 10);\n var hitAreaWidth = parseInt(this.selectionHandles.styles.topLeftHitArea.width, 10);\n this.selectionHandles.styles.topLeft.top = \"\".concat(parseInt(top - handleWidth, 10), \"px\");\n this.selectionHandles.styles.topLeft.left = \"\".concat(parseInt(left - handleWidth, 10), \"px\");\n this.selectionHandles.styles.topLeftHitArea.top = \"\".concat(parseInt(top - hitAreaWidth / 4 * 3, 10), \"px\");\n this.selectionHandles.styles.topLeftHitArea.left = \"\".concat(parseInt(left - hitAreaWidth / 4 * 3, 10), \"px\");\n this.selectionHandles.styles.bottomRight.top = \"\".concat(parseInt(top + height, 10), \"px\");\n this.selectionHandles.styles.bottomRight.left = \"\".concat(parseInt(left + width, 10), \"px\");\n this.selectionHandles.styles.bottomRightHitArea.top = \"\".concat(parseInt(top + height - hitAreaWidth / 4, 10), \"px\");\n this.selectionHandles.styles.bottomRightHitArea.left = \"\".concat(parseInt(left + width - hitAreaWidth / 4, 10), \"px\");\n\n if (this.settings.border.cornerVisible && this.settings.border.cornerVisible()) {\n this.selectionHandles.styles.topLeft.display = 'block';\n this.selectionHandles.styles.topLeftHitArea.display = 'block';\n\n if (this.isPartRange(row, col)) {\n this.selectionHandles.styles.bottomRight.display = 'none';\n this.selectionHandles.styles.bottomRightHitArea.display = 'none';\n } else {\n this.selectionHandles.styles.bottomRight.display = 'block';\n this.selectionHandles.styles.bottomRightHitArea.display = 'block';\n }\n } else {\n this.selectionHandles.styles.topLeft.display = 'none';\n this.selectionHandles.styles.bottomRight.display = 'none';\n this.selectionHandles.styles.topLeftHitArea.display = 'none';\n this.selectionHandles.styles.bottomRightHitArea.display = 'none';\n }\n\n if (row === this.wot.wtSettings.getSetting('fixedRowsTop') || col === this.wot.wtSettings.getSetting('fixedColumnsLeft')) {\n this.selectionHandles.styles.topLeft.zIndex = '9999';\n this.selectionHandles.styles.topLeftHitArea.zIndex = '9999';\n } else {\n this.selectionHandles.styles.topLeft.zIndex = '';\n this.selectionHandles.styles.topLeftHitArea.zIndex = '';\n }\n }\n /**\n * Show border around one or many cells.\n *\n * @param {Array} corners The corner coordinates.\n */\n\n }, {\n key: \"appear\",\n value: function appear(corners) {\n if (this.disabled) {\n return;\n }\n\n var _this$wot = this.wot,\n wtTable = _this$wot.wtTable,\n rootDocument = _this$wot.rootDocument,\n rootWindow = _this$wot.rootWindow;\n var fromRow;\n var toRow;\n var fromColumn;\n var toColumn;\n var rowHeader;\n var columnHeader;\n var rowsCount = wtTable.getRenderedRowsCount();\n\n for (var i = 0; i < rowsCount; i += 1) {\n var s = wtTable.rowFilter.renderedToSource(i);\n\n if (s >= corners[0] && s <= corners[2]) {\n fromRow = s;\n rowHeader = corners[0];\n break;\n }\n }\n\n for (var _i = rowsCount - 1; _i >= 0; _i -= 1) {\n var _s = wtTable.rowFilter.renderedToSource(_i);\n\n if (_s >= corners[0] && _s <= corners[2]) {\n toRow = _s;\n break;\n }\n }\n\n var columnsCount = wtTable.getRenderedColumnsCount();\n\n for (var _i2 = 0; _i2 < columnsCount; _i2 += 1) {\n var _s2 = wtTable.columnFilter.renderedToSource(_i2);\n\n if (_s2 >= corners[1] && _s2 <= corners[3]) {\n fromColumn = _s2;\n columnHeader = corners[1];\n break;\n }\n }\n\n for (var _i3 = columnsCount - 1; _i3 >= 0; _i3 -= 1) {\n var _s3 = wtTable.columnFilter.renderedToSource(_i3);\n\n if (_s3 >= corners[1] && _s3 <= corners[3]) {\n toColumn = _s3;\n break;\n }\n }\n\n if (fromRow === void 0 || fromColumn === void 0) {\n this.disappear();\n return;\n }\n\n var fromTD = wtTable.getCell(new CellCoords(fromRow, fromColumn));\n var isMultiple = fromRow !== toRow || fromColumn !== toColumn;\n var toTD = isMultiple ? wtTable.getCell(new CellCoords(toRow, toColumn)) : fromTD;\n var fromOffset = offset(fromTD);\n var toOffset = isMultiple ? offset(toTD) : fromOffset;\n var containerOffset = offset(wtTable.TABLE);\n var minTop = fromOffset.top;\n var minLeft = fromOffset.left;\n var left = minLeft - containerOffset.left - 1;\n var width = toOffset.left + outerWidth(toTD) - minLeft;\n\n if (this.isEntireColumnSelected(fromRow, toRow)) {\n var modifiedValues = this.getDimensionsFromHeader('columns', fromColumn, toColumn, rowHeader, containerOffset);\n var fromTH = null;\n\n if (modifiedValues) {\n var _modifiedValues = _slicedToArray(modifiedValues, 3);\n\n fromTH = _modifiedValues[0];\n left = _modifiedValues[1];\n width = _modifiedValues[2];\n }\n\n if (fromTH) {\n fromTD = fromTH;\n }\n }\n\n var top = minTop - containerOffset.top - 1;\n var height = toOffset.top + outerHeight(toTD) - minTop;\n\n if (this.isEntireRowSelected(fromColumn, toColumn)) {\n var _modifiedValues2 = this.getDimensionsFromHeader('rows', fromRow, toRow, columnHeader, containerOffset);\n\n var _fromTH = null;\n\n if (_modifiedValues2) {\n var _modifiedValues3 = _slicedToArray(_modifiedValues2, 3);\n\n _fromTH = _modifiedValues3[0];\n top = _modifiedValues3[1];\n height = _modifiedValues3[2];\n }\n\n if (_fromTH) {\n fromTD = _fromTH;\n }\n }\n\n var style = getComputedStyle(fromTD, rootWindow);\n\n if (parseInt(style.borderTopWidth, 10) > 0) {\n top += 1;\n height = height > 0 ? height - 1 : 0;\n }\n\n if (parseInt(style.borderLeftWidth, 10) > 0) {\n left += 1;\n width = width > 0 ? width - 1 : 0;\n }\n\n this.topStyle.top = \"\".concat(top, \"px\");\n this.topStyle.left = \"\".concat(left, \"px\");\n this.topStyle.width = \"\".concat(width, \"px\");\n this.topStyle.display = 'block';\n this.leftStyle.top = \"\".concat(top, \"px\");\n this.leftStyle.left = \"\".concat(left, \"px\");\n this.leftStyle.height = \"\".concat(height, \"px\");\n this.leftStyle.display = 'block';\n var delta = Math.floor(this.settings.border.width / 2);\n this.bottomStyle.top = \"\".concat(top + height - delta, \"px\");\n this.bottomStyle.left = \"\".concat(left, \"px\");\n this.bottomStyle.width = \"\".concat(width, \"px\");\n this.bottomStyle.display = 'block';\n this.rightStyle.top = \"\".concat(top, \"px\");\n this.rightStyle.left = \"\".concat(left + width - delta, \"px\");\n this.rightStyle.height = \"\".concat(height + 1, \"px\");\n this.rightStyle.display = 'block';\n var cornerVisibleSetting = this.settings.border.cornerVisible;\n cornerVisibleSetting = typeof cornerVisibleSetting === 'function' ? cornerVisibleSetting(this.settings.layerLevel) : cornerVisibleSetting;\n var hookResult = this.wot.getSetting('onModifyGetCellCoords', toRow, toColumn);\n var checkRow = toRow,\n checkCol = toColumn;\n\n if (hookResult && Array.isArray(hookResult)) {\n var _hookResult = _slicedToArray(hookResult, 4);\n\n checkRow = _hookResult[2];\n checkCol = _hookResult[3];\n }\n\n if (isMobileBrowser() || !cornerVisibleSetting || this.isPartRange(checkRow, checkCol)) {\n this.cornerStyle.display = 'none';\n } else {\n this.cornerStyle.top = \"\".concat(top + height + this.cornerCenterPointOffset - 1, \"px\");\n this.cornerStyle.left = \"\".concat(left + width + this.cornerCenterPointOffset - 1, \"px\");\n this.cornerStyle.borderRightWidth = this.cornerDefaultStyle.borderWidth;\n this.cornerStyle.width = this.cornerDefaultStyle.width; // Hide the fill handle, so the possible further adjustments won't force unneeded scrollbars.\n\n this.cornerStyle.display = 'none';\n var trimmingContainer = getTrimmingContainer(wtTable.TABLE);\n var trimToWindow = trimmingContainer === rootWindow;\n\n if (trimToWindow) {\n trimmingContainer = rootDocument.documentElement;\n }\n\n if (toColumn === this.wot.getSetting('totalColumns') - 1) {\n var toTdOffsetLeft = trimToWindow ? toTD.getBoundingClientRect().left : toTD.offsetLeft;\n var cornerRightEdge = toTdOffsetLeft + outerWidth(toTD) + parseInt(this.cornerDefaultStyle.width, 10) / 2;\n var cornerOverlappingContainer = cornerRightEdge >= innerWidth(trimmingContainer);\n\n if (cornerOverlappingContainer) {\n this.cornerStyle.left = \"\".concat(Math.floor(left + width + this.cornerCenterPointOffset - parseInt(this.cornerDefaultStyle.width, 10) / 2), \"px\"); // eslint-disable-line max-len\n\n this.cornerStyle.borderRightWidth = 0;\n }\n }\n\n if (toRow === this.wot.getSetting('totalRows') - 1) {\n var toTdOffsetTop = trimToWindow ? toTD.getBoundingClientRect().top : toTD.offsetTop;\n var cornerBottomEdge = toTdOffsetTop + outerHeight(toTD) + parseInt(this.cornerDefaultStyle.height, 10) / 2;\n\n var _cornerOverlappingContainer = cornerBottomEdge >= innerHeight(trimmingContainer);\n\n if (_cornerOverlappingContainer) {\n this.cornerStyle.top = \"\".concat(Math.floor(top + height + this.cornerCenterPointOffset - parseInt(this.cornerDefaultStyle.height, 10) / 2), \"px\"); // eslint-disable-line max-len\n\n this.cornerStyle.borderBottomWidth = 0;\n }\n }\n\n this.cornerStyle.display = 'block';\n }\n\n if (isMobileBrowser()) {\n this.updateMultipleSelectionHandlesPosition(toRow, toColumn, top, left, width, height);\n }\n }\n /**\n * Check whether an entire column of cells is selected.\n *\n * @private\n * @param {number} startRowIndex Start row index.\n * @param {number} endRowIndex End row index.\n * @returns {boolean}\n */\n\n }, {\n key: \"isEntireColumnSelected\",\n value: function isEntireColumnSelected(startRowIndex, endRowIndex) {\n return startRowIndex === this.wot.wtTable.getFirstRenderedRow() && endRowIndex === this.wot.wtTable.getLastRenderedRow();\n }\n /**\n * Check whether an entire row of cells is selected.\n *\n * @private\n * @param {number} startColumnIndex Start column index.\n * @param {number} endColumnIndex End column index.\n * @returns {boolean}\n */\n\n }, {\n key: \"isEntireRowSelected\",\n value: function isEntireRowSelected(startColumnIndex, endColumnIndex) {\n return startColumnIndex === this.wot.wtTable.getFirstRenderedColumn() && endColumnIndex === this.wot.wtTable.getLastRenderedColumn();\n }\n /**\n * Get left/top index and width/height depending on the `direction` provided.\n *\n * @private\n * @param {string} direction `rows` or `columns`, defines if an entire column or row is selected.\n * @param {number} fromIndex Start index of the selection.\n * @param {number} toIndex End index of the selection.\n * @param {number} headerIndex The header index as negative value.\n * @param {number} containerOffset Offset of the container.\n * @returns {Array|boolean} Returns an array of [headerElement, left, width] or [headerElement, top, height], depending on `direction` (`false` in case of an error getting the headers).\n */\n\n }, {\n key: \"getDimensionsFromHeader\",\n value: function getDimensionsFromHeader(direction, fromIndex, toIndex, headerIndex, containerOffset) {\n var wtTable = this.wot.wtTable;\n var rootHotElement = wtTable.wtRootElement.parentNode;\n var getHeaderFn = null;\n var dimensionFn = null;\n var entireSelectionClassname = null;\n var index = null;\n var dimension = null;\n var dimensionProperty = null;\n var startHeader = null;\n var endHeader = null;\n\n switch (direction) {\n case 'rows':\n getHeaderFn = function getHeaderFn() {\n return wtTable.getRowHeader.apply(wtTable, arguments);\n };\n\n dimensionFn = function dimensionFn() {\n return outerHeight.apply(void 0, arguments);\n };\n\n entireSelectionClassname = 'ht__selection--rows';\n dimensionProperty = 'top';\n break;\n\n case 'columns':\n getHeaderFn = function getHeaderFn() {\n return wtTable.getColumnHeader.apply(wtTable, arguments);\n };\n\n dimensionFn = function dimensionFn() {\n return outerWidth.apply(void 0, arguments);\n };\n\n entireSelectionClassname = 'ht__selection--columns';\n dimensionProperty = 'left';\n break;\n\n default:\n }\n\n if (rootHotElement.classList.contains(entireSelectionClassname)) {\n var columnHeaderLevelCount = this.wot.getSetting('columnHeaders').length;\n startHeader = getHeaderFn(fromIndex, columnHeaderLevelCount - headerIndex);\n endHeader = getHeaderFn(toIndex, columnHeaderLevelCount - headerIndex);\n\n if (!startHeader || !endHeader) {\n return false;\n }\n\n var startHeaderOffset = offset(startHeader);\n var endOffset = offset(endHeader);\n\n if (startHeader && endHeader) {\n index = startHeaderOffset[dimensionProperty] - containerOffset[dimensionProperty] - 1;\n dimension = endOffset[dimensionProperty] + dimensionFn(endHeader) - startHeaderOffset[dimensionProperty];\n }\n\n return [startHeader, index, dimension];\n }\n\n return false;\n }\n /**\n * Change border style.\n *\n * @private\n * @param {string} borderElement Coordinate where add/remove border: top, right, bottom, left.\n * @param {object} border The border object descriptor.\n */\n\n }, {\n key: \"changeBorderStyle\",\n value: function changeBorderStyle(borderElement, border) {\n var style = this[borderElement].style;\n var borderStyle = border[borderElement];\n\n if (!borderStyle || borderStyle.hide) {\n addClass(this[borderElement], 'hidden');\n } else {\n if (hasClass(this[borderElement], 'hidden')) {\n removeClass(this[borderElement], 'hidden');\n }\n\n style.backgroundColor = borderStyle.color;\n\n if (borderElement === 'top' || borderElement === 'bottom') {\n style.height = \"\".concat(borderStyle.width, \"px\");\n }\n\n if (borderElement === 'right' || borderElement === 'left') {\n style.width = \"\".concat(borderStyle.width, \"px\");\n }\n }\n }\n /**\n * Change border style to default.\n *\n * @private\n * @param {string} position The position type (\"top\", \"bottom\", \"left\", \"right\") to change.\n */\n\n }, {\n key: \"changeBorderToDefaultStyle\",\n value: function changeBorderToDefaultStyle(position) {\n var defaultBorder = {\n width: 1,\n color: '#000'\n };\n var style = this[position].style;\n style.backgroundColor = defaultBorder.color;\n style.width = \"\".concat(defaultBorder.width, \"px\");\n style.height = \"\".concat(defaultBorder.width, \"px\");\n }\n /**\n * Toggle class 'hidden' to element.\n *\n * @private\n * @param {string} borderElement Coordinate where add/remove border: top, right, bottom, left.\n * @param {boolean} [remove] Defines type of the action to perform.\n */\n\n }, {\n key: \"toggleHiddenClass\",\n value: function toggleHiddenClass(borderElement, remove) {\n this.changeBorderToDefaultStyle(borderElement);\n\n if (remove) {\n addClass(this[borderElement], 'hidden');\n } else {\n removeClass(this[borderElement], 'hidden');\n }\n }\n /**\n * Hide border.\n */\n\n }, {\n key: \"disappear\",\n value: function disappear() {\n this.topStyle.display = 'none';\n this.leftStyle.display = 'none';\n this.bottomStyle.display = 'none';\n this.rightStyle.display = 'none';\n this.cornerStyle.display = 'none';\n\n if (isMobileBrowser()) {\n this.selectionHandles.styles.topLeft.display = 'none';\n this.selectionHandles.styles.bottomRight.display = 'none';\n }\n }\n /**\n * Cleans up all the DOM state related to a Border instance. Call this prior to deleting a Border instance.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.eventManager.destroyWithOwnEventsOnly();\n this.main.parentNode.removeChild(this.main);\n }\n }]);\n\n return Border;\n}();\n\nexport default Border;","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.string.includes.js\";\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.object.values.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\nimport \"core-js/modules/es.array.from.js\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { addClass, hasClass } from \"./../../../helpers/dom/element.mjs\";\nimport Border from \"./border.mjs\";\nimport CellCoords from \"./cell/coords.mjs\";\nimport CellRange from \"./cell/range.mjs\";\n/**\n * @class Selection\n */\n\nvar Selection = /*#__PURE__*/function () {\n /**\n * @param {object} settings The selection settings object.\n * @param {CellRange} cellRange The cell range instance.\n */\n function Selection(settings, cellRange) {\n _classCallCheck(this, Selection);\n\n this.settings = settings;\n this.cellRange = cellRange || null;\n this.instanceBorders = {};\n this.classNames = [this.settings.className];\n this.classNameGenerator = this.linearClassNameGenerator(this.settings.className, this.settings.layerLevel);\n }\n /**\n * Each Walkontable clone requires it's own border for every selection. This method creates and returns selection\n * borders per instance.\n *\n * @param {Walkontable} wotInstance The Walkontable instance.\n * @returns {Border}\n */\n\n\n _createClass(Selection, [{\n key: \"getBorder\",\n value: function getBorder(wotInstance) {\n if (!this.instanceBorders[wotInstance.guid]) {\n this.instanceBorders[wotInstance.guid] = new Border(wotInstance, this.settings);\n }\n\n return this.instanceBorders[wotInstance.guid];\n }\n /**\n * Checks if selection is empty.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isEmpty\",\n value: function isEmpty() {\n return this.cellRange === null;\n }\n /**\n * Adds a cell coords to the selection.\n *\n * @param {CellCoords} coords The cell coordinates to add.\n * @returns {Selection}\n */\n\n }, {\n key: \"add\",\n value: function add(coords) {\n if (this.isEmpty()) {\n this.cellRange = new CellRange(coords);\n } else {\n this.cellRange.expand(coords);\n }\n\n return this;\n }\n /**\n * If selection range from or to property equals oldCoords, replace it with newCoords. Return boolean\n * information about success.\n *\n * @param {CellCoords} oldCoords An old cell coordinates to replace.\n * @param {CellCoords} newCoords The new cell coordinates.\n * @returns {boolean}\n */\n\n }, {\n key: \"replace\",\n value: function replace(oldCoords, newCoords) {\n if (!this.isEmpty()) {\n if (this.cellRange.from.isEqual(oldCoords)) {\n this.cellRange.from = newCoords;\n return true;\n }\n\n if (this.cellRange.to.isEqual(oldCoords)) {\n this.cellRange.to = newCoords;\n return true;\n }\n }\n\n return false;\n }\n /**\n * Clears selection.\n *\n * @returns {Selection}\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n this.cellRange = null;\n return this;\n }\n /**\n * Returns the top left (TL) and bottom right (BR) selection coordinates.\n *\n * @returns {Array} Returns array of coordinates for example `[1, 1, 5, 5]`.\n */\n\n }, {\n key: \"getCorners\",\n value: function getCorners() {\n var topLeft = this.cellRange.getOuterTopLeftCorner();\n var bottomRight = this.cellRange.getOuterBottomRightCorner();\n return [topLeft.row, topLeft.col, bottomRight.row, bottomRight.col];\n }\n /**\n * Adds class name to cell element at given coords.\n *\n * @param {Walkontable} wotInstance Walkontable instance.\n * @param {number} sourceRow Cell row coord.\n * @param {number} sourceColumn Cell column coord.\n * @param {string} className Class name.\n * @param {boolean} [markIntersections=false] If `true`, linear className generator will be used to add CSS classes\n * in a continuous way.\n * @returns {Selection}\n */\n\n }, {\n key: \"addClassAtCoords\",\n value: function addClassAtCoords(wotInstance, sourceRow, sourceColumn, className) {\n var markIntersections = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n var TD = wotInstance.wtTable.getCell(new CellCoords(sourceRow, sourceColumn));\n\n if (_typeof(TD) === 'object') {\n var cellClassName = className;\n\n if (markIntersections) {\n cellClassName = this.classNameGenerator(TD);\n\n if (!this.classNames.includes(cellClassName)) {\n this.classNames.push(cellClassName);\n }\n }\n\n addClass(TD, cellClassName);\n }\n\n return this;\n }\n /**\n * Generate helper for calculating classNames based on previously added base className.\n * The generated className is always generated as a continuation of the previous className. For example, when\n * the currently checked element has 'area-2' className the generated new className will be 'area-3'. When\n * the element doesn't have any classNames than the base className will be returned ('area');.\n *\n * @param {string} baseClassName Base className to be used.\n * @param {number} layerLevelOwner Layer level which the instance of the Selection belongs to.\n * @returns {Function}\n */\n\n }, {\n key: \"linearClassNameGenerator\",\n value: function linearClassNameGenerator(baseClassName, layerLevelOwner) {\n // TODO: Make this recursive function Proper Tail Calls (TCO/PTC) friendly.\n return function calcClassName(element) {\n var previousIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;\n\n if (layerLevelOwner === 0 || previousIndex === 0) {\n return baseClassName;\n }\n\n var index = previousIndex >= 0 ? previousIndex : layerLevelOwner;\n var className = baseClassName;\n index -= 1;\n var previousClassName = index === 0 ? baseClassName : \"\".concat(baseClassName, \"-\").concat(index);\n\n if (hasClass(element, previousClassName)) {\n var currentLayer = index + 1;\n className = \"\".concat(baseClassName, \"-\").concat(currentLayer);\n } else {\n className = calcClassName(element, index);\n }\n\n return className;\n };\n }\n /**\n * @param {Walkontable} wotInstance The Walkontable instance.\n */\n\n }, {\n key: \"draw\",\n value: function draw(wotInstance) {\n if (this.isEmpty()) {\n if (this.settings.border) {\n this.getBorder(wotInstance).disappear();\n }\n\n return;\n }\n\n var renderedRows = wotInstance.wtTable.getRenderedRowsCount();\n var renderedColumns = wotInstance.wtTable.getRenderedColumnsCount();\n var corners = this.getCorners();\n\n var _corners = _slicedToArray(corners, 4),\n topRow = _corners[0],\n topColumn = _corners[1],\n bottomRow = _corners[2],\n bottomColumn = _corners[3];\n\n var _this$settings = this.settings,\n highlightHeaderClassName = _this$settings.highlightHeaderClassName,\n highlightColumnClassName = _this$settings.highlightColumnClassName,\n highlightRowClassName = _this$settings.highlightRowClassName,\n highlightOnlyClosestHeader = _this$settings.highlightOnlyClosestHeader,\n selectionType = _this$settings.selectionType;\n var isHeaderSelectionType = selectionType === void 0 || ['active-header', 'header'].includes(selectionType);\n\n if (isHeaderSelectionType && topColumn !== null && bottomColumn !== null) {\n var selectionColumnCursor = 0;\n\n for (var column = 0; column < renderedColumns; column += 1) {\n var sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(column);\n\n if (sourceCol >= topColumn && sourceCol <= bottomColumn) {\n var THs = wotInstance.wtTable.getColumnHeaders(sourceCol);\n var closestHeaderLevel = THs.length - 1;\n\n if (highlightOnlyClosestHeader && THs.length > 1) {\n THs = [THs[closestHeaderLevel]];\n }\n\n for (var headerLevel = 0; headerLevel < THs.length; headerLevel += 1) {\n var newClasses = [];\n var TH = THs[headerLevel];\n\n if (highlightHeaderClassName) {\n newClasses.push(highlightHeaderClassName);\n }\n\n if (highlightColumnClassName) {\n newClasses.push(highlightColumnClassName);\n }\n\n headerLevel = highlightOnlyClosestHeader ? closestHeaderLevel : headerLevel;\n var newSourceCol = wotInstance.getSetting('onBeforeHighlightingColumnHeader', sourceCol, headerLevel, {\n selectionType: selectionType,\n columnCursor: selectionColumnCursor,\n selectionWidth: bottomColumn - topColumn + 1,\n classNames: newClasses\n });\n\n if (newSourceCol !== sourceCol) {\n TH = wotInstance.wtTable.getColumnHeader(newSourceCol, headerLevel);\n }\n\n addClass(TH, newClasses);\n }\n\n selectionColumnCursor += 1;\n }\n }\n }\n\n if (topRow !== null && bottomRow !== null) {\n var selectionRowCursor = 0;\n\n for (var row = 0; row < renderedRows; row += 1) {\n var sourceRow = wotInstance.wtTable.rowFilter.renderedToSource(row);\n\n if (isHeaderSelectionType && sourceRow >= topRow && sourceRow <= bottomRow) {\n var _THs = wotInstance.wtTable.getRowHeaders(sourceRow);\n\n var _closestHeaderLevel = _THs.length - 1;\n\n if (highlightOnlyClosestHeader && _THs.length > 1) {\n _THs = [_THs[_closestHeaderLevel]];\n }\n\n for (var _headerLevel = 0; _headerLevel < _THs.length; _headerLevel += 1) {\n var _newClasses = [];\n var _TH = _THs[_headerLevel];\n\n if (highlightHeaderClassName) {\n _newClasses.push(highlightHeaderClassName);\n }\n\n if (highlightRowClassName) {\n _newClasses.push(highlightRowClassName);\n }\n\n _headerLevel = highlightOnlyClosestHeader ? _closestHeaderLevel : _headerLevel;\n var newSourceRow = wotInstance.getSetting('onBeforeHighlightingRowHeader', sourceRow, _headerLevel, {\n selectionType: selectionType,\n rowCursor: selectionRowCursor,\n selectionHeight: bottomRow - topRow + 1,\n classNames: _newClasses\n });\n\n if (newSourceRow !== sourceRow) {\n _TH = wotInstance.wtTable.getRowHeader(newSourceRow, _headerLevel);\n }\n\n addClass(_TH, _newClasses);\n }\n\n selectionRowCursor += 1;\n }\n\n if (topColumn !== null && bottomColumn !== null) {\n for (var _column = 0; _column < renderedColumns; _column += 1) {\n var _sourceCol = wotInstance.wtTable.columnFilter.renderedToSource(_column);\n\n if (sourceRow >= topRow && sourceRow <= bottomRow && _sourceCol >= topColumn && _sourceCol <= bottomColumn) {\n // selected cell\n if (this.settings.className) {\n this.addClassAtCoords(wotInstance, sourceRow, _sourceCol, this.settings.className, this.settings.markIntersections);\n }\n } else if (sourceRow >= topRow && sourceRow <= bottomRow) {\n // selection is in this row\n if (highlightRowClassName) {\n this.addClassAtCoords(wotInstance, sourceRow, _sourceCol, highlightRowClassName);\n }\n } else if (_sourceCol >= topColumn && _sourceCol <= bottomColumn) {\n // selection is in this column\n if (highlightColumnClassName) {\n this.addClassAtCoords(wotInstance, sourceRow, _sourceCol, highlightColumnClassName);\n }\n }\n\n var additionalSelectionClass = wotInstance.getSetting('onAfterDrawSelection', sourceRow, _sourceCol, this.settings.layerLevel);\n\n if (typeof additionalSelectionClass === 'string') {\n this.addClassAtCoords(wotInstance, sourceRow, _sourceCol, additionalSelectionClass);\n }\n }\n }\n }\n }\n\n wotInstance.getSetting('onBeforeDrawBorders', corners, this.settings.className);\n\n if (this.settings.border) {\n // warning! border.appear modifies corners!\n this.getBorder(wotInstance).appear(corners);\n }\n }\n /**\n * Cleans up all the DOM state related to a Selection instance. Call this prior to deleting a Selection instance.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n Object.values(this.instanceBorders).forEach(function (border) {\n return border.destroy();\n });\n }\n }]);\n\n return Selection;\n}();\n\nexport default Selection;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\nimport \"core-js/modules/es.array.from.js\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { Selection, CellCoords, CellRange } from \"./../../3rdparty/walkontable/src/index.mjs\";\n\nvar VisualSelection = /*#__PURE__*/function (_Selection) {\n _inherits(VisualSelection, _Selection);\n\n var _super = _createSuper(VisualSelection);\n\n function VisualSelection(settings, visualCellRange) {\n var _this;\n\n _classCallCheck(this, VisualSelection);\n\n _this = _super.call(this, settings, null);\n /**\n * Range of selection visually. Visual representation may have representation in a rendered selection.\n *\n * @type {null|CellRange}\n */\n\n _this.visualCellRange = visualCellRange || null;\n\n _this.commit();\n\n return _this;\n }\n /**\n * Adds a cell coords to the selection.\n *\n * @param {CellCoords} coords Visual coordinates of a cell.\n * @returns {VisualSelection}\n */\n\n\n _createClass(VisualSelection, [{\n key: \"add\",\n value: function add(coords) {\n if (this.visualCellRange === null) {\n this.visualCellRange = new CellRange(coords);\n } else {\n this.visualCellRange.expand(coords);\n }\n\n return this;\n }\n /**\n * Clears visual and renderable selection.\n *\n * @returns {VisualSelection}\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n this.visualCellRange = null;\n return _get(_getPrototypeOf(VisualSelection.prototype), \"clear\", this).call(this);\n }\n /**\n * Search for the first visible coordinates in the range as range may start and/or end with the hidden index.\n *\n * @private\n * @param {CellCoords} startCoords Visual start coordinates for the range. Starting point for finding destination coordinates\n * with visible coordinates (we are going from the starting coordinates to the end coordinates until the criteria are met).\n * @param {CellCoords} endCoords Visual end coordinates for the range.\n * @param {number} incrementByRow We are searching for a next visible rows by increasing (to be precise, or decreasing) indexes.\n * This variable represent indexes shift. We are looking for an index:\n * - for rows: from the left to the right (increasing indexes, then variable should have value 1) or\n * other way around (decreasing indexes, then variable should have the value -1)\n * - for columns: from the top to the bottom (increasing indexes, then variable should have value 1)\n * or other way around (decreasing indexes, then variable should have the value -1).\n * @param {number} incrementByColumn As above, just indexes shift for columns.\n * @returns {null|CellCoords} Visual cell coordinates.\n */\n\n }, {\n key: \"findVisibleCoordsInRange\",\n value: function findVisibleCoordsInRange(startCoords, endCoords, incrementByRow) {\n var incrementByColumn = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : incrementByRow;\n var nextVisibleRow = this.findVisibleCoordsInRowsRange(startCoords.row, endCoords.row, incrementByRow); // There are no more visual rows in the range.\n\n if (nextVisibleRow === null) {\n return null;\n }\n\n var nextVisibleColumn = this.findVisibleCoordsInColumnsRange(startCoords.col, endCoords.col, incrementByColumn); // There are no more visual columns in the range.\n\n if (nextVisibleColumn === null) {\n return null;\n }\n\n return new CellCoords(nextVisibleRow, nextVisibleColumn);\n }\n /**\n * Searches the nearest visible row index, which is not hidden (is renderable).\n *\n * @private\n * @param {CellCoords} startVisibleRow Visual row index which starts the range. Starting point for finding\n * destination coordinates with visible coordinates (we are going from the starting coordinates to the end\n * coordinates until the criteria are met).\n * @param {CellCoords} endVisibleRow Visual row index which ends the range.\n * @param {number} incrementBy We are searching for a next visible rows by increasing (to be precise, or decreasing)\n * indexes. This variable represent indexes shift. From the left to the right (increasing indexes, then variable\n * should have value 1) or other way around (decreasing indexes, then variable should have the value -1).\n * @returns {number|null} The visual row index.\n */\n\n }, {\n key: \"findVisibleCoordsInRowsRange\",\n value: function findVisibleCoordsInRowsRange(startVisibleRow, endVisibleRow, incrementBy) {\n var _this$settings$visual = this.settings.visualToRenderableCoords({\n row: startVisibleRow,\n col: -1\n }),\n startRowRenderable = _this$settings$visual.row; // There are no more visual rows in the range.\n\n\n if (endVisibleRow === startVisibleRow && startRowRenderable === null) {\n return null;\n } // We are looking for a next visible row in the range.\n\n\n if (startRowRenderable === null) {\n return this.findVisibleCoordsInRowsRange(startVisibleRow + incrementBy, endVisibleRow, incrementBy);\n } // We found visible row index in the range.\n\n\n return startVisibleRow;\n }\n /**\n * Searches the nearest visible column index, which is not hidden (is renderable).\n *\n * @private\n * @param {CellCoords} startVisibleColumn Visual column index which starts the range. Starting point for finding\n * destination coordinates with visible coordinates (we are going from the starting coordinates to the end\n * coordinates until the criteria are met).\n * @param {CellCoords} endVisibleColumn Visual column index which ends the range.\n * @param {number} incrementBy We are searching for a next visible columns by increasing (to be precise, or decreasing)\n * indexes. This variable represent indexes shift. From the top to the bottom (increasing indexes, then variable\n * should have value 1) or other way around (decreasing indexes, then variable should have the value -1).\n * @returns {number|null} The visual column index.\n */\n\n }, {\n key: \"findVisibleCoordsInColumnsRange\",\n value: function findVisibleCoordsInColumnsRange(startVisibleColumn, endVisibleColumn, incrementBy) {\n var _this$settings$visual2 = this.settings.visualToRenderableCoords({\n row: -1,\n col: startVisibleColumn\n }),\n startColumnRenderable = _this$settings$visual2.col; // There are no more visual columns in the range.\n\n\n if (endVisibleColumn === startVisibleColumn && startColumnRenderable === null) {\n return null;\n } // We are looking for a next visible column in the range.\n\n\n if (startColumnRenderable === null) {\n return this.findVisibleCoordsInColumnsRange(startVisibleColumn + incrementBy, endVisibleColumn, incrementBy);\n } // We found visible column index in the range.\n\n\n return startVisibleColumn;\n }\n /**\n * Searches the nearest visible column and row index, which is not hidden (is renderable). If one\n * of the axes' range is entirely hidden, then created CellCoords object will hold the `null` value\n * under a specific axis. For example, when we select the hidden column, then the calculated `col`\n * prop will be `null`. In that case, rows are calculated further (regardless of the column result)\n * to make rows header highlightable.\n *\n * @private\n * @param {CellCoords} visualFromCoords Visual start coordinates for the range. Starting point for finding destination coordinates\n * with visible coordinates (we are going from the starting coordinates to the end coordinates until the criteria are met).\n * @param {CellCoords} visualToCoords Visual end coordinates for the range.\n * @param {number} incrementByRow We are searching for a next visible rows by increasing (to be precise, or decreasing) indexes.\n * This variable represent indexes shift. We are looking for an index:\n * - for rows: from the left to the right (increasing indexes, then variable should have value 1) or\n * other way around (decreasing indexes, then variable should have the value -1)\n * - for columns: from the top to the bottom (increasing indexes, then variable should have value 1)\n * or other way around (decreasing indexes, then variable should have the value -1).\n * @param {number} incrementByColumn As above, just indexes shift for columns.\n * @returns {CellCoords[]|null} Visual cell coordinates.\n */\n\n }, {\n key: \"findVisibleHeaderRange\",\n value: function findVisibleHeaderRange(visualFromCoords, visualToCoords, incrementByRow, incrementByColumn) {\n var fromRangeVisualRow = this.findVisibleCoordsInRowsRange(visualFromCoords.row, visualToCoords.row, incrementByRow);\n var toRangeVisualRow = this.findVisibleCoordsInRowsRange(visualToCoords.row, visualFromCoords.row, -incrementByRow);\n var fromRangeVisualColumn = this.findVisibleCoordsInColumnsRange(visualFromCoords.col, visualToCoords.col, incrementByColumn);\n var toRangeVisualColumn = this.findVisibleCoordsInColumnsRange(visualToCoords.col, visualFromCoords.col, -incrementByColumn); // All rows and columns ranges are hidden.\n\n if (fromRangeVisualRow === null && toRangeVisualRow === null && fromRangeVisualColumn === null && toRangeVisualColumn === null) {\n return null;\n }\n\n return [new CellCoords(fromRangeVisualRow, fromRangeVisualColumn), new CellCoords(toRangeVisualRow, toRangeVisualColumn)];\n }\n /**\n * Override internally stored visual indexes added by the Selection's `add` function. It should be executed\n * at the end of process of adding visual selection coordinates.\n *\n * @returns {VisualSelection}\n */\n\n }, {\n key: \"commit\",\n value: function commit() {\n // There is no information about visual ranges, thus no selection may be displayed.\n if (this.visualCellRange === null) {\n return this;\n }\n\n var _this$visualCellRange = this.visualCellRange,\n visualFromCoords = _this$visualCellRange.from,\n visualToCoords = _this$visualCellRange.to; // We may move in two different directions while searching for visible rows and visible columns.\n\n var incrementByRow = this.getRowSearchDirection(this.visualCellRange);\n var incrementByColumn = this.getColumnSearchDirection(this.visualCellRange);\n var fromRangeVisual = this.findVisibleCoordsInRange(visualFromCoords, visualToCoords, incrementByRow, incrementByColumn);\n var toRangeVisual = this.findVisibleCoordsInRange(visualToCoords, visualFromCoords, -incrementByRow, -incrementByColumn); // There is no visual start point (and also visual end point) in the range.\n // We are looking for the first visible cell in a broader range.\n\n if (fromRangeVisual === null || toRangeVisual === null) {\n var isHeaderSelectionType = this.settings.type === 'header';\n var cellRange = null; // For the \"header\" selection type, find rows and column indexes, which should be\n // highlighted, although one of the axes is completely hidden.\n\n if (isHeaderSelectionType) {\n var _this$findVisibleHead = this.findVisibleHeaderRange(visualFromCoords, visualToCoords, incrementByRow, incrementByColumn),\n _this$findVisibleHead2 = _slicedToArray(_this$findVisibleHead, 2),\n fromRangeVisualHeader = _this$findVisibleHead2[0],\n toRangeVisualHeader = _this$findVisibleHead2[1];\n\n cellRange = this.createRenderableCellRange(fromRangeVisualHeader, toRangeVisualHeader);\n }\n\n this.cellRange = cellRange;\n } else {\n this.cellRange = this.createRenderableCellRange(fromRangeVisual, toRangeVisual);\n }\n\n return this;\n }\n /**\n * Some selection may be a part of broader cell range. This function adjusting coordinates of current selection\n * and the broader cell range when needed (current selection can't be presented visually).\n *\n * @param {CellRange} broaderCellRange Visual range. Actual cell range may be contained in the broader cell range.\n * When there is no way to represent some cell range visually we try to find range containing just the first visible cell.\n *\n * Warn: Please keep in mind that this function may change coordinates of the handled broader range.\n *\n * @returns {VisualSelection}\n */\n\n }, {\n key: \"adjustCoordinates\",\n value: function adjustCoordinates(broaderCellRange) {\n // We may move in two different directions while searching for visible rows and visible columns.\n var incrementByRow = this.getRowSearchDirection(broaderCellRange);\n var incrementByColumn = this.getColumnSearchDirection(broaderCellRange);\n var normFromCoords = broaderCellRange.from.clone().normalize();\n var normToCoords = broaderCellRange.to.clone().normalize();\n var singleCellRangeVisual = this.findVisibleCoordsInRange(normFromCoords, normToCoords, incrementByRow, incrementByColumn);\n\n if (singleCellRangeVisual !== null) {\n // We can't show selection visually now, but we found fist visible range in the broader cell range.\n if (this.cellRange === null) {\n var singleCellRangeRenderable = this.settings.visualToRenderableCoords(singleCellRangeVisual);\n this.cellRange = new CellRange(singleCellRangeRenderable);\n } // We set new highlight as it might change (for example, when showing/hiding some cells from the broader selection range)\n // TODO: It is also handled by the `MergeCells` plugin while adjusting already modified coordinates. Should it?\n\n\n broaderCellRange.setHighlight(singleCellRangeVisual);\n return this;\n } // Fallback to the start of the range. It resets the previous highlight (for example, when all columns have been hidden).\n\n\n broaderCellRange.setHighlight(broaderCellRange.from);\n return this;\n }\n /**\n * Returns the top left (TL) and bottom right (BR) selection coordinates (renderable indexes).\n * The method overwrites the original method to support header selection for hidden cells.\n * To make the header selection working, the CellCoords and CellRange have to support not\n * complete coordinates (`null` values for example, `row: null`, `col: 2`).\n *\n * @returns {Array} Returns array of coordinates for example `[1, 1, 5, 5]`.\n */\n\n }, {\n key: \"getCorners\",\n value: function getCorners() {\n var _this$cellRange = this.cellRange,\n from = _this$cellRange.from,\n to = _this$cellRange.to;\n var isRowUndefined = from.row === null || to.row === null;\n var isColumnUndefined = from.col === null || to.col === null;\n var topLeftCorner = new CellCoords(isRowUndefined ? null : Math.min(from.row, to.row), isColumnUndefined ? null : Math.min(from.col, to.col));\n var bottomRightCorner = new CellCoords(isRowUndefined ? null : Math.max(from.row, to.row), isColumnUndefined ? null : Math.max(from.col, to.col));\n return [topLeftCorner.row, topLeftCorner.col, bottomRightCorner.row, bottomRightCorner.col];\n }\n /**\n * Returns the top left (TL) and bottom right (BR) selection coordinates (visual indexes).\n *\n * @returns {Array} Returns array of coordinates for example `[1, 1, 5, 5]`.\n */\n\n }, {\n key: \"getVisualCorners\",\n value: function getVisualCorners() {\n var topLeft = this.settings.renderableToVisualCoords(this.cellRange.getTopLeftCorner());\n var bottomRight = this.settings.renderableToVisualCoords(this.cellRange.getBottomRightCorner());\n return [topLeft.row, topLeft.col, bottomRight.row, bottomRight.col];\n }\n /**\n * Creates a new CellRange object based on visual coordinates which before object creation are\n * translated to renderable indexes.\n *\n * @param {CellCoords} visualFromCoords The CellCoords object which contains coordinates that\n * points to the begining of the selection.\n * @param {CellCoords} visualToCoords The CellCoords object which contains coordinates that\n * points to the end of the selection.\n * @returns {CellRange}\n */\n\n }, {\n key: \"createRenderableCellRange\",\n value: function createRenderableCellRange(visualFromCoords, visualToCoords) {\n var renderableFromCoords = this.settings.visualToRenderableCoords(visualFromCoords);\n var renderableToCoords = this.settings.visualToRenderableCoords(visualToCoords);\n return new CellRange(renderableFromCoords, renderableFromCoords, renderableToCoords);\n }\n /**\n * It returns rows shift needed for searching visual row.\n *\n * @private\n * @param {CellRange} cellRange Selection range.\n * @returns {number} Rows shift. It return 1 when we should increase indexes (moving from the top to the bottom) or\n * -1 when we should decrease indexes (moving other way around).\n */\n\n }, {\n key: \"getRowSearchDirection\",\n value: function getRowSearchDirection(cellRange) {\n if (cellRange.from.row < cellRange.to.row) {\n return 1; // Increasing row indexes.\n }\n\n return -1; // Decreasing row indexes.\n }\n /**\n * It returns columns shift needed for searching visual column.\n *\n * @private\n * @param {CellRange} cellRange Selection range.\n * @returns {number} Columns shift. It return 1 when we should increase indexes (moving from the left to the right) or\n * -1 when we should decrease indexes (moving other way around).\n */\n\n }, {\n key: \"getColumnSearchDirection\",\n value: function getColumnSearchDirection(cellRange) {\n if (cellRange.from.col < cellRange.to.col) {\n return 1; // Increasing column indexes.\n }\n\n return -1; // Decreasing column indexes.\n }\n }]);\n\n return VisualSelection;\n}(Selection);\n\nexport default VisualSelection;","import \"core-js/modules/es.object.keys.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptors.js\";\nvar _excluded = [\"activeHeaderClassName\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { ACTIVE_HEADER_TYPE } from \"../constants.mjs\";\nimport VisualSelection from \"../visualSelection.mjs\";\n/**\n * @param {object} highlightParams A configuration object to create a highlight.\n * @param {string} highlightParams.activeHeaderClassName Highlighted headers' class name.\n * @returns {Selection}\n */\n\nfunction createHighlight(_ref) {\n var activeHeaderClassName = _ref.activeHeaderClassName,\n restOptions = _objectWithoutProperties(_ref, _excluded);\n\n var s = new VisualSelection(_objectSpread(_objectSpread({\n highlightHeaderClassName: activeHeaderClassName\n }, restOptions), {}, {\n selectionType: ACTIVE_HEADER_TYPE\n }));\n return s;\n}\n\nexport default createHighlight;","import \"core-js/modules/es.object.keys.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptors.js\";\nvar _excluded = [\"layerLevel\", \"areaCornerVisible\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { AREA_TYPE } from \"../constants.mjs\";\nimport VisualSelection from \"../visualSelection.mjs\";\n/**\n * Creates the new instance of Selection responsible for highlighting area of the selected multiple cells.\n *\n * @param {object} highlightParams A configuration object to create a highlight.\n * @param {number} highlightParams.layerLevel Layer level.\n * @param {object} highlightParams.areaCornerVisible Function to determine if area's corner should be visible.\n * @returns {Selection}\n */\n\nfunction createHighlight(_ref) {\n var layerLevel = _ref.layerLevel,\n areaCornerVisible = _ref.areaCornerVisible,\n restOptions = _objectWithoutProperties(_ref, _excluded);\n\n var s = new VisualSelection(_objectSpread(_objectSpread({\n className: 'area',\n markIntersections: true,\n layerLevel: Math.min(layerLevel, 7),\n border: {\n width: 1,\n color: '#4b89ff',\n cornerVisible: areaCornerVisible\n }\n }, restOptions), {}, {\n selectionType: AREA_TYPE\n }));\n return s;\n}\n\nexport default createHighlight;","import \"core-js/modules/es.object.keys.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptors.js\";\nvar _excluded = [\"cellCornerVisible\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { CELL_TYPE } from \"../constants.mjs\";\nimport VisualSelection from \"../visualSelection.mjs\";\n/**\n * Creates the new instance of Selection responsible for highlighting currently selected cell. This type of selection\n * can present on the table only one at the time.\n *\n * @param {object} highlightParams A configuration object to create a highlight.\n * @param {Function} highlightParams.cellCornerVisible Function to determine if cell's corner should be visible.\n * @returns {Selection}\n */\n\nfunction createHighlight(_ref) {\n var cellCornerVisible = _ref.cellCornerVisible,\n restOptions = _objectWithoutProperties(_ref, _excluded);\n\n var s = new VisualSelection(_objectSpread(_objectSpread({\n className: 'current',\n border: {\n width: 2,\n color: '#4b89ff',\n cornerVisible: cellCornerVisible\n }\n }, restOptions), {}, {\n selectionType: CELL_TYPE\n }));\n return s;\n}\n\nexport default createHighlight;","import \"core-js/modules/es.object.keys.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptors.js\";\nvar _excluded = [\"border\", \"visualCellRange\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { CUSTOM_SELECTION_TYPE } from \"../constants.mjs\";\nimport VisualSelection from \"../visualSelection.mjs\";\n/**\n * Creates the new instance of Selection responsible for highlighting currently selected cell. This type of selection\n * can present on the table only one at the time.\n *\n * @param {object} highlightParams A configuration object to create a highlight.\n * @param {object} highlightParams.border Border configuration.\n * @param {object} highlightParams.visualCellRange Function to translate visual to renderable coords.\n * @returns {Selection}\n */\n\nfunction createHighlight(_ref) {\n var border = _ref.border,\n visualCellRange = _ref.visualCellRange,\n restOptions = _objectWithoutProperties(_ref, _excluded);\n\n var s = new VisualSelection(_objectSpread(_objectSpread(_objectSpread({}, border), restOptions), {}, {\n selectionType: CUSTOM_SELECTION_TYPE\n }), visualCellRange);\n return s;\n}\n\nexport default createHighlight;","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport \"core-js/modules/es.object.assign.js\";\nimport \"core-js/modules/es.object.keys.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptors.js\";\nimport { FILL_TYPE } from \"../constants.mjs\";\nimport VisualSelection from \"../visualSelection.mjs\";\n/**\n * Creates the new instance of Selection, responsible for highlighting cells which are covered by fill handle\n * functionality. This type of selection can present on the table only one at the time.\n *\n * @param {object} highlightParams A configuration object to create a highlight.\n * @returns {Selection}\n */\n\nfunction createHighlight(_ref) {\n var restOptions = Object.assign({}, _ref);\n var s = new VisualSelection(_objectSpread(_objectSpread({\n className: 'fill',\n border: {\n width: 1,\n color: '#ff0000'\n }\n }, restOptions), {}, {\n selectionType: FILL_TYPE\n }));\n return s;\n}\n\nexport default createHighlight;","import \"core-js/modules/es.object.keys.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptors.js\";\nvar _excluded = [\"headerClassName\", \"rowClassName\", \"columnClassName\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport { HEADER_TYPE } from \"../constants.mjs\";\nimport VisualSelection from \"../visualSelection.mjs\";\n/**\n * Creates the new instance of Selection, responsible for highlighting row and column headers. This type of selection\n * can occur multiple times.\n *\n * @param {object} highlightParams A configuration object to create a highlight.\n * @param {string} highlightParams.headerClassName Highlighted headers' class name.\n * @param {string} highlightParams.rowClassName Highlighted row' class name.\n * @param {string} highlightParams.columnClassName Highlighted column' class name.\n * @returns {Selection}\n */\n\nfunction createHighlight(_ref) {\n var headerClassName = _ref.headerClassName,\n rowClassName = _ref.rowClassName,\n columnClassName = _ref.columnClassName,\n restOptions = _objectWithoutProperties(_ref, _excluded);\n\n var s = new VisualSelection(_objectSpread(_objectSpread({\n className: 'highlight',\n highlightHeaderClassName: headerClassName,\n highlightRowClassName: rowClassName,\n highlightColumnClassName: columnClassName\n }, restOptions), {}, {\n highlightOnlyClosestHeader: true,\n selectionType: HEADER_TYPE\n }));\n return s;\n}\n\nexport default createHighlight;","import \"core-js/modules/es.object.keys.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptors.js\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport staticRegister from \"./../../../utils/staticRegister.mjs\";\nimport { ACTIVE_HEADER_TYPE, AREA_TYPE, CELL_TYPE, CUSTOM_SELECTION_TYPE, FILL_TYPE, HEADER_TYPE } from \"../constants.mjs\";\nimport activeHeaderHighlight from \"./activeHeader.mjs\";\nimport areaHighlight from \"./area.mjs\";\nimport cellHighlight from \"./cell.mjs\";\nimport customSelection from \"./customSelection.mjs\";\nimport fillHighlight from \"./fill.mjs\";\nimport headerHighlight from \"./header.mjs\";\n\nvar _staticRegister = staticRegister('highlight/types'),\n register = _staticRegister.register,\n getItem = _staticRegister.getItem;\n\nregister(ACTIVE_HEADER_TYPE, activeHeaderHighlight);\nregister(AREA_TYPE, areaHighlight);\nregister(CELL_TYPE, cellHighlight);\nregister(CUSTOM_SELECTION_TYPE, customSelection);\nregister(FILL_TYPE, fillHighlight);\nregister(HEADER_TYPE, headerHighlight);\n/**\n * @param {string} highlightType The selection type.\n * @param {object} options The selection options.\n * @returns {Selection}\n */\n\nfunction createHighlight(highlightType, options) {\n return getItem(highlightType)(_objectSpread({\n type: highlightType\n }, options));\n}\n\nexport { createHighlight };","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport \"core-js/modules/es.array.fill.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.string.includes.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.object.keys.js\";\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptors.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { createHighlight } from \"./types/index.mjs\";\nimport { ACTIVE_HEADER_TYPE, AREA_TYPE, CELL_TYPE, CUSTOM_SELECTION_TYPE, FILL_TYPE, HEADER_TYPE } from \"./constants.mjs\";\nimport { arrayEach } from \"./../../helpers/array.mjs\";\n/**\n * Highlight class responsible for managing Walkontable Selection classes.\n *\n * With Highlight object you can manipulate four different highlight types:\n * - `cell` can be added only to a single cell at a time and it defines currently selected cell;\n * - `fill` can occur only once and its highlight defines selection of autofill functionality (managed by the plugin with the same name);\n * - `areas` can be added to multiple cells at a time. This type highlights selected cell or multiple cells.\n * The multiple cells have to be defined as an uninterrupted order (regular shape). Otherwise, the new layer of\n * that type should be created to manage not-consecutive selection;\n * - `header` can occur multiple times. This type is designed to highlight only headers. Like `area` type it\n * can appear with multiple highlights (accessed under different level layers).\n *\n * @class Highlight\n * @util\n */\n\nvar Highlight = /*#__PURE__*/function () {\n function Highlight(options) {\n _classCallCheck(this, Highlight);\n\n /**\n * Options consumed by Highlight class and Walkontable Selection classes.\n *\n * @type {object}\n */\n this.options = options;\n /**\n * The property which describes which layer level of the visual selection will be modified.\n * This option is valid only for `area` and `header` highlight types which occurs multiple times on\n * the table (as a non-consecutive selection).\n *\n * An order of the layers is the same as the order of added new non-consecutive selections.\n *\n * @type {number}\n * @default 0\n */\n\n this.layerLevel = 0;\n /**\n * `cell` highlight object which describes attributes for the currently selected cell.\n * It can only occur only once on the table.\n *\n * @type {Selection}\n */\n\n this.cell = createHighlight(CELL_TYPE, options);\n /**\n * `fill` highlight object which describes attributes for the borders for autofill functionality.\n * It can only occur only once on the table.\n *\n * @type {Selection}\n */\n\n this.fill = createHighlight(FILL_TYPE, options);\n /**\n * Collection of the `area` highlights. That objects describes attributes for the borders and selection of\n * the multiple selected cells. It can occur multiple times on the table.\n *\n * @type {Map.}\n */\n\n this.areas = new Map();\n /**\n * Collection of the `header` highlights. That objects describes attributes for the selection of\n * the multiple selected rows and columns in the table header. It can occur multiple times on the table.\n *\n * @type {Map.}\n */\n\n this.headers = new Map();\n /**\n * Collection of the `active-header` highlights. That objects describes attributes for the selection of\n * the multiple selected rows and columns in the table header. The table headers which have selected all items in\n * a row will be marked as `active-header`.\n *\n * @type {Map.}\n */\n\n this.activeHeaders = new Map();\n /**\n * Collection of the `custom-selection`, holder for example borders added through CustomBorders plugin.\n *\n * @type {Selection[]}\n */\n\n this.customSelections = [];\n }\n /**\n * Check if highlight cell rendering is disabled for specified highlight type.\n *\n * @param {string} highlightType Highlight type. Possible values are: `cell`, `area`, `fill` or `header`.\n * @param {CellCoords} coords The CellCoords instance with defined visual coordinates.\n * @returns {boolean}\n */\n\n\n _createClass(Highlight, [{\n key: \"isEnabledFor\",\n value: function isEnabledFor(highlightType, coords) {\n var type = highlightType; // Legacy compatibility.\n\n if (highlightType === CELL_TYPE) {\n type = 'current'; // One from settings for `disableVisualSelection` up to Handsontable 0.36/Handsontable Pro 1.16.0.\n }\n\n var disableHighlight = this.options.disabledCellSelection(coords.row, coords.col);\n\n if (typeof disableHighlight === 'string') {\n disableHighlight = [disableHighlight];\n }\n\n return disableHighlight === false || Array.isArray(disableHighlight) && !disableHighlight.includes(type);\n }\n /**\n * Set a new layer level to make access to the desire `area` and `header` highlights.\n *\n * @param {number} [level=0] Layer level to use.\n * @returns {Highlight}\n */\n\n }, {\n key: \"useLayerLevel\",\n value: function useLayerLevel() {\n var level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n this.layerLevel = level;\n return this;\n }\n /**\n * Get Walkontable Selection instance created for controlling highlight of the currently selected/edited cell.\n *\n * @returns {Selection}\n */\n\n }, {\n key: \"getCell\",\n value: function getCell() {\n return this.cell;\n }\n /**\n * Get Walkontable Selection instance created for controlling highlight of the autofill functionality.\n *\n * @returns {Selection}\n */\n\n }, {\n key: \"getFill\",\n value: function getFill() {\n return this.fill;\n }\n /**\n * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight\n * of the multiple selected cells.\n *\n * @returns {Selection}\n */\n\n }, {\n key: \"createOrGetArea\",\n value: function createOrGetArea() {\n var layerLevel = this.layerLevel;\n var area;\n\n if (this.areas.has(layerLevel)) {\n area = this.areas.get(layerLevel);\n } else {\n area = createHighlight(AREA_TYPE, _objectSpread({\n layerLevel: layerLevel\n }, this.options));\n this.areas.set(layerLevel, area);\n }\n\n return area;\n }\n /**\n * Get all Walkontable Selection instances which describes the state of the visual highlight of the cells.\n *\n * @returns {Selection[]}\n */\n\n }, {\n key: \"getAreas\",\n value: function getAreas() {\n return _toConsumableArray(this.areas.values());\n }\n /**\n * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight\n * of the multiple selected header cells.\n *\n * @returns {Selection}\n */\n\n }, {\n key: \"createOrGetHeader\",\n value: function createOrGetHeader() {\n var layerLevel = this.layerLevel;\n var header;\n\n if (this.headers.has(layerLevel)) {\n header = this.headers.get(layerLevel);\n } else {\n header = createHighlight(HEADER_TYPE, _objectSpread({}, this.options));\n this.headers.set(layerLevel, header);\n }\n\n return header;\n }\n /**\n * Get all Walkontable Selection instances which describes the state of the visual highlight of the headers.\n *\n * @returns {Selection[]}\n */\n\n }, {\n key: \"getHeaders\",\n value: function getHeaders() {\n return _toConsumableArray(this.headers.values());\n }\n /**\n * Get or create (if not exist in the cache) Walkontable Selection instance created for controlling highlight\n * of the multiple selected active header cells.\n *\n * @returns {Selection}\n */\n\n }, {\n key: \"createOrGetActiveHeader\",\n value: function createOrGetActiveHeader() {\n var layerLevel = this.layerLevel;\n var header;\n\n if (this.activeHeaders.has(layerLevel)) {\n header = this.activeHeaders.get(layerLevel);\n } else {\n header = createHighlight(ACTIVE_HEADER_TYPE, _objectSpread({}, this.options));\n this.activeHeaders.set(layerLevel, header);\n }\n\n return header;\n }\n /**\n * Get all Walkontable Selection instances which describes the state of the visual highlight of the active headers.\n *\n * @returns {Selection[]}\n */\n\n }, {\n key: \"getActiveHeaders\",\n value: function getActiveHeaders() {\n return _toConsumableArray(this.activeHeaders.values());\n }\n /**\n * Get Walkontable Selection instance created for controlling highlight of the custom selection functionality.\n *\n * @returns {Selection}\n */\n\n }, {\n key: \"getCustomSelections\",\n value: function getCustomSelections() {\n return _toConsumableArray(this.customSelections.values());\n }\n /**\n * Add selection to the custom selection instance. The new selection are added to the end of the selection collection.\n *\n * @param {object} selectionInstance The selection instance.\n */\n\n }, {\n key: \"addCustomSelection\",\n value: function addCustomSelection(selectionInstance) {\n this.customSelections.push(createHighlight(CUSTOM_SELECTION_TYPE, _objectSpread(_objectSpread({}, this.options), selectionInstance)));\n }\n /**\n * Perform cleaning visual highlights for the whole table.\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n this.cell.clear();\n this.fill.clear();\n arrayEach(this.areas.values(), function (highlight) {\n return void highlight.clear();\n });\n arrayEach(this.headers.values(), function (highlight) {\n return void highlight.clear();\n });\n arrayEach(this.activeHeaders.values(), function (highlight) {\n return void highlight.clear();\n });\n }\n /**\n * This object can be iterate over using `for of` syntax or using internal `arrayEach` helper.\n *\n * @returns {Selection[]}\n */\n\n }, {\n key: Symbol.iterator,\n value: function value() {\n return [this.cell, this.fill].concat(_toConsumableArray(this.areas.values()), _toConsumableArray(this.headers.values()), _toConsumableArray(this.activeHeaders.values()), _toConsumableArray(this.customSelections))[Symbol.iterator]();\n }\n }]);\n\n return Highlight;\n}();\n\nexport default Highlight;","import \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.string.includes.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { CellRange } from \"./../3rdparty/walkontable/src/index.mjs\";\n/**\n * The SelectionRange class is a simple CellRanges collection designed for easy manipulation of the multiple\n * consecutive and non-consecutive selections.\n *\n * @class SelectionRange\n * @util\n */\n\nvar SelectionRange = /*#__PURE__*/function () {\n function SelectionRange() {\n _classCallCheck(this, SelectionRange);\n\n /**\n * List of all CellRanges added to the class instance.\n *\n * @type {CellRange[]}\n */\n this.ranges = [];\n }\n /**\n * Check if selected range is empty.\n *\n * @returns {boolean}\n */\n\n\n _createClass(SelectionRange, [{\n key: \"isEmpty\",\n value: function isEmpty() {\n return this.size() === 0;\n }\n /**\n * Set coordinates to the class instance. It clears all previously added coordinates and push `coords`\n * to the collection.\n *\n * @param {CellCoords} coords The CellCoords instance with defined visual coordinates.\n * @returns {SelectionRange}\n */\n\n }, {\n key: \"set\",\n value: function set(coords) {\n this.clear();\n this.ranges.push(new CellRange(coords));\n return this;\n }\n /**\n * Add coordinates to the class instance. The new coordinates are added to the end of the range collection.\n *\n * @param {CellCoords} coords The CellCoords instance with defined visual coordinates.\n * @returns {SelectionRange}\n */\n\n }, {\n key: \"add\",\n value: function add(coords) {\n this.ranges.push(new CellRange(coords));\n return this;\n }\n /**\n * Removes from the stack the last added coordinates.\n *\n * @returns {SelectionRange}\n */\n\n }, {\n key: \"pop\",\n value: function pop() {\n this.ranges.pop();\n return this;\n }\n /**\n * Get last added coordinates from ranges, it returns a CellRange instance.\n *\n * @returns {CellRange|undefined}\n */\n\n }, {\n key: \"current\",\n value: function current() {\n return this.peekByIndex(0);\n }\n /**\n * Get previously added coordinates from ranges, it returns a CellRange instance.\n *\n * @returns {CellRange|undefined}\n */\n\n }, {\n key: \"previous\",\n value: function previous() {\n return this.peekByIndex(-1);\n }\n /**\n * Returns `true` if coords is within selection coords. This method iterates through all selection layers to check if\n * the coords object is within selection range.\n *\n * @param {CellCoords} coords The CellCoords instance with defined visual coordinates.\n * @returns {boolean}\n */\n\n }, {\n key: \"includes\",\n value: function includes(coords) {\n return this.ranges.some(function (cellRange) {\n return cellRange.includes(coords);\n });\n }\n /**\n * Clear collection.\n *\n * @returns {SelectionRange}\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n this.ranges.length = 0;\n return this;\n }\n /**\n * Get count of added all coordinates added to the selection.\n *\n * @returns {number}\n */\n\n }, {\n key: \"size\",\n value: function size() {\n return this.ranges.length;\n }\n /**\n * Peek the coordinates based on the offset where that coordinate resides in the collection.\n *\n * @param {number} [offset=0] An offset where the coordinate will be retrieved from.\n * @returns {CellRange|undefined}\n */\n\n }, {\n key: \"peekByIndex\",\n value: function peekByIndex() {\n var offset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var rangeIndex = this.size() + offset - 1;\n var cellRange;\n\n if (rangeIndex >= 0) {\n cellRange = this.ranges[rangeIndex];\n }\n\n return cellRange;\n }\n }, {\n key: Symbol.iterator,\n value: function value() {\n return this.ranges[Symbol.iterator]();\n }\n }]);\n\n return SelectionRange;\n}();\n\nexport default SelectionRange;","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { CellCoords } from \"./../3rdparty/walkontable/src/index.mjs\";\nimport { mixin } from \"../helpers/object.mjs\";\nimport localHooks from \"./../mixins/localHooks.mjs\";\n/**\n * The Transformation class implements algorithms for transforming coordinates based on current settings\n * passed to the Handsontable.\n *\n * Transformation is always applied relative to the current selection.\n *\n * @class Transformation\n * @util\n */\n\nvar Transformation = /*#__PURE__*/function () {\n function Transformation(range, options) {\n _classCallCheck(this, Transformation);\n\n /**\n * Instance of the SelectionRange, holder for visual coordinates applied to the table.\n *\n * @type {SelectionRange}\n */\n this.range = range;\n /**\n * Additional options which define the state of the settings which can infer transformation and\n * give the possibility to translate indexes.\n *\n * @type {object}\n */\n\n this.options = options;\n }\n /**\n * Selects cell relative to current cell (if possible).\n *\n * @param {number} rowDelta Rows number to move, value can be passed as negative number.\n * @param {number} colDelta Columns number to move, value can be passed as negative number.\n * @param {boolean} force If `true` the new rows/columns will be created if necessary. Otherwise, row/column will\n * be created according to `minSpareRows/minSpareCols` settings of Handsontable.\n * @returns {CellCoords} Visual coordinates after transformation.\n */\n\n\n _createClass(Transformation, [{\n key: \"transformStart\",\n value: function transformStart(rowDelta, colDelta, force) {\n var delta = new CellCoords(rowDelta, colDelta);\n var highlightCoords = this.range.current().highlight;\n\n var _this$options$visualT = this.options.visualToRenderableCoords(highlightCoords),\n renderableRow = _this$options$visualT.row,\n renderableColumn = _this$options$visualT.col;\n\n var visualCoords = highlightCoords;\n var rowTransformDir = 0;\n var colTransformDir = 0;\n this.runLocalHooks('beforeTransformStart', delta);\n\n if (renderableRow !== null && renderableColumn !== null) {\n var totalRows = this.options.countRows();\n var totalCols = this.options.countCols();\n var fixedRowsBottom = this.options.fixedRowsBottom();\n var minSpareRows = this.options.minSpareRows();\n var minSpareCols = this.options.minSpareCols();\n var autoWrapRow = this.options.autoWrapRow();\n var autoWrapCol = this.options.autoWrapCol();\n\n if (renderableRow + rowDelta > totalRows - 1) {\n if (force && minSpareRows > 0 && !(fixedRowsBottom && renderableRow >= totalRows - fixedRowsBottom - 1)) {\n this.runLocalHooks('insertRowRequire', totalRows);\n totalRows = this.options.countRows();\n } else if (autoWrapCol) {\n delta.row = 1 - totalRows;\n delta.col = renderableColumn + delta.col === totalCols - 1 ? 1 - totalCols : 1;\n }\n } else if (autoWrapCol && renderableRow + delta.row < 0 && renderableColumn + delta.col >= 0) {\n delta.row = totalRows - 1;\n delta.col = renderableColumn + delta.col === 0 ? totalCols - 1 : -1;\n }\n\n if (renderableColumn + delta.col > totalCols - 1) {\n if (force && minSpareCols > 0) {\n this.runLocalHooks('insertColRequire', totalCols);\n totalCols = this.options.countCols();\n } else if (autoWrapRow) {\n delta.row = renderableRow + delta.row === totalRows - 1 ? 1 - totalRows : 1;\n delta.col = 1 - totalCols;\n }\n } else if (autoWrapRow && renderableColumn + delta.col < 0 && renderableRow + delta.row >= 0) {\n delta.row = renderableRow + delta.row === 0 ? totalRows - 1 : -1;\n delta.col = totalCols - 1;\n }\n\n var coords = new CellCoords(renderableRow + delta.row, renderableColumn + delta.col);\n rowTransformDir = 0;\n colTransformDir = 0;\n\n if (coords.row < 0) {\n rowTransformDir = -1;\n coords.row = 0;\n } else if (coords.row > 0 && coords.row >= totalRows) {\n rowTransformDir = 1;\n coords.row = totalRows - 1;\n }\n\n if (coords.col < 0) {\n colTransformDir = -1;\n coords.col = 0;\n } else if (coords.col > 0 && coords.col >= totalCols) {\n colTransformDir = 1;\n coords.col = totalCols - 1;\n }\n\n visualCoords = this.options.renderableToVisualCoords(coords);\n }\n\n this.runLocalHooks('afterTransformStart', visualCoords, rowTransformDir, colTransformDir);\n return visualCoords;\n }\n /**\n * Sets selection end cell relative to current selection end cell (if possible).\n *\n * @param {number} rowDelta Rows number to move, value can be passed as negative number.\n * @param {number} colDelta Columns number to move, value can be passed as negative number.\n * @returns {CellCoords} Visual coordinates after transformation.\n */\n\n }, {\n key: \"transformEnd\",\n value: function transformEnd(rowDelta, colDelta) {\n var delta = new CellCoords(rowDelta, colDelta);\n var cellRange = this.range.current();\n var visualCoords = cellRange.to;\n var rowTransformDir = 0;\n var colTransformDir = 0;\n this.runLocalHooks('beforeTransformEnd', delta);\n\n var _this$options$visualT2 = this.options.visualToRenderableCoords(cellRange.highlight),\n rowHighlight = _this$options$visualT2.row,\n colHighlight = _this$options$visualT2.col; // We have highlight (start point for the selection).\n\n\n if (rowHighlight !== null && colHighlight !== null) {\n var totalRows = this.options.countRows();\n var totalCols = this.options.countCols();\n\n var _this$options$visualT3 = this.options.visualToRenderableCoords(cellRange.to),\n rowTo = _this$options$visualT3.row,\n colTo = _this$options$visualT3.col;\n\n var coords = new CellCoords(rowTo + delta.row, colTo + delta.col);\n rowTransformDir = 0;\n colTransformDir = 0;\n\n if (coords.row < 0) {\n rowTransformDir = -1;\n coords.row = 0;\n } else if (coords.row > 0 && coords.row >= totalRows) {\n rowTransformDir = 1;\n coords.row = totalRows - 1;\n }\n\n if (coords.col < 0) {\n colTransformDir = -1;\n coords.col = 0;\n } else if (coords.col > 0 && coords.col >= totalCols) {\n colTransformDir = 1;\n coords.col = totalCols - 1;\n }\n\n visualCoords = this.options.renderableToVisualCoords(coords);\n }\n\n this.runLocalHooks('afterTransformEnd', visualCoords, rowTransformDir, colTransformDir);\n return visualCoords;\n }\n }]);\n\n return Transformation;\n}();\n\nmixin(Transformation, localHooks);\nexport default Transformation;","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.string.includes.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.set.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.array.sort.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\nimport { CellRange } from \"./../3rdparty/walkontable/src/index.mjs\";\nimport { arrayEach, arrayReduce } from \"./../helpers/array.mjs\";\nimport { isUndefined } from \"./../helpers/mixed.mjs\";\nexport var SELECTION_TYPE_UNRECOGNIZED = 0;\nexport var SELECTION_TYPE_EMPTY = 1;\nexport var SELECTION_TYPE_ARRAY = 2;\nexport var SELECTION_TYPE_OBJECT = 3;\nexport var SELECTION_TYPES = [SELECTION_TYPE_OBJECT, SELECTION_TYPE_ARRAY];\nvar ARRAY_TYPE_PATTERN = [['number'], ['number', 'string'], ['number', 'undefined'], ['number', 'string', 'undefined']];\nvar rootCall = Symbol('root');\nvar childCall = Symbol('child');\n/**\n * Detect selection schema structure.\n *\n * @param {*} selectionRanges The selected range or and array of selected ranges. This type of data is produced by\n * `hot.getSelected()`, `hot.getSelectedLast()`, `hot.getSelectedRange()`\n * and `hot.getSelectedRangeLast()` methods.\n * @param {symbol} _callSymbol The symbol object which indicates source of the helper invocation.\n * @returns {number} Returns a number that specifies the type of detected selection schema. If selection schema type\n * is unrecognized than it returns `0`.\n */\n\nexport function detectSelectionType(selectionRanges) {\n var _callSymbol = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : rootCall;\n\n if (_callSymbol !== rootCall && _callSymbol !== childCall) {\n throw new Error('The second argument is used internally only and cannot be overwritten.');\n }\n\n var isArray = Array.isArray(selectionRanges);\n var isRootCall = _callSymbol === rootCall;\n var result = SELECTION_TYPE_UNRECOGNIZED;\n\n if (isArray) {\n var firstItem = selectionRanges[0];\n\n if (selectionRanges.length === 0) {\n result = SELECTION_TYPE_EMPTY;\n } else if (isRootCall && firstItem instanceof CellRange) {\n result = SELECTION_TYPE_OBJECT;\n } else if (isRootCall && Array.isArray(firstItem)) {\n result = detectSelectionType(firstItem, childCall);\n } else if (selectionRanges.length >= 2 && selectionRanges.length <= 4) {\n var isArrayType = !selectionRanges.some(function (value, index) {\n return !ARRAY_TYPE_PATTERN[index].includes(_typeof(value));\n });\n\n if (isArrayType) {\n result = SELECTION_TYPE_ARRAY;\n }\n }\n }\n\n return result;\n}\n/**\n * Factory function designed for normalization data schema from different data structures of the selection ranges.\n *\n * @param {string} type Selection type which will be processed.\n * @param {object} [options] The normalization options.\n * @param {boolean} [options.keepDirection=false] If `true`, the coordinates which contain the direction of the\n * selected cells won't be changed. Otherwise, the selection will be\n * normalized to values starting from top-left to bottom-right.\n * @param {Function} [options.propToCol] Pass the converting function (usually `datamap.propToCol`) if the column\n * defined as props should be normalized to the numeric values.\n * @returns {number[]} Returns normalized data about selected range as an array (`[rowStart, columnStart, rowEnd, columnEnd]`).\n */\n\nexport function normalizeSelectionFactory(type) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$keepDirection = _ref.keepDirection,\n keepDirection = _ref$keepDirection === void 0 ? false : _ref$keepDirection,\n propToCol = _ref.propToCol;\n\n if (!SELECTION_TYPES.includes(type)) {\n throw new Error('Unsupported selection ranges schema type was provided.');\n }\n\n return function (selection) {\n var isObjectType = type === SELECTION_TYPE_OBJECT;\n var rowStart = isObjectType ? selection.from.row : selection[0];\n var columnStart = isObjectType ? selection.from.col : selection[1];\n var rowEnd = isObjectType ? selection.to.row : selection[2];\n var columnEnd = isObjectType ? selection.to.col : selection[3];\n\n if (typeof propToCol === 'function') {\n if (typeof columnStart === 'string') {\n columnStart = propToCol(columnStart);\n }\n\n if (typeof columnEnd === 'string') {\n columnEnd = propToCol(columnEnd);\n }\n }\n\n if (isUndefined(rowEnd)) {\n rowEnd = rowStart;\n }\n\n if (isUndefined(columnEnd)) {\n columnEnd = columnStart;\n }\n\n if (!keepDirection) {\n var origRowStart = rowStart;\n var origColumnStart = columnStart;\n var origRowEnd = rowEnd;\n var origColumnEnd = columnEnd;\n rowStart = Math.min(origRowStart, origRowEnd);\n columnStart = Math.min(origColumnStart, origColumnEnd);\n rowEnd = Math.max(origRowStart, origRowEnd);\n columnEnd = Math.max(origColumnStart, origColumnEnd);\n }\n\n return [rowStart, columnStart, rowEnd, columnEnd];\n };\n}\n/**\n * Function transform selection ranges (produced by `hot.getSelected()` and `hot.getSelectedRange()`) to normalized\n * data structure. It merges repeated ranges into consecutive coordinates. The returned structure\n * contains an array of arrays. The single item contains at index 0 visual column index from the selection was\n * started and at index 1 distance as a count of selected columns.\n *\n * @param {Array[]|CellRange[]} selectionRanges Selection ranges produced by Handsontable.\n * @returns {Array[]} Returns an array of arrays with ranges defines in that schema:\n * `[[visualColumnStart, distance], [visualColumnStart, distance], ...]`.\n * The column distances are always created starting from the left (zero index) to the\n * right (the latest column index).\n */\n\nexport function transformSelectionToColumnDistance(selectionRanges) {\n var selectionType = detectSelectionType(selectionRanges);\n\n if (selectionType === SELECTION_TYPE_UNRECOGNIZED || selectionType === SELECTION_TYPE_EMPTY) {\n return [];\n }\n\n var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);\n var unorderedIndexes = new Set(); // Iterate through all ranges and collect all column indexes which are not saved yet.\n\n arrayEach(selectionRanges, function (selection) {\n var _selectionSchemaNorma = selectionSchemaNormalizer(selection),\n _selectionSchemaNorma2 = _slicedToArray(_selectionSchemaNorma, 4),\n columnStart = _selectionSchemaNorma2[1],\n columnEnd = _selectionSchemaNorma2[3];\n\n var columnNonHeaderStart = Math.max(columnStart, 0);\n var amount = columnEnd - columnNonHeaderStart + 1;\n arrayEach(Array.from(new Array(amount), function (_, i) {\n return columnNonHeaderStart + i;\n }), function (index) {\n if (!unorderedIndexes.has(index)) {\n unorderedIndexes.add(index);\n }\n });\n }); // Sort indexes in ascending order to easily detecting non-consecutive columns.\n\n var orderedIndexes = Array.from(unorderedIndexes).sort(function (a, b) {\n return a - b;\n });\n var normalizedColumnRanges = arrayReduce(orderedIndexes, function (acc, visualColumnIndex, index, array) {\n if (index !== 0 && visualColumnIndex === array[index - 1] + 1) {\n acc[acc.length - 1][1] += 1;\n } else {\n acc.push([visualColumnIndex, 1]);\n }\n\n return acc;\n }, []);\n return normalizedColumnRanges;\n}\n/**\n * Function transform selection ranges (produced by `hot.getSelected()` and `hot.getSelectedRange()`) to normalized\n * data structure. It merges repeated ranges into consecutive coordinates. The returned structure\n * contains an array of arrays. The single item contains at index 0 visual column index from the selection was\n * started and at index 1 distance as a count of selected columns.\n *\n * @param {Array[]|CellRange[]} selectionRanges Selection ranges produced by Handsontable.\n * @returns {Array[]} Returns an array of arrays with ranges defines in that schema:\n * `[[visualColumnStart, distance], [visualColumnStart, distance], ...]`.\n * The column distances are always created starting from the left (zero index) to the\n * right (the latest column index).\n */\n\nexport function transformSelectionToRowDistance(selectionRanges) {\n var selectionType = detectSelectionType(selectionRanges);\n\n if (selectionType === SELECTION_TYPE_UNRECOGNIZED || selectionType === SELECTION_TYPE_EMPTY) {\n return [];\n }\n\n var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType);\n var unorderedIndexes = new Set(); // Iterate through all ranges and collect all column indexes which are not saved yet.\n\n arrayEach(selectionRanges, function (selection) {\n var _selectionSchemaNorma3 = selectionSchemaNormalizer(selection),\n _selectionSchemaNorma4 = _slicedToArray(_selectionSchemaNorma3, 3),\n rowStart = _selectionSchemaNorma4[0],\n rowEnd = _selectionSchemaNorma4[2];\n\n var rowNonHeaderStart = Math.max(rowStart, 0);\n var amount = rowEnd - rowNonHeaderStart + 1;\n arrayEach(Array.from(new Array(amount), function (_, i) {\n return rowNonHeaderStart + i;\n }), function (index) {\n if (!unorderedIndexes.has(index)) {\n unorderedIndexes.add(index);\n }\n });\n }); // Sort indexes in ascending order to easily detecting non-consecutive columns.\n\n var orderedIndexes = Array.from(unorderedIndexes).sort(function (a, b) {\n return a - b;\n });\n var normalizedRowRanges = arrayReduce(orderedIndexes, function (acc, rowIndex, index, array) {\n if (index !== 0 && rowIndex === array[index - 1] + 1) {\n acc[acc.length - 1][1] += 1;\n } else {\n acc.push([rowIndex, 1]);\n }\n\n return acc;\n }, []);\n return normalizedRowRanges;\n}\n/**\n * Check if passed value can be treated as valid cell coordinate. The second argument is\n * used to check if the value doesn't exceed the defined max table rows/columns count.\n *\n * @param {number} coord The coordinate to validate (row index or column index).\n * @param {number} maxTableItemsCount The value that declares the maximum coordinate that is still validatable.\n * @returns {boolean}\n */\n\nexport function isValidCoord(coord) {\n var maxTableItemsCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;\n return typeof coord === 'number' && coord >= 0 && coord < maxTableItemsCount;\n}","import \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.object.freeze.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.function.name.js\";\n\nvar _templateObject;\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.set.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.string.includes.js\";\nimport \"core-js/modules/es.number.is-integer.js\";\nimport \"core-js/modules/es.number.constructor.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport Highlight from \"./highlight/highlight.mjs\";\nimport { AREA_TYPE, HEADER_TYPE, CELL_TYPE } from \"./highlight/constants.mjs\";\nimport SelectionRange from \"./range.mjs\";\nimport { CellCoords } from \"./../3rdparty/walkontable/src/index.mjs\";\nimport { isPressedCtrlKey } from \"./../utils/keyStateObserver.mjs\";\nimport { createObjectPropListener, mixin } from \"./../helpers/object.mjs\";\nimport { isUndefined } from \"./../helpers/mixed.mjs\";\nimport { arrayEach } from \"./../helpers/array.mjs\";\nimport localHooks from \"./../mixins/localHooks.mjs\";\nimport Transformation from \"./transformation.mjs\";\nimport { detectSelectionType, isValidCoord, normalizeSelectionFactory, SELECTION_TYPE_EMPTY, SELECTION_TYPE_UNRECOGNIZED } from \"./utils.mjs\";\nimport { toSingleLine } from \"./../helpers/templateLiteralTag.mjs\";\n/**\n * @class Selection\n * @util\n */\n\nvar Selection = /*#__PURE__*/function () {\n function Selection(settings, tableProps) {\n var _this = this;\n\n _classCallCheck(this, Selection);\n\n /**\n * Handsontable settings instance.\n *\n * @type {GridSettings}\n */\n this.settings = settings;\n /**\n * An additional object with dynamically defined properties which describes table state.\n *\n * @type {object}\n */\n\n this.tableProps = tableProps;\n /**\n * The flag which determines if the selection is in progress.\n *\n * @type {boolean}\n */\n\n this.inProgress = false;\n /**\n * The flag indicates that selection was performed by clicking the corner overlay.\n *\n * @type {boolean}\n */\n\n this.selectedByCorner = false;\n /**\n * The collection of the selection layer levels where the whole row was selected using the row header or\n * the corner header.\n *\n * @type {Set.}\n */\n\n this.selectedByRowHeader = new Set();\n /**\n * The collection of the selection layer levels where the whole column was selected using the column header or\n * the corner header.\n *\n * @type {Set.}\n */\n\n this.selectedByColumnHeader = new Set();\n /**\n * Selection data layer (handle visual coordinates).\n *\n * @type {SelectionRange}\n */\n\n this.selectedRange = new SelectionRange();\n /**\n * Visualization layer.\n *\n * @type {Highlight}\n */\n\n this.highlight = new Highlight({\n headerClassName: settings.currentHeaderClassName,\n activeHeaderClassName: settings.activeHeaderClassName,\n rowClassName: settings.currentRowClassName,\n columnClassName: settings.currentColClassName,\n disabledCellSelection: function disabledCellSelection(row, column) {\n return _this.tableProps.isDisabledCellSelection(row, column);\n },\n cellCornerVisible: function cellCornerVisible() {\n return _this.isCellCornerVisible.apply(_this, arguments);\n },\n areaCornerVisible: function areaCornerVisible() {\n return _this.isAreaCornerVisible.apply(_this, arguments);\n },\n visualToRenderableCoords: function visualToRenderableCoords(coords) {\n return _this.tableProps.visualToRenderableCoords(coords);\n },\n renderableToVisualCoords: function renderableToVisualCoords(coords) {\n return _this.tableProps.renderableToVisualCoords(coords);\n }\n });\n /**\n * The module for modifying coordinates.\n *\n * @type {Transformation}\n */\n\n this.transformation = new Transformation(this.selectedRange, {\n countRows: function countRows() {\n return _this.tableProps.countRowsTranslated();\n },\n countCols: function countCols() {\n return _this.tableProps.countColsTranslated();\n },\n visualToRenderableCoords: function visualToRenderableCoords(coords) {\n return _this.tableProps.visualToRenderableCoords(coords);\n },\n renderableToVisualCoords: function renderableToVisualCoords(coords) {\n return _this.tableProps.renderableToVisualCoords(coords);\n },\n fixedRowsBottom: function fixedRowsBottom() {\n return settings.fixedRowsBottom;\n },\n minSpareRows: function minSpareRows() {\n return settings.minSpareRows;\n },\n minSpareCols: function minSpareCols() {\n return settings.minSpareCols;\n },\n autoWrapRow: function autoWrapRow() {\n return settings.autoWrapRow;\n },\n autoWrapCol: function autoWrapCol() {\n return settings.autoWrapCol;\n }\n });\n this.transformation.addLocalHook('beforeTransformStart', function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _this.runLocalHooks.apply(_this, ['beforeModifyTransformStart'].concat(args));\n });\n this.transformation.addLocalHook('afterTransformStart', function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return _this.runLocalHooks.apply(_this, ['afterModifyTransformStart'].concat(args));\n });\n this.transformation.addLocalHook('beforeTransformEnd', function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return _this.runLocalHooks.apply(_this, ['beforeModifyTransformEnd'].concat(args));\n });\n this.transformation.addLocalHook('afterTransformEnd', function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return _this.runLocalHooks.apply(_this, ['afterModifyTransformEnd'].concat(args));\n });\n this.transformation.addLocalHook('insertRowRequire', function () {\n for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {\n args[_key5] = arguments[_key5];\n }\n\n return _this.runLocalHooks.apply(_this, ['insertRowRequire'].concat(args));\n });\n this.transformation.addLocalHook('insertColRequire', function () {\n for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {\n args[_key6] = arguments[_key6];\n }\n\n return _this.runLocalHooks.apply(_this, ['insertColRequire'].concat(args));\n });\n }\n /**\n * Get data layer for current selection.\n *\n * @returns {SelectionRange}\n */\n\n\n _createClass(Selection, [{\n key: \"getSelectedRange\",\n value: function getSelectedRange() {\n return this.selectedRange;\n }\n /**\n * Indicate that selection process began. It sets internaly `.inProgress` property to `true`.\n */\n\n }, {\n key: \"begin\",\n value: function begin() {\n this.inProgress = true;\n }\n /**\n * Indicate that selection process finished. It sets internaly `.inProgress` property to `false`.\n */\n\n }, {\n key: \"finish\",\n value: function finish() {\n this.runLocalHooks('afterSelectionFinished', Array.from(this.selectedRange));\n this.inProgress = false;\n }\n /**\n * Check if the process of selecting the cell/cells is in progress.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isInProgress\",\n value: function isInProgress() {\n return this.inProgress;\n }\n /**\n * Starts selection range on given coordinate object.\n *\n * @param {CellCoords} coords Visual coords.\n * @param {boolean} [multipleSelection] If `true`, selection will be worked in 'multiple' mode. This option works\n * only when 'selectionMode' is set as 'multiple'. If the argument is not defined\n * the default trigger will be used (isPressedCtrlKey() helper).\n * @param {boolean} [fragment=false] If `true`, the selection will be treated as a partial selection where the\n * `setRangeEnd` method won't be called on every `setRangeStart` call.\n */\n\n }, {\n key: \"setRangeStart\",\n value: function setRangeStart(coords, multipleSelection) {\n var fragment = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var isMultipleMode = this.settings.selectionMode === 'multiple';\n var isMultipleSelection = isUndefined(multipleSelection) ? isPressedCtrlKey() : multipleSelection;\n var isRowNegative = coords.row < 0;\n var isColumnNegative = coords.col < 0;\n var selectedByCorner = isRowNegative && isColumnNegative;\n this.selectedByCorner = selectedByCorner;\n this.runLocalHooks(\"beforeSetRangeStart\".concat(fragment ? 'Only' : ''), coords);\n\n if (!isMultipleMode || isMultipleMode && !isMultipleSelection && isUndefined(multipleSelection)) {\n this.selectedRange.clear();\n }\n\n this.selectedRange.add(coords);\n\n if (this.getLayerLevel() === 0) {\n this.selectedByRowHeader.clear();\n this.selectedByColumnHeader.clear();\n }\n\n if (!selectedByCorner && isColumnNegative) {\n this.selectedByRowHeader.add(this.getLayerLevel());\n }\n\n if (!selectedByCorner && isRowNegative) {\n this.selectedByColumnHeader.add(this.getLayerLevel());\n }\n\n if (!fragment) {\n this.setRangeEnd(coords);\n }\n }\n /**\n * Starts selection range on given coordinate object.\n *\n * @param {CellCoords} coords Visual coords.\n * @param {boolean} [multipleSelection] If `true`, selection will be worked in 'multiple' mode. This option works\n * only when 'selectionMode' is set as 'multiple'. If the argument is not defined\n * the default trigger will be used (isPressedCtrlKey() helper).\n */\n\n }, {\n key: \"setRangeStartOnly\",\n value: function setRangeStartOnly(coords, multipleSelection) {\n this.setRangeStart(coords, multipleSelection, true);\n }\n /**\n * Ends selection range on given coordinate object.\n *\n * @param {CellCoords} coords Visual coords.\n */\n\n }, {\n key: \"setRangeEnd\",\n value: function setRangeEnd(coords) {\n if (this.selectedRange.isEmpty()) {\n return;\n }\n\n this.runLocalHooks('beforeSetRangeEnd', coords);\n this.begin();\n var cellRange = this.selectedRange.current();\n\n if (this.settings.selectionMode !== 'single') {\n cellRange.setTo(new CellCoords(coords.row, coords.col));\n } // Set up current selection.\n\n\n this.highlight.getCell().clear();\n\n if (this.highlight.isEnabledFor(CELL_TYPE, cellRange.highlight)) {\n this.highlight.getCell().add(this.selectedRange.current().highlight).commit().adjustCoordinates(cellRange);\n }\n\n var layerLevel = this.getLayerLevel(); // If the next layer level is lower than previous then clear all area and header highlights. This is the\n // indication that the new selection is performing.\n\n if (layerLevel < this.highlight.layerLevel) {\n arrayEach(this.highlight.getAreas(), function (highlight) {\n return void highlight.clear();\n });\n arrayEach(this.highlight.getHeaders(), function (highlight) {\n return void highlight.clear();\n });\n arrayEach(this.highlight.getActiveHeaders(), function (highlight) {\n return void highlight.clear();\n });\n }\n\n this.highlight.useLayerLevel(layerLevel);\n var areaHighlight = this.highlight.createOrGetArea();\n var headerHighlight = this.highlight.createOrGetHeader();\n var activeHeaderHighlight = this.highlight.createOrGetActiveHeader();\n areaHighlight.clear();\n headerHighlight.clear();\n activeHeaderHighlight.clear();\n\n if (this.highlight.isEnabledFor(AREA_TYPE, cellRange.highlight) && (this.isMultiple() || layerLevel >= 1)) {\n areaHighlight.add(cellRange.from).add(cellRange.to).commit();\n\n if (layerLevel === 1) {\n // For single cell selection in the same layer, we do not create area selection to prevent blue background.\n // When non-consecutive selection is performed we have to add that missing area selection to the previous layer\n // based on previous coordinates. It only occurs when the previous selection wasn't select multiple cells.\n var previousRange = this.selectedRange.previous();\n this.highlight.useLayerLevel(layerLevel - 1).createOrGetArea().add(previousRange.from).commit() // Range may start with hidden indexes. Commit would not found start point (as we add just the `from` coords).\n .adjustCoordinates(previousRange);\n this.highlight.useLayerLevel(layerLevel);\n }\n }\n\n if (this.highlight.isEnabledFor(HEADER_TYPE, cellRange.highlight)) {\n // The header selection generally contains cell selection. In a case when all rows (or columns)\n // are hidden that visual coordinates are translated to renderable coordinates that do not exist.\n // Hence no header highlight is generated. In that case, to make a column (or a row) header\n // highlight, the row and column index has to point to the header (the negative value). See #7052.\n var areAnyRowsRendered = this.tableProps.countRowsTranslated() === 0;\n var areAnyColumnsRendered = this.tableProps.countColsTranslated() === 0;\n var headerCellRange = cellRange;\n\n if (areAnyRowsRendered || areAnyColumnsRendered) {\n headerCellRange = cellRange.clone();\n }\n\n if (areAnyRowsRendered) {\n headerCellRange.from.row = -1;\n }\n\n if (areAnyColumnsRendered) {\n headerCellRange.from.col = -1;\n }\n\n if (this.settings.selectionMode === 'single') {\n if (this.isSelectedByAnyHeader()) {\n headerCellRange.from.normalize();\n }\n\n headerHighlight.add(headerCellRange.from).commit();\n } else {\n headerHighlight.add(headerCellRange.from).add(headerCellRange.to).commit();\n }\n\n if (this.isEntireRowSelected()) {\n var isRowSelected = this.tableProps.countCols() === cellRange.getWidth(); // Make sure that the whole row is selected (in case where selectionMode is set to 'single')\n\n if (isRowSelected) {\n activeHeaderHighlight.add(new CellCoords(cellRange.from.row, -1)).add(new CellCoords(cellRange.to.row, -1)).commit();\n }\n }\n\n if (this.isEntireColumnSelected()) {\n var isColumnSelected = this.tableProps.countRows() === cellRange.getHeight(); // Make sure that the whole column is selected (in case where selectionMode is set to 'single')\n\n if (isColumnSelected) {\n activeHeaderHighlight.add(new CellCoords(-1, cellRange.from.col)).add(new CellCoords(-1, cellRange.to.col)).commit();\n }\n }\n }\n\n this.runLocalHooks('afterSetRangeEnd', coords);\n }\n /**\n * Returns information if we have a multiselection. This method check multiselection only on the latest layer of\n * the selection.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isMultiple\",\n value: function isMultiple() {\n var isMultipleListener = createObjectPropListener(!this.selectedRange.current().isSingle());\n this.runLocalHooks('afterIsMultipleSelection', isMultipleListener);\n return isMultipleListener.value;\n }\n /**\n * Selects cell relative to the current cell (if possible).\n *\n * @param {number} rowDelta Rows number to move, value can be passed as negative number.\n * @param {number} colDelta Columns number to move, value can be passed as negative number.\n * @param {boolean} force If `true` the new rows/columns will be created if necessary. Otherwise, row/column will\n * be created according to `minSpareRows/minSpareCols` settings of Handsontable.\n */\n\n }, {\n key: \"transformStart\",\n value: function transformStart(rowDelta, colDelta, force) {\n this.setRangeStart(this.transformation.transformStart(rowDelta, colDelta, force));\n }\n /**\n * Sets selection end cell relative to the current selection end cell (if possible).\n *\n * @param {number} rowDelta Rows number to move, value can be passed as negative number.\n * @param {number} colDelta Columns number to move, value can be passed as negative number.\n */\n\n }, {\n key: \"transformEnd\",\n value: function transformEnd(rowDelta, colDelta) {\n this.setRangeEnd(this.transformation.transformEnd(rowDelta, colDelta));\n }\n /**\n * Returns currently used layer level.\n *\n * @returns {number} Returns layer level starting from 0. If no selection was added to the table -1 is returned.\n */\n\n }, {\n key: \"getLayerLevel\",\n value: function getLayerLevel() {\n return this.selectedRange.size() - 1;\n }\n /**\n * Returns `true` if currently there is a selection on the screen, `false` otherwise.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isSelected\",\n value: function isSelected() {\n return !this.selectedRange.isEmpty();\n }\n /**\n * Returns `true` if the selection was applied by clicking to the row header. If the `layerLevel`\n * argument is passed then only that layer will be checked. Otherwise, it checks if any row header\n * was clicked on any selection layer level.\n *\n * @param {number} [layerLevel=this.getLayerLevel()] Selection layer level to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"isSelectedByRowHeader\",\n value: function isSelectedByRowHeader() {\n var layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel();\n return !this.isSelectedByCorner(layerLevel) && this.isEntireRowSelected(layerLevel);\n }\n /**\n * Returns `true` if the selection consists of entire rows (including their headers). If the `layerLevel`\n * argument is passed then only that layer will be checked. Otherwise, it checks the selection for all layers.\n *\n * @param {number} [layerLevel=this.getLayerLevel()] Selection layer level to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"isEntireRowSelected\",\n value: function isEntireRowSelected() {\n var layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel();\n return layerLevel === -1 ? this.selectedByRowHeader.size > 0 : this.selectedByRowHeader.has(layerLevel);\n }\n /**\n * Returns `true` if the selection was applied by clicking to the column header. If the `layerLevel`\n * argument is passed then only that layer will be checked. Otherwise, it checks if any column header\n * was clicked on any selection layer level.\n *\n * @param {number} [layerLevel=this.getLayerLevel()] Selection layer level to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"isSelectedByColumnHeader\",\n value: function isSelectedByColumnHeader() {\n var layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel();\n return !this.isSelectedByCorner() && this.isEntireColumnSelected(layerLevel);\n }\n /**\n * Returns `true` if the selection consists of entire columns (including their headers). If the `layerLevel`\n * argument is passed then only that layer will be checked. Otherwise, it checks the selection for all layers.\n *\n * @param {number} [layerLevel=this.getLayerLevel()] Selection layer level to check.\n * @returns {boolean}\n */\n\n }, {\n key: \"isEntireColumnSelected\",\n value: function isEntireColumnSelected() {\n var layerLevel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getLayerLevel();\n return layerLevel === -1 ? this.selectedByColumnHeader.size > 0 : this.selectedByColumnHeader.has(layerLevel);\n }\n /**\n * Returns `true` if the selection was applied by clicking on the row or column header on any layer level.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isSelectedByAnyHeader\",\n value: function isSelectedByAnyHeader() {\n return this.isSelectedByRowHeader(-1) || this.isSelectedByColumnHeader(-1) || this.isSelectedByCorner();\n }\n /**\n * Returns `true` if the selection was applied by clicking on the left-top corner overlay.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isSelectedByCorner\",\n value: function isSelectedByCorner() {\n return this.selectedByCorner;\n }\n /**\n * Returns `true` if coords is within selection coords. This method iterates through all selection layers to check if\n * the coords object is within selection range.\n *\n * @param {CellCoords} coords The CellCoords instance with defined visual coordinates.\n * @returns {boolean}\n */\n\n }, {\n key: \"inInSelection\",\n value: function inInSelection(coords) {\n return this.selectedRange.includes(coords);\n }\n /**\n * Returns `true` if the cell corner should be visible.\n *\n * @private\n * @returns {boolean} `true` if the corner element has to be visible, `false` otherwise.\n */\n\n }, {\n key: \"isCellCornerVisible\",\n value: function isCellCornerVisible() {\n return this.settings.fillHandle && !this.tableProps.isEditorOpened() && !this.isMultiple();\n }\n /**\n * Returns `true` if the area corner should be visible.\n *\n * @param {number} layerLevel The layer level.\n * @returns {boolean} `true` if the corner element has to be visible, `false` otherwise.\n */\n\n }, {\n key: \"isAreaCornerVisible\",\n value: function isAreaCornerVisible(layerLevel) {\n if (Number.isInteger(layerLevel) && layerLevel !== this.getLayerLevel()) {\n return false;\n }\n\n return this.settings.fillHandle && !this.tableProps.isEditorOpened() && this.isMultiple();\n }\n /**\n * Clear the selection by resetting the collected ranges and highlights.\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n // TODO: collections selectedByColumnHeader and selectedByRowHeader should be clear too.\n this.selectedRange.clear();\n this.highlight.clear();\n }\n /**\n * Deselects all selected cells.\n */\n\n }, {\n key: \"deselect\",\n value: function deselect() {\n if (!this.isSelected()) {\n return;\n }\n\n this.inProgress = false;\n this.clear();\n this.runLocalHooks('afterDeselect');\n }\n /**\n * Select all cells.\n *\n * @param {boolean} [includeRowHeaders=false] `true` If the selection should include the row headers, `false`\n * otherwise.\n * @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column headers, `false`\n * otherwise.\n */\n\n }, {\n key: \"selectAll\",\n value: function selectAll() {\n var includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var nrOfRows = this.tableProps.countRows();\n var nrOfColumns = this.tableProps.countCols(); // We can't select cells when there is no data.\n\n if (!includeRowHeaders && !includeColumnHeaders && (nrOfRows === 0 || nrOfColumns === 0)) {\n return;\n }\n\n var startCoords = new CellCoords(includeColumnHeaders ? -1 : 0, includeRowHeaders ? -1 : 0);\n this.clear();\n this.setRangeStartOnly(startCoords);\n this.selectedByRowHeader.add(this.getLayerLevel());\n this.selectedByColumnHeader.add(this.getLayerLevel());\n this.setRangeEnd(new CellCoords(nrOfRows - 1, nrOfColumns - 1));\n this.finish();\n }\n /**\n * Make multiple, non-contiguous selection specified by `row` and `column` values or a range of cells\n * finishing at `endRow`, `endColumn`. The method supports two input formats, first as an array of arrays such\n * as `[[rowStart, columnStart, rowEnd, columnEnd]]` and second format as an array of CellRange objects.\n * If the passed ranges have another format the exception will be thrown.\n *\n * @param {Array[]|CellRange[]} selectionRanges The coordinates which define what the cells should be selected.\n * @returns {boolean} Returns `true` if selection was successful, `false` otherwise.\n */\n\n }, {\n key: \"selectCells\",\n value: function selectCells(selectionRanges) {\n var _this2 = this;\n\n var selectionType = detectSelectionType(selectionRanges);\n\n if (selectionType === SELECTION_TYPE_EMPTY) {\n return false;\n } else if (selectionType === SELECTION_TYPE_UNRECOGNIZED) {\n throw new Error(toSingleLine(_templateObject || (_templateObject = _taggedTemplateLiteral([\"Unsupported format of the selection ranges was passed. To select cells pass \\n the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd, \\n columnEnd/columnPropEnd]]) or as an array of CellRange objects.\"], [\"Unsupported format of the selection ranges was passed. To select cells pass\\\\x20\\n the coordinates as an array of arrays ([[rowStart, columnStart/columnPropStart, rowEnd,\\\\x20\\n columnEnd/columnPropEnd]]) or as an array of CellRange objects.\"]))));\n }\n\n var selectionSchemaNormalizer = normalizeSelectionFactory(selectionType, {\n propToCol: function propToCol(prop) {\n return _this2.tableProps.propToCol(prop);\n },\n keepDirection: true\n });\n var nrOfRows = this.tableProps.countRows();\n var nrOfColumns = this.tableProps.countCols(); // Check if every layer of the coordinates are valid.\n\n var isValid = !selectionRanges.some(function (selection) {\n var _selectionSchemaNorma = selectionSchemaNormalizer(selection),\n _selectionSchemaNorma2 = _slicedToArray(_selectionSchemaNorma, 4),\n rowStart = _selectionSchemaNorma2[0],\n columnStart = _selectionSchemaNorma2[1],\n rowEnd = _selectionSchemaNorma2[2],\n columnEnd = _selectionSchemaNorma2[3];\n\n var _isValid = isValidCoord(rowStart, nrOfRows) && isValidCoord(columnStart, nrOfColumns) && isValidCoord(rowEnd, nrOfRows) && isValidCoord(columnEnd, nrOfColumns);\n\n return !_isValid;\n });\n\n if (isValid) {\n this.clear();\n arrayEach(selectionRanges, function (selection) {\n var _selectionSchemaNorma3 = selectionSchemaNormalizer(selection),\n _selectionSchemaNorma4 = _slicedToArray(_selectionSchemaNorma3, 4),\n rowStart = _selectionSchemaNorma4[0],\n columnStart = _selectionSchemaNorma4[1],\n rowEnd = _selectionSchemaNorma4[2],\n columnEnd = _selectionSchemaNorma4[3];\n\n _this2.setRangeStartOnly(new CellCoords(rowStart, columnStart), false);\n\n _this2.setRangeEnd(new CellCoords(rowEnd, columnEnd));\n\n _this2.finish();\n });\n }\n\n return isValid;\n }\n /**\n * Select column specified by `startColumn` visual index or column property or a range of columns finishing at\n * `endColumn`.\n *\n * @param {number|string} startColumn Visual column index or column property from which the selection starts.\n * @param {number|string} [endColumn] Visual column index or column property from to the selection finishes.\n * @param {number} [headerLevel=-1] A row header index that triggers the column selection. The value can\n * take -1 to -N, where -1 means the header closest to the cells.\n *\n * @returns {boolean} Returns `true` if selection was successful, `false` otherwise.\n */\n\n }, {\n key: \"selectColumns\",\n value: function selectColumns(startColumn) {\n var endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;\n var headerLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;\n var start = typeof startColumn === 'string' ? this.tableProps.propToCol(startColumn) : startColumn;\n var end = typeof endColumn === 'string' ? this.tableProps.propToCol(endColumn) : endColumn;\n var nrOfColumns = this.tableProps.countCols();\n var nrOfRows = this.tableProps.countRows();\n var isValid = isValidCoord(start, nrOfColumns) && isValidCoord(end, nrOfColumns);\n\n if (isValid) {\n this.setRangeStartOnly(new CellCoords(headerLevel, start));\n this.setRangeEnd(new CellCoords(nrOfRows - 1, end));\n this.finish();\n }\n\n return isValid;\n }\n /**\n * Select row specified by `startRow` visual index or a range of rows finishing at `endRow`.\n *\n * @param {number} startRow Visual row index from which the selection starts.\n * @param {number} [endRow] Visual row index from to the selection finishes.\n * @param {number} [headerLevel=-1] A column header index that triggers the row selection.\n * The value can take -1 to -N, where -1 means the header\n * closest to the cells.\n * @returns {boolean} Returns `true` if selection was successful, `false` otherwise.\n */\n\n }, {\n key: \"selectRows\",\n value: function selectRows(startRow) {\n var endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;\n var headerLevel = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1;\n var nrOfRows = this.tableProps.countRows();\n var nrOfColumns = this.tableProps.countCols();\n var isValid = isValidCoord(startRow, nrOfRows) && isValidCoord(endRow, nrOfRows);\n\n if (isValid) {\n this.setRangeStartOnly(new CellCoords(startRow, headerLevel));\n this.setRangeEnd(new CellCoords(endRow, nrOfColumns - 1));\n this.finish();\n }\n\n return isValid;\n }\n /**\n * Rewrite the rendered state of the selection as visual selection may have a new representation in the DOM.\n */\n\n }, {\n key: \"refresh\",\n value: function refresh() {\n var customSelections = this.highlight.getCustomSelections();\n customSelections.forEach(function (customSelection) {\n customSelection.commit();\n });\n\n if (!this.isSelected()) {\n return;\n }\n\n var cellHighlight = this.highlight.getCell();\n var currentLayer = this.getLayerLevel();\n cellHighlight.commit().adjustCoordinates(this.selectedRange.current()); // Rewriting rendered ranges going through all layers.\n\n for (var layerLevel = 0; layerLevel < this.selectedRange.size(); layerLevel += 1) {\n this.highlight.useLayerLevel(layerLevel);\n var areaHighlight = this.highlight.createOrGetArea();\n var headerHighlight = this.highlight.createOrGetHeader();\n var activeHeaderHighlight = this.highlight.createOrGetActiveHeader();\n areaHighlight.commit();\n headerHighlight.commit();\n activeHeaderHighlight.commit();\n } // Reverting starting layer for the Highlight.\n\n\n this.highlight.useLayerLevel(currentLayer);\n }\n }]);\n\n return Selection;\n}();\n\nmixin(Selection, localHooks);\nexport default Selection;","import \"core-js/modules/es.number.is-integer.js\";\nimport \"core-js/modules/es.number.constructor.js\";\nimport { hasOwnProperty, isObject, objectEach, inherit } from \"../../helpers/object.mjs\";\nimport { getCellType } from \"../../cellTypes/registry.mjs\";\n/**\n * Expands \"type\" property of the meta object to single values. For example `type: 'numeric'` sets\n * \"renderer\", \"editor\", \"validator\" properties to specific functions designed for numeric values.\n * If \"type\" is passed as an object that object will be returned, excluding properties that\n * already exist in the \"metaObject\" if passed.\n *\n * @param {object|string} type Type to expand;.\n * @param {object|undefined} [metaObject] Source meta object.\n * @returns {object|undefined}\n */\n\nexport function expandMetaType(type, metaObject) {\n var validType = typeof type === 'string' ? getCellType(type) : type;\n\n if (!isObject(validType)) {\n return;\n }\n\n var preventSourceOverwrite = isObject(metaObject);\n var expandedType = {};\n objectEach(validType, function (value, property) {\n if (property !== 'CELL_TYPE' && (!preventSourceOverwrite || preventSourceOverwrite && !hasOwnProperty(metaObject, property))) {\n expandedType[property] = value;\n }\n });\n return expandedType;\n}\n/**\n * Creates new class which extends properties from TableMeta layer class.\n *\n * @param {TableMeta} TableMeta The TableMeta which the new ColumnMeta is created from.\n * @param {string[]} [conflictList] List of the properties which are conflicted with the column meta layer.\n * Conflicted properties are overwritten by `undefined` value, to separate them\n * from the TableMeta layer.\n * @returns {ColumnMeta} Returns constructor ready to initialize with `new` operator.\n */\n\nexport function columnFactory(TableMeta) {\n var conflictList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n\n // Do not use ES6 \"class extends\" syntax here. It seems that the babel produces code\n // which drastically decreases the performance of the ColumnMeta class creation.\n\n /**\n * Base \"class\" for column meta.\n */\n function ColumnMeta() {}\n\n inherit(ColumnMeta, TableMeta); // Clear conflict settings\n\n for (var i = 0; i < conflictList.length; i++) {\n ColumnMeta.prototype[conflictList[i]] = void 0;\n }\n\n return ColumnMeta;\n}\n/**\n * Helper which checks if the provided argument is an unsigned number.\n *\n * @param {*} value Value to check.\n * @returns {boolean}\n */\n\nexport function isUnsignedNumber(value) {\n return Number.isInteger(value) && value >= 0;\n}\n/**\n * Function which makes assertion by custom condition. Function throws an error when assertion doesn't meet the spec.\n *\n * @param {Function} condition Function with custom logic. The condition has to return boolean values.\n * @param {string} errorMessage String which describes assertion error.\n */\n\nexport function assert(condition, errorMessage) {\n if (!condition()) {\n throw new Error(\"Assertion failed: \".concat(errorMessage));\n }\n}\n/**\n * Check if given variable is null or undefined.\n *\n * @param {*} variable Variable to check.\n * @returns {boolean}\n */\n\nexport function isNullish(variable) {\n return variable === null || variable === void 0;\n}","import \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { isEmpty } from \"../../helpers/mixed.mjs\";\nimport { isObjectEqual } from \"../../helpers/object.mjs\";\n/* eslint-disable jsdoc/require-description-complete-sentence */\n\n/**\n * @alias Options\n * @class Options\n * @description\n *\n * Handsontable provides many options to choose from. They come either from the [Core](core) features or [plugins hooks](hooks).\n *\n * You can pass options in an object iteral notation (a comma-separated list of name-value pairs wrapped in curly braces) as a second argument of the Handsontable constructor.\n *\n * In the further documentation, and in Guides, we prefer calling this object a `Settings` object or `configuration` object.\n *\n * ```js\n * const container = document.getElementById('example');\n * const hot = new Handsontable(container, {\n * data: myArray,\n * width: 400,\n * height: 300\n * });\n * ```\n *\n * ## Applying options to different elements of the grid\n *\n * Options can set for many different parts of the data grid:\n *\n * - The entire grid\n * - A column or range of columns\n * - A row or range of rows\n * - A cell or range of cells\n *\n * Options use the cascading configuration to make that possible.\n *\n * Take a look at the following example:\n *\n * ```js\n * const container = document.getElementById('example');\n * const hot = new Handsontable(container, {\n * readOnly: true,\n * columns: [\n * { readOnly: false },\n * {},\n * {},\n * ],\n * cells: function(row, col, prop) {\n * var cellProperties = {};\n *\n * if (row === 0 && col === 0) {\n * cellProperties.readOnly = true;\n * }\n *\n * return cellProperties;\n * }\n * });\n * ```\n *\n * In the above example we first set the `read-only` option for the entire grid. Then we make two exceptions of this rule:\n *\n * - We exclude the first column by passing `readOnly: false`, which in result makes it editable.\n * - We exclude the cell in the top left corner, just like we did it with the first column.\n *\n * To learn more about how to use cascading settings go to the [Setting Options](@/guides/getting-started/setting-options.md) page.\n *\n * ::: tip\n * In order for the data separation to work properly, make sure that each instance of Handsontable has a unique `id`.\n * :::\n */\n\n/* eslint-enable jsdoc/require-description-complete-sentence */\n\nexport default (function () {\n return {\n /**\n * License key for commercial version of Handsontable.\n *\n * @memberof Options#\n * @type {string}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * licenseKey: '00000-00000-00000-00000-00000',\n * // or\n * licenseKey: 'non-commercial-and-evaluation',\n * ```\n */\n licenseKey: void 0,\n\n /**\n * @description\n * Initial data source that will be bound to the data grid __by reference__ (editing data grid alters the data source).\n * Can be declared as an array of arrays or an array of objects.\n *\n * See [Understanding binding as reference](@/guides/getting-started/binding-to-data.md#understand-binding-as-a-reference).\n *\n * @memberof Options#\n * @type {Array[]|object[]}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // as an array of arrays\n * data: [\n * ['A', 'B', 'C'],\n * ['D', 'E', 'F'],\n * ['G', 'H', 'J']\n * ]\n *\n * // as an array of objects\n * data: [\n * {id: 1, name: 'Ted Right'},\n * {id: 2, name: 'Frank Honest'},\n * {id: 3, name: 'Joan Well'},\n * {id: 4, name: 'Gail Polite'},\n * {id: 5, name: 'Michael Fair'},\n * ]\n * ```\n */\n data: void 0,\n\n /**\n * @description\n * Defines the structure of a new row when data source is an array of objects.\n *\n * See [data-schema](@/guides/getting-started/binding-to-data.md#array-of-objects-with-custom-data-schema) for more options.\n *\n * @memberof Options#\n * @type {object}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // with data schema we can start with an empty table\n * data: null,\n * dataSchema: {id: null, name: {first: null, last: null}, address: null},\n * colHeaders: ['ID', 'First Name', 'Last Name', 'Address'],\n * columns: [\n * {data: 'id'},\n * {data: 'name.first'},\n * {data: 'name.last'},\n * {data: 'address'}\n * ],\n * startRows: 5,\n * minSpareRows: 1\n * ```\n */\n dataSchema: void 0,\n\n /**\n * Width of the grid. Can be a value or a function that returns a value.\n *\n * @memberof Options#\n * @type {number|string|Function}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // as a number\n * width: 500,\n *\n * // as a string\n * width: '75vw',\n *\n * // as a function\n * width: function() {\n * return 500;\n * },\n * ```\n */\n width: void 0,\n\n /**\n * Height of the grid. Can be a number or a function that returns a number.\n *\n * @memberof Options#\n * @type {number|string|Function}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // as a number\n * height: 500,\n *\n * // as a string\n * height: '75vh',\n *\n * // as a function\n * height: function() {\n * return 500;\n * },\n * ```\n */\n height: void 0,\n\n /**\n * @description\n * Initial number of rows.\n *\n * __Note:__ This option only has effect in Handsontable constructor and only if `data` option is not provided.\n *\n * @memberof Options#\n * @type {number}\n * @default 5\n * @category Core\n *\n * @example\n * ```js\n * // start with 15 empty rows\n * startRows: 15,\n * ```\n */\n startRows: 5,\n\n /**\n * @description\n * Initial number of columns.\n *\n * __Note:__ This option only has effect in Handsontable constructor and only if `data` option is not provided.\n *\n * @memberof Options#\n * @type {number}\n * @default 5\n * @category Core\n *\n * @example\n * ```js\n * // start with 15 empty columns\n * startCols: 15,\n * ```\n */\n startCols: 5,\n\n /**\n * Setting `true` or `false` will enable or disable the default row headers (1, 2, 3).\n * You can also define an array `['One', 'Two', 'Three', ...]` or a function to define the headers.\n * If a function is set the index of the row is passed as a parameter.\n *\n * @memberof Options#\n * @type {boolean|string[]|Function}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // as a boolean\n * rowHeaders: true,\n *\n * // as an array\n * rowHeaders: ['1', '2', '3'],\n *\n * // as a function\n * rowHeaders: function(index) {\n * return index + ': AB';\n * },\n * ```\n */\n rowHeaders: void 0,\n\n /**\n * Setting `true` or `false` will enable or disable the default column headers (A, B, C).\n * You can also define an array `['One', 'Two', 'Three', ...]` or a function to define the headers.\n * If a function is set, then the index of the column is passed as a parameter.\n *\n * @memberof Options#\n * @type {boolean|string[]|Function}\n * @default null\n * @category Core\n *\n * @example\n * ```js\n * // as a boolean\n * colHeaders: true,\n *\n * // as an array\n * colHeaders: ['A', 'B', 'C'],\n *\n * // as a function\n * colHeaders: function(index) {\n * return index + ': AB';\n * },\n * ```\n */\n colHeaders: null,\n\n /**\n * Defines column widths in pixels. Accepts number, string (that will be converted to a number), array of numbers\n * (if you want to define column width separately for each column) or a function (if you want to set column width\n * dynamically on each render).\n *\n * The default width for columns in the rendering process equals 50px.\n *\n * An `undefined` value is for detection in {@link Hooks#modifyColWidth} hook if plugin or setting changed the default size.\n *\n * Note: This option will forcely disable {@link auto-column-size AutoColumnSize} plugin.\n *\n * @memberof Options#\n * @type {number|number[]|string|string[]|Array|Function}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // as a number, for each column.\n * colWidths: 100,\n *\n * // as a string, for each column.\n * colWidths: '100px',\n *\n * // as an array, based on visual indexes. Unspecified columns have a default width.\n * colWidths: [100, 120, undefined, 90],\n *\n * // as a function, based on visual indexes.\n * colWidths: function(index) {\n * return index * 10;\n * },\n * ```\n */\n colWidths: void 0,\n\n /**\n * Defines row heights in pixels. Accepts numbers, strings (that will be converted into a number), array of numbers\n * (if you want to define row height separately for each row) or a function (if you want to set row height dynamically\n * on each render).\n *\n * If the {@link manual-row-resize ManualRowResize} or {@link auto-row-size AutoRowSize} plugins are enabled, this is also the minimum height that can\n * be set via either of those two plugins.\n *\n * The default height for rows in the rendering process equals 23px.\n * Height should be equal or greater than 23px. Table is rendered incorrectly if height is less than 23px.\n *\n * An `undefined` value is for detection in {@link Hooks#modifyRowHeight} hook if plugin or setting changed the default size.\n *\n * @memberof Options#\n * @type {number|number[]|string|string[]|Array|Function}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // as a number, the same for all rows\n * rowHeights: 100,\n *\n * // as a string, the same for all row\n * rowHeights: '100px',\n *\n * // as an array, based on visual indexes. The rest of the rows have a default height\n * rowHeights: [100, 120, 90],\n *\n * // as a function, based on visual indexes\n * rowHeights: function(index) {\n * return index * 10;\n * },\n * ```\n */\n rowHeights: void 0,\n\n /**\n * @description\n * Defines the cell properties and data binding for certain columns.\n *\n * __Note:__ Using this option sets a fixed number of columns (options `startCols`, `minCols`, `maxCols` will be ignored).\n *\n * See [documentation -> datasources.html](@/guides/getting-started/binding-to-data.md#array-of-objects-with-column-mapping) for examples.\n *\n * @memberof Options#\n * @type {object[]|Function}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // as an array of objects\n * // order of the objects in array is representation of physical indexes.\n * columns: [\n * {\n * // column options for the first column\n * type: 'numeric',\n * numericFormat: {\n * pattern: '0,0.00 $'\n * }\n * },\n * {\n * // column options for the second column\n * type: 'text',\n * readOnly: true\n * }\n * ],\n *\n * // or as a function, based on physical indexes\n * columns: function(index) {\n * return {\n * type: index > 0 ? 'numeric' : 'text',\n * readOnly: index < 1\n * }\n * }\n * ```\n */\n columns: void 0,\n\n /**\n * @description\n * Defines the cell properties for given `row`, `col`, `prop` coordinates. Any constructor or column option may be\n * overwritten for a particular cell (row/column combination) using the `cells` property in the Handsontable constructor.\n *\n * __Note:__ Parameters `row` and `col` always represent __physical indexes__. Example below show how to execute\n * operations based on the __visual__ representation of Handsontable.\n *\n * Possible values of `prop`:\n * - property name for column's data source object, when dataset is an [array of objects](@/guides/getting-started/binding-to-data.md#array-of-objects)\n * - the same number as `col`, when dataset is an [array of arrays](@/guides/getting-started/binding-to-data.md#array-of-arrays).\n *\n * @memberof Options#\n * @type {Function}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * cells: function(row, column, prop) {\n * const cellProperties = { readOnly: false };\n * const visualRowIndex = this.instance.toVisualRow(row);\n * const visualColIndex = this.instance.toVisualColumn(column);\n *\n * if (visualRowIndex === 0 && visualColIndex === 0) {\n * cellProperties.readOnly = true;\n * }\n *\n * return cellProperties;\n * },\n * ```\n */\n cells: void 0,\n\n /**\n * Any constructor or column option may be overwritten for a particular cell (row/column combination), using `cell`\n * array passed to the Handsontable constructor.\n *\n * @memberof Options#\n * @type {Array[]}\n * @default []\n * @category Core\n *\n * @example\n * ```js\n * // make cell with coordinates (0, 0) read only\n * cell: [\n * {\n * row: 0,\n * col: 0,\n * readOnly: true\n * }\n * ],\n * ```\n */\n cell: [],\n\n /**\n * @description\n * If `true`, enables the {@link comments Comments} plugin, which enables an option to apply cell comments through the context menu\n * (configurable with context menu keys `commentsAddEdit`, `commentsRemove`).\n *\n * To initialize Handsontable with predefined comments, provide cell coordinates and comment text values in a form of\n * an array.\n *\n * See [Comments](@/guides/cell-features/comments.md) demo for examples.\n *\n * @memberof Options#\n * @type {boolean|object[]}\n * @default false\n * @category Comments\n *\n * @example\n * ```js\n * // enable comments plugin\n * comments: true,\n *\n * // or an object with extra predefined plugin config:\n *\n * comments: {\n * displayDelay: 1000\n * }\n *\n * // or\n * // enable comments plugin and add predefined comments\n * const hot = new Handsontable(document.getElementById('example'), {\n * data: getData(),\n * comments: true,\n * cell: [\n * { row: 1, col: 1, comment: { value: 'Foo' } },\n * { row: 2, col: 2, comment: { value: 'Bar' } }\n * ]\n * });\n * ```\n */\n comments: false,\n\n /**\n * @description\n * If `true`, enables the {@link custom-borders CustomBorders} plugin, which enables an option to apply custom borders through the context\n * menu (configurable with context menu key `borders`). To initialize Handsontable with predefined custom borders,\n * provide cell coordinates and border styles in a form of an array.\n *\n * See [Custom Borders](@/guides/cell-features/formatting-cells.md#custom-cell-borders) demo for examples.\n *\n * @memberof Options#\n * @type {boolean|object[]}\n * @default false\n * @category CustomBorders\n *\n * @example\n * ```js\n * // enable custom borders\n * customBorders: true,\n *\n * // or\n * // enable custom borders and start with predefined left border\n * customBorders: [\n * {\n * range: {\n * from: {\n * row: 1,\n * col: 1\n * },\n * to: {\n * row: 3,\n * col: 4\n * }\n * },\n * left: {\n * width: 2,\n * color: 'red'\n * },\n * right: {},\n * top: {},\n * bottom: {}\n * }\n * ],\n *\n * // or\n * customBorders: [\n * {\n * row: 2,\n * col: 2,\n * left: {\n * width: 2,\n * color: 'red'\n * },\n * right: {\n * width: 1,\n * color: 'green'\n * },\n * top: '',\n * bottom: ''\n * }\n * ],\n * ```\n */\n customBorders: false,\n\n /**\n * Minimum number of rows. At least that number of rows will be created during initialization.\n *\n * @memberof Options#\n * @type {number}\n * @default 0\n * @category Core\n *\n * @example\n * ```js\n * // set minimum table size to 10 rows\n * minRows: 10,\n * ```\n */\n minRows: 0,\n\n /**\n * Minimum number of columns. At least that number of columns will be created during initialization.\n * Works only with an array data source. When data source in an object, you can only have as many columns\n * as defined in the first data row, data schema, or the `columns` setting.\n *\n * @memberof Options#\n * @type {number}\n * @default 0\n * @category Core\n *\n * @example\n * ```js\n * // set minimum table size to 10 columns\n * minCols: 10,\n * ```\n */\n minCols: 0,\n\n /**\n * Maximum number of rows. If set to a value lower than the initial row count, the data will be trimmed to the provided\n * value as the number of rows.\n *\n * @memberof Options#\n * @type {number}\n * @default Infinity\n * @category Core\n *\n * @example\n * ```js\n * // limit table size to maximum 300 rows\n * maxRows: 300,\n * ```\n */\n maxRows: Infinity,\n\n /**\n * Maximum number of cols. If set to a value lower than the initial col count, the data will be trimmed to the provided\n * value as the number of cols.\n *\n * @memberof Options#\n * @type {number}\n * @default Infinity\n * @category Core\n *\n * @example\n * ```js\n * // limit table size to maximum 300 columns\n * maxCols: 300,\n * ```\n */\n maxCols: Infinity,\n\n /**\n * When set to 1 (or more), Handsontable will add a new row at the end of grid if there are no more empty rows.\n * (unless the number of rows exceeds the one set in the `maxRows` property).\n *\n * @memberof Options#\n * @type {number}\n * @default 0\n * @category Core\n *\n * @example\n * ```js\n * // always add 3 empty rows at the table end\n * minSpareRows: 3,\n * ```\n */\n minSpareRows: 0,\n\n /**\n * When set to 1 (or more), Handsontable will add a new column at the end of grid if there are no more empty columns.\n * (unless the number of rows exceeds the one set in the `maxCols` property).\n *\n * @memberof Options#\n * @type {number}\n * @default 0\n * @category Core\n *\n * @example\n * ```js\n * // always add 3 empty columns at the table end\n * minSpareCols: 3,\n * ```\n */\n minSpareCols: 0,\n\n /**\n * If set to `false`, there won't be an option to insert new rows in the Context Menu.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * // hide \"Insert row above\" and \"Insert row below\" options from the Context Menu\n * allowInsertRow: false,\n * ```\n */\n allowInsertRow: true,\n\n /**\n * If set to `false`, there won't be an option to insert new columns in the Context Menu.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * // hide \"Insert column left\" and \"Insert column right\" options from the Context Menu\n * allowInsertColumn: false,\n * ```\n */\n allowInsertColumn: true,\n\n /**\n * If set to `false`, there won't be an option to remove rows in the Context Menu.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * // hide \"Remove row\" option from the Context Menu\n * allowRemoveRow: false,\n * ```\n */\n allowRemoveRow: true,\n\n /**\n * If set to `false`, there won't be an option to remove columns in the Context Menu.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * // hide \"Remove column\" option from the Context Menu\n * allowRemoveColumn: false,\n * ```\n */\n allowRemoveColumn: true,\n\n /**\n * @description\n * Defines how the table selection reacts. The selection support three different behaviors defined as:\n * * `'single'` Only a single cell can be selected.\n * * `'range'` Multiple cells within a single range can be selected.\n * * `'multiple'` Multiple ranges of cells can be selected.\n *\n * To see how to interact with selection by getting selected data or change styles of the selected cells go to\n * [Selecting Ranges](@/guides/cell-features/selection.md).\n *\n * @memberof Options#\n * @type {string}\n * @default 'multiple'\n * @category Core\n *\n * @example\n * ```js\n * // only one cell can be selected at a time\n * selectionMode: 'single',\n * ```\n */\n selectionMode: 'multiple',\n\n /**\n * Enables the fill handle (drag-down and copy-down) functionality, which shows a small rectangle in bottom\n * right corner of the selected area, that let's you expand values to the adjacent cells.\n *\n * Setting to `true` enables the fillHandle plugin. Possible values: `true` (to enable in all directions),\n * `'vertical'` or `'horizontal'` (to enable in one direction), `false` (to disable completely), an object with\n * options: `autoInsertRow`, `direction`.\n *\n * If `autoInsertRow` option is `true`, fill-handler will create new rows till it reaches the last row.\n * It is enabled by default.\n *\n * @memberof Options#\n * @type {boolean|string|object}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * // enable plugin in all directions and with autoInsertRow as true\n * fillHandle: true,\n *\n * // or\n * // enable plugin in vertical direction and with autoInsertRow as true\n * fillHandle: 'vertical',\n *\n * // or\n * fillHandle: {\n * // enable plugin in both directions and with autoInsertRow as false\n * autoInsertRow: false,\n * },\n *\n * // or\n * fillHandle: {\n * // enable plugin in vertical direction and with autoInsertRow as false\n * autoInsertRow: false,\n * direction: 'vertical'\n * },\n * ```\n */\n fillHandle: {\n autoInsertRow: false\n },\n\n /**\n * Allows to specify the number of fixed (or *frozen*) rows at the top of the table.\n *\n * @memberof Options#\n * @type {number}\n * @default 0\n * @category Core\n *\n * @example\n * ```js\n * // freeze the first 3 rows of the table.\n * fixedRowsTop: 3,\n * ```\n */\n fixedRowsTop: 0,\n\n /**\n * Allows to specify the number of fixed (or *frozen*) rows at the bottom of the table.\n *\n * @memberof Options#\n * @type {number}\n * @default 0\n * @category Core\n *\n * @example\n * ```js\n * // freeze the last 3 rows of the table.\n * fixedRowsBottom: 3,\n * ```\n */\n fixedRowsBottom: 0,\n\n /**\n * Allows to specify the number of fixed (or *frozen*) columns on the left of the table.\n *\n * @memberof Options#\n * @type {number}\n * @default 0\n * @category Core\n *\n * @example\n * ```js\n * // freeze first 3 columns of the table.\n * fixedColumnsLeft: 3,\n * ```\n */\n fixedColumnsLeft: 0,\n\n /**\n * If `true`, mouse click outside the grid will deselect the current selection. Can be a function that takes the\n * click event target and returns a boolean.\n *\n * @memberof Options#\n * @type {boolean|Function}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * // don't clear current selection when mouse click was outside the grid\n * outsideClickDeselects: false,\n *\n * // or\n * outsideClickDeselects: function(event) {\n * return false;\n * }\n * ```\n */\n outsideClickDeselects: true,\n\n /**\n * If `true`, ENTER begins editing mode (like in Google Docs). If `false`, ENTER moves to next\n * row (like Excel) and adds a new row if necessary. TAB adds new column if necessary.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * enterBeginsEditing: false,\n * ```\n */\n enterBeginsEditing: true,\n\n /**\n * Defines the cursor movement after ENTER was pressed (SHIFT + ENTER uses a negative vector). Can\n * be an object or a function that returns an object. The event argument passed to the function is a DOM Event object\n * received after the ENTER key has been pressed. This event object can be used to check whether user pressed\n * ENTER or SHIFT + ENTER.\n *\n * @memberof Options#\n * @type {object|Function}\n * @default {col: 0, row: 1}\n * @category Core\n *\n * @example\n * ```js\n * // move selection diagonal by 1 cell in x and y axis\n * enterMoves: {col: 1, row: 1},\n * // or as a function\n * enterMoves: function(event) {\n * return {col: 1, row: 1};\n * },\n * ```\n */\n enterMoves: {\n col: 0,\n row: 1\n },\n\n /**\n * Defines the cursor movement after TAB is pressed (SHIFT + TAB uses a negative vector). Can\n * be an object or a function that returns an object. The event argument passed to the function is a DOM Event object\n * received after the TAB key has been pressed. This event object can be used to check whether user pressed\n * TAB or SHIFT + TAB.\n *\n * @memberof Options#\n * @type {object|Function}\n * @default {row: 0, col: 1}\n * @category Core\n *\n * @example\n * ```js\n * // move selection 2 cells away after TAB pressed.\n * tabMoves: {row: 2, col: 2},\n * // or as a function\n * tabMoves: function(event) {\n * return {row: 2, col: 2};\n * },\n * ```\n */\n tabMoves: {\n row: 0,\n col: 1\n },\n\n /**\n * If `true`, pressing TAB or right arrow in the last column will move to first column in next row.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * // stop TAB key navigation on the last column\n * autoWrapRow: false,\n * ```\n */\n autoWrapRow: true,\n\n /**\n * If `true`, pressing ENTER or down arrow in the last row will move to the first row in the next column.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * // stop ENTER key navigation on the last row\n * autoWrapCol: false,\n * ```\n */\n autoWrapCol: true,\n\n /**\n * @description\n * Turns on saving the state of column sorting, column positions and column sizes in local storage.\n *\n * You can save any sort of data in local storage to preserve table state between page reloads. In order to enable\n * data storage mechanism, `persistentState` option must be set to `true` (you can set it either during Handsontable\n * initialization or using the `updateSettings` method). When `persistentState` is enabled it exposes 3 hooks:\n *\n * __persistentStateSave__ (key: String, value: Mixed).\n *\n * * Saves value under given key in browser local storage.\n *\n * __persistentStateLoad__ (key: String, valuePlaceholder: Object).\n *\n * * Loads `value`, saved under given key, form browser local storage. The loaded `value` will be saved in\n * `valuePlaceholder.value` (this is due to specific behaviour of `Hooks.run()` method). If no value have\n * been saved under key `valuePlaceholder.value` will be `undefined`.\n *\n * __persistentStateReset__ (key: String).\n *\n * * Clears the value saved under `key`. If no `key` is given, all values associated with table will be cleared.\n *\n * __Note:__ The main reason behind using `persistentState` hooks rather than regular LocalStorage API is that it\n * ensures separation of data stored by multiple Handsontable instances. In other words, if you have two (or more)\n * instances of Handsontable on one page, data saved by one instance won't be accessible by the second instance.\n * Those two instances can store data under the same key and no data would be overwritten.\n *\n * __Important:__ In order for the data separation to work properly, make sure that each instance of Handsontable has a unique `id`.\n *\n * @memberof Options#\n * @type {boolean}\n * @default false\n * @category PersistentState\n *\n * @example\n * ```js\n * // enable the persistent state plugin\n * persistentState: true,\n * ```\n */\n persistentState: void 0,\n\n /**\n * Class name for all visible rows in the current selection.\n *\n * @memberof Options#\n * @type {string}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // This will add a 'currentRow' class name to appropriate table cells.\n * currentRowClassName: 'currentRow',\n * ```\n */\n currentRowClassName: void 0,\n\n /**\n * Class name for all visible columns in the current selection.\n *\n * @memberof Options#\n * @type {string}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // This will add a 'currentColumn' class name to appropriate table cells.\n * currentColClassName: 'currentColumn',\n * ```\n */\n currentColClassName: void 0,\n\n /**\n * Class name for all visible headers in current selection.\n *\n * @memberof Options#\n * @type {string}\n * @default 'ht__highlight'\n * @category Core\n *\n * @example\n * ```js\n * // This will add a 'ht__highlight' class name to appropriate table headers.\n * currentHeaderClassName: 'ht__highlight',\n * ```\n */\n currentHeaderClassName: 'ht__highlight',\n\n /**\n * Class name for all active headers in selections. The header will be marked with this class name\n * only when a whole column or row will be selected.\n *\n * @memberof Options#\n * @type {string}\n * @since 0.38.2\n * @default 'ht__active_highlight'\n * @category Core\n *\n * @example\n * ```js\n * // this will add a 'ht__active_highlight' class name to appropriate table headers.\n * activeHeaderClassName: 'ht__active_highlight',\n * ```\n */\n activeHeaderClassName: 'ht__active_highlight',\n\n /**\n * Class name for the current element.\n * The interpretation depends on the level on which this option is provided in the [cascading configuration](@/guides/getting-started/setting-options.md).\n * If `className` is provided on the first (constructor) level, it is the applied to the Handsontable container.\n * If `className` is provided on the second (`column`) or the third (`cell` or `cells`) level, it is applied to the table cell.\n *\n * @memberof Options#\n * @type {string|string[]}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // can be set as a string\n * className: 'your__class--name',\n *\n * // or as an array of strings\n * className: ['first-class-name', 'second-class-name'],\n * ```\n */\n className: void 0,\n\n /**\n * Class name for all tables inside container element.\n *\n * @memberof Options#\n * @type {string|string[]}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // set custom class for table element\n * tableClassName: 'your__class--name',\n *\n * // or\n * tableClassName: ['first-class-name', 'second-class-name'],\n * ```\n */\n tableClassName: void 0,\n\n /**\n * @description\n * Defines how the columns react, when the declared table width is different than the calculated sum of all column widths.\n * [See more](@/guides/columns/column-width.md#column-stretching) mode. Possible values:\n * * `'none'` Disable stretching\n * * `'last'` Stretch only the last column\n * * `'all'` Stretch all the columns evenly.\n *\n * @memberof Options#\n * @type {string}\n * @default 'none'\n * @category Core\n *\n * @example\n * ```js\n * // fit table to the container\n * stretchH: 'all',\n * ```\n */\n stretchH: 'none',\n\n /**\n * Overwrites the default `isEmptyRow` method, which checks if row at the provided index is empty.\n *\n * @memberof Options#\n * @type {Function}\n * @param {number} row Visual row index.\n * @returns {boolean}\n * @category Core\n *\n * @example\n * ```js\n * // define custom checks for empty row\n * isEmptyRow: function(row) {\n * ...\n * },\n * ```\n */\n isEmptyRow: function isEmptyRow(row) {\n var col;\n var colLen;\n var value;\n var meta;\n\n for (col = 0, colLen = this.countCols(); col < colLen; col++) {\n value = this.getDataAtCell(row, col);\n\n if (isEmpty(value) === false) {\n if (_typeof(value) === 'object') {\n meta = this.getCellMeta(row, col);\n return isObjectEqual(this.getSchema()[meta.prop], value);\n }\n\n return false;\n }\n }\n\n return true;\n },\n\n /**\n * Overwrites the default `isEmptyCol` method, which checks if column at the provided index is empty.\n *\n * @memberof Options#\n * @type {Function}\n * @param {number} col Visual column index.\n * @returns {boolean}\n * @category Core\n *\n * @example\n * ```js\n * // define custom checks for empty column\n * isEmptyCol: function(column) {\n * return false;\n * },\n * ```\n */\n isEmptyCol: function isEmptyCol(col) {\n var row;\n var rowLen;\n var value;\n\n for (row = 0, rowLen = this.countRows(); row < rowLen; row++) {\n value = this.getDataAtCell(row, col);\n\n if (isEmpty(value) === false) {\n return false;\n }\n }\n\n return true;\n },\n\n /**\n * When set to `true`, the table is re-rendered when it is detected that it was made visible in DOM.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * // don't rerender the table on visibility changes\n * observeDOMVisibility: false,\n * ```\n */\n observeDOMVisibility: true,\n\n /**\n * If set to `true`, Handsontable will accept values that were marked as invalid by the cell `validator`. It will\n * result with *invalid* cells being treated as *valid* (will save the *invalid* value into the Handsontable data source).\n * If set to `false`, Handsontable will *not* accept the invalid values and won't allow the user to close the editor.\n * This option will be particularly useful when used with the Autocomplete's `strict` mode.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * // don't save the invalid values\n * allowInvalid: false,\n * ```\n */\n allowInvalid: true,\n\n /**\n * If set to `true`, Handsontable will accept values that are empty (`null`, `undefined` or `''`). If set\n * to `false`, Handsontable will *not* accept the empty values and mark cell as invalid.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * // allow empty values for all cells (whole table)\n * allowEmpty: true,\n *\n * // or\n * columns: [\n * {\n * data: 'date',\n * dateFormat: 'DD/MM/YYYY',\n * // allow empty values only for the 'date' column\n * allowEmpty: true\n * }\n * ],\n * ```\n */\n allowEmpty: true,\n\n /**\n * CSS class name for cells that did not pass validation.\n *\n * @memberof Options#\n * @type {string}\n * @default 'htInvalid'\n * @category Core\n *\n * @example\n * ```js\n * // set custom validation error class\n * invalidCellClassName: 'highlight--error',\n * ```\n */\n invalidCellClassName: 'htInvalid',\n\n /**\n * When set to an non-empty string, displayed as the cell content for empty cells. If a value of a different type is provided,\n * it will be stringified and applied as a string.\n *\n * @memberof Options#\n * @type {string}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // add custom placeholder content to empty cells\n * placeholder: 'Empty Cell',\n * ```\n */\n placeholder: void 0,\n\n /**\n * CSS class name for cells that have a placeholder in use.\n *\n * @memberof Options#\n * @type {string}\n * @default 'htPlaceholder'\n * @category Core\n *\n * @example\n * ```js\n * // set custom placeholder class\n * placeholderCellClassName: 'has-placeholder',\n * ```\n */\n placeholderCellClassName: 'htPlaceholder',\n\n /**\n * CSS class name for read-only cells.\n *\n * @memberof Options#\n * @type {string}\n * @default 'htDimmed'\n * @category Core\n *\n * @example\n * ```js\n * // set custom read-only class\n * readOnlyCellClassName: 'is-readOnly',\n * ```\n */\n readOnlyCellClassName: 'htDimmed',\n\n /* eslint-disable jsdoc/require-description-complete-sentence */\n\n /**\n * @description\n * If a string is provided, it may be one of the following predefined values:\n * * `autocomplete`,\n * * `checkbox`,\n * * `html`,\n * * `numeric`,\n * * `password`.\n * * `text`.\n *\n * Or you can [register](@/guides/cell-functions/cell-renderer.md) the custom renderer under specified name and use its name as an alias in your\n * configuration.\n *\n * If a function is provided, it will receive the following arguments:\n * ```js\n * function(instance, TD, row, col, prop, value, cellProperties) {}\n * ```\n *\n * You can read more about custom renderes [in the documentation](@/guides/cell-functions/cell-renderer.md).\n *\n * @memberof Options#\n * @type {string|Function}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // register custom renderer\n * Handsontable.renderers.registerRenderer('my.renderer', function(instance, TD, row, col, prop, value, cellProperties) {\n * TD.innerHTML = value;\n * });\n *\n * // use it for selected column:\n * columns: [\n * {\n * // as a string with the name of build in renderer\n * renderer: 'autocomplete',\n * editor: 'select'\n * },\n * {\n * // as an alias to custom renderer registered above\n * renderer: 'my.renderer'\n * },\n * {\n * // renderer as custom function\n * renderer: function(hotInstance, TD, row, col, prop, value, cellProperties) {\n * TD.style.color = 'blue';\n * TD.innerHTML = value;\n * }\n * }\n * ],\n * ```\n */\n renderer: void 0,\n\n /* eslint-enable jsdoc/require-description-complete-sentence */\n\n /**\n * CSS class name added to the commented cells.\n *\n * @memberof Options#\n * @type {string}\n * @default 'htCommentCell'\n * @category Core\n *\n * @example\n * ```js\n * // set custom class for commented cells\n * commentedCellClassName: 'has-comment',\n * ```\n */\n commentedCellClassName: 'htCommentCell',\n\n /**\n * If set to `true`, it enables the browser's native selection of a fragment of the text within a single cell, between\n * adjacent cells or in a whole table. If set to `'cell'`, it enables the possibility of selecting a fragment of the\n * text within a single cell's body.\n *\n * @memberof Options#\n * @type {boolean|string}\n * @default false\n * @category Core\n *\n * @example\n * ```js\n * // enable text selection within table\n * fragmentSelection: true,\n *\n * // or\n * // enable text selection within cells only\n * fragmentSelection: 'cell',\n * ```\n */\n fragmentSelection: false,\n\n /**\n * @description\n * Makes cell, column or comment [read only](@/guides/cell-features/disabled-cells.md#read-only-columns).\n *\n * @memberof Options#\n * @type {boolean}\n * @default false\n * @category Core\n *\n * @example\n * ```js\n * // set as read only\n * readOnly: true,\n * ```\n */\n readOnly: false,\n\n /**\n * @description\n * When added to a `column` property, it skips the column on paste and pastes the data on the next column to the right.\n *\n * @memberof Options#\n * @type {boolean}\n * @default false\n * @category Core\n *\n * @example\n * ```js\n * columns: [\n * {\n * // don't paste data to this column\n * skipColumnOnPaste: true\n * }\n * ],\n * ```\n */\n skipColumnOnPaste: false,\n\n /**\n * @description\n * When added to a cell property, it skips the row on paste and pastes the data on the following row.\n *\n * @memberof Options#\n * @type {boolean}\n * @default false\n * @category Core\n *\n * @example\n * ```js\n * cells: function(row, column) {\n * const cellProperties = {};\n *\n * // don't paste data to the second row\n * if (row === 1) {\n * cellProperties.skipRowOnPaste = true;\n * }\n *\n * return cellProperties;\n * }\n * ```\n */\n skipRowOnPaste: false,\n\n /**\n * @description\n * Setting to `true` enables the {@link search Search} plugin (see [demo](@/guides/accessories-and-menus/searching-values.md)).\n *\n * @memberof Options#\n * @type {boolean}\n * @default false\n * @category Search\n *\n * @example\n * ```js\n * // enable search plugin\n * search: true,\n *\n * // or\n * // as an object with detailed configuration\n * search: {\n * searchResultClass: 'customClass',\n * queryMethod: function(queryStr, value) {\n * ...\n * },\n * callback: function(instance, row, column, value, result) {\n * ...\n * }\n * }\n * ```\n */\n search: false,\n\n /**\n * @description\n * Shortcut to define the combination of the cell renderer, editor and validator for the column, cell or whole table.\n *\n * Possible values:\n * * [autocomplete](@/guides/cell-types/autocomplete-cell-type.md)\n * * [checkbox](@/guides/cell-types/checkbox-cell-type.md)\n * * [date](@/guides/cell-types/date-cell-type.md)\n * * [dropdown](@/guides/cell-types/dropdown-cell-type.md)\n * * [handsontable](@/guides/cell-types/handsontable-cell-type.md)\n * * [numeric](@/guides/cell-types/numeric-cell-type.md)\n * * [password](@/guides/cell-types/password-cell-type.md)\n * * text\n * * [time](@/guides/cell-types/time-cell-type.md).\n *\n * Or you can register the custom cell type under specified name and use\n * its name as an alias in your configuration.\n *\n * @memberof Options#\n * @type {string}\n * @default 'text'\n * @category Core\n *\n * @example\n * ```js\n * // register custom cell type:\n * Handsontable.cellTypes.registerCellType('my.type', {\n * editor: MyEditorClass,\n * renderer: function(hot, td, row, col, prop, value, cellProperties) {\n * td.innerHTML = value;\n * },\n * validator: function(value, callback) {\n * callback(value === 'foo' ? true : false);\n * }\n * });\n *\n * // use it in column settings:\n * columns: [\n * {\n * type: 'text'\n * },\n * {\n * // an alias to custom type\n * type: 'my.type'\n * },\n * {\n * type: 'checkbox'\n * }\n * ],\n * ```\n */\n type: 'text',\n\n /**\n * @description\n * Makes a cell copyable (pressing CTRL + C on your keyboard moves its value to system clipboard).\n *\n * __Note:__ this setting is `false` by default for cells with type `password`.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * cells: [\n * {\n * cell: 0,\n * row: 0,\n * // cell with coordinates (0, 0) can't be copied\n * copyable: false,\n * }\n * ],\n * ```\n */\n copyable: true,\n\n /**\n * Defines the editor for the table/column/cell.\n *\n * If a string is provided, it may be one of the following predefined values:\n * * [autocomplete](@/guides/cell-types/autocomplete-cell-type.md)\n * * [checkbox](@/guides/cell-types/checkbox-cell-type.md)\n * * [date](@/guides/cell-types/date-cell-type.md)\n * * [dropdown](@/guides/cell-types/dropdown-cell-type.md)\n * * [handsontable](@/guides/cell-types/handsontable-cell-type.md)\n * * mobile\n * * [password](@/guides/cell-types/password-cell-type.md)\n * * [select](@/guides/cell-types/select-cell-type.md)\n * * text.\n *\n * Or you can [register](@/guides/cell-functions/cell-editor.md#registering-an-editor) the custom editor under specified name and use its name as an alias in your\n * configuration.\n *\n * To disable cell editing completely set `editor` property to `false`.\n *\n * @memberof Options#\n * @type {string|Function|boolean}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * columns: [\n * {\n * // set editor for the first column\n * editor: 'select'\n * },\n * {\n * // disable editor for the second column\n * editor: false\n * }\n * ],\n * ```\n */\n editor: void 0,\n\n /**\n * Control number of choices for the autocomplete (or dropdown) typed cells. After exceeding it, a scrollbar for the\n * dropdown list of choices will appear.\n *\n * @memberof Options#\n * @type {number}\n * @default 10\n * @category Core\n *\n * @example\n * ```js\n * columns: [\n * {\n * type: 'autocomplete',\n * // set autocomplete options list height\n * visibleRows: 15,\n * }\n * ],\n * ```\n */\n visibleRows: 10,\n\n /**\n * Makes autocomplete or dropdown width the same as the edited cell width. If `false` then editor will be scaled\n * according to its content.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * columns: [\n * {\n * type: 'autocomplete',\n * // don't trim dropdown width with column width\n * trimDropdown: false,\n * }\n * ],\n * ```\n */\n trimDropdown: true,\n\n /**\n * When set to `true`, the text of the cell content is wrapped if it does not fit in the fixed column width.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * colWidths: 100,\n * columns: [\n * {\n * // fixed column width is set but don't wrap the content\n * wordWrap: false,\n * }\n * ],\n * ```\n */\n wordWrap: true,\n\n /**\n * CSS class name added to cells with cell meta `wordWrap: false`.\n *\n * @memberof Options#\n * @type {string}\n * @default 'htNoWrap'\n * @category Core\n *\n * @example\n * ```js\n * // set custom class for cells which content won't be wrapped\n * noWordWrapClassName: 'is-noWrapCell',\n * ```\n */\n noWordWrapClassName: 'htNoWrap',\n\n /**\n * @description\n * Defines if the right-click context menu should be enabled. Context menu allows to create new row or column at any\n * place in the grid among [other features](@/guides/accessories-and-menus/context-menu.md).\n * Possible values:\n * * `true` (to enable default options),\n * * `false` (to disable completely)\n * * an array of [predefined options](@/guides/accessories-and-menus/context-menu.md#context-menu-with-specific-options),\n * * an object [with defined structure](@/guides/accessories-and-menus/context-menu.md#context-menu-with-fully-custom-configuration).\n *\n * If the value is an object, you can also customize the options with:\n * * `disableSelection` - a `boolean`, if set to true it prevents mouseover from highlighting the item for selection\n * * `isCommand` - a `boolean`, if set to false it prevents clicks from executing the command and closing the menu.\n *\n * See [the context menu demo](@/guides/accessories-and-menus/context-menu.md) for examples.\n *\n * @memberof Options#\n * @type {boolean|string[]|object}\n * @default undefined\n * @category ContextMenu\n *\n * @example\n * ```js\n * // as a boolean\n * contextMenu: true,\n *\n * // as an array\n * contextMenu: ['row_above', 'row_below', '---------', 'undo', 'redo'],\n *\n * // as an object (`name` attribute is required in the custom keys)\n * contextMenu: {\n * items: {\n * \"option1\": {\n * name: \"option1\"\n * },\n * \"option2\": {\n * name: \"option2\",\n * submenu: {\n * items: [\n * {\n * key: \"option2:suboption1\",\n * name: \"option2:suboption1\",\n * callback: function(key, options) {\n * ...\n * }\n * },\n * ...\n * ]\n * }\n * }\n * }\n * },\n * ```\n */\n contextMenu: void 0,\n\n /**\n * Disables or enables the copy/paste functionality.\n *\n * @memberof Options#\n * @type {object|boolean}\n * @default true\n * @category CopyPaste\n *\n * @example\n * ```js\n * // disable copy and paste\n * copyPaste: false,\n *\n * // enable copy and paste with custom configuration\n * copyPaste: {\n * columnsLimit: 25,\n * rowsLimit: 50,\n * pasteMode: 'shift_down',\n * uiContainer: document.body,\n * },\n * ```\n */\n copyPaste: true,\n\n /**\n * If `true`, undo/redo functionality is enabled.\n * Note: `undefined` by default but it acts as enabled.\n * You need to switch it to `false` to disable it completely.\n *\n * @memberof Options#\n * @type {boolean}\n * @default undefined\n * @category UndoRedo\n *\n * @example\n * ```js\n * // enable undo and redo\n * undo: true,\n * ```\n */\n undo: void 0,\n\n /**\n * @description\n * Turns on [Column sorting](@/guides/rows/row-sorting.md). Can be either a boolean (`true` / `false`) or an object with a declared sorting options:\n * * `initialConfig` - Object with predefined keys:\n * * `column` - sorted column\n * * `sortOrder` - order in which column will be sorted\n * * `'asc'` = ascending\n * * `'desc'` = descending\n * * `indicator` - display status for sorting order indicator (an arrow icon in the column header, specifying the sorting order).\n * * `true` = show sort indicator for sorted columns\n * * `false` = don't show sort indicator for sorted columns\n * * `headerAction` - allow to click on the headers to sort\n * * `true` = turn on possibility to click on the headers to sort\n * * `false` = turn off possibility to click on the headers to sort\n * * `sortEmptyCells` - how empty values ([more information here](options#allowempty)) should be handled\n * * `true` = the table sorts empty cells\n * * `false` = the table moves all empty cells to the end of the table\n * * `compareFunctionFactory` - curry function returning compare function; compare function should work in the same way as function which is handled by native `Array.sort` method); please take a look at below examples for more information.\n *\n * @memberof Options#\n * @type {boolean|object}\n * @default undefined\n * @category ColumnSorting\n *\n * @example\n * ```js\n * // as boolean\n * columnSorting: true\n *\n * // as an object with initial sort config (sort ascending for column at index 1)\n * columnSorting: {\n * initialConfig: {\n * column: 1,\n * sortOrder: 'asc'\n * }\n * }\n *\n * // as an object which define specific sorting options for all columns\n * columnSorting: {\n * sortEmptyCells: true, // true = the table sorts empty cells, false = the table moves all empty cells to the end of the table\n * indicator: true, // true = shows indicator for all columns, false = don't show indicator for columns\n * headerAction: false, // true = allow to click on the headers to sort, false = turn off possibility to click on the headers to sort\n * compareFunctionFactory: function(sortOrder, columnMeta) {\n * return function(value, nextValue) {\n * // Some value comparisons which will return -1, 0 or 1...\n * }\n * }\n * }\n * ```\n */\n columnSorting: void 0,\n\n /**\n * Turns on [Manual column move](@/guides/columns/column-moving.md), if set to a boolean or define initial column order (as an array of column indexes).\n *\n * @memberof Options#\n * @type {boolean|number[]}\n * @default undefined\n * @category ManualColumnMove\n *\n * @example\n * ```js\n * // as a boolean to enable column move\n * manualColumnMove: true,\n *\n * // as a array with initial order\n * // (move column index at 0 to 1 and move column index at 1 to 4)\n * manualColumnMove: [1, 4],\n * ```\n */\n manualColumnMove: void 0,\n\n /**\n * @description\n * Turns on [Manual column resize](@/guides/columns/column-width.md#column-stretching), if set to a boolean or define initial column resized widths (an an array of widths).\n *\n * @memberof Options#\n * @type {boolean|number[]}\n * @default undefined\n * @category ManualColumnResize\n *\n * @example\n * ```js\n * // as a boolean to enable column resize\n * manualColumnResize: true,\n *\n * // as a array with initial widths\n * // (column at 0 index has 40px and column at 1 index has 50px)\n * manualColumnResize: [40, 50],\n * ```\n */\n manualColumnResize: void 0,\n\n /**\n * @description\n * Turns on [Manual row move](@/guides/columns/column-moving.md), if set to a boolean or define initial row order (as an array of row indexes).\n *\n * @memberof Options#\n * @type {boolean|number[]}\n * @default undefined\n * @category ManualRowMove\n *\n * @example\n * ```js\n * // as a boolean\n * manualRowMove: true,\n *\n * // as a array with initial order\n * // (move row index at 0 to 1 and move row index at 1 to 4)\n * manualRowMove: [1, 4],\n * ```\n */\n manualRowMove: void 0,\n\n /**\n * @description\n * Turns on [Manual row resize](@/guides/columns/column-width.md#column-stretching), if set to a boolean or define initial row resized heights (as an array of heights).\n *\n * @memberof Options#\n * @type {boolean|number[]}\n * @default undefined\n * @category ManualRowResize\n *\n * @example\n * ```js\n * // as a boolean to enable row resize\n * manualRowResize: true,\n *\n * // as an array to set initial heights\n * // (row at 0 index has 40px and row at 1 index has 50px)\n * manualRowResize: [40, 50],\n * ```\n */\n manualRowResize: void 0,\n\n /**\n * @description\n * If set to `true`, it enables a possibility to merge cells. If set to an array of objects, it merges the cells provided\n * in the objects (see the example below). More information on [the demo page](@/guides/cell-features/merge-cells.md).\n *\n * @memberof Options#\n * @type {boolean|object[]}\n * @default false\n * @category MergeCells\n *\n * @example\n * ```js\n * // enables the mergeCells plugin\n * margeCells: true,\n *\n * // declares a list of merged sections\n * mergeCells: [\n * // rowspan and colspan properties declare the width and height of a merged section in cells\n * {row: 1, col: 1, rowspan: 3, colspan: 3},\n * {row: 3, col: 4, rowspan: 2, colspan: 2},\n * {row: 5, col: 6, rowspan: 3, colspan: 3}\n * ],\n * ```\n */\n mergeCells: false,\n\n /**\n * @description\n * Turns on [Multi-column sorting](@/guides/rows/row-sorting.md). Can be either a boolean (`true` / `false`) or an object with a declared sorting options:\n * * `initialConfig` - Array containing objects, every with predefined keys:\n * * `column` - sorted column\n * * `sortOrder` - order in which column will be sorted\n * * `'asc'` = ascending\n * * `'desc'` = descending\n * * `indicator` - display status for sorting order indicator (an arrow icon in the column header, specifying the sorting order).\n * * `true` = show sort indicator for sorted columns\n * * `false` = don't show sort indicator for sorted columns\n * * `headerAction` - allow to click on the headers to sort\n * * `true` = turn on possibility to click on the headers to sort\n * * `false` = turn off possibility to click on the headers to sort\n * * `sortEmptyCells` - how empty values ([more information here](options#allowempty)) should be handled\n * * `true` = the table sorts empty cells\n * * `false` = the table moves all empty cells to the end of the table\n * * `compareFunctionFactory` - curry function returning compare function; compare function should work in the same way as function which is handled by native `Array.sort` method); please take a look at below examples for more information.\n *\n * @memberof Options#\n * @type {boolean|object}\n * @default undefined\n * @category MultiColumnSorting\n *\n * @example\n * ```js\n * // as boolean\n * multiColumnSorting: true\n *\n * // as an object with initial sort config (sort ascending for column at index 1 and then sort descending for column at index 0)\n * multiColumnSorting: {\n * initialConfig: [{\n * column: 1,\n * sortOrder: 'asc'\n * }, {\n * column: 0,\n * sortOrder: 'desc'\n * }]\n * }\n *\n * // as an object which define specific sorting options for all columns\n * multiColumnSorting: {\n * sortEmptyCells: true, // true = the table sorts empty cells, false = the table moves all empty cells to the end of the table\n * indicator: true, // true = shows indicator for all columns, false = don't show indicator for columns\n * headerAction: false, // true = allow to click on the headers to sort, false = turn off possibility to click on the headers to sort\n * compareFunctionFactory: function(sortOrder, columnMeta) {\n * return function(value, nextValue) {\n * // Some value comparisons which will return -1, 0 or 1...\n * }\n * }\n * }\n * ```\n */\n multiColumnSorting: void 0,\n\n /**\n * @description\n * Number of rows to be rendered outside of the visible part of the table. By default, it's set to `'auto'`, which\n * makes Handsontable to attempt to calculate the best offset performance-wise.\n *\n * You may test out different values to find the best one that works for your specific implementation.\n *\n * @memberof Options#\n * @type {number|string}\n * @default 'auto'\n * @category Core\n *\n * @example\n * ```js\n * viewportRowRenderingOffset: 70,\n * ```\n */\n viewportRowRenderingOffset: 'auto',\n\n /**\n * @description\n * Number of columns to be rendered outside of the visible part of the table. By default, it's set to `'auto'`, which\n * makes Handsontable try calculating the best offset performance-wise.\n *\n * You may experiment with the value to find the one that works best for your specific implementation.\n *\n * @memberof Options#\n * @type {number|string}\n * @default 'auto'\n * @category Core\n *\n * @example\n * ```js\n * viewportColumnRenderingOffset: 70,\n * ```\n */\n viewportColumnRenderingOffset: 'auto',\n\n /**\n * @description\n * A function, regular expression or a string, which will be used in the process of cell validation. If a function is\n * used, be sure to execute the callback argument with either `true` (`callback(true)`) if the validation passed\n * or with `false` (`callback(false)`), if the validation failed.\n *\n * __Note__, that `this` in the function points to the `cellProperties` object.\n *\n * If a string is provided, it may be one of the following predefined values:\n * * `autocomplete`,\n * * `date`,\n * * `numeric`,\n * * `time`.\n *\n * Or you can [register](@/guides/cell-functions/cell-validator.md) the validator function under specified name and use its name as an alias in your\n * configuration.\n *\n * See more [in the demo](@/guides/cell-functions/cell-validator.md).\n *\n * @memberof Options#\n * @type {Function|RegExp|string}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * columns: [\n * {\n * // as a function\n * validator: function(value, callback) {\n * ...\n * }\n * },\n * {\n * // regular expression\n * validator: /^[0-9]$/\n * },\n * {\n * // as a string\n * validator: 'numeric'\n * }\n * ],\n * ```\n */\n validator: void 0,\n\n /**\n * @description\n * Disables visual cells selection.\n *\n * Possible values:\n * * `true` - Disables any type of visual selection (current, header and area selection),\n * * `false` - Enables any type of visual selection. This is default value.\n * * `'current'` - Disables the selection of a currently selected cell, the area selection is still present.\n * * `'area'` - Disables the area selection, the currently selected cell selection is still present.\n * * `'header'` - Disables the headers selection, the currently selected cell selection is still present.\n *\n * @memberof Options#\n * @type {boolean|string|string[]}\n * @default false\n * @category Core\n *\n * @example\n * ```js\n * // as a boolean\n * disableVisualSelection: true,\n *\n * // as a string ('current', 'area' or 'header')\n * disableVisualSelection: 'current',\n *\n * // as an array\n * disableVisualSelection: ['current', 'area'],\n * ```\n */\n disableVisualSelection: false,\n\n /**\n * Disables or enables {@link manual-column-freeze ManualColumnFreeze} plugin.\n *\n * @memberof Options#\n * @type {boolean}\n * @default undefined\n * @category ManualColumnFreeze\n *\n * @example\n * ```js\n * // enable fixed columns\n * manualColumnFreeze: true,\n * ```\n */\n manualColumnFreeze: void 0,\n\n /**\n * Defines whether Handsontable should trim the whitespace at the beginning and the end of the cell contents.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * columns: [\n * {\n * // don't remove whitespace\n * trimWhitespace: false\n * }\n * ]\n * ```\n */\n trimWhitespace: true,\n\n /**\n * Defines data source for Autocomplete or Dropdown cell types.\n *\n * @memberof Options#\n * @type {Array|Function}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // source as a array\n * columns: [{\n * type: 'autocomplete',\n * source: ['A', 'B', 'C', 'D']\n * }],\n *\n * // source as a function\n * columns: [{\n * type: 'autocomplete',\n * source: function(query, callback) {\n * fetch('https://example.com/query?q=' + query, function(response) {\n * callback(response.items);\n * })\n * }\n * }],\n * ```\n */\n source: void 0,\n\n /**\n * @description\n * Defines the column header name.\n *\n * @memberof Options#\n * @type {string}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // set header names for every column\n * columns: [\n * {\n * title: 'First name',\n * type: 'text',\n * },\n * {\n * title: 'Last name',\n * type: 'text',\n * }\n * ],\n * ```\n */\n title: void 0,\n\n /**\n * Data template for `'checkbox'` type when checkbox is checked.\n *\n * @memberof Options#\n * @type {boolean|string|number}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * checkedTemplate: 'good'\n *\n * // if a checkbox-typed cell is checked, then getDataAtCell(x, y),\n * // where x and y are the coordinates of the cell will return 'good'.\n * ```\n */\n checkedTemplate: void 0,\n\n /**\n * Data template for `'checkbox'` type when checkbox is unchecked.\n *\n * @memberof Options#\n * @type {boolean|string|number}\n * @default false\n * @category Core\n *\n * @example\n * ```js\n * uncheckedTemplate: 'bad'\n *\n * // if a checkbox-typed cell is not checked, then getDataAtCell(x,y),\n * // where x and y are the coordinates of the cell will return 'bad'.\n * ```\n */\n uncheckedTemplate: void 0,\n\n /**\n * @description\n * Object which describes if renderer should create checkbox element with label element as a parent.\n *\n * __Note__, this option only works for [checkbox-typed](@/guides/cell-types/checkbox-cell-type.md) cells.\n *\n * By default the [checkbox](@/guides/cell-types/checkbox-cell-type.md) renderer renders the checkbox without a label.\n *\n * Possible object properties:\n * * `property` - Defines the property name of the data object, which will to be used as a label.\n * (eg. `label: {property: 'name.last'}`). This option works only if data was passed as an array of objects.\n * * `position` - String which describes where to place the label text (before or after checkbox element).\n * Valid values are `'before'` and '`after`' (defaults to `'after'`).\n * * `value` - String or a Function which will be used as label text.\n * * `separated` - Boolean which describes that checkbox & label elements are separated or not. Default value is `false`.\n *\n * @memberof Options#\n * @type {object}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * columns: [{\n * type: 'checkbox',\n * // add \"My label:\" after the checkbox\n * label: { position: 'after', value: 'My label: ', separated: true }\n * }],\n * ```\n */\n label: void 0,\n\n /**\n * Display format for numeric typed renderers.\n *\n * __Note__, this option only works for [numeric-typed](@/guides/cell-types/numeric-cell-type.md) cells.\n *\n * Format is described by two properties:\n * * `pattern` - Handled by `numbro` for purpose of formatting numbers to desired pattern. List of supported patterns can be found [here](https://numbrojs.com/format.html#numbers).\n * * `culture` - Handled by `numbro` for purpose of formatting currencies. Examples showing how it works can be found [here](https://numbrojs.com/format.html#currency). List of supported cultures can be found [here](https://numbrojs.com/languages.html#supported-languages).\n *\n * __Note:__ Please keep in mind that this option is used only to format the displayed output! It has no effect on the input data provided for the cell. The numeric data can be entered to the table only as floats (separated by a dot or a comma) or integers, and are stored in the source dataset as JavaScript numbers.\n *\n * Handsontable uses [numbro](https://numbrojs.com/) as a main library for numbers formatting.\n *\n * @memberof Options#\n * @since 0.35.0\n * @type {object}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * columns: [\n * {\n * type: 'numeric',\n * // set desired format pattern and\n * numericFormat: {\n * pattern: '0,00',\n * culture: 'en-US'\n * }\n * }\n * ],\n * ```\n */\n numericFormat: void 0,\n\n /**\n * Language for Handsontable translation. Possible language codes are [listed here](@/guides/internationalization/internationalization-i18n.md#list-of-available-languages).\n *\n * @memberof Options#\n * @type {string}\n * @default 'en-US'\n * @category Core\n *\n * @example\n * ```js\n * // set Polish language\n * language: 'pl-PL',\n * ```\n */\n language: 'en-US',\n\n /**\n * Data source for [select-typed](@/guides/cell-types/select-cell-type.md) cells.\n *\n * __Note__, this option only works for [select-typed](@/guides/cell-types/select-cell-type.md) cells.\n *\n * @memberof Options#\n * @type {string[]}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * columns: [\n * {\n * editor: 'select',\n * // add three select options to choose from\n * selectOptions: ['A', 'B', 'C'],\n * }\n * ],\n * ```\n */\n selectOptions: void 0,\n\n /**\n * Enables or disables the {@link auto-column-size AutoColumnSize} plugin. Default value `undefined`\n * is an equivalent of `true`, sets `syncLimit` to 50.\n * Disabling this plugin can increase performance, as no size-related calculations would be done.\n * To disable plugin it's necessary to set `false`.\n *\n * Column width calculations are divided into sync and async part. Each of those parts has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous\n * operations don't block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value.\n *\n * You can also use the `useHeaders` option to take the column headers width into calculation.\n *\n * Note: Using {@link core#colwidths Core#colWidths} option will forcibly disable {@link auto-column-size AutoColumnSize}.\n *\n * @memberof Options#\n * @type {object|boolean}\n * @default undefined\n * @category AutoColumnSize\n *\n * @example\n * ```js\n * // as a number (300 columns in sync, rest async)\n * autoColumnSize: { syncLimit: 300 },\n *\n * // as a string (percent)\n * autoColumnSize: { syncLimit: '40%' },\n *\n * // use headers width while calculating the column width\n * autoColumnSize: { useHeaders: true },\n *\n * // defines how many samples for the same length will be caught to calculations\n * autoColumnSize: { samplingRatio: 10 },\n *\n * // defines if duplicated samples are allowed in calculations\n * autoColumnSize: { allowSampleDuplicates: true },\n * ```\n */\n autoColumnSize: void 0,\n\n /**\n * Enables or disables {@link auto-row-size AutoRowSize} plugin. Default value is `undefined`, which has the same effect as `false`\n * (disabled). Enabling this plugin can decrease performance, as size-related calculations would be performed.\n *\n * __Note:__ the default `syncLimit` value is set to 500 when the plugin is manually enabled by declaring it as: `autoRowSize: true`.\n *\n * Row height calculations are divided into sync and async stages. Each of these stages has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous\n * operations don't block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of rows) or a percentage value.\n *\n * @memberof Options#\n * @type {object|boolean}\n * @default undefined\n * @category AutoRowSize\n *\n * @example\n * ```js\n * // as a number (300 rows in sync, rest async)\n * autoRowSize: {syncLimit: 300},\n *\n * // as a string (percent)\n * autoRowSize: {syncLimit: '40%'},\n * ```\n */\n autoRowSize: void 0,\n\n /**\n * Date validation format.\n *\n * __Note__, this option only works for [date-typed](@/guides/cell-types/date-cell-type.md) cells.\n *\n * @memberof Options#\n * @type {string}\n * @default 'DD/MM/YYYY'\n * @category Core\n *\n * @example\n * ```js\n * columns: [{\n * type: 'date',\n * // localise date format\n * dateFormat: 'MM/DD/YYYY'\n * }],\n * ```\n */\n dateFormat: 'DD/MM/YYYY',\n\n /**\n * If `true` then dates will be automatically formatted to match the desired format.\n *\n * __Note__, this option only works for [date-typed](@/guides/cell-types/date-cell-type.md) cells.\n *\n * @memberof Options#\n * @type {boolean}\n * @default false\n * @category Core\n *\n * @example\n * ```js\n * columns: [{\n * type: 'date',\n * dateFormat: 'YYYY-MM-DD',\n * // force selected date format\n * correctFormat: true\n * }],\n * ```\n */\n correctFormat: false,\n\n /**\n * Definition of default value which will fill the empty cells.\n *\n * __Note__, this option only works for [date-typed](@/guides/cell-types/date-cell-type.md) cells.\n *\n * @memberof Options#\n * @type {string}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * columns: [\n * {\n * type: 'date',\n * // always set this date for empty cells\n * defaultDate: '2015-02-02'\n * }\n * ],\n * ```\n */\n defaultDate: void 0,\n\n /**\n * If set to `true`, the value entered into the cell must match (case-sensitive) the autocomplete source.\n * Otherwise, cell won't pass the validation. When filtering the autocomplete source list, the editor will\n * be working in case-insensitive mode.\n *\n * __Note__, this option only works for [autocomplete-typed](@/guides/cell-types/autocomplete-cell-type.md) cells.\n *\n * @memberof Options#\n * @type {boolean}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * columns: [{\n * type: 'autocomplete',\n * source: ['A', 'B', 'C'],\n * // force selected value to match the source list\n * strict: true\n * }],\n * ```\n */\n strict: void 0,\n\n /**\n * If set to `true`, data defined in `source` of the autocomplete or dropdown cell will be treated as HTML.\n *\n * __Warning:__ Enabling this option can cause serious XSS vulnerabilities.\n *\n * __Note__, this option only works for [autocomplete-typed](@/guides/cell-types/autocomplete-cell-type.md) cells.\n *\n * @memberof Options#\n * @type {boolean}\n * @default false\n * @category Core\n *\n * @example\n * ```js\n * columns: [{\n * type: 'autocomplete',\n * // use HTML in the source list\n * allowHtml: true,\n * source: ['foo', 'bar']\n * }],\n * ```\n */\n allowHtml: false,\n\n /**\n * If typed `true` then virtual rendering mechanism for handsontable will be disabled.\n *\n * @memberof Options#\n * @type {boolean}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // disable virtual rows rendering\n * renderAllRows: true,\n * ```\n */\n renderAllRows: void 0,\n\n /**\n * Prevents table to overlap outside the parent element. If `'horizontal'` option is chosen then table will show\n * a horizontal scrollbar if parent's width is narrower then table's width.\n *\n * Possible values:\n * * `false` - Disables functionality.\n * * `horizontal` - Prevents horizontal overflow table.\n * * `vertical` - Prevents vertical overflow table.\n *\n * @memberof Options#\n * @type {string|boolean}\n * @default false\n * @category Core\n *\n * @example\n * ```js\n * preventOverflow: 'horizontal',\n * ```\n */\n preventOverflow: false,\n\n /**\n * Prevents wheel event on overlays for doing default action.\n *\n * @memberof Options#\n * @private\n * @type {boolean}\n * @default false\n * @category Core\n *\n * @example\n * ```js\n * preventWheel: false,\n * ```\n */\n preventWheel: false,\n\n /**\n * @description\n * Enables the functionality of the {@link bind-rows-with-headers BindRowsWithHeaders} plugin which allows binding the table rows with their headers.\n * If the plugin is enabled, the table row headers will \"stick\" to the rows, when they are hidden/moved. Basically,\n * if at the initialization row 0 has a header titled \"A\", it will have it no matter what you do with the table.\n *\n * @memberof Options#\n * @type {boolean|string}\n * @default undefined\n * @category BindRowsWithHeaders\n *\n * @example\n * ```js\n * // keep row data and row headers in sync\n * bindRowsWithHeaders: true\n * ```\n */\n bindRowsWithHeaders: void 0,\n\n /**\n * @description\n * The {@link collapsible-columns CollapsibleColumns} plugin allows collapsing of columns, covered by a header with the `colspan` property\n * defined.\n *\n * Clicking the \"collapse/expand\" button collapses (or expands) all \"child\" headers except the first one.\n *\n * Setting the `collapsibleColumns` property to `true` will display a \"collapse/expand\" button in every\n * header with a defined colspan` property.\n *\n * To limit this functionality to a smaller group of headers, define the `collapsibleColumns` property\n * as an array of objects, as in the example below.\n *\n * @memberof Options#\n * @type {boolean|object[]}\n * @default undefined\n * @category CollapsibleColumns\n *\n * @example\n * ```js\n * // enable collapsing for all headers\n * collapsibleColumns: true,\n *\n * // or\n * // enable collapsing for selected headers\n * collapsibleColumns: [\n * {row: -4, col: 1, collapsible: true},\n * {row: -3, col: 5, collapsible: true}\n * ],\n * ```\n */\n collapsibleColumns: void 0,\n\n /**\n * @description\n * Allows making pre-defined calculations on the cell values and display the results within Handsontable.\n *\n * Possible types:\n * * `'sum'`\n * * `'min'`\n * * `'max'`\n * * `'count'`\n * * `'average'`\n * * `'custom'` - add `customFunction`.\n *\n * [See the demo for more information](@/guides/columns/column-summary.md).\n *\n * @memberof Options#\n * @type {object[]|Function}\n * @default undefined\n * @category ColumnSummary\n *\n * @example\n * ```js\n * columnSummary: [\n * {\n * destinationRow: 4,\n * destinationColumn: 1,\n * forceNumeric: true,\n * reversedRowCoords: true,\n * suppressDataTypeErrors: false,\n * readOnly: true,\n * roundFloat: false,\n * type: 'custom',\n * customFunction: function(endpoint) {\n * return 100;\n * }\n * }\n * ],\n * ```\n */\n columnSummary: void 0,\n\n /**\n * This plugin allows adding a configurable dropdown menu to the table's column headers. The dropdown menu acts like\n * the {@link options#contextmenu Options#contextMenu}, but is triggered by clicking the button in the header.\n *\n * @memberof Options#\n * @type {boolean|object|string[]}\n * @default undefined\n * @category DropdownMenu\n *\n * @example\n * ```js\n * // enable dropdown menu\n * dropdownMenu: true,\n *\n * // or\n * // enable and configure dropdown menu options\n * dropdownMenu: ['remove_col', '---------', 'make_read_only', 'alignment']\n * ```\n */\n dropdownMenu: void 0,\n\n /**\n * The {@link filters Filters} plugin allows filtering the table data either by the built-in component or with the API.\n *\n * @memberof Options#\n * @type {boolean}\n * @default undefined\n * @category Filters\n *\n * @example\n * ```js\n * // enable filters\n * filters: true,\n * ```\n */\n filters: void 0,\n\n /**\n * The {@link formulas Formulas} plugin allows Handsontable to process formula expressions defined in the provided data.\n *\n * @memberof Options#\n * @type {boolean|object}\n * @default undefined\n * @category Formulas\n *\n * @example\n * ```js\n * // enable formulas plugin\n * formulas: true,\n *\n * // or as an object with custom variables to be used in formula expressions\n * formulas: {\n * variables: {\n * FOO: 64,\n * BAR: 'baz',\n * }\n * },\n * ```\n */\n formulas: void 0,\n\n /**\n * The {@link hidden-columns HiddenColumns} plugin allows hiding of certain columns. You can pass additional configuration with an\n * object notation. Options that are then available are:\n * * `columns` - an array of rows that should be hidden on plugin initialization\n * * `indicators` - enables small ui markers to indicate where are hidden columns.\n *\n * @memberof Options#\n * @type {boolean|object}\n * @default undefined\n * @category HiddenColumns\n *\n * @example\n * ```js\n * // enable column hiding\n * hiddenColumns: true,\n *\n * // or\n * hiddenColumns: {\n * // set columns that are hidden by default\n * columns: [5, 10, 15],\n * // show where are hidden columns\n * indicators: true\n * }\n * ```\n */\n hiddenColumns: void 0,\n\n /**\n * The {@link hidden-rows HiddenRows} plugin allows hiding of certain rows. You can pass additional configuration with an\n * object notation. Options that are then available are:\n * * `rows` - an array of rows that should be hidden on plugin initialization\n * * `indicators` - enables small ui markers to indicate where are hidden columns.\n *\n * @memberof Options#\n * @type {boolean|object}\n * @default undefined\n * @category HiddenRows\n *\n * @example\n * ```js\n * // enable row hiding\n * hiddenRows: true,\n *\n * // or\n * hiddenRows: {\n * // set rows that are hidden by default\n * rows: [5, 10, 15],\n * // show where are hidden rows\n * indicators: true\n * }\n * ```\n */\n hiddenRows: void 0,\n\n /**\n * @description\n * Allows creating a nested header structure, using the HTML's colspan attribute.\n *\n * @memberof Options#\n * @type {Array[]}\n * @default undefined\n * @category NestedHeaders\n *\n * @example\n * ```js\n * nestedHeaders: [\n * ['A', {label: 'B', colspan: 8}, 'C'],\n * ['D', {label: 'E', colspan: 4}, {label: 'F', colspan: 4}, 'G'],\n * ['H', 'I', 'J', 'K', 'L', 'M', 'N', 'R', 'S', 'T']\n * ],\n * ```\n */\n nestedHeaders: void 0,\n\n /**\n * @description\n * Plugin allowing hiding of certain rows.\n *\n * @memberof Options#\n * @type {boolean|number[]}\n * @default undefined\n * @category TrimRows\n *\n * @example\n * ```js\n * // enable plugin\n * trimRows: true,\n *\n * // or\n * // trim selected rows on table initialization\n * trimRows: [5, 10, 15],\n * ```\n */\n trimRows: void 0,\n\n /**\n * @description\n * Allows setting a custom width of the row headers. You can provide a number or an array of widths, if many row\n * header levels are defined.\n *\n * @memberof Options#\n * @type {number|number[]}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // set width for all row headers\n * rowHeaderWidth: 25,\n *\n * // or\n * // set width for selected headers only\n * rowHeaderWidth: [25, 30, 55],\n * ```\n */\n rowHeaderWidth: void 0,\n\n /**\n * @description\n * Allows setting a custom height of the column headers. You can provide a number or an array of heights, if many\n * column header levels are defined.\n *\n * @memberof Options#\n * @type {number|number[]}\n * @default undefined\n * @category Core\n *\n * @example\n * ```js\n * // set shared height for all headers\n * columnHeaderHeight: 35,\n *\n * // or\n * // set height for each header individually\n * columnHeaderHeight: [35, 20, 55],\n *\n * // or\n * // skipped headers will fallback to default value\n * columnHeaderHeight: [35, undefined, 55],\n * ```\n */\n columnHeaderHeight: void 0,\n\n /**\n * If defined as `true`, the Autocomplete's suggestion list would be sorted by relevance (the closer to the left the\n * match is, the higher the suggestion).\n *\n * __Note__, this option only works for [autocomplete-typed](@/guides/cell-types/autocomplete-cell-type.md) cells.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * columns: [\n * {\n * type: 'autocomplete',\n * source: [ ... ],\n * // keep options order as they were defined\n * sortByRelevance: false\n * }\n * ],\n * ```\n */\n sortByRelevance: true,\n\n /**\n * If defined as `true`, when the user types into the input area the Autocomplete's suggestion list is updated to only\n * include those choices starting with what has been typed; if defined as `false` all suggestions remain shown, with\n * those matching what has been typed marked in bold.\n *\n * __Note__, this option only works for [autocomplete-typed](@/guides/cell-types/autocomplete-cell-type.md) cells.\n *\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category Core\n *\n * @example\n * ```js\n * columns: [\n * {\n * type: 'autocomplete',\n * source: [ ... ],\n * // don't hide options that don't match search query\n * filter: false\n * }\n * ],\n * ```\n */\n filter: true,\n\n /**\n * If defined as `true`, filtering in the Autocomplete Editor will be case-sensitive.\n *\n * __Note__, this option only works for [autocomplete-typed](@/guides/cell-types/autocomplete-cell-type.md) cells.\n *\n * @memberof Options#\n * @type {boolean}\n * @default false\n * @category Core\n *\n * @example\n * ```js\n * columns: [\n * {\n * type: 'autocomplete',\n * source: [ ... ],\n * // match case while searching autocomplete options\n * filteringCaseSensitive: true\n * }\n * ],\n * ```\n */\n filteringCaseSensitive: false,\n\n /**\n * @description\n * Disables or enables the {@link drag-to-scroll drag to scroll} functionality.\n * @memberof Options#\n * @type {boolean}\n * @default true\n * @category DragToScroll\n *\n * @example\n * ```js\n * // don't scroll the viewport when selection gets to the viewport edge\n * dragToScroll: false,\n * ```\n */\n dragToScroll: true,\n\n /**\n * @description\n * Disable or enable the nested rows functionality - displaying nested structures in a two-dimensional data table.\n *\n * See [quick setup of the Nested rows](@/guides/rows/row-parent-child.md).\n * @example\n * ```js\n * nestedRows: true,\n * ```\n *\n * @memberof Options#\n * @type {boolean}\n * @default false\n * @category NestedRows\n */\n nestedRows: void 0\n };\n});","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport { extend } from \"../../../helpers/object.mjs\";\nimport { expandMetaType } from \"../utils.mjs\";\nimport metaSchemaFactory from \"../metaSchema.mjs\";\n/**\n * @returns {TableMeta} Returns an empty object. The holder for global meta object.\n */\n\nfunction createTableMetaEmptyClass() {\n return function TableMeta() {\n _classCallCheck(this, TableMeta);\n };\n}\n/**\n * The global meta object is a root of all default settings, which are recognizable by Handsontable.\n * Other layers are inherited from this object. Adding, removing, or changing property in that\n * object has a direct reflection to all layers such as: TableMeta, ColumnMeta, or CellMeta layers.\n *\n * +-------------+.\n * │ GlobalMeta │\n * │ (prototype) │\n * +-------------+\\\n * │ \\\n * │ \\\n * \\│/ _\\|\n * +-------------+ +-------------+.\n * │ TableMeta │ │ ColumnMeta │\n * │ (instance) │ │ (prototype) │\n * +-------------+ +-------------+.\n * │\n * │\n * \\│/\n * +-------------+.\n * │ CellMeta │\n * │ (instance) │\n * +-------------+.\n */\n\n\nvar GlobalMeta = /*#__PURE__*/function () {\n function GlobalMeta() {\n _classCallCheck(this, GlobalMeta);\n\n /**\n * An alias for the constructor. Necessary for inheritance for creating new layers.\n *\n * @type {TableMeta}\n */\n this.metaCtor = createTableMetaEmptyClass();\n /**\n * Main object (prototype of the internal TableMeta class), holder for all default settings.\n *\n * @type {object}\n */\n\n this.meta = this.metaCtor.prototype;\n extend(this.meta, metaSchemaFactory());\n }\n /**\n * Gets constructor of the global meta object. Necessary for inheritance for creating the next meta layers.\n *\n * @returns {Function}\n */\n\n\n _createClass(GlobalMeta, [{\n key: \"getMetaConstructor\",\n value: function getMetaConstructor() {\n return this.metaCtor;\n }\n /**\n * Gets settings object for this layer.\n *\n * @returns {object}\n */\n\n }, {\n key: \"getMeta\",\n value: function getMeta() {\n return this.meta;\n }\n /**\n * Updates global settings object by merging settings with the current state.\n *\n * @param {object} settings An object to merge with.\n */\n\n }, {\n key: \"updateMeta\",\n value: function updateMeta(settings) {\n extend(this.meta, settings);\n extend(this.meta, expandMetaType(settings.type, settings));\n }\n }]);\n\n return GlobalMeta;\n}();\n\nexport { GlobalMeta as default };","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { extend } from \"../../../helpers/object.mjs\";\nimport { expandMetaType } from \"../utils.mjs\";\n/**\n * The table meta object is a layer that keeps all settings of the Handsontable that was passed in\n * the constructor. That layer contains all default settings inherited from the GlobalMeta layer\n * merged with settings passed by the developer. Adding, removing, or changing property in that\n * object has no direct reflection on any other layers.\n *\n * +-------------+.\n * │ GlobalMeta │\n * │ (prototype) │\n * +-------------+\\\n * │ \\\n * │ \\\n * \\│/ _\\|\n * +-------------+ +-------------+.\n * │ TableMeta │ │ ColumnMeta │\n * │ (instance) │ │ (prototype) │\n * +-------------+ +-------------+.\n * │\n * │\n * \\│/\n * +-------------+.\n * │ CellMeta │\n * │ (instance) │\n * +-------------+.\n */\n\nvar TableMeta = /*#__PURE__*/function () {\n function TableMeta(globalMeta) {\n _classCallCheck(this, TableMeta);\n\n var MetaCtor = globalMeta.getMetaConstructor();\n /**\n * Main object (instance of the internal TableMeta class from GlobalMeta), holder for all settings defined in the table scope.\n *\n * @type {object}\n */\n\n this.meta = new MetaCtor();\n }\n /**\n * Gets settings object for this layer.\n *\n * @returns {object}\n */\n\n\n _createClass(TableMeta, [{\n key: \"getMeta\",\n value: function getMeta() {\n return this.meta;\n }\n /**\n * Updates table settings object by merging settings with the current state.\n *\n * @param {object} settings An object to merge with.\n */\n\n }, {\n key: \"updateMeta\",\n value: function updateMeta(settings) {\n extend(this.meta, settings);\n extend(this.meta, expandMetaType(settings.type, settings));\n }\n }]);\n\n return TableMeta;\n}();\n\nexport { TableMeta as default };","import \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.set.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.splice.js\";\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.array.index-of.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { arrayFilter } from \"../../helpers/array.mjs\";\nimport { assert, isUnsignedNumber, isNullish } from \"./utils.mjs\";\n/* eslint-disable jsdoc/require-description-complete-sentence */\n\n/**\n * @class LazyFactoryMap\n *\n * The LazyFactoryMap object holds key-value pairs in the structure similar to the\n * regular Map. Once created, items can be moved around a grid depending on the operations\n * performed on that grid - adding or removing rows. The collection requires \"key\"\n * to be a zero-based index.\n *\n * It's essential to notice that the \"key\" index under which the item was created\n * is volatile. After altering the grid, the \"key\" index can change.\n *\n * Having created N items with corresponding example data where the data has 10\n * holes (`undefined` values) within (that's why internal storage index counts from 10).\n * +------+------+------+------+------+.\n * | 0/10 | 1/11 | 2/12 | 3/13 | 4/14 | Keys (volatile zero-based index / internal storage index)\n * +------+------+------+------+------+.\n * │ │ │ │ │\n * +------+------+------+------+------+.\n * | AAA | BBB | CCC | DDD | EEE | Data\n * +------+------+------+------+------+.\n *\n * Map.obtain(0) // returns \"AAA\"\n * map.obtain(2) // returns \"CCC\".\n *\n * After inserting 2 new rows, keys that hold the data positioned after the place\n * where the new rows are added are upshifted by 2.\n * │\n * │ Insert 2 rows\n * \\│/\n * +------+------+------+------+------+.\n * | 0/10 | 1/11 | 2/12 | 3/13 | 4/14 | Keys before\n * +------+------+------+------+------+.\n *\n * / 2 new rows \\\n * +------+------+------+------+------+------+------+.\n * | 0/10 | 1/11 | 2/15 | 3/16 | 4/12 | 5/13 | 6/14 | Keys after\n * +------+------+------+------+------+------+------+.\n * │ │ │ │ │ │ │\n * │ │ └──────┼──────┼──────┼┐ │\n * │ │ └──────┼──────┼┼────┼┐\n * │ │ ┌─────────────┘ ││ ││\n * │ │ │ ┌─────────────┘│ ││\n * │ │ │ │ ┌───────┼────┘│\n * │ │ │ │ │ │ │\n * +------+------+------+------+------+------+------+.\n * | AAA | BBB | CCC | DDD | EEE | FFF | GGG | Data\n * +------+------+------+------+------+------+------+\n *\n * Now at index 2 and 3 we have access to new items.\n *\n * map.obtain(2) // returns new value \"FFF\" for newly created row.\n * map.obtain(4) // index shifted by 2 has access to the old \"CCC\" value, as before inserting.\n *\n * after removing 4 rows, keys that hold the data positioned after the place where the\n * rows are removed are downshifted by 4.\n * │\n * │ Remove 4 rows\n * ├───────────────────────────┐\n * \\│/ │\n * +------+------+------+------+------+------+------+\n * | 0/10 | 1/11 | 2/15 | 3/16 | 4/12 | 5/13 | 6/14 | Keys after\n * +------+------+------+------+------+------+------+\n * │ │ │ │ │ │ │\n * │ │ └──────┼──────┼──────┼┐ │\n * │ │ └──────┼──────┼┼────┼┐\n * │ │ ┌─────────────┘ ││ ││\n * │ │ │ ┌─────────────┘│ ││\n * │ │ │ │ ┌───────┼────┘│\n * │ │ │ │ │ │ │\n * +------+------+------+------+------+------+------+\n * | AAA | BBB | CCC | DDD | EEE | FFF | GGG | Data\n * +------+------+------+------+------+------+------+\n *\n * +------+------+------+\n * | 0/10 | 1/13 | 2/14 | Keys after\n * +------+------+------+\n * │ │ │\n * │ │ └─────────────┐\n * │ └────────────┐ │\n * │ │ │\n * │ │ │\n * │ │ │\n * │ │ │\n * +------+------+------+------+------+------+------+\n * | AAA | BBB | CCC | DDD | EEE | FFF | GGG | Data\n * +------+------+------+------+------+------+------+\n * /│\\ /│\\ /│\\ /│\\\n * └──┬──┘ └──┬──┘\n * This data is marked as \"hole\" which\n * means that can be replaced by new item\n * when that will be created.\n *\n * map.obtain(2) // returns the value (\"EEE\") as it should. Access to the value is\n * // changed (the key was downshifted). However, the internal index has not changed,\n * // which means that the data does not need to be changed (spliced) too.\n *\n * After previous remove operation which creates some \"holes\" obtaining new\n * items replaces that \"holes\" as follows:\n *\n * // Obtains new item\n * map.obtain(90) // Returns \"NEW\" value\n *\n * +------+------+------+...+------+\n * | 0/10 | 1/13 | 2/14 | | 90/0 | Keys after\n * +------+------+------+...+------+\n * │ │ │ │\n * │ │ └──────────┼────────────┐\n * │ └─────────────────┼─────┐ │\n * └──────────┐ │ │ │\n * │ │ │ │\n * ┌──────────┼──────────────┘ │ │\n * │ │ │ │\n * +------+...+------+------+------+------+------+-----+\n * | NEW | | AAA | BBB | CCC | DDD | EEE | FFF | Data\n * +------+...+------+------+------+------+------+-----+\n * /│\\\n * │\n * The first \"hole\" (at index 0) item is permanently removed and replaced by a new item.\n * The hole index is taken from the hole collection which act as FIFO (First In First Out).\n */\n\n/* eslint-enable jsdoc/require-description-complete-sentence */\n\nvar LazyFactoryMap = /*#__PURE__*/function () {\n function LazyFactoryMap(valueFactory) {\n _classCallCheck(this, LazyFactoryMap);\n\n this.valueFactory = valueFactory;\n /**\n * An array which contains data.\n *\n * @type {Array}\n */\n\n this.data = [];\n /**\n * An array of indexes where the key of the array is mapped to the value which points to the\n * specific position of the data array.\n *\n * @type {number[]}\n */\n\n this.index = [];\n /**\n * The collection of indexes that points to the data items which can be replaced by obtaining new\n * ones. The \"holes\" are an intended effect of deleting entries.\n *\n * The idea of \"holes\" generally allows us to not modify the \"data\" structure while removing\n * items from the collection.\n *\n * @type {Set}\n */\n\n this.holes = new Set();\n }\n /**\n * Gets or if data not exist creates and returns new data.\n *\n * @param {number} key The item key as zero-based index.\n * @returns {*}\n */\n\n\n _createClass(LazyFactoryMap, [{\n key: \"obtain\",\n value: function obtain(key) {\n assert(function () {\n return isUnsignedNumber(key);\n }, 'Expecting an unsigned number.');\n\n var dataIndex = this._getStorageIndexByKey(key);\n\n var result;\n\n if (dataIndex >= 0) {\n result = this.data[dataIndex];\n\n if (result === void 0) {\n result = this.valueFactory(key);\n this.data[dataIndex] = result;\n }\n } else {\n result = this.valueFactory(key);\n\n if (this.holes.size > 0) {\n var reuseIndex = this.holes.values().next().value; // Gets first item from the collection\n\n this.holes.delete(reuseIndex);\n this.data[reuseIndex] = result;\n this.index[key] = reuseIndex;\n } else {\n this.data.push(result);\n this.index[key] = this.data.length - 1;\n }\n }\n\n return result;\n }\n /**\n * Inserts an empty data to the map. This method creates an empty space for obtaining\n * new data.\n *\n * @param {number} key The key as volatile zero-based index at which to begin inserting space for new data.\n * @param {number} [amount=1] Ammount of data to insert.\n */\n\n }, {\n key: \"insert\",\n value: function insert(key) {\n var _this$index;\n\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n assert(function () {\n return isUnsignedNumber(key) || isNullish(key);\n }, 'Expecting an unsigned number or null/undefined argument.');\n var newIndexes = [];\n var dataLength = this.data.length;\n\n for (var i = 0; i < amount; i++) {\n newIndexes.push(dataLength + i);\n this.data.push(void 0);\n }\n\n (_this$index = this.index).splice.apply(_this$index, [isNullish(key) ? this.index.length : key, 0].concat(newIndexes));\n }\n /**\n * Removes (soft remove) data from \"index\" and according to the amount of data.\n *\n * @param {number} key The key as volatile zero-based index at which to begin removing the data.\n * @param {number} [amount=1] Ammount data to remove.\n */\n\n }, {\n key: \"remove\",\n value: function remove(key) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n assert(function () {\n return isUnsignedNumber(key) || isNullish(key);\n }, 'Expecting an unsigned number or null/undefined argument.');\n var removed = this.index.splice(isNullish(key) ? this.index.length - amount : key, amount);\n\n for (var i = 0; i < removed.length; i++) {\n var removedIndex = removed[i];\n\n if (typeof removedIndex === 'number') {\n this.holes.add(removedIndex);\n }\n }\n }\n /**\n * Returns the size of the data which this map holds.\n *\n * @returns {number}\n */\n\n }, {\n key: \"size\",\n value: function size() {\n return this.data.length - this.holes.size;\n }\n /**\n * Returns a new Iterator object that contains the values for each item in the LazyMap object.\n *\n * @returns {Iterator}\n */\n\n }, {\n key: \"values\",\n value: function values() {\n var _this = this;\n\n return arrayFilter(this.data, function (_, index) {\n return !_this.holes.has(index);\n })[Symbol.iterator]();\n }\n /**\n * Returns a new Iterator object that contains an array of `[index, value]` for each item in the LazyMap object.\n *\n * @returns {Iterator}\n */\n\n }, {\n key: \"entries\",\n value: function entries() {\n var validEntries = [];\n\n for (var i = 0; i < this.data.length; i++) {\n var keyIndex = this._getKeyByStorageIndex(i);\n\n if (keyIndex !== -1) {\n validEntries.push([keyIndex, this.data[i]]);\n }\n }\n\n var dataIndex = 0;\n return {\n next: function next() {\n if (dataIndex < validEntries.length) {\n var value = validEntries[dataIndex];\n dataIndex += 1;\n return {\n value: value,\n done: false\n };\n }\n\n return {\n done: true\n };\n }\n };\n }\n /**\n * Clears the map.\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n this.data = [];\n this.index = [];\n this.holes.clear();\n }\n /**\n * Gets storage index calculated from the key associated with the specified value.\n *\n * @param {number} key Volatile zero-based index.\n * @returns {number} Returns index 0-N or -1 if no storage index found.\n */\n\n }, {\n key: \"_getStorageIndexByKey\",\n value: function _getStorageIndexByKey(key) {\n return this.index.length > key ? this.index[key] : -1;\n }\n /**\n * Gets the key associated with the specified value calculated from storage index.\n *\n * @param {number} dataIndex Zero-based storage index.\n * @returns {number} Returns index 0-N or -1 if no key found.\n */\n\n }, {\n key: \"_getKeyByStorageIndex\",\n value: function _getKeyByStorageIndex(dataIndex) {\n return this.index.indexOf(dataIndex);\n }\n /**\n * Makes this object iterable.\n *\n * @returns {Iterator}\n */\n\n }, {\n key: Symbol.iterator,\n value: function value() {\n return this.entries();\n }\n }]);\n\n return LazyFactoryMap;\n}();\n\nexport { LazyFactoryMap as default };","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { extend } from \"../../../helpers/object.mjs\";\nimport { columnFactory, expandMetaType } from \"../utils.mjs\";\nimport LazyFactoryMap from \"../lazyFactoryMap.mjs\";\n/**\n * List of props which have to be cleared in the column meta-layer. That props have a\n * different meaning when using in column meta.\n *\n * @type {string[]}\n */\n\nvar COLUMNS_PROPS_CONFLICTS = ['data', 'width'];\n/**\n * The column meta object is a root of all settings defined in the column property of the Handsontable\n * settings. Each column in the Handsontable is associated with a unique meta object which is managed by\n * this layer. Adding, removing, or changing property in that object has a direct reflection only for\n * the CellMeta layer. The reflection will be visible only if the property doesn't exist in the lower\n * layers (prototype lookup).\n *\n * +-------------+.\n * │ GlobalMeta │\n * │ (prototype) │\n * +-------------+\\\n * │ \\\n * │ \\\n * \\│/ _\\|\n * +-------------+ +-------------+.\n * │ TableMeta │ │ ColumnMeta │\n * │ (instance) │ │ (prototype) │\n * +-------------+ +-------------+.\n * │\n * │\n * \\│/\n * +-------------+.\n * │ CellMeta │\n * │ (instance) │\n * +-------------+.\n */\n\nvar ColumnMeta = /*#__PURE__*/function () {\n function ColumnMeta(globalMeta) {\n var _this = this;\n\n _classCallCheck(this, ColumnMeta);\n\n /**\n * Reference to the GlobalMeta layer. While creating new column meta objects, all new objects\n * inherit properties from the GlobalMeta layer.\n *\n * @type {GlobalMeta}\n */\n this.globalMeta = globalMeta;\n /**\n * The LazyFactoryMap structure, holder for column meta objects where each column meta is\n * stored under the physical column index.\n *\n * @type {LazyFactoryMap}\n */\n\n this.metas = new LazyFactoryMap(function () {\n return _this._createMeta();\n });\n }\n /**\n * Updates column meta object by merging settings with the current state.\n *\n * @param {number} physicalColumn The physical column index which points what column meta object is updated.\n * @param {object} settings An object to merge with.\n */\n\n\n _createClass(ColumnMeta, [{\n key: \"updateMeta\",\n value: function updateMeta(physicalColumn, settings) {\n var meta = this.getMeta(physicalColumn);\n extend(meta, settings);\n extend(meta, expandMetaType(settings.type, meta));\n }\n /**\n * Creates one or more columns at specific position.\n *\n * @param {number} physicalColumn The physical column index which points from what position the column is added.\n * @param {number} amount An amount of columns to add.\n */\n\n }, {\n key: \"createColumn\",\n value: function createColumn(physicalColumn, amount) {\n this.metas.insert(physicalColumn, amount);\n }\n /**\n * Removes one or more columns from the collection.\n *\n * @param {number} physicalColumn The physical column index which points from what position the column is removed.\n * @param {number} amount An amount columns to remove.\n */\n\n }, {\n key: \"removeColumn\",\n value: function removeColumn(physicalColumn, amount) {\n this.metas.remove(physicalColumn, amount);\n }\n /**\n * Gets settings object for this layer.\n *\n * @param {number} physicalColumn The physical column index.\n * @returns {object}\n */\n\n }, {\n key: \"getMeta\",\n value: function getMeta(physicalColumn) {\n return this.metas.obtain(physicalColumn);\n }\n /**\n * Gets constructor of the column meta object. Necessary for inheritance - creating the next meta layers.\n *\n * @param {number} physicalColumn The physical column index.\n * @returns {Function}\n */\n\n }, {\n key: \"getMetaConstructor\",\n value: function getMetaConstructor(physicalColumn) {\n return this.metas.obtain(physicalColumn).constructor;\n }\n /**\n * Clears all saved column meta objects.\n */\n\n }, {\n key: \"clearCache\",\n value: function clearCache() {\n this.metas.clear();\n }\n /**\n * Creates and returns new column meta object with properties inherited from the global meta layer.\n *\n * @private\n * @returns {object}\n */\n\n }, {\n key: \"_createMeta\",\n value: function _createMeta() {\n return columnFactory(this.globalMeta.getMetaConstructor(), COLUMNS_PROPS_CONFLICTS).prototype;\n }\n }]);\n\n return ColumnMeta;\n}();\n\nexport { ColumnMeta as default };","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { extend } from \"../../../helpers/object.mjs\";\nimport { expandMetaType, assert, isUnsignedNumber } from \"../utils.mjs\";\nimport LazyFactoryMap from \"../lazyFactoryMap.mjs\";\n/* eslint-disable jsdoc/require-description-complete-sentence */\n\n/**\n * @class CellMeta\n *\n * The cell meta object is a root of all settings defined for the specific cell rendered by the\n * Handsontable. Each cell meta inherits settings from higher layers. When a property doesn't\n * exist in that layer, it is looked up through a prototype to the highest layer. Starting\n * from CellMeta -> ColumnMeta and ending to GlobalMeta, which stores default settings. Adding,\n * removing, or changing property in that object has no direct reflection on any other layers.\n *\n * +-------------+\n * │ GlobalMeta │\n * │ (prototype) │\n * +-------------+\\\n * │ \\\n * │ \\\n * \\│/ _\\|\n * +-------------+ +-------------+\n * │ TableMeta │ │ ColumnMeta │\n * │ (instance) │ │ (prototype) │\n * +-------------+ +-------------+\n * │\n * │\n * \\│/\n * +-------------+\n * │ CellMeta │\n * │ (instance) │\n * +-------------+\n */\n\n/* eslint-enable jsdoc/require-description-complete-sentence */\n\nvar CellMeta = /*#__PURE__*/function () {\n function CellMeta(columnMeta) {\n var _this = this;\n\n _classCallCheck(this, CellMeta);\n\n /**\n * Reference to the ColumnMeta layer. While creating new cell meta objects, all new objects\n * inherit properties from the ColumnMeta layer.\n *\n * @type {ColumnMeta}\n */\n this.columnMeta = columnMeta;\n /**\n * Holder for cell meta objects, organized as a grid of LazyFactoryMap of LazyFactoryMaps.\n * The access to the cell meta object is done through access to the row defined by the physical\n * row index and then by accessing the second LazyFactory Map under the physical column index.\n *\n * @type {LazyFactoryMap>}\n */\n\n this.metas = new LazyFactoryMap(function () {\n return _this._createRow();\n });\n }\n /**\n * Updates cell meta object by merging settings with the current state.\n *\n * @param {number} physicalRow The physical row index which points what cell meta object is updated.\n * @param {number} physicalColumn The physical column index which points what cell meta object is updated.\n * @param {object} settings An object to merge with.\n */\n\n\n _createClass(CellMeta, [{\n key: \"updateMeta\",\n value: function updateMeta(physicalRow, physicalColumn, settings) {\n var meta = this.getMeta(physicalRow, physicalColumn);\n extend(meta, settings);\n extend(meta, expandMetaType(settings.type, meta));\n }\n /**\n * Creates one or more rows at specific position.\n *\n * @param {number} physicalRow The physical row index which points from what position the row is added.\n * @param {number} amount An amount of rows to add.\n */\n\n }, {\n key: \"createRow\",\n value: function createRow(physicalRow, amount) {\n this.metas.insert(physicalRow, amount);\n }\n /**\n * Creates one or more columns at specific position.\n *\n * @param {number} physicalColumn The physical column index which points from what position the column is added.\n * @param {number} amount An amount of columns to add.\n */\n\n }, {\n key: \"createColumn\",\n value: function createColumn(physicalColumn, amount) {\n for (var i = 0; i < this.metas.size(); i++) {\n this.metas.obtain(i).insert(physicalColumn, amount);\n }\n }\n /**\n * Removes one or more rows from the collection.\n *\n * @param {number} physicalRow The physical row index which points from what position the row is removed.\n * @param {number} amount An amount of rows to remove.\n */\n\n }, {\n key: \"removeRow\",\n value: function removeRow(physicalRow, amount) {\n this.metas.remove(physicalRow, amount);\n }\n /**\n * Removes one or more columns from the collection.\n *\n * @param {number} physicalColumn The physical column index which points from what position the column is removed.\n * @param {number} amount An amount of columns to remove.\n */\n\n }, {\n key: \"removeColumn\",\n value: function removeColumn(physicalColumn, amount) {\n for (var i = 0; i < this.metas.size(); i++) {\n this.metas.obtain(i).remove(physicalColumn, amount);\n }\n }\n /**\n * Gets settings object for this layer.\n *\n * @param {number} physicalRow The physical row index.\n * @param {number} physicalColumn The physical column index.\n * @param {string} [key] If the key exists its value will be returned, otherwise the whole cell meta object.\n * @returns {object}\n */\n\n }, {\n key: \"getMeta\",\n value: function getMeta(physicalRow, physicalColumn, key) {\n var cellMeta = this.metas.obtain(physicalRow).obtain(physicalColumn);\n\n if (key === void 0) {\n return cellMeta;\n }\n\n return cellMeta[key];\n }\n /**\n * Sets settings object for this layer defined by \"key\" property.\n *\n * @param {number} physicalRow The physical row index.\n * @param {number} physicalColumn The physical column index.\n * @param {string} key The property name to set.\n * @param {*} value Value to save.\n */\n\n }, {\n key: \"setMeta\",\n value: function setMeta(physicalRow, physicalColumn, key, value) {\n var cellMeta = this.metas.obtain(physicalRow).obtain(physicalColumn);\n cellMeta[key] = value;\n }\n /**\n * Removes a property defined by the \"key\" argument from the cell meta object.\n *\n * @param {number} physicalRow The physical row index.\n * @param {number} physicalColumn The physical column index.\n * @param {string} key The property name to remove.\n */\n\n }, {\n key: \"removeMeta\",\n value: function removeMeta(physicalRow, physicalColumn, key) {\n var cellMeta = this.metas.obtain(physicalRow).obtain(physicalColumn);\n delete cellMeta[key];\n }\n /**\n * Returns all cell meta objects that were created during the Handsontable operation. As cell meta\n * objects are created lazy, the length of the returned collection depends on how and when the\n * table has asked for access to that meta objects.\n *\n * @returns {object[]}\n */\n\n }, {\n key: \"getMetas\",\n value: function getMetas() {\n var metas = [];\n var rows = Array.from(this.metas.values());\n\n for (var row = 0; row < rows.length; row++) {\n metas.push.apply(metas, _toConsumableArray(rows[row].values()));\n }\n\n return metas;\n }\n /**\n * Returns all cell meta objects that were created during the Handsontable operation but for\n * specyfic row index.\n *\n * @param {number} physicalRow The physical row index.\n * @returns {object[]}\n */\n\n }, {\n key: \"getMetasAtRow\",\n value: function getMetasAtRow(physicalRow) {\n assert(function () {\n return isUnsignedNumber(physicalRow);\n }, 'Expecting an unsigned number.');\n var rowsMeta = new Map(this.metas);\n return rowsMeta.has(physicalRow) ? Array.from(rowsMeta.get(physicalRow).values()) : [];\n }\n /**\n * Clears all saved cell meta objects.\n */\n\n }, {\n key: \"clearCache\",\n value: function clearCache() {\n this.metas.clear();\n }\n /**\n * Creates and returns new structure for cell meta objects stored in columnar axis.\n *\n * @private\n * @returns {object}\n */\n\n }, {\n key: \"_createRow\",\n value: function _createRow() {\n var _this2 = this;\n\n return new LazyFactoryMap(function (physicalColumn) {\n return _this2._createMeta(physicalColumn);\n });\n }\n /**\n * Creates and returns new cell meta object with properties inherited from the column meta layer.\n *\n * @private\n * @param {number} physicalColumn The physical column index.\n * @returns {object}\n */\n\n }, {\n key: \"_createMeta\",\n value: function _createMeta(physicalColumn) {\n var ColumnMeta = this.columnMeta.getMetaConstructor(physicalColumn);\n return new ColumnMeta();\n }\n }]);\n\n return CellMeta;\n}();\n\nexport { CellMeta as default };","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport GlobalMeta from \"./metaLayers/globalMeta.mjs\";\nimport TableMeta from \"./metaLayers/tableMeta.mjs\";\nimport ColumnMeta from \"./metaLayers/columnMeta.mjs\";\nimport CellMeta from \"./metaLayers/cellMeta.mjs\";\n/**\n * With the Meta Manager class, it can be possible to manage with meta objects for different layers in\n * one place. All coordinates used to fetch, updating, removing, or creating rows or columns have to\n * be passed as physical values.\n *\n * The diagram of the meta layers:\n * +-------------+.\n * │ GlobalMeta │\n * │ (prototype) │\n * +-------------+\\\n * │ \\\n * │ \\\n * \\│/ _\\|\n * +-------------+ +-------------+.\n * │ TableMeta │ │ ColumnMeta │\n * │ (instance) │ │ (prototype) │\n * +-------------+ +-------------+.\n * │\n * │\n * \\│/\n * +-------------+.\n * │ CellMeta │\n * │ (instance) │\n * +-------------+.\n *\n * A more detailed description of the specific layers can be found in the \"metaLayers/\" modules description.\n */\n\nvar MetaManager = /*#__PURE__*/function () {\n function MetaManager() {\n var customSettings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, MetaManager);\n\n /**\n * @type {GlobalMeta}\n */\n this.globalMeta = new GlobalMeta();\n this.globalMeta.updateMeta(customSettings);\n /**\n * @type {TableMeta}\n */\n\n this.tableMeta = new TableMeta(this.globalMeta);\n /**\n * @type {ColumnMeta}\n */\n\n this.columnMeta = new ColumnMeta(this.globalMeta);\n /**\n * @type {CellMeta}\n */\n\n this.cellMeta = new CellMeta(this.columnMeta);\n }\n /**\n * Gets the global meta object that is a root of all default settings, which are recognizable by Handsontable.\n * Other layers inherites all properties from this. Adding, removing, or changing property in that\n * object has a direct reflection to all layers.\n *\n * @returns {object}\n */\n\n\n _createClass(MetaManager, [{\n key: \"getGlobalMeta\",\n value: function getGlobalMeta() {\n return this.globalMeta.getMeta();\n }\n /**\n * Updates global settings object by merging settings with the current state.\n *\n * @param {object} settings An object to merge with.\n */\n\n }, {\n key: \"updateGlobalMeta\",\n value: function updateGlobalMeta(settings) {\n this.globalMeta.updateMeta(settings);\n }\n /**\n * Gets settings object that was passed in the Handsontable constructor. That layer contains all\n * default settings inherited from the GlobalMeta layer merged with settings passed by the developer.\n * Adding, removing, or changing property in that object has no direct reflection on any other layers.\n *\n * @returns {object}\n */\n\n }, {\n key: \"getTableMeta\",\n value: function getTableMeta() {\n return this.tableMeta.getMeta();\n }\n /**\n * Updates table settings object by merging settings with the current state.\n *\n * @param {object} settings An object to merge with.\n */\n\n }, {\n key: \"updateTableMeta\",\n value: function updateTableMeta(settings) {\n this.tableMeta.updateMeta(settings);\n }\n /**\n * Gets column meta object that is a root of all settings defined in the column property of the Handsontable\n * settings. Each column in the Handsontable is associated with a unique meta object which identified by\n * the physical column index. Adding, removing, or changing property in that object has a direct reflection\n * only for the CellMeta layer. The reflection will be visible only if the property doesn't exist in the lower\n * layers (prototype lookup).\n *\n * @param {number} physicalColumn The physical column index.\n * @returns {object}\n */\n\n }, {\n key: \"getColumnMeta\",\n value: function getColumnMeta(physicalColumn) {\n return this.columnMeta.getMeta(physicalColumn);\n }\n /**\n * Updates column meta object by merging settings with the current state.\n *\n * @param {number} physicalColumn The physical column index which points what column meta object is updated.\n * @param {object} settings An object to merge with.\n */\n\n }, {\n key: \"updateColumnMeta\",\n value: function updateColumnMeta(physicalColumn, settings) {\n this.columnMeta.updateMeta(physicalColumn, settings);\n }\n /**\n * Gets the cell meta object that is a root of all settings defined for the specific cell rendered by\n * the Handsontable. Each cell meta inherits settings from higher layers. When a property doesn't\n * exist in that layer, it is looked up through a prototype to the highest layer. Starting\n * from CellMeta -> ColumnMeta and ending to GlobalMeta, which stores default settings. Adding,\n * removing, or changing property in that object has no direct reflection on any other layers.\n *\n * @param {number} physicalRow The physical row index.\n * @param {number} physicalColumn The physical column index.\n * @param {string} [key] If the key exists its value will be returned, otherwise the whole cell meta object.\n * @returns {object}\n */\n\n }, {\n key: \"getCellMeta\",\n value: function getCellMeta(physicalRow, physicalColumn, key) {\n return this.cellMeta.getMeta(physicalRow, physicalColumn, key);\n }\n /**\n * Sets settings object for cell meta object defined by \"key\" property.\n *\n * @param {number} physicalRow The physical row index.\n * @param {number} physicalColumn The physical column index.\n * @param {string} key The property name to set.\n * @param {*} value Value to save.\n */\n\n }, {\n key: \"setCellMeta\",\n value: function setCellMeta(physicalRow, physicalColumn, key, value) {\n this.cellMeta.setMeta(physicalRow, physicalColumn, key, value);\n }\n /**\n * Updates cell meta object by merging settings with the current state.\n *\n * @param {number} physicalRow The physical row index which points what cell meta object is updated.\n * @param {number} physicalColumn The physical column index which points what cell meta object is updated.\n * @param {object} settings An object to merge with.\n */\n\n }, {\n key: \"updateCellMeta\",\n value: function updateCellMeta(physicalRow, physicalColumn, settings) {\n this.cellMeta.updateMeta(physicalRow, physicalColumn, settings);\n }\n /**\n * Removes a property defined by the \"key\" argument from the cell meta object.\n *\n * @param {number} physicalRow The physical row index.\n * @param {number} physicalColumn The physical column index.\n * @param {string} key The property name to remove.\n */\n\n }, {\n key: \"removeCellMeta\",\n value: function removeCellMeta(physicalRow, physicalColumn, key) {\n this.cellMeta.removeMeta(physicalRow, physicalColumn, key);\n }\n /**\n * Returns all cell meta objects that were created during the Handsontable operation. As cell meta\n * objects are created lazy, the length of the returned collection depends on how and when the\n * table has asked for access to that meta objects.\n *\n * @returns {object[]}\n */\n\n }, {\n key: \"getCellsMeta\",\n value: function getCellsMeta() {\n return this.cellMeta.getMetas();\n }\n /**\n * Returns all cell meta objects that were created during the Handsontable operation but for\n * specyfic row index.\n *\n * @param {number} physicalRow The physical row index.\n * @returns {object[]}\n */\n\n }, {\n key: \"getCellsMetaAtRow\",\n value: function getCellsMetaAtRow(physicalRow) {\n return this.cellMeta.getMetasAtRow(physicalRow);\n }\n /**\n * Creates one or more rows at specific position.\n *\n * @param {number} physicalRow The physical row index which points from what position the row is added.\n * @param {number} [amount=1] An amount of rows to add.\n */\n\n }, {\n key: \"createRow\",\n value: function createRow(physicalRow) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n this.cellMeta.createRow(physicalRow, amount);\n }\n /**\n * Removes one or more rows from the collection.\n *\n * @param {number} physicalRow The physical row index which points from what position the row is removed.\n * @param {number} [amount=1] An amount rows to remove.\n */\n\n }, {\n key: \"removeRow\",\n value: function removeRow(physicalRow) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n this.cellMeta.removeRow(physicalRow, amount);\n }\n /**\n * Creates one or more columns at specific position.\n *\n * @param {number} physicalColumn The physical column index which points from what position the column is added.\n * @param {number} [amount=1] An amount of columns to add.\n */\n\n }, {\n key: \"createColumn\",\n value: function createColumn(physicalColumn) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n this.cellMeta.createColumn(physicalColumn, amount);\n this.columnMeta.createColumn(physicalColumn, amount);\n }\n /**\n * Removes one or more columns from the collection.\n *\n * @param {number} physicalColumn The physical column index which points from what position the column is removed.\n * @param {number} [amount=1] An amount of columns to remove.\n */\n\n }, {\n key: \"removeColumn\",\n value: function removeColumn(physicalColumn) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n this.cellMeta.removeColumn(physicalColumn, amount);\n this.columnMeta.removeColumn(physicalColumn, amount);\n }\n /**\n * Clears all saved cell meta objects. It keeps column meta, table meta, and global meta intact.\n */\n\n }, {\n key: \"clearCellsCache\",\n value: function clearCellsCache() {\n this.cellMeta.clearCache();\n }\n /**\n * Clears all saved cell and columns meta objects.\n */\n\n }, {\n key: \"clearCache\",\n value: function clearCache() {\n this.cellMeta.clearCache();\n this.columnMeta.clearCache();\n }\n }]);\n\n return MetaManager;\n}();\n\nexport { MetaManager as default };","import \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.match.js\";\nimport \"core-js/modules/es.string.replace.js\";\nimport \"core-js/modules/es.string.starts-with.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.array.join.js\";\nimport \"core-js/modules/es.array.fill.js\";\nimport \"core-js/modules/es.array.index-of.js\";\n\n/* eslint-disable jsdoc/require-description-complete-sentence */\n\n/**\n * SheetClip - Spreadsheet Clipboard Parser.\n * version 0.2\n *\n * This tiny library transforms JavaScript arrays to strings that are pasteable by LibreOffice, OpenOffice,\n * Google Docs and Microsoft Excel.\n *\n * Copyright 2012, Marcin Warpechowski\n * Licensed under the MIT license.\n * http://github.com/warpech/sheetclip/\n */\nvar regUniversalNewLine = /^(\\r\\n|\\n\\r|\\r|\\n)/;\nvar regNextCellNoQuotes = /^[^\\t\\r\\n]+/;\nvar regNextEmptyCell = /^\\t/;\n/**\n * Decode spreadsheet string into array.\n *\n * @param {string} str The string to parse.\n * @returns {Array}\n */\n\nexport function parse(str) {\n var arr = [['']];\n\n if (str.length === 0) {\n return arr;\n }\n\n var column = 0;\n var row = 0;\n var lastLength;\n\n while (str.length > 0) {\n if (lastLength === str.length) {\n // In the case If in last cycle we didn't match anything, we have to leave the infinite loop\n break;\n }\n\n lastLength = str.length;\n\n if (str.match(regNextEmptyCell)) {\n str = str.replace(regNextEmptyCell, '');\n column += 1;\n arr[row][column] = '';\n } else if (str.match(regUniversalNewLine)) {\n str = str.replace(regUniversalNewLine, '');\n column = 0;\n row += 1;\n arr[row] = [''];\n } else {\n var nextCell = '';\n\n if (str.startsWith('\"')) {\n var quoteNo = 0;\n var isStillCell = true;\n\n while (isStillCell) {\n var nextChar = str.slice(0, 1);\n\n if (nextChar === '\"') {\n quoteNo += 1;\n }\n\n nextCell += nextChar;\n str = str.slice(1);\n\n if (str.length === 0 || str.match(/^[\\t\\r\\n]/) && quoteNo % 2 === 0) {\n isStillCell = false;\n }\n }\n\n nextCell = nextCell.replace(/^\"/, '').replace(/\"$/, '').replace(/[\"]*/g, function (match) {\n return new Array(Math.floor(match.length / 2)).fill('\"').join('');\n });\n } else {\n var matchedText = str.match(regNextCellNoQuotes);\n nextCell = matchedText ? matchedText[0] : '';\n str = str.slice(nextCell.length);\n }\n\n arr[row][column] = nextCell;\n }\n }\n\n return arr;\n}\n/**\n * Encode array into valid spreadsheet string.\n *\n * @param {Array} arr An array of arrays to stringify.\n * @returns {string}\n */\n\nexport function stringify(arr) {\n var r;\n var rLen;\n var c;\n var cLen;\n var str = '';\n var val;\n\n for (r = 0, rLen = arr.length; r < rLen; r += 1) {\n cLen = arr[r].length;\n\n for (c = 0; c < cLen; c += 1) {\n if (c > 0) {\n str += '\\t';\n }\n\n val = arr[r][c];\n\n if (typeof val === 'string') {\n if (val.indexOf('\\n') > -1) {\n str += \"\\\"\".concat(val.replace(/\"/g, '\"\"'), \"\\\"\");\n } else {\n str += val;\n }\n } else if (val === null || val === void 0) {\n // void 0 resolves to undefined\n str += '';\n } else {\n str += val;\n }\n }\n\n if (r !== rLen - 1) {\n str += '\\n';\n }\n }\n\n return str;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.number.is-integer.js\";\nimport \"core-js/modules/es.number.constructor.js\";\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.array.splice.js\";\nimport \"core-js/modules/es.array.sort.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.split.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { stringify } from \"./3rdparty/SheetClip/index.mjs\";\nimport { cellMethodLookupFactory, countFirstRowKeys as _countFirstRowKeys } from \"./helpers/data.mjs\";\nimport { createObjectPropListener, deepClone, deepExtend, deepObjectSize, duckSchema, hasOwnProperty, isObject, objectEach } from \"./helpers/object.mjs\";\nimport { extendArray, to2dArray } from \"./helpers/array.mjs\";\nimport { rangeEach } from \"./helpers/number.mjs\";\nimport { isDefined } from \"./helpers/mixed.mjs\";\nvar copyableLookup = cellMethodLookupFactory('copyable', false);\n/**\n * Utility class that gets and saves data from/to the data source using mapping of columns numbers to object property names.\n *\n * @todo Refactor arguments of methods getRange, getText to be numbers (not objects).\n * @todo Remove priv, GridSettings from object constructor.\n *\n * @util\n * @class DataMap\n * @private\n */\n\nvar DataMap = /*#__PURE__*/function () {\n /**\n * @param {object} instance Instance of Handsontable.\n * @param {Array} data Array of arrays or array of objects containing data.\n * @param {TableMeta} tableMeta The table meta instance.\n */\n function DataMap(instance, data, tableMeta) {\n _classCallCheck(this, DataMap);\n\n /**\n * Instance of {@link Handsontable}.\n *\n * @private\n * @type {Handsontable}\n */\n this.instance = instance;\n /**\n * Instance of {@link TableMeta}.\n *\n * @private\n * @type {TableMeta}\n */\n\n this.tableMeta = tableMeta;\n /**\n * Reference to the original dataset.\n *\n * @type {*}\n */\n\n this.dataSource = data;\n /**\n * Generated schema based on the first row from the source data.\n *\n * @type {object}\n */\n\n this.duckSchema = this.dataSource && this.dataSource[0] ? duckSchema(this.dataSource[0]) : {};\n /**\n * Cached array of properties to columns.\n *\n * @type {Array}\n */\n\n this.colToPropCache = void 0;\n /**\n * Cached map of properties to columns.\n *\n * @type {Map}\n */\n\n this.propToColCache = void 0;\n this.createMap();\n }\n /**\n * Generates cache for property to and from column addressation.\n */\n\n\n _createClass(DataMap, [{\n key: \"createMap\",\n value: function createMap() {\n var schema = this.getSchema();\n\n if (typeof schema === 'undefined') {\n throw new Error('trying to create `columns` definition but you didn\\'t provide `schema` nor `data`');\n }\n\n var columns = this.tableMeta.columns;\n var i;\n this.colToPropCache = [];\n this.propToColCache = new Map();\n\n if (columns) {\n var columnsLen = 0;\n var filteredIndex = 0;\n var columnsAsFunc = false;\n\n if (typeof columns === 'function') {\n var schemaLen = deepObjectSize(schema);\n columnsLen = schemaLen > 0 ? schemaLen : this.countFirstRowKeys();\n columnsAsFunc = true;\n } else {\n var maxCols = this.tableMeta.maxCols;\n columnsLen = Math.min(maxCols, columns.length);\n }\n\n for (i = 0; i < columnsLen; i++) {\n var column = columnsAsFunc ? columns(i) : columns[i];\n\n if (isObject(column)) {\n if (typeof column.data !== 'undefined') {\n var index = columnsAsFunc ? filteredIndex : i;\n this.colToPropCache[index] = column.data;\n this.propToColCache.set(column.data, index);\n }\n\n filteredIndex += 1;\n }\n }\n } else {\n this.recursiveDuckColumns(schema);\n }\n }\n /**\n * Get the amount of physical columns in the first data row.\n *\n * @returns {number} Amount of physical columns in the first data row.\n */\n\n }, {\n key: \"countFirstRowKeys\",\n value: function countFirstRowKeys() {\n return _countFirstRowKeys(this.dataSource);\n }\n /**\n * Generates columns' translation cache.\n *\n * @param {object} schema An object to generate schema from.\n * @param {number} lastCol The column index.\n * @param {number} parent The property cache for recursive calls.\n * @returns {number}\n */\n\n }, {\n key: \"recursiveDuckColumns\",\n value: function recursiveDuckColumns(schema, lastCol, parent) {\n var _this = this;\n\n var lastColumn = lastCol;\n var propertyParent = parent;\n var prop;\n\n if (typeof lastColumn === 'undefined') {\n lastColumn = 0;\n propertyParent = '';\n }\n\n if (_typeof(schema) === 'object' && !Array.isArray(schema)) {\n objectEach(schema, function (value, key) {\n if (value === null) {\n prop = propertyParent + key;\n\n _this.colToPropCache.push(prop);\n\n _this.propToColCache.set(prop, lastColumn);\n\n lastColumn += 1;\n } else {\n lastColumn = _this.recursiveDuckColumns(value, lastColumn, \"\".concat(key, \".\"));\n }\n });\n }\n\n return lastColumn;\n }\n /**\n * Returns property name that corresponds with the given column index.\n *\n * @param {string|number} column Visual column index or another passed argument.\n * @returns {string|number} Column property, physical column index or passed argument.\n */\n\n }, {\n key: \"colToProp\",\n value: function colToProp(column) {\n // TODO: Should it work? Please, look at the test:\n // \"it should return the provided property name, when the user passes a property name as a column number\".\n if (Number.isInteger(column) === false) {\n return column;\n }\n\n var physicalColumn = this.instance.toPhysicalColumn(column); // Out of range, not visible column index.\n\n if (physicalColumn === null) {\n return column;\n } // Cached property.\n\n\n if (this.colToPropCache && isDefined(this.colToPropCache[physicalColumn])) {\n return this.colToPropCache[physicalColumn];\n }\n\n return physicalColumn;\n }\n /**\n * Translates property into visual column index.\n *\n * @param {string|number} prop Column property which may be also a physical column index.\n * @returns {string|number} Visual column index or passed argument.\n */\n\n }, {\n key: \"propToCol\",\n value: function propToCol(prop) {\n var cachedPhysicalIndex = this.propToColCache.get(prop);\n\n if (isDefined(cachedPhysicalIndex)) {\n return this.instance.toVisualColumn(cachedPhysicalIndex);\n } // Property may be a physical column index.\n\n\n var visualColumn = this.instance.toVisualColumn(prop);\n\n if (visualColumn === null) {\n return prop;\n }\n\n return visualColumn;\n }\n /**\n * Returns data's schema.\n *\n * @returns {object}\n */\n\n }, {\n key: \"getSchema\",\n value: function getSchema() {\n var schema = this.tableMeta.dataSchema;\n\n if (schema) {\n if (typeof schema === 'function') {\n return schema();\n }\n\n return schema;\n }\n\n return this.duckSchema;\n }\n /**\n * Creates row at the bottom of the data array.\n *\n * @param {number} [index] Physical index of the row before which the new row will be inserted.\n * @param {number} [amount=1] An amount of rows to add.\n * @param {string} [source] Source of method call.\n * @fires Hooks#afterCreateRow\n * @returns {number} Returns number of created rows.\n */\n\n }, {\n key: \"createRow\",\n value: function createRow(index) {\n var _this2 = this;\n\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var source = arguments.length > 2 ? arguments[2] : undefined;\n var sourceRowsCount = this.instance.countSourceRows();\n var physicalRowIndex = sourceRowsCount;\n var numberOfCreatedRows = 0;\n var rowIndex = index;\n\n if (typeof rowIndex !== 'number' || rowIndex >= sourceRowsCount) {\n rowIndex = sourceRowsCount;\n }\n\n if (rowIndex < this.instance.countRows()) {\n physicalRowIndex = this.instance.toPhysicalRow(rowIndex);\n }\n\n var continueProcess = this.instance.runHooks('beforeCreateRow', rowIndex, amount, source);\n\n if (continueProcess === false || physicalRowIndex === null) {\n return 0;\n }\n\n var maxRows = this.tableMeta.maxRows;\n var columnCount = this.instance.countCols();\n var rowsToAdd = [];\n\n var _loop = function _loop() {\n var row = null;\n\n if (_this2.instance.dataType === 'array') {\n if (_this2.tableMeta.dataSchema) {\n // Clone template array\n row = deepClone(_this2.getSchema());\n } else {\n row = [];\n /* eslint-disable no-loop-func */\n\n rangeEach(columnCount - 1, function () {\n return row.push(null);\n });\n }\n } else if (_this2.instance.dataType === 'function') {\n row = _this2.tableMeta.dataSchema(rowIndex + numberOfCreatedRows);\n } else {\n row = {};\n deepExtend(row, _this2.getSchema());\n }\n\n rowsToAdd.push(row);\n numberOfCreatedRows += 1;\n };\n\n while (numberOfCreatedRows < amount && sourceRowsCount + numberOfCreatedRows < maxRows) {\n _loop();\n }\n\n this.instance.rowIndexMapper.insertIndexes(rowIndex, numberOfCreatedRows);\n this.spliceData.apply(this, [physicalRowIndex, 0].concat(rowsToAdd));\n this.instance.runHooks('afterCreateRow', rowIndex, numberOfCreatedRows, source);\n this.instance.forceFullRender = true; // used when data was changed\n\n return numberOfCreatedRows;\n }\n /**\n * Creates column at the right of the data array.\n *\n * @param {number} [index] Visual index of the column before which the new column will be inserted.\n * @param {number} [amount=1] An amount of columns to add.\n * @param {string} [source] Source of method call.\n * @fires Hooks#afterCreateCol\n * @returns {number} Returns number of created columns.\n */\n\n }, {\n key: \"createCol\",\n value: function createCol(index) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var source = arguments.length > 2 ? arguments[2] : undefined;\n\n if (!this.instance.isColumnModificationAllowed()) {\n throw new Error('Cannot create new column. When data source in an object, ' + 'you can only have as much columns as defined in first data row, data schema or in the \\'columns\\' setting.' + 'If you want to be able to add new columns, you have to use array datasource.');\n }\n\n var dataSource = this.dataSource;\n var maxCols = this.tableMeta.maxCols;\n var columnIndex = index;\n\n if (typeof columnIndex !== 'number' || columnIndex >= this.instance.countSourceCols()) {\n columnIndex = this.instance.countSourceCols();\n }\n\n var continueProcess = this.instance.runHooks('beforeCreateCol', columnIndex, amount, source);\n\n if (continueProcess === false) {\n return 0;\n }\n\n var physicalColumnIndex = this.instance.countSourceCols();\n\n if (columnIndex < this.instance.countCols()) {\n physicalColumnIndex = this.instance.toPhysicalColumn(columnIndex);\n }\n\n var numberOfSourceRows = this.instance.countSourceRows();\n var nrOfColumns = this.instance.countCols();\n var numberOfCreatedCols = 0;\n var currentIndex = physicalColumnIndex;\n\n while (numberOfCreatedCols < amount && nrOfColumns < maxCols) {\n if (typeof columnIndex !== 'number' || columnIndex >= nrOfColumns) {\n if (numberOfSourceRows > 0) {\n for (var row = 0; row < numberOfSourceRows; row += 1) {\n if (typeof dataSource[row] === 'undefined') {\n dataSource[row] = [];\n }\n\n dataSource[row].push(null);\n }\n } else {\n dataSource.push([null]);\n }\n } else {\n for (var _row = 0; _row < numberOfSourceRows; _row++) {\n dataSource[_row].splice(currentIndex, 0, null);\n }\n }\n\n numberOfCreatedCols += 1;\n currentIndex += 1;\n nrOfColumns += 1;\n }\n\n this.instance.columnIndexMapper.insertIndexes(columnIndex, numberOfCreatedCols);\n this.instance.runHooks('afterCreateCol', columnIndex, numberOfCreatedCols, source);\n this.instance.forceFullRender = true; // used when data was changed\n\n return numberOfCreatedCols;\n }\n /**\n * Removes row from the data array.\n *\n * @fires Hooks#beforeRemoveRow\n * @fires Hooks#afterRemoveRow\n * @param {number} [index] Visual index of the row to be removed. If not provided, the last row will be removed.\n * @param {number} [amount=1] Amount of the rows to be removed. If not provided, one row will be removed.\n * @param {string} [source] Source of method call.\n * @returns {boolean} Returns `false` when action was cancelled, otherwise `true`.\n */\n\n }, {\n key: \"removeRow\",\n value: function removeRow(index) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var source = arguments.length > 2 ? arguments[2] : undefined;\n var rowIndex = Number.isInteger(index) ? index : -amount; // -amount = taking indexes from the end.\n\n var removedPhysicalIndexes = this.visualRowsToPhysical(rowIndex, amount);\n var sourceRowsLength = this.instance.countSourceRows();\n rowIndex = (sourceRowsLength + rowIndex) % sourceRowsLength; // It handle also callback from the `NestedRows` plugin. Removing parent node has effect in removing children nodes.\n\n var actionWasNotCancelled = this.instance.runHooks('beforeRemoveRow', rowIndex, removedPhysicalIndexes.length, removedPhysicalIndexes, source);\n\n if (actionWasNotCancelled === false) {\n return false;\n }\n\n var data = this.dataSource; // List of removed indexes might be changed in the `beforeRemoveRow` hook. There may be new values.\n\n var numberOfRemovedIndexes = removedPhysicalIndexes.length;\n var newData = this.filterData(rowIndex, numberOfRemovedIndexes, removedPhysicalIndexes);\n\n if (newData) {\n data.length = 0;\n Array.prototype.push.apply(data, newData);\n } // TODO: Function `removeRow` should validate fully, probably above.\n\n\n if (rowIndex < this.instance.countRows()) {\n this.instance.rowIndexMapper.removeIndexes(removedPhysicalIndexes);\n var customDefinedColumns = isDefined(this.tableMeta.columns) || isDefined(this.tableMeta.dataSchema); // All rows have been removed. There shouldn't be any columns.\n\n if (this.instance.rowIndexMapper.getNotTrimmedIndexesLength() === 0 && customDefinedColumns === false) {\n this.instance.columnIndexMapper.setIndexesSequence([]);\n }\n }\n\n this.instance.runHooks('afterRemoveRow', rowIndex, numberOfRemovedIndexes, removedPhysicalIndexes, source);\n this.instance.forceFullRender = true; // used when data was changed\n\n return true;\n }\n /**\n * Removes column from the data array.\n *\n * @fires Hooks#beforeRemoveCol\n * @fires Hooks#afterRemoveCol\n * @param {number} [index] Visual index of the column to be removed. If not provided, the last column will be removed.\n * @param {number} [amount=1] Amount of the columns to be removed. If not provided, one column will be removed.\n * @param {string} [source] Source of method call.\n * @returns {boolean} Returns `false` when action was cancelled, otherwise `true`.\n */\n\n }, {\n key: \"removeCol\",\n value: function removeCol(index) {\n var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var source = arguments.length > 2 ? arguments[2] : undefined;\n\n if (this.instance.dataType === 'object' || this.tableMeta.columns) {\n throw new Error('cannot remove column with object data source or columns option specified');\n }\n\n var columnIndex = typeof index !== 'number' ? -amount : index;\n columnIndex = (this.instance.countCols() + columnIndex) % this.instance.countCols();\n var logicColumns = this.visualColumnsToPhysical(columnIndex, amount);\n var descendingLogicColumns = logicColumns.slice(0).sort(function (a, b) {\n return b - a;\n });\n var actionWasNotCancelled = this.instance.runHooks('beforeRemoveCol', columnIndex, amount, logicColumns, source);\n\n if (actionWasNotCancelled === false) {\n return false;\n }\n\n var isTableUniform = true;\n var removedColumnsCount = descendingLogicColumns.length;\n var data = this.dataSource;\n\n for (var c = 0; c < removedColumnsCount; c++) {\n if (isTableUniform && logicColumns[0] !== logicColumns[c] - c) {\n isTableUniform = false;\n }\n }\n\n if (isTableUniform) {\n for (var r = 0, rlen = this.instance.countSourceRows(); r < rlen; r++) {\n data[r].splice(logicColumns[0], amount);\n }\n } else {\n for (var _r = 0, _rlen = this.instance.countSourceRows(); _r < _rlen; _r++) {\n for (var _c = 0; _c < removedColumnsCount; _c++) {\n data[_r].splice(descendingLogicColumns[_c], 1);\n }\n }\n } // TODO: Function `removeCol` should validate fully, probably above.\n\n\n if (columnIndex < this.instance.countCols()) {\n this.instance.columnIndexMapper.removeIndexes(logicColumns); // All columns have been removed. There shouldn't be any rows.\n\n if (this.instance.columnIndexMapper.getNotTrimmedIndexesLength() === 0) {\n this.instance.rowIndexMapper.setIndexesSequence([]);\n }\n }\n\n this.instance.runHooks('afterRemoveCol', columnIndex, amount, logicColumns, source);\n this.instance.forceFullRender = true; // used when data was changed\n\n return true;\n }\n /**\n * Add/Removes data from the column.\n *\n * @param {number} col Physical index of column in which do you want to do splice.\n * @param {number} index Index at which to start changing the array. If negative, will begin that many elements from the end.\n * @param {number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed.\n * @param {Array} [elements] The new columns to add.\n * @returns {Array} Returns removed portion of columns.\n */\n\n }, {\n key: \"spliceCol\",\n value: function spliceCol(col, index, amount) {\n var colData = this.instance.getDataAtCol(col);\n var removed = colData.slice(index, index + amount);\n var after = colData.slice(index + amount);\n\n for (var _len = arguments.length, elements = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {\n elements[_key - 3] = arguments[_key];\n }\n\n extendArray(elements, after);\n var i = 0;\n\n while (i < amount) {\n elements.push(null); // add null in place of removed elements\n\n i += 1;\n }\n\n to2dArray(elements);\n this.instance.populateFromArray(index, col, elements, null, null, 'spliceCol');\n return removed;\n }\n /**\n * Add/Removes data from the row.\n *\n * @param {number} row Physical index of row in which do you want to do splice.\n * @param {number} index Index at which to start changing the array. If negative, will begin that many elements from the end.\n * @param {number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed.\n * @param {Array} [elements] The new rows to add.\n * @returns {Array} Returns removed portion of rows.\n */\n\n }, {\n key: \"spliceRow\",\n value: function spliceRow(row, index, amount) {\n var rowData = this.instance.getSourceDataAtRow(row);\n var removed = rowData.slice(index, index + amount);\n var after = rowData.slice(index + amount);\n\n for (var _len2 = arguments.length, elements = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {\n elements[_key2 - 3] = arguments[_key2];\n }\n\n extendArray(elements, after);\n var i = 0;\n\n while (i < amount) {\n elements.push(null); // add null in place of removed elements\n\n i += 1;\n }\n\n this.instance.populateFromArray(row, index, [elements], null, null, 'spliceRow');\n return removed;\n }\n /**\n * Add/remove row(s) to/from the data source.\n *\n * @param {number} index Physical index of the element to add/remove.\n * @param {number} amount Number of rows to add/remove.\n * @param {...object} elements Row elements to be added.\n */\n\n }, {\n key: \"spliceData\",\n value: function spliceData(index, amount) {\n for (var _len3 = arguments.length, elements = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n elements[_key3 - 2] = arguments[_key3];\n }\n\n var continueSplicing = this.instance.runHooks('beforeDataSplice', index, amount, elements);\n\n if (continueSplicing !== false) {\n var _this$dataSource;\n\n (_this$dataSource = this.dataSource).splice.apply(_this$dataSource, [index, amount].concat(elements));\n }\n }\n /**\n * Filter unwanted data elements from the data source.\n *\n * @param {number} index Visual index of the element to remove.\n * @param {number} amount Number of rows to add/remove.\n * @param {number} physicalRows Physical row indexes.\n * @returns {Array}\n */\n\n }, {\n key: \"filterData\",\n value: function filterData(index, amount, physicalRows) {\n var continueSplicing = this.instance.runHooks('beforeDataFilter', index, amount, physicalRows);\n\n if (continueSplicing !== false) {\n var newData = this.dataSource.filter(function (row, rowIndex) {\n return physicalRows.indexOf(rowIndex) === -1;\n });\n return newData;\n }\n }\n /**\n * Returns single value from the data array.\n *\n * @param {number} row Visual row index.\n * @param {number} prop The column property.\n * @returns {*}\n */\n\n }, {\n key: \"get\",\n value: function get(row, prop) {\n var physicalRow = this.instance.toPhysicalRow(row);\n var dataRow = this.dataSource[physicalRow]; // TODO: To remove, use 'modifyData' hook instead (see below)\n\n var modifiedRowData = this.instance.runHooks('modifyRowData', physicalRow);\n dataRow = isNaN(modifiedRowData) ? modifiedRowData : dataRow; //\n\n var value = null; // try to get value under property `prop` (includes dot)\n\n if (dataRow && dataRow.hasOwnProperty && hasOwnProperty(dataRow, prop)) {\n value = dataRow[prop];\n } else if (typeof prop === 'string' && prop.indexOf('.') > -1) {\n var sliced = prop.split('.');\n var out = dataRow;\n\n if (!out) {\n return null;\n }\n\n for (var i = 0, ilen = sliced.length; i < ilen; i++) {\n out = out[sliced[i]];\n\n if (typeof out === 'undefined') {\n return null;\n }\n }\n\n value = out;\n } else if (typeof prop === 'function') {\n /**\n * Allows for interacting with complex structures, for example\n * d3/jQuery getter/setter properties:\n *\n * {columns: [{\n * data: function(row, value){\n * if(arguments.length === 1){\n * return row.property();\n * }\n * row.property(value);\n * }\n * }]}.\n */\n value = prop(this.dataSource.slice(physicalRow, physicalRow + 1)[0]);\n }\n\n if (this.instance.hasHook('modifyData')) {\n var valueHolder = createObjectPropListener(value);\n this.instance.runHooks('modifyData', physicalRow, this.propToCol(prop), valueHolder, 'get');\n\n if (valueHolder.isTouched()) {\n value = valueHolder.value;\n }\n }\n\n return value;\n }\n /**\n * Returns single value from the data array (intended for clipboard copy to an external application).\n *\n * @param {number} row Physical row index.\n * @param {number} prop The column property.\n * @returns {string}\n */\n\n }, {\n key: \"getCopyable\",\n value: function getCopyable(row, prop) {\n if (copyableLookup.call(this.instance, row, this.propToCol(prop))) {\n return this.get(row, prop);\n }\n\n return '';\n }\n /**\n * Saves single value to the data array.\n *\n * @param {number} row Visual row index.\n * @param {number} prop The column property.\n * @param {string} value The value to set.\n */\n\n }, {\n key: \"set\",\n value: function set(row, prop, value) {\n var physicalRow = this.instance.toPhysicalRow(row);\n var newValue = value;\n var dataRow = this.dataSource[physicalRow]; // TODO: To remove, use 'modifyData' hook instead (see below)\n\n var modifiedRowData = this.instance.runHooks('modifyRowData', physicalRow);\n dataRow = isNaN(modifiedRowData) ? modifiedRowData : dataRow; //\n\n if (this.instance.hasHook('modifyData')) {\n var valueHolder = createObjectPropListener(newValue);\n this.instance.runHooks('modifyData', physicalRow, this.propToCol(prop), valueHolder, 'set');\n\n if (valueHolder.isTouched()) {\n newValue = valueHolder.value;\n }\n } // try to set value under property `prop` (includes dot)\n\n\n if (dataRow && dataRow.hasOwnProperty && hasOwnProperty(dataRow, prop)) {\n dataRow[prop] = newValue;\n } else if (typeof prop === 'string' && prop.indexOf('.') > -1) {\n var sliced = prop.split('.');\n var out = dataRow;\n var i = 0;\n var ilen;\n\n for (i = 0, ilen = sliced.length - 1; i < ilen; i++) {\n if (typeof out[sliced[i]] === 'undefined') {\n out[sliced[i]] = {};\n }\n\n out = out[sliced[i]];\n }\n\n out[sliced[i]] = newValue;\n } else if (typeof prop === 'function') {\n /* see the `function` handler in `get` */\n prop(this.dataSource.slice(physicalRow, physicalRow + 1)[0], newValue);\n } else {\n dataRow[prop] = newValue;\n }\n }\n /**\n * This ridiculous piece of code maps rows Id that are present in table data to those displayed for user.\n * The trick is, the physical row id (stored in settings.data) is not necessary the same\n * as the visual (displayed) row id (e.g. When sorting is applied).\n *\n * @param {number} index Visual row index.\n * @param {number} amount An amount of rows to translate.\n * @returns {number}\n */\n\n }, {\n key: \"visualRowsToPhysical\",\n value: function visualRowsToPhysical(index, amount) {\n var totalRows = this.instance.countSourceRows();\n var logicRows = [];\n var physicRow = (totalRows + index) % totalRows;\n var rowsToRemove = amount;\n var row;\n\n while (physicRow < totalRows && rowsToRemove) {\n row = this.instance.toPhysicalRow(physicRow);\n logicRows.push(row);\n rowsToRemove -= 1;\n physicRow += 1;\n }\n\n return logicRows;\n }\n /**\n *\n * @param {number} index Visual column index.\n * @param {number} amount An amount of rows to translate.\n * @returns {Array}\n */\n\n }, {\n key: \"visualColumnsToPhysical\",\n value: function visualColumnsToPhysical(index, amount) {\n var totalCols = this.instance.countCols();\n var visualCols = [];\n var physicalCol = (totalCols + index) % totalCols;\n var colsToRemove = amount;\n\n while (physicalCol < totalCols && colsToRemove) {\n var col = this.instance.toPhysicalColumn(physicalCol);\n visualCols.push(col);\n colsToRemove -= 1;\n physicalCol += 1;\n }\n\n return visualCols;\n }\n /**\n * Clears the data array.\n */\n\n }, {\n key: \"clear\",\n value: function clear() {\n for (var r = 0; r < this.instance.countSourceRows(); r++) {\n for (var c = 0; c < this.instance.countCols(); c++) {\n this.set(r, this.colToProp(c), '');\n }\n }\n }\n /**\n * Get data length.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getLength\",\n value: function getLength() {\n var maxRowsFromSettings = this.tableMeta.maxRows;\n var maxRows;\n\n if (maxRowsFromSettings < 0 || maxRowsFromSettings === 0) {\n maxRows = 0;\n } else {\n maxRows = maxRowsFromSettings || Infinity;\n }\n\n var length = this.instance.rowIndexMapper.getNotTrimmedIndexesLength();\n return Math.min(length, maxRows);\n }\n /**\n * Returns the data array.\n *\n * @returns {Array}\n */\n\n }, {\n key: \"getAll\",\n value: function getAll() {\n var start = {\n row: 0,\n col: 0\n };\n var end = {\n row: Math.max(this.instance.countRows() - 1, 0),\n col: Math.max(this.instance.countCols() - 1, 0)\n };\n\n if (start.row - end.row === 0 && !this.instance.countSourceRows()) {\n return [];\n }\n\n return this.getRange(start, end, DataMap.DESTINATION_RENDERER);\n }\n /**\n * Count the number of columns cached in the `colToProp` cache.\n *\n * @returns {number} Amount of cached columns.\n */\n\n }, {\n key: \"countCachedColumns\",\n value: function countCachedColumns() {\n return this.colToPropCache.length;\n }\n /**\n * Returns data range as array.\n *\n * @param {object} [start] Start selection position. Visual indexes.\n * @param {object} [end] End selection position. Visual indexes.\n * @param {number} destination Destination of datamap.get.\n * @returns {Array}\n */\n\n }, {\n key: \"getRange\",\n value: function getRange(start, end, destination) {\n var output = [];\n var r;\n var c;\n var row;\n var maxRows = this.tableMeta.maxRows;\n var maxCols = this.tableMeta.maxCols;\n\n if (maxRows === 0 || maxCols === 0) {\n return [];\n }\n\n var getFn = destination === DataMap.DESTINATION_CLIPBOARD_GENERATOR ? this.getCopyable : this.get;\n var rlen = Math.min(Math.max(maxRows - 1, 0), Math.max(start.row, end.row));\n var clen = Math.min(Math.max(maxCols - 1, 0), Math.max(start.col, end.col));\n\n for (r = Math.min(start.row, end.row); r <= rlen; r++) {\n row = []; // We just store indexes for rows without headers.\n\n var physicalRow = r >= 0 ? this.instance.toPhysicalRow(r) : r;\n\n for (c = Math.min(start.col, end.col); c <= clen; c++) {\n if (physicalRow === null) {\n break;\n }\n\n row.push(getFn.call(this, r, this.colToProp(c)));\n }\n\n if (physicalRow !== null) {\n output.push(row);\n }\n }\n\n return output;\n }\n /**\n * Return data as text (tab separated columns).\n *\n * @param {object} [start] Start selection position. Visual indexes.\n * @param {object} [end] End selection position. Visual indexes.\n * @returns {string}\n */\n\n }, {\n key: \"getText\",\n value: function getText(start, end) {\n return stringify(this.getRange(start, end, DataMap.DESTINATION_RENDERER));\n }\n /**\n * Return data as copyable text (tab separated columns intended for clipboard copy to an external application).\n *\n * @param {object} [start] Start selection position. Visual indexes.\n * @param {object} [end] End selection position. Visual indexes.\n * @returns {string}\n */\n\n }, {\n key: \"getCopyableText\",\n value: function getCopyableText(start, end) {\n return stringify(this.getRange(start, end, DataMap.DESTINATION_CLIPBOARD_GENERATOR));\n }\n /**\n * Destroy instance.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.instance = null;\n this.tableMeta = null;\n this.dataSource = null;\n this.duckSchema = null;\n this.colToPropCache.length = 0;\n this.propToColCache.clear();\n this.propToColCache = void 0;\n }\n }], [{\n key: \"DESTINATION_RENDERER\",\n get:\n /**\n * @type {number}\n */\n function get() {\n return 1;\n }\n /**\n * @type {number}\n */\n\n }, {\n key: \"DESTINATION_CLIPBOARD_GENERATOR\",\n get: function get() {\n return 2;\n }\n }]);\n\n return DataMap;\n}();\n\nexport default DataMap;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport \"core-js/modules/es.array.sort.js\";\nimport \"core-js/modules/es.array.splice.js\";\nimport \"core-js/modules/es.number.is-integer.js\";\nimport \"core-js/modules/es.number.constructor.js\";\nimport \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.replace.js\";\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.array.reverse.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/web.timers.js\";\nimport \"core-js/modules/web.immediate.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { addClass, empty, removeClass } from \"./helpers/dom/element.mjs\";\nimport { isFunction } from \"./helpers/function.mjs\";\nimport { isDefined, isUndefined, isRegExp, _injectProductInfo, isEmpty } from \"./helpers/mixed.mjs\";\nimport { isMobileBrowser, isIpadOS } from \"./helpers/browser.mjs\";\nimport EditorManager from \"./editorManager.mjs\";\nimport EventManager from \"./eventManager.mjs\";\nimport { deepClone, duckSchema, isObjectEqual, deepObjectSize, hasOwnProperty, createObjectPropListener, objectEach } from \"./helpers/object.mjs\";\nimport { arrayMap, arrayEach, arrayReduce, getDifferenceOfArrays, stringToArray } from \"./helpers/array.mjs\";\nimport { instanceToHTML } from \"./utils/parseTable.mjs\";\nimport { getPlugin, getPluginsNames } from \"./plugins/registry.mjs\";\nimport { getRenderer } from \"./renderers/registry.mjs\";\nimport { getValidator } from \"./validators/registry.mjs\";\nimport { randomString, toUpperCaseFirst } from \"./helpers/string.mjs\";\nimport { rangeEach, rangeEachReverse } from \"./helpers/number.mjs\";\nimport TableView from \"./tableView.mjs\";\nimport DataSource from \"./dataSource.mjs\";\nimport { translateRowsToColumns, cellMethodLookupFactory, spreadsheetColumnLabel } from \"./helpers/data.mjs\";\nimport { IndexMapper } from \"./translations/index.mjs\";\nimport { registerAsRootInstance, hasValidParameter, isRootInstance } from \"./utils/rootInstance.mjs\";\nimport { CellCoords, ViewportColumnsCalculator } from \"./3rdparty/walkontable/src/index.mjs\";\nimport Hooks from \"./pluginHooks.mjs\";\nimport { hasLanguageDictionary, getValidLanguageCode, getTranslatedPhrase } from \"./i18n/registry.mjs\";\nimport { warnUserAboutLanguageRegistration, normalizeLanguageCode } from \"./i18n/utils.mjs\";\nimport { startObserving as keyStateStartObserving, stopObserving as keyStateStopObserving } from \"./utils/keyStateObserver.mjs\";\nimport { Selection } from \"./selection/index.mjs\";\nimport { MetaManager, DataMap } from \"./dataMap/index.mjs\";\nimport { createUniqueMap } from \"./utils/dataStructures/uniqueMap.mjs\";\nvar activeGuid = null;\n/* eslint-disable jsdoc/require-description-complete-sentence */\n\n/**\n * Handsontable constructor.\n *\n * @core\n * @class Core\n * @description\n *\n * The `Handsontable` class to which we refer as to `Core`, allows you to modify the grid's behavior by using one of the available public methods.\n *\n * ## How to call a method\n *\n * ```js\n * // First, let's contruct Handsontable\n * const hot = new Handsontable(document.getElementById('example'), options);\n *\n * // Then, let's use the setDataAtCell method\n * hot.setDataAtCell(0, 0, 'new value');\n * ```\n *\n * @param {HTMLElement} rootElement The element to which the Handsontable instance is injected.\n * @param {object} userSettings The user defined options.\n * @param {boolean} [rootInstanceSymbol=false] Indicates if the instance is root of all later instances created.\n */\n\nexport default function Core(rootElement, userSettings) {\n var _this = this;\n\n var rootInstanceSymbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var preventScrollingToCell = false;\n var instance = this;\n var eventManager = new EventManager(instance);\n var datamap;\n var dataSource;\n var grid;\n var editorManager;\n var firstRun = true;\n userSettings.language = getValidLanguageCode(userSettings.language);\n var metaManager = new MetaManager(userSettings);\n var tableMeta = metaManager.getTableMeta();\n var globalMeta = metaManager.getGlobalMeta();\n var pluginsRegistry = createUniqueMap();\n\n if (hasValidParameter(rootInstanceSymbol)) {\n registerAsRootInstance(this);\n } // TODO: check if references to DOM elements should be move to UI layer (Walkontable)\n\n /**\n * Reference to the container element.\n *\n * @private\n * @type {HTMLElement}\n */\n\n\n this.rootElement = rootElement;\n /* eslint-enable jsdoc/require-description-complete-sentence */\n\n /**\n * The nearest document over container.\n *\n * @private\n * @type {Document}\n */\n\n this.rootDocument = rootElement.ownerDocument;\n /**\n * Window object over container's document.\n *\n * @private\n * @type {Window}\n */\n\n this.rootWindow = this.rootDocument.defaultView;\n /**\n * A boolean to tell if the Handsontable has been fully destroyed. This is set to `true`\n * after `afterDestroy` hook is called.\n *\n * @memberof Core#\n * @member isDestroyed\n * @type {boolean}\n */\n\n this.isDestroyed = false;\n /**\n * The counter determines how many times the render suspending was called. It allows\n * tracking the nested suspending calls. For each render suspend resuming call the\n * counter is decremented. The value equal to 0 means the render suspending feature\n * is disabled.\n *\n * @private\n * @type {number}\n */\n\n this.renderSuspendedCounter = 0;\n /**\n * The counter determines how many times the execution suspending was called. It allows\n * tracking the nested suspending calls. For each execution suspend resuming call the\n * counter is decremented. The value equal to 0 means the execution suspending feature\n * is disabled.\n *\n * @private\n * @type {number}\n */\n\n this.executionSuspendedCounter = 0;\n keyStateStartObserving(this.rootDocument);\n this.container = this.rootDocument.createElement('div');\n this.renderCall = false;\n rootElement.insertBefore(this.container, rootElement.firstChild);\n\n if (isRootInstance(this)) {\n _injectProductInfo(userSettings.licenseKey, rootElement);\n }\n\n this.guid = \"ht_\".concat(randomString()); // this is the namespace for global events\n\n /**\n * Instance of index mapper which is responsible for managing the column indexes.\n *\n * @memberof Core#\n * @member columnIndexMapper\n * @type {IndexMapper}\n */\n\n this.columnIndexMapper = new IndexMapper();\n /**\n * Instance of index mapper which is responsible for managing the row indexes.\n *\n * @memberof Core#\n * @member rowIndexMapper\n * @type {IndexMapper}\n */\n\n this.rowIndexMapper = new IndexMapper();\n dataSource = new DataSource(instance);\n\n if (!this.rootElement.id || this.rootElement.id.substring(0, 3) === 'ht_') {\n this.rootElement.id = this.guid; // if root element does not have an id, assign a random id\n }\n\n var visualToRenderableCoords = function visualToRenderableCoords(coords) {\n var visualRow = coords.row,\n visualColumn = coords.col;\n return new CellCoords( // We just store indexes for rows and columns without headers.\n visualRow >= 0 ? instance.rowIndexMapper.getRenderableFromVisualIndex(visualRow) : visualRow, visualColumn >= 0 ? instance.columnIndexMapper.getRenderableFromVisualIndex(visualColumn) : visualColumn);\n };\n\n var renderableToVisualCoords = function renderableToVisualCoords(coords) {\n var renderableRow = coords.row,\n renderableColumn = coords.col;\n return new CellCoords( // We just store indexes for rows and columns without headers.\n renderableRow >= 0 ? instance.rowIndexMapper.getVisualFromRenderableIndex(renderableRow) : renderableRow, renderableColumn >= 0 ? instance.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn) : renderableColumn // eslint-disable-line max-len\n );\n };\n\n var selection = new Selection(tableMeta, {\n countCols: function countCols() {\n return instance.countCols();\n },\n countRows: function countRows() {\n return instance.countRows();\n },\n propToCol: function propToCol(prop) {\n return datamap.propToCol(prop);\n },\n isEditorOpened: function isEditorOpened() {\n return instance.getActiveEditor() ? instance.getActiveEditor().isOpened() : false;\n },\n countColsTranslated: function countColsTranslated() {\n return _this.view.countRenderableColumns();\n },\n countRowsTranslated: function countRowsTranslated() {\n return _this.view.countRenderableRows();\n },\n visualToRenderableCoords: visualToRenderableCoords,\n renderableToVisualCoords: renderableToVisualCoords,\n isDisabledCellSelection: function isDisabledCellSelection(visualRow, visualColumn) {\n return instance.getCellMeta(visualRow, visualColumn).disableVisualSelection;\n }\n });\n this.selection = selection;\n\n var onIndexMapperCacheUpdate = function onIndexMapperCacheUpdate(_ref) {\n var hiddenIndexesChanged = _ref.hiddenIndexesChanged;\n\n if (hiddenIndexesChanged) {\n _this.selection.refresh();\n }\n };\n\n this.columnIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);\n this.rowIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);\n this.selection.addLocalHook('beforeSetRangeStart', function (cellCoords) {\n _this.runHooks('beforeSetRangeStart', cellCoords);\n });\n this.selection.addLocalHook('beforeSetRangeStartOnly', function (cellCoords) {\n _this.runHooks('beforeSetRangeStartOnly', cellCoords);\n });\n this.selection.addLocalHook('beforeSetRangeEnd', function (cellCoords) {\n _this.runHooks('beforeSetRangeEnd', cellCoords);\n\n if (cellCoords.row < 0) {\n cellCoords.row = _this.view.wt.wtTable.getFirstVisibleRow();\n }\n\n if (cellCoords.col < 0) {\n cellCoords.col = _this.view.wt.wtTable.getFirstVisibleColumn();\n }\n });\n this.selection.addLocalHook('afterSetRangeEnd', function (cellCoords) {\n var preventScrolling = createObjectPropListener(false);\n\n var selectionRange = _this.selection.getSelectedRange();\n\n var _selectionRange$curre = selectionRange.current(),\n from = _selectionRange$curre.from,\n to = _selectionRange$curre.to;\n\n var selectionLayerLevel = selectionRange.size() - 1;\n\n _this.runHooks('afterSelection', from.row, from.col, to.row, to.col, preventScrolling, selectionLayerLevel);\n\n _this.runHooks('afterSelectionByProp', from.row, instance.colToProp(from.col), to.row, instance.colToProp(to.col), preventScrolling, selectionLayerLevel); // eslint-disable-line max-len\n\n\n var isSelectedByAnyHeader = _this.selection.isSelectedByAnyHeader();\n\n var currentSelectedRange = _this.selection.selectedRange.current();\n\n var scrollToCell = true;\n\n if (preventScrollingToCell) {\n scrollToCell = false;\n }\n\n if (preventScrolling.isTouched()) {\n scrollToCell = !preventScrolling.value;\n }\n\n var isSelectedByRowHeader = _this.selection.isSelectedByRowHeader();\n\n var isSelectedByColumnHeader = _this.selection.isSelectedByColumnHeader();\n\n if (scrollToCell !== false) {\n if (!isSelectedByAnyHeader) {\n if (currentSelectedRange && !_this.selection.isMultiple()) {\n _this.view.scrollViewport(visualToRenderableCoords(currentSelectedRange.from));\n } else {\n _this.view.scrollViewport(visualToRenderableCoords(cellCoords));\n }\n } else if (isSelectedByRowHeader) {\n _this.view.scrollViewportVertically(instance.rowIndexMapper.getRenderableFromVisualIndex(cellCoords.row));\n } else if (isSelectedByColumnHeader) {\n _this.view.scrollViewportHorizontally(instance.columnIndexMapper.getRenderableFromVisualIndex(cellCoords.col));\n }\n } // @TODO: These CSS classes are no longer needed anymore. They are used only as a indicator of the selected\n // rows/columns in the MergedCells plugin (via border.js#L520 in the walkontable module). After fixing\n // the Border class this should be removed.\n\n\n if (isSelectedByRowHeader && isSelectedByColumnHeader) {\n addClass(_this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);\n } else if (isSelectedByRowHeader) {\n removeClass(_this.rootElement, 'ht__selection--columns');\n addClass(_this.rootElement, 'ht__selection--rows');\n } else if (isSelectedByColumnHeader) {\n removeClass(_this.rootElement, 'ht__selection--rows');\n addClass(_this.rootElement, 'ht__selection--columns');\n } else {\n removeClass(_this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);\n }\n\n _this._refreshBorders(null);\n });\n this.selection.addLocalHook('afterSelectionFinished', function (cellRanges) {\n var selectionLayerLevel = cellRanges.length - 1;\n var _cellRanges$selection = cellRanges[selectionLayerLevel],\n from = _cellRanges$selection.from,\n to = _cellRanges$selection.to;\n\n _this.runHooks('afterSelectionEnd', from.row, from.col, to.row, to.col, selectionLayerLevel);\n\n _this.runHooks('afterSelectionEndByProp', from.row, instance.colToProp(from.col), to.row, instance.colToProp(to.col), selectionLayerLevel);\n });\n this.selection.addLocalHook('afterIsMultipleSelection', function (isMultiple) {\n var changedIsMultiple = _this.runHooks('afterIsMultipleSelection', isMultiple.value);\n\n if (isMultiple.value) {\n isMultiple.value = changedIsMultiple;\n }\n });\n this.selection.addLocalHook('beforeModifyTransformStart', function (cellCoordsDelta) {\n _this.runHooks('modifyTransformStart', cellCoordsDelta);\n });\n this.selection.addLocalHook('afterModifyTransformStart', function (coords, rowTransformDir, colTransformDir) {\n _this.runHooks('afterModifyTransformStart', coords, rowTransformDir, colTransformDir);\n });\n this.selection.addLocalHook('beforeModifyTransformEnd', function (cellCoordsDelta) {\n _this.runHooks('modifyTransformEnd', cellCoordsDelta);\n });\n this.selection.addLocalHook('afterModifyTransformEnd', function (coords, rowTransformDir, colTransformDir) {\n _this.runHooks('afterModifyTransformEnd', coords, rowTransformDir, colTransformDir);\n });\n this.selection.addLocalHook('afterDeselect', function () {\n editorManager.destroyEditor();\n\n _this._refreshBorders();\n\n removeClass(_this.rootElement, ['ht__selection--rows', 'ht__selection--columns']);\n\n _this.runHooks('afterDeselect');\n });\n this.selection.addLocalHook('insertRowRequire', function (totalRows) {\n _this.alter('insert_row', totalRows, 1, 'auto');\n });\n this.selection.addLocalHook('insertColRequire', function (totalCols) {\n _this.alter('insert_col', totalCols, 1, 'auto');\n });\n grid = {\n /**\n * Inserts or removes rows and columns.\n *\n * @memberof Core#\n * @function alter\n * @private\n * @param {string} action Possible values: \"insert_row\", \"insert_col\", \"remove_row\", \"remove_col\".\n * @param {number|Array} index Row or column visual index which from the alter action will be triggered.\n * Alter actions such as \"remove_row\" and \"remove_col\" support array indexes in the\n * format `[[index, amount], [index, amount]...]` this can be used to remove\n * non-consecutive columns or rows in one call.\n * @param {number} [amount=1] Ammount rows or columns to remove.\n * @param {string} [source] Optional. Source of hook runner.\n * @param {boolean} [keepEmptyRows] Optional. Flag for preventing deletion of empty rows.\n */\n alter: function alter(action, index) {\n var amount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var source = arguments.length > 3 ? arguments[3] : undefined;\n var keepEmptyRows = arguments.length > 4 ? arguments[4] : undefined;\n var delta;\n\n var normalizeIndexesGroup = function normalizeIndexesGroup(indexes) {\n if (indexes.length === 0) {\n return [];\n }\n\n var sortedIndexes = _toConsumableArray(indexes); // Sort the indexes in ascending order.\n\n\n sortedIndexes.sort(function (_ref2, _ref3) {\n var _ref4 = _slicedToArray(_ref2, 1),\n indexA = _ref4[0];\n\n var _ref5 = _slicedToArray(_ref3, 1),\n indexB = _ref5[0];\n\n if (indexA === indexB) {\n return 0;\n }\n\n return indexA > indexB ? 1 : -1;\n }); // Normalize the {index, amount} groups into bigger groups.\n\n var normalizedIndexes = arrayReduce(sortedIndexes, function (acc, _ref6) {\n var _ref7 = _slicedToArray(_ref6, 2),\n groupIndex = _ref7[0],\n groupAmount = _ref7[1];\n\n var previousItem = acc[acc.length - 1];\n\n var _previousItem = _slicedToArray(previousItem, 2),\n prevIndex = _previousItem[0],\n prevAmount = _previousItem[1];\n\n var prevLastIndex = prevIndex + prevAmount;\n\n if (groupIndex <= prevLastIndex) {\n var amountToAdd = Math.max(groupAmount - (prevLastIndex - groupIndex), 0);\n previousItem[1] += amountToAdd;\n } else {\n acc.push([groupIndex, groupAmount]);\n }\n\n return acc;\n }, [sortedIndexes[0]]);\n return normalizedIndexes;\n };\n /* eslint-disable no-case-declarations */\n\n\n switch (action) {\n case 'insert_row':\n var numberOfSourceRows = instance.countSourceRows();\n\n if (tableMeta.maxRows === numberOfSourceRows) {\n return;\n } // eslint-disable-next-line no-param-reassign\n\n\n index = isDefined(index) ? index : numberOfSourceRows;\n delta = datamap.createRow(index, amount, source);\n\n if (delta) {\n metaManager.createRow(instance.toPhysicalRow(index), amount);\n var currentSelectedRange = selection.selectedRange.current();\n var currentFromRange = currentSelectedRange === null || currentSelectedRange === void 0 ? void 0 : currentSelectedRange.from;\n var currentFromRow = currentFromRange === null || currentFromRange === void 0 ? void 0 : currentFromRange.row; // Moving down the selection (when it exist). It should be present on the \"old\" row.\n // TODO: The logic here should be handled by selection module.\n\n if (isDefined(currentFromRow) && currentFromRow >= index) {\n var _currentSelectedRange = currentSelectedRange.to,\n currentToRow = _currentSelectedRange.row,\n currentToColumn = _currentSelectedRange.col;\n var currentFromColumn = currentFromRange.col; // Workaround: headers are not stored inside selection.\n\n if (selection.isSelectedByRowHeader()) {\n currentFromColumn = -1;\n } // Remove from the stack the last added selection as that selection below will be\n // replaced by new transformed selection.\n\n\n selection.getSelectedRange().pop(); // I can't use transforms as they don't work in negative indexes.\n\n selection.setRangeStartOnly(new CellCoords(currentFromRow + delta, currentFromColumn), true);\n selection.setRangeEnd(new CellCoords(currentToRow + delta, currentToColumn)); // will call render() internally\n } else {\n instance._refreshBorders(); // it will call render and prepare methods\n\n }\n }\n\n break;\n\n case 'insert_col':\n delta = datamap.createCol(index, amount, source);\n\n if (delta) {\n metaManager.createColumn(instance.toPhysicalColumn(index), amount);\n\n if (Array.isArray(tableMeta.colHeaders)) {\n var spliceArray = [index, 0];\n spliceArray.length += delta; // inserts empty (undefined) elements at the end of an array\n\n Array.prototype.splice.apply(tableMeta.colHeaders, spliceArray); // inserts empty (undefined) elements into the colHeader array\n }\n\n var _currentSelectedRange2 = selection.selectedRange.current();\n\n var _currentFromRange = _currentSelectedRange2 === null || _currentSelectedRange2 === void 0 ? void 0 : _currentSelectedRange2.from;\n\n var _currentFromColumn = _currentFromRange === null || _currentFromRange === void 0 ? void 0 : _currentFromRange.col; // Moving right the selection (when it exist). It should be present on the \"old\" row.\n // TODO: The logic here should be handled by selection module.\n\n\n if (isDefined(_currentFromColumn) && _currentFromColumn >= index) {\n var _currentSelectedRange3 = _currentSelectedRange2.to,\n _currentToRow = _currentSelectedRange3.row,\n _currentToColumn = _currentSelectedRange3.col;\n var _currentFromRow = _currentFromRange.row; // Workaround: headers are not stored inside selection.\n\n if (selection.isSelectedByColumnHeader()) {\n _currentFromRow = -1;\n } // Remove from the stack the last added selection as that selection below will be\n // replaced by new transformed selection.\n\n\n selection.getSelectedRange().pop(); // I can't use transforms as they don't work in negative indexes.\n\n selection.setRangeStartOnly(new CellCoords(_currentFromRow, _currentFromColumn + delta), true);\n selection.setRangeEnd(new CellCoords(_currentToRow, _currentToColumn + delta)); // will call render() internally\n } else {\n instance._refreshBorders(); // it will call render and prepare methods\n\n }\n }\n\n break;\n\n case 'remove_row':\n var removeRow = function removeRow(indexes) {\n var offset = 0; // Normalize the {index, amount} groups into bigger groups.\n\n arrayEach(indexes, function (_ref8) {\n var _ref9 = _slicedToArray(_ref8, 2),\n groupIndex = _ref9[0],\n groupAmount = _ref9[1];\n\n var calcIndex = isEmpty(groupIndex) ? instance.countRows() - 1 : Math.max(groupIndex - offset, 0); // If the 'index' is an integer decrease it by 'offset' otherwise pass it through to make the value\n // compatible with datamap.removeCol method.\n\n if (Number.isInteger(groupIndex)) {\n // eslint-disable-next-line no-param-reassign\n groupIndex = Math.max(groupIndex - offset, 0);\n } // TODO: for datamap.removeRow index should be passed as it is (with undefined and null values). If not, the logic\n // inside the datamap.removeRow breaks the removing functionality.\n\n\n var wasRemoved = datamap.removeRow(groupIndex, groupAmount, source);\n\n if (!wasRemoved) {\n return;\n }\n\n metaManager.removeRow(instance.toPhysicalRow(calcIndex), groupAmount);\n var totalRows = instance.countRows();\n var fixedRowsTop = tableMeta.fixedRowsTop;\n\n if (fixedRowsTop >= calcIndex + 1) {\n tableMeta.fixedRowsTop -= Math.min(groupAmount, fixedRowsTop - calcIndex);\n }\n\n var fixedRowsBottom = tableMeta.fixedRowsBottom;\n\n if (fixedRowsBottom && calcIndex >= totalRows - fixedRowsBottom) {\n tableMeta.fixedRowsBottom -= Math.min(groupAmount, fixedRowsBottom);\n }\n\n offset += groupAmount;\n });\n };\n\n if (Array.isArray(index)) {\n removeRow(normalizeIndexesGroup(index));\n } else {\n removeRow([[index, amount]]);\n }\n\n grid.adjustRowsAndCols();\n\n instance._refreshBorders(); // it will call render and prepare methods\n\n\n break;\n\n case 'remove_col':\n var removeCol = function removeCol(indexes) {\n var offset = 0; // Normalize the {index, amount} groups into bigger groups.\n\n arrayEach(indexes, function (_ref10) {\n var _ref11 = _slicedToArray(_ref10, 2),\n groupIndex = _ref11[0],\n groupAmount = _ref11[1];\n\n var calcIndex = isEmpty(groupIndex) ? instance.countCols() - 1 : Math.max(groupIndex - offset, 0);\n var physicalColumnIndex = instance.toPhysicalColumn(calcIndex); // If the 'index' is an integer decrease it by 'offset' otherwise pass it through to make the value\n // compatible with datamap.removeCol method.\n\n if (Number.isInteger(groupIndex)) {\n // eslint-disable-next-line no-param-reassign\n groupIndex = Math.max(groupIndex - offset, 0);\n } // TODO: for datamap.removeCol index should be passed as it is (with undefined and null values). If not, the logic\n // inside the datamap.removeCol breaks the removing functionality.\n\n\n var wasRemoved = datamap.removeCol(groupIndex, groupAmount, source);\n\n if (!wasRemoved) {\n return;\n }\n\n metaManager.removeColumn(physicalColumnIndex, groupAmount);\n var fixedColumnsLeft = tableMeta.fixedColumnsLeft;\n\n if (fixedColumnsLeft >= calcIndex + 1) {\n tableMeta.fixedColumnsLeft -= Math.min(groupAmount, fixedColumnsLeft - calcIndex);\n }\n\n if (Array.isArray(tableMeta.colHeaders)) {\n if (typeof physicalColumnIndex === 'undefined') {\n physicalColumnIndex = -1;\n }\n\n tableMeta.colHeaders.splice(physicalColumnIndex, groupAmount);\n }\n\n offset += groupAmount;\n });\n };\n\n if (Array.isArray(index)) {\n removeCol(normalizeIndexesGroup(index));\n } else {\n removeCol([[index, amount]]);\n }\n\n grid.adjustRowsAndCols();\n\n instance._refreshBorders(); // it will call render and prepare methods\n\n\n break;\n\n default:\n throw new Error(\"There is no such action \\\"\".concat(action, \"\\\"\"));\n }\n\n if (!keepEmptyRows) {\n grid.adjustRowsAndCols(); // makes sure that we did not add rows that will be removed in next refresh\n }\n },\n\n /**\n * Makes sure there are empty rows at the bottom of the table.\n */\n adjustRowsAndCols: function adjustRowsAndCols() {\n var minRows = tableMeta.minRows;\n var minSpareRows = tableMeta.minSpareRows;\n var minCols = tableMeta.minCols;\n var minSpareCols = tableMeta.minSpareCols;\n\n if (minRows) {\n // should I add empty rows to data source to meet minRows?\n var nrOfRows = instance.countRows();\n\n if (nrOfRows < minRows) {\n // The synchronization with cell meta is not desired here. For `minRows` option,\n // we don't want to touch/shift cell meta objects.\n datamap.createRow(nrOfRows, minRows - nrOfRows, 'auto');\n }\n }\n\n if (minSpareRows) {\n var emptyRows = instance.countEmptyRows(true); // should I add empty rows to meet minSpareRows?\n\n if (emptyRows < minSpareRows) {\n var emptyRowsMissing = minSpareRows - emptyRows;\n var rowsToCreate = Math.min(emptyRowsMissing, tableMeta.maxRows - instance.countSourceRows()); // The synchronization with cell meta is not desired here. For `minSpareRows` option,\n // we don't want to touch/shift cell meta objects.\n\n datamap.createRow(instance.countRows(), rowsToCreate, 'auto');\n }\n }\n\n {\n var emptyCols; // count currently empty cols\n\n if (minCols || minSpareCols) {\n emptyCols = instance.countEmptyCols(true);\n }\n\n var nrOfColumns = instance.countCols(); // should I add empty cols to meet minCols?\n\n if (minCols && !tableMeta.columns && nrOfColumns < minCols) {\n // The synchronization with cell meta is not desired here. For `minSpareRows` option,\n // we don't want to touch/shift cell meta objects.\n var colsToCreate = minCols - nrOfColumns;\n emptyCols += colsToCreate;\n datamap.createCol(nrOfColumns, colsToCreate, 'auto');\n } // should I add empty cols to meet minSpareCols?\n\n\n if (minSpareCols && !tableMeta.columns && instance.dataType === 'array' && emptyCols < minSpareCols) {\n nrOfColumns = instance.countCols();\n var emptyColsMissing = minSpareCols - emptyCols;\n\n var _colsToCreate = Math.min(emptyColsMissing, tableMeta.maxCols - nrOfColumns); // The synchronization with cell meta is not desired here. For `minSpareRows` option,\n // we don't want to touch/shift cell meta objects.\n\n\n datamap.createCol(nrOfColumns, _colsToCreate, 'auto');\n }\n }\n var rowCount = instance.countRows();\n var colCount = instance.countCols();\n\n if (rowCount === 0 || colCount === 0) {\n selection.deselect();\n }\n\n if (selection.isSelected()) {\n arrayEach(selection.selectedRange, function (range) {\n var selectionChanged = false;\n var fromRow = range.from.row;\n var fromCol = range.from.col;\n var toRow = range.to.row;\n var toCol = range.to.col; // if selection is outside, move selection to last row\n\n if (fromRow > rowCount - 1) {\n fromRow = rowCount - 1;\n selectionChanged = true;\n\n if (toRow > fromRow) {\n toRow = fromRow;\n }\n } else if (toRow > rowCount - 1) {\n toRow = rowCount - 1;\n selectionChanged = true;\n\n if (fromRow > toRow) {\n fromRow = toRow;\n }\n } // if selection is outside, move selection to last row\n\n\n if (fromCol > colCount - 1) {\n fromCol = colCount - 1;\n selectionChanged = true;\n\n if (toCol > fromCol) {\n toCol = fromCol;\n }\n } else if (toCol > colCount - 1) {\n toCol = colCount - 1;\n selectionChanged = true;\n\n if (fromCol > toCol) {\n fromCol = toCol;\n }\n }\n\n if (selectionChanged) {\n instance.selectCell(fromRow, fromCol, toRow, toCol);\n }\n });\n }\n\n if (instance.view) {\n instance.view.adjustElementsSize();\n }\n },\n\n /**\n * Populate the data from the provided 2d array from the given cell coordinates.\n *\n * @private\n * @param {object} start Start selection position. Visual indexes.\n * @param {Array} input 2d data array.\n * @param {object} [end] End selection position (only for drag-down mode). Visual indexes.\n * @param {string} [source=\"populateFromArray\"] Source information string.\n * @param {string} [method=\"overwrite\"] Populate method. Possible options: `shift_down`, `shift_right`, `overwrite`.\n * @param {string} direction (left|right|up|down) String specifying the direction.\n * @param {Array} deltas The deltas array. A difference between values of adjacent cells.\n * Useful **only** when the type of handled cells is `numeric`.\n * @returns {object|undefined} Ending td in pasted area (only if any cell was changed).\n */\n populateFromArray: function populateFromArray(start, input, end, source, method, direction, deltas) {\n // TODO: either remove or implement the `direction` argument. Currently it's not working at all.\n var r;\n var rlen;\n var c;\n var clen;\n var setData = [];\n var current = {};\n rlen = input.length;\n\n if (rlen === 0) {\n return false;\n }\n\n var repeatCol;\n var repeatRow;\n var cmax;\n var rmax;\n /* eslint-disable no-case-declarations */\n // insert data with specified pasteMode method\n\n switch (method) {\n case 'shift_down':\n repeatCol = end ? end.col - start.col + 1 : 0;\n repeatRow = end ? end.row - start.row + 1 : 0; // eslint-disable-next-line no-param-reassign\n\n input = translateRowsToColumns(input);\n\n for (c = 0, clen = input.length, cmax = Math.max(clen, repeatCol); c < cmax; c++) {\n if (c < clen) {\n var _instance;\n\n for (r = 0, rlen = input[c].length; r < repeatRow - rlen; r++) {\n input[c].push(input[c][r % rlen]);\n }\n\n input[c].unshift(start.col + c, start.row, 0);\n\n (_instance = instance).spliceCol.apply(_instance, _toConsumableArray(input[c]));\n } else {\n var _instance2;\n\n input[c % clen][0] = start.col + c;\n\n (_instance2 = instance).spliceCol.apply(_instance2, _toConsumableArray(input[c % clen]));\n }\n }\n\n break;\n\n case 'shift_right':\n repeatCol = end ? end.col - start.col + 1 : 0;\n repeatRow = end ? end.row - start.row + 1 : 0;\n\n for (r = 0, rlen = input.length, rmax = Math.max(rlen, repeatRow); r < rmax; r++) {\n if (r < rlen) {\n var _instance3;\n\n for (c = 0, clen = input[r].length; c < repeatCol - clen; c++) {\n input[r].push(input[r][c % clen]);\n }\n\n input[r].unshift(start.row + r, start.col, 0);\n\n (_instance3 = instance).spliceRow.apply(_instance3, _toConsumableArray(input[r]));\n } else {\n var _instance4;\n\n input[r % rlen][0] = start.row + r;\n\n (_instance4 = instance).spliceRow.apply(_instance4, _toConsumableArray(input[r % rlen]));\n }\n }\n\n break;\n\n case 'overwrite':\n default:\n // overwrite and other not specified options\n current.row = start.row;\n current.col = start.col;\n var selected = {\n // selected range\n row: end && start ? end.row - start.row + 1 : 1,\n col: end && start ? end.col - start.col + 1 : 1\n };\n var skippedRow = 0;\n var skippedColumn = 0;\n var pushData = true;\n var cellMeta;\n\n var getInputValue = function getInputValue(row) {\n var col = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var rowValue = input[row % input.length];\n\n if (col !== null) {\n return rowValue[col % rowValue.length];\n }\n\n return rowValue;\n };\n\n var rowInputLength = input.length;\n var rowSelectionLength = end ? end.row - start.row + 1 : 0;\n\n if (end) {\n rlen = rowSelectionLength;\n } else {\n rlen = Math.max(rowInputLength, rowSelectionLength);\n }\n\n for (r = 0; r < rlen; r++) {\n if (end && current.row > end.row && rowSelectionLength > rowInputLength || !tableMeta.allowInsertRow && current.row > instance.countRows() - 1 || current.row >= tableMeta.maxRows) {\n break;\n }\n\n var visualRow = r - skippedRow;\n var colInputLength = getInputValue(visualRow).length;\n var colSelectionLength = end ? end.col - start.col + 1 : 0;\n\n if (end) {\n clen = colSelectionLength;\n } else {\n clen = Math.max(colInputLength, colSelectionLength);\n }\n\n current.col = start.col;\n cellMeta = instance.getCellMeta(current.row, current.col);\n\n if ((source === 'CopyPaste.paste' || source === 'Autofill.fill') && cellMeta.skipRowOnPaste) {\n skippedRow += 1;\n current.row += 1;\n rlen += 1;\n /* eslint-disable no-continue */\n\n continue;\n }\n\n skippedColumn = 0;\n\n for (c = 0; c < clen; c++) {\n if (end && current.col > end.col && colSelectionLength > colInputLength || !tableMeta.allowInsertColumn && current.col > instance.countCols() - 1 || current.col >= tableMeta.maxCols) {\n break;\n }\n\n cellMeta = instance.getCellMeta(current.row, current.col);\n\n if ((source === 'CopyPaste.paste' || source === 'Autofill.fill') && cellMeta.skipColumnOnPaste) {\n skippedColumn += 1;\n current.col += 1;\n clen += 1;\n continue;\n }\n\n if (cellMeta.readOnly && source !== 'UndoRedo.undo') {\n current.col += 1;\n /* eslint-disable no-continue */\n\n continue;\n }\n\n var visualColumn = c - skippedColumn;\n var value = getInputValue(visualRow, visualColumn);\n var orgValue = instance.getDataAtCell(current.row, current.col);\n var index = {\n row: visualRow,\n col: visualColumn\n };\n\n if (source === 'Autofill.fill') {\n var result = instance.runHooks('beforeAutofillInsidePopulate', index, direction, input, deltas, {}, selected);\n\n if (result) {\n value = isUndefined(result.value) ? value : result.value;\n }\n }\n\n if (value !== null && _typeof(value) === 'object') {\n // when 'value' is array and 'orgValue' is null, set 'orgValue' to\n // an empty array so that the null value can be compared to 'value'\n // as an empty value for the array context\n if (Array.isArray(value) && orgValue === null) orgValue = [];\n\n if (orgValue === null || _typeof(orgValue) !== 'object') {\n pushData = false;\n } else {\n var orgValueSchema = duckSchema(Array.isArray(orgValue) ? orgValue : orgValue[0] || orgValue);\n var valueSchema = duckSchema(Array.isArray(value) ? value : value[0] || value);\n /* eslint-disable max-depth */\n\n if (isObjectEqual(orgValueSchema, valueSchema)) {\n value = deepClone(value);\n } else {\n pushData = false;\n }\n }\n } else if (orgValue !== null && _typeof(orgValue) === 'object') {\n pushData = false;\n }\n\n if (pushData) {\n setData.push([current.row, current.col, value]);\n }\n\n pushData = true;\n current.col += 1;\n }\n\n current.row += 1;\n }\n\n instance.setDataAtCell(setData, null, null, source || 'populateFromArray');\n break;\n }\n }\n };\n /**\n * Internal function to set `language` key of settings.\n *\n * @private\n * @param {string} languageCode Language code for specific language i.e. 'en-US', 'pt-BR', 'de-DE'.\n * @fires Hooks#afterLanguageChange\n */\n\n function setLanguage(languageCode) {\n var normalizedLanguageCode = normalizeLanguageCode(languageCode);\n\n if (hasLanguageDictionary(normalizedLanguageCode)) {\n instance.runHooks('beforeLanguageChange', normalizedLanguageCode);\n globalMeta.language = normalizedLanguageCode;\n instance.runHooks('afterLanguageChange', normalizedLanguageCode);\n } else {\n warnUserAboutLanguageRegistration(languageCode);\n }\n }\n /**\n * Internal function to set `className` or `tableClassName`, depending on the key from the settings object.\n *\n * @private\n * @param {string} className `className` or `tableClassName` from the key in the settings object.\n * @param {string|string[]} classSettings String or array of strings. Contains class name(s) from settings object.\n */\n\n\n function setClassName(className, classSettings) {\n var element = className === 'className' ? instance.rootElement : instance.table;\n\n if (firstRun) {\n addClass(element, classSettings);\n } else {\n var globalMetaSettingsArray = [];\n var settingsArray = [];\n\n if (globalMeta[className]) {\n globalMetaSettingsArray = Array.isArray(globalMeta[className]) ? globalMeta[className] : stringToArray(globalMeta[className]);\n }\n\n if (classSettings) {\n settingsArray = Array.isArray(classSettings) ? classSettings : stringToArray(classSettings);\n }\n\n var classNameToRemove = getDifferenceOfArrays(globalMetaSettingsArray, settingsArray);\n var classNameToAdd = getDifferenceOfArrays(settingsArray, globalMetaSettingsArray);\n\n if (classNameToRemove.length) {\n removeClass(element, classNameToRemove);\n }\n\n if (classNameToAdd.length) {\n addClass(element, classNameToAdd);\n }\n }\n\n globalMeta[className] = classSettings;\n }\n\n this.init = function () {\n dataSource.setData(tableMeta.data);\n instance.runHooks('beforeInit');\n\n if (isMobileBrowser() || isIpadOS()) {\n addClass(instance.rootElement, 'mobile');\n }\n\n this.updateSettings(tableMeta, true);\n this.view = new TableView(this);\n editorManager = EditorManager.getInstance(instance, tableMeta, selection);\n instance.runHooks('init');\n this.forceFullRender = true; // used when data was changed\n\n this.view.render();\n\n if (_typeof(firstRun) === 'object') {\n instance.runHooks('afterChange', firstRun[0], firstRun[1]);\n firstRun = false;\n }\n\n instance.runHooks('afterInit');\n };\n /**\n * @ignore\n * @returns {object}\n */\n\n\n function ValidatorsQueue() {\n // moved this one level up so it can be used in any function here. Probably this should be moved to a separate file\n var resolved = false;\n return {\n validatorsInQueue: 0,\n valid: true,\n addValidatorToQueue: function addValidatorToQueue() {\n this.validatorsInQueue += 1;\n resolved = false;\n },\n removeValidatorFormQueue: function removeValidatorFormQueue() {\n this.validatorsInQueue = this.validatorsInQueue - 1 < 0 ? 0 : this.validatorsInQueue - 1;\n this.checkIfQueueIsEmpty();\n },\n onQueueEmpty: function onQueueEmpty() {},\n checkIfQueueIsEmpty: function checkIfQueueIsEmpty() {\n if (this.validatorsInQueue === 0 && resolved === false) {\n resolved = true;\n this.onQueueEmpty(this.valid);\n }\n }\n };\n }\n /**\n * Get parsed number from numeric string.\n *\n * @private\n * @param {string} numericData Float (separated by a dot or a comma) or integer.\n * @returns {number} Number if we get data in parsable format, not changed value otherwise.\n */\n\n\n function getParsedNumber(numericData) {\n // Unifying \"float like\" string. Change from value with comma determiner to value with dot determiner,\n // for example from `450,65` to `450.65`.\n var unifiedNumericData = numericData.replace(',', '.');\n\n if (isNaN(parseFloat(unifiedNumericData)) === false) {\n return parseFloat(unifiedNumericData);\n }\n\n return numericData;\n }\n /**\n * @ignore\n * @param {Array} changes The 2D array containing information about each of the edited cells.\n * @param {string} source The string that identifies source of validation.\n * @param {Function} callback The callback function fot async validation.\n */\n\n\n function validateChanges(changes, source, callback) {\n if (!changes.length) {\n return;\n }\n\n var activeEditor = instance.getActiveEditor();\n var beforeChangeResult = instance.runHooks('beforeChange', changes, source || 'edit');\n var shouldBeCanceled = true;\n\n if (beforeChangeResult === false) {\n if (activeEditor) {\n activeEditor.cancelChanges();\n }\n\n return;\n }\n\n var waitingForValidator = new ValidatorsQueue();\n\n var isNumericData = function isNumericData(value) {\n return value.length > 0 && /^\\s*[+-.]?\\s*(?:(?:\\d+(?:(\\.|,)\\d+)?(?:e[+-]?\\d+)?)|(?:0x[a-f\\d]+))\\s*$/.test(value);\n };\n\n waitingForValidator.onQueueEmpty = function (isValid) {\n if (activeEditor && shouldBeCanceled) {\n activeEditor.cancelChanges();\n }\n\n callback(isValid); // called when async validators are resolved and beforeChange was not async\n };\n\n for (var i = changes.length - 1; i >= 0; i--) {\n if (changes[i] === null) {\n changes.splice(i, 1);\n } else {\n var _changes$i = _slicedToArray(changes[i], 4),\n row = _changes$i[0],\n prop = _changes$i[1],\n newValue = _changes$i[3];\n\n var col = datamap.propToCol(prop);\n var cellProperties = instance.getCellMeta(row, col);\n\n if (cellProperties.type === 'numeric' && typeof newValue === 'string' && isNumericData(newValue)) {\n changes[i][3] = getParsedNumber(newValue);\n }\n /* eslint-disable no-loop-func */\n\n\n if (instance.getCellValidator(cellProperties)) {\n waitingForValidator.addValidatorToQueue();\n instance.validateCell(changes[i][3], cellProperties, function (index, cellPropertiesReference) {\n return function (result) {\n if (typeof result !== 'boolean') {\n throw new Error('Validation error: result is not boolean');\n }\n\n if (result === false && cellPropertiesReference.allowInvalid === false) {\n shouldBeCanceled = false;\n changes.splice(index, 1); // cancel the change\n\n cellPropertiesReference.valid = true; // we cancelled the change, so cell value is still valid\n\n var cell = instance.getCell(cellPropertiesReference.visualRow, cellPropertiesReference.visualCol);\n\n if (cell !== null) {\n removeClass(cell, tableMeta.invalidCellClassName);\n } // index -= 1;\n\n }\n\n waitingForValidator.removeValidatorFormQueue();\n };\n }(i, cellProperties), source);\n }\n }\n }\n\n waitingForValidator.checkIfQueueIsEmpty();\n }\n /**\n * Internal function to apply changes. Called after validateChanges.\n *\n * @private\n * @param {Array} changes Array in form of [row, prop, oldValue, newValue].\n * @param {string} source String that identifies how this change will be described in changes array (useful in onChange callback).\n * @fires Hooks#beforeChangeRender\n * @fires Hooks#afterChange\n */\n\n\n function applyChanges(changes, source) {\n var i = changes.length - 1;\n\n if (i < 0) {\n return;\n }\n\n for (; i >= 0; i--) {\n var skipThisChange = false;\n\n if (changes[i] === null) {\n changes.splice(i, 1);\n /* eslint-disable no-continue */\n\n continue;\n }\n\n if ((changes[i][2] === null || changes[i][2] === void 0) && (changes[i][3] === null || changes[i][3] === void 0)) {\n /* eslint-disable no-continue */\n continue;\n }\n\n if (tableMeta.allowInsertRow) {\n while (changes[i][0] > instance.countRows() - 1) {\n var numberOfCreatedRows = datamap.createRow(void 0, void 0, source);\n\n if (numberOfCreatedRows >= 1) {\n metaManager.createRow(null, numberOfCreatedRows);\n } else {\n skipThisChange = true;\n break;\n }\n }\n }\n\n if (instance.dataType === 'array' && (!tableMeta.columns || tableMeta.columns.length === 0) && tableMeta.allowInsertColumn) {\n while (datamap.propToCol(changes[i][1]) > instance.countCols() - 1) {\n var numberOfCreatedColumns = datamap.createCol(void 0, void 0, source);\n\n if (numberOfCreatedColumns >= 1) {\n metaManager.createColumn(null, numberOfCreatedColumns);\n } else {\n skipThisChange = true;\n break;\n }\n }\n }\n\n if (skipThisChange) {\n /* eslint-disable no-continue */\n continue;\n }\n\n datamap.set(changes[i][0], changes[i][1], changes[i][3]);\n }\n\n instance.forceFullRender = true; // used when data was changed\n\n grid.adjustRowsAndCols();\n instance.runHooks('beforeChangeRender', changes, source);\n editorManager.lockEditor();\n\n instance._refreshBorders(null);\n\n editorManager.unlockEditor();\n instance.view.adjustElementsSize();\n instance.runHooks('afterChange', changes, source || 'edit');\n var activeEditor = instance.getActiveEditor();\n\n if (activeEditor && isDefined(activeEditor.refreshValue)) {\n activeEditor.refreshValue();\n }\n }\n /**\n * Validate a single cell.\n *\n * @param {string|number} value The value to validate.\n * @param {object} cellProperties The cell meta which corresponds with the value.\n * @param {Function} callback The callback function.\n * @param {string} source The string that identifies source of the validation.\n */\n\n\n this.validateCell = function (value, cellProperties, callback, source) {\n var validator = instance.getCellValidator(cellProperties); // the `canBeValidated = false` argument suggests, that the cell passes validation by default.\n\n /**\n * @param {boolean} valid Indicates if the validation was successful.\n * @param {boolean} [canBeValidated=true] Flag which controls the validation process.\n * @private\n */\n\n function done(valid) {\n var canBeValidated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n // Fixes GH#3903\n if (!canBeValidated || cellProperties.hidden === true) {\n callback(valid);\n return;\n }\n\n var col = cellProperties.visualCol;\n var row = cellProperties.visualRow;\n var td = instance.getCell(row, col, true);\n\n if (td && td.nodeName !== 'TH') {\n var renderableRow = instance.rowIndexMapper.getRenderableFromVisualIndex(row);\n var renderableColumn = instance.columnIndexMapper.getRenderableFromVisualIndex(col);\n instance.view.wt.wtSettings.settings.cellRenderer(renderableRow, renderableColumn, td);\n }\n\n callback(valid);\n }\n\n if (isRegExp(validator)) {\n validator = function (expression) {\n return function (cellValue, validatorCallback) {\n validatorCallback(expression.test(cellValue));\n };\n }(validator);\n }\n\n if (isFunction(validator)) {\n // eslint-disable-next-line no-param-reassign\n value = instance.runHooks('beforeValidate', value, cellProperties.visualRow, cellProperties.prop, source); // To provide consistent behaviour, validation should be always asynchronous\n\n instance._registerImmediate(function () {\n validator.call(cellProperties, value, function (valid) {\n if (!instance) {\n return;\n } // eslint-disable-next-line no-param-reassign\n\n\n valid = instance.runHooks('afterValidate', valid, value, cellProperties.visualRow, cellProperties.prop, source);\n cellProperties.valid = valid;\n done(valid);\n instance.runHooks('postAfterValidate', valid, value, cellProperties.visualRow, cellProperties.prop, source);\n });\n });\n } else {\n // resolve callback even if validator function was not found\n instance._registerImmediate(function () {\n cellProperties.valid = true;\n done(cellProperties.valid, false);\n });\n }\n };\n /**\n * @ignore\n * @param {number} row The visual row index.\n * @param {string|number} propOrCol The visual prop or column index.\n * @param {*} value The cell value.\n * @returns {Array}\n */\n\n\n function setDataInputToArray(row, propOrCol, value) {\n if (Array.isArray(row)) {\n // it's an array of changes\n return row;\n }\n\n return [[row, propOrCol, value]];\n }\n /**\n * @description\n * Set new value to a cell. To change many cells at once (recommended way), pass an array of `changes` in format\n * `[[row, col, value],...]` as the first argument.\n *\n * @memberof Core#\n * @function setDataAtCell\n * @param {number|Array} row Visual row index or array of changes in format `[[row, col, value],...]`.\n * @param {number} [column] Visual column index.\n * @param {string} [value] New value.\n * @param {string} [source] String that identifies how this change will be described in the changes array (useful in afterChange or beforeChange callback). Set to 'edit' if left empty.\n */\n\n\n this.setDataAtCell = function (row, column, value, source) {\n var input = setDataInputToArray(row, column, value);\n var changes = [];\n var changeSource = source;\n var i;\n var ilen;\n var prop;\n\n for (i = 0, ilen = input.length; i < ilen; i++) {\n if (_typeof(input[i]) !== 'object') {\n throw new Error('Method `setDataAtCell` accepts row number or changes array of arrays as its first parameter');\n }\n\n if (typeof input[i][1] !== 'number') {\n throw new Error('Method `setDataAtCell` accepts row and column number as its parameters. If you want to use object property name, use method `setDataAtRowProp`'); // eslint-disable-line max-len\n }\n\n if (input[i][1] >= this.countCols()) {\n prop = input[i][1];\n } else {\n prop = datamap.colToProp(input[i][1]);\n }\n\n changes.push([input[i][0], prop, dataSource.getAtCell(this.toPhysicalRow(input[i][0]), input[i][1]), input[i][2]]);\n }\n\n if (!changeSource && _typeof(row) === 'object') {\n changeSource = column;\n }\n\n instance.runHooks('afterSetDataAtCell', changes, changeSource);\n validateChanges(changes, changeSource, function () {\n applyChanges(changes, changeSource);\n });\n };\n /**\n * @description\n * Set new value to a cell. To change many cells at once (recommended way), pass an array of `changes` in format\n * `[[row, prop, value],...]` as the first argument.\n *\n * @memberof Core#\n * @function setDataAtRowProp\n * @param {number|Array} row Visual row index or array of changes in format `[[row, prop, value], ...]`.\n * @param {string} prop Property name or the source string (e.g. `'first.name'` or `'0'`).\n * @param {string} value Value to be set.\n * @param {string} [source] String that identifies how this change will be described in changes array (useful in onChange callback).\n */\n\n\n this.setDataAtRowProp = function (row, prop, value, source) {\n var input = setDataInputToArray(row, prop, value);\n var changes = [];\n var changeSource = source;\n var i;\n var ilen;\n\n for (i = 0, ilen = input.length; i < ilen; i++) {\n changes.push([input[i][0], input[i][1], dataSource.getAtCell(this.toPhysicalRow(input[i][0]), input[i][1]), input[i][2]]);\n }\n\n if (!changeSource && _typeof(row) === 'object') {\n changeSource = prop;\n }\n\n instance.runHooks('afterSetDataAtRowProp', changes, changeSource);\n validateChanges(changes, changeSource, function () {\n applyChanges(changes, changeSource);\n });\n };\n /**\n * Listen to the keyboard input on document body. This allows Handsontable to capture keyboard events and respond\n * in the right way.\n *\n * @memberof Core#\n * @function listen\n * @fires Hooks#afterListen\n */\n\n\n this.listen = function () {\n if (instance && !instance.isListening()) {\n activeGuid = instance.guid;\n instance.runHooks('afterListen');\n }\n };\n /**\n * Stop listening to keyboard input on the document body. Calling this method makes the Handsontable inactive for\n * any keyboard events.\n *\n * @memberof Core#\n * @function unlisten\n */\n\n\n this.unlisten = function () {\n if (this.isListening()) {\n activeGuid = null;\n instance.runHooks('afterUnlisten');\n }\n };\n /**\n * Returns `true` if the current Handsontable instance is listening to keyboard input on document body.\n *\n * @memberof Core#\n * @function isListening\n * @returns {boolean} `true` if the instance is listening, `false` otherwise.\n */\n\n\n this.isListening = function () {\n return activeGuid === instance.guid;\n };\n /**\n * Destroys the current editor, render the table and prepares the editor of the newly selected cell.\n *\n * @memberof Core#\n * @function destroyEditor\n * @param {boolean} [revertOriginal=false] If `true`, the previous value will be restored. Otherwise, the edited value will be saved.\n * @param {boolean} [prepareEditorIfNeeded=true] If `true` the editor under the selected cell will be prepared to open.\n */\n\n\n this.destroyEditor = function () {\n var revertOriginal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var prepareEditorIfNeeded = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n instance._refreshBorders(revertOriginal, prepareEditorIfNeeded);\n };\n /**\n * Populate cells at position with 2D input array (e.g. `[[1, 2], [3, 4]]`). Use `endRow`, `endCol` when you\n * want to cut input when a certain row is reached.\n *\n * Optional `method` argument has the same effect as pasteMode option (see {@link options#pastemode Options#pasteMode}).\n *\n * @memberof Core#\n * @function populateFromArray\n * @param {number} row Start visual row index.\n * @param {number} column Start visual column index.\n * @param {Array} input 2d array.\n * @param {number} [endRow] End visual row index (use when you want to cut input when certain row is reached).\n * @param {number} [endCol] End visual column index (use when you want to cut input when certain column is reached).\n * @param {string} [source=populateFromArray] Used to identify this call in the resulting events (beforeChange, afterChange).\n * @param {string} [method=overwrite] Populate method, possible values: `'shift_down'`, `'shift_right'`, `'overwrite'`.\n * @param {string} direction Populate direction, possible values: `'left'`, `'right'`, `'up'`, `'down'`.\n * @param {Array} deltas The deltas array. A difference between values of adjacent cells.\n * Useful **only** when the type of handled cells is `numeric`.\n * @returns {object|undefined} Ending td in pasted area (only if any cell was changed).\n */\n\n\n this.populateFromArray = function (row, column, input, endRow, endCol, source, method, direction, deltas) {\n if (!(_typeof(input) === 'object' && _typeof(input[0]) === 'object')) {\n throw new Error('populateFromArray parameter `input` must be an array of arrays'); // API changed in 0.9-beta2, let's check if you use it correctly\n }\n\n var c = typeof endRow === 'number' ? new CellCoords(endRow, endCol) : null;\n return grid.populateFromArray(new CellCoords(row, column), input, c, source, method, direction, deltas);\n };\n /**\n * Adds/removes data from the column. This method works the same as Array.splice for arrays.\n *\n * @memberof Core#\n * @function spliceCol\n * @param {number} column Index of the column in which do you want to do splice.\n * @param {number} index Index at which to start changing the array. If negative, will begin that many elements from the end.\n * @param {number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed.\n * @param {...number} [elements] The elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array.\n * @returns {Array} Returns removed portion of columns.\n */\n\n\n this.spliceCol = function (column, index, amount) {\n var _datamap;\n\n for (var _len = arguments.length, elements = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {\n elements[_key - 3] = arguments[_key];\n }\n\n return (_datamap = datamap).spliceCol.apply(_datamap, [column, index, amount].concat(elements));\n };\n /**\n * Adds/removes data from the row. This method works the same as Array.splice for arrays.\n *\n * @memberof Core#\n * @function spliceRow\n * @param {number} row Index of column in which do you want to do splice.\n * @param {number} index Index at which to start changing the array. If negative, will begin that many elements from the end.\n * @param {number} amount An integer indicating the number of old array elements to remove. If amount is 0, no elements are removed.\n * @param {...number} [elements] The elements to add to the array. If you don't specify any elements, spliceCol simply removes elements from the array.\n * @returns {Array} Returns removed portion of rows.\n */\n\n\n this.spliceRow = function (row, index, amount) {\n var _datamap2;\n\n for (var _len2 = arguments.length, elements = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {\n elements[_key2 - 3] = arguments[_key2];\n }\n\n return (_datamap2 = datamap).spliceRow.apply(_datamap2, [row, index, amount].concat(elements));\n };\n /**\n * Returns indexes of the currently selected cells as an array of arrays `[[startRow, startCol, endRow, endCol],...]`.\n *\n * Start row and start column are the coordinates of the active cell (where the selection was started).\n *\n * The version 0.36.0 adds a non-consecutive selection feature. Since this version, the method returns an array of arrays.\n * Additionally to collect the coordinates of the currently selected area (as it was previously done by the method)\n * you need to use `getSelectedLast` method.\n *\n * @memberof Core#\n * @function getSelected\n * @returns {Array[]|undefined} An array of arrays of the selection's coordinates.\n */\n\n\n this.getSelected = function () {\n // https://github.com/handsontable/handsontable/issues/44 //cjl\n if (selection.isSelected()) {\n return arrayMap(selection.getSelectedRange(), function (_ref12) {\n var from = _ref12.from,\n to = _ref12.to;\n return [from.row, from.col, to.row, to.col];\n });\n }\n };\n /**\n * Returns the last coordinates applied to the table as a an array `[startRow, startCol, endRow, endCol]`.\n *\n * @since 0.36.0\n * @memberof Core#\n * @function getSelectedLast\n * @returns {Array|undefined} An array of the selection's coordinates.\n */\n\n\n this.getSelectedLast = function () {\n var selected = this.getSelected();\n var result;\n\n if (selected && selected.length > 0) {\n result = selected[selected.length - 1];\n }\n\n return result;\n };\n /**\n * Returns the current selection as an array of CellRange objects.\n *\n * The version 0.36.0 adds a non-consecutive selection feature. Since this version, the method returns an array of arrays.\n * Additionally to collect the coordinates of the currently selected area (as it was previously done by the method)\n * you need to use `getSelectedRangeLast` method.\n *\n * @memberof Core#\n * @function getSelectedRange\n * @returns {CellRange[]|undefined} Selected range object or undefined if there is no selection.\n */\n\n\n this.getSelectedRange = function () {\n // https://github.com/handsontable/handsontable/issues/44 //cjl\n if (selection.isSelected()) {\n return Array.from(selection.getSelectedRange());\n }\n };\n /**\n * Returns the last coordinates applied to the table as a CellRange object.\n *\n * @memberof Core#\n * @function getSelectedRangeLast\n * @since 0.36.0\n * @returns {CellRange|undefined} Selected range object or undefined` if there is no selection.\n */\n\n\n this.getSelectedRangeLast = function () {\n var selectedRange = this.getSelectedRange();\n var result;\n\n if (selectedRange && selectedRange.length > 0) {\n result = selectedRange[selectedRange.length - 1];\n }\n\n return result;\n };\n /**\n * Erases content from cells that have been selected in the table.\n *\n * @memberof Core#\n * @function emptySelectedCells\n * @param {string} [source] String that identifies how this change will be described in the changes array (useful in afterChange or beforeChange callback). Set to 'edit' if left empty.\n * @since 0.36.0\n */\n\n\n this.emptySelectedCells = function (source) {\n var _this2 = this;\n\n if (!selection.isSelected() || this.countRows() === 0 || this.countCols() === 0) {\n return;\n }\n\n var changes = [];\n arrayEach(selection.getSelectedRange(), function (cellRange) {\n var topLeft = cellRange.getTopLeftCorner();\n var bottomRight = cellRange.getBottomRightCorner();\n rangeEach(topLeft.row, bottomRight.row, function (row) {\n rangeEach(topLeft.col, bottomRight.col, function (column) {\n if (!_this2.getCellMeta(row, column).readOnly) {\n changes.push([row, column, null]);\n }\n });\n });\n });\n\n if (changes.length > 0) {\n this.setDataAtCell(changes, source);\n }\n };\n /**\n * Checks if the table rendering process was suspended. See explanation in {@link core#suspendrender Core#suspendRender}.\n *\n * @memberof Core#\n * @function isRenderSuspended\n * @since 8.3.0\n * @returns {boolean}\n */\n\n\n this.isRenderSuspended = function () {\n return this.renderSuspendedCounter > 0;\n };\n /**\n * Suspends the rendering process. It's helpful to wrap the table render\n * cycles triggered by API calls or UI actions (or both) and call the \"render\"\n * once in the end. As a result, it improves the performance of wrapped operations.\n * When the table is in the suspend state, most operations will have no visual\n * effect until the rendering state is resumed. Resuming the state automatically\n * invokes the table rendering. To make sure that after executing all operations,\n * the table will be rendered, it's highly recommended to use the {@link core#batchrender Core#batchRender}\n * method or {@link core#batch Core#batch}, which additionally aggregates the logic execution\n * that happens behind the table.\n *\n * The method is intended to be used by advanced users. Suspending the rendering\n * process could cause visual glitches when wrongly implemented.\n *\n * @memberof Core#\n * @function suspendRender\n * @since 8.3.0\n * @example\n * ```js\n * hot.suspendRender();\n * hot.alter('insert_row', 5, 45);\n * hot.alter('insert_col', 10, 40);\n * hot.setDataAtCell(1, 1, 'John');\n * hot.setDataAtCell(2, 2, 'Mark');\n * hot.setDataAtCell(3, 3, 'Ann');\n * hot.setDataAtCell(4, 4, 'Sophia');\n * hot.setDataAtCell(5, 5, 'Mia');\n * hot.selectCell(0, 0);\n * hot.resumeRender(); // It re-renders the table internally\n * ```\n */\n\n\n this.suspendRender = function () {\n this.renderSuspendedCounter += 1;\n };\n /**\n * Resumes the rendering process. In combination with the {@link core#suspendrender Core#suspendRender}\n * method it allows aggregating the table render cycles triggered by API calls or UI\n * actions (or both) and calls the \"render\" once in the end. When the table is in\n * the suspend state, most operations will have no visual effect until the rendering\n * state is resumed. Resuming the state automatically invokes the table rendering.\n *\n * The method is intended to be used by advanced users. Suspending the rendering\n * process could cause visual glitches when wrongly implemented.\n *\n * @memberof Core#\n * @function resumeRender\n * @since 8.3.0\n * @example\n * ```js\n * hot.suspendRender();\n * hot.alter('insert_row', 5, 45);\n * hot.alter('insert_col', 10, 40);\n * hot.setDataAtCell(1, 1, 'John');\n * hot.setDataAtCell(2, 2, 'Mark');\n * hot.setDataAtCell(3, 3, 'Ann');\n * hot.setDataAtCell(4, 4, 'Sophia');\n * hot.setDataAtCell(5, 5, 'Mia');\n * hot.selectCell(0, 0);\n * hot.resumeRender(); // It re-renders the table internally\n * ```\n */\n\n\n this.resumeRender = function () {\n var nextValue = this.renderSuspendedCounter - 1;\n this.renderSuspendedCounter = Math.max(nextValue, 0);\n\n if (!this.isRenderSuspended() && nextValue === this.renderSuspendedCounter) {\n if (this.renderCall) {\n this.render();\n } else {\n this._refreshBorders(null);\n }\n }\n };\n /**\n * Rerender the table. Calling this method starts the process of recalculating, redrawing and applying the changes\n * to the DOM. While rendering the table all cell renderers are recalled.\n *\n * Calling this method manually is not recommended. Handsontable tries to render itself by choosing the most\n * optimal moments in its lifecycle.\n *\n * @memberof Core#\n * @function render\n */\n\n\n this.render = function () {\n if (this.view) {\n this.renderCall = true;\n this.forceFullRender = true; // used when data was changed\n\n if (!this.isRenderSuspended()) {\n editorManager.lockEditor();\n\n this._refreshBorders(null);\n\n editorManager.unlockEditor();\n }\n }\n };\n /**\n * The method aggregates multi-line API calls into a callback and postpones the\n * table rendering process. After the execution of the operations, the table is\n * rendered once. As a result, it improves the performance of wrapped operations.\n * Without batching, a similar case could trigger multiple table render calls.\n *\n * @memberof Core#\n * @function batchRender\n * @param {Function} wrappedOperations Batched operations wrapped in a function.\n * @returns {*} Returns result from the wrappedOperations callback.\n * @since 8.3.0\n * @example\n * ```js\n * hot.batchRender(() => {\n * hot.alter('insert_row', 5, 45);\n * hot.alter('insert_col', 10, 40);\n * hot.setDataAtCell(1, 1, 'John');\n * hot.setDataAtCell(2, 2, 'Mark');\n * hot.setDataAtCell(3, 3, 'Ann');\n * hot.setDataAtCell(4, 4, 'Sophia');\n * hot.setDataAtCell(5, 5, 'Mia');\n * hot.selectCell(0, 0);\n * // The table will be rendered once after executing the callback\n * });\n * ```\n */\n\n\n this.batchRender = function (wrappedOperations) {\n this.suspendRender();\n var result = wrappedOperations();\n this.resumeRender();\n return result;\n };\n /**\n * Checks if the table indexes recalculation process was suspended. See explanation\n * in {@link core#suspendexecution Core#suspendExecution}.\n *\n * @memberof Core#\n * @function isExecutionSuspended\n * @since 8.3.0\n * @returns {boolean}\n */\n\n\n this.isExecutionSuspended = function () {\n return this.executionSuspendedCounter > 0;\n };\n /**\n * Suspends the execution process. It's helpful to wrap the table logic changes\n * such as index changes into one call after which the cache is updated. As a result,\n * it improves the performance of wrapped operations.\n *\n * The method is intended to be used by advanced users. Suspending the execution\n * process could cause visual glitches caused by not updated the internal table cache.\n *\n * @memberof Core#\n * @function suspendExecution\n * @since 8.3.0\n * @example\n * ```js\n * hot.suspendExecution();\n * const filters = hot.getPlugin('filters');\n *\n * filters.addCondition(2, 'contains', ['3']);\n * filters.filter();\n * hot.getPlugin('columnSorting').sort({ column: 1, sortOrder: 'desc' });\n * hot.resumeExecution(); // It updates the cache internally\n * ```\n */\n\n\n this.suspendExecution = function () {\n this.executionSuspendedCounter += 1;\n this.columnIndexMapper.suspendOperations();\n this.rowIndexMapper.suspendOperations();\n };\n /**\n * Resumes the execution process. In combination with the {@link core#suspendexecution Core#suspendExecution}\n * method it allows aggregating the table logic changes after which the cache is\n * updated. Resuming the state automatically invokes the table cache updating process.\n *\n * The method is intended to be used by advanced users. Suspending the execution\n * process could cause visual glitches caused by not updated the internal table cache.\n *\n * @memberof Core#\n * @function resumeExecution\n * @param {boolean} [forceFlushChanges=false] If `true`, the table internal data cache\n * is recalculated after the execution of the batched operations. For nested\n * {@link core#batchexecution Core#batchExecution} calls, it can be desire to recalculate the table\n * after each batch.\n * @since 8.3.0\n * @example\n * ```js\n * hot.suspendExecution();\n * const filters = hot.getPlugin('filters');\n *\n * filters.addCondition(2, 'contains', ['3']);\n * filters.filter();\n * hot.getPlugin('columnSorting').sort({ column: 1, sortOrder: 'desc' });\n * hot.resumeExecution(); // It updates the cache internally\n * ```\n */\n\n\n this.resumeExecution = function () {\n var forceFlushChanges = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var nextValue = this.executionSuspendedCounter - 1;\n this.executionSuspendedCounter = Math.max(nextValue, 0);\n\n if (!this.isExecutionSuspended() && nextValue === this.executionSuspendedCounter || forceFlushChanges) {\n this.columnIndexMapper.resumeOperations();\n this.rowIndexMapper.resumeOperations();\n }\n };\n /**\n * The method aggregates multi-line API calls into a callback and postpones the\n * table execution process. After the execution of the operations, the internal table\n * cache is recalculated once. As a result, it improves the performance of wrapped\n * operations. Without batching, a similar case could trigger multiple table cache rebuilds.\n *\n * @memberof Core#\n * @function batchExecution\n * @param {Function} wrappedOperations Batched operations wrapped in a function.\n * @param {boolean} [forceFlushChanges=false] If `true`, the table internal data cache\n * is recalculated after the execution of the batched operations. For nested calls,\n * it can be a desire to recalculate the table after each batch.\n * @returns {*} Returns result from the wrappedOperations callback.\n * @since 8.3.0\n * @example\n * ```js\n * hot.batchExecution(() => {\n * const filters = hot.getPlugin('filters');\n *\n * filters.addCondition(2, 'contains', ['3']);\n * filters.filter();\n * hot.getPlugin('columnSorting').sort({ column: 1, sortOrder: 'desc' });\n * // The table cache will be recalculated once after executing the callback\n * });\n * ```\n */\n\n\n this.batchExecution = function (wrappedOperations) {\n var forceFlushChanges = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n this.suspendExecution();\n var result = wrappedOperations();\n this.resumeExecution(forceFlushChanges);\n return result;\n };\n /**\n * It batches the rendering process and index recalculations. The method aggregates\n * multi-line API calls into a callback and postpones the table rendering process\n * as well aggregates the table logic changes such as index changes into one call\n * after which the cache is updated. After the execution of the operations, the\n * table is rendered, and the cache is updated once. As a result, it improves the\n * performance of wrapped operations.\n *\n * @memberof Core#\n * @function batch\n * @param {Function} wrappedOperations Batched operations wrapped in a function.\n * @returns {*} Returns result from the wrappedOperations callback.\n * @since 8.3.0\n * @example\n * ```js\n * hot.batch(() => {\n * hot.alter('insert_row', 5, 45);\n * hot.alter('insert_col', 10, 40);\n * hot.setDataAtCell(1, 1, 'x');\n * hot.setDataAtCell(2, 2, 'c');\n * hot.setDataAtCell(3, 3, 'v');\n * hot.setDataAtCell(4, 4, 'b');\n * hot.setDataAtCell(5, 5, 'n');\n * hot.selectCell(0, 0);\n *\n * const filters = hot.getPlugin('filters');\n *\n * filters.addCondition(2, 'contains', ['3']);\n * filters.filter();\n * hot.getPlugin('columnSorting').sort({ column: 1, sortOrder: 'desc' });\n * // The table will be re-rendered and cache will be recalculated once after executing the callback\n * });\n * ```\n */\n\n\n this.batch = function (wrappedOperations) {\n this.suspendRender();\n this.suspendExecution();\n var result = wrappedOperations();\n this.resumeExecution();\n this.resumeRender();\n return result;\n };\n /**\n * Updates dimensions of the table. The method compares previous dimensions with the current ones and updates accordingly.\n *\n * @memberof Core#\n * @function refreshDimensions\n * @fires Hooks#beforeRefreshDimensions\n * @fires Hooks#afterRefreshDimensions\n */\n\n\n this.refreshDimensions = function () {\n if (!instance.view) {\n return;\n }\n\n var _instance$view$getLas = instance.view.getLastSize(),\n lastWidth = _instance$view$getLas.width,\n lastHeight = _instance$view$getLas.height;\n\n var _instance$rootElement = instance.rootElement.getBoundingClientRect(),\n width = _instance$rootElement.width,\n height = _instance$rootElement.height;\n\n var isSizeChanged = width !== lastWidth || height !== lastHeight;\n var isResizeBlocked = instance.runHooks('beforeRefreshDimensions', {\n width: lastWidth,\n height: lastHeight\n }, {\n width: width,\n height: height\n }, isSizeChanged) === false;\n\n if (isResizeBlocked) {\n return;\n }\n\n if (isSizeChanged || instance.view.wt.wtOverlays.scrollableElement === instance.rootWindow) {\n instance.view.setLastSize(width, height);\n instance.render();\n }\n\n instance.runHooks('afterRefreshDimensions', {\n width: lastWidth,\n height: lastHeight\n }, {\n width: width,\n height: height\n }, isSizeChanged);\n };\n /**\n * Loads new data to Handsontable. Loading new data resets the cell meta.\n * Since 8.0.0 loading new data also resets states corresponding to rows and columns\n * (for example, row/column sequence, column width, row height, frozen columns etc.).\n *\n * @memberof Core#\n * @function loadData\n * @param {Array} data Array of arrays or array of objects containing data.\n * @param {string} [source] Source of the loadData call.\n * @fires Hooks#beforeLoadData\n * @fires Hooks#afterLoadData\n * @fires Hooks#afterChange\n */\n\n\n this.loadData = function (data, source) {\n if (Array.isArray(tableMeta.dataSchema)) {\n instance.dataType = 'array';\n } else if (isFunction(tableMeta.dataSchema)) {\n instance.dataType = 'function';\n } else {\n instance.dataType = 'object';\n }\n\n if (datamap) {\n datamap.destroy();\n }\n\n data = instance.runHooks('beforeLoadData', data, firstRun, source);\n datamap = new DataMap(instance, data, tableMeta);\n\n if (_typeof(data) === 'object' && data !== null) {\n if (!(data.push && data.splice)) {\n // check if data is array. Must use duck-type check so Backbone Collections also pass it\n // when data is not an array, attempt to make a single-row array of it\n // eslint-disable-next-line no-param-reassign\n data = [data];\n }\n } else if (data === null) {\n var dataSchema = datamap.getSchema(); // eslint-disable-next-line no-param-reassign\n\n data = [];\n var row;\n var r = 0;\n var rlen = 0;\n\n for (r = 0, rlen = tableMeta.startRows; r < rlen; r++) {\n if ((instance.dataType === 'object' || instance.dataType === 'function') && tableMeta.dataSchema) {\n row = deepClone(dataSchema);\n data.push(row);\n } else if (instance.dataType === 'array') {\n row = deepClone(dataSchema[0]);\n data.push(row);\n } else {\n row = [];\n\n for (var c = 0, clen = tableMeta.startCols; c < clen; c++) {\n row.push(null);\n }\n\n data.push(row);\n }\n }\n } else {\n throw new Error(\"loadData only accepts array of objects or array of arrays (\".concat(_typeof(data), \" given)\"));\n }\n\n if (Array.isArray(data[0])) {\n instance.dataType = 'array';\n }\n\n tableMeta.data = data;\n datamap.dataSource = data;\n dataSource.data = data;\n dataSource.dataType = instance.dataType;\n dataSource.colToProp = datamap.colToProp.bind(datamap);\n dataSource.propToCol = datamap.propToCol.bind(datamap);\n dataSource.countCachedColumns = datamap.countCachedColumns.bind(datamap);\n metaManager.clearCellsCache();\n instance.initIndexMappers();\n grid.adjustRowsAndCols();\n instance.runHooks('afterLoadData', data, firstRun, source);\n\n if (firstRun) {\n firstRun = [null, 'loadData'];\n } else {\n instance.runHooks('afterChange', null, 'loadData');\n instance.render();\n }\n };\n /**\n * Init index mapper which manage indexes assigned to the data.\n *\n * @private\n */\n\n\n this.initIndexMappers = function () {\n var columnsSettings = tableMeta.columns;\n var finalNrOfColumns = 0; // We will check number of columns when the `columns` property was defined as an array. Columns option may\n // narrow down or expand displayed dataset in that case.\n\n if (Array.isArray(columnsSettings)) {\n finalNrOfColumns = columnsSettings.length;\n } else if (isFunction(columnsSettings)) {\n if (instance.dataType === 'array') {\n var nrOfSourceColumns = this.countSourceCols();\n\n for (var columnIndex = 0; columnIndex < nrOfSourceColumns; columnIndex += 1) {\n if (columnsSettings(columnIndex)) {\n finalNrOfColumns += 1;\n }\n } // Extended dataset by the `columns` property? Moved code right from the refactored `countCols` method.\n\n } else if (instance.dataType === 'object' || instance.dataType === 'function') {\n finalNrOfColumns = datamap.colToPropCache.length;\n } // In some cases we need to check columns length from the schema, i.e. `data` may be empty.\n\n } else if (isDefined(tableMeta.dataSchema)) {\n var schema = datamap.getSchema(); // Schema may be defined as an array of objects. Each object will define column.\n\n finalNrOfColumns = Array.isArray(schema) ? schema.length : deepObjectSize(schema);\n } else {\n // We init index mappers by length of source data to provide indexes also for skipped indexes.\n finalNrOfColumns = this.countSourceCols();\n }\n\n this.columnIndexMapper.initToLength(finalNrOfColumns);\n this.rowIndexMapper.initToLength(this.countSourceRows());\n };\n /**\n * Returns the current data object (the same one that was passed by `data` configuration option or `loadData` method,\n * unless some modifications have been applied (i.e. Sequence of rows/columns was changed, some row/column was skipped).\n * If that's the case - use the {@link core#getsourcedata Core#getSourceData} method.).\n *\n * Optionally you can provide cell range by defining `row`, `column`, `row2`, `column2` to get only a fragment of table data.\n *\n * @memberof Core#\n * @function getData\n * @param {number} [row] From visual row index.\n * @param {number} [column] From visual column index.\n * @param {number} [row2] To visual row index.\n * @param {number} [column2] To visual column index.\n * @returns {Array[]} Array with the data.\n * @example\n * ```js\n * // Get all data (in order how it is rendered in the table).\n * hot.getData();\n * // Get data fragment (from top-left 0, 0 to bottom-right 3, 3).\n * hot.getData(3, 3);\n * // Get data fragment (from top-left 2, 1 to bottom-right 3, 3).\n * hot.getData(2, 1, 3, 3);\n * ```\n */\n\n\n this.getData = function (row, column, row2, column2) {\n if (isUndefined(row)) {\n return datamap.getAll();\n }\n\n return datamap.getRange(new CellCoords(row, column), new CellCoords(row2, column2), datamap.DESTINATION_RENDERER);\n };\n /**\n * Returns a string value of the selected range. Each column is separated by tab, each row is separated by a new\n * line character.\n *\n * @memberof Core#\n * @function getCopyableText\n * @param {number} startRow From visual row index.\n * @param {number} startCol From visual column index.\n * @param {number} endRow To visual row index.\n * @param {number} endCol To visual column index.\n * @returns {string}\n */\n\n\n this.getCopyableText = function (startRow, startCol, endRow, endCol) {\n return datamap.getCopyableText(new CellCoords(startRow, startCol), new CellCoords(endRow, endCol));\n };\n /**\n * Returns the data's copyable value at specified `row` and `column` index.\n *\n * @memberof Core#\n * @function getCopyableData\n * @param {number} row Visual row index.\n * @param {number} column Visual column index.\n * @returns {string}\n */\n\n\n this.getCopyableData = function (row, column) {\n return datamap.getCopyable(row, datamap.colToProp(column));\n };\n /**\n * Returns schema provided by constructor settings. If it doesn't exist then it returns the schema based on the data\n * structure in the first row.\n *\n * @memberof Core#\n * @function getSchema\n * @returns {object} Schema object.\n */\n\n\n this.getSchema = function () {\n return datamap.getSchema();\n };\n /**\n * Use it if you need to change configuration after initialization. The `settings` argument is an object containing the new\n * settings, declared the same way as in the initial settings object.\n *\n * __Note__, that although the `updateSettings` method doesn't overwrite the previously declared settings, it might reset\n * the settings made post-initialization. (for example - ignore changes made using the columnResize feature).\n *\n * Since 8.0.0 passing `columns` or `data` inside `settings` objects will result in resetting states corresponding to rows and columns\n * (for example, row/column sequence, column width, row height, frozen columns etc.).\n *\n * @memberof Core#\n * @function updateSettings\n * @param {object} settings New settings object (see {@link options Options}).\n * @param {boolean} [init=false] Internally used for in initialization mode.\n * @example\n * ```js\n * hot.updateSettings({\n * contextMenu: true,\n * colHeaders: true,\n * fixedRowsTop: 2\n * });\n * ```\n * @fires Hooks#afterCellMetaReset\n * @fires Hooks#afterUpdateSettings\n */\n\n\n this.updateSettings = function (settings) {\n var init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var columnsAsFunc = false;\n var i;\n var j;\n\n if (isDefined(settings.rows)) {\n throw new Error('The \"rows\" setting is no longer supported. Do you mean startRows, minRows or maxRows?');\n }\n\n if (isDefined(settings.cols)) {\n throw new Error('The \"cols\" setting is no longer supported. Do you mean startCols, minCols or maxCols?');\n }\n\n if (isDefined(settings.ganttChart)) {\n throw new Error('Since 8.0.0 the \"ganttChart\" setting is no longer supported.');\n } // eslint-disable-next-line no-restricted-syntax\n\n\n for (i in settings) {\n if (i === 'data') {\n /* eslint-disable-next-line no-continue */\n continue; // loadData will be triggered later\n } else if (i === 'language') {\n setLanguage(settings.language);\n /* eslint-disable-next-line no-continue */\n\n continue;\n } else if (i === 'className') {\n setClassName('className', settings.className);\n } else if (i === 'tableClassName' && instance.table) {\n setClassName('tableClassName', settings.tableClassName);\n instance.view.wt.wtOverlays.syncOverlayTableClassNames();\n } else if (Hooks.getSingleton().isRegistered(i) || Hooks.getSingleton().isDeprecated(i)) {\n if (isFunction(settings[i]) || Array.isArray(settings[i])) {\n settings[i].initialHook = true;\n instance.addHook(i, settings[i]);\n }\n } else if (!init && hasOwnProperty(settings, i)) {\n // Update settings\n globalMeta[i] = settings[i];\n }\n } // Load data or create data map\n\n\n if (settings.data === void 0 && tableMeta.data === void 0) {\n instance.loadData(null, 'updateSettings'); // data source created just now\n } else if (settings.data !== void 0) {\n instance.loadData(settings.data, 'updateSettings'); // data source given as option\n } else if (settings.columns !== void 0) {\n datamap.createMap(); // The `column` property has changed - dataset may be expanded or narrowed down. The `loadData` do the same.\n\n instance.initIndexMappers();\n }\n\n var clen = instance.countCols();\n var columnSetting = tableMeta.columns; // Init columns constructors configuration\n\n if (columnSetting && isFunction(columnSetting)) {\n columnsAsFunc = true;\n } // Clear cell meta cache\n\n\n if (settings.cell !== void 0 || settings.cells !== void 0 || settings.columns !== void 0) {\n metaManager.clearCache();\n }\n\n if (clen > 0) {\n for (i = 0, j = 0; i < clen; i++) {\n // Use settings provided by user\n if (columnSetting) {\n var column = columnsAsFunc ? columnSetting(i) : columnSetting[j];\n\n if (column) {\n metaManager.updateColumnMeta(j, column);\n }\n }\n\n j += 1;\n }\n }\n\n if (isDefined(settings.cell)) {\n objectEach(settings.cell, function (cell) {\n instance.setCellMetaObject(cell.row, cell.col, cell);\n });\n }\n\n instance.runHooks('afterCellMetaReset');\n var currentHeight = instance.rootElement.style.height;\n\n if (currentHeight !== '') {\n currentHeight = parseInt(instance.rootElement.style.height, 10);\n }\n\n var height = settings.height;\n\n if (isFunction(height)) {\n height = height();\n }\n\n if (init) {\n var initialStyle = instance.rootElement.getAttribute('style');\n\n if (initialStyle) {\n instance.rootElement.setAttribute('data-initialstyle', instance.rootElement.getAttribute('style'));\n }\n }\n\n if (height === null) {\n var _initialStyle = instance.rootElement.getAttribute('data-initialstyle');\n\n if (_initialStyle && (_initialStyle.indexOf('height') > -1 || _initialStyle.indexOf('overflow') > -1)) {\n instance.rootElement.setAttribute('style', _initialStyle);\n } else {\n instance.rootElement.style.height = '';\n instance.rootElement.style.overflow = '';\n }\n } else if (height !== void 0) {\n instance.rootElement.style.height = isNaN(height) ? \"\".concat(height) : \"\".concat(height, \"px\");\n instance.rootElement.style.overflow = 'hidden';\n }\n\n if (typeof settings.width !== 'undefined') {\n var width = settings.width;\n\n if (isFunction(width)) {\n width = width();\n }\n\n instance.rootElement.style.width = isNaN(width) ? \"\".concat(width) : \"\".concat(width, \"px\");\n }\n\n if (!init) {\n if (instance.view) {\n instance.view.wt.wtViewport.resetHasOversizedColumnHeadersMarked();\n instance.view.wt.exportSettingsAsClassNames();\n }\n\n instance.runHooks('afterUpdateSettings', settings);\n }\n\n grid.adjustRowsAndCols();\n\n if (instance.view && !firstRun) {\n instance.forceFullRender = true; // used when data was changed\n\n editorManager.lockEditor();\n\n instance._refreshBorders(null);\n\n instance.view.wt.wtOverlays.adjustElementsSize();\n editorManager.unlockEditor();\n }\n\n if (!init && instance.view && (currentHeight === '' || height === '' || height === void 0) && currentHeight !== height) {\n instance.view.wt.wtOverlays.updateMainScrollableElements();\n }\n };\n /**\n * Get value from the selected cell.\n *\n * @memberof Core#\n * @function getValue\n * @returns {*} Value of selected cell.\n */\n\n\n this.getValue = function () {\n var sel = instance.getSelectedLast();\n\n if (tableMeta.getValue) {\n if (isFunction(tableMeta.getValue)) {\n return tableMeta.getValue.call(instance);\n } else if (sel) {\n return instance.getData()[sel[0][0]][tableMeta.getValue];\n }\n } else if (sel) {\n return instance.getDataAtCell(sel[0], sel[1]);\n }\n };\n /**\n * Returns the object settings.\n *\n * @memberof Core#\n * @function getSettings\n * @returns {object} Object containing the current table settings.\n */\n\n\n this.getSettings = function () {\n return tableMeta;\n };\n /**\n * Clears the data from the table (the table settings remain intact).\n *\n * @memberof Core#\n * @function clear\n */\n\n\n this.clear = function () {\n this.selectAll();\n this.emptySelectedCells();\n };\n /**\n * Allows altering the table structure by either inserting/removing rows or columns.\n * This method works with an array data structure only.\n *\n * @memberof Core#\n * @function alter\n * @param {string} action Possible alter operations:\n * \n * - `'insert_row'`
\n * - `'insert_col'`
\n * - `'remove_row'`
\n * - `'remove_col'`
\n * .\n * @param {number|number[]} index Visual index of the row/column before which the new row/column will be\n * inserted/removed or an array of arrays in format `[[index, amount],...]`.\n * @param {number} [amount=1] Amount of rows/columns to be inserted or removed.\n * @param {string} [source] Source indicator.\n * @param {boolean} [keepEmptyRows] Flag for preventing deletion of empty rows.\n * @example\n * ```js\n * // Insert new row above the row at given visual index.\n * hot.alter('insert_row', 10);\n * // Insert 3 new columns before 10th column.\n * hot.alter('insert_col', 10, 3);\n * // Remove 2 rows starting from 10th row.\n * hot.alter('remove_row', 10, 2);\n * // Remove 5 non-contiquous rows (it removes 3 rows from visual index 1 and 2 rows from visual index 5).\n * hot.alter('remove_row', [[1, 3], [5, 2]]);\n * ```\n */\n\n\n this.alter = function (action, index, amount, source, keepEmptyRows) {\n grid.alter(action, index, amount, source, keepEmptyRows);\n };\n /**\n * Returns a TD element for the given `row` and `column` arguments, if it is rendered on screen.\n * Returns `null` if the TD is not rendered on screen (probably because that part of the table is not visible).\n *\n * @memberof Core#\n * @function getCell\n * @param {number} row Visual row index.\n * @param {number} column Visual column index.\n * @param {boolean} [topmost=false] If set to `true`, it returns the TD element from the topmost overlay. For example,\n * if the wanted cell is in the range of fixed rows, it will return a TD element from the `top` overlay.\n * @returns {HTMLTableCellElement|null} The cell's TD element.\n */\n\n\n this.getCell = function (row, column) {\n var topmost = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var renderableColumnIndex = column; // Handling also column headers.\n\n var renderableRowIndex = row; // Handling also row headers.\n\n if (column >= 0) {\n if (this.columnIndexMapper.isHidden(this.toPhysicalColumn(column))) {\n return null;\n }\n\n renderableColumnIndex = this.columnIndexMapper.getRenderableFromVisualIndex(column);\n }\n\n if (row >= 0) {\n if (this.rowIndexMapper.isHidden(this.toPhysicalRow(row))) {\n return null;\n }\n\n renderableRowIndex = this.rowIndexMapper.getRenderableFromVisualIndex(row);\n }\n\n if (renderableRowIndex === null || renderableColumnIndex === null) {\n return null;\n }\n\n return instance.view.getCellAtCoords(new CellCoords(renderableRowIndex, renderableColumnIndex), topmost);\n };\n /**\n * Returns the coordinates of the cell, provided as a HTML table cell element.\n *\n * @memberof Core#\n * @function getCoords\n * @param {HTMLTableCellElement} element The HTML Element representing the cell.\n * @returns {CellCoords|null} Visual coordinates object.\n * @example\n * ```js\n * hot.getCoords(hot.getCell(1, 1));\n * // it returns CellCoords object instance with props row: 1 and col: 1.\n * ```\n */\n\n\n this.getCoords = function (element) {\n var renderableCoords = this.view.wt.wtTable.getCoords(element);\n\n if (renderableCoords === null) {\n return null;\n }\n\n var renderableRow = renderableCoords.row,\n renderableColumn = renderableCoords.col;\n var visualRow = renderableRow;\n var visualColumn = renderableColumn;\n\n if (renderableRow >= 0) {\n visualRow = this.rowIndexMapper.getVisualFromRenderableIndex(renderableRow);\n }\n\n if (renderableColumn >= 0) {\n visualColumn = this.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn);\n }\n\n return new CellCoords(visualRow, visualColumn);\n };\n /**\n * Returns the property name that corresponds with the given column index.\n * If the data source is an array of arrays, it returns the columns index.\n *\n * @memberof Core#\n * @function colToProp\n * @param {number} column Visual column index.\n * @returns {string|number} Column property or physical column index.\n */\n\n\n this.colToProp = function (column) {\n return datamap.colToProp(column);\n };\n /**\n * Returns column index that corresponds with the given property.\n *\n * @memberof Core#\n * @function propToCol\n * @param {string|number} prop Property name or physical column index.\n * @returns {number} Visual column index.\n */\n\n\n this.propToCol = function (prop) {\n return datamap.propToCol(prop);\n };\n /**\n * Translate physical row index into visual.\n *\n * This method is useful when you want to retrieve visual row index which can be reordered, moved or trimmed\n * based on a physical index.\n *\n * @memberof Core#\n * @function toVisualRow\n * @param {number} row Physical row index.\n * @returns {number} Returns visual row index.\n */\n\n\n this.toVisualRow = function (row) {\n return _this.rowIndexMapper.getVisualFromPhysicalIndex(row);\n };\n /**\n * Translate physical column index into visual.\n *\n * This method is useful when you want to retrieve visual column index which can be reordered, moved or trimmed\n * based on a physical index.\n *\n * @memberof Core#\n * @function toVisualColumn\n * @param {number} column Physical column index.\n * @returns {number} Returns visual column index.\n */\n\n\n this.toVisualColumn = function (column) {\n return _this.columnIndexMapper.getVisualFromPhysicalIndex(column);\n };\n /**\n * Translate visual row index into physical.\n *\n * This method is useful when you want to retrieve physical row index based on a visual index which can be\n * reordered, moved or trimmed.\n *\n * @memberof Core#\n * @function toPhysicalRow\n * @param {number} row Visual row index.\n * @returns {number} Returns physical row index.\n */\n\n\n this.toPhysicalRow = function (row) {\n return _this.rowIndexMapper.getPhysicalFromVisualIndex(row);\n };\n /**\n * Translate visual column index into physical.\n *\n * This method is useful when you want to retrieve physical column index based on a visual index which can be\n * reordered, moved or trimmed.\n *\n * @memberof Core#\n * @function toPhysicalColumn\n * @param {number} column Visual column index.\n * @returns {number} Returns physical column index.\n */\n\n\n this.toPhysicalColumn = function (column) {\n return _this.columnIndexMapper.getPhysicalFromVisualIndex(column);\n };\n /**\n * @description\n * Returns the cell value at `row`, `column`.\n *\n * __Note__: If data is reordered, sorted or trimmed, the currently visible order will be used.\n *\n * @memberof Core#\n * @function getDataAtCell\n * @param {number} row Visual row index.\n * @param {number} column Visual column index.\n * @returns {*} Data at cell.\n */\n\n\n this.getDataAtCell = function (row, column) {\n return datamap.get(row, datamap.colToProp(column));\n };\n /**\n * Returns value at visual `row` and `prop` indexes.\n *\n * __Note__: If data is reordered, sorted or trimmed, the currently visible order will be used.\n *\n * @memberof Core#\n * @function getDataAtRowProp\n * @param {number} row Visual row index.\n * @param {string} prop Property name.\n * @returns {*} Cell value.\n */\n\n\n this.getDataAtRowProp = function (row, prop) {\n return datamap.get(row, prop);\n };\n /**\n * @description\n * Returns array of column values from the data source.\n *\n * __Note__: If columns were reordered or sorted, the currently visible order will be used.\n *\n * @memberof Core#\n * @function getDataAtCol\n * @param {number} column Visual column index.\n * @returns {Array} Array of cell values.\n */\n\n\n this.getDataAtCol = function (column) {\n var _ref13;\n\n return (_ref13 = []).concat.apply(_ref13, _toConsumableArray(datamap.getRange(new CellCoords(0, column), new CellCoords(tableMeta.data.length - 1, column), datamap.DESTINATION_RENDERER)));\n };\n /**\n * Given the object property name (e.g. `'first.name'` or `'0'`), returns an array of column's values from the table data.\n * You can also provide a column index as the first argument.\n *\n * @memberof Core#\n * @function getDataAtProp\n * @param {string|number} prop Property name or physical column index.\n * @returns {Array} Array of cell values.\n */\n // TODO: Getting data from `datamap` should work on visual indexes.\n\n\n this.getDataAtProp = function (prop) {\n var _ref14;\n\n var range = datamap.getRange(new CellCoords(0, datamap.propToCol(prop)), new CellCoords(tableMeta.data.length - 1, datamap.propToCol(prop)), datamap.DESTINATION_RENDERER);\n return (_ref14 = []).concat.apply(_ref14, _toConsumableArray(range));\n };\n /**\n * Returns a clone of the source data object.\n * Optionally you can provide a cell range by using the `row`, `column`, `row2`, `column2` arguments, to get only a\n * fragment of the table data.\n *\n * __Note__: This method does not participate in data transformation. If the visual data of the table is reordered,\n * sorted or trimmed only physical indexes are correct.\n *\n * @memberof Core#\n * @function getSourceData\n * @param {number} [row] From physical row index.\n * @param {number} [column] From physical column index (or visual index, if data type is an array of objects).\n * @param {number} [row2] To physical row index.\n * @param {number} [column2] To physical column index (or visual index, if data type is an array of objects).\n * @returns {Array[]|object[]} The table data.\n */\n\n\n this.getSourceData = function (row, column, row2, column2) {\n var data;\n\n if (row === void 0) {\n data = dataSource.getData();\n } else {\n data = dataSource.getByRange(new CellCoords(row, column), new CellCoords(row2, column2));\n }\n\n return data;\n };\n /**\n * Returns the source data object as an arrays of arrays format even when source data was provided in another format.\n * Optionally you can provide a cell range by using the `row`, `column`, `row2`, `column2` arguments, to get only a\n * fragment of the table data.\n *\n * __Note__: This method does not participate in data transformation. If the visual data of the table is reordered,\n * sorted or trimmed only physical indexes are correct.\n *\n * @memberof Core#\n * @function getSourceDataArray\n * @param {number} [row] From physical row index.\n * @param {number} [column] From physical column index (or visual index, if data type is an array of objects).\n * @param {number} [row2] To physical row index.\n * @param {number} [column2] To physical column index (or visual index, if data type is an array of objects).\n * @returns {Array} An array of arrays.\n */\n\n\n this.getSourceDataArray = function (row, column, row2, column2) {\n var data;\n\n if (row === void 0) {\n data = dataSource.getData(true);\n } else {\n data = dataSource.getByRange(new CellCoords(row, column), new CellCoords(row2, column2), true);\n }\n\n return data;\n };\n /**\n * Returns an array of column values from the data source.\n *\n * @memberof Core#\n * @function getSourceDataAtCol\n * @param {number} column Visual column index.\n * @returns {Array} Array of the column's cell values.\n */\n // TODO: Getting data from `sourceData` should work always on physical indexes.\n\n\n this.getSourceDataAtCol = function (column) {\n return dataSource.getAtColumn(column);\n };\n /* eslint-disable jsdoc/require-param */\n\n /**\n * Set the provided value in the source data set at the provided coordinates.\n *\n * @memberof Core#\n * @function setSourceDataAtCell\n * @param {number|Array} row Physical row index or array of changes in format `[[row, prop, value], ...]`.\n * @param {number|string} column Physical column index / prop name.\n * @param {*} value The value to be set at the provided coordinates.\n * @param {string} [source] Source of the change as a string.\n */\n\n /* eslint-enable jsdoc/require-param */\n\n\n this.setSourceDataAtCell = function (row, column, value, source) {\n var input = setDataInputToArray(row, column, value);\n var isThereAnySetSourceListener = this.hasHook('afterSetSourceDataAtCell');\n var changesForHook = [];\n\n if (isThereAnySetSourceListener) {\n arrayEach(input, function (_ref15) {\n var _ref16 = _slicedToArray(_ref15, 3),\n changeRow = _ref16[0],\n changeProp = _ref16[1],\n changeValue = _ref16[2];\n\n changesForHook.push([changeRow, changeProp, dataSource.getAtCell(changeRow, changeProp), // The previous value.\n changeValue]);\n });\n }\n\n arrayEach(input, function (_ref17) {\n var _ref18 = _slicedToArray(_ref17, 3),\n changeRow = _ref18[0],\n changeProp = _ref18[1],\n changeValue = _ref18[2];\n\n dataSource.setAtCell(changeRow, changeProp, changeValue);\n });\n\n if (isThereAnySetSourceListener) {\n this.runHooks('afterSetSourceDataAtCell', changesForHook, source);\n }\n\n this.render();\n var activeEditor = instance.getActiveEditor();\n\n if (activeEditor && isDefined(activeEditor.refreshValue)) {\n activeEditor.refreshValue();\n }\n };\n /**\n * Returns a single row of the data (array or object, depending on what data format you use).\n *\n * __Note__: This method does not participate in data transformation. If the visual data of the table is reordered,\n * sorted or trimmed only physical indexes are correct.\n *\n * @memberof Core#\n * @function getSourceDataAtRow\n * @param {number} row Physical row index.\n * @returns {Array|object} Single row of data.\n */\n\n\n this.getSourceDataAtRow = function (row) {\n return dataSource.getAtRow(row);\n };\n /**\n * Returns a single value from the data source.\n *\n * @memberof Core#\n * @function getSourceDataAtCell\n * @param {number} row Physical row index.\n * @param {number} column Visual column index.\n * @returns {*} Cell data.\n */\n // TODO: Getting data from `sourceData` should work always on physical indexes.\n\n\n this.getSourceDataAtCell = function (row, column) {\n return dataSource.getAtCell(row, column);\n };\n /**\n * @description\n * Returns a single row of the data.\n *\n * __Note__: If rows were reordered, sorted or trimmed, the currently visible order will be used.\n *\n * @memberof Core#\n * @function getDataAtRow\n * @param {number} row Visual row index.\n * @returns {Array} Array of row's cell data.\n */\n\n\n this.getDataAtRow = function (row) {\n var data = datamap.getRange(new CellCoords(row, 0), new CellCoords(row, this.countCols() - 1), datamap.DESTINATION_RENDERER);\n return data[0] || [];\n };\n /**\n * @description\n * Returns a data type defined in the Handsontable settings under the `type` key ({@link options#type Options#type}).\n * If there are cells with different types in the selected range, it returns `'mixed'`.\n *\n * __Note__: If data is reordered, sorted or trimmed, the currently visible order will be used.\n *\n * @memberof Core#\n * @function getDataType\n * @param {number} rowFrom From visual row index.\n * @param {number} columnFrom From visual column index.\n * @param {number} rowTo To visual row index.\n * @param {number} columnTo To visual column index.\n * @returns {string} Cell type (e.q: `'mixed'`, `'text'`, `'numeric'`, `'autocomplete'`).\n */\n\n\n this.getDataType = function (rowFrom, columnFrom, rowTo, columnTo) {\n var _this3 = this;\n\n var coords = rowFrom === void 0 ? [0, 0, this.countRows(), this.countCols()] : [rowFrom, columnFrom, rowTo, columnTo];\n var rowStart = coords[0],\n columnStart = coords[1];\n var rowEnd = coords[2],\n columnEnd = coords[3];\n var previousType = null;\n var currentType = null;\n\n if (rowEnd === void 0) {\n rowEnd = rowStart;\n }\n\n if (columnEnd === void 0) {\n columnEnd = columnStart;\n }\n\n var type = 'mixed';\n rangeEach(Math.max(Math.min(rowStart, rowEnd), 0), Math.max(rowStart, rowEnd), function (row) {\n var isTypeEqual = true;\n rangeEach(Math.max(Math.min(columnStart, columnEnd), 0), Math.max(columnStart, columnEnd), function (column) {\n var cellType = _this3.getCellMeta(row, column);\n\n currentType = cellType.type;\n\n if (previousType) {\n isTypeEqual = previousType === currentType;\n } else {\n previousType = currentType;\n }\n\n return isTypeEqual;\n });\n type = isTypeEqual ? currentType : 'mixed';\n return isTypeEqual;\n });\n return type;\n };\n /**\n * Remove a property defined by the `key` argument from the cell meta object for the provided `row` and `column` coordinates.\n *\n * @memberof Core#\n * @function removeCellMeta\n * @param {number} row Visual row index.\n * @param {number} column Visual column index.\n * @param {string} key Property name.\n * @fires Hooks#beforeRemoveCellMeta\n * @fires Hooks#afterRemoveCellMeta\n */\n\n\n this.removeCellMeta = function (row, column, key) {\n var _ref19 = [this.toPhysicalRow(row), this.toPhysicalColumn(column)],\n physicalRow = _ref19[0],\n physicalColumn = _ref19[1];\n var cachedValue = metaManager.getCellMeta(physicalRow, physicalColumn, key);\n var hookResult = instance.runHooks('beforeRemoveCellMeta', row, column, key, cachedValue);\n\n if (hookResult !== false) {\n metaManager.removeCellMeta(physicalRow, physicalColumn, key);\n instance.runHooks('afterRemoveCellMeta', row, column, key, cachedValue);\n }\n\n cachedValue = null;\n };\n /**\n * Removes or adds one or more rows of the cell meta objects to the cell meta collections.\n *\n * @since 0.30.0\n * @memberof Core#\n * @function spliceCellsMeta\n * @param {number} visualIndex A visual index that specifies at what position to add/remove items.\n * @param {number} [deleteAmount=0] The number of items to be removed. If set to 0, no cell meta objects will be removed.\n * @param {...object} [cellMetaRows] The new cell meta row objects to be added to the cell meta collection.\n */\n\n\n this.spliceCellsMeta = function (visualIndex) {\n var _this4 = this;\n\n var deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n for (var _len3 = arguments.length, cellMetaRows = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n cellMetaRows[_key3 - 2] = arguments[_key3];\n }\n\n if (cellMetaRows.length > 0 && !Array.isArray(cellMetaRows[0])) {\n throw new Error('The 3rd argument (cellMetaRows) has to be passed as an array of cell meta objects array.');\n }\n\n if (deleteAmount > 0) {\n metaManager.removeRow(this.toPhysicalRow(visualIndex), deleteAmount);\n }\n\n if (cellMetaRows.length > 0) {\n arrayEach(cellMetaRows.reverse(), function (cellMetaRow) {\n metaManager.createRow(_this4.toPhysicalRow(visualIndex));\n arrayEach(cellMetaRow, function (cellMeta, columnIndex) {\n return _this4.setCellMetaObject(visualIndex, columnIndex, cellMeta);\n });\n });\n }\n };\n /**\n * Set cell meta data object defined by `prop` to the corresponding params `row` and `column`.\n *\n * @memberof Core#\n * @function setCellMetaObject\n * @param {number} row Visual row index.\n * @param {number} column Visual column index.\n * @param {object} prop Meta object.\n */\n\n\n this.setCellMetaObject = function (row, column, prop) {\n var _this5 = this;\n\n if (_typeof(prop) === 'object') {\n objectEach(prop, function (value, key) {\n _this5.setCellMeta(row, column, key, value);\n });\n }\n };\n /**\n * Sets a property defined by the `key` property to the meta object of a cell corresponding to params `row` and `column`.\n *\n * @memberof Core#\n * @function setCellMeta\n * @param {number} row Visual row index.\n * @param {number} column Visual column index.\n * @param {string} key Property name.\n * @param {string} value Property value.\n * @fires Hooks#beforeSetCellMeta\n * @fires Hooks#afterSetCellMeta\n */\n\n\n this.setCellMeta = function (row, column, key, value) {\n var allowSetCellMeta = instance.runHooks('beforeSetCellMeta', row, column, key, value);\n\n if (allowSetCellMeta === false) {\n return;\n }\n\n var physicalRow = row;\n var physicalColumn = column;\n\n if (row < this.countRows()) {\n physicalRow = this.toPhysicalRow(row);\n }\n\n if (column < this.countCols()) {\n physicalColumn = this.toPhysicalColumn(column);\n }\n\n metaManager.setCellMeta(physicalRow, physicalColumn, key, value);\n instance.runHooks('afterSetCellMeta', row, column, key, value);\n };\n /**\n * Get all the cells meta settings at least once generated in the table (in order of cell initialization).\n *\n * @memberof Core#\n * @function getCellsMeta\n * @returns {Array} Returns an array of ColumnSettings object instances.\n */\n\n\n this.getCellsMeta = function () {\n return metaManager.getCellsMeta();\n };\n /**\n * Returns the cell properties object for the given `row` and `column` coordinates.\n *\n * @memberof Core#\n * @function getCellMeta\n * @param {number} row Visual row index.\n * @param {number} column Visual column index.\n * @returns {object} The cell properties object.\n * @fires Hooks#beforeGetCellMeta\n * @fires Hooks#afterGetCellMeta\n */\n\n\n this.getCellMeta = function (row, column) {\n var physicalRow = this.toPhysicalRow(row);\n var physicalColumn = this.toPhysicalColumn(column);\n\n if (physicalRow === null) {\n physicalRow = row;\n }\n\n if (physicalColumn === null) {\n physicalColumn = column;\n }\n\n var prop = datamap.colToProp(column);\n var cellProperties = metaManager.getCellMeta(physicalRow, physicalColumn); // TODO(perf): Add assigning this props and executing below code only once per table render cycle.\n\n cellProperties.row = physicalRow;\n cellProperties.col = physicalColumn;\n cellProperties.visualRow = row;\n cellProperties.visualCol = column;\n cellProperties.prop = prop;\n cellProperties.instance = instance;\n instance.runHooks('beforeGetCellMeta', row, column, cellProperties); // for `type` added or changed in beforeGetCellMeta\n\n if (instance.hasHook('beforeGetCellMeta') && hasOwnProperty(cellProperties, 'type')) {\n metaManager.updateCellMeta(physicalRow, physicalColumn, {\n type: cellProperties.type\n });\n }\n\n if (cellProperties.cells) {\n var settings = cellProperties.cells(physicalRow, physicalColumn, prop);\n\n if (settings) {\n metaManager.updateCellMeta(physicalRow, physicalColumn, settings);\n }\n }\n\n instance.runHooks('afterGetCellMeta', row, column, cellProperties);\n return cellProperties;\n };\n /**\n * Returns an array of cell meta objects for specified physical row index.\n *\n * @memberof Core#\n * @function getCellMetaAtRow\n * @param {number} row Physical row index.\n * @returns {Array}\n */\n\n\n this.getCellMetaAtRow = function (row) {\n return metaManager.getCellsMetaAtRow(row);\n };\n /**\n * Checks if the data format and config allows user to modify the column structure.\n *\n * @memberof Core#\n * @function isColumnModificationAllowed\n * @returns {boolean}\n */\n\n\n this.isColumnModificationAllowed = function () {\n return !(instance.dataType === 'object' || tableMeta.columns);\n };\n\n var rendererLookup = cellMethodLookupFactory('renderer');\n /**\n * Returns the cell renderer function by given `row` and `column` arguments.\n *\n * @memberof Core#\n * @function getCellRenderer\n * @param {number|object} row Visual row index or cell meta object (see {@link core#getcellmeta Core#getCellMeta}).\n * @param {number} column Visual column index.\n * @returns {Function} The renderer function.\n * @example\n * ```js\n * // Get cell renderer using `row` and `column` coordinates.\n * hot.getCellRenderer(1, 1);\n * // Get cell renderer using cell meta object.\n * hot.getCellRenderer(hot.getCellMeta(1, 1));\n * ```\n */\n\n this.getCellRenderer = function (row, column) {\n return getRenderer(rendererLookup.call(this, row, column));\n };\n /**\n * Returns the cell editor class by the provided `row` and `column` arguments.\n *\n * @memberof Core#\n * @function getCellEditor\n * @param {number} row Visual row index or cell meta object (see {@link core#getcellmeta Core#getCellMeta}).\n * @param {number} column Visual column index.\n * @returns {Function} The editor class.\n * @example\n * ```js\n * // Get cell editor class using `row` and `column` coordinates.\n * hot.getCellEditor(1, 1);\n * // Get cell editor class using cell meta object.\n * hot.getCellEditor(hot.getCellMeta(1, 1));\n * ```\n */\n\n\n this.getCellEditor = cellMethodLookupFactory('editor');\n var validatorLookup = cellMethodLookupFactory('validator');\n /**\n * Returns the cell validator by `row` and `column`.\n *\n * @memberof Core#\n * @function getCellValidator\n * @param {number|object} row Visual row index or cell meta object (see {@link core#getcellmeta Core#getCellMeta}).\n * @param {number} column Visual column index.\n * @returns {Function|RegExp|undefined} The validator function.\n * @example\n * ```js\n * // Get cell valiator using `row` and `column` coordinates.\n * hot.getCellValidator(1, 1);\n * // Get cell valiator using cell meta object.\n * hot.getCellValidator(hot.getCellMeta(1, 1));\n * ```\n */\n\n this.getCellValidator = function (row, column) {\n var validator = validatorLookup.call(this, row, column);\n\n if (typeof validator === 'string') {\n validator = getValidator(validator);\n }\n\n return validator;\n };\n /**\n * Validates all cells using their validator functions and calls callback when finished.\n *\n * If one of the cells is invalid, the callback will be fired with `'valid'` arguments as `false` - otherwise it\n * would equal `true`.\n *\n * @memberof Core#\n * @function validateCells\n * @param {Function} [callback] The callback function.\n * @example\n * ```js\n * hot.validateCells((valid) => {\n * if (valid) {\n * // ... code for validated cells\n * }\n * })\n * ```\n */\n\n\n this.validateCells = function (callback) {\n this._validateCells(callback);\n };\n /**\n * Validates rows using their validator functions and calls callback when finished.\n *\n * If one of the cells is invalid, the callback will be fired with `'valid'` arguments as `false` - otherwise it\n * would equal `true`.\n *\n * @memberof Core#\n * @function validateRows\n * @param {Array} [rows] Array of validation target visual row indexes.\n * @param {Function} [callback] The callback function.\n * @example\n * ```js\n * hot.validateRows([3, 4, 5], (valid) => {\n * if (valid) {\n * // ... code for validated rows\n * }\n * })\n * ```\n */\n\n\n this.validateRows = function (rows, callback) {\n if (!Array.isArray(rows)) {\n throw new Error('validateRows parameter `rows` must be an array');\n }\n\n this._validateCells(callback, rows);\n };\n /**\n * Validates columns using their validator functions and calls callback when finished.\n *\n * If one of the cells is invalid, the callback will be fired with `'valid'` arguments as `false` - otherwise it\n * would equal `true`.\n *\n * @memberof Core#\n * @function validateColumns\n * @param {Array} [columns] Array of validation target visual columns indexes.\n * @param {Function} [callback] The callback function.\n * @example\n * ```js\n * hot.validateColumns([3, 4, 5], (valid) => {\n * if (valid) {\n * // ... code for validated columns\n * }\n * })\n * ```\n */\n\n\n this.validateColumns = function (columns, callback) {\n if (!Array.isArray(columns)) {\n throw new Error('validateColumns parameter `columns` must be an array');\n }\n\n this._validateCells(callback, undefined, columns);\n };\n /**\n * Validates all cells using their validator functions and calls callback when finished.\n *\n * If one of the cells is invalid, the callback will be fired with `'valid'` arguments as `false` - otherwise it would equal `true`.\n *\n * Private use intended.\n *\n * @private\n * @memberof Core#\n * @function _validateCells\n * @param {Function} [callback] The callback function.\n * @param {Array} [rows] An array of validation target visual row indexes.\n * @param {Array} [columns] An array of validation target visual column indexes.\n */\n\n\n this._validateCells = function (callback, rows, columns) {\n var waitingForValidator = new ValidatorsQueue();\n\n if (callback) {\n waitingForValidator.onQueueEmpty = callback;\n }\n\n var i = instance.countRows() - 1;\n\n while (i >= 0) {\n if (rows !== undefined && rows.indexOf(i) === -1) {\n i -= 1;\n continue;\n }\n\n var j = instance.countCols() - 1;\n\n while (j >= 0) {\n if (columns !== undefined && columns.indexOf(j) === -1) {\n j -= 1;\n continue;\n }\n\n waitingForValidator.addValidatorToQueue();\n instance.validateCell(instance.getDataAtCell(i, j), instance.getCellMeta(i, j), function (result) {\n if (typeof result !== 'boolean') {\n throw new Error('Validation error: result is not boolean');\n }\n\n if (result === false) {\n waitingForValidator.valid = false;\n }\n\n waitingForValidator.removeValidatorFormQueue();\n }, 'validateCells');\n j -= 1;\n }\n\n i -= 1;\n }\n\n waitingForValidator.checkIfQueueIsEmpty();\n };\n /**\n * Returns an array of row headers' values (if they are enabled). If param `row` was given, it returns the header of the given row as a string.\n *\n * @memberof Core#\n * @function getRowHeader\n * @param {number} [row] Visual row index.\n * @fires Hooks#modifyRowHeader\n * @returns {Array|string|number} Array of header values / single header value.\n */\n\n\n this.getRowHeader = function (row) {\n var rowHeader = tableMeta.rowHeaders;\n var physicalRow = row;\n\n if (physicalRow !== void 0) {\n physicalRow = instance.runHooks('modifyRowHeader', physicalRow);\n }\n\n if (physicalRow === void 0) {\n rowHeader = [];\n rangeEach(instance.countRows() - 1, function (i) {\n rowHeader.push(instance.getRowHeader(i));\n });\n } else if (Array.isArray(rowHeader) && rowHeader[physicalRow] !== void 0) {\n rowHeader = rowHeader[physicalRow];\n } else if (isFunction(rowHeader)) {\n rowHeader = rowHeader(physicalRow);\n } else if (rowHeader && typeof rowHeader !== 'string' && typeof rowHeader !== 'number') {\n rowHeader = physicalRow + 1;\n }\n\n return rowHeader;\n };\n /**\n * Returns information about if this table is configured to display row headers.\n *\n * @memberof Core#\n * @function hasRowHeaders\n * @returns {boolean} `true` if the instance has the row headers enabled, `false` otherwise.\n */\n\n\n this.hasRowHeaders = function () {\n return !!tableMeta.rowHeaders;\n };\n /**\n * Returns information about if this table is configured to display column headers.\n *\n * @memberof Core#\n * @function hasColHeaders\n * @returns {boolean} `true` if the instance has the column headers enabled, `false` otherwise.\n */\n\n\n this.hasColHeaders = function () {\n if (tableMeta.colHeaders !== void 0 && tableMeta.colHeaders !== null) {\n // Polymer has empty value = null\n return !!tableMeta.colHeaders;\n }\n\n for (var i = 0, ilen = instance.countCols(); i < ilen; i++) {\n if (instance.getColHeader(i)) {\n return true;\n }\n }\n\n return false;\n };\n /**\n * Returns an array of column headers (in string format, if they are enabled). If param `column` is given, it\n * returns the header at the given column.\n *\n * @memberof Core#\n * @function getColHeader\n * @param {number} [column] Visual column index.\n * @fires Hooks#modifyColHeader\n * @returns {Array|string|number} The column header(s).\n */\n\n\n this.getColHeader = function (column) {\n var columnIndex = instance.runHooks('modifyColHeader', column);\n var result = tableMeta.colHeaders;\n\n if (columnIndex === void 0) {\n var out = [];\n var ilen = instance.countCols();\n\n for (var i = 0; i < ilen; i++) {\n out.push(instance.getColHeader(i));\n }\n\n result = out;\n } else {\n var translateVisualIndexToColumns = function translateVisualIndexToColumns(visualColumnIndex) {\n var arr = [];\n var columnsLen = instance.countCols();\n var index = 0;\n\n for (; index < columnsLen; index++) {\n if (isFunction(tableMeta.columns) && tableMeta.columns(index)) {\n arr.push(index);\n }\n }\n\n return arr[visualColumnIndex];\n };\n\n var physicalColumn = instance.toPhysicalColumn(columnIndex);\n var prop = translateVisualIndexToColumns(physicalColumn);\n\n if (tableMeta.colHeaders === false) {\n result = null;\n } else if (tableMeta.columns && isFunction(tableMeta.columns) && tableMeta.columns(prop) && tableMeta.columns(prop).title) {\n result = tableMeta.columns(prop).title;\n } else if (tableMeta.columns && tableMeta.columns[physicalColumn] && tableMeta.columns[physicalColumn].title) {\n result = tableMeta.columns[physicalColumn].title;\n } else if (Array.isArray(tableMeta.colHeaders) && tableMeta.colHeaders[physicalColumn] !== void 0) {\n result = tableMeta.colHeaders[physicalColumn];\n } else if (isFunction(tableMeta.colHeaders)) {\n result = tableMeta.colHeaders(physicalColumn);\n } else if (tableMeta.colHeaders && typeof tableMeta.colHeaders !== 'string' && typeof tableMeta.colHeaders !== 'number') {\n result = spreadsheetColumnLabel(columnIndex); // see #1458\n }\n }\n\n return result;\n };\n /**\n * Return column width from settings (no guessing). Private use intended.\n *\n * @private\n * @memberof Core#\n * @function _getColWidthFromSettings\n * @param {number} col Visual col index.\n * @returns {number}\n */\n\n\n this._getColWidthFromSettings = function (col) {\n var width; // We currently don't support cell meta objects for headers (negative values)\n\n if (col >= 0) {\n var cellProperties = instance.getCellMeta(0, col);\n width = cellProperties.width;\n }\n\n if (width === void 0 || width === tableMeta.width) {\n width = tableMeta.colWidths;\n }\n\n if (width !== void 0 && width !== null) {\n switch (_typeof(width)) {\n case 'object':\n // array\n width = width[col];\n break;\n\n case 'function':\n width = width(col);\n break;\n\n default:\n break;\n }\n\n if (typeof width === 'string') {\n width = parseInt(width, 10);\n }\n }\n\n return width;\n };\n /**\n * Returns the width of the requested column.\n *\n * @memberof Core#\n * @function getColWidth\n * @param {number} column Visual column index.\n * @returns {number} Column width.\n * @fires Hooks#modifyColWidth\n */\n\n\n this.getColWidth = function (column) {\n var width = instance._getColWidthFromSettings(column);\n\n width = instance.runHooks('modifyColWidth', width, column);\n\n if (width === void 0) {\n width = ViewportColumnsCalculator.DEFAULT_WIDTH;\n }\n\n return width;\n };\n /**\n * Return row height from settings (no guessing). Private use intended.\n *\n * @private\n * @memberof Core#\n * @function _getRowHeightFromSettings\n * @param {number} row Visual row index.\n * @returns {number}\n */\n\n\n this._getRowHeightFromSettings = function (row) {\n // let cellProperties = instance.getCellMeta(row, 0);\n // let height = cellProperties.height;\n //\n // if (height === void 0 || height === tableMeta.height) {\n // height = cellProperties.rowHeights;\n // }\n var height = tableMeta.rowHeights;\n\n if (height !== void 0 && height !== null) {\n switch (_typeof(height)) {\n case 'object':\n // array\n height = height[row];\n break;\n\n case 'function':\n height = height(row);\n break;\n\n default:\n break;\n }\n\n if (typeof height === 'string') {\n height = parseInt(height, 10);\n }\n }\n\n return height;\n };\n /**\n * Returns the row height.\n *\n * @memberof Core#\n * @function getRowHeight\n * @param {number} row Visual row index.\n * @returns {number} The given row's height.\n * @fires Hooks#modifyRowHeight\n */\n\n\n this.getRowHeight = function (row) {\n var height = instance._getRowHeightFromSettings(row);\n\n height = instance.runHooks('modifyRowHeight', height, row);\n return height;\n };\n /**\n * Returns the total number of rows in the data source.\n *\n * @memberof Core#\n * @function countSourceRows\n * @returns {number} Total number of rows.\n */\n\n\n this.countSourceRows = function () {\n return dataSource.countRows();\n };\n /**\n * Returns the total number of columns in the data source.\n *\n * @memberof Core#\n * @function countSourceCols\n * @returns {number} Total number of columns.\n */\n\n\n this.countSourceCols = function () {\n return dataSource.countFirstRowKeys();\n };\n /**\n * Returns the total number of visual rows in the table.\n *\n * @memberof Core#\n * @function countRows\n * @returns {number} Total number of rows.\n */\n\n\n this.countRows = function () {\n return datamap.getLength();\n };\n /**\n * Returns the total number of visible columns in the table.\n *\n * @memberof Core#\n * @function countCols\n * @returns {number} Total number of columns.\n */\n\n\n this.countCols = function () {\n var maxCols = tableMeta.maxCols;\n var dataLen = this.columnIndexMapper.getNotTrimmedIndexesLength();\n return Math.min(maxCols, dataLen);\n };\n /**\n * Returns the number of rendered rows (including rows partially or fully rendered outside viewport).\n *\n * @memberof Core#\n * @function countRenderedRows\n * @returns {number} Returns -1 if table is not visible.\n */\n\n\n this.countRenderedRows = function () {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedRowsCount() : -1;\n };\n /**\n * Returns the number of visible rows (rendered rows that fully fit inside viewport).\n *\n * @memberof Core#\n * @function countVisibleRows\n * @returns {number} Number of visible rows or -1.\n */\n\n\n this.countVisibleRows = function () {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleRowsCount() : -1;\n };\n /**\n * Returns the number of rendered columns (including columns partially or fully rendered outside viewport).\n *\n * @memberof Core#\n * @function countRenderedCols\n * @returns {number} Returns -1 if table is not visible.\n */\n\n\n this.countRenderedCols = function () {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getRenderedColumnsCount() : -1;\n };\n /**\n * Returns the number of visible columns. Returns -1 if table is not visible.\n *\n * @memberof Core#\n * @function countVisibleCols\n * @returns {number} Number of visible columns or -1.\n */\n\n\n this.countVisibleCols = function () {\n return instance.view.wt.drawn ? instance.view.wt.wtTable.getVisibleColumnsCount() : -1;\n };\n /**\n * Returns the number of empty rows. If the optional ending parameter is `true`, returns the\n * number of empty rows at the bottom of the table.\n *\n * @memberof Core#\n * @function countEmptyRows\n * @param {boolean} [ending=false] If `true`, will only count empty rows at the end of the data source.\n * @returns {number} Count empty rows.\n */\n\n\n this.countEmptyRows = function () {\n var ending = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var emptyRows = 0;\n rangeEachReverse(instance.countRows() - 1, function (visualIndex) {\n if (instance.isEmptyRow(visualIndex)) {\n emptyRows += 1;\n } else if (ending === true) {\n return false;\n }\n });\n return emptyRows;\n };\n /**\n * Returns the number of empty columns. If the optional ending parameter is `true`, returns the number of empty\n * columns at right hand edge of the table.\n *\n * @memberof Core#\n * @function countEmptyCols\n * @param {boolean} [ending=false] If `true`, will only count empty columns at the end of the data source row.\n * @returns {number} Count empty cols.\n */\n\n\n this.countEmptyCols = function () {\n var ending = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (instance.countRows() < 1) {\n return 0;\n }\n\n var emptyColumns = 0;\n rangeEachReverse(instance.countCols() - 1, function (visualIndex) {\n if (instance.isEmptyCol(visualIndex)) {\n emptyColumns += 1;\n } else if (ending === true) {\n return false;\n }\n });\n return emptyColumns;\n };\n /**\n * Check if all cells in the row declared by the `row` argument are empty.\n *\n * @memberof Core#\n * @function isEmptyRow\n * @param {number} row Visual row index.\n * @returns {boolean} `true` if the row at the given `row` is empty, `false` otherwise.\n */\n\n\n this.isEmptyRow = function (row) {\n return tableMeta.isEmptyRow.call(instance, row);\n };\n /**\n * Check if all cells in the the column declared by the `column` argument are empty.\n *\n * @memberof Core#\n * @function isEmptyCol\n * @param {number} column Column index.\n * @returns {boolean} `true` if the column at the given `col` is empty, `false` otherwise.\n */\n\n\n this.isEmptyCol = function (column) {\n return tableMeta.isEmptyCol.call(instance, column);\n };\n /**\n * Select cell specified by `row` and `column` values or a range of cells finishing at `endRow`, `endCol`. If the table\n * was configured to support data column properties that properties can be used to making a selection.\n *\n * By default, viewport will be scrolled to the selection. After the `selectCell` method had finished, the instance\n * will be listening to keyboard input on the document.\n *\n * @example\n * ```js\n * // select a single cell\n * hot.selectCell(2, 4);\n * // select a single cell using column property\n * hot.selectCell(2, 'address');\n * // select a range of cells\n * hot.selectCell(2, 4, 3, 5);\n * // select a range of cells using column properties\n * hot.selectCell(2, 'address', 3, 'phone_number');\n * // select a range of cells without scrolling to them\n * hot.selectCell(2, 'address', 3, 'phone_number', false);\n * ```\n *\n * @memberof Core#\n * @function selectCell\n * @param {number} row Visual row index.\n * @param {number|string} column Visual column index or column property.\n * @param {number} [endRow] Visual end row index (if selecting a range).\n * @param {number|string} [endColumn] Visual end column index or column property (if selecting a range).\n * @param {boolean} [scrollToCell=true] If `true`, the viewport will be scrolled to the selection.\n * @param {boolean} [changeListener=true] If `false`, Handsontable will not change keyboard events listener to himself.\n * @returns {boolean} `true` if selection was successful, `false` otherwise.\n */\n\n\n this.selectCell = function (row, column, endRow, endColumn) {\n var scrollToCell = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n var changeListener = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;\n\n if (isUndefined(row) || isUndefined(column)) {\n return false;\n }\n\n return this.selectCells([[row, column, endRow, endColumn]], scrollToCell, changeListener);\n };\n /**\n * Make multiple, non-contiguous selection specified by `row` and `column` values or a range of cells\n * finishing at `endRow`, `endColumn`. The method supports two input formats which are the same as that\n * produces by `getSelected` and `getSelectedRange` methods.\n *\n * By default, viewport will be scrolled to selection. After the `selectCells` method had finished, the instance\n * will be listening to keyboard input on the document.\n *\n * @example\n * ```js\n * // Using an array of arrays.\n * hot.selectCells([[1, 1, 2, 2], [3, 3], [6, 2, 0, 2]]);\n * // Using an array of arrays with defined columns as props.\n * hot.selectCells([[1, 'id', 2, 'first_name'], [3, 'full_name'], [6, 'last_name', 0, 'first_name']]);\n * // Using an array of CellRange objects (produced by `.getSelectedRange()` method).\n * const selected = hot.getSelectedRange();\n *\n * selected[0].from.row = 0;\n * selected[0].from.col = 0;\n *\n * hot.selectCells(selected);\n * ```\n *\n * @memberof Core#\n * @since 0.38.0\n * @function selectCells\n * @param {Array[]|CellRange[]} coords Visual coords passed as an array of array (`[[rowStart, columnStart, rowEnd, columnEnd], ...]`)\n * the same format as `getSelected` method returns or as an CellRange objects\n * which is the same format what `getSelectedRange` method returns.\n * @param {boolean} [scrollToCell=true] If `true`, the viewport will be scrolled to the selection.\n * @param {boolean} [changeListener=true] If `false`, Handsontable will not change keyboard events listener to himself.\n * @returns {boolean} `true` if selection was successful, `false` otherwise.\n */\n\n\n this.selectCells = function () {\n var coords = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [[]];\n var scrollToCell = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var changeListener = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n if (scrollToCell === false) {\n preventScrollingToCell = true;\n }\n\n var wasSelected = selection.selectCells(coords);\n\n if (wasSelected && changeListener) {\n instance.listen();\n }\n\n preventScrollingToCell = false;\n return wasSelected;\n };\n /**\n * Select column specified by `startColumn` visual index, column property or a range of columns finishing at `endColumn`.\n *\n * @example\n * ```js\n * // Select column using visual index.\n * hot.selectColumns(1);\n * // Select column using column property.\n * hot.selectColumns('id');\n * // Select range of columns using visual indexes.\n * hot.selectColumns(1, 4);\n * // Select range of columns using column properties.\n * hot.selectColumns('id', 'last_name');\n * ```\n *\n * @memberof Core#\n * @since 0.38.0\n * @function selectColumns\n * @param {number} startColumn The visual column index from which the selection starts.\n * @param {number} [endColumn=startColumn] The visual column index to which the selection finishes. If `endColumn`\n * is not defined the column defined by `startColumn` will be selected.\n * @returns {boolean} `true` if selection was successful, `false` otherwise.\n */\n\n\n this.selectColumns = function (startColumn) {\n var endColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startColumn;\n return selection.selectColumns(startColumn, endColumn);\n };\n /**\n * Select row specified by `startRow` visual index or a range of rows finishing at `endRow`.\n *\n * @example\n * ```js\n * // Select row using visual index.\n * hot.selectRows(1);\n * // Select range of rows using visual indexes.\n * hot.selectRows(1, 4);\n * ```\n *\n * @memberof Core#\n * @since 0.38.0\n * @function selectRows\n * @param {number} startRow The visual row index from which the selection starts.\n * @param {number} [endRow=startRow] The visual row index to which the selection finishes. If `endRow`\n * is not defined the row defined by `startRow` will be selected.\n * @returns {boolean} `true` if selection was successful, `false` otherwise.\n */\n\n\n this.selectRows = function (startRow) {\n var endRow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : startRow;\n return selection.selectRows(startRow, endRow);\n };\n /**\n * Deselects the current cell selection on the table.\n *\n * @memberof Core#\n * @function deselectCell\n */\n\n\n this.deselectCell = function () {\n selection.deselect();\n };\n /**\n * Select the whole table. The previous selection will be overwritten.\n *\n * @since 0.38.2\n * @memberof Core#\n * @function selectAll\n * @param {boolean} [includeHeaders=true] `true` If the selection should include the row, column and corner headers,\n * `false` otherwise.\n */\n\n\n this.selectAll = function () {\n var includeHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var includeRowHeaders = includeHeaders && this.hasRowHeaders();\n var includeColumnHeaders = includeHeaders && this.hasColHeaders();\n preventScrollingToCell = true;\n selection.selectAll(includeRowHeaders, includeColumnHeaders);\n preventScrollingToCell = false;\n };\n\n var getIndexToScroll = function getIndexToScroll(indexMapper, visualIndex) {\n // Looking for a visual index on the right and then (when not found) on the left.\n return indexMapper.getFirstNotHiddenIndex(visualIndex, 1, true);\n };\n /**\n * Scroll viewport to coordinates specified by the `row` and `column` arguments.\n *\n * @memberof Core#\n * @function scrollViewportTo\n * @param {number} [row] Row index. If the last argument isn't defined we treat the index as a visual row index. Otherwise,\n * we are using the index for numbering only this rows which may be rendered (we don't consider hidden rows).\n * @param {number} [column] Column index. If the last argument isn't defined we treat the index as a visual column index.\n * Otherwise, we are using the index for numbering only this columns which may be rendered (we don't consider hidden columns).\n * @param {boolean} [snapToBottom=false] If `true`, viewport is scrolled to show the cell on the bottom of the table.\n * @param {boolean} [snapToRight=false] If `true`, viewport is scrolled to show the cell on the right side of the table.\n * @param {boolean} [considerHiddenIndexes=true] If `true`, we handle visual indexes, otherwise we handle only indexes which\n * may be rendered when they are in the viewport (we don't consider hidden indexes as they aren't rendered).\n * @returns {boolean} `true` if scroll was successful, `false` otherwise.\n */\n\n\n this.scrollViewportTo = function (row, column) {\n var snapToBottom = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var snapToRight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var considerHiddenIndexes = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n var snapToTop = !snapToBottom;\n var snapToLeft = !snapToRight;\n var renderableRow = row;\n var renderableColumn = column;\n\n if (considerHiddenIndexes) {\n var _isRowInteger = Number.isInteger(row);\n\n var _isColumnInteger = Number.isInteger(column);\n\n var visualRowToScroll = _isRowInteger ? getIndexToScroll(this.rowIndexMapper, row) : void 0;\n var visualColumnToScroll = _isColumnInteger ? getIndexToScroll(this.columnIndexMapper, column) : void 0;\n\n if (visualRowToScroll === null || visualColumnToScroll === null) {\n return false;\n }\n\n renderableRow = _isRowInteger ? instance.rowIndexMapper.getRenderableFromVisualIndex(visualRowToScroll) : void 0;\n renderableColumn = _isColumnInteger ? instance.columnIndexMapper.getRenderableFromVisualIndex(visualColumnToScroll) : void 0;\n }\n\n var isRowInteger = Number.isInteger(renderableRow);\n var isColumnInteger = Number.isInteger(renderableColumn);\n\n if (isRowInteger && isColumnInteger) {\n return instance.view.scrollViewport(new CellCoords(renderableRow, renderableColumn), snapToTop, snapToRight, snapToBottom, snapToLeft);\n }\n\n if (isRowInteger && isColumnInteger === false) {\n return instance.view.scrollViewportVertically(renderableRow, snapToTop, snapToBottom);\n }\n\n if (isColumnInteger && isRowInteger === false) {\n return instance.view.scrollViewportHorizontally(renderableColumn, snapToRight, snapToLeft);\n }\n\n return false;\n };\n /**\n * Removes the table from the DOM and destroys the instance of the Handsontable.\n *\n * @memberof Core#\n * @function destroy\n * @fires Hooks#afterDestroy\n */\n\n\n this.destroy = function () {\n instance._clearTimeouts();\n\n instance._clearImmediates();\n\n if (instance.view) {\n // in case HT is destroyed before initialization has finished\n instance.view.destroy();\n }\n\n if (dataSource) {\n dataSource.destroy();\n }\n\n dataSource = null;\n metaManager.clearCache();\n keyStateStopObserving();\n\n if (isRootInstance(instance)) {\n var licenseInfo = this.rootDocument.querySelector('#hot-display-license-info');\n\n if (licenseInfo) {\n licenseInfo.parentNode.removeChild(licenseInfo);\n }\n }\n\n empty(instance.rootElement);\n eventManager.destroy();\n\n if (editorManager) {\n editorManager.destroy();\n } // The plugin's `destroy` method is called as a consequence and it should handle\n // unregistration of plugin's maps. Some unregistered maps reset the cache.\n\n\n instance.batchExecution(function () {\n instance.rowIndexMapper.unregisterAll();\n instance.columnIndexMapper.unregisterAll();\n pluginsRegistry.getItems().forEach(function (_ref20) {\n var _ref21 = _slicedToArray(_ref20, 2),\n plugin = _ref21[1];\n\n plugin.destroy();\n });\n pluginsRegistry.clear();\n instance.runHooks('afterDestroy');\n }, true);\n Hooks.getSingleton().destroy(instance);\n objectEach(instance, function (property, key, obj) {\n // replace instance methods with post mortem\n if (isFunction(property)) {\n obj[key] = postMortem(key);\n } else if (key !== 'guid') {\n // replace instance properties with null (restores memory)\n // it should not be necessary but this prevents a memory leak side effects that show itself in Jasmine tests\n obj[key] = null;\n }\n });\n instance.isDestroyed = true; // replace private properties with null (restores memory)\n // it should not be necessary but this prevents a memory leak side effects that show itself in Jasmine tests\n\n if (datamap) {\n datamap.destroy();\n }\n\n instance.rowIndexMapper = null;\n instance.columnIndexMapper = null;\n datamap = null;\n grid = null;\n selection = null;\n editorManager = null;\n instance = null;\n };\n /**\n * Replacement for all methods after the Handsontable was destroyed.\n *\n * @private\n * @param {string} method The method name.\n * @returns {Function}\n */\n\n\n function postMortem(method) {\n return function () {\n throw new Error(\"The \\\"\".concat(method, \"\\\" method cannot be called because this Handsontable instance has been destroyed\"));\n };\n }\n /**\n * Returns the active editor class instance.\n *\n * @memberof Core#\n * @function getActiveEditor\n * @returns {BaseEditor} The active editor instance.\n */\n\n\n this.getActiveEditor = function () {\n return editorManager.getActiveEditor();\n };\n /**\n * Returns plugin instance by provided its name.\n *\n * @memberof Core#\n * @function getPlugin\n * @param {string} pluginName The plugin name.\n * @returns {BasePlugin|undefined} The plugin instance or undefined if there is no plugin.\n */\n\n\n this.getPlugin = function (pluginName) {\n var unifiedPluginName = toUpperCaseFirst(pluginName); // Workaround for the UndoRedo plugin which, currently doesn't follow the plugin architecture.\n\n if (unifiedPluginName === 'UndoRedo') {\n return this.undoRedo;\n }\n\n return pluginsRegistry.getItem(unifiedPluginName);\n };\n /**\n * Returns name of the passed plugin.\n *\n * @private\n * @memberof Core#\n * @param {BasePlugin} plugin The plugin instance.\n * @returns {string}\n */\n\n\n this.getPluginName = function (plugin) {\n // Workaround for the UndoRedo plugin which, currently doesn't follow the plugin architecture.\n if (plugin === this.undoRedo) {\n return this.undoRedo.constructor.PLUGIN_KEY;\n }\n\n return pluginsRegistry.getId(plugin);\n };\n /**\n * Returns the Handsontable instance.\n *\n * @memberof Core#\n * @function getInstance\n * @returns {Handsontable} The Handsontable instance.\n */\n\n\n this.getInstance = function () {\n return instance;\n };\n /**\n * Adds listener to the specified hook name (only for this Handsontable instance).\n *\n * @memberof Core#\n * @function addHook\n * @see Hooks#add\n * @param {string} key Hook name (see {@link hooks Hooks}).\n * @param {Function|Array} callback Function or array of functions.\n * @example\n * ```js\n * hot.addHook('beforeInit', myCallback);\n * ```\n */\n\n\n this.addHook = function (key, callback) {\n Hooks.getSingleton().add(key, callback, instance);\n };\n /**\n * Check if for a specified hook name there are added listeners (only for this Handsontable instance). All available\n * hooks you will find {@link hooks Hooks}.\n *\n * @memberof Core#\n * @function hasHook\n * @see Hooks#has\n * @param {string} key Hook name.\n * @returns {boolean}\n *\n * @example\n * ```js\n * const hasBeforeInitListeners = hot.hasHook('beforeInit');\n * ```\n */\n\n\n this.hasHook = function (key) {\n return Hooks.getSingleton().has(key, instance);\n };\n /**\n * Adds listener to specified hook name (only for this Handsontable instance). After the listener is triggered,\n * it will be automatically removed.\n *\n * @memberof Core#\n * @function addHookOnce\n * @see Hooks#once\n * @param {string} key Hook name (see {@link hooks Hooks}).\n * @param {Function|Array} callback Function or array of functions.\n * @example\n * ```js\n * hot.addHookOnce('beforeInit', myCallback);\n * ```\n */\n\n\n this.addHookOnce = function (key, callback) {\n Hooks.getSingleton().once(key, callback, instance);\n };\n /**\n * Removes the hook listener previously registered with {@link core#addhook Core#addHook}.\n *\n * @memberof Core#\n * @function removeHook\n * @see Hooks#remove\n * @param {string} key Hook name.\n * @param {Function} callback Reference to the function which has been registered using {@link core#addhook Core#addHook}.\n *\n * @example\n * ```js\n * hot.removeHook('beforeInit', myCallback);\n * ```\n */\n\n\n this.removeHook = function (key, callback) {\n Hooks.getSingleton().remove(key, callback, instance);\n };\n /**\n * Run the callbacks for the hook provided in the `key` argument using the parameters given in the other arguments.\n *\n * @memberof Core#\n * @function runHooks\n * @see Hooks#run\n * @param {string} key Hook name.\n * @param {*} [p1] Argument passed to the callback.\n * @param {*} [p2] Argument passed to the callback.\n * @param {*} [p3] Argument passed to the callback.\n * @param {*} [p4] Argument passed to the callback.\n * @param {*} [p5] Argument passed to the callback.\n * @param {*} [p6] Argument passed to the callback.\n * @returns {*}\n *\n * @example\n * ```js\n * // Run built-in hook\n * hot.runHooks('beforeInit');\n * // Run custom hook\n * hot.runHooks('customAction', 10, 'foo');\n * ```\n */\n\n\n this.runHooks = function (key, p1, p2, p3, p4, p5, p6) {\n return Hooks.getSingleton().run(instance, key, p1, p2, p3, p4, p5, p6);\n };\n /**\n * Get language phrase for specified dictionary key.\n *\n * @memberof Core#\n * @function getTranslatedPhrase\n * @since 0.35.0\n * @param {string} dictionaryKey Constant which is dictionary key.\n * @param {*} extraArguments Arguments which will be handled by formatters.\n * @returns {string}\n */\n\n\n this.getTranslatedPhrase = function (dictionaryKey, extraArguments) {\n return getTranslatedPhrase(tableMeta.language, dictionaryKey, extraArguments);\n };\n /**\n * Converts instance into outerHTML of HTMLTableElement.\n *\n * @memberof Core#\n * @function toHTML\n * @since 7.1.0\n * @returns {string}\n */\n\n\n this.toHTML = function () {\n return instanceToHTML(_this);\n };\n /**\n * Converts instance into HTMLTableElement.\n *\n * @memberof Core#\n * @function toTableElement\n * @since 7.1.0\n * @returns {HTMLTableElement}\n */\n\n\n this.toTableElement = function () {\n var tempElement = _this.rootDocument.createElement('div');\n\n tempElement.insertAdjacentHTML('afterbegin', instanceToHTML(_this));\n return tempElement.firstElementChild;\n };\n\n this.timeouts = [];\n /**\n * Sets timeout. Purpose of this method is to clear all known timeouts when `destroy` method is called.\n *\n * @param {number|Function} handle Handler returned from setTimeout or function to execute (it will be automatically wraped\n * by setTimeout function).\n * @param {number} [delay=0] If first argument is passed as a function this argument set delay of the execution of that function.\n * @private\n */\n\n this._registerTimeout = function (handle) {\n var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var handleFunc = handle;\n\n if (typeof handleFunc === 'function') {\n handleFunc = setTimeout(handleFunc, delay);\n }\n\n this.timeouts.push(handleFunc);\n };\n /**\n * Clears all known timeouts.\n *\n * @private\n */\n\n\n this._clearTimeouts = function () {\n arrayEach(this.timeouts, function (handler) {\n clearTimeout(handler);\n });\n };\n\n this.immediates = [];\n /**\n * Execute function execution to the next event loop cycle. Purpose of this method is to clear all known timeouts when `destroy` method is called.\n *\n * @param {Function} callback Function to be delayed in execution.\n * @private\n */\n\n this._registerImmediate = function (callback) {\n this.immediates.push(setImmediate(callback));\n };\n /**\n * Clears all known timeouts.\n *\n * @private\n */\n\n\n this._clearImmediates = function () {\n arrayEach(this.immediates, function (handler) {\n clearImmediate(handler);\n });\n };\n /**\n * Refresh selection borders. This is temporary method relic after selection rewrite.\n *\n * @private\n * @param {boolean} [revertOriginal=false] If `true`, the previous value will be restored. Otherwise, the edited value will be saved.\n * @param {boolean} [prepareEditorIfNeeded=true] If `true` the editor under the selected cell will be prepared to open.\n */\n\n\n this._refreshBorders = function () {\n var revertOriginal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var prepareEditorIfNeeded = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n editorManager.destroyEditor(revertOriginal);\n instance.view.render();\n\n if (prepareEditorIfNeeded && selection.isSelected()) {\n editorManager.prepareEditor();\n }\n };\n\n getPluginsNames().forEach(function (pluginName) {\n var PluginClass = getPlugin(pluginName);\n pluginsRegistry.addItem(pluginName, new PluginClass(_this));\n });\n Hooks.getSingleton().run(instance, 'construct');\n}","import \"core-js/modules/web.timers.js\";\n\n/**\n * autoResize - resizes a DOM element to the width and height of another DOM element\n *\n * Copyright 2014, Marcin Warpechowski\n * Licensed under the MIT license\n */\nexport function autoResize() {\n var defaults = {\n minHeight: 200,\n maxHeight: 300,\n minWidth: 100,\n maxWidth: 300\n },\n el,\n body = document.body,\n text = document.createTextNode(''),\n span = document.createElement('SPAN'),\n observe = function observe(element, event, handler) {\n element.addEventListener(event, handler, false);\n },\n _unObserve = function unObserve(element, event, handler) {\n element.removeEventListener(event, handler, false);\n },\n resize = function resize(newChar) {\n var width, scrollHeight;\n\n if (!newChar) {\n newChar = \"\";\n } else if (!/^[a-zA-Z \\.,\\\\\\/\\|0-9]$/.test(newChar)) {\n newChar = \".\";\n }\n\n if (text.textContent !== void 0) {\n text.textContent = el.value + newChar;\n } else {\n text.data = el.value + newChar; //IE8\n }\n\n span.style.fontSize = getComputedStyle(el).fontSize;\n span.style.fontFamily = getComputedStyle(el).fontFamily;\n span.style.whiteSpace = \"pre\";\n body.appendChild(span);\n width = span.clientWidth + 2;\n body.removeChild(span);\n el.style.height = defaults.minHeight + 'px';\n\n if (defaults.minWidth > width) {\n el.style.width = defaults.minWidth + 'px';\n } else if (width > defaults.maxWidth) {\n el.style.width = defaults.maxWidth + 'px';\n } else {\n el.style.width = width + 'px';\n }\n\n scrollHeight = el.scrollHeight ? el.scrollHeight - 1 : 0;\n\n if (defaults.minHeight > scrollHeight) {\n el.style.height = defaults.minHeight + 'px';\n } else if (defaults.maxHeight < scrollHeight) {\n el.style.height = defaults.maxHeight + 'px';\n el.style.overflowY = 'visible';\n } else {\n el.style.height = scrollHeight + 'px';\n }\n },\n delayedResize = function delayedResize() {\n window.setTimeout(resize, 0);\n },\n extendDefaults = function extendDefaults(config) {\n if (config && config.minHeight) {\n if (config.minHeight == 'inherit') {\n defaults.minHeight = el.clientHeight;\n } else {\n var minHeight = parseInt(config.minHeight);\n\n if (!isNaN(minHeight)) {\n defaults.minHeight = minHeight;\n }\n }\n }\n\n if (config && config.maxHeight) {\n if (config.maxHeight == 'inherit') {\n defaults.maxHeight = el.clientHeight;\n } else {\n var maxHeight = parseInt(config.maxHeight);\n\n if (!isNaN(maxHeight)) {\n defaults.maxHeight = maxHeight;\n }\n }\n }\n\n if (config && config.minWidth) {\n if (config.minWidth == 'inherit') {\n defaults.minWidth = el.clientWidth;\n } else {\n var minWidth = parseInt(config.minWidth);\n\n if (!isNaN(minWidth)) {\n defaults.minWidth = minWidth;\n }\n }\n }\n\n if (config && config.maxWidth) {\n if (config.maxWidth == 'inherit') {\n defaults.maxWidth = el.clientWidth;\n } else {\n var maxWidth = parseInt(config.maxWidth);\n\n if (!isNaN(maxWidth)) {\n defaults.maxWidth = maxWidth;\n }\n }\n }\n\n if (!span.firstChild) {\n span.className = \"autoResize\";\n span.style.display = 'inline-block';\n span.appendChild(text);\n }\n },\n _init = function init(el_, config, doObserve) {\n el = el_;\n extendDefaults(config);\n\n if (el.nodeName == 'TEXTAREA') {\n el.style.resize = 'none';\n el.style.overflowY = '';\n el.style.height = defaults.minHeight + 'px';\n el.style.minWidth = defaults.minWidth + 'px';\n el.style.maxWidth = defaults.maxWidth + 'px';\n el.style.overflowY = 'hidden';\n }\n\n if (doObserve) {\n observe(el, 'change', resize);\n observe(el, 'cut', delayedResize);\n observe(el, 'paste', delayedResize);\n observe(el, 'drop', delayedResize);\n observe(el, 'keydown', delayedResize);\n observe(el, 'focus', resize);\n observe(el, 'compositionstart', delayedResize);\n observe(el, 'compositionupdate', delayedResize);\n observe(el, 'compositionend', delayedResize);\n }\n\n resize();\n };\n\n function getComputedStyle(element) {\n return element.currentStyle || document.defaultView.getComputedStyle(element);\n }\n\n return {\n init: function init(el_, config, doObserve) {\n _init(el_, config, doObserve);\n },\n unObserve: function unObserve() {\n _unObserve(el, 'change', resize);\n\n _unObserve(el, 'cut', delayedResize);\n\n _unObserve(el, 'paste', delayedResize);\n\n _unObserve(el, 'drop', delayedResize);\n\n _unObserve(el, 'keydown', delayedResize);\n\n _unObserve(el, 'focus', resize);\n\n _unObserve(el, 'compositionstart', delayedResize);\n\n _unObserve(el, 'compositionupdate', delayedResize);\n\n _unObserve(el, 'compositionend', delayedResize);\n },\n resize: resize\n };\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { BaseEditor, EDITOR_STATE } from \"../baseEditor/index.mjs\";\nimport EventManager from \"../../eventManager.mjs\";\nimport { isMobileBrowser, isIE, isEdge, isIOS } from \"../../helpers/browser.mjs\";\nimport { addClass, getCaretPosition, getComputedStyle, getCssTransform, getScrollbarWidth, innerWidth, offset, resetCssTransform, setCaretPosition, hasVerticalScrollbar, hasHorizontalScrollbar, hasClass, removeClass } from \"../../helpers/dom/element.mjs\";\nimport { stopImmediatePropagation, isImmediatePropagationStopped } from \"../../helpers/dom/event.mjs\";\nimport { rangeEach } from \"../../helpers/number.mjs\";\nimport { KEY_CODES } from \"../../helpers/unicode.mjs\";\nimport { autoResize } from \"../../3rdparty/autoResize/index.mjs\";\nvar EDITOR_VISIBLE_CLASS_NAME = 'ht_editor_visible';\nvar EDITOR_HIDDEN_CLASS_NAME = 'ht_editor_hidden';\nexport var EDITOR_TYPE = 'text';\n/**\n * @private\n * @class TextEditor\n */\n\nexport var TextEditor = /*#__PURE__*/function (_BaseEditor) {\n _inherits(TextEditor, _BaseEditor);\n\n var _super = _createSuper(TextEditor);\n\n /**\n * @param {Core} instance The Handsontable instance.\n */\n function TextEditor(instance) {\n var _this;\n\n _classCallCheck(this, TextEditor);\n\n _this = _super.call(this, instance);\n /**\n * Instance of {@link EventManager}.\n *\n * @private\n * @type {EventManager}\n */\n\n _this.eventManager = new EventManager(_assertThisInitialized(_this));\n /**\n * Autoresize instance. Automagically resizes editor after changes.\n *\n * @private\n * @type {autoResize}\n */\n\n _this.autoResize = autoResize();\n /**\n * An TEXTAREA element.\n *\n * @private\n * @type {HTMLTextAreaElement}\n */\n\n _this.TEXTAREA = void 0;\n /**\n * Style declaration object of the TEXTAREA element.\n *\n * @private\n * @type {CSSStyleDeclaration}\n */\n\n _this.textareaStyle = void 0;\n /**\n * Parent element of the TEXTAREA.\n *\n * @private\n * @type {HTMLDivElement}\n */\n\n _this.TEXTAREA_PARENT = void 0;\n /**\n * Style declaration object of the TEXTAREA_PARENT element.\n *\n * @private\n * @type {CSSStyleDeclaration}\n */\n\n _this.textareaParentStyle = void 0;\n /**\n * Z-index class style for the editor.\n *\n * @private\n * @type {string}\n */\n\n _this.layerClass = void 0;\n\n _this.createElements();\n\n _this.bindEvents();\n\n _this.hot.addHookOnce('afterDestroy', function () {\n return _this.destroy();\n });\n\n return _this;\n }\n /**\n * Gets current value from editable element.\n *\n * @returns {number}\n */\n\n\n _createClass(TextEditor, [{\n key: \"getValue\",\n value: function getValue() {\n return this.TEXTAREA.value;\n }\n /**\n * Sets new value into editable element.\n *\n * @param {*} newValue The editor value.\n */\n\n }, {\n key: \"setValue\",\n value: function setValue(newValue) {\n this.TEXTAREA.value = newValue;\n }\n /**\n * Opens the editor and adjust its size.\n */\n\n }, {\n key: \"open\",\n value: function open() {\n var _this2 = this;\n\n this.refreshDimensions(); // need it instantly, to prevent https://github.com/handsontable/handsontable/issues/348\n\n this.showEditableElement();\n this.addHook('beforeKeyDown', function (event) {\n return _this2.onBeforeKeyDown(event);\n });\n }\n /**\n * Closes the editor.\n */\n\n }, {\n key: \"close\",\n value: function close() {\n this.autoResize.unObserve();\n\n if (this.hot.rootDocument.activeElement === this.TEXTAREA) {\n this.hot.listen(); // don't refocus the table if user focused some cell outside of HT on purpose\n }\n\n this.hideEditableElement();\n this.removeHooksByKey('beforeKeyDown');\n }\n /**\n * Prepares editor's meta data.\n *\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number|string} prop The column property (passed when datasource is an array of objects).\n * @param {HTMLTableCellElement} td The rendered cell element.\n * @param {*} value The rendered value.\n * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).\n */\n\n }, {\n key: \"prepare\",\n value: function prepare(row, col, prop, td, value, cellProperties) {\n var previousState = this.state;\n\n _get(_getPrototypeOf(TextEditor.prototype), \"prepare\", this).call(this, row, col, prop, td, value, cellProperties);\n\n if (!cellProperties.readOnly) {\n this.refreshDimensions(true);\n var allowInvalid = cellProperties.allowInvalid,\n fragmentSelection = cellProperties.fragmentSelection;\n\n if (allowInvalid) {\n // Remove an empty space from texarea (added by copyPaste plugin to make copy/paste\n // functionality work with IME)\n this.TEXTAREA.value = '';\n }\n\n if (previousState !== EDITOR_STATE.FINISHED) {\n this.hideEditableElement();\n } // @TODO: The fragmentSelection functionality is conflicted with IME. For this feature\n // refocus has to be disabled (to make IME working).\n\n\n var restoreFocus = !fragmentSelection;\n\n if (restoreFocus && !isMobileBrowser()) {\n this.focus();\n }\n }\n }\n /**\n * Begins editing on a highlighted cell and hides fillHandle corner if was present.\n *\n * @param {*} newInitialValue The editor initial value.\n * @param {Event} event The keyboard event object.\n */\n\n }, {\n key: \"beginEditing\",\n value: function beginEditing(newInitialValue, event) {\n if (this.state !== EDITOR_STATE.VIRGIN) {\n return;\n }\n\n this.TEXTAREA.value = ''; // Remove an empty space from texarea (added by copyPaste plugin to make copy/paste functionality work with IME).\n\n _get(_getPrototypeOf(TextEditor.prototype), \"beginEditing\", this).call(this, newInitialValue, event);\n }\n /**\n * Sets focus state on the select element.\n */\n\n }, {\n key: \"focus\",\n value: function focus() {\n // For IME editor textarea element must be focused using \".select\" method.\n // Using \".focus\" browser automatically scroll into the focused element which\n // is undesire effect.\n this.TEXTAREA.select();\n setCaretPosition(this.TEXTAREA, this.TEXTAREA.value.length);\n }\n /**\n * Creates an editor's elements and adds necessary CSS classnames.\n */\n\n }, {\n key: \"createElements\",\n value: function createElements() {\n var rootDocument = this.hot.rootDocument;\n this.TEXTAREA = rootDocument.createElement('TEXTAREA');\n this.TEXTAREA.setAttribute('data-hot-input', ''); // Makes the element recognizable by Hot as its own component's element.\n\n this.TEXTAREA.tabIndex = -1;\n addClass(this.TEXTAREA, 'handsontableInput');\n this.textareaStyle = this.TEXTAREA.style;\n this.textareaStyle.width = 0;\n this.textareaStyle.height = 0;\n this.textareaStyle.overflowY = 'visible';\n this.TEXTAREA_PARENT = rootDocument.createElement('DIV');\n addClass(this.TEXTAREA_PARENT, 'handsontableInputHolder');\n\n if (hasClass(this.TEXTAREA_PARENT, this.layerClass)) {\n removeClass(this.TEXTAREA_PARENT, this.layerClass);\n }\n\n addClass(this.TEXTAREA_PARENT, EDITOR_HIDDEN_CLASS_NAME);\n this.textareaParentStyle = this.TEXTAREA_PARENT.style;\n this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);\n this.hot.rootElement.appendChild(this.TEXTAREA_PARENT);\n }\n /**\n * Moves an editable element out of the viewport, but element must be able to hold focus for IME support.\n *\n * @private\n */\n\n }, {\n key: \"hideEditableElement\",\n value: function hideEditableElement() {\n if (isIE() || isEdge()) {\n this.textareaStyle.textIndent = '-99999px';\n }\n\n this.textareaStyle.overflowY = 'visible';\n this.textareaParentStyle.opacity = '0';\n this.textareaParentStyle.height = '1px';\n\n if (hasClass(this.TEXTAREA_PARENT, this.layerClass)) {\n removeClass(this.TEXTAREA_PARENT, this.layerClass);\n }\n\n addClass(this.TEXTAREA_PARENT, EDITOR_HIDDEN_CLASS_NAME);\n }\n /**\n * Resets an editable element position.\n *\n * @private\n */\n\n }, {\n key: \"showEditableElement\",\n value: function showEditableElement() {\n this.textareaParentStyle.height = '';\n this.textareaParentStyle.overflow = '';\n this.textareaParentStyle.position = '';\n this.textareaParentStyle.right = 'auto';\n this.textareaParentStyle.opacity = '1';\n this.textareaStyle.textIndent = '';\n this.textareaStyle.overflowY = 'hidden';\n var childNodes = this.TEXTAREA_PARENT.childNodes;\n var hasClassHandsontableEditor = false;\n rangeEach(childNodes.length - 1, function (index) {\n var childNode = childNodes[index];\n\n if (hasClass(childNode, 'handsontableEditor')) {\n hasClassHandsontableEditor = true;\n return false;\n }\n });\n\n if (hasClass(this.TEXTAREA_PARENT, EDITOR_HIDDEN_CLASS_NAME)) {\n removeClass(this.TEXTAREA_PARENT, EDITOR_HIDDEN_CLASS_NAME);\n }\n\n if (hasClassHandsontableEditor) {\n this.layerClass = EDITOR_VISIBLE_CLASS_NAME;\n addClass(this.TEXTAREA_PARENT, this.layerClass);\n } else {\n this.layerClass = this.getEditedCellsLayerClass();\n addClass(this.TEXTAREA_PARENT, this.layerClass);\n }\n }\n /**\n * Refreshes editor's value using source data.\n *\n * @private\n */\n\n }, {\n key: \"refreshValue\",\n value: function refreshValue() {\n var physicalRow = this.hot.toPhysicalRow(this.row);\n var sourceData = this.hot.getSourceDataAtCell(physicalRow, this.col);\n this.originalValue = sourceData;\n this.setValue(sourceData);\n this.refreshDimensions();\n }\n /**\n * Refreshes editor's size and position.\n *\n * @private\n * @param {boolean} force Indicates if the refreshing editor dimensions should be triggered.\n */\n\n }, {\n key: \"refreshDimensions\",\n value: function refreshDimensions() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (this.state !== EDITOR_STATE.EDITING && !force) {\n return;\n }\n\n this.TD = this.getEditedCell(); // TD is outside of the viewport.\n\n if (!this.TD) {\n if (!force) {\n this.close(); // TODO shouldn't it be this.finishEditing() ?\n }\n\n return;\n }\n\n var _this$hot$view$wt = this.hot.view.wt,\n wtOverlays = _this$hot$view$wt.wtOverlays,\n wtViewport = _this$hot$view$wt.wtViewport;\n var currentOffset = offset(this.TD);\n var containerOffset = offset(this.hot.rootElement);\n var scrollableContainerTop = wtOverlays.topOverlay.holder;\n var scrollableContainerLeft = wtOverlays.leftOverlay.holder;\n var containerScrollTop = scrollableContainerTop !== this.hot.rootWindow ? scrollableContainerTop.scrollTop : 0;\n var containerScrollLeft = scrollableContainerLeft !== this.hot.rootWindow ? scrollableContainerLeft.scrollLeft : 0;\n var editorSection = this.checkEditorSection();\n var scrollTop = ['', 'left'].includes(editorSection) ? containerScrollTop : 0;\n var scrollLeft = ['', 'top', 'bottom'].includes(editorSection) ? containerScrollLeft : 0; // If colHeaders is disabled, cells in the first row have border-top\n\n var editTopModifier = currentOffset.top === containerOffset.top ? 0 : 1;\n var backgroundColor = this.TD.style.backgroundColor;\n var editTop = currentOffset.top - containerOffset.top - editTopModifier - scrollTop;\n var editLeft = currentOffset.left - containerOffset.left - 1 - scrollLeft;\n var cssTransformOffset; // TODO: Refactor this to the new instance.getCell method (from #ply-59), after 0.12.1 is released\n\n switch (editorSection) {\n case 'top':\n cssTransformOffset = getCssTransform(wtOverlays.topOverlay.clone.wtTable.holder.parentNode);\n break;\n\n case 'left':\n cssTransformOffset = getCssTransform(wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);\n break;\n\n case 'top-left-corner':\n cssTransformOffset = getCssTransform(wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n\n case 'bottom-left-corner':\n cssTransformOffset = getCssTransform(wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n\n case 'bottom':\n cssTransformOffset = getCssTransform(wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode);\n break;\n\n default:\n break;\n }\n\n var hasColumnHeaders = this.hot.hasColHeaders();\n var renderableRow = this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row);\n var renderableColumn = this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col);\n var nrOfRenderableRowIndexes = this.hot.rowIndexMapper.getRenderableIndexesLength();\n var firstRowIndexOfTheBottomOverlay = nrOfRenderableRowIndexes - this.hot.view.wt.getSetting('fixedRowsBottom');\n\n if (hasColumnHeaders && renderableRow <= 0 || renderableRow === firstRowIndexOfTheBottomOverlay) {\n editTop += 1;\n }\n\n if (renderableColumn <= 0) {\n editLeft += 1;\n }\n\n if (cssTransformOffset && cssTransformOffset !== -1) {\n this.textareaParentStyle[cssTransformOffset[0]] = cssTransformOffset[1];\n } else {\n resetCssTransform(this.TEXTAREA_PARENT);\n }\n\n this.textareaParentStyle.top = \"\".concat(editTop, \"px\");\n this.textareaParentStyle.left = \"\".concat(editLeft, \"px\");\n this.showEditableElement();\n var firstRowOffset = wtViewport.rowsRenderCalculator.startPosition;\n var firstColumnOffset = wtViewport.columnsRenderCalculator.startPosition;\n var horizontalScrollPosition = wtOverlays.leftOverlay.getScrollPosition();\n var verticalScrollPosition = wtOverlays.topOverlay.getScrollPosition();\n var scrollbarWidth = getScrollbarWidth(this.hot.rootDocument);\n var cellTopOffset = this.TD.offsetTop + firstRowOffset - verticalScrollPosition;\n var cellLeftOffset = this.TD.offsetLeft + firstColumnOffset - horizontalScrollPosition;\n var width = innerWidth(this.TD) - 8;\n var actualVerticalScrollbarWidth = hasVerticalScrollbar(scrollableContainerTop) ? scrollbarWidth : 0;\n var actualHorizontalScrollbarWidth = hasHorizontalScrollbar(scrollableContainerLeft) ? scrollbarWidth : 0;\n var maxWidth = this.hot.view.maximumVisibleElementWidth(cellLeftOffset) - 9 - actualVerticalScrollbarWidth;\n var height = this.TD.scrollHeight + 1;\n var maxHeight = Math.max(this.hot.view.maximumVisibleElementHeight(cellTopOffset) - actualHorizontalScrollbarWidth, 23); // eslint-disable-line max-len\n\n var cellComputedStyle = getComputedStyle(this.TD, this.hot.rootWindow);\n this.TEXTAREA.style.fontSize = cellComputedStyle.fontSize;\n this.TEXTAREA.style.fontFamily = cellComputedStyle.fontFamily;\n this.TEXTAREA.style.backgroundColor = backgroundColor;\n this.autoResize.init(this.TEXTAREA, {\n minHeight: Math.min(height, maxHeight),\n maxHeight: maxHeight,\n // TEXTAREA should never be higher than visible part of the viewport (should not cover the scrollbar)\n minWidth: Math.min(width, maxWidth),\n maxWidth: maxWidth // TEXTAREA should never be wider than visible part of the viewport (should not cover the scrollbar)\n\n }, true);\n }\n /**\n * Binds events and hooks.\n *\n * @private\n */\n\n }, {\n key: \"bindEvents\",\n value: function bindEvents() {\n var _this3 = this;\n\n this.eventManager.addEventListener(this.TEXTAREA, 'cut', function (event) {\n return event.stopPropagation();\n });\n this.eventManager.addEventListener(this.TEXTAREA, 'paste', function (event) {\n return event.stopPropagation();\n });\n\n if (isIOS()) {\n // on iOS after click \"Done\" the edit isn't hidden by default, so we need to handle it manually.\n this.eventManager.addEventListener(this.TEXTAREA, 'focusout', function () {\n return _this3.finishEditing(false);\n });\n }\n\n this.addHook('afterScrollHorizontally', function () {\n return _this3.refreshDimensions();\n });\n this.addHook('afterScrollVertically', function () {\n return _this3.refreshDimensions();\n });\n this.addHook('afterColumnResize', function () {\n _this3.refreshDimensions();\n\n _this3.focus();\n });\n this.addHook('afterRowResize', function () {\n _this3.refreshDimensions();\n\n _this3.focus();\n });\n }\n /**\n * Ugly hack for autocompleteEditor.\n *\n * @private\n */\n\n }, {\n key: \"allowKeyEventPropagation\",\n value: function allowKeyEventPropagation() {}\n /**\n * Destroys the internal event manager and clears attached hooks.\n *\n * @private\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.eventManager.destroy();\n this.clearHooks();\n }\n /**\n * OnBeforeKeyDown callback.\n *\n * @param {Event} event The keyboard event object.\n */\n\n }, {\n key: \"onBeforeKeyDown\",\n value: function onBeforeKeyDown(event) {\n // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)\n var ctrlDown = (event.ctrlKey || event.metaKey) && !event.altKey; // Process only events that have been fired in the editor\n\n if (event.target !== this.TEXTAREA || isImmediatePropagationStopped(event)) {\n return;\n }\n\n switch (event.keyCode) {\n case KEY_CODES.ARROW_RIGHT:\n if (this.isInFullEditMode()) {\n if (!this.isWaiting() && !this.allowKeyEventPropagation(event.keyCode)) {\n stopImmediatePropagation(event);\n }\n }\n\n break;\n\n case KEY_CODES.ARROW_LEFT:\n if (this.isInFullEditMode()) {\n if (!this.isWaiting() && !this.allowKeyEventPropagation(event.keyCode)) {\n stopImmediatePropagation(event);\n }\n }\n\n break;\n\n case KEY_CODES.ARROW_UP:\n case KEY_CODES.ARROW_DOWN:\n if (this.isInFullEditMode()) {\n if (!this.isWaiting() && !this.allowKeyEventPropagation(event.keyCode)) {\n stopImmediatePropagation(event);\n }\n }\n\n break;\n\n case KEY_CODES.ENTER:\n {\n var isMultipleSelection = this.hot.selection.isMultiple();\n\n if (ctrlDown && !isMultipleSelection || event.altKey) {\n // if ctrl+enter or alt+enter, add new line\n if (this.isOpened()) {\n var caretPosition = getCaretPosition(this.TEXTAREA);\n var value = this.getValue();\n var newValue = \"\".concat(value.slice(0, caretPosition), \"\\n\").concat(value.slice(caretPosition));\n this.setValue(newValue);\n setCaretPosition(this.TEXTAREA, caretPosition + 1);\n } else {\n this.beginEditing(\"\".concat(this.originalValue, \"\\n\"));\n }\n\n stopImmediatePropagation(event);\n }\n\n event.preventDefault(); // don't add newline to field\n\n break;\n }\n\n case KEY_CODES.BACKSPACE:\n case KEY_CODES.DELETE:\n case KEY_CODES.HOME:\n case KEY_CODES.END:\n stopImmediatePropagation(event); // backspace, delete, home, end should only work locally when cell is edited (not in table context)\n\n break;\n\n default:\n break;\n }\n\n var arrowKeyCodes = [KEY_CODES.ARROW_UP, KEY_CODES.ARROW_RIGHT, KEY_CODES.ARROW_DOWN, KEY_CODES.ARROW_LEFT];\n\n if (arrowKeyCodes.indexOf(event.keyCode) === -1) {\n this.autoResize.resize(String.fromCharCode(event.keyCode));\n }\n }\n }], [{\n key: \"EDITOR_TYPE\",\n get: function get() {\n return EDITOR_TYPE;\n }\n }]);\n\n return TextEditor;\n}(BaseEditor);","/**\n * Adds appropriate CSS class to table cell, based on cellProperties.\n */\nimport { addClass, removeClass } from \"../../helpers/dom/element.mjs\";\nexport var RENDERER_TYPE = 'base';\n/**\n * @param {Core} instance The Handsontable instance.\n * @param {HTMLTableCellElement} TD The rendered cell element.\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number|string} prop The column property (passed when datasource is an array of objects).\n * @param {*} value The rendered value.\n * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).\n */\n\nexport function baseRenderer(instance, TD, row, col, prop, value, cellProperties) {\n var classesToAdd = [];\n var classesToRemove = [];\n\n if (cellProperties.className) {\n addClass(TD, cellProperties.className);\n }\n\n if (cellProperties.readOnly) {\n classesToAdd.push(cellProperties.readOnlyCellClassName);\n }\n\n if (cellProperties.valid === false && cellProperties.invalidCellClassName) {\n classesToAdd.push(cellProperties.invalidCellClassName);\n } else {\n classesToRemove.push(cellProperties.invalidCellClassName);\n }\n\n if (cellProperties.wordWrap === false && cellProperties.noWordWrapClassName) {\n classesToAdd.push(cellProperties.noWordWrapClassName);\n }\n\n if (!value && cellProperties.placeholder) {\n classesToAdd.push(cellProperties.placeholderCellClassName);\n }\n\n removeClass(TD, classesToRemove);\n addClass(TD, classesToAdd);\n}\nbaseRenderer.RENDERER_TYPE = RENDERER_TYPE;","import \"core-js/modules/es.string.trim.js\";\nimport { baseRenderer } from \"../baseRenderer/index.mjs\";\nimport { empty, fastInnerText } from \"../../helpers/dom/element.mjs\";\nimport { stringify } from \"../../helpers/mixed.mjs\";\nexport var RENDERER_TYPE = 'text';\n/**\n * Default text renderer.\n *\n * @private\n * @param {Core} instance The Handsontable instance.\n * @param {HTMLTableCellElement} TD The rendered cell element.\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number|string} prop The column property (passed when datasource is an array of objects).\n * @param {*} value The rendered value.\n * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).\n */\n\nexport function textRenderer(instance, TD, row, col, prop, value, cellProperties) {\n baseRenderer.apply(this, [instance, TD, row, col, prop, value, cellProperties]);\n var escaped = value;\n\n if (!escaped && cellProperties.placeholder) {\n escaped = cellProperties.placeholder;\n }\n\n escaped = stringify(escaped);\n\n if (instance.getSettings().trimWhitespace) {\n escaped = escaped.trim();\n }\n\n if (cellProperties.rendererTemplate) {\n empty(TD);\n var TEMPLATE = instance.rootDocument.createElement('TEMPLATE');\n TEMPLATE.setAttribute('bind', '{{}}');\n TEMPLATE.innerHTML = cellProperties.rendererTemplate;\n HTMLTemplateElement.decorate(TEMPLATE);\n TEMPLATE.model = instance.getSourceDataAtRow(row);\n TD.appendChild(TEMPLATE);\n } else {\n // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n fastInnerText(TD, escaped);\n }\n}\ntextRenderer.RENDERER_TYPE = RENDERER_TYPE;","import { TextEditor } from \"../../editors/textEditor/index.mjs\";\nimport { textRenderer } from \"../../renderers/textRenderer/index.mjs\";\nexport var CELL_TYPE = 'text';\nexport var TextCellType = {\n CELL_TYPE: CELL_TYPE,\n editor: TextEditor,\n renderer: textRenderer\n};","import Core from \"./core.mjs\";\nimport { rootInstanceSymbol } from \"./utils/rootInstance.mjs\"; // FIXME: Bug in eslint-plugin-import: https://github.com/benmosher/eslint-plugin-import/issues/1883\n\n/* eslint-disable import/named */\n\nimport { dictionaryKeys, getTranslatedPhrase, registerLanguageDictionary, getLanguagesDictionaries, getLanguageDictionary } from \"./i18n/registry.mjs\";\n/* eslint-enable import/named */\n\nimport { registerCellType } from \"./cellTypes/registry.mjs\";\nimport { TextCellType } from \"./cellTypes/textType/index.mjs\";\nregisterCellType(TextCellType);\n/**\n * @param {HTMLElement} rootElement The element to which the Handsontable instance is injected.\n * @param {object} userSettings The user defined options.\n * @returns {Core}\n */\n\nfunction Handsontable(rootElement, userSettings) {\n var instance = new Core(rootElement, userSettings || {}, rootInstanceSymbol);\n instance.init();\n return instance;\n}\n\nHandsontable.Core = function (rootElement) {\n var userSettings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return new Core(rootElement, userSettings, rootInstanceSymbol);\n};\n\nHandsontable.packageName = 'handsontable';\nHandsontable.buildDate = \"28/07/2021 09:12:07\";\nHandsontable.version = \"9.0.2\";\nHandsontable.languages = {\n dictionaryKeys: dictionaryKeys,\n getLanguageDictionary: getLanguageDictionary,\n getLanguagesDictionaries: getLanguagesDictionaries,\n registerLanguageDictionary: registerLanguageDictionary,\n getTranslatedPhrase: getTranslatedPhrase\n};\nexport default Handsontable;","import \"core-js/modules/es.array.concat.js\";\n\n/**\n * @param {Core} Handsontable The Handsontable instance.\n */\nexport default function jQueryWrapper(Handsontable) {\n // eslint-disable-next-line\n var jQuery = typeof window === 'undefined' ? false : window.jQuery;\n\n if (!jQuery) {\n return;\n }\n\n jQuery.fn.handsontable = function (action) {\n var $this = this.first(); // Use only first element from list\n\n var instance = $this.data('handsontable'); // Init case\n\n if (typeof action !== 'string') {\n var userSettings = action || {};\n\n if (instance) {\n instance.updateSettings(userSettings);\n } else {\n instance = new Handsontable.Core($this[0], userSettings);\n $this.data('handsontable', instance);\n instance.init();\n }\n\n return $this;\n }\n\n var output; // Action case\n\n if (instance) {\n if (typeof instance[action] !== 'undefined') {\n var _instance$action;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n output = (_instance$action = instance[action]).call.apply(_instance$action, [instance].concat(args));\n\n if (action === 'destroy') {\n $this.removeData();\n }\n } else {\n throw new Error(\"Handsontable do not provide action: \".concat(action));\n }\n }\n\n return output;\n };\n}","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.string.trim.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\nimport \"core-js/modules/es.array.from.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { addClass, outerHeight, outerWidth } from \"./../helpers/dom/element.mjs\";\nimport { arrayEach } from \"./../helpers/array.mjs\";\n/**\n * @class GhostTable\n * @util\n */\n\nvar GhostTable = /*#__PURE__*/function () {\n function GhostTable(hotInstance) {\n _classCallCheck(this, GhostTable);\n\n /**\n * Handsontable instance.\n *\n * @type {Core}\n */\n this.hot = hotInstance;\n /**\n * Container element where every table will be injected.\n *\n * @type {HTMLElement|null}\n */\n\n this.container = null;\n /**\n * Flag which determine is table was injected to DOM.\n *\n * @type {boolean}\n */\n\n this.injected = false;\n /**\n * Added rows collection.\n *\n * @type {Array}\n */\n\n this.rows = [];\n /**\n * Added columns collection.\n *\n * @type {Array}\n */\n\n this.columns = [];\n /**\n * Samples prepared for calculations.\n *\n * @type {Map}\n * @default {null}\n */\n\n this.samples = null;\n /**\n * Ghost table settings.\n *\n * @type {object}\n * @default {Object}\n */\n\n this.settings = {\n useHeaders: true\n };\n }\n /**\n * Add row.\n *\n * @param {number} row Row index.\n * @param {Map} samples Samples Map object.\n */\n\n\n _createClass(GhostTable, [{\n key: \"addRow\",\n value: function addRow(row, samples) {\n if (this.columns.length) {\n throw new Error('Doesn\\'t support multi-dimensional table');\n }\n\n if (!this.rows.length) {\n this.container = this.createContainer(this.hot.rootElement.className);\n }\n\n var rowObject = {\n row: row\n };\n this.rows.push(rowObject);\n this.samples = samples;\n this.table = this.createTable(this.hot.table.className);\n this.table.colGroup.appendChild(this.createColGroupsCol());\n this.table.tr.appendChild(this.createRow(row));\n this.container.container.appendChild(this.table.fragment);\n rowObject.table = this.table.table;\n }\n /**\n * Add a row consisting of the column headers.\n *\n * @param {Map} samples A map with sampled table values.\n */\n\n }, {\n key: \"addColumnHeadersRow\",\n value: function addColumnHeadersRow(samples) {\n var colHeader = this.hot.getColHeader(0);\n\n if (colHeader !== null && colHeader !== void 0) {\n var rowObject = {\n row: -1\n };\n this.rows.push(rowObject);\n this.container = this.createContainer(this.hot.rootElement.className);\n this.samples = samples;\n this.table = this.createTable(this.hot.table.className);\n this.table.colGroup.appendChild(this.createColGroupsCol());\n this.appendColumnHeadersRow();\n this.container.container.appendChild(this.table.fragment);\n rowObject.table = this.table.table;\n }\n }\n /**\n * Add column.\n *\n * @param {number} column Column index.\n * @param {Map} samples A map with sampled table values.\n */\n\n }, {\n key: \"addColumn\",\n value: function addColumn(column, samples) {\n if (this.rows.length) {\n throw new Error('Doesn\\'t support multi-dimensional table');\n }\n\n if (!this.columns.length) {\n this.container = this.createContainer(this.hot.rootElement.className);\n }\n\n var columnObject = {\n col: column\n };\n this.columns.push(columnObject);\n this.samples = samples;\n this.table = this.createTable(this.hot.table.className);\n\n if (this.getSetting('useHeaders') && this.hot.getColHeader(column) !== null) {\n // Please keep in mind that the renderable column index equal to the visual columns index for the GhostTable.\n // We render all columns.\n this.hot.view.appendColHeader(column, this.table.th);\n }\n\n this.table.tBody.appendChild(this.createCol(column));\n this.container.container.appendChild(this.table.fragment);\n columnObject.table = this.table.table;\n }\n /**\n * Get calculated heights.\n *\n * @param {Function} callback Callback which will be fired for each calculated row.\n */\n\n }, {\n key: \"getHeights\",\n value: function getHeights(callback) {\n if (!this.injected) {\n this.injectTable();\n }\n\n arrayEach(this.rows, function (row) {\n // -1 <- reduce border-top from table\n callback(row.row, outerHeight(row.table) - 1);\n });\n }\n /**\n * Get calculated widths.\n *\n * @param {Function} callback Callback which will be fired for each calculated column.\n */\n\n }, {\n key: \"getWidths\",\n value: function getWidths(callback) {\n if (!this.injected) {\n this.injectTable();\n }\n\n arrayEach(this.columns, function (column) {\n callback(column.col, outerWidth(column.table));\n });\n }\n /**\n * Set the Ghost Table settings to the provided object.\n *\n * @param {object} settings New Ghost Table Settings.\n */\n\n }, {\n key: \"setSettings\",\n value: function setSettings(settings) {\n this.settings = settings;\n }\n /**\n * Set a single setting of the Ghost Table.\n *\n * @param {string} name Setting name.\n * @param {*} value Setting value.\n */\n\n }, {\n key: \"setSetting\",\n value: function setSetting(name, value) {\n if (!this.settings) {\n this.settings = {};\n }\n\n this.settings[name] = value;\n }\n /**\n * Get the Ghost Table settings.\n *\n * @returns {object|null}\n */\n\n }, {\n key: \"getSettings\",\n value: function getSettings() {\n return this.settings;\n }\n /**\n * Get a single Ghost Table setting.\n *\n * @param {string} name The setting name to get.\n * @returns {boolean|null}\n */\n\n }, {\n key: \"getSetting\",\n value: function getSetting(name) {\n if (this.settings) {\n return this.settings[name];\n }\n\n return null;\n }\n /**\n * Create colgroup col elements.\n *\n * @returns {DocumentFragment}\n */\n\n }, {\n key: \"createColGroupsCol\",\n value: function createColGroupsCol() {\n var _this = this;\n\n var fragment = this.hot.rootDocument.createDocumentFragment();\n\n if (this.hot.hasRowHeaders()) {\n fragment.appendChild(this.createColElement(-1));\n }\n\n this.samples.forEach(function (sample) {\n arrayEach(sample.strings, function (string) {\n fragment.appendChild(_this.createColElement(string.col));\n });\n });\n return fragment;\n }\n /**\n * Create table row element.\n *\n * @param {number} row Row index.\n * @returns {DocumentFragment} Returns created table row elements.\n */\n\n }, {\n key: \"createRow\",\n value: function createRow(row) {\n var _this2 = this;\n\n var rootDocument = this.hot.rootDocument;\n var fragment = rootDocument.createDocumentFragment();\n var th = rootDocument.createElement('th');\n\n if (this.hot.hasRowHeaders()) {\n this.hot.view.appendRowHeader(row, th);\n fragment.appendChild(th);\n }\n\n this.samples.forEach(function (sample) {\n arrayEach(sample.strings, function (string) {\n var column = string.col;\n\n var cellProperties = _this2.hot.getCellMeta(row, column);\n\n cellProperties.col = column;\n cellProperties.row = row;\n\n var renderer = _this2.hot.getCellRenderer(cellProperties);\n\n var td = rootDocument.createElement('td'); // Indicate that this element is created and supported by GhostTable. It can be useful to\n // exclude rendering performance costly logic or exclude logic which doesn't work within a hidden table.\n\n td.setAttribute('ghost-table', 1);\n renderer(_this2.hot, td, row, column, _this2.hot.colToProp(column), string.value, cellProperties);\n fragment.appendChild(td);\n });\n });\n return fragment;\n }\n /**\n * Creates DOM elements for headers and appends them to the THEAD element of the table.\n */\n\n }, {\n key: \"appendColumnHeadersRow\",\n value: function appendColumnHeadersRow() {\n var _this3 = this;\n\n var rootDocument = this.hot.rootDocument;\n var domFragment = rootDocument.createDocumentFragment();\n var columnHeaders = [];\n\n if (this.hot.hasRowHeaders()) {\n var th = rootDocument.createElement('th');\n columnHeaders.push([-1, th]);\n domFragment.appendChild(th);\n }\n\n this.samples.forEach(function (sample) {\n arrayEach(sample.strings, function (string) {\n var column = string.col;\n var th = rootDocument.createElement('th');\n columnHeaders.push([column, th]);\n domFragment.appendChild(th);\n });\n }); // Appending DOM elements for headers\n\n this.table.tHead.appendChild(domFragment);\n arrayEach(columnHeaders, function (columnHeader) {\n var _columnHeader = _slicedToArray(columnHeader, 2),\n column = _columnHeader[0],\n th = _columnHeader[1]; // Using source method for filling a header with value.\n\n\n _this3.hot.view.appendColHeader(column, th);\n });\n }\n /**\n * Create table column elements.\n *\n * @param {number} column Column index.\n * @returns {DocumentFragment} Returns created column table column elements.\n */\n\n }, {\n key: \"createCol\",\n value: function createCol(column) {\n var _this4 = this;\n\n var rootDocument = this.hot.rootDocument;\n var fragment = rootDocument.createDocumentFragment();\n this.samples.forEach(function (sample) {\n arrayEach(sample.strings, function (string) {\n var row = string.row;\n\n var cellProperties = _this4.hot.getCellMeta(row, column);\n\n cellProperties.col = column;\n cellProperties.row = row;\n\n var renderer = _this4.hot.getCellRenderer(cellProperties);\n\n var td = rootDocument.createElement('td');\n var tr = rootDocument.createElement('tr'); // Indicate that this element is created and supported by GhostTable. It can be useful to\n // exclude rendering performance costly logic or exclude logic which doesn't work within a hidden table.\n\n td.setAttribute('ghost-table', 1);\n renderer(_this4.hot, td, row, column, _this4.hot.colToProp(column), string.value, cellProperties);\n tr.appendChild(td);\n fragment.appendChild(tr);\n });\n });\n return fragment;\n }\n /**\n * Remove table from document and reset internal state.\n */\n\n }, {\n key: \"clean\",\n value: function clean() {\n this.rows.length = 0;\n this.rows[-1] = void 0;\n this.columns.length = 0;\n\n if (this.samples) {\n this.samples.clear();\n }\n\n this.samples = null;\n this.removeTable();\n }\n /**\n * Inject generated table into document.\n *\n * @param {HTMLElement} [parent=null] The element to which the ghost table is injected.\n */\n\n }, {\n key: \"injectTable\",\n value: function injectTable() {\n var parent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n if (!this.injected) {\n (parent || this.hot.rootElement).appendChild(this.container.fragment);\n this.injected = true;\n }\n }\n /**\n * Remove table from document.\n */\n\n }, {\n key: \"removeTable\",\n value: function removeTable() {\n if (this.injected && this.container.container.parentNode) {\n this.container.container.parentNode.removeChild(this.container.container);\n this.container = null;\n this.injected = false;\n }\n }\n /**\n * Create col element.\n *\n * @param {number} column Column index.\n * @returns {HTMLElement}\n */\n\n }, {\n key: \"createColElement\",\n value: function createColElement(column) {\n var col = this.hot.rootDocument.createElement('col');\n col.style.width = \"\".concat(this.hot.view.wt.wtTable.getStretchedColumnWidth(column), \"px\");\n return col;\n }\n /**\n * Create table element.\n *\n * @param {string} className The CSS classes to add.\n * @returns {object}\n */\n\n }, {\n key: \"createTable\",\n value: function createTable() {\n var className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var rootDocument = this.hot.rootDocument;\n var fragment = rootDocument.createDocumentFragment();\n var table = rootDocument.createElement('table');\n var tHead = rootDocument.createElement('thead');\n var tBody = rootDocument.createElement('tbody');\n var colGroup = rootDocument.createElement('colgroup');\n var tr = rootDocument.createElement('tr');\n var th = rootDocument.createElement('th');\n\n if (this.isVertical()) {\n table.appendChild(colGroup);\n }\n\n if (this.isHorizontal()) {\n tr.appendChild(th);\n tHead.appendChild(tr);\n table.style.tableLayout = 'auto';\n table.style.width = 'auto';\n }\n\n table.appendChild(tHead);\n\n if (this.isVertical()) {\n tBody.appendChild(tr);\n }\n\n table.appendChild(tBody);\n addClass(table, className);\n fragment.appendChild(table);\n return {\n fragment: fragment,\n table: table,\n tHead: tHead,\n tBody: tBody,\n colGroup: colGroup,\n tr: tr,\n th: th\n };\n }\n /**\n * Create container for tables.\n *\n * @param {string} className The CSS classes to add.\n * @returns {object}\n */\n\n }, {\n key: \"createContainer\",\n value: function createContainer() {\n var className = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var rootDocument = this.hot.rootDocument;\n var fragment = rootDocument.createDocumentFragment();\n var container = rootDocument.createElement('div');\n var containerClassName = \"htGhostTable htAutoSize \".concat(className.trim());\n addClass(container, containerClassName);\n fragment.appendChild(container);\n return {\n fragment: fragment,\n container: container\n };\n }\n /**\n * Checks if table is raised vertically (checking rows).\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isVertical\",\n value: function isVertical() {\n return !!(this.rows.length && !this.columns.length);\n }\n /**\n * Checks if table is raised horizontally (checking columns).\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isHorizontal\",\n value: function isHorizontal() {\n return !!(this.columns.length && !this.rows.length);\n }\n }]);\n\n return GhostTable;\n}();\n\nexport default GhostTable;","/**\n * Get normalized Date object for the ISO formatted date strings.\n * Natively, the date object parsed from a ISO 8601 string will be offsetted by the timezone difference, which may result in returning a wrong date.\n * See: Github issue #3338.\n *\n * @param {string} dateString String representing the date.\n * @returns {Date} The proper Date object.\n */\nexport function getNormalizedDate(dateString) {\n var nativeDate = new Date(dateString); // NaN if dateString is not in ISO format\n\n if (!isNaN(new Date(\"\".concat(dateString, \"T00:00\")).getDate())) {\n // Compensate timezone offset\n return new Date(nativeDate.getTime() + nativeDate.getTimezoneOffset() * 60000);\n }\n\n return nativeDate;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { TextEditor } from \"../textEditor/index.mjs\";\nimport { setCaretPosition } from \"../../helpers/dom/element.mjs\";\nimport { stopImmediatePropagation, isImmediatePropagationStopped } from \"../../helpers/dom/event.mjs\";\nimport { KEY_CODES } from \"../../helpers/unicode.mjs\";\nimport { extend } from \"../../helpers/object.mjs\";\nexport var EDITOR_TYPE = 'handsontable';\n/**\n * @private\n * @class HandsontableEditor\n */\n\nexport var HandsontableEditor = /*#__PURE__*/function (_TextEditor) {\n _inherits(HandsontableEditor, _TextEditor);\n\n var _super = _createSuper(HandsontableEditor);\n\n function HandsontableEditor() {\n _classCallCheck(this, HandsontableEditor);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(HandsontableEditor, [{\n key: \"open\",\n value:\n /**\n * Opens the editor and adjust its size.\n */\n function open() {\n // this.addHook('beforeKeyDown', event => this.onBeforeKeyDown(event));\n _get(_getPrototypeOf(HandsontableEditor.prototype), \"open\", this).call(this);\n\n if (this.htEditor) {\n this.htEditor.destroy();\n }\n\n if (this.htContainer.style.display === 'none') {\n this.htContainer.style.display = '';\n } // Construct and initialise a new Handsontable\n\n\n this.htEditor = new this.hot.constructor(this.htContainer, this.htOptions);\n this.htEditor.init();\n this.htEditor.rootElement.style.display = '';\n\n if (this.cellProperties.strict) {\n this.htEditor.selectCell(0, 0);\n } else {\n this.htEditor.deselectCell();\n }\n\n setCaretPosition(this.TEXTAREA, 0, this.TEXTAREA.value.length);\n }\n /**\n * Closes the editor.\n */\n\n }, {\n key: \"close\",\n value: function close() {\n if (this.htEditor) {\n this.htEditor.rootElement.style.display = 'none';\n }\n\n this.removeHooksByKey('beforeKeyDown');\n\n _get(_getPrototypeOf(HandsontableEditor.prototype), \"close\", this).call(this);\n }\n /**\n * Prepares editor's meta data and configuration of the internal Handsontable's instance.\n *\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number|string} prop The column property (passed when datasource is an array of objects).\n * @param {HTMLTableCellElement} td The rendered cell element.\n * @param {*} value The rendered value.\n * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).\n */\n\n }, {\n key: \"prepare\",\n value: function prepare(row, col, prop, td, value, cellProperties) {\n _get(_getPrototypeOf(HandsontableEditor.prototype), \"prepare\", this).call(this, row, col, prop, td, value, cellProperties);\n\n var parent = this;\n var options = {\n startRows: 0,\n startCols: 0,\n minRows: 0,\n minCols: 0,\n className: 'listbox',\n copyPaste: false,\n autoColumnSize: false,\n autoRowSize: false,\n readOnly: true,\n fillHandle: false,\n autoWrapCol: false,\n autoWrapRow: false,\n afterOnCellMouseDown: function afterOnCellMouseDown(_, coords) {\n var sourceValue = this.getSourceData(coords.row, coords.col); // if the value is undefined then it means we don't want to set the value\n\n if (sourceValue !== void 0) {\n parent.setValue(sourceValue);\n }\n\n parent.instance.destroyEditor();\n },\n preventWheel: true\n };\n\n if (this.cellProperties.handsontable) {\n extend(options, cellProperties.handsontable);\n }\n\n this.htOptions = options;\n }\n /**\n * Begins editing on a highlighted cell and hides fillHandle corner if was present.\n *\n * @param {*} newInitialValue The editor initial value.\n * @param {*} event The keyboard event object.\n */\n\n }, {\n key: \"beginEditing\",\n value: function beginEditing(newInitialValue, event) {\n var onBeginEditing = this.hot.getSettings().onBeginEditing;\n\n if (onBeginEditing && onBeginEditing() === false) {\n return;\n }\n\n _get(_getPrototypeOf(HandsontableEditor.prototype), \"beginEditing\", this).call(this, newInitialValue, event);\n }\n /**\n * Creates an editor's elements and adds necessary CSS classnames.\n */\n\n }, {\n key: \"createElements\",\n value: function createElements() {\n _get(_getPrototypeOf(HandsontableEditor.prototype), \"createElements\", this).call(this);\n\n var DIV = this.hot.rootDocument.createElement('DIV');\n DIV.className = 'handsontableEditor';\n this.TEXTAREA_PARENT.appendChild(DIV);\n this.htContainer = DIV;\n this.assignHooks();\n }\n /**\n * Finishes editing and start saving or restoring process for editing cell or last selected range.\n *\n * @param {boolean} restoreOriginalValue If true, then closes editor without saving value from the editor into a cell.\n * @param {boolean} ctrlDown If true, then saveValue will save editor's value to each cell in the last selected range.\n * @param {Function} callback The callback function, fired after editor closing.\n */\n\n }, {\n key: \"finishEditing\",\n value: function finishEditing(restoreOriginalValue, ctrlDown, callback) {\n if (this.htEditor && this.htEditor.isListening()) {\n // if focus is still in the HOT editor\n this.hot.listen(); // return the focus to the parent HOT instance\n }\n\n if (this.htEditor && this.htEditor.getSelectedLast()) {\n var value = this.htEditor.getInstance().getValue();\n\n if (value !== void 0) {\n // if the value is undefined then it means we don't want to set the value\n this.setValue(value);\n }\n }\n\n _get(_getPrototypeOf(HandsontableEditor.prototype), \"finishEditing\", this).call(this, restoreOriginalValue, ctrlDown, callback);\n }\n /**\n * Assings afterDestroy callback to prevent memory leaks.\n *\n * @private\n */\n\n }, {\n key: \"assignHooks\",\n value: function assignHooks() {\n var _this = this;\n\n this.hot.addHook('afterDestroy', function () {\n if (_this.htEditor) {\n _this.htEditor.destroy();\n }\n });\n }\n /**\n * OnBeforeKeyDown callback.\n *\n * @private\n * @param {Event} event The keyboard event object.\n */\n\n }, {\n key: \"onBeforeKeyDown\",\n value: function onBeforeKeyDown(event) {\n if (isImmediatePropagationStopped(event)) {\n return;\n }\n\n var innerHOT = this.htEditor.getInstance();\n var rowToSelect;\n var selectedRow;\n\n if (event.keyCode === KEY_CODES.ARROW_DOWN) {\n if (!innerHOT.getSelectedLast() && !innerHOT.flipped) {\n rowToSelect = 0;\n } else if (innerHOT.getSelectedLast()) {\n if (innerHOT.flipped) {\n rowToSelect = innerHOT.getSelectedLast()[0] + 1;\n } else if (!innerHOT.flipped) {\n var lastRow = innerHOT.countRows() - 1;\n selectedRow = innerHOT.getSelectedLast()[0];\n rowToSelect = Math.min(lastRow, selectedRow + 1);\n }\n }\n } else if (event.keyCode === KEY_CODES.ARROW_UP) {\n if (!innerHOT.getSelectedLast() && innerHOT.flipped) {\n rowToSelect = innerHOT.countRows() - 1;\n } else if (innerHOT.getSelectedLast()) {\n if (innerHOT.flipped) {\n selectedRow = innerHOT.getSelectedLast()[0];\n rowToSelect = Math.max(0, selectedRow - 1);\n } else {\n selectedRow = innerHOT.getSelectedLast()[0];\n rowToSelect = selectedRow - 1;\n }\n }\n }\n\n if (rowToSelect !== void 0) {\n if (rowToSelect < 0 || innerHOT.flipped && rowToSelect > innerHOT.countRows() - 1) {\n innerHOT.deselectCell();\n } else {\n innerHOT.selectCell(rowToSelect, 0);\n }\n\n if (innerHOT.getData().length) {\n event.preventDefault();\n stopImmediatePropagation(event);\n this.hot.listen();\n this.TEXTAREA.focus();\n }\n }\n\n _get(_getPrototypeOf(HandsontableEditor.prototype), \"onBeforeKeyDown\", this).call(this, event);\n }\n }], [{\n key: \"EDITOR_TYPE\",\n get: function get() {\n return EDITOR_TYPE;\n }\n }]);\n\n return HandsontableEditor;\n}(TextEditor);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/es.weak-map.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.array.find.js\";\nimport \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.replace.js\";\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.array.sort.js\";\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport { HandsontableEditor } from \"../handsontableEditor/index.mjs\";\nimport { arrayMap, pivot } from \"../../helpers/array.mjs\";\nimport { addClass, getCaretPosition, getScrollbarWidth, getSelectionEndPosition, getTrimmingContainer, offset, outerHeight, outerWidth, setCaretPosition } from \"../../helpers/dom/element.mjs\";\nimport { isDefined, stringify } from \"../../helpers/mixed.mjs\";\nimport { stripTags } from \"../../helpers/string.mjs\";\nimport { KEY_CODES, isPrintableChar } from \"../../helpers/unicode.mjs\";\nimport { textRenderer } from \"../../renderers/textRenderer/index.mjs\";\nvar privatePool = new WeakMap();\nexport var EDITOR_TYPE = 'autocomplete';\n/**\n * @private\n * @class AutocompleteEditor\n */\n\nexport var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {\n _inherits(AutocompleteEditor, _HandsontableEditor);\n\n var _super = _createSuper(AutocompleteEditor);\n\n function AutocompleteEditor(instance) {\n var _this;\n\n _classCallCheck(this, AutocompleteEditor);\n\n _this = _super.call(this, instance);\n /**\n * Query string to turn available values over.\n *\n * @type {string}\n */\n\n _this.query = null;\n /**\n * Contains stripped choices.\n *\n * @type {string[]}\n */\n\n _this.strippedChoices = [];\n /**\n * Contains raw choices.\n *\n * @type {Array}\n */\n\n _this.rawChoices = [];\n privatePool.set(_assertThisInitialized(_this), {\n skipOne: false,\n isMacOS: _this.hot.rootWindow.navigator.platform.indexOf('Mac') > -1\n });\n return _this;\n }\n /**\n * Gets current value from editable element.\n *\n * @returns {string}\n */\n\n\n _createClass(AutocompleteEditor, [{\n key: \"getValue\",\n value: function getValue() {\n var _this2 = this;\n\n var selectedValue = this.rawChoices.find(function (value) {\n var strippedValue = _this2.stripValueIfNeeded(value);\n\n return strippedValue === _this2.TEXTAREA.value;\n });\n\n if (isDefined(selectedValue)) {\n return selectedValue;\n }\n\n return this.TEXTAREA.value;\n }\n /**\n * Creates an editor's elements and adds necessary CSS classnames.\n */\n\n }, {\n key: \"createElements\",\n value: function createElements() {\n _get(_getPrototypeOf(AutocompleteEditor.prototype), \"createElements\", this).call(this);\n\n addClass(this.htContainer, 'autocompleteEditor');\n addClass(this.htContainer, this.hot.rootWindow.navigator.platform.indexOf('Mac') === -1 ? '' : 'htMacScroll');\n }\n /**\n * Opens the editor and adjust its size and internal Handsontable's instance.\n */\n\n }, {\n key: \"open\",\n value: function open() {\n var _this3 = this;\n\n var priv = privatePool.get(this);\n\n _get(_getPrototypeOf(AutocompleteEditor.prototype), \"open\", this).call(this);\n\n var choicesListHot = this.htEditor.getInstance();\n var trimDropdown = this.cellProperties.trimDropdown === void 0 ? true : this.cellProperties.trimDropdown;\n this.showEditableElement();\n this.focus();\n var scrollbarWidth = getScrollbarWidth();\n\n if (scrollbarWidth === 0 && priv.isMacOS) {\n scrollbarWidth += 15; // default scroll bar width if scroll bars are visible only when scrolling\n }\n\n choicesListHot.updateSettings({\n colWidths: trimDropdown ? [outerWidth(this.TEXTAREA) - 2] : void 0,\n width: trimDropdown ? outerWidth(this.TEXTAREA) + scrollbarWidth : void 0,\n renderer: function renderer(instance, TD, row, col, prop, value, cellProperties) {\n textRenderer(instance, TD, row, col, prop, value, cellProperties);\n var _this3$cellProperties = _this3.cellProperties,\n filteringCaseSensitive = _this3$cellProperties.filteringCaseSensitive,\n allowHtml = _this3$cellProperties.allowHtml;\n var query = _this3.query;\n var cellValue = stringify(value);\n var indexOfMatch;\n var match;\n\n if (cellValue && !allowHtml) {\n indexOfMatch = filteringCaseSensitive === true ? cellValue.indexOf(query) : cellValue.toLowerCase().indexOf(query.toLowerCase());\n\n if (indexOfMatch !== -1) {\n match = cellValue.substr(indexOfMatch, query.length);\n cellValue = cellValue.replace(match, \"\".concat(match, \"\"));\n }\n }\n\n TD.innerHTML = cellValue;\n },\n autoColumnSize: true\n });\n\n if (priv.skipOne) {\n priv.skipOne = false;\n }\n\n this.hot._registerTimeout(function () {\n _this3.queryChoices(_this3.TEXTAREA.value);\n });\n }\n /**\n * Closes the editor.\n */\n\n }, {\n key: \"close\",\n value: function close() {\n this.removeHooksByKey('beforeKeyDown');\n\n _get(_getPrototypeOf(AutocompleteEditor.prototype), \"close\", this).call(this);\n }\n /**\n * Verifies result of validation or closes editor if user's cancelled changes.\n *\n * @param {boolean|undefined} result If `false` and the cell using allowInvalid option,\n * then an editor won't be closed until validation is passed.\n */\n\n }, {\n key: \"discardEditor\",\n value: function discardEditor(result) {\n _get(_getPrototypeOf(AutocompleteEditor.prototype), \"discardEditor\", this).call(this, result);\n\n this.hot.view.render();\n }\n /**\n * Prepares choices list based on applied argument.\n *\n * @private\n * @param {string} query The query.\n */\n\n }, {\n key: \"queryChoices\",\n value: function queryChoices(query) {\n var _this4 = this;\n\n var source = this.cellProperties.source;\n this.query = query;\n\n if (typeof source === 'function') {\n source.call(this.cellProperties, query, function (choices) {\n _this4.rawChoices = choices;\n\n _this4.updateChoicesList(_this4.stripValuesIfNeeded(choices));\n });\n } else if (Array.isArray(source)) {\n this.rawChoices = source;\n this.updateChoicesList(this.stripValuesIfNeeded(source));\n } else {\n this.updateChoicesList([]);\n }\n }\n /**\n * Updates list of the possible completions to choose.\n *\n * @private\n * @param {Array} choicesList The choices list to process.\n */\n\n }, {\n key: \"updateChoicesList\",\n value: function updateChoicesList(choicesList) {\n var pos = getCaretPosition(this.TEXTAREA);\n var endPos = getSelectionEndPosition(this.TEXTAREA);\n var sortByRelevanceSetting = this.cellProperties.sortByRelevance;\n var filterSetting = this.cellProperties.filter;\n var orderByRelevance = null;\n var highlightIndex = null;\n var choices = choicesList;\n\n if (sortByRelevanceSetting) {\n orderByRelevance = AutocompleteEditor.sortByRelevance(this.stripValueIfNeeded(this.getValue()), choices, this.cellProperties.filteringCaseSensitive);\n }\n\n var orderByRelevanceLength = Array.isArray(orderByRelevance) ? orderByRelevance.length : 0;\n\n if (filterSetting === false) {\n if (orderByRelevanceLength) {\n highlightIndex = orderByRelevance[0];\n }\n } else {\n var sorted = [];\n\n for (var i = 0, choicesCount = choices.length; i < choicesCount; i++) {\n if (sortByRelevanceSetting && orderByRelevanceLength <= i) {\n break;\n }\n\n if (orderByRelevanceLength) {\n sorted.push(choices[orderByRelevance[i]]);\n } else {\n sorted.push(choices[i]);\n }\n }\n\n highlightIndex = 0;\n choices = sorted;\n }\n\n this.strippedChoices = choices;\n this.htEditor.loadData(pivot([choices]));\n this.updateDropdownHeight();\n this.flipDropdownIfNeeded();\n\n if (this.cellProperties.strict === true) {\n this.highlightBestMatchingChoice(highlightIndex);\n }\n\n this.hot.listen();\n setCaretPosition(this.TEXTAREA, pos, pos === endPos ? void 0 : endPos);\n }\n /**\n * Checks where is enough place to open editor.\n *\n * @private\n * @returns {boolean}\n */\n\n }, {\n key: \"flipDropdownIfNeeded\",\n value: function flipDropdownIfNeeded() {\n var textareaOffset = offset(this.TEXTAREA);\n var textareaHeight = outerHeight(this.TEXTAREA);\n var dropdownHeight = this.getDropdownHeight();\n var trimmingContainer = getTrimmingContainer(this.hot.view.wt.wtTable.TABLE);\n var trimmingContainerScrollTop = trimmingContainer.scrollTop;\n var headersHeight = outerHeight(this.hot.view.wt.wtTable.THEAD);\n var containerOffset = {\n row: 0,\n col: 0\n };\n\n if (trimmingContainer !== this.hot.rootWindow) {\n containerOffset = offset(trimmingContainer);\n }\n\n var spaceAbove = textareaOffset.top - containerOffset.top - headersHeight + trimmingContainerScrollTop;\n var spaceBelow = trimmingContainer.scrollHeight - spaceAbove - headersHeight - textareaHeight;\n var flipNeeded = dropdownHeight > spaceBelow && spaceAbove > spaceBelow;\n\n if (flipNeeded) {\n this.flipDropdown(dropdownHeight);\n } else {\n this.unflipDropdown();\n }\n\n this.limitDropdownIfNeeded(flipNeeded ? spaceAbove : spaceBelow, dropdownHeight);\n return flipNeeded;\n }\n /**\n * Checks if the internal table should generate scrollbar or could be rendered without it.\n *\n * @private\n * @param {number} spaceAvailable The free space as height definded in px available for dropdown list.\n * @param {number} dropdownHeight The dropdown height.\n */\n\n }, {\n key: \"limitDropdownIfNeeded\",\n value: function limitDropdownIfNeeded(spaceAvailable, dropdownHeight) {\n if (dropdownHeight > spaceAvailable) {\n var tempHeight = 0;\n var i = 0;\n var lastRowHeight = 0;\n var height = null;\n\n do {\n lastRowHeight = this.htEditor.getRowHeight(i) || this.htEditor.view.wt.wtSettings.settings.defaultRowHeight;\n tempHeight += lastRowHeight;\n i += 1;\n } while (tempHeight < spaceAvailable);\n\n height = tempHeight - lastRowHeight;\n\n if (this.htEditor.flipped) {\n this.htEditor.rootElement.style.top = \"\".concat(parseInt(this.htEditor.rootElement.style.top, 10) + dropdownHeight - height, \"px\"); // eslint-disable-line max-len\n }\n\n this.setDropdownHeight(tempHeight - lastRowHeight);\n }\n }\n /**\n * Configures editor to open it at the top.\n *\n * @private\n * @param {number} dropdownHeight The dropdown height.\n */\n\n }, {\n key: \"flipDropdown\",\n value: function flipDropdown(dropdownHeight) {\n var dropdownStyle = this.htEditor.rootElement.style;\n dropdownStyle.position = 'absolute';\n dropdownStyle.top = \"\".concat(-dropdownHeight, \"px\");\n this.htEditor.flipped = true;\n }\n /**\n * Configures editor to open it at the bottom.\n *\n * @private\n */\n\n }, {\n key: \"unflipDropdown\",\n value: function unflipDropdown() {\n var dropdownStyle = this.htEditor.rootElement.style;\n\n if (dropdownStyle.position === 'absolute') {\n dropdownStyle.position = '';\n dropdownStyle.top = '';\n }\n\n this.htEditor.flipped = void 0;\n }\n /**\n * Updates width and height of the internal Handsontable's instance.\n *\n * @private\n */\n\n }, {\n key: \"updateDropdownHeight\",\n value: function updateDropdownHeight() {\n var currentDropdownWidth = this.htEditor.getColWidth(0) + getScrollbarWidth(this.hot.rootDocument) + 2;\n var trimDropdown = this.cellProperties.trimDropdown;\n this.htEditor.updateSettings({\n height: this.getDropdownHeight(),\n width: trimDropdown ? void 0 : currentDropdownWidth\n });\n this.htEditor.view.wt.wtTable.alignOverlaysWithTrimmingContainer();\n }\n /**\n * Sets new height of the internal Handsontable's instance.\n *\n * @private\n * @param {number} height The new dropdown height.\n */\n\n }, {\n key: \"setDropdownHeight\",\n value: function setDropdownHeight(height) {\n this.htEditor.updateSettings({\n height: height\n });\n }\n /**\n * Creates new selection on specified row index, or deselects selected cells.\n *\n * @private\n * @param {number|undefined} index The visual row index.\n */\n\n }, {\n key: \"highlightBestMatchingChoice\",\n value: function highlightBestMatchingChoice(index) {\n if (typeof index === 'number') {\n this.htEditor.selectCell(index, 0, void 0, void 0, void 0, false);\n } else {\n this.htEditor.deselectCell();\n }\n }\n /**\n * Calculates and return the internal Handsontable's height.\n *\n * @private\n * @returns {number}\n */\n\n }, {\n key: \"getDropdownHeight\",\n value: function getDropdownHeight() {\n var firstRowHeight = this.htEditor.getInstance().getRowHeight(0) || 23;\n var visibleRows = this.cellProperties.visibleRows;\n return this.strippedChoices.length >= visibleRows ? visibleRows * firstRowHeight : this.strippedChoices.length * firstRowHeight + 8; // eslint-disable-line max-len\n }\n /**\n * Sanitizes value from potential dangerous tags.\n *\n * @private\n * @param {string} value The value to sanitize.\n * @returns {string}\n */\n\n }, {\n key: \"stripValueIfNeeded\",\n value: function stripValueIfNeeded(value) {\n return this.stripValuesIfNeeded([value])[0];\n }\n /**\n * Sanitizes an array of the values from potential dangerous tags.\n *\n * @private\n * @param {string[]} values The value to sanitize.\n * @returns {string[]}\n */\n\n }, {\n key: \"stripValuesIfNeeded\",\n value: function stripValuesIfNeeded(values) {\n var allowHtml = this.cellProperties.allowHtml;\n var stringifiedValues = arrayMap(values, function (value) {\n return stringify(value);\n });\n var strippedValues = arrayMap(stringifiedValues, function (value) {\n return allowHtml ? value : stripTags(value);\n });\n return strippedValues;\n }\n /**\n * Captures use of arrow down and up to control their behaviour.\n *\n * @private\n * @param {number} keyCode The keyboard keycode.\n * @returns {boolean}\n */\n\n }, {\n key: \"allowKeyEventPropagation\",\n value: function allowKeyEventPropagation(keyCode) {\n var selectedRange = this.htEditor.getSelectedRangeLast();\n var selected = {\n row: selectedRange ? selectedRange.from.row : -1\n };\n var allowed = false;\n\n if (keyCode === KEY_CODES.ARROW_DOWN && selected.row > 0 && selected.row < this.htEditor.countRows() - 1) {\n allowed = true;\n }\n\n if (keyCode === KEY_CODES.ARROW_UP && selected.row > -1) {\n allowed = true;\n }\n\n return allowed;\n }\n /**\n * OnBeforeKeyDown callback.\n *\n * @private\n * @param {KeyboardEvent} event The keyboard event object.\n */\n\n }, {\n key: \"onBeforeKeyDown\",\n value: function onBeforeKeyDown(event) {\n var _this5 = this;\n\n var priv = privatePool.get(this);\n priv.skipOne = false;\n\n if (isPrintableChar(event.keyCode) || event.keyCode === KEY_CODES.BACKSPACE || event.keyCode === KEY_CODES.DELETE || event.keyCode === KEY_CODES.INSERT) {\n var timeOffset = 0; // on ctl+c / cmd+c don't update suggestion list\n\n if (event.keyCode === KEY_CODES.C && (event.ctrlKey || event.metaKey)) {\n return;\n }\n\n if (!this.isOpened()) {\n timeOffset += 10;\n }\n\n if (this.htEditor) {\n this.hot._registerTimeout(function () {\n _this5.queryChoices(_this5.TEXTAREA.value);\n\n priv.skipOne = true;\n }, timeOffset);\n }\n }\n\n _get(_getPrototypeOf(AutocompleteEditor.prototype), \"onBeforeKeyDown\", this).call(this, event);\n }\n }], [{\n key: \"EDITOR_TYPE\",\n get: function get() {\n return EDITOR_TYPE;\n }\n }]);\n\n return AutocompleteEditor;\n}(HandsontableEditor);\n/**\n * Filters and sorts by relevance.\n *\n * @param {*} value The selected value.\n * @param {string[]} choices The list of available choices.\n * @param {boolean} caseSensitive Indicates if it's sorted by case.\n * @returns {number[]} Array of indexes in original choices array.\n */\n\nAutocompleteEditor.sortByRelevance = function (value, choices, caseSensitive) {\n var choicesRelevance = [];\n var result = [];\n var valueLength = value.length;\n var choicesCount = choices.length;\n var charsLeft;\n var currentItem;\n var i;\n var valueIndex;\n\n if (valueLength === 0) {\n for (i = 0; i < choicesCount; i++) {\n result.push(i);\n }\n\n return result;\n }\n\n for (i = 0; i < choicesCount; i++) {\n currentItem = stripTags(stringify(choices[i]));\n\n if (caseSensitive) {\n valueIndex = currentItem.indexOf(value);\n } else {\n valueIndex = currentItem.toLowerCase().indexOf(value.toLowerCase());\n }\n\n if (valueIndex !== -1) {\n charsLeft = currentItem.length - valueIndex - valueLength;\n choicesRelevance.push({\n baseIndex: i,\n index: valueIndex,\n charsLeft: charsLeft,\n value: currentItem\n });\n }\n }\n\n choicesRelevance.sort(function (a, b) {\n if (b.index === -1) {\n return -1;\n }\n\n if (a.index === -1) {\n return 1;\n }\n\n if (a.index < b.index) {\n return -1;\n } else if (b.index < a.index) {\n return 1;\n } else if (a.index === b.index) {\n if (a.charsLeft < b.charsLeft) {\n return -1;\n } else if (a.charsLeft > b.charsLeft) {\n return 1;\n }\n }\n\n return 0;\n });\n\n for (i = 0, choicesCount = choicesRelevance.length; i < choicesCount; i++) {\n result.push(choicesRelevance[i].baseIndex);\n }\n\n return result;\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { BaseEditor } from \"../baseEditor/index.mjs\";\nimport { hasClass } from \"../../helpers/dom/element.mjs\";\nexport var EDITOR_TYPE = 'checkbox';\n/**\n * @private\n * @class CheckboxEditor\n */\n\nexport var CheckboxEditor = /*#__PURE__*/function (_BaseEditor) {\n _inherits(CheckboxEditor, _BaseEditor);\n\n var _super = _createSuper(CheckboxEditor);\n\n function CheckboxEditor() {\n _classCallCheck(this, CheckboxEditor);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(CheckboxEditor, [{\n key: \"beginEditing\",\n value: function beginEditing(initialValue, event) {\n // Just some events connected with checkbox editor are delegated here. Some `keydown` events like `enter` and `space` key press\n // are handled inside `checkboxRenderer`. Some events come here from `editorManager`. Below `if` statement was created by author\n // for purpose of handling only `doubleclick` event which may be done on a cell with checkbox.\n if (event && event.type === 'mouseup') {\n var checkbox = this.TD.querySelector('input[type=\"checkbox\"]');\n\n if (!hasClass(checkbox, 'htBadValue')) {\n checkbox.click();\n }\n }\n }\n }, {\n key: \"finishEditing\",\n value: function finishEditing() {}\n }, {\n key: \"init\",\n value: function init() {}\n }, {\n key: \"open\",\n value: function open() {}\n }, {\n key: \"close\",\n value: function close() {}\n }, {\n key: \"getValue\",\n value: function getValue() {}\n }, {\n key: \"setValue\",\n value: function setValue() {}\n }, {\n key: \"focus\",\n value: function focus() {}\n }], [{\n key: \"EDITOR_TYPE\",\n get: function get() {\n return EDITOR_TYPE;\n }\n }]);\n\n return CheckboxEditor;\n}(BaseEditor);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport moment from 'moment';\nimport Pikaday from 'pikaday';\nimport { TextEditor } from \"../textEditor/index.mjs\";\nimport EventManager from \"../../eventManager.mjs\";\nimport { addClass, outerHeight } from \"../../helpers/dom/element.mjs\";\nimport { deepExtend } from \"../../helpers/object.mjs\";\nimport { isFunctionKey } from \"../../helpers/unicode.mjs\";\nexport var EDITOR_TYPE = 'date';\n/**\n * @private\n * @class DateEditor\n */\n\nexport var DateEditor = /*#__PURE__*/function (_TextEditor) {\n _inherits(DateEditor, _TextEditor);\n\n var _super = _createSuper(DateEditor);\n\n /**\n * @param {Core} hotInstance Handsontable instance.\n * @private\n */\n function DateEditor(hotInstance) {\n var _this;\n\n _classCallCheck(this, DateEditor);\n\n _this = _super.call(this, hotInstance); // TODO: Move this option to general settings\n\n _this.defaultDateFormat = 'DD/MM/YYYY';\n _this.isCellEdited = false;\n _this.parentDestroyed = false;\n return _this;\n }\n\n _createClass(DateEditor, [{\n key: \"init\",\n value: function init() {\n var _this2 = this;\n\n if (typeof moment !== 'function') {\n throw new Error('You need to include moment.js to your project.');\n }\n\n if (typeof Pikaday !== 'function') {\n throw new Error('You need to include Pikaday to your project.');\n }\n\n _get(_getPrototypeOf(DateEditor.prototype), \"init\", this).call(this);\n\n this.instance.addHook('afterDestroy', function () {\n _this2.parentDestroyed = true;\n\n _this2.destroyElements();\n });\n }\n /**\n * Create data picker instance.\n */\n\n }, {\n key: \"createElements\",\n value: function createElements() {\n _get(_getPrototypeOf(DateEditor.prototype), \"createElements\", this).call(this);\n\n this.datePicker = this.hot.rootDocument.createElement('DIV');\n this.datePickerStyle = this.datePicker.style;\n this.datePickerStyle.position = 'absolute';\n this.datePickerStyle.top = 0;\n this.datePickerStyle.left = 0;\n this.datePickerStyle.zIndex = 9999;\n addClass(this.datePicker, 'htDatepickerHolder');\n this.hot.rootDocument.body.appendChild(this.datePicker);\n this.$datePicker = new Pikaday(this.getDatePickerConfig());\n var eventManager = new EventManager(this);\n /**\n * Prevent recognizing clicking on datepicker as clicking outside of table.\n */\n\n eventManager.addEventListener(this.datePicker, 'mousedown', function (event) {\n return event.stopPropagation();\n });\n this.hideDatepicker();\n }\n /**\n * Destroy data picker instance.\n */\n\n }, {\n key: \"destroyElements\",\n value: function destroyElements() {\n var datePickerParentElement = this.datePicker.parentNode;\n this.$datePicker.destroy();\n\n if (datePickerParentElement) {\n datePickerParentElement.removeChild(this.datePicker);\n }\n }\n /**\n * Prepare editor to appear.\n *\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number|string} prop The column property (passed when datasource is an array of objects).\n * @param {HTMLTableCellElement} td The rendered cell element.\n * @param {*} value The rendered value.\n * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).\n */\n\n }, {\n key: \"prepare\",\n value: function prepare(row, col, prop, td, value, cellProperties) {\n _get(_getPrototypeOf(DateEditor.prototype), \"prepare\", this).call(this, row, col, prop, td, value, cellProperties);\n }\n /**\n * Open editor.\n *\n * @param {Event} [event=null] The event object.\n */\n\n }, {\n key: \"open\",\n value: function open() {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n _get(_getPrototypeOf(DateEditor.prototype), \"open\", this).call(this);\n\n this.showDatepicker(event);\n }\n /**\n * Close editor.\n */\n\n }, {\n key: \"close\",\n value: function close() {\n var _this3 = this;\n\n this._opened = false;\n\n this.instance._registerTimeout(function () {\n _this3.instance._refreshBorders();\n });\n\n _get(_getPrototypeOf(DateEditor.prototype), \"close\", this).call(this);\n }\n /**\n * Finishes editing and start saving or restoring process for editing cell or last selected range.\n *\n * @param {boolean} restoreOriginalValue If true, then closes editor without saving value from the editor into a cell.\n * @param {boolean} ctrlDown If true, then saveValue will save editor's value to each cell in the last selected range.\n */\n\n }, {\n key: \"finishEditing\",\n value: function finishEditing() {\n var restoreOriginalValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var ctrlDown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (restoreOriginalValue) {\n // pressed ESC, restore original value\n // var value = this.instance.getDataAtCell(this.row, this.col);\n var value = this.originalValue;\n\n if (value !== void 0) {\n this.setValue(value);\n }\n }\n\n this.hideDatepicker();\n\n _get(_getPrototypeOf(DateEditor.prototype), \"finishEditing\", this).call(this, restoreOriginalValue, ctrlDown);\n }\n /**\n * Show data picker.\n *\n * @param {Event} event The event object.\n */\n\n }, {\n key: \"showDatepicker\",\n value: function showDatepicker(event) {\n this.$datePicker.config(this.getDatePickerConfig());\n var offset = this.TD.getBoundingClientRect();\n var dateFormat = this.cellProperties.dateFormat || this.defaultDateFormat;\n var datePickerConfig = this.$datePicker.config();\n var isMouseDown = this.instance.view.isMouseDown();\n var isMeta = event ? isFunctionKey(event.keyCode) : false;\n var dateStr;\n this.datePickerStyle.top = \"\".concat(this.hot.rootWindow.pageYOffset + offset.top + outerHeight(this.TD), \"px\");\n this.datePickerStyle.left = \"\".concat(this.hot.rootWindow.pageXOffset + offset.left, \"px\");\n\n this.$datePicker._onInputFocus = function () {};\n\n datePickerConfig.format = dateFormat;\n\n if (this.originalValue) {\n dateStr = this.originalValue;\n\n if (moment(dateStr, dateFormat, true).isValid()) {\n this.$datePicker.setMoment(moment(dateStr, dateFormat), true);\n } // workaround for date/time cells - pikaday resets the cell value to 12:00 AM by default, this will overwrite the value.\n\n\n if (this.getValue() !== this.originalValue) {\n this.setValue(this.originalValue);\n }\n\n if (!isMeta && !isMouseDown) {\n this.setValue('');\n }\n } else if (this.cellProperties.defaultDate) {\n dateStr = this.cellProperties.defaultDate;\n datePickerConfig.defaultDate = dateStr;\n\n if (moment(dateStr, dateFormat, true).isValid()) {\n this.$datePicker.setMoment(moment(dateStr, dateFormat), true);\n }\n\n if (!isMeta && !isMouseDown) {\n this.setValue('');\n }\n } else {\n // if a default date is not defined, set a soft-default-date: display the current day and month in the\n // datepicker, but don't fill the editor input\n this.$datePicker.gotoToday();\n }\n\n this.datePickerStyle.display = 'block';\n this.$datePicker.show();\n }\n /**\n * Hide data picker.\n */\n\n }, {\n key: \"hideDatepicker\",\n value: function hideDatepicker() {\n this.datePickerStyle.display = 'none';\n this.$datePicker.hide();\n }\n /**\n * Get date picker options.\n *\n * @returns {object}\n */\n\n }, {\n key: \"getDatePickerConfig\",\n value: function getDatePickerConfig() {\n var _this4 = this;\n\n var htInput = this.TEXTAREA;\n var options = {};\n\n if (this.cellProperties && this.cellProperties.datePickerConfig) {\n deepExtend(options, this.cellProperties.datePickerConfig);\n }\n\n var origOnSelect = options.onSelect;\n var origOnClose = options.onClose;\n options.field = htInput;\n options.trigger = htInput;\n options.container = this.datePicker;\n options.bound = false;\n options.format = options.format || this.defaultDateFormat;\n options.reposition = options.reposition || false;\n\n options.onSelect = function (value) {\n var dateStr = value;\n\n if (!isNaN(dateStr.getTime())) {\n dateStr = moment(dateStr).format(_this4.cellProperties.dateFormat || _this4.defaultDateFormat);\n }\n\n _this4.setValue(dateStr);\n\n _this4.hideDatepicker();\n\n if (origOnSelect) {\n origOnSelect();\n }\n };\n\n options.onClose = function () {\n if (!_this4.parentDestroyed) {\n _this4.finishEditing(false);\n }\n\n if (origOnClose) {\n origOnClose();\n }\n };\n\n return options;\n }\n }], [{\n key: \"EDITOR_TYPE\",\n get: function get() {\n return EDITOR_TYPE;\n }\n }]);\n\n return DateEditor;\n}(TextEditor);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { AutocompleteEditor } from \"../autocompleteEditor/index.mjs\";\nimport Hooks from \"../../pluginHooks.mjs\";\nexport var EDITOR_TYPE = 'dropdown';\n/**\n * @private\n * @class DropdownEditor\n */\n\nexport var DropdownEditor = /*#__PURE__*/function (_AutocompleteEditor) {\n _inherits(DropdownEditor, _AutocompleteEditor);\n\n var _super = _createSuper(DropdownEditor);\n\n function DropdownEditor() {\n _classCallCheck(this, DropdownEditor);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(DropdownEditor, [{\n key: \"prepare\",\n value:\n /**\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number|string} prop The column property (passed when datasource is an array of objects).\n * @param {HTMLTableCellElement} td The rendered cell element.\n * @param {*} value The rendered value.\n * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).\n */\n function prepare(row, col, prop, td, value, cellProperties) {\n _get(_getPrototypeOf(DropdownEditor.prototype), \"prepare\", this).call(this, row, col, prop, td, value, cellProperties);\n\n this.cellProperties.filter = false;\n this.cellProperties.strict = true;\n }\n }], [{\n key: \"EDITOR_TYPE\",\n get: function get() {\n return EDITOR_TYPE;\n }\n }]);\n\n return DropdownEditor;\n}(AutocompleteEditor);\nHooks.getSingleton().add('beforeValidate', function (value, row, col) {\n var cellMeta = this.getCellMeta(row, this.propToCol(col));\n\n if (cellMeta.editor === DropdownEditor) {\n if (cellMeta.strict === void 0) {\n cellMeta.filter = false;\n cellMeta.strict = true;\n }\n }\n});","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { TextEditor } from \"../textEditor/index.mjs\";\nexport var EDITOR_TYPE = 'numeric';\n/**\n * @private\n * @class NumericEditor\n */\n\nexport var NumericEditor = /*#__PURE__*/function (_TextEditor) {\n _inherits(NumericEditor, _TextEditor);\n\n var _super = _createSuper(NumericEditor);\n\n function NumericEditor() {\n _classCallCheck(this, NumericEditor);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(NumericEditor, null, [{\n key: \"EDITOR_TYPE\",\n get: function get() {\n return EDITOR_TYPE;\n }\n }]);\n\n return NumericEditor;\n}(TextEditor);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { TextEditor } from \"../textEditor/index.mjs\";\nimport { empty } from \"../../helpers/dom/element.mjs\";\nexport var EDITOR_TYPE = 'password';\n/**\n * @private\n * @class PasswordEditor\n */\n\nexport var PasswordEditor = /*#__PURE__*/function (_TextEditor) {\n _inherits(PasswordEditor, _TextEditor);\n\n var _super = _createSuper(PasswordEditor);\n\n function PasswordEditor() {\n _classCallCheck(this, PasswordEditor);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(PasswordEditor, [{\n key: \"createElements\",\n value: function createElements() {\n _get(_getPrototypeOf(PasswordEditor.prototype), \"createElements\", this).call(this);\n\n this.TEXTAREA = this.hot.rootDocument.createElement('input');\n this.TEXTAREA.setAttribute('type', 'password');\n this.TEXTAREA.setAttribute('data-hot-input', ''); // Makes the element recognizable by Hot as its own component's element.\n\n this.TEXTAREA.className = 'handsontableInput';\n this.textareaStyle = this.TEXTAREA.style;\n this.textareaStyle.width = 0;\n this.textareaStyle.height = 0;\n empty(this.TEXTAREA_PARENT);\n this.TEXTAREA_PARENT.appendChild(this.TEXTAREA);\n }\n }], [{\n key: \"EDITOR_TYPE\",\n get: function get() {\n return EDITOR_TYPE;\n }\n }]);\n\n return PasswordEditor;\n}(TextEditor);","import \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { BaseEditor, EDITOR_STATE } from \"../baseEditor/index.mjs\";\nimport { addClass, empty, fastInnerHTML, getComputedStyle, getCssTransform, hasClass, offset, outerHeight, outerWidth, removeClass, resetCssTransform } from \"../../helpers/dom/element.mjs\";\nimport { stopImmediatePropagation } from \"../../helpers/dom/event.mjs\";\nimport { objectEach } from \"../../helpers/object.mjs\";\nimport { KEY_CODES } from \"../../helpers/unicode.mjs\";\nvar EDITOR_VISIBLE_CLASS_NAME = 'ht_editor_visible';\nexport var EDITOR_TYPE = 'select';\n/**\n * @private\n * @class SelectEditor\n */\n\nexport var SelectEditor = /*#__PURE__*/function (_BaseEditor) {\n _inherits(SelectEditor, _BaseEditor);\n\n var _super = _createSuper(SelectEditor);\n\n function SelectEditor() {\n _classCallCheck(this, SelectEditor);\n\n return _super.apply(this, arguments);\n }\n\n _createClass(SelectEditor, [{\n key: \"init\",\n value:\n /**\n * Initializes editor instance, DOM Element and mount hooks.\n */\n function init() {\n this.select = this.hot.rootDocument.createElement('SELECT');\n addClass(this.select, 'htSelectEditor');\n this.select.style.display = 'none';\n this.hot.rootElement.appendChild(this.select);\n this.registerHooks();\n }\n /**\n * Returns select's value.\n *\n * @returns {*}\n */\n\n }, {\n key: \"getValue\",\n value: function getValue() {\n return this.select.value;\n }\n /**\n * Sets value in the select element.\n *\n * @param {*} value A new select's value.\n */\n\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n this.select.value = value;\n }\n /**\n * Opens the editor and adjust its size.\n */\n\n }, {\n key: \"open\",\n value: function open() {\n var _this = this;\n\n this._opened = true;\n this.refreshDimensions();\n this.select.style.display = '';\n this.addHook('beforeKeyDown', function () {\n return _this.onBeforeKeyDown();\n });\n }\n /**\n * Closes the editor.\n */\n\n }, {\n key: \"close\",\n value: function close() {\n this._opened = false;\n this.select.style.display = 'none';\n\n if (hasClass(this.select, EDITOR_VISIBLE_CLASS_NAME)) {\n removeClass(this.select, EDITOR_VISIBLE_CLASS_NAME);\n }\n\n this.clearHooks();\n }\n /**\n * Sets focus state on the select element.\n */\n\n }, {\n key: \"focus\",\n value: function focus() {\n this.select.focus();\n }\n /**\n * Binds hooks to refresh editor's size after scrolling of the viewport or resizing of columns/rows.\n *\n * @private\n */\n\n }, {\n key: \"registerHooks\",\n value: function registerHooks() {\n var _this2 = this;\n\n this.addHook('afterScrollHorizontally', function () {\n return _this2.refreshDimensions();\n });\n this.addHook('afterScrollVertically', function () {\n return _this2.refreshDimensions();\n });\n this.addHook('afterColumnResize', function () {\n return _this2.refreshDimensions();\n });\n this.addHook('afterRowResize', function () {\n return _this2.refreshDimensions();\n });\n }\n /**\n * Prepares editor's meta data and a list of available options.\n *\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number|string} prop The column property (passed when datasource is an array of objects).\n * @param {HTMLTableCellElement} td The rendered cell element.\n * @param {*} value The rendered value.\n * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).\n */\n\n }, {\n key: \"prepare\",\n value: function prepare(row, col, prop, td, value, cellProperties) {\n var _this3 = this;\n\n _get(_getPrototypeOf(SelectEditor.prototype), \"prepare\", this).call(this, row, col, prop, td, value, cellProperties);\n\n var selectOptions = this.cellProperties.selectOptions;\n var options;\n\n if (typeof selectOptions === 'function') {\n options = this.prepareOptions(selectOptions(this.row, this.col, this.prop));\n } else {\n options = this.prepareOptions(selectOptions);\n }\n\n empty(this.select);\n objectEach(options, function (optionValue, key) {\n var optionElement = _this3.hot.rootDocument.createElement('OPTION');\n\n optionElement.value = key;\n fastInnerHTML(optionElement, optionValue);\n\n _this3.select.appendChild(optionElement);\n });\n }\n /**\n * Creates consistent list of available options.\n *\n * @private\n * @param {Array|object} optionsToPrepare The list of the values to render in the select eleemnt.\n * @returns {object}\n */\n\n }, {\n key: \"prepareOptions\",\n value: function prepareOptions(optionsToPrepare) {\n var preparedOptions = {};\n\n if (Array.isArray(optionsToPrepare)) {\n for (var i = 0, len = optionsToPrepare.length; i < len; i++) {\n preparedOptions[optionsToPrepare[i]] = optionsToPrepare[i];\n }\n } else if (_typeof(optionsToPrepare) === 'object') {\n preparedOptions = optionsToPrepare;\n }\n\n return preparedOptions;\n }\n /**\n * Refreshes editor's value using source data.\n *\n * @private\n */\n\n }, {\n key: \"refreshValue\",\n value: function refreshValue() {\n var sourceData = this.hot.getSourceDataAtCell(this.row, this.prop);\n this.originalValue = sourceData;\n this.setValue(sourceData);\n this.refreshDimensions();\n }\n /**\n * Refreshes editor's size and position.\n *\n * @private\n */\n\n }, {\n key: \"refreshDimensions\",\n value: function refreshDimensions() {\n if (this.state !== EDITOR_STATE.EDITING) {\n return;\n }\n\n this.TD = this.getEditedCell(); // TD is outside of the viewport.\n\n if (!this.TD) {\n this.close();\n return;\n }\n\n var wtOverlays = this.hot.view.wt.wtOverlays;\n var currentOffset = offset(this.TD);\n var containerOffset = offset(this.hot.rootElement);\n var scrollableContainer = wtOverlays.scrollableElement;\n var editorSection = this.checkEditorSection();\n var width = outerWidth(this.TD) + 1;\n var height = outerHeight(this.TD) + 1;\n var editTop = currentOffset.top - containerOffset.top - 1 - (scrollableContainer.scrollTop || 0);\n var editLeft = currentOffset.left - containerOffset.left - 1 - (scrollableContainer.scrollLeft || 0);\n var cssTransformOffset;\n\n switch (editorSection) {\n case 'top':\n cssTransformOffset = getCssTransform(wtOverlays.topOverlay.clone.wtTable.holder.parentNode);\n break;\n\n case 'left':\n cssTransformOffset = getCssTransform(wtOverlays.leftOverlay.clone.wtTable.holder.parentNode);\n break;\n\n case 'top-left-corner':\n cssTransformOffset = getCssTransform(wtOverlays.topLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n\n case 'bottom-left-corner':\n cssTransformOffset = getCssTransform(wtOverlays.bottomLeftCornerOverlay.clone.wtTable.holder.parentNode);\n break;\n\n case 'bottom':\n cssTransformOffset = getCssTransform(wtOverlays.bottomOverlay.clone.wtTable.holder.parentNode);\n break;\n\n default:\n break;\n }\n\n var renderableRow = this.hot.rowIndexMapper.getRenderableFromVisualIndex(this.row);\n var renderableColumn = this.hot.columnIndexMapper.getRenderableFromVisualIndex(this.col);\n var nrOfRenderableRowIndexes = this.hot.rowIndexMapper.getRenderableIndexesLength();\n var firstRowIndexOfTheBottomOverlay = nrOfRenderableRowIndexes - this.hot.view.wt.getSetting('fixedRowsBottom');\n\n if (renderableRow <= 0 || renderableRow === firstRowIndexOfTheBottomOverlay) {\n editTop += 1;\n }\n\n if (renderableColumn <= 0) {\n editLeft += 1;\n }\n\n var selectStyle = this.select.style;\n\n if (cssTransformOffset && cssTransformOffset !== -1) {\n selectStyle[cssTransformOffset[0]] = cssTransformOffset[1];\n } else {\n resetCssTransform(this.select);\n }\n\n var cellComputedStyle = getComputedStyle(this.TD, this.hot.rootWindow);\n\n if (parseInt(cellComputedStyle.borderTopWidth, 10) > 0) {\n height -= 1;\n }\n\n if (parseInt(cellComputedStyle.borderLeftWidth, 10) > 0) {\n width -= 1;\n }\n\n selectStyle.height = \"\".concat(height, \"px\");\n selectStyle.minWidth = \"\".concat(width, \"px\");\n selectStyle.top = \"\".concat(editTop, \"px\");\n selectStyle.left = \"\".concat(editLeft, \"px\");\n selectStyle.margin = '0px';\n addClass(this.select, EDITOR_VISIBLE_CLASS_NAME);\n }\n /**\n * OnBeforeKeyDown callback.\n *\n * @private\n */\n\n }, {\n key: \"onBeforeKeyDown\",\n value: function onBeforeKeyDown() {\n var previousOptionIndex = this.select.selectedIndex - 1;\n var nextOptionIndex = this.select.selectedIndex + 1;\n\n switch (event.keyCode) {\n case KEY_CODES.ARROW_UP:\n if (previousOptionIndex >= 0) {\n this.select[previousOptionIndex].selected = true;\n }\n\n stopImmediatePropagation(event);\n event.preventDefault();\n break;\n\n case KEY_CODES.ARROW_DOWN:\n if (nextOptionIndex <= this.select.length - 1) {\n this.select[nextOptionIndex].selected = true;\n }\n\n stopImmediatePropagation(event);\n event.preventDefault();\n break;\n\n default:\n break;\n }\n }\n }], [{\n key: \"EDITOR_TYPE\",\n get: function get() {\n return EDITOR_TYPE;\n }\n }]);\n\n return SelectEditor;\n}(BaseEditor);","import { baseRenderer } from \"../baseRenderer/index.mjs\";\nimport { fastInnerHTML } from \"../../helpers/dom/element.mjs\";\nexport var RENDERER_TYPE = 'html';\n/**\n * @private\n * @param {Core} instance The Handsontable instance.\n * @param {HTMLTableCellElement} TD The rendered cell element.\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number|string} prop The column property (passed when datasource is an array of objects).\n * @param {*} value The rendered value.\n * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).\n */\n\nexport function htmlRenderer(instance, TD, row, col, prop, value, cellProperties) {\n baseRenderer.apply(this, [instance, TD, row, col, prop, value, cellProperties]);\n fastInnerHTML(TD, value === null || value === void 0 ? '' : value, false);\n}\nhtmlRenderer.RENDERER_TYPE = RENDERER_TYPE;","import { htmlRenderer } from \"../htmlRenderer/index.mjs\";\nimport { textRenderer } from \"../textRenderer/index.mjs\";\nimport { CellCoords } from \"../../3rdparty/walkontable/src/index.mjs\";\nimport EventManager from \"../../eventManager.mjs\";\nimport { addClass, hasClass } from \"../../helpers/dom/element.mjs\";\nexport var RENDERER_TYPE = 'autocomplete';\n/**\n * Autocomplete renderer.\n *\n * @private\n * @param {Core} instance The Handsontable instance.\n * @param {HTMLTableCellElement} TD The rendered cell element.\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number|string} prop The column property (passed when datasource is an array of objects).\n * @param {*} value The rendered value.\n * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).\n */\n\nexport function autocompleteRenderer(instance, TD, row, col, prop, value, cellProperties) {\n var rootDocument = instance.rootDocument;\n var rendererFunc = cellProperties.allowHtml ? htmlRenderer : textRenderer;\n var ARROW = rootDocument.createElement('DIV');\n ARROW.className = 'htAutocompleteArrow';\n ARROW.appendChild(rootDocument.createTextNode(String.fromCharCode(9660)));\n rendererFunc.apply(this, [instance, TD, row, col, prop, value, cellProperties]);\n\n if (!TD.firstChild) {\n // http://jsperf.com/empty-node-if-needed\n // otherwise empty fields appear borderless in demo/renderers.html (IE)\n TD.appendChild(rootDocument.createTextNode(String.fromCharCode(160))); // workaround for https://github.com/handsontable/handsontable/issues/1946\n // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips\n }\n\n TD.insertBefore(ARROW, TD.firstChild);\n addClass(TD, 'htAutocomplete');\n\n if (!instance.acArrowListener) {\n var eventManager = new EventManager(instance); // not very elegant but easy and fast\n\n instance.acArrowListener = function (event) {\n if (hasClass(event.target, 'htAutocompleteArrow')) {\n instance.view.wt.getSetting('onCellDblClick', null, new CellCoords(row, col), TD);\n }\n };\n\n eventManager.addEventListener(instance.rootElement, 'mousedown', instance.acArrowListener); // We need to unbind the listener after the table has been destroyed\n\n instance.addHookOnce('afterDestroy', function () {\n eventManager.destroy();\n });\n }\n}\nautocompleteRenderer.RENDERER_TYPE = RENDERER_TYPE;","import \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/es.weak-map.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.string.includes.js\";\nimport \"core-js/modules/es.regexp.to-string.js\";\nimport \"core-js/modules/web.timers.js\";\nimport { baseRenderer } from \"../baseRenderer/index.mjs\";\nimport EventManager from \"../../eventManager.mjs\";\nimport { empty, addClass } from \"../../helpers/dom/element.mjs\";\nimport { stopImmediatePropagation, isImmediatePropagationStopped } from \"../../helpers/dom/event.mjs\";\nimport { partial } from \"../../helpers/function.mjs\";\nimport { equalsIgnoreCase } from \"../../helpers/string.mjs\";\nimport { isEmpty } from \"../../helpers/mixed.mjs\";\nimport { isKey } from \"../../helpers/unicode.mjs\";\nimport Hooks from \"../../pluginHooks.mjs\";\nvar isListeningKeyDownEvent = new WeakMap();\nvar isCheckboxListenerAdded = new WeakMap();\nvar BAD_VALUE_CLASS = 'htBadValue';\nvar ATTR_ROW = 'data-row';\nvar ATTR_COLUMN = 'data-col';\nexport var RENDERER_TYPE = 'checkbox';\nHooks.getSingleton().add('modifyAutoColumnSizeSeed', function (bundleSeed, cellMeta, cellValue) {\n var label = cellMeta.label,\n type = cellMeta.type,\n row = cellMeta.row,\n column = cellMeta.column,\n prop = cellMeta.prop;\n\n if (type !== RENDERER_TYPE) {\n return;\n }\n\n if (label) {\n var labelValue = label.value,\n labelProperty = label.property;\n var labelText = cellValue;\n\n if (labelValue) {\n labelText = typeof labelValue === 'function' ? labelValue(row, column, prop, cellValue) : labelValue;\n } else if (labelProperty) {\n var labelData = this.getDataAtRowProp(row, labelProperty);\n labelText = labelData !== null ? labelData : cellValue;\n }\n\n bundleSeed = labelText;\n }\n\n return bundleSeed;\n});\n/**\n * Checkbox renderer.\n *\n * @private\n * @param {Core} instance The Handsontable instance.\n * @param {HTMLTableCellElement} TD The rendered cell element.\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number|string} prop The column property (passed when datasource is an array of objects).\n * @param {*} value The rendered value.\n * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).\n */\n\nexport function checkboxRenderer(instance, TD, row, col, prop, value, cellProperties) {\n var rootDocument = instance.rootDocument;\n baseRenderer.apply(this, [instance, TD, row, col, prop, value, cellProperties]);\n registerEvents(instance);\n var input = createInput(rootDocument);\n var labelOptions = cellProperties.label;\n var badValue = false;\n\n if (typeof cellProperties.checkedTemplate === 'undefined') {\n cellProperties.checkedTemplate = true;\n }\n\n if (typeof cellProperties.uncheckedTemplate === 'undefined') {\n cellProperties.uncheckedTemplate = false;\n }\n\n empty(TD); // TODO identify under what circumstances this line can be removed\n\n if (value === cellProperties.checkedTemplate || equalsIgnoreCase(value, cellProperties.checkedTemplate)) {\n input.checked = true;\n } else if (value === cellProperties.uncheckedTemplate || equalsIgnoreCase(value, cellProperties.uncheckedTemplate)) {\n input.checked = false;\n } else if (isEmpty(value)) {\n // default value\n addClass(input, 'noValue');\n } else {\n input.style.display = 'none';\n addClass(input, BAD_VALUE_CLASS);\n badValue = true;\n }\n\n input.setAttribute(ATTR_ROW, row);\n input.setAttribute(ATTR_COLUMN, col);\n\n if (!badValue && labelOptions) {\n var labelText = '';\n\n if (labelOptions.value) {\n labelText = typeof labelOptions.value === 'function' ? labelOptions.value.call(this, row, col, prop, value) : labelOptions.value;\n } else if (labelOptions.property) {\n var labelValue = instance.getDataAtRowProp(row, labelOptions.property);\n labelText = labelValue !== null ? labelValue : '';\n }\n\n var label = createLabel(rootDocument, labelText, labelOptions.separated !== true);\n\n if (labelOptions.position === 'before') {\n if (labelOptions.separated) {\n TD.appendChild(label);\n TD.appendChild(input);\n } else {\n label.appendChild(input);\n input = label;\n }\n } else if (!labelOptions.position || labelOptions.position === 'after') {\n if (labelOptions.separated) {\n TD.appendChild(input);\n TD.appendChild(label);\n } else {\n label.insertBefore(input, label.firstChild);\n input = label;\n }\n }\n }\n\n if (!labelOptions || labelOptions && !labelOptions.separated) {\n TD.appendChild(input);\n }\n\n if (badValue) {\n TD.appendChild(rootDocument.createTextNode('#bad-value#'));\n }\n\n if (!isListeningKeyDownEvent.has(instance)) {\n isListeningKeyDownEvent.set(instance, true);\n instance.addHook('beforeKeyDown', onBeforeKeyDown);\n }\n /**\n * On before key down DOM listener.\n *\n * @private\n * @param {Event} event The keyboard event object.\n */\n\n\n function onBeforeKeyDown(event) {\n var toggleKeys = 'SPACE|ENTER';\n var switchOffKeys = 'DELETE|BACKSPACE';\n var isKeyCode = partial(isKey, event.keyCode);\n\n if (!instance.getSettings().enterBeginsEditing && isKeyCode('ENTER')) {\n return;\n }\n\n if (isKeyCode(\"\".concat(toggleKeys, \"|\").concat(switchOffKeys)) && !isImmediatePropagationStopped(event)) {\n eachSelectedCheckboxCell(function () {\n stopImmediatePropagation(event);\n event.preventDefault();\n });\n }\n\n if (isKeyCode(toggleKeys)) {\n changeSelectedCheckboxesState();\n }\n\n if (isKeyCode(switchOffKeys)) {\n changeSelectedCheckboxesState(true);\n }\n }\n /**\n * Change checkbox checked property.\n *\n * @private\n * @param {boolean} [uncheckCheckbox=false] The new \"checked\" state for the checkbox elements.\n */\n\n\n function changeSelectedCheckboxesState() {\n var uncheckCheckbox = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n var selRange = instance.getSelectedRange();\n\n if (!selRange) {\n return;\n }\n\n for (var key = 0; key < selRange.length; key++) {\n var _selRange$key$getTopL = selRange[key].getTopLeftCorner(),\n startRow = _selRange$key$getTopL.row,\n startColumn = _selRange$key$getTopL.col;\n\n var _selRange$key$getBott = selRange[key].getBottomRightCorner(),\n endRow = _selRange$key$getBott.row,\n endColumn = _selRange$key$getBott.col;\n\n var changes = [];\n\n for (var visualRow = startRow; visualRow <= endRow; visualRow += 1) {\n for (var visualColumn = startColumn; visualColumn <= endColumn; visualColumn += 1) {\n var cachedCellProperties = instance.getCellMeta(visualRow, visualColumn);\n\n if (cachedCellProperties.type !== 'checkbox') {\n return;\n }\n /* eslint-disable no-continue */\n\n\n if (cachedCellProperties.readOnly === true) {\n continue;\n }\n\n if (typeof cachedCellProperties.checkedTemplate === 'undefined') {\n cachedCellProperties.checkedTemplate = true;\n }\n\n if (typeof cachedCellProperties.uncheckedTemplate === 'undefined') {\n cachedCellProperties.uncheckedTemplate = false;\n }\n\n var dataAtCell = instance.getDataAtCell(visualRow, visualColumn);\n\n if (uncheckCheckbox === false) {\n if ([cachedCellProperties.checkedTemplate, cachedCellProperties.checkedTemplate.toString()].includes(dataAtCell)) {\n // eslint-disable-line max-len\n changes.push([visualRow, visualColumn, cachedCellProperties.uncheckedTemplate]);\n } else if ([cachedCellProperties.uncheckedTemplate, cachedCellProperties.uncheckedTemplate.toString(), null, void 0].includes(dataAtCell)) {\n // eslint-disable-line max-len\n changes.push([visualRow, visualColumn, cachedCellProperties.checkedTemplate]);\n }\n } else {\n changes.push([visualRow, visualColumn, cachedCellProperties.uncheckedTemplate]);\n }\n }\n }\n\n if (changes.length > 0) {\n instance.setDataAtCell(changes);\n }\n }\n }\n /**\n * Call callback for each found selected cell with checkbox type.\n *\n * @private\n * @param {Function} callback The callback function.\n */\n\n\n function eachSelectedCheckboxCell(callback) {\n var selRange = instance.getSelectedRange();\n\n if (!selRange) {\n return;\n }\n\n for (var key = 0; key < selRange.length; key++) {\n var topLeft = selRange[key].getTopLeftCorner();\n var bottomRight = selRange[key].getBottomRightCorner();\n\n for (var visualRow = topLeft.row; visualRow <= bottomRight.row; visualRow++) {\n for (var visualColumn = topLeft.col; visualColumn <= bottomRight.col; visualColumn++) {\n var cachedCellProperties = instance.getCellMeta(visualRow, visualColumn);\n\n if (cachedCellProperties.type !== 'checkbox') {\n return;\n }\n\n var cell = instance.getCell(visualRow, visualColumn);\n\n if (cell === null || cell === void 0) {\n callback(visualRow, visualColumn, cachedCellProperties);\n } else {\n var checkboxes = cell.querySelectorAll('input[type=checkbox]');\n\n if (checkboxes.length > 0 && !cachedCellProperties.readOnly) {\n callback(checkboxes);\n }\n }\n }\n }\n }\n }\n}\ncheckboxRenderer.RENDERER_TYPE = RENDERER_TYPE;\n/**\n * Register checkbox listeners.\n *\n * @param {Core} instance The Handsontable instance.\n * @returns {EventManager}\n */\n\nfunction registerEvents(instance) {\n var eventManager = isCheckboxListenerAdded.get(instance);\n\n if (!eventManager) {\n var rootElement = instance.rootElement;\n eventManager = new EventManager(instance);\n eventManager.addEventListener(rootElement, 'click', function (event) {\n return onClick(event, instance);\n });\n eventManager.addEventListener(rootElement, 'mouseup', function (event) {\n return onMouseUp(event, instance);\n });\n eventManager.addEventListener(rootElement, 'change', function (event) {\n return onChange(event, instance);\n });\n isCheckboxListenerAdded.set(instance, eventManager);\n }\n\n return eventManager;\n}\n/**\n * Create input element.\n *\n * @param {Document} rootDocument The document owner.\n * @returns {Node}\n */\n\n\nfunction createInput(rootDocument) {\n var input = rootDocument.createElement('input');\n input.className = 'htCheckboxRendererInput';\n input.type = 'checkbox';\n input.setAttribute('autocomplete', 'off');\n input.setAttribute('tabindex', '-1');\n return input.cloneNode(false);\n}\n/**\n * Create label element.\n *\n * @param {Document} rootDocument The document owner.\n * @param {string} text The label text.\n * @param {boolean} fullWidth Determines whether label should have full width.\n * @returns {Node}\n */\n\n\nfunction createLabel(rootDocument, text, fullWidth) {\n var label = rootDocument.createElement('label');\n label.className = \"htCheckboxRendererLabel \".concat(fullWidth ? 'fullWidth' : '');\n label.appendChild(rootDocument.createTextNode(text));\n return label.cloneNode(true);\n}\n/**\n * `mouseup` callback.\n *\n * @private\n * @param {Event} event `mouseup` event.\n * @param {Core} instance The Handsontable instance.\n */\n\n\nfunction onMouseUp(event, instance) {\n var target = event.target;\n\n if (!isCheckboxInput(target)) {\n return;\n }\n\n if (!target.hasAttribute(ATTR_ROW) || !target.hasAttribute(ATTR_COLUMN)) {\n return;\n }\n\n setTimeout(instance.listen, 10);\n}\n/**\n * `click` callback.\n *\n * @private\n * @param {MouseEvent} event `click` event.\n * @param {Core} instance The Handsontable instance.\n */\n\n\nfunction onClick(event, instance) {\n var target = event.target;\n\n if (!isCheckboxInput(target)) {\n return;\n }\n\n if (!target.hasAttribute(ATTR_ROW) || !target.hasAttribute(ATTR_COLUMN)) {\n return;\n }\n\n var row = parseInt(target.getAttribute(ATTR_ROW), 10);\n var col = parseInt(target.getAttribute(ATTR_COLUMN), 10);\n var cellProperties = instance.getCellMeta(row, col);\n\n if (cellProperties.readOnly) {\n event.preventDefault();\n }\n}\n/**\n * `change` callback.\n *\n * @param {Event} event `change` event.\n * @param {Core} instance The Handsontable instance.\n */\n\n\nfunction onChange(event, instance) {\n var target = event.target;\n\n if (!isCheckboxInput(target)) {\n return;\n }\n\n if (!target.hasAttribute(ATTR_ROW) || !target.hasAttribute(ATTR_COLUMN)) {\n return;\n }\n\n var row = parseInt(target.getAttribute(ATTR_ROW), 10);\n var col = parseInt(target.getAttribute(ATTR_COLUMN), 10);\n var cellProperties = instance.getCellMeta(row, col);\n\n if (!cellProperties.readOnly) {\n var newCheckboxValue = null;\n\n if (event.target.checked) {\n newCheckboxValue = cellProperties.uncheckedTemplate === void 0 ? true : cellProperties.checkedTemplate;\n } else {\n newCheckboxValue = cellProperties.uncheckedTemplate === void 0 ? false : cellProperties.uncheckedTemplate;\n }\n\n instance.setDataAtCell(row, col, newCheckboxValue);\n }\n}\n/**\n * Check if the provided element is the checkbox input.\n *\n * @private\n * @param {HTMLElement} element The element in question.\n * @returns {boolean}\n */\n\n\nfunction isCheckboxInput(element) {\n return element.tagName === 'INPUT' && element.getAttribute('type') === 'checkbox';\n}","import \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.split.js\";\nimport \"core-js/modules/es.string.replace.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.array.join.js\";\nimport numbro from 'numbro';\nimport { textRenderer } from \"../textRenderer/index.mjs\";\nimport { isNumeric } from \"../../helpers/number.mjs\";\nexport var RENDERER_TYPE = 'numeric';\n/**\n * Numeric cell renderer.\n *\n * @private\n * @param {Core} instance The Handsontable instance.\n * @param {HTMLTableCellElement} TD The rendered cell element.\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number|string} prop The column property (passed when datasource is an array of objects).\n * @param {*} value The rendered value.\n * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).\n */\n\nexport function numericRenderer(instance, TD, row, col, prop, value, cellProperties) {\n var newValue = value;\n\n if (isNumeric(newValue)) {\n var numericFormat = cellProperties.numericFormat;\n var cellCulture = numericFormat && numericFormat.culture || '-';\n var cellFormatPattern = numericFormat && numericFormat.pattern;\n var className = cellProperties.className || '';\n var classArr = className.length ? className.split(' ') : [];\n\n if (typeof cellCulture !== 'undefined' && !numbro.languages()[cellCulture]) {\n var shortTag = cellCulture.replace('-', '');\n var langData = numbro.allLanguages ? numbro.allLanguages[cellCulture] : numbro[shortTag];\n\n if (langData) {\n numbro.registerLanguage(langData);\n }\n }\n\n numbro.setLanguage(cellCulture);\n newValue = numbro(newValue).format(cellFormatPattern || '0');\n\n if (classArr.indexOf('htLeft') < 0 && classArr.indexOf('htCenter') < 0 && classArr.indexOf('htRight') < 0 && classArr.indexOf('htJustify') < 0) {\n classArr.push('htRight');\n }\n\n if (classArr.indexOf('htNumeric') < 0) {\n classArr.push('htNumeric');\n }\n\n cellProperties.className = classArr.join(' ');\n }\n\n textRenderer(instance, TD, row, col, prop, newValue, cellProperties);\n}\nnumericRenderer.RENDERER_TYPE = RENDERER_TYPE;","import { textRenderer } from \"../textRenderer/index.mjs\";\nimport { fastInnerHTML } from \"../../helpers/dom/element.mjs\";\nimport { rangeEach } from \"../../helpers/number.mjs\";\nexport var RENDERER_TYPE = 'password';\n/**\n * @private\n * @param {Core} instance The Handsontable instance.\n * @param {HTMLTableCellElement} TD The rendered cell element.\n * @param {number} row The visual row index.\n * @param {number} col The visual column index.\n * @param {number|string} prop The column property (passed when datasource is an array of objects).\n * @param {*} value The rendered value.\n * @param {object} cellProperties The cell meta object ({@see Core#getCellMeta}).\n */\n\nexport function passwordRenderer(instance, TD, row, col, prop, value, cellProperties) {\n textRenderer.apply(this, [instance, TD, row, col, prop, value, cellProperties]);\n var hashLength = cellProperties.hashLength || TD.innerHTML.length;\n var hashSymbol = cellProperties.hashSymbol || '*';\n var hash = '';\n rangeEach(hashLength - 1, function () {\n hash += hashSymbol;\n });\n fastInnerHTML(TD, hash);\n}\npasswordRenderer.RENDERER_TYPE = RENDERER_TYPE;","export var VALIDATOR_TYPE = 'autocomplete';\n/**\n * The Autocomplete cell validator.\n *\n * @private\n * @param {*} value Value of edited cell.\n * @param {Function} callback Callback called with validation result.\n */\n\nexport function autocompleteValidator(value, callback) {\n var valueToValidate = value;\n\n if (valueToValidate === null || valueToValidate === void 0) {\n valueToValidate = '';\n }\n\n if (this.allowEmpty && valueToValidate === '') {\n callback(true);\n return;\n }\n\n if (this.strict && this.source) {\n if (typeof this.source === 'function') {\n this.source(valueToValidate, process(valueToValidate, callback));\n } else {\n process(valueToValidate, callback)(this.source);\n }\n } else {\n callback(true);\n }\n}\nautocompleteValidator.VALIDATOR_TYPE = VALIDATOR_TYPE;\n/**\n * Function responsible for validation of autocomplete value.\n *\n * @param {*} value Value of edited cell.\n * @param {Function} callback Callback called with validation result.\n * @returns {Function}\n */\n\nfunction process(value, callback) {\n var originalVal = value;\n return function (source) {\n var found = false;\n\n for (var s = 0, slen = source.length; s < slen; s++) {\n if (originalVal === source[s]) {\n found = true; // perfect match\n\n break;\n }\n }\n\n callback(found);\n };\n}","import \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.search.js\";\nimport moment from 'moment';\nimport { getEditorInstance } from \"../../editors/registry.mjs\";\nimport { EDITOR_TYPE as DATE_EDITOR_TYPE } from \"../../editors/dateEditor/index.mjs\";\nimport { getNormalizedDate } from \"../../helpers/date.mjs\";\nexport var VALIDATOR_TYPE = 'date';\n/**\n * The Date cell validator.\n *\n * @private\n * @param {*} value Value of edited cell.\n * @param {Function} callback Callback called with validation result.\n */\n\nexport function dateValidator(value, callback) {\n var dateEditor = getEditorInstance(DATE_EDITOR_TYPE, this.instance);\n var valueToValidate = value;\n var valid = true;\n\n if (valueToValidate === null || valueToValidate === void 0) {\n valueToValidate = '';\n }\n\n var isValidFormat = moment(valueToValidate, this.dateFormat || dateEditor.defaultDateFormat, true).isValid();\n var isValidDate = moment(new Date(valueToValidate)).isValid() || isValidFormat;\n\n if (this.allowEmpty && valueToValidate === '') {\n isValidDate = true;\n isValidFormat = true;\n }\n\n if (!isValidDate) {\n valid = false;\n }\n\n if (!isValidDate && isValidFormat) {\n valid = true;\n }\n\n if (isValidDate && !isValidFormat) {\n if (this.correctFormat === true) {\n // if format correction is enabled\n var correctedValue = correctFormat(valueToValidate, this.dateFormat);\n var row = this.instance.toVisualRow(this.row);\n var column = this.instance.toVisualColumn(this.col);\n this.instance.setDataAtCell(row, column, correctedValue, 'dateValidator');\n valid = true;\n } else {\n valid = false;\n }\n }\n\n callback(valid);\n}\ndateValidator.VALIDATOR_TYPE = VALIDATOR_TYPE;\n/**\n * Format the given string using moment.js' format feature.\n *\n * @param {string} value The value to format.\n * @param {string} dateFormat The date pattern to format to.\n * @returns {string}\n */\n\nexport function correctFormat(value, dateFormat) {\n var dateFromDate = moment(getNormalizedDate(value));\n var dateFromMoment = moment(value, dateFormat);\n var isAlphanumeric = value.search(/[A-z]/g) > -1;\n var date;\n\n if (dateFromDate.isValid() && dateFromDate.format('x') === dateFromMoment.format('x') || !dateFromMoment.isValid() || isAlphanumeric) {\n date = dateFromDate;\n } else {\n date = dateFromMoment;\n }\n\n return date.format(dateFormat);\n}","import { isNumeric } from \"../../helpers/number.mjs\";\nexport var VALIDATOR_TYPE = 'numeric';\n/**\n * The Numeric cell validator.\n *\n * @private\n * @param {*} value Value of edited cell.\n * @param {Function} callback Callback called with validation result.\n */\n\nexport function numericValidator(value, callback) {\n var valueToValidate = value;\n\n if (valueToValidate === null || valueToValidate === void 0) {\n valueToValidate = '';\n }\n\n if (this.allowEmpty && valueToValidate === '') {\n callback(true);\n } else if (valueToValidate === '') {\n callback(false);\n } else {\n callback(isNumeric(value));\n }\n}\nnumericValidator.VALIDATOR_TYPE = VALIDATOR_TYPE;","import moment from 'moment'; // Formats which are correctly parsed to time (supported by momentjs)\n\nvar STRICT_FORMATS = ['YYYY-MM-DDTHH:mm:ss.SSSZ', 'X', // Unix timestamp\n'x' // Unix ms timestamp\n];\nexport var VALIDATOR_TYPE = 'time';\n/**\n * The Time cell validator.\n *\n * @private\n * @param {*} value Value of edited cell.\n * @param {Function} callback Callback called with validation result.\n */\n\nexport function timeValidator(value, callback) {\n var timeFormat = this.timeFormat || 'h:mm:ss a';\n var valid = true;\n var valueToValidate = value;\n\n if (valueToValidate === null) {\n valueToValidate = '';\n }\n\n valueToValidate = /^\\d{3,}$/.test(valueToValidate) ? parseInt(valueToValidate, 10) : valueToValidate;\n var twoDigitValue = /^\\d{1,2}$/.test(valueToValidate);\n\n if (twoDigitValue) {\n valueToValidate += ':00';\n }\n\n var date = moment(valueToValidate, STRICT_FORMATS, true).isValid() ? moment(valueToValidate) : moment(valueToValidate, timeFormat);\n var isValidTime = date.isValid(); // is it in the specified format\n\n var isValidFormat = moment(valueToValidate, timeFormat, true).isValid() && !twoDigitValue;\n\n if (this.allowEmpty && valueToValidate === '') {\n isValidTime = true;\n isValidFormat = true;\n }\n\n if (!isValidTime) {\n valid = false;\n }\n\n if (!isValidTime && isValidFormat) {\n valid = true;\n }\n\n if (isValidTime && !isValidFormat) {\n if (this.correctFormat === true) {\n // if format correction is enabled\n var correctedValue = date.format(timeFormat);\n var row = this.instance.toVisualRow(this.row);\n var column = this.instance.toVisualColumn(this.col);\n this.instance.setDataAtCell(row, column, correctedValue, 'timeValidator');\n valid = true;\n } else {\n valid = false;\n }\n }\n\n callback(valid);\n}\ntimeValidator.VALIDATOR_TYPE = VALIDATOR_TYPE;","import { AutocompleteEditor } from \"../../editors/autocompleteEditor/index.mjs\";\nimport { autocompleteRenderer } from \"../../renderers/autocompleteRenderer/index.mjs\";\nimport { autocompleteValidator } from \"../../validators/autocompleteValidator/index.mjs\";\nexport var CELL_TYPE = 'autocomplete';\nexport var AutocompleteCellType = {\n CELL_TYPE: CELL_TYPE,\n editor: AutocompleteEditor,\n renderer: autocompleteRenderer,\n validator: autocompleteValidator\n};","import { CheckboxEditor } from \"../../editors/checkboxEditor/index.mjs\";\nimport { checkboxRenderer } from \"../../renderers/checkboxRenderer/index.mjs\";\nexport var CELL_TYPE = 'checkbox';\nexport var CheckboxCellType = {\n CELL_TYPE: CELL_TYPE,\n editor: CheckboxEditor,\n renderer: checkboxRenderer\n};","import { DateEditor } from \"../../editors/dateEditor/index.mjs\";\nimport { autocompleteRenderer } from \"../../renderers/autocompleteRenderer/index.mjs\";\nimport { dateValidator } from \"../../validators/dateValidator/index.mjs\";\nexport var CELL_TYPE = 'date';\nexport var DateCellType = {\n CELL_TYPE: CELL_TYPE,\n editor: DateEditor,\n // displays small gray arrow on right side of the cell\n renderer: autocompleteRenderer,\n validator: dateValidator\n};","import { DropdownEditor } from \"../../editors/dropdownEditor/index.mjs\";\nimport { autocompleteRenderer } from \"../../renderers/autocompleteRenderer/index.mjs\";\nimport { autocompleteValidator } from \"../../validators/autocompleteValidator/index.mjs\";\nexport var CELL_TYPE = 'dropdown';\nexport var DropdownCellType = {\n CELL_TYPE: CELL_TYPE,\n editor: DropdownEditor,\n // displays small gray arrow on right side of the cell\n renderer: autocompleteRenderer,\n validator: autocompleteValidator\n};","import { HandsontableEditor } from \"../../editors/handsontableEditor/index.mjs\";\nimport { autocompleteRenderer } from \"../../renderers/autocompleteRenderer/index.mjs\";\nexport var CELL_TYPE = 'handsontable';\nexport var HandsontableCellType = {\n CELL_TYPE: CELL_TYPE,\n editor: HandsontableEditor,\n // displays small gray arrow on right side of the cell\n renderer: autocompleteRenderer\n};","import { NumericEditor } from \"../../editors/numericEditor/index.mjs\";\nimport { numericRenderer } from \"../../renderers/numericRenderer/index.mjs\";\nimport { numericValidator } from \"../../validators/numericValidator/index.mjs\";\nexport var CELL_TYPE = 'numeric';\nexport var NumericCellType = {\n CELL_TYPE: CELL_TYPE,\n editor: NumericEditor,\n renderer: numericRenderer,\n validator: numericValidator,\n dataType: 'number'\n};","import { PasswordEditor } from \"../../editors/passwordEditor/index.mjs\";\nimport { passwordRenderer } from \"../../renderers/passwordRenderer/index.mjs\";\nexport var CELL_TYPE = 'password';\nexport var PasswordCellType = {\n CELL_TYPE: CELL_TYPE,\n editor: PasswordEditor,\n renderer: passwordRenderer,\n copyable: false\n};","import { TextEditor } from \"../../editors/textEditor/index.mjs\";\nimport { textRenderer } from \"../../renderers/textRenderer/index.mjs\";\nimport { timeValidator } from \"../../validators/timeValidator/index.mjs\";\nexport var CELL_TYPE = 'time';\nexport var TimeCellType = {\n CELL_TYPE: CELL_TYPE,\n editor: TextEditor,\n // displays small gray arrow on right side of the cell\n renderer: textRenderer,\n validator: timeValidator\n};","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.weak-map.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.regexp.exec.js\";\nimport \"core-js/modules/es.string.split.js\";\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.array.join.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.array.splice.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport { defineGetter, objectEach } from \"../../helpers/object.mjs\";\nimport { arrayEach } from \"../../helpers/array.mjs\";\nimport { getPluginsNames, hasPlugin } from \"../registry.mjs\";\nimport { hasCellType } from \"../../cellTypes/registry.mjs\";\nimport { hasEditor } from \"../../editors/registry.mjs\";\nimport { hasRenderer } from \"../../renderers/registry.mjs\";\nimport { hasValidator } from \"../../validators/registry.mjs\";\nvar DEPS_TYPE_CHECKERS = new Map([['plugin', hasPlugin], ['cell-type', hasCellType], ['editor', hasEditor], ['renderer', hasRenderer], ['validator', hasValidator]]);\nexport var PLUGIN_KEY = 'base';\nvar privatePool = new WeakMap();\nvar missingDependeciesMsgs = [];\nvar initializedPlugins = null;\n/**\n * @util\n */\n\nexport var BasePlugin = /*#__PURE__*/function () {\n /**\n * @param {object} hotInstance Handsontable instance.\n */\n function BasePlugin(hotInstance) {\n var _this = this;\n\n _classCallCheck(this, BasePlugin);\n\n /**\n * Handsontable instance.\n *\n * @type {Core}\n */\n defineGetter(this, 'hot', hotInstance, {\n writable: false\n });\n privatePool.set(this, {\n hooks: {}\n });\n initializedPlugins = null;\n this.pluginName = null;\n this.pluginsInitializedCallbacks = [];\n this.isPluginsReady = false;\n this.enabled = false;\n this.initialized = false;\n this.hot.addHook('afterPluginsInitialized', function () {\n return _this.onAfterPluginsInitialized();\n });\n this.hot.addHook('afterUpdateSettings', function (newSettings) {\n return _this.onUpdateSettings(newSettings);\n });\n this.hot.addHook('beforeInit', function () {\n return _this.init();\n });\n }\n\n _createClass(BasePlugin, [{\n key: \"init\",\n value: function init() {\n var _this2 = this;\n\n this.pluginName = this.hot.getPluginName(this);\n var pluginDeps = this.constructor.PLUGIN_DEPS;\n var dependecies = Array.isArray(pluginDeps) ? pluginDeps : [];\n\n if (dependecies.length > 0) {\n var missingDependencies = [];\n dependecies.forEach(function (dependency) {\n var _dependency$split = dependency.split(':'),\n _dependency$split2 = _slicedToArray(_dependency$split, 2),\n type = _dependency$split2[0],\n moduleName = _dependency$split2[1];\n\n if (!DEPS_TYPE_CHECKERS.has(type)) {\n throw new Error(\"Unknown plugin dependency type \\\"\".concat(type, \"\\\" was found.\"));\n }\n\n if (!DEPS_TYPE_CHECKERS.get(type)(moduleName)) {\n missingDependencies.push(\" - \".concat(moduleName, \" (\").concat(type, \")\"));\n }\n });\n\n if (missingDependencies.length > 0) {\n var errorMsg = [\"The \".concat(this.pluginName, \" plugin requires the following modules:\\n\"), \"\".concat(missingDependencies.join('\\n'), \"\\n\")].join('');\n missingDependeciesMsgs.push(errorMsg);\n }\n }\n\n if (!initializedPlugins) {\n initializedPlugins = getPluginsNames();\n } // Workaround for the UndoRedo plugin which, currently doesn't follow the plugin architecture.\n // Without this line the `callOnPluginsReady` callback won't be triggered after all plugin\n // initialization.\n\n\n if (initializedPlugins.indexOf('UndoRedo') >= 0) {\n initializedPlugins.splice(initializedPlugins.indexOf('UndoRedo'), 1);\n }\n\n if (initializedPlugins.indexOf(this.pluginName) >= 0) {\n initializedPlugins.splice(initializedPlugins.indexOf(this.pluginName), 1);\n }\n\n this.hot.addHookOnce('afterPluginsInitialized', function () {\n if (_this2.isEnabled && _this2.isEnabled()) {\n _this2.enablePlugin();\n }\n });\n var isAllPluginsAreInitialized = initializedPlugins.length === 0;\n\n if (isAllPluginsAreInitialized) {\n if (missingDependeciesMsgs.length > 0) {\n var _errorMsg = [\"\".concat(missingDependeciesMsgs.join('\\n'), \"\\n\"), 'You have to import and register them manually.'].join('');\n\n throw new Error(_errorMsg);\n }\n\n this.hot.runHooks('afterPluginsInitialized');\n }\n\n this.initialized = true;\n }\n /**\n * Enable plugin for this Handsontable instance.\n */\n\n }, {\n key: \"enablePlugin\",\n value: function enablePlugin() {\n this.enabled = true;\n }\n /**\n * Disable plugin for this Handsontable instance.\n */\n\n }, {\n key: \"disablePlugin\",\n value: function disablePlugin() {\n if (this.eventManager) {\n this.eventManager.clear();\n }\n\n this.clearHooks();\n this.enabled = false;\n }\n /**\n * Add listener to plugin hooks system.\n *\n * @param {string} name The hook name.\n * @param {Function} callback The listener function to add.\n */\n\n }, {\n key: \"addHook\",\n value: function addHook(name, callback) {\n privatePool.get(this).hooks[name] = privatePool.get(this).hooks[name] || [];\n var hooks = privatePool.get(this).hooks[name];\n this.hot.addHook(name, callback);\n hooks.push(callback);\n privatePool.get(this).hooks[name] = hooks;\n }\n /**\n * Remove all hooks listeners by hook name.\n *\n * @param {string} name The hook name.\n */\n\n }, {\n key: \"removeHooks\",\n value: function removeHooks(name) {\n var _this3 = this;\n\n arrayEach(privatePool.get(this).hooks[name] || [], function (callback) {\n _this3.hot.removeHook(name, callback);\n });\n }\n /**\n * Clear all hooks.\n */\n\n }, {\n key: \"clearHooks\",\n value: function clearHooks() {\n var _this4 = this;\n\n var hooks = privatePool.get(this).hooks;\n objectEach(hooks, function (callbacks, name) {\n return _this4.removeHooks(name);\n });\n hooks.length = 0;\n }\n /**\n * Register function which will be immediately called after all plugins initialized.\n *\n * @param {Function} callback The listener function to call.\n */\n\n }, {\n key: \"callOnPluginsReady\",\n value: function callOnPluginsReady(callback) {\n if (this.isPluginsReady) {\n callback();\n } else {\n this.pluginsInitializedCallbacks.push(callback);\n }\n }\n /**\n * On after plugins initialized listener.\n *\n * @private\n */\n\n }, {\n key: \"onAfterPluginsInitialized\",\n value: function onAfterPluginsInitialized() {\n arrayEach(this.pluginsInitializedCallbacks, function (callback) {\n return callback();\n });\n this.pluginsInitializedCallbacks.length = 0;\n this.isPluginsReady = true;\n }\n /**\n * On update settings listener.\n *\n * @private\n * @param {object} newSettings New set of settings passed to the `updateSettings` method.\n */\n\n }, {\n key: \"onUpdateSettings\",\n value: function onUpdateSettings(newSettings) {\n if (this.isEnabled) {\n if (this.enabled && !this.isEnabled()) {\n this.disablePlugin();\n }\n\n if (!this.enabled && this.isEnabled()) {\n this.enablePlugin();\n }\n\n if (this.enabled && this.isEnabled()) {\n this.updatePlugin(newSettings);\n }\n }\n }\n /**\n * Updates the plugin to use the latest options you have specified.\n *\n * @private\n */\n\n }, {\n key: \"updatePlugin\",\n value: function updatePlugin() {}\n /**\n * Destroy plugin.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n var _this5 = this;\n\n if (this.eventManager) {\n this.eventManager.destroy();\n }\n\n this.clearHooks();\n objectEach(this, function (value, property) {\n if (property !== 'hot') {\n _this5[property] = null;\n }\n });\n delete this.t;\n delete this.hot;\n }\n }], [{\n key: \"PLUGIN_KEY\",\n get: function get() {\n return PLUGIN_KEY;\n }\n }]);\n\n return BasePlugin;\n}();","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.object.keys.js\";\nimport \"core-js/modules/es.array.index-of.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { isObject } from \"./../helpers/object.mjs\";\nimport { rangeEach } from \"./../helpers/number.mjs\";\nimport { stringify } from \"./../helpers/mixed.mjs\";\n/**\n * @class SamplesGenerator\n * @util\n */\n\nvar SamplesGenerator = /*#__PURE__*/function () {\n function SamplesGenerator(dataFactory) {\n _classCallCheck(this, SamplesGenerator);\n\n /**\n * Samples prepared for calculations.\n *\n * @type {Map}\n * @default {null}\n */\n this.samples = null;\n /**\n * Function which give the data to collect samples.\n *\n * @type {Function}\n */\n\n this.dataFactory = dataFactory;\n /**\n * Custom number of samples to take of each value length.\n *\n * @type {number}\n * @default {null}\n */\n\n this.customSampleCount = null;\n /**\n * `true` if duplicate samples collection should be allowed, `false` otherwise.\n *\n * @type {boolean}\n * @default {false}\n */\n\n this.allowDuplicates = false;\n }\n /**\n * Get the sample count for this instance.\n *\n * @returns {number}\n */\n\n\n _createClass(SamplesGenerator, [{\n key: \"getSampleCount\",\n value: function getSampleCount() {\n if (this.customSampleCount) {\n return this.customSampleCount;\n }\n\n return SamplesGenerator.SAMPLE_COUNT;\n }\n /**\n * Set the sample count.\n *\n * @param {number} sampleCount Number of samples to be collected.\n */\n\n }, {\n key: \"setSampleCount\",\n value: function setSampleCount(sampleCount) {\n this.customSampleCount = sampleCount;\n }\n /**\n * Set if the generator should accept duplicate values.\n *\n * @param {boolean} allowDuplicates `true` to allow duplicate values.\n */\n\n }, {\n key: \"setAllowDuplicates\",\n value: function setAllowDuplicates(allowDuplicates) {\n this.allowDuplicates = allowDuplicates;\n }\n /**\n * Generate samples for row. You can control which area should be sampled by passing `rowRange` object and `colRange` object.\n *\n * @param {object|number} rowRange The rows range to generate the samples.\n * @param {object} colRange The column range to generate the samples.\n * @returns {object}\n */\n\n }, {\n key: \"generateRowSamples\",\n value: function generateRowSamples(rowRange, colRange) {\n return this.generateSamples('row', colRange, rowRange);\n }\n /**\n * Generate samples for column. You can control which area should be sampled by passing `colRange` object and `rowRange` object.\n *\n * @param {object} colRange Column index.\n * @param {object} rowRange Column index.\n * @returns {object}\n */\n\n }, {\n key: \"generateColumnSamples\",\n value: function generateColumnSamples(colRange, rowRange) {\n return this.generateSamples('col', rowRange, colRange);\n }\n /**\n * Generate collection of samples.\n *\n * @param {string} type Type to generate. Can be `col` or `row`.\n * @param {object} range The range to generate the samples.\n * @param {object|number} specifierRange The range to generate the samples.\n * @returns {Map}\n */\n\n }, {\n key: \"generateSamples\",\n value: function generateSamples(type, range, specifierRange) {\n var _this = this;\n\n var samples = new Map();\n\n var _ref = typeof specifierRange === 'number' ? {\n from: specifierRange,\n to: specifierRange\n } : specifierRange,\n from = _ref.from,\n to = _ref.to;\n\n rangeEach(from, to, function (index) {\n var sample = _this.generateSample(type, range, index);\n\n samples.set(index, sample);\n });\n return samples;\n }\n /**\n * Generate sample for specified type (`row` or `col`).\n *\n * @param {string} type Samples type `row` or `col`.\n * @param {object} range The range to generate the samples.\n * @param {number} specifierValue The range to generate the samples.\n * @returns {Map}\n */\n\n }, {\n key: \"generateSample\",\n value: function generateSample(type, range, specifierValue) {\n var _this2 = this;\n\n if (type !== 'row' && type !== 'col') {\n throw new Error('Unsupported sample type');\n }\n\n var samples = new Map();\n var computedKey = type === 'row' ? 'col' : 'row';\n var sampledValues = [];\n rangeEach(range.from, range.to, function (index) {\n var _ref2 = type === 'row' ? _this2.dataFactory(specifierValue, index) : _this2.dataFactory(index, specifierValue),\n value = _ref2.value,\n bundleSeed = _ref2.bundleSeed;\n\n var hasCustomBundleSeed = typeof bundleSeed === 'string' && bundleSeed.length > 0;\n var seed;\n\n if (hasCustomBundleSeed) {\n seed = bundleSeed;\n } else if (isObject(value)) {\n seed = \"\".concat(Object.keys(value).length);\n } else if (Array.isArray(value)) {\n seed = \"\".concat(value.length);\n } else {\n seed = \"\".concat(stringify(value).length);\n }\n\n if (!samples.has(seed)) {\n samples.set(seed, {\n needed: _this2.getSampleCount(),\n strings: []\n });\n }\n\n var sample = samples.get(seed);\n\n if (sample.needed) {\n var duplicate = sampledValues.indexOf(value) > -1;\n\n if (!duplicate || _this2.allowDuplicates || hasCustomBundleSeed) {\n sample.strings.push(_defineProperty({\n value: value\n }, computedKey, index));\n sampledValues.push(value);\n sample.needed -= 1;\n }\n }\n });\n return samples;\n }\n }], [{\n key: \"SAMPLE_COUNT\",\n get:\n /**\n * Number of samples to take of each value length.\n *\n * @type {number}\n */\n function get() {\n return 3;\n }\n }]);\n\n return SamplesGenerator;\n}();\n\nexport default SamplesGenerator;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/es.weak-map.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/web.timers.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.set.js\";\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.function.name.js\";\nimport { BasePlugin } from \"../base/index.mjs\";\nimport { arrayEach, arrayFilter, arrayReduce, arrayMap } from \"../../helpers/array.mjs\";\nimport { cancelAnimationFrame, requestAnimationFrame } from \"../../helpers/feature.mjs\";\nimport GhostTable from \"../../utils/ghostTable.mjs\";\nimport Hooks from \"../../pluginHooks.mjs\";\nimport { isObject, hasOwnProperty } from \"../../helpers/object.mjs\";\nimport { valueAccordingPercent, rangeEach } from \"../../helpers/number.mjs\";\nimport SamplesGenerator from \"../../utils/samplesGenerator.mjs\";\nimport { isPercentValue } from \"../../helpers/string.mjs\";\nimport { ViewportColumnsCalculator } from \"../../3rdparty/walkontable/src/index.mjs\";\nimport { PhysicalIndexToValueMap as IndexToValueMap } from \"../../translations/index.mjs\";\nimport { isDefined } from \"../../helpers/mixed.mjs\";\nHooks.getSingleton().register('modifyAutoColumnSizeSeed');\nexport var PLUGIN_KEY = 'autoColumnSize';\nexport var PLUGIN_PRIORITY = 10;\nvar privatePool = new WeakMap();\nvar COLUMN_SIZE_MAP_NAME = 'autoColumnSize';\n/* eslint-disable jsdoc/require-description-complete-sentence */\n\n/**\n * @plugin AutoColumnSize\n * @class AutoColumnSize\n *\n * @description\n * This plugin allows to set column widths based on their widest cells.\n *\n * By default, the plugin is declared as `undefined`, which makes it enabled (same as if it was declared as `true`).\n * Enabling this plugin may decrease the overall table performance, as it needs to calculate the widths of all cells to\n * resize the columns accordingly.\n * If you experience problems with the performance, try turning this feature off and declaring the column widths manually.\n *\n * Column width calculations are divided into sync and async part. Each of this parts has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous\n * operations don't block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of columns) or a percentage value to a config object:\n *\n * ```js\n * // as a number (300 columns in sync, rest async)\n * autoColumnSize: {syncLimit: 300},.\n *\n * // as a string (percent)\n * autoColumnSize: {syncLimit: '40%'},\n * ```\n *\n * The plugin uses {@link ghost-table GhostTable} and {@link samples-generator SamplesGenerator} for calculations.\n * First, {@link samples-generator SamplesGenerator} prepares samples of data with its coordinates.\n * Next {@link ghost-table GhostTable} uses coordinates to get cells' renderers and append all to the DOM through DocumentFragment.\n *\n * Sampling accepts additional options:\n * - *samplingRatio* - Defines how many samples for the same length will be used to calculate. Default is `3`.\n *\n * ```js\n * autoColumnSize: {\n * samplingRatio: 10,\n * }\n * ```\n *\n * - *allowSampleDuplicates* - Defines if duplicated values might be used in sampling. Default is `false`.\n *\n * ```js\n * autoColumnSize: {\n * allowSampleDuplicates: true,\n * }\n * ```\n *\n * To configure this plugin see {@link Options#autoColumnSize}.\n *\n * @example\n *\n * ```js\n * const hot = new Handsontable(document.getElementById('example'), {\n * data: getData(),\n * autoColumnSize: true\n * });\n * // Access to plugin instance:\n * const plugin = hot.getPlugin('autoColumnSize');\n *\n * plugin.getColumnWidth(4);\n *\n * if (plugin.isEnabled()) {\n * // code...\n * }\n * ```\n */\n\n/* eslint-enable jsdoc/require-description-complete-sentence */\n\nexport var AutoColumnSize = /*#__PURE__*/function (_BasePlugin) {\n _inherits(AutoColumnSize, _BasePlugin);\n\n var _super = _createSuper(AutoColumnSize);\n\n function AutoColumnSize(hotInstance) {\n var _this;\n\n _classCallCheck(this, AutoColumnSize);\n\n _this = _super.call(this, hotInstance);\n privatePool.set(_assertThisInitialized(_this), {\n /**\n * Cached column header names. It is used to diff current column headers with previous state and detect which\n * columns width should be updated.\n *\n * @private\n * @type {Array}\n */\n cachedColumnHeaders: []\n });\n /**\n * Instance of {@link GhostTable} for rows and columns size calculations.\n *\n * @private\n * @type {GhostTable}\n */\n\n _this.ghostTable = new GhostTable(_this.hot);\n /**\n * Instance of {@link samples-generator SamplesGenerator} for generating samples necessary for columns width calculations.\n *\n * @private\n * @type {SamplesGenerator}\n * @fires Hooks#modifyAutoColumnSizeSeed\n */\n\n _this.samplesGenerator = new SamplesGenerator(function (row, column) {\n var cellMeta = _this.hot.getCellMeta(row, column);\n\n var cellValue = '';\n\n if (!cellMeta.spanned) {\n cellValue = _this.hot.getDataAtCell(row, column);\n }\n\n var bundleSeed = '';\n\n if (_this.hot.hasHook('modifyAutoColumnSizeSeed')) {\n bundleSeed = _this.hot.runHooks('modifyAutoColumnSizeSeed', bundleSeed, cellMeta, cellValue);\n }\n\n return {\n value: cellValue,\n bundleSeed: bundleSeed\n };\n });\n /**\n * `true` only if the first calculation was performed.\n *\n * @private\n * @type {boolean}\n */\n\n _this.firstCalculation = true;\n /**\n * `true` if the size calculation is in progress.\n *\n * @type {boolean}\n */\n\n _this.inProgress = false;\n /**\n * Number of already measured columns (we already know their sizes).\n *\n * @type {number}\n */\n\n _this.measuredColumns = 0;\n /**\n * PhysicalIndexToValueMap to keep and track widths for physical column indexes.\n *\n * @private\n * @type {PhysicalIndexToValueMap}\n */\n\n _this.columnWidthsMap = new IndexToValueMap();\n\n _this.hot.columnIndexMapper.registerMap(COLUMN_SIZE_MAP_NAME, _this.columnWidthsMap); // Leave the listener active to allow auto-sizing the columns when the plugin is disabled.\n // This is necesseary for width recalculation for resize handler doubleclick (ManualColumnResize).\n\n\n _this.addHook('beforeColumnResize', function (size, column, isDblClick) {\n return _this.onBeforeColumnResize(size, column, isDblClick);\n });\n\n return _this;\n }\n /**\n * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link hooks#beforeinit Hooks#beforeInit}\n * hook and if it returns `true` than the {@link auto-column-size#enableplugin #enablePlugin} method is called.\n *\n * @returns {boolean}\n */\n\n\n _createClass(AutoColumnSize, [{\n key: \"isEnabled\",\n value: function isEnabled() {\n return this.hot.getSettings()[PLUGIN_KEY] !== false && !this.hot.getSettings().colWidths;\n }\n /**\n * Enables the plugin functionality for this Handsontable instance.\n */\n\n }, {\n key: \"enablePlugin\",\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n var setting = this.hot.getSettings()[PLUGIN_KEY];\n\n if (setting && setting.useHeaders !== null && setting.useHeaders !== void 0) {\n this.ghostTable.setSetting('useHeaders', setting.useHeaders);\n }\n\n this.setSamplingOptions();\n this.addHook('afterLoadData', function () {\n return _this2.onAfterLoadData();\n });\n this.addHook('beforeChange', function (changes) {\n return _this2.onBeforeChange(changes);\n });\n this.addHook('afterFormulasValuesUpdate', function (changes) {\n return _this2.onAfterFormulasValuesUpdate(changes);\n });\n this.addHook('beforeRender', function (force) {\n return _this2.onBeforeRender(force);\n });\n this.addHook('modifyColWidth', function (width, col) {\n return _this2.getColumnWidth(col, width);\n });\n this.addHook('afterInit', function () {\n return _this2.onAfterInit();\n });\n\n _get(_getPrototypeOf(AutoColumnSize.prototype), \"enablePlugin\", this).call(this);\n }\n /**\n * Updates the plugin state. This method is executed when {@link core#updatesettings Core#updateSettings} is invoked.\n */\n\n }, {\n key: \"updatePlugin\",\n value: function updatePlugin() {\n var changedColumns = this.findColumnsWhereHeaderWasChanged();\n\n if (changedColumns.length) {\n this.clearCache(changedColumns);\n this.calculateVisibleColumnsWidth();\n }\n\n _get(_getPrototypeOf(AutoColumnSize.prototype), \"updatePlugin\", this).call(this);\n }\n /**\n * Disables the plugin functionality for this Handsontable instance.\n */\n\n }, {\n key: \"disablePlugin\",\n value: function disablePlugin() {\n var _this3 = this;\n\n _get(_getPrototypeOf(AutoColumnSize.prototype), \"disablePlugin\", this).call(this); // Leave the listener active to allow auto-sizing the columns when the plugin is disabled.\n // This is necesseary for width recalculation for resize handler doubleclick (ManualColumnResize).\n\n\n this.addHook('beforeColumnResize', function (size, column, isDblClick) {\n return _this3.onBeforeColumnResize(size, column, isDblClick);\n });\n }\n /**\n * Calculates visible columns width.\n */\n\n }, {\n key: \"calculateVisibleColumnsWidth\",\n value: function calculateVisibleColumnsWidth() {\n var rowsCount = this.hot.countRows(); // Keep last column widths unchanged for situation when all rows was deleted or trimmed (pro #6)\n\n if (!rowsCount) {\n return;\n }\n\n var force = this.hot.renderCall;\n var firstVisibleColumn = this.getFirstVisibleColumn();\n var lastVisibleColumn = this.getLastVisibleColumn();\n\n if (firstVisibleColumn === -1 || lastVisibleColumn === -1) {\n return;\n }\n\n this.calculateColumnsWidth({\n from: firstVisibleColumn,\n to: lastVisibleColumn\n }, void 0, force);\n }\n /**\n * Calculates a columns width.\n *\n * @param {number|object} colRange Visual column index or an object with `from` and `to` visual indexes as a range.\n * @param {number|object} rowRange Visual row index or an object with `from` and `to` visual indexes as a range.\n * @param {boolean} [force=false] If `true` the calculation will be processed regardless of whether the width exists in the cache.\n */\n\n }, {\n key: \"calculateColumnsWidth\",\n value: function calculateColumnsWidth() {\n var _this4 = this;\n\n var colRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n from: 0,\n to: this.hot.countCols() - 1\n };\n var rowRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n from: 0,\n to: this.hot.countRows() - 1\n };\n var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n // eslint-disable-line max-len\n var columnsRange = typeof colRange === 'number' ? {\n from: colRange,\n to: colRange\n } : colRange;\n var rowsRange = typeof rowRange === 'number' ? {\n from: rowRange,\n to: rowRange\n } : rowRange;\n rangeEach(columnsRange.from, columnsRange.to, function (visualColumn) {\n var physicalColumn = _this4.hot.toPhysicalColumn(visualColumn);\n\n if (physicalColumn === null) {\n physicalColumn = visualColumn;\n }\n\n if (force || _this4.columnWidthsMap.getValueAtIndex(physicalColumn) === null && !_this4.hot._getColWidthFromSettings(physicalColumn)) {\n var samples = _this4.samplesGenerator.generateColumnSamples(visualColumn, rowsRange);\n\n arrayEach(samples, function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n column = _ref2[0],\n sample = _ref2[1];\n\n return _this4.ghostTable.addColumn(column, sample);\n });\n }\n });\n\n if (this.ghostTable.columns.length) {\n this.hot.batchExecution(function () {\n _this4.ghostTable.getWidths(function (visualColumn, width) {\n var physicalColumn = _this4.hot.toPhysicalColumn(visualColumn);\n\n _this4.columnWidthsMap.setValueAtIndex(physicalColumn, width);\n });\n }, true);\n this.measuredColumns = columnsRange.to + 1;\n this.ghostTable.clean();\n }\n }\n /**\n * Calculates all columns width. The calculated column will be cached in the {@link auto-column-size#widths AutoColumnSize#widths} property.\n * To retrieve width for specified column use {@link auto-column-size#getcolumnwidth AutoColumnSize#getColumnWidth} method.\n *\n * @param {object|number} rowRange Row index or an object with `from` and `to` properties which define row range.\n */\n\n }, {\n key: \"calculateAllColumnsWidth\",\n value: function calculateAllColumnsWidth() {\n var _this5 = this;\n\n var rowRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n from: 0,\n to: this.hot.countRows() - 1\n };\n var current = 0;\n var length = this.hot.countCols() - 1;\n var timer = null;\n this.inProgress = true;\n\n var loop = function loop() {\n // When hot was destroyed after calculating finished cancel frame\n if (!_this5.hot) {\n cancelAnimationFrame(timer);\n _this5.inProgress = false;\n return;\n }\n\n _this5.calculateColumnsWidth({\n from: current,\n to: Math.min(current + AutoColumnSize.CALCULATION_STEP, length)\n }, rowRange);\n\n current = current + AutoColumnSize.CALCULATION_STEP + 1;\n\n if (current < length) {\n timer = requestAnimationFrame(loop);\n } else {\n cancelAnimationFrame(timer);\n _this5.inProgress = false; // @TODO Should call once per render cycle, currently fired separately in different plugins\n\n _this5.hot.view.adjustElementsSize();\n }\n };\n\n var syncLimit = this.getSyncCalculationLimit(); // sync\n\n if (this.firstCalculation && syncLimit >= 0) {\n this.calculateColumnsWidth({\n from: 0,\n to: syncLimit\n }, rowRange);\n this.firstCalculation = false;\n current = syncLimit + 1;\n } // async\n\n\n if (current < length) {\n loop();\n } else {\n this.inProgress = false;\n }\n }\n /**\n * Sets the sampling options.\n *\n * @private\n */\n\n }, {\n key: \"setSamplingOptions\",\n value: function setSamplingOptions() {\n var setting = this.hot.getSettings()[PLUGIN_KEY];\n var samplingRatio = setting && hasOwnProperty(setting, 'samplingRatio') ? setting.samplingRatio : void 0;\n var allowSampleDuplicates = setting && hasOwnProperty(setting, 'allowSampleDuplicates') ? setting.allowSampleDuplicates : void 0;\n\n if (samplingRatio && !isNaN(samplingRatio)) {\n this.samplesGenerator.setSampleCount(parseInt(samplingRatio, 10));\n }\n\n if (allowSampleDuplicates) {\n this.samplesGenerator.setAllowDuplicates(allowSampleDuplicates);\n }\n }\n /**\n * Recalculates all columns width (overwrite cache values).\n */\n\n }, {\n key: \"recalculateAllColumnsWidth\",\n value: function recalculateAllColumnsWidth() {\n if (this.hot.view && this.hot.view.wt.wtTable.isVisible()) {\n this.clearCache();\n this.calculateAllColumnsWidth();\n }\n }\n /**\n * Gets value which tells how many columns should be calculated synchronously (rest of the columns will be calculated\n * asynchronously). The limit is calculated based on `syncLimit` set to `autoColumnSize` option (see {@link options#autocolumnsize Options#autoColumnSize}).\n *\n * @returns {number}\n */\n\n }, {\n key: \"getSyncCalculationLimit\",\n value: function getSyncCalculationLimit() {\n var settings = this.hot.getSettings()[PLUGIN_KEY];\n /* eslint-disable no-bitwise */\n\n var limit = AutoColumnSize.SYNC_CALCULATION_LIMIT;\n var colsLimit = this.hot.countCols() - 1;\n\n if (isObject(settings)) {\n limit = settings.syncLimit;\n\n if (isPercentValue(limit)) {\n limit = valueAccordingPercent(colsLimit, limit);\n } else {\n // Force to Number\n limit >>= 0;\n }\n }\n\n return Math.min(limit, colsLimit);\n }\n /**\n * Gets the calculated column width.\n *\n * @param {number} column Visual column index.\n * @param {number} [defaultWidth] Default column width. It will be picked up if no calculated width found.\n * @param {boolean} [keepMinimum=true] If `true` then returned value won't be smaller then 50 (default column width).\n * @returns {number}\n */\n\n }, {\n key: \"getColumnWidth\",\n value: function getColumnWidth(column) {\n var defaultWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0;\n var keepMinimum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var width = defaultWidth;\n\n if (width === void 0) {\n width = this.columnWidthsMap.getValueAtIndex(this.hot.toPhysicalColumn(column));\n\n if (keepMinimum && typeof width === 'number') {\n width = Math.max(width, ViewportColumnsCalculator.DEFAULT_WIDTH);\n }\n }\n\n return width;\n }\n /**\n * Gets the first visible column.\n *\n * @returns {number} Returns visual column index, -1 if table is not rendered or if there are no columns to base the the calculations on.\n */\n\n }, {\n key: \"getFirstVisibleColumn\",\n value: function getFirstVisibleColumn() {\n var wot = this.hot.view.wt;\n\n if (wot.wtViewport.columnsVisibleCalculator) {\n // Fist fully visible column is stored as renderable index.\n var firstFullyVisibleColumn = wot.wtTable.getFirstVisibleColumn();\n\n if (firstFullyVisibleColumn !== -1) {\n return this.hot.columnIndexMapper.getVisualFromRenderableIndex(firstFullyVisibleColumn);\n }\n }\n\n if (wot.wtViewport.columnsRenderCalculator) {\n var firstRenderedColumn = wot.wtTable.getFirstRenderedColumn(); // There are no rendered column.\n\n if (firstRenderedColumn !== -1) {\n return this.hot.columnIndexMapper.getVisualFromRenderableIndex(firstRenderedColumn);\n }\n }\n\n return -1;\n }\n /**\n * Gets the last visible column.\n *\n * @returns {number} Returns visual column index or -1 if table is not rendered.\n */\n\n }, {\n key: \"getLastVisibleColumn\",\n value: function getLastVisibleColumn() {\n var wot = this.hot.view.wt;\n\n if (wot.wtViewport.columnsVisibleCalculator) {\n // Last fully visible column is stored as renderable index.\n var lastFullyVisibleColumn = wot.wtTable.getLastVisibleColumn();\n\n if (lastFullyVisibleColumn !== -1) {\n return this.hot.columnIndexMapper.getVisualFromRenderableIndex(lastFullyVisibleColumn);\n }\n }\n\n if (wot.wtViewport.columnsRenderCalculator) {\n // Last fully visible column is stored as renderable index.\n var lastRenderedColumn = wot.wtTable.getLastRenderedColumn(); // There are no rendered columns.\n\n if (lastRenderedColumn !== -1) {\n return this.hot.columnIndexMapper.getVisualFromRenderableIndex(lastRenderedColumn);\n }\n }\n\n return -1;\n }\n /**\n * Collects all columns which titles has been changed in comparison to the previous state.\n *\n * @private\n * @returns {Array} It returns an array of physical column indexes.\n */\n\n }, {\n key: \"findColumnsWhereHeaderWasChanged\",\n value: function findColumnsWhereHeaderWasChanged() {\n var columnHeaders = this.hot.getColHeader();\n\n var _privatePool$get = privatePool.get(this),\n cachedColumnHeaders = _privatePool$get.cachedColumnHeaders;\n\n var changedColumns = arrayReduce(columnHeaders, function (acc, columnTitle, physicalColumn) {\n var cachedColumnsLength = cachedColumnHeaders.length;\n\n if (cachedColumnsLength - 1 < physicalColumn || cachedColumnHeaders[physicalColumn] !== columnTitle) {\n acc.push(physicalColumn);\n }\n\n if (cachedColumnsLength - 1 < physicalColumn) {\n cachedColumnHeaders.push(columnTitle);\n } else {\n cachedColumnHeaders[physicalColumn] = columnTitle;\n }\n\n return acc;\n }, []);\n return changedColumns;\n }\n /**\n * Clears cache of calculated column widths. If you want to clear only selected columns pass an array with their indexes.\n * Otherwise whole cache will be cleared.\n *\n * @param {number[]} [columns] List of physical column indexes to clear.\n */\n\n }, {\n key: \"clearCache\",\n value: function clearCache() {\n var _this6 = this;\n\n var columns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n\n if (columns.length) {\n this.hot.batchExecution(function () {\n arrayEach(columns, function (physicalIndex) {\n _this6.columnWidthsMap.setValueAtIndex(physicalIndex, null);\n });\n }, true);\n } else {\n this.columnWidthsMap.clear();\n }\n }\n /**\n * Checks if all widths were calculated. If not then return `true` (need recalculate).\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isNeedRecalculate\",\n value: function isNeedRecalculate() {\n return !!arrayFilter(this.columnWidthsMap.getValues().slice(0, this.measuredColumns), function (item) {\n return item === null;\n }).length;\n }\n /**\n * On before render listener.\n *\n * @private\n */\n\n }, {\n key: \"onBeforeRender\",\n value: function onBeforeRender() {\n this.calculateVisibleColumnsWidth();\n\n if (this.isNeedRecalculate() && !this.inProgress) {\n this.calculateAllColumnsWidth();\n }\n }\n /**\n * On after load data listener.\n *\n * @private\n */\n\n }, {\n key: \"onAfterLoadData\",\n value: function onAfterLoadData() {\n var _this7 = this;\n\n if (this.hot.view) {\n this.recalculateAllColumnsWidth();\n } else {\n // first load - initialization\n setTimeout(function () {\n if (_this7.hot) {\n _this7.recalculateAllColumnsWidth();\n }\n }, 0);\n }\n }\n /**\n * On before change listener.\n *\n * @private\n * @param {Array} changes An array of modified data.\n */\n\n }, {\n key: \"onBeforeChange\",\n value: function onBeforeChange(changes) {\n var _this8 = this;\n\n var changedColumns = arrayMap(changes, function (_ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n columnProperty = _ref4[1];\n\n return _this8.hot.toPhysicalColumn(_this8.hot.propToCol(columnProperty));\n });\n this.clearCache(Array.from(new Set(changedColumns)));\n }\n /**\n * On before column resize listener.\n *\n * @private\n * @param {number} size Calculated new column width.\n * @param {number} column Visual index of the resized column.\n * @param {boolean} isDblClick Flag that determines whether there was a double-click.\n * @returns {number}\n */\n\n }, {\n key: \"onBeforeColumnResize\",\n value: function onBeforeColumnResize(size, column, isDblClick) {\n var newSize = size;\n\n if (isDblClick) {\n this.calculateColumnsWidth(column, void 0, true);\n newSize = this.getColumnWidth(column, void 0, false);\n }\n\n return newSize;\n }\n /**\n * On after Handsontable init fill plugin with all necessary values.\n *\n * @private\n */\n\n }, {\n key: \"onAfterInit\",\n value: function onAfterInit() {\n privatePool.get(this).cachedColumnHeaders = this.hot.getColHeader();\n }\n /**\n * After formulas values updated listener.\n *\n * @private\n * @param {Array} changes An array of modified data.\n */\n\n }, {\n key: \"onAfterFormulasValuesUpdate\",\n value: function onAfterFormulasValuesUpdate(changes) {\n var filteredChanges = arrayFilter(changes, function (change) {\n var _change$address;\n\n return isDefined((_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.col);\n });\n var changedColumns = arrayMap(filteredChanges, function (change) {\n return change.address.col;\n });\n this.clearCache(Array.from(new Set(changedColumns)));\n }\n /**\n * Destroys the plugin instance.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.ghostTable.clean();\n\n _get(_getPrototypeOf(AutoColumnSize.prototype), \"destroy\", this).call(this);\n }\n }], [{\n key: \"PLUGIN_KEY\",\n get: function get() {\n return PLUGIN_KEY;\n }\n }, {\n key: \"PLUGIN_PRIORITY\",\n get: function get() {\n return PLUGIN_PRIORITY;\n }\n }, {\n key: \"CALCULATION_STEP\",\n get: function get() {\n return 50;\n }\n }, {\n key: \"SYNC_CALCULATION_LIMIT\",\n get: function get() {\n return 50;\n }\n }]);\n\n return AutoColumnSize;\n}(BasePlugin);","import \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.object.keys.js\";\nimport { isObject } from \"../../helpers/object.mjs\";\nimport { isDefined } from \"../../helpers/mixed.mjs\";\nimport { CellCoords } from \"../../3rdparty/walkontable/src/index.mjs\";\nexport var DIRECTIONS = {\n horizontal: 'horizontal',\n vertical: 'vertical'\n};\n/**\n * Get deltas array.\n *\n * @param {CellCoords} start The point in the grid where the selection starts.\n * @param {CellCoords} end The point in the grid where the selection ends.\n * @param {Array} data The chunk of the data which belongs to the selected box.\n * @param {string} direction The selection direction.\n * @returns {Array}\n */\n\nexport function getDeltas(start, end, data, direction) {\n var rowsLength = data.length;\n var columnsLength = data ? data[0].length : 0;\n var deltas = [];\n var diffRow = end.row - start.row;\n var diffCol = end.col - start.col;\n\n if (['down', 'up'].indexOf(direction) !== -1) {\n var arr = [];\n\n for (var col = 0; col < diffCol; col++) {\n var startValue = parseInt(data[0][col], 10);\n var endValue = parseInt(data[rowsLength - 1][col], 10);\n var delta = (direction === 'down' ? endValue - startValue : startValue - endValue) / (rowsLength - 1) || 0;\n arr.push(delta);\n }\n\n deltas.push(arr);\n }\n\n if (['right', 'left'].indexOf(direction) !== -1) {\n for (var row = 0; row < diffRow; row++) {\n var _startValue = parseInt(data[row][0], 10);\n\n var _endValue = parseInt(data[row][columnsLength - 1], 10);\n\n var _delta = (direction === 'right' ? _endValue - _startValue : _startValue - _endValue) / (columnsLength - 1) || 0;\n\n deltas.push([_delta]);\n }\n }\n\n return deltas;\n}\n/**\n * Get direction between positions and cords of selections difference (drag area).\n *\n * @param {Array} startSelection The coordinates where the selection starts.\n * @param {Array} endSelection The coordinates where the selection ends.\n * @returns {{direction: string, start: CellCoords, end: CellCoords}}\n */\n\nexport function getDragDirectionAndRange(startSelection, endSelection) {\n var startOfDragCoords;\n var endOfDragCoords;\n var directionOfDrag;\n\n if (endSelection[0] === startSelection[0] && endSelection[1] < startSelection[1]) {\n directionOfDrag = 'left';\n startOfDragCoords = new CellCoords(endSelection[0], endSelection[1]);\n endOfDragCoords = new CellCoords(endSelection[2], startSelection[1] - 1);\n } else if (endSelection[2] === startSelection[2] && endSelection[0] === startSelection[0] && endSelection[3] > startSelection[3]) {\n directionOfDrag = 'right';\n startOfDragCoords = new CellCoords(endSelection[0], startSelection[3] + 1);\n endOfDragCoords = new CellCoords(endSelection[2], endSelection[3]);\n } else if (endSelection[0] < startSelection[0] && endSelection[1] === startSelection[1]) {\n directionOfDrag = 'up';\n startOfDragCoords = new CellCoords(endSelection[0], endSelection[1]);\n endOfDragCoords = new CellCoords(startSelection[0] - 1, endSelection[3]);\n } else if (endSelection[2] > startSelection[2] && endSelection[1] === startSelection[1]) {\n directionOfDrag = 'down';\n startOfDragCoords = new CellCoords(startSelection[2] + 1, endSelection[1]);\n endOfDragCoords = new CellCoords(endSelection[2], endSelection[3]);\n }\n\n if (startOfDragCoords) {\n startOfDragCoords.normalize();\n }\n\n if (endOfDragCoords) {\n endOfDragCoords.normalize();\n }\n\n return {\n directionOfDrag: directionOfDrag,\n startOfDragCoords: startOfDragCoords,\n endOfDragCoords: endOfDragCoords\n };\n}\n/**\n * Get mapped FillHandle setting containing information about\n * allowed FillHandle directions and if allowed is automatic insertion of rows on drag.\n *\n * @param {boolean|object} fillHandle Property of Handsontable settings.\n * @returns {{directions: Array, autoInsertRow: boolean}} Object allowing access to information\n * about FillHandle in more useful way.\n */\n\nexport function getMappedFillHandleSetting(fillHandle) {\n var mappedSettings = {};\n\n if (fillHandle === true) {\n mappedSettings.directions = Object.keys(DIRECTIONS);\n mappedSettings.autoInsertRow = true;\n } else if (isObject(fillHandle)) {\n if (isDefined(fillHandle.autoInsertRow)) {\n // autoInsertRow for horizontal direction will be always false\n if (fillHandle.direction === DIRECTIONS.horizontal) {\n mappedSettings.autoInsertRow = false;\n } else {\n mappedSettings.autoInsertRow = fillHandle.autoInsertRow;\n }\n } else {\n mappedSettings.autoInsertRow = false;\n }\n\n if (isDefined(fillHandle.direction)) {\n mappedSettings.directions = [fillHandle.direction];\n } else {\n mappedSettings.directions = Object.keys(DIRECTIONS);\n }\n } else if (typeof fillHandle === 'string') {\n mappedSettings.directions = [fillHandle];\n mappedSettings.autoInsertRow = true;\n } else {\n mappedSettings.directions = [];\n mappedSettings.autoInsertRow = false;\n }\n\n return mappedSettings;\n}","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.string.includes.js\";\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\nimport \"core-js/modules/es.array.from.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { BasePlugin } from \"../base/index.mjs\";\nimport Hooks from \"../../pluginHooks.mjs\";\nimport { offset, outerHeight, outerWidth } from \"../../helpers/dom/element.mjs\";\nimport { arrayEach, arrayMap } from \"../../helpers/array.mjs\";\nimport { isObjectEqual } from \"../../helpers/object.mjs\";\nimport EventManager from \"../../eventManager.mjs\";\nimport { CellCoords, CellRange } from \"../../3rdparty/walkontable/src/index.mjs\";\nimport { getDeltas, getDragDirectionAndRange, DIRECTIONS, getMappedFillHandleSetting } from \"./utils.mjs\";\nHooks.getSingleton().register('modifyAutofillRange');\nHooks.getSingleton().register('beforeAutofill');\nHooks.getSingleton().register('afterAutofill');\nexport var PLUGIN_KEY = 'autofill';\nexport var PLUGIN_PRIORITY = 20;\nvar INSERT_ROW_ALTER_ACTION_NAME = 'insert_row';\nvar INTERVAL_FOR_ADDING_ROW = 200;\n/**\n * This plugin provides \"drag-down\" and \"copy-down\" functionalities, both operated using the small square in the right\n * bottom of the cell selection.\n *\n * \"Drag-down\" expands the value of the selected cells to the neighbouring cells when you drag the small\n * square in the corner.\n *\n * \"Copy-down\" copies the value of the selection to all empty cells below when you double click the small square.\n *\n * @class Autofill\n * @plugin Autofill\n */\n\nexport var Autofill = /*#__PURE__*/function (_BasePlugin) {\n _inherits(Autofill, _BasePlugin);\n\n var _super = _createSuper(Autofill);\n\n function Autofill(hotInstance) {\n var _this;\n\n _classCallCheck(this, Autofill);\n\n _this = _super.call(this, hotInstance);\n /**\n * Event manager instance.\n *\n * @private\n * @type {EventManager}\n */\n\n _this.eventManager = new EventManager(_assertThisInitialized(_this));\n /**\n * Specifies if adding new row started.\n *\n * @private\n * @type {boolean}\n */\n\n _this.addingStarted = false;\n /**\n * Specifies if there was mouse down on the cell corner.\n *\n * @private\n * @type {boolean}\n */\n\n _this.mouseDownOnCellCorner = false;\n /**\n * Specifies if mouse was dragged outside Handsontable.\n *\n * @private\n * @type {boolean}\n */\n\n _this.mouseDragOutside = false;\n /**\n * Specifies how many cell levels were dragged using the handle.\n *\n * @private\n * @type {boolean}\n */\n\n _this.handleDraggedCells = 0;\n /**\n * Specifies allowed directions of drag (`'horizontal'` or '`vertical`').\n *\n * @private\n * @type {string[]}\n */\n\n _this.directions = [];\n /**\n * Specifies if can insert new rows if needed.\n *\n * @type {boolean}\n */\n\n _this.autoInsertRow = false;\n return _this;\n }\n /**\n * Checks if the plugin is enabled in the Handsontable settings.\n *\n * @returns {boolean}\n */\n\n\n _createClass(Autofill, [{\n key: \"isEnabled\",\n value: function isEnabled() {\n return this.hot.getSettings().fillHandle;\n }\n /**\n * Enables the plugin functionality for this Handsontable instance.\n */\n\n }, {\n key: \"enablePlugin\",\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.mapSettings();\n this.registerEvents();\n this.addHook('afterOnCellCornerMouseDown', function (event) {\n return _this2.onAfterCellCornerMouseDown(event);\n });\n this.addHook('afterOnCellCornerDblClick', function (event) {\n return _this2.onCellCornerDblClick(event);\n });\n this.addHook('beforeOnCellMouseOver', function (_, coords) {\n return _this2.onBeforeCellMouseOver(coords);\n });\n\n _get(_getPrototypeOf(Autofill.prototype), \"enablePlugin\", this).call(this);\n }\n /**\n * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked.\n */\n\n }, {\n key: \"updatePlugin\",\n value: function updatePlugin() {\n this.disablePlugin();\n this.enablePlugin();\n\n _get(_getPrototypeOf(Autofill.prototype), \"updatePlugin\", this).call(this);\n }\n /**\n * Disables the plugin functionality for this Handsontable instance.\n */\n\n }, {\n key: \"disablePlugin\",\n value: function disablePlugin() {\n this.clearMappedSettings();\n\n _get(_getPrototypeOf(Autofill.prototype), \"disablePlugin\", this).call(this);\n }\n /**\n * Gets selection data.\n *\n * @private\n * @returns {object[]} Ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.\n */\n\n }, {\n key: \"getSelectionData\",\n value: function getSelectionData() {\n var _this3 = this;\n\n var selection = this.hot.getSelectedRangeLast();\n\n var _selection$getTopLeft = selection.getTopLeftCorner(),\n startRow = _selection$getTopLeft.row,\n startCol = _selection$getTopLeft.col;\n\n var _selection$getBottomR = selection.getBottomRightCorner(),\n endRow = _selection$getBottomR.row,\n endCol = _selection$getBottomR.col;\n\n var copyableRanges = this.hot.runHooks('modifyCopyableRange', [{\n startRow: startRow,\n startCol: startCol,\n endRow: endRow,\n endCol: endCol\n }]);\n var copyableRows = [];\n var copyableColumns = [];\n var data = [];\n arrayEach(copyableRanges, function (range) {\n for (var visualRow = range.startRow; visualRow <= range.endRow; visualRow += 1) {\n if (copyableRows.indexOf(visualRow) === -1) {\n copyableRows.push(visualRow);\n }\n }\n\n for (var visualColumn = range.startCol; visualColumn <= range.endCol; visualColumn += 1) {\n if (copyableColumns.indexOf(visualColumn) === -1) {\n copyableColumns.push(visualColumn);\n }\n }\n });\n arrayEach(copyableRows, function (row) {\n var rowSet = [];\n arrayEach(copyableColumns, function (column) {\n rowSet.push(_this3.hot.getCopyableData(row, column));\n });\n data.push(rowSet);\n });\n return data;\n }\n /**\n * Try to apply fill values to the area in fill border, omitting the selection border.\n *\n * @private\n * @returns {boolean} Reports if fill was applied.\n *\n * @fires Hooks#modifyAutofillRange\n * @fires Hooks#beforeAutofill\n * @fires Hooks#afterAutofill\n */\n\n }, {\n key: \"fillIn\",\n value: function fillIn() {\n if (this.hot.selection.highlight.getFill().isEmpty()) {\n return false;\n } // Fill area may starts or ends with invisible cell. There won't be any information about it as highlighted\n // selection store just renderable indexes (It's part of Walkontable). I extrapolate where the start or/and\n // the end is.\n\n\n var _this$hot$selection$h = this.hot.selection.highlight.getFill().getVisualCorners(),\n _this$hot$selection$h2 = _slicedToArray(_this$hot$selection$h, 4),\n fillStartRow = _this$hot$selection$h2[0],\n fillStartColumn = _this$hot$selection$h2[1],\n fillEndRow = _this$hot$selection$h2[2],\n fillEndColumn = _this$hot$selection$h2[3];\n\n var selectionRangeLast = this.hot.getSelectedRangeLast();\n var topLeftCorner = selectionRangeLast.getTopLeftCorner();\n var bottomRightCorner = selectionRangeLast.getBottomRightCorner();\n this.resetSelectionOfDraggedArea();\n var cornersOfSelectedCells = [topLeftCorner.row, topLeftCorner.col, bottomRightCorner.row, bottomRightCorner.col];\n var cornersOfSelectionAndDragAreas = this.hot.runHooks('modifyAutofillRange', [Math.min(topLeftCorner.row, fillStartRow), Math.min(topLeftCorner.col, fillStartColumn), Math.max(bottomRightCorner.row, fillEndRow), Math.max(bottomRightCorner.col, fillEndColumn)], cornersOfSelectedCells);\n\n var _getDragDirectionAndR = getDragDirectionAndRange(cornersOfSelectedCells, cornersOfSelectionAndDragAreas),\n directionOfDrag = _getDragDirectionAndR.directionOfDrag,\n startOfDragCoords = _getDragDirectionAndR.startOfDragCoords,\n endOfDragCoords = _getDragDirectionAndR.endOfDragCoords;\n\n if (startOfDragCoords && startOfDragCoords.row > -1 && startOfDragCoords.col > -1) {\n var selectionData = this.getSelectionData();\n var sourceRange = selectionRangeLast.clone();\n var targetRange = new CellRange(startOfDragCoords, startOfDragCoords, endOfDragCoords);\n var beforeAutofillHookResult = this.hot.runHooks('beforeAutofill', selectionData, sourceRange, targetRange, directionOfDrag);\n\n if (beforeAutofillHookResult === false) {\n this.hot.selection.highlight.getFill().clear();\n this.hot.render();\n return false;\n } // TODO: The `hasFillDataChanged` hook argument allows skipping processing of the autofill\n // handler when the user modifies the fillData in the `beforeAutofill` hook. The workaround\n // is necessary for the Formulas plugin and can be removed after implementing the missing\n // feature for the HF (such as `getFillRangeData` method). With that the last argument could\n // be removed from the `afterAutofill` hook.\n\n\n var sourceFrom = sourceRange.from,\n sourceTo = sourceRange.to;\n var refData = this.hot.getData(sourceFrom.row, sourceFrom.col, sourceTo.row, sourceTo.col);\n var hasFillDataChanged = !isObjectEqual(refData, beforeAutofillHookResult);\n var deltas = getDeltas(startOfDragCoords, endOfDragCoords, selectionData, directionOfDrag);\n var fillData = beforeAutofillHookResult;\n var res = beforeAutofillHookResult;\n\n if (['up', 'left'].indexOf(directionOfDrag) > -1 && !(res.length === 1 && res[0].length === 0)) {\n fillData = [];\n\n if (directionOfDrag === 'up') {\n var dragLength = endOfDragCoords.row - startOfDragCoords.row + 1;\n var fillOffset = dragLength % res.length;\n\n for (var i = 0; i < dragLength; i++) {\n fillData.push(res[(i + (res.length - fillOffset)) % res.length]);\n }\n } else {\n var _dragLength = endOfDragCoords.col - startOfDragCoords.col + 1;\n\n var _fillOffset = _dragLength % res[0].length;\n\n for (var _i2 = 0; _i2 < res.length; _i2++) {\n fillData.push([]);\n\n for (var j = 0; j < _dragLength; j++) {\n fillData[_i2].push(res[_i2][(j + (res[_i2].length - _fillOffset)) % res[_i2].length]);\n }\n }\n }\n }\n\n this.hot.populateFromArray(startOfDragCoords.row, startOfDragCoords.col, fillData, endOfDragCoords.row, endOfDragCoords.col, \"\".concat(this.pluginName, \".fill\"), null, directionOfDrag, deltas);\n this.setSelection(cornersOfSelectionAndDragAreas);\n this.hot.runHooks('afterAutofill', fillData, sourceRange, targetRange, directionOfDrag, hasFillDataChanged);\n this.hot.render();\n } else {\n // reset to avoid some range bug\n this.hot._refreshBorders();\n }\n\n return true;\n }\n /**\n * Reduces the selection area if the handle was dragged outside of the table or on headers.\n *\n * @private\n * @param {CellCoords} coords Indexes of selection corners.\n * @returns {CellCoords}\n */\n\n }, {\n key: \"reduceSelectionAreaIfNeeded\",\n value: function reduceSelectionAreaIfNeeded(coords) {\n if (coords.row < 0) {\n coords.row = 0;\n }\n\n if (coords.col < 0) {\n coords.col = 0;\n }\n\n return coords;\n }\n /**\n * Gets the coordinates of the drag & drop borders.\n *\n * @private\n * @param {CellCoords} coordsOfSelection `CellCoords` coord object.\n * @returns {CellCoords}\n */\n\n }, {\n key: \"getCoordsOfDragAndDropBorders\",\n value: function getCoordsOfDragAndDropBorders(coordsOfSelection) {\n var currentSelection = this.hot.getSelectedRangeLast();\n var bottomRightCorner = currentSelection.getBottomRightCorner();\n var coords = coordsOfSelection;\n\n if (this.directions.includes(DIRECTIONS.vertical) && this.directions.includes(DIRECTIONS.horizontal)) {\n var topLeftCorner = currentSelection.getTopLeftCorner();\n\n if (bottomRightCorner.col <= coordsOfSelection.col || topLeftCorner.col >= coordsOfSelection.col) {\n coords = new CellCoords(bottomRightCorner.row, coordsOfSelection.col);\n }\n\n if (bottomRightCorner.row < coordsOfSelection.row || topLeftCorner.row > coordsOfSelection.row) {\n coords = new CellCoords(coordsOfSelection.row, bottomRightCorner.col);\n }\n } else if (this.directions.includes(DIRECTIONS.vertical)) {\n coords = new CellCoords(coordsOfSelection.row, bottomRightCorner.col);\n } else if (this.directions.includes(DIRECTIONS.horizontal)) {\n coords = new CellCoords(bottomRightCorner.row, coordsOfSelection.col);\n } else {\n // wrong direction\n return;\n }\n\n return this.reduceSelectionAreaIfNeeded(coords);\n }\n /**\n * Show the fill border.\n *\n * @private\n * @param {CellCoords} coordsOfSelection `CellCoords` coord object.\n */\n\n }, {\n key: \"showBorder\",\n value: function showBorder(coordsOfSelection) {\n var coordsOfDragAndDropBorders = this.getCoordsOfDragAndDropBorders(coordsOfSelection);\n\n if (coordsOfDragAndDropBorders) {\n this.redrawBorders(coordsOfDragAndDropBorders);\n }\n }\n /**\n * Add new row.\n *\n * @private\n */\n\n }, {\n key: \"addRow\",\n value: function addRow() {\n var _this4 = this;\n\n this.hot._registerTimeout(function () {\n _this4.hot.alter(INSERT_ROW_ALTER_ACTION_NAME, void 0, 1, \"\".concat(_this4.pluginName, \".fill\"));\n\n _this4.addingStarted = false;\n }, INTERVAL_FOR_ADDING_ROW);\n }\n /**\n * Add new rows if they are needed to continue auto-filling values.\n *\n * @private\n */\n\n }, {\n key: \"addNewRowIfNeeded\",\n value: function addNewRowIfNeeded() {\n if (!this.hot.selection.highlight.getFill().isEmpty() && this.addingStarted === false && this.autoInsertRow) {\n var cornersOfSelectedCells = this.hot.getSelectedLast();\n var cornersOfSelectedDragArea = this.hot.selection.highlight.getFill().getVisualCorners();\n var nrOfTableRows = this.hot.countRows();\n\n if (cornersOfSelectedCells[2] < nrOfTableRows - 1 && cornersOfSelectedDragArea[2] === nrOfTableRows - 1) {\n this.addingStarted = true;\n this.addRow();\n }\n }\n }\n /**\n * Get index of last adjacent filled in row.\n *\n * @private\n * @param {Array} cornersOfSelectedCells Indexes of selection corners.\n * @returns {number} Gives number greater than or equal to zero when selection adjacent can be applied.\n * Or -1 when selection adjacent can't be applied.\n */\n\n }, {\n key: \"getIndexOfLastAdjacentFilledInRow\",\n value: function getIndexOfLastAdjacentFilledInRow(cornersOfSelectedCells) {\n var data = this.hot.getData();\n var nrOfTableRows = this.hot.countRows();\n var lastFilledInRowIndex;\n\n for (var rowIndex = cornersOfSelectedCells[2] + 1; rowIndex < nrOfTableRows; rowIndex++) {\n for (var columnIndex = cornersOfSelectedCells[1]; columnIndex <= cornersOfSelectedCells[3]; columnIndex++) {\n var dataInCell = data[rowIndex][columnIndex];\n\n if (dataInCell) {\n return -1;\n }\n }\n\n var dataInNextLeftCell = data[rowIndex][cornersOfSelectedCells[1] - 1];\n var dataInNextRightCell = data[rowIndex][cornersOfSelectedCells[3] + 1];\n\n if (!!dataInNextLeftCell || !!dataInNextRightCell) {\n lastFilledInRowIndex = rowIndex;\n }\n }\n\n return lastFilledInRowIndex;\n }\n /**\n * Adds a selection from the start area to the specific row index.\n *\n * @private\n * @param {Array} selectStartArea Selection area from which we start to create more comprehensive selection.\n * @param {number} rowIndex The row index into the selection will be added.\n */\n\n }, {\n key: \"addSelectionFromStartAreaToSpecificRowIndex\",\n value: function addSelectionFromStartAreaToSpecificRowIndex(selectStartArea, rowIndex) {\n this.hot.selection.highlight.getFill().clear().add(new CellCoords(selectStartArea[0], selectStartArea[1])).add(new CellCoords(rowIndex, selectStartArea[3])).commit();\n }\n /**\n * Sets selection based on passed corners.\n *\n * @private\n * @param {Array} cornersOfArea An array witch defines selection.\n */\n\n }, {\n key: \"setSelection\",\n value: function setSelection(cornersOfArea) {\n var _this$hot;\n\n (_this$hot = this.hot).selectCell.apply(_this$hot, _toConsumableArray(arrayMap(cornersOfArea, function (index) {\n return Math.max(index, 0);\n })).concat([false, false]));\n }\n /**\n * Try to select cells down to the last row in the left column and then returns if selection was applied.\n *\n * @private\n * @returns {boolean}\n */\n\n }, {\n key: \"selectAdjacent\",\n value: function selectAdjacent() {\n var cornersOfSelectedCells = this.hot.getSelectedLast();\n var lastFilledInRowIndex = this.getIndexOfLastAdjacentFilledInRow(cornersOfSelectedCells);\n\n if (lastFilledInRowIndex === -1 || lastFilledInRowIndex === void 0) {\n return false;\n }\n\n this.addSelectionFromStartAreaToSpecificRowIndex(cornersOfSelectedCells, lastFilledInRowIndex);\n return true;\n }\n /**\n * Resets selection of dragged area.\n *\n * @private\n */\n\n }, {\n key: \"resetSelectionOfDraggedArea\",\n value: function resetSelectionOfDraggedArea() {\n this.handleDraggedCells = 0;\n this.hot.selection.highlight.getFill().clear();\n }\n /**\n * Redraws borders.\n *\n * @private\n * @param {CellCoords} coords `CellCoords` coord object.\n */\n\n }, {\n key: \"redrawBorders\",\n value: function redrawBorders(coords) {\n this.hot.selection.highlight.getFill().clear().add(this.hot.getSelectedRangeLast().from).add(this.hot.getSelectedRangeLast().to).add(coords).commit();\n this.hot.view.render();\n }\n /**\n * Get if mouse was dragged outside.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n * @returns {boolean}\n */\n\n }, {\n key: \"getIfMouseWasDraggedOutside\",\n value: function getIfMouseWasDraggedOutside(event) {\n var documentElement = this.hot.rootDocument.documentElement;\n var tableBottom = offset(this.hot.table).top - (this.hot.rootWindow.pageYOffset || documentElement.scrollTop) + outerHeight(this.hot.table);\n var tableRight = offset(this.hot.table).left - (this.hot.rootWindow.pageXOffset || documentElement.scrollLeft) + outerWidth(this.hot.table);\n return event.clientY > tableBottom && event.clientX <= tableRight;\n }\n /**\n * Bind the events used by the plugin.\n *\n * @private\n */\n\n }, {\n key: \"registerEvents\",\n value: function registerEvents() {\n var _this5 = this;\n\n var documentElement = this.hot.rootDocument.documentElement;\n this.eventManager.addEventListener(documentElement, 'mouseup', function () {\n return _this5.onMouseUp();\n });\n this.eventManager.addEventListener(documentElement, 'mousemove', function (event) {\n return _this5.onMouseMove(event);\n });\n }\n /**\n * On cell corner double click callback.\n *\n * @private\n */\n\n }, {\n key: \"onCellCornerDblClick\",\n value: function onCellCornerDblClick() {\n var selectionApplied = this.selectAdjacent();\n\n if (selectionApplied) {\n this.fillIn();\n }\n }\n /**\n * On after cell corner mouse down listener.\n *\n * @private\n */\n\n }, {\n key: \"onAfterCellCornerMouseDown\",\n value: function onAfterCellCornerMouseDown() {\n this.handleDraggedCells = 1;\n this.mouseDownOnCellCorner = true;\n }\n /**\n * On before cell mouse over listener.\n *\n * @private\n * @param {CellCoords} coords `CellCoords` coord object.\n */\n\n }, {\n key: \"onBeforeCellMouseOver\",\n value: function onBeforeCellMouseOver(coords) {\n if (this.mouseDownOnCellCorner && !this.hot.view.isMouseDown() && this.handleDraggedCells) {\n this.handleDraggedCells += 1;\n this.showBorder(coords);\n this.addNewRowIfNeeded();\n }\n }\n /**\n * On mouse up listener.\n *\n * @private\n */\n\n }, {\n key: \"onMouseUp\",\n value: function onMouseUp() {\n if (this.handleDraggedCells) {\n if (this.handleDraggedCells > 1) {\n this.fillIn();\n }\n\n this.handleDraggedCells = 0;\n this.mouseDownOnCellCorner = false;\n }\n }\n /**\n * On mouse move listener.\n *\n * @private\n * @param {MouseEvent} event `mousemove` event properties.\n */\n\n }, {\n key: \"onMouseMove\",\n value: function onMouseMove(event) {\n var mouseWasDraggedOutside = this.getIfMouseWasDraggedOutside(event);\n\n if (this.addingStarted === false && this.handleDraggedCells > 0 && mouseWasDraggedOutside) {\n this.mouseDragOutside = true;\n this.addingStarted = true;\n } else {\n this.mouseDragOutside = false;\n }\n\n if (this.mouseDragOutside && this.autoInsertRow) {\n this.addRow();\n }\n }\n /**\n * Clears mapped settings.\n *\n * @private\n */\n\n }, {\n key: \"clearMappedSettings\",\n value: function clearMappedSettings() {\n this.directions.length = 0;\n this.autoInsertRow = false;\n }\n /**\n * Map settings.\n *\n * @private\n */\n\n }, {\n key: \"mapSettings\",\n value: function mapSettings() {\n var mappedSettings = getMappedFillHandleSetting(this.hot.getSettings().fillHandle);\n this.directions = mappedSettings.directions;\n this.autoInsertRow = mappedSettings.autoInsertRow;\n }\n /**\n * Destroys the plugin instance.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(Autofill.prototype), \"destroy\", this).call(this);\n }\n }], [{\n key: \"PLUGIN_KEY\",\n get: function get() {\n return PLUGIN_KEY;\n }\n }, {\n key: \"PLUGIN_PRIORITY\",\n get: function get() {\n return PLUGIN_PRIORITY;\n }\n }]);\n\n return Autofill;\n}(BasePlugin);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/web.timers.js\";\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.function.name.js\";\nimport \"core-js/modules/es.array.from.js\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { BasePlugin } from \"../base/index.mjs\";\nimport { arrayEach, arrayFilter } from \"../../helpers/array.mjs\";\nimport { cancelAnimationFrame, requestAnimationFrame } from \"../../helpers/feature.mjs\";\nimport { isVisible } from \"../../helpers/dom/element.mjs\";\nimport GhostTable from \"../../utils/ghostTable.mjs\";\nimport { isObject, hasOwnProperty } from \"../../helpers/object.mjs\";\nimport { valueAccordingPercent, rangeEach } from \"../../helpers/number.mjs\";\nimport SamplesGenerator from \"../../utils/samplesGenerator.mjs\";\nimport { isPercentValue } from \"../../helpers/string.mjs\";\nimport { PhysicalIndexToValueMap as IndexToValueMap } from \"../../translations/index.mjs\";\nexport var PLUGIN_KEY = 'autoRowSize';\nexport var PLUGIN_PRIORITY = 40;\nvar ROW_WIDTHS_MAP_NAME = 'autoRowSize';\n/* eslint-disable jsdoc/require-description-complete-sentence */\n\n/**\n * @plugin AutoRowSize\n * @class AutoRowSize\n * @description\n * This plugin allows to set row heights based on their highest cells.\n *\n * By default, the plugin is declared as `undefined`, which makes it disabled (same as if it was declared as `false`).\n * Enabling this plugin may decrease the overall table performance, as it needs to calculate the heights of all cells to\n * resize the rows accordingly.\n * If you experience problems with the performance, try turning this feature off and declaring the row heights manually.\n *\n * Row height calculations are divided into sync and async part. Each of this parts has their own advantages and\n * disadvantages. Synchronous calculations are faster but they block the browser UI, while the slower asynchronous\n * operations don't block the browser UI.\n *\n * To configure the sync/async distribution, you can pass an absolute value (number of rows) or a percentage value to a config object:\n * ```js\n * // as a number (300 rows in sync, rest async)\n * autoRowSize: {syncLimit: 300},.\n *\n * // as a string (percent)\n * autoRowSize: {syncLimit: '40%'},.\n *\n * // allow sample duplication\n * autoRowSize: {syncLimit: '40%', allowSampleDuplicates: true},\n * ```\n *\n * You can also use the `allowSampleDuplicates` option to allow sampling duplicate values when calculating the row\n * height. __Note__, that this might have a negative impact on performance.\n *\n * To configure this plugin see {@link options#autorowsize Options#autoRowSize}.\n *\n * @example\n *\n * ```js\n * const hot = new Handsontable(document.getElementById('example'), {\n * data: getData(),\n * autoRowSize: true\n * });\n * // Access to plugin instance:\n * const plugin = hot.getPlugin('autoRowSize');\n *\n * plugin.getRowHeight(4);\n *\n * if (plugin.isEnabled()) {\n * // code...\n * }\n * ```\n */\n\n/* eslint-enable jsdoc/require-description-complete-sentence */\n\nexport var AutoRowSize = /*#__PURE__*/function (_BasePlugin) {\n _inherits(AutoRowSize, _BasePlugin);\n\n var _super = _createSuper(AutoRowSize);\n\n function AutoRowSize(hotInstance) {\n var _this;\n\n _classCallCheck(this, AutoRowSize);\n\n _this = _super.call(this, hotInstance);\n /**\n * PhysicalIndexToValueMap to keep and track heights for physical row indexes.\n *\n * @private\n * @type {PhysicalIndexToValueMap}\n */\n\n _this.rowHeightsMap = void 0;\n /**\n * Columns header's height cache.\n *\n * @private\n * @type {number}\n */\n\n _this.headerHeight = null;\n /**\n * Instance of {@link GhostTable} for rows and columns size calculations.\n *\n * @private\n * @type {GhostTable}\n */\n\n _this.ghostTable = new GhostTable(_this.hot);\n /**\n * Instance of {@link SamplesGenerator} for generating samples necessary for rows height calculations.\n *\n * @private\n * @type {SamplesGenerator}\n */\n\n _this.samplesGenerator = new SamplesGenerator(function (row, col) {\n var cellValue;\n\n if (row >= 0) {\n cellValue = _this.hot.getDataAtCell(row, col);\n } else if (row === -1) {\n cellValue = _this.hot.getColHeader(col);\n }\n\n return {\n value: cellValue\n };\n });\n /**\n * `true` if only the first calculation was performed.\n *\n * @private\n * @type {boolean}\n */\n\n _this.firstCalculation = true;\n /**\n * `true` if the size calculation is in progress.\n *\n * @type {boolean}\n */\n\n _this.inProgress = false;\n /**\n * Number of already measured rows (we already know their sizes).\n *\n * @type {number}\n */\n\n _this.measuredRows = 0;\n /**\n * PhysicalIndexToValueMap to keep and track heights for physical row indexes.\n *\n * @private\n * @type {PhysicalIndexToValueMap}\n */\n\n _this.rowHeightsMap = new IndexToValueMap();\n\n _this.hot.rowIndexMapper.registerMap(ROW_WIDTHS_MAP_NAME, _this.rowHeightsMap); // Leave the listener active to allow auto-sizing the rows when the plugin is disabled.\n // This is necesseary for height recalculation for resize handler doubleclick (ManualRowResize).\n\n\n _this.addHook('beforeRowResize', function (size, row, isDblClick) {\n return _this.onBeforeRowResize(size, row, isDblClick);\n });\n\n return _this;\n }\n /**\n * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link hooks#beforeinit Hooks#beforeInit}\n * hook and if it returns `true` than the {@link auto-row-size#enableplugin AutoRowSize#enablePlugin} method is called.\n *\n * @returns {boolean}\n */\n\n\n _createClass(AutoRowSize, [{\n key: \"isEnabled\",\n value: function isEnabled() {\n var settings = this.hot.getSettings()[PLUGIN_KEY];\n return settings === true || isObject(settings);\n }\n /**\n * Enables the plugin functionality for this Handsontable instance.\n */\n\n }, {\n key: \"enablePlugin\",\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n this.setSamplingOptions();\n this.addHook('afterLoadData', function () {\n return _this2.onAfterLoadData();\n });\n this.addHook('beforeChange', function (changes) {\n return _this2.onBeforeChange(changes);\n });\n this.addHook('beforeColumnResize', function () {\n return _this2.recalculateAllRowsHeight();\n });\n this.addHook('beforeRender', function (force) {\n return _this2.onBeforeRender(force);\n });\n this.addHook('modifyRowHeight', function (height, row) {\n return _this2.getRowHeight(row, height);\n });\n this.addHook('modifyColumnHeaderHeight', function () {\n return _this2.getColumnHeaderHeight();\n });\n\n _get(_getPrototypeOf(AutoRowSize.prototype), \"enablePlugin\", this).call(this);\n }\n /**\n * Disables the plugin functionality for this Handsontable instance.\n */\n\n }, {\n key: \"disablePlugin\",\n value: function disablePlugin() {\n var _this3 = this;\n\n this.headerHeight = null;\n\n _get(_getPrototypeOf(AutoRowSize.prototype), \"disablePlugin\", this).call(this); // Leave the listener active to allow auto-sizing the rows when the plugin is disabled.\n // This is necesseary for height recalculation for resize handler doubleclick (ManualRowResize).\n\n\n this.addHook('beforeRowResize', function (size, row, isDblClick) {\n return _this3.onBeforeRowResize(size, row, isDblClick);\n });\n }\n /**\n * Calculate a given rows height.\n *\n * @param {number|object} rowRange Row index or an object with `from` and `to` indexes as a range.\n * @param {number|object} colRange Column index or an object with `from` and `to` indexes as a range.\n * @param {boolean} [force=false] If `true` the calculation will be processed regardless of whether the width exists in the cache.\n */\n\n }, {\n key: \"calculateRowsHeight\",\n value: function calculateRowsHeight() {\n var _this4 = this;\n\n var rowRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n from: 0,\n to: this.hot.countRows() - 1\n };\n var colRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n from: 0,\n to: this.hot.countCols() - 1\n };\n var force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n // eslint-disable-line max-len\n var rowsRange = typeof rowRange === 'number' ? {\n from: rowRange,\n to: rowRange\n } : rowRange;\n var columnsRange = typeof colRange === 'number' ? {\n from: colRange,\n to: colRange\n } : colRange;\n\n if (this.hot.getColHeader(0) !== null) {\n var samples = this.samplesGenerator.generateRowSamples(-1, columnsRange);\n this.ghostTable.addColumnHeadersRow(samples.get(-1));\n }\n\n rangeEach(rowsRange.from, rowsRange.to, function (row) {\n // For rows we must calculate row height even when user had set height value manually.\n // We can shrink column but cannot shrink rows!\n if (force || _this4.rowHeightsMap.getValueAtIndex(row) === null) {\n var _samples = _this4.samplesGenerator.generateRowSamples(row, columnsRange);\n\n arrayEach(_samples, function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n rowIndex = _ref2[0],\n sample = _ref2[1];\n\n return _this4.ghostTable.addRow(rowIndex, sample);\n });\n }\n });\n\n if (this.ghostTable.rows.length) {\n this.hot.batchExecution(function () {\n _this4.ghostTable.getHeights(function (row, height) {\n if (row < 0) {\n _this4.headerHeight = height;\n } else {\n _this4.rowHeightsMap.setValueAtIndex(_this4.hot.toPhysicalRow(row), height);\n }\n });\n }, true);\n this.measuredRows = rowsRange.to + 1;\n this.ghostTable.clean();\n }\n }\n /**\n * Calculate all rows heights. The calculated row will be cached in the {@link auto-row-size#heights AutoRowSize#heights} property.\n * To retrieve height for specified row use {@link auto-row-size#getrowheight AutoRowSize#getRowHeight} method.\n *\n * @param {object|number} colRange Row index or an object with `from` and `to` properties which define row range.\n */\n\n }, {\n key: \"calculateAllRowsHeight\",\n value: function calculateAllRowsHeight() {\n var _this5 = this;\n\n var colRange = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n from: 0,\n to: this.hot.countCols() - 1\n };\n var current = 0;\n var length = this.hot.countRows() - 1;\n var timer = null;\n this.inProgress = true;\n\n var loop = function loop() {\n // When hot was destroyed after calculating finished cancel frame\n if (!_this5.hot) {\n cancelAnimationFrame(timer);\n _this5.inProgress = false;\n return;\n }\n\n _this5.calculateRowsHeight({\n from: current,\n to: Math.min(current + AutoRowSize.CALCULATION_STEP, length)\n }, colRange);\n\n current = current + AutoRowSize.CALCULATION_STEP + 1;\n\n if (current < length) {\n timer = requestAnimationFrame(loop);\n } else {\n cancelAnimationFrame(timer);\n _this5.inProgress = false; // @TODO Should call once per render cycle, currently fired separately in different plugins\n\n _this5.hot.view.adjustElementsSize(true); // tmp\n\n\n if (_this5.hot.view.wt.wtOverlays.leftOverlay.needFullRender) {\n _this5.hot.view.wt.wtOverlays.leftOverlay.clone.draw();\n }\n }\n };\n\n var syncLimit = this.getSyncCalculationLimit(); // sync\n\n if (this.firstCalculation && syncLimit >= 0) {\n this.calculateRowsHeight({\n from: 0,\n to: syncLimit\n }, colRange);\n this.firstCalculation = false;\n current = syncLimit + 1;\n } // async\n\n\n if (current < length) {\n loop();\n } else {\n this.inProgress = false;\n this.hot.view.adjustElementsSize(false);\n }\n }\n /**\n * Sets the sampling options.\n *\n * @private\n */\n\n }, {\n key: \"setSamplingOptions\",\n value: function setSamplingOptions() {\n var setting = this.hot.getSettings()[PLUGIN_KEY];\n var samplingRatio = setting && hasOwnProperty(setting, 'samplingRatio') ? setting.samplingRatio : void 0;\n var allowSampleDuplicates = setting && hasOwnProperty(setting, 'allowSampleDuplicates') ? setting.allowSampleDuplicates : void 0;\n\n if (samplingRatio && !isNaN(samplingRatio)) {\n this.samplesGenerator.setSampleCount(parseInt(samplingRatio, 10));\n }\n\n if (allowSampleDuplicates) {\n this.samplesGenerator.setAllowDuplicates(allowSampleDuplicates);\n }\n }\n /**\n * Recalculates all rows height (overwrite cache values).\n */\n\n }, {\n key: \"recalculateAllRowsHeight\",\n value: function recalculateAllRowsHeight() {\n if (isVisible(this.hot.view.wt.wtTable.TABLE)) {\n this.clearCache();\n this.calculateAllRowsHeight();\n }\n }\n /**\n * Gets value which tells how many rows should be calculated synchronously (rest of the rows will be calculated\n * asynchronously). The limit is calculated based on `syncLimit` set to autoRowSize option (see {@link options#autorowsize Options#autoRowSize}).\n *\n * @returns {number}\n */\n\n }, {\n key: \"getSyncCalculationLimit\",\n value: function getSyncCalculationLimit() {\n var settings = this.hot.getSettings()[PLUGIN_KEY];\n /* eslint-disable no-bitwise */\n\n var limit = AutoRowSize.SYNC_CALCULATION_LIMIT;\n var rowsLimit = this.hot.countRows() - 1;\n\n if (isObject(settings)) {\n limit = settings.syncLimit;\n\n if (isPercentValue(limit)) {\n limit = valueAccordingPercent(rowsLimit, limit);\n } else {\n // Force to Number\n limit >>= 0;\n }\n }\n\n return Math.min(limit, rowsLimit);\n }\n /**\n * Gets the calculated row height.\n *\n * @param {number} row Visual row index.\n * @param {number} [defaultHeight] Default row height. It will be picked up if no calculated height found.\n * @returns {number}\n */\n\n }, {\n key: \"getRowHeight\",\n value: function getRowHeight(row) {\n var defaultHeight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : void 0;\n var cachedHeight = row < 0 ? this.headerHeight : this.rowHeightsMap.getValueAtIndex(this.hot.toPhysicalRow(row));\n var height = defaultHeight;\n\n if (cachedHeight !== null && cachedHeight > (defaultHeight || 0)) {\n height = cachedHeight;\n }\n\n return height;\n }\n /**\n * Get the calculated column header height.\n *\n * @returns {number|undefined}\n */\n\n }, {\n key: \"getColumnHeaderHeight\",\n value: function getColumnHeaderHeight() {\n return this.headerHeight;\n }\n /**\n * Get the first visible row.\n *\n * @returns {number} Returns row index, -1 if table is not rendered or if there are no rows to base the the calculations on.\n */\n\n }, {\n key: \"getFirstVisibleRow\",\n value: function getFirstVisibleRow() {\n var wot = this.hot.view.wt;\n\n if (wot.wtViewport.rowsVisibleCalculator) {\n return wot.wtTable.getFirstVisibleRow();\n }\n\n if (wot.wtViewport.rowsRenderCalculator) {\n return wot.wtTable.getFirstRenderedRow();\n }\n\n return -1;\n }\n /**\n * Gets the last visible row.\n *\n * @returns {number} Returns row index or -1 if table is not rendered.\n */\n\n }, {\n key: \"getLastVisibleRow\",\n value: function getLastVisibleRow() {\n var wot = this.hot.view.wt;\n\n if (wot.wtViewport.rowsVisibleCalculator) {\n return wot.wtTable.getLastVisibleRow();\n }\n\n if (wot.wtViewport.rowsRenderCalculator) {\n return wot.wtTable.getLastRenderedRow();\n }\n\n return -1;\n }\n /**\n * Clears cached heights.\n */\n\n }, {\n key: \"clearCache\",\n value: function clearCache() {\n this.headerHeight = null;\n this.rowHeightsMap.init();\n }\n /**\n * Clears cache by range.\n *\n * @param {object|number} range Row index or an object with `from` and `to` properties which define row range.\n */\n\n }, {\n key: \"clearCacheByRange\",\n value: function clearCacheByRange(range) {\n var _this6 = this;\n\n var _ref3 = typeof range === 'number' ? {\n from: range,\n to: range\n } : range,\n from = _ref3.from,\n to = _ref3.to;\n\n this.hot.batchExecution(function () {\n rangeEach(Math.min(from, to), Math.max(from, to), function (row) {\n _this6.rowHeightsMap.setValueAtIndex(row, null);\n });\n }, true);\n }\n /**\n * Checks if all heights were calculated. If not then return `true` (need recalculate).\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isNeedRecalculate\",\n value: function isNeedRecalculate() {\n return !!arrayFilter(this.rowHeightsMap.getValues().slice(0, this.measuredRows), function (item) {\n return item === null;\n }).length;\n }\n /**\n * On before render listener.\n *\n * @private\n */\n\n }, {\n key: \"onBeforeRender\",\n value: function onBeforeRender() {\n var force = this.hot.renderCall;\n var fixedRowsBottom = this.hot.getSettings().fixedRowsBottom;\n var firstVisibleRow = this.getFirstVisibleRow();\n var lastVisibleRow = this.getLastVisibleRow();\n\n if (firstVisibleRow === -1 || lastVisibleRow === -1) {\n return;\n }\n\n this.calculateRowsHeight({\n from: firstVisibleRow,\n to: lastVisibleRow\n }, void 0, force); // Calculate rows height synchronously for bottom overlay\n\n if (fixedRowsBottom) {\n var totalRows = this.hot.countRows() - 1;\n this.calculateRowsHeight({\n from: totalRows - fixedRowsBottom,\n to: totalRows\n });\n }\n\n if (this.isNeedRecalculate() && !this.inProgress) {\n this.calculateAllRowsHeight();\n }\n }\n /**\n * On before row move listener.\n *\n * @private\n * @param {number} from Row index where was grabbed.\n * @param {number} to Destination row index.\n */\n\n }, {\n key: \"onBeforeRowMove\",\n value: function onBeforeRowMove(from, to) {\n this.clearCacheByRange({\n from: from,\n to: to\n });\n this.calculateAllRowsHeight();\n }\n /**\n * On before row resize listener.\n *\n * @private\n * @param {number} size The size of the current row index.\n * @param {number} row Current row index.\n * @param {boolean} isDblClick Indicates if the resize was triggered by doubleclick.\n * @returns {number}\n */\n\n }, {\n key: \"onBeforeRowResize\",\n value: function onBeforeRowResize(size, row, isDblClick) {\n var newSize = size;\n\n if (isDblClick) {\n this.calculateRowsHeight(row, void 0, true);\n newSize = this.getRowHeight(row);\n }\n\n return newSize;\n }\n /**\n * On after load data listener.\n *\n * @private\n */\n\n }, {\n key: \"onAfterLoadData\",\n value: function onAfterLoadData() {\n var _this7 = this;\n\n if (this.hot.view) {\n this.recalculateAllRowsHeight();\n } else {\n // first load - initialization\n setTimeout(function () {\n if (_this7.hot) {\n _this7.recalculateAllRowsHeight();\n }\n }, 0);\n }\n }\n /**\n * On before change listener.\n *\n * @private\n * @param {Array} changes 2D array containing information about each of the edited cells.\n */\n\n }, {\n key: \"onBeforeChange\",\n value: function onBeforeChange(changes) {\n var range = null;\n\n if (changes.length === 1) {\n range = changes[0][0];\n } else if (changes.length > 1) {\n range = {\n from: changes[0][0],\n to: changes[changes.length - 1][0]\n };\n }\n\n if (range !== null) {\n this.clearCacheByRange(range);\n }\n }\n /**\n * Destroys the plugin instance.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.ghostTable.clean();\n\n _get(_getPrototypeOf(AutoRowSize.prototype), \"destroy\", this).call(this);\n }\n }], [{\n key: \"PLUGIN_KEY\",\n get: function get() {\n return PLUGIN_KEY;\n }\n }, {\n key: \"PLUGIN_PRIORITY\",\n get: function get() {\n return PLUGIN_PRIORITY;\n }\n }, {\n key: \"CALCULATION_STEP\",\n get: function get() {\n return 50;\n }\n }, {\n key: \"SYNC_CALCULATION_LIMIT\",\n get: function get() {\n return 500;\n }\n }]);\n\n return AutoRowSize;\n}(BasePlugin);","import \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport { getDecreasedIndexes, getIncreasedIndexes } from \"./actionsOnIndexes.mjs\";\nimport { getListWithInsertedItems as sequenceStrategyInsert, getListWithRemovedItems as sequenceStrategyRemove } from \"./indexesSequence.mjs\";\nimport { getListWithInsertedItems as physicalStrategyInsert, getListWithRemovedItems as physicalStrategyRemove } from \"./physicallyIndexed.mjs\";\nvar alterStrategies = new Map([['indexesSequence', {\n getListWithInsertedItems: sequenceStrategyInsert,\n getListWithRemovedItems: sequenceStrategyRemove\n}], ['physicallyIndexed', {\n getListWithInsertedItems: physicalStrategyInsert,\n getListWithRemovedItems: physicalStrategyRemove\n}]]);\n\nvar alterUtilsFactory = function alterUtilsFactory(indexationStrategy) {\n if (alterStrategies.has(indexationStrategy) === false) {\n throw new Error(\"Alter strategy with ID '\".concat(indexationStrategy, \"' does not exist.\"));\n }\n\n return alterStrategies.get(indexationStrategy);\n};\n\nexport { getDecreasedIndexes, getIncreasedIndexes, alterUtilsFactory };","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { IndexMap, alterUtilsFactory, getDecreasedIndexes, getIncreasedIndexes } from \"../../../translations/index.mjs\";\n\nvar _alterUtilsFactory = alterUtilsFactory('physicallyIndexed'),\n getListWithInsertedItems = _alterUtilsFactory.getListWithInsertedItems,\n getListWithRemovedItems = _alterUtilsFactory.getListWithRemovedItems;\n/**\n * Map from physical index to another index.\n */\n\n\nvar LooseBindsMap = /*#__PURE__*/function (_IndexMap) {\n _inherits(LooseBindsMap, _IndexMap);\n\n var _super = _createSuper(LooseBindsMap);\n\n function LooseBindsMap() {\n _classCallCheck(this, LooseBindsMap);\n\n return _super.call(this, function (index) {\n return index;\n });\n }\n /**\n * Add values to list and reorganize.\n *\n * @private\n * @param {number} insertionIndex Position inside the list.\n * @param {Array} insertedIndexes List of inserted indexes.\n */\n\n\n _createClass(LooseBindsMap, [{\n key: \"insert\",\n value: function insert(insertionIndex, insertedIndexes) {\n var listAfterUpdate = getIncreasedIndexes(this.indexedValues, insertedIndexes);\n this.indexedValues = getListWithInsertedItems(listAfterUpdate, insertionIndex, insertedIndexes, this.initValueOrFn);\n\n _get(_getPrototypeOf(LooseBindsMap.prototype), \"insert\", this).call(this, insertionIndex, insertedIndexes);\n }\n /**\n * Remove values from the list and reorganize.\n *\n * @private\n * @param {Array} removedIndexes List of removed indexes.\n */\n\n }, {\n key: \"remove\",\n value: function remove(removedIndexes) {\n var listAfterUpdate = getListWithRemovedItems(this.indexedValues, removedIndexes);\n this.indexedValues = getDecreasedIndexes(listAfterUpdate, removedIndexes);\n\n _get(_getPrototypeOf(LooseBindsMap.prototype), \"remove\", this).call(this, removedIndexes);\n }\n }]);\n\n return LooseBindsMap;\n}(IndexMap);\n\nexport default LooseBindsMap;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport { IndexMap, alterUtilsFactory } from \"../../../translations/index.mjs\";\n\nvar _alterUtilsFactory = alterUtilsFactory('physicallyIndexed'),\n getListWithInsertedItems = _alterUtilsFactory.getListWithInsertedItems,\n getListWithRemovedItems = _alterUtilsFactory.getListWithRemovedItems;\n/**\n * Map from physical index to another index.\n */\n\n\nvar StrictBindsMap = /*#__PURE__*/function (_IndexMap) {\n _inherits(StrictBindsMap, _IndexMap);\n\n var _super = _createSuper(StrictBindsMap);\n\n function StrictBindsMap() {\n _classCallCheck(this, StrictBindsMap);\n\n return _super.call(this, function (index) {\n return index;\n });\n }\n /**\n * Add values to list and reorganize.\n *\n * @private\n * @param {number} insertionIndex Position inside the list.\n * @param {Array} insertedIndexes List of inserted indexes.\n */\n\n\n _createClass(StrictBindsMap, [{\n key: \"insert\",\n value: function insert(insertionIndex, insertedIndexes) {\n var _this = this;\n\n this.indexedValues = getListWithInsertedItems(this.indexedValues, insertionIndex, insertedIndexes, function (_, ordinalNumber) {\n return _this.getNextValue(ordinalNumber);\n });\n\n _get(_getPrototypeOf(StrictBindsMap.prototype), \"insert\", this).call(this, insertionIndex, insertedIndexes);\n }\n /**\n * Remove values from the list and reorganize.\n *\n * @private\n * @param {Array} removedIndexes List of removed indexes.\n */\n\n }, {\n key: \"remove\",\n value: function remove(removedIndexes) {\n this.indexedValues = getListWithRemovedItems(this.indexedValues, removedIndexes);\n\n _get(_getPrototypeOf(StrictBindsMap.prototype), \"remove\", this).call(this, removedIndexes);\n }\n /**\n * Get next values, which should be greater than actual maximum value in the list.\n *\n * @param {number} ordinalNumber Position in the list.\n * @returns {number}\n */\n\n }, {\n key: \"getNextValue\",\n value: function getNextValue(ordinalNumber) {\n return Math.max.apply(Math, _toConsumableArray(this.getValues())) + 1 + ordinalNumber;\n }\n }]);\n\n return StrictBindsMap;\n}(IndexMap);\n\nexport default StrictBindsMap;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport { BasePlugin } from \"../base/index.mjs\";\nimport LooseBindsMap from \"./maps/looseBindsMap.mjs\";\nimport StrictBindsMap from \"./maps/strictBindsMap.mjs\";\nexport var PLUGIN_KEY = 'bindRowsWithHeaders';\nexport var PLUGIN_PRIORITY = 210;\nvar DEFAULT_BIND = 'loose';\nvar bindTypeToMapStrategy = new Map([['loose', LooseBindsMap], ['strict', StrictBindsMap]]);\n/**\n * @plugin BindRowsWithHeaders\n * @class BindRowsWithHeaders\n *\n * @description\n * Plugin allows binding the table rows with their headers.\n *\n * If the plugin is enabled, the table row headers will \"stick\" to the rows, when they are hidden/moved. Basically, if\n * at the initialization row 0 has a header titled \"A\", it will have it no matter what you do with the table.\n *\n * @example\n * ```js\n * const container = document.getElementById('example');\n * const hot = new Handsontable(container, {\n * data: getData(),\n * // enable plugin\n * bindRowsWithHeaders: true\n * });\n * ```\n */\n\nexport var BindRowsWithHeaders = /*#__PURE__*/function (_BasePlugin) {\n _inherits(BindRowsWithHeaders, _BasePlugin);\n\n var _super = _createSuper(BindRowsWithHeaders);\n\n function BindRowsWithHeaders(hotInstance) {\n var _this;\n\n _classCallCheck(this, BindRowsWithHeaders);\n\n _this = _super.call(this, hotInstance);\n /**\n * Plugin indexes cache.\n *\n * @private\n * @type {null|IndexMap}\n */\n\n _this.headerIndexes = null;\n return _this;\n }\n /**\n * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}\n * hook and if it returns `true` than the {@link BindRowsWithHeaders#enablePlugin} method is called.\n *\n * @returns {boolean}\n */\n\n\n _createClass(BindRowsWithHeaders, [{\n key: \"isEnabled\",\n value: function isEnabled() {\n return !!this.hot.getSettings()[PLUGIN_KEY];\n }\n /**\n * Enables the plugin functionality for this Handsontable instance.\n */\n\n }, {\n key: \"enablePlugin\",\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n var bindType = this.hot.getSettings()[PLUGIN_KEY];\n\n if (typeof bindType !== 'string') {\n bindType = DEFAULT_BIND;\n }\n\n var MapStrategy = bindTypeToMapStrategy.get(bindType);\n this.headerIndexes = this.hot.rowIndexMapper.registerMap('bindRowsWithHeaders', new MapStrategy());\n this.addHook('modifyRowHeader', function (row) {\n return _this2.onModifyRowHeader(row);\n });\n\n _get(_getPrototypeOf(BindRowsWithHeaders.prototype), \"enablePlugin\", this).call(this);\n }\n /**\n * Disables the plugin functionality for this Handsontable instance.\n */\n\n }, {\n key: \"disablePlugin\",\n value: function disablePlugin() {\n this.hot.rowIndexMapper.unregisterMap('bindRowsWithHeaders');\n\n _get(_getPrototypeOf(BindRowsWithHeaders.prototype), \"disablePlugin\", this).call(this);\n }\n /**\n * On modify row header listener.\n *\n * @private\n * @param {number} row Row index.\n * @returns {number}\n */\n\n }, {\n key: \"onModifyRowHeader\",\n value: function onModifyRowHeader(row) {\n return this.headerIndexes.getValueAtIndex(this.hot.toPhysicalRow(row));\n }\n /**\n * Destroys the plugin instance.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n _get(_getPrototypeOf(BindRowsWithHeaders.prototype), \"destroy\", this).call(this);\n }\n }], [{\n key: \"PLUGIN_KEY\",\n get: function get() {\n return PLUGIN_KEY;\n }\n }, {\n key: \"PLUGIN_PRIORITY\",\n get: function get() {\n return PLUGIN_PRIORITY;\n }\n }]);\n\n return BindRowsWithHeaders;\n}(BasePlugin);","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\n\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\n\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\n\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\n\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.map.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.concat.js\";\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.array.index-of.js\";\nimport \"core-js/modules/es.weak-map.js\";\nimport \"core-js/modules/es.object.set-prototype-of.js\";\nimport \"core-js/modules/es.object.get-prototype-of.js\";\nimport \"core-js/modules/es.reflect.construct.js\";\nimport \"core-js/modules/es.reflect.get.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\nimport { BasePlugin } from \"../base/index.mjs\";\nimport { arrayEach, arrayFilter, arrayUnique } from \"../../helpers/array.mjs\";\nimport { rangeEach } from \"../../helpers/number.mjs\";\nimport { warn } from \"../../helpers/console.mjs\";\nimport { addClass, hasClass, fastInnerText } from \"../../helpers/dom/element.mjs\";\nimport EventManager from \"../../eventManager.mjs\";\nimport { stopImmediatePropagation } from \"../../helpers/dom/event.mjs\";\nexport var PLUGIN_KEY = 'collapsibleColumns';\nexport var PLUGIN_PRIORITY = 290;\nvar actionDictionary = new Map([['collapse', {\n hideColumn: true,\n beforeHook: 'beforeColumnCollapse',\n afterHook: 'afterColumnCollapse'\n}], ['expand', {\n hideColumn: false,\n beforeHook: 'beforeColumnExpand',\n afterHook: 'afterColumnExpand'\n}]]);\n/**\n * @plugin CollapsibleColumns\n * @class CollapsibleColumns\n *\n * @description\n * The _CollapsibleColumns_ plugin allows collapsing of columns, covered by a header with the `colspan` property defined.\n *\n * Clicking the \"collapse/expand\" button collapses (or expands) all \"child\" headers except the first one.\n *\n * Setting the {@link Options#collapsiblecolumns} property to `true` will display a \"collapse/expand\" button in every header\n * with a defined `colspan` property.\n *\n * To limit this functionality to a smaller group of headers, define the `collapsibleColumns` property as an array\n * of objects, as in the example below.\n *\n * @example\n * ```js\n * const container = document.getElementById('example');\n * const hot = new Handsontable(container, {\n * data: generateDataObj(),\n * colHeaders: true,\n * rowHeaders: true,\n * nestedHeaders: true,\n * // enable plugin\n * collapsibleColumns: true,\n * });\n *\n * // or\n * const hot = new Handsontable(container, {\n * data: generateDataObj(),\n * colHeaders: true,\n * rowHeaders: true,\n * nestedHeaders: true,\n * // enable and configure which columns can be collapsed\n * collapsibleColumns: [\n * {row: -4, col: 1, collapsible: true},\n * {row: -3, col: 5, collapsible: true}\n * ],\n * });\n * ```\n */\n\nvar _collapsedColumnsMap = /*#__PURE__*/new WeakMap();\n\nexport var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {\n _inherits(CollapsibleColumns, _BasePlugin);\n\n var _super = _createSuper(CollapsibleColumns);\n\n function CollapsibleColumns() {\n var _this;\n\n _classCallCheck(this, CollapsibleColumns);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"nestedHeadersPlugin\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"eventManager\", new EventManager(_assertThisInitialized(_this)));\n\n _defineProperty(_assertThisInitialized(_this), \"headerStateManager\", null);\n\n _collapsedColumnsMap.set(_assertThisInitialized(_this), {\n writable: true,\n value: null\n });\n\n return _this;\n }\n\n _createClass(CollapsibleColumns, [{\n key: \"isEnabled\",\n value:\n /**\n * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}\n * hook and if it returns `true` than the {@link CollapsibleColumns#enablePlugin} method is called.\n *\n * @returns {boolean}\n */\n function isEnabled() {\n return !!this.hot.getSettings()[PLUGIN_KEY];\n }\n /**\n * Enables the plugin functionality for this Handsontable instance.\n */\n\n }, {\n key: \"enablePlugin\",\n value: function enablePlugin() {\n var _this2 = this;\n\n if (this.enabled) {\n return;\n }\n\n var _this$hot$getSettings = this.hot.getSettings(),\n nestedHeaders = _this$hot$getSettings.nestedHeaders;\n\n if (!nestedHeaders) {\n warn('You need to configure the Nested Headers plugin in order to use collapsible headers.');\n }\n\n _classPrivateFieldSet(this, _collapsedColumnsMap, this.hot.columnIndexMapper.createAndRegisterIndexMap(this.pluginName, 'hiding'));\n\n this.nestedHeadersPlugin = this.hot.getPlugin('nestedHeaders');\n this.headerStateManager = this.nestedHeadersPlugin.getStateManager();\n this.addHook('init', function () {\n return _this2.onInit();\n });\n this.addHook('afterLoadData', function () {\n return _this2.onAfterLoadData.apply(_this2, arguments);\n });\n this.addHook('afterGetColHeader', function (col, TH) {\n return _this2.onAfterGetColHeader(col, TH);\n });\n this.addHook('beforeOnCellMouseDown', function (event, coords, TD) {\n return _this2.onBeforeOnCellMouseDown(event, coords, TD);\n });\n\n _get(_getPrototypeOf(CollapsibleColumns.prototype), \"enablePlugin\", this).call(this); // @TODO: Workaround for broken plugin initialization abstraction (#6806).\n\n\n this.updatePlugin();\n }\n /**\n * Updates the plugin state. This method is executed when {@link Core#updateSettings} is invoked.\n */\n\n }, {\n key: \"updatePlugin\",\n value: function updatePlugin() {\n // @TODO: Workaround for broken plugin initialization abstraction (#6806).\n if (!this.hot.view) {\n return;\n }\n\n if (!this.nestedHeadersPlugin.detectedOverlappedHeaders) {\n var _this$hot$getSettings2 = this.hot.getSettings(),\n collapsibleColumns = _this$hot$getSettings2.collapsibleColumns;\n\n if (typeof collapsibleColumns === 'boolean') {\n // Add `collapsible: true` attribute to all headers with colspan higher than 1.\n this.headerStateManager.mapState(function (headerSettings) {\n return {\n collapsible: headerSettings.origColspan > 1\n };\n });\n } else if (Array.isArray(collapsibleColumns)) {\n this.headerStateManager.mergeStateWith(collapsibleColumns);\n }\n }\n\n _get(_getPrototypeOf(CollapsibleColumns.prototype), \"updatePlugin\", this).call(this);\n }\n /**\n * Disables the plugin functionality for this Handsontable instance.\n */\n\n }, {\n key: \"disablePlugin\",\n value: function disablePlugin() {\n this.hot.columnIndexMapper.unregisterMap(this.pluginName);\n\n _classPrivateFieldSet(this, _collapsedColumnsMap, null);\n\n this.nestedHeadersPlugin = null;\n this.clearButtons();\n\n _get(_getPrototypeOf(CollapsibleColumns.prototype), \"disablePlugin\", this).call(this);\n }\n /**\n * Clears the expand/collapse buttons.\n *\n * @private\n */\n\n }, {\n key: \"clearButtons\",\n value: function clearButtons() {\n if (!this.hot.view) {\n return;\n }\n\n var headerLevels = this.hot.view.wt.getSetting('columnHeaders').length;\n var mainHeaders = this.hot.view.wt.wtTable.THEAD;\n var topHeaders = this.hot.view.wt.wtOverlays.topOverlay.clone.wtTable.THEAD;\n var topLeftCornerHeaders = this.hot.view.wt.wtOverlays.topLeftCornerOverlay ? this.hot.view.wt.wtOverlays.topLeftCornerOverlay.clone.wtTable.THEAD : null;\n\n var removeButton = function removeButton(button) {\n if (button) {\n button.parentNode.removeChild(button);\n }\n };\n\n rangeEach(0, headerLevels - 1, function (i) {\n var masterLevel = mainHeaders.childNodes[i];\n var topLevel = topHeaders.childNodes[i];\n var topLeftCornerLevel = topLeftCornerHeaders ? topLeftCornerHeaders.childNodes[i] : null;\n rangeEach(0, masterLevel.childNodes.length - 1, function (j) {\n var button = masterLevel.childNodes[j].querySelector('.collapsibleIndicator');\n removeButton(button);\n\n if (topLevel && topLevel.childNodes[j]) {\n button = topLevel.childNodes[j].querySelector('.collapsibleIndicator');\n removeButton(button);\n }\n\n if (topLeftCornerHeaders && topLeftCornerLevel && topLeftCornerLevel.childNodes[j]) {\n button = topLeftCornerLevel.childNodes[j].querySelector('.collapsibleIndicator');\n removeButton(button);\n }\n });\n }, true);\n }\n /**\n * Expands section at the provided coords.\n *\n * @param {object} coords Contains coordinates information. (`coords.row`, `coords.col`).\n */\n\n }, {\n key: \"expandSection\",\n value: function expandSection(coords) {\n this.toggleCollapsibleSection([coords], 'expand');\n }\n /**\n * Collapses section at the provided coords.\n *\n * @param {object} coords Contains coordinates information. (`coords.row`, `coords.col`).\n */\n\n }, {\n key: \"collapseSection\",\n value: function collapseSection(coords) {\n this.toggleCollapsibleSection([coords], 'collapse');\n }\n /**\n * Collapses or expand all collapsible sections, depending on the action parameter.\n *\n * @param {string} action 'collapse' or 'expand'.\n */\n\n }, {\n key: \"toggleAllCollapsibleSections\",\n value: function toggleAllCollapsibleSections(action) {\n var _this3 = this;\n\n var coords = this.headerStateManager.mapNodes(function (_ref) {\n var collapsible = _ref.collapsible,\n origColspan = _ref.origColspan,\n headerLevel = _ref.headerLevel,\n columnIndex = _ref.columnIndex;\n\n if (collapsible === true && origColspan > 1) {\n return {\n row: _this3.headerStateManager.levelToRowCoords(headerLevel),\n col: columnIndex\n };\n }\n });\n this.toggleCollapsibleSection(coords, action);\n }\n /**\n * Collapses all collapsible sections.\n */\n\n }, {\n key: \"collapseAll\",\n value: function collapseAll() {\n this.toggleAllCollapsibleSections('collapse');\n }\n /**\n * Expands all collapsible sections.\n */\n\n }, {\n key: \"expandAll\",\n value: function expandAll() {\n this.toggleAllCollapsibleSections('expand');\n }\n /**\n * Collapses/Expands a section.\n *\n * @param {Array} coords Array of coords - section coordinates.\n * @param {string} [action] Action definition ('collapse' or 'expand').\n * @fires Hooks#beforeColumnCollapse\n * @fires Hooks#beforeColumnExpand\n * @fires Hooks#afterColumnCollapse\n * @fires Hooks#afterColumnExpand\n */\n\n }, {\n key: \"toggleCollapsibleSection\",\n value: function toggleCollapsibleSection(coords, action) {\n var _this4 = this;\n\n if (!actionDictionary.has(action)) {\n throw new Error(\"Unsupported action is passed (\".concat(action, \").\"));\n }\n\n if (!Array.isArray(coords)) {\n return;\n } // Ignore coordinates which points to the cells range.\n\n\n var filteredCoords = arrayFilter(coords, function (_ref2) {\n var row = _ref2.row;\n return row < 0;\n });\n var isActionPossible = filteredCoords.length > 0;\n arrayEach(filteredCoords, function (_ref3) {\n var _this4$headerStateMan;\n\n var row = _ref3.row,\n column = _ref3.col;\n\n var _ref4 = (_this4$headerStateMan = _this4.headerStateManager.getHeaderSettings(row, column)) !== null && _this4$headerStateMan !== void 0 ? _this4$headerStateMan : {},\n collapsible = _ref4.collapsible,\n isCollapsed = _ref4.isCollapsed;\n\n if (!collapsible || isCollapsed && action === 'collapse' || !isCollapsed && action === 'expand') {\n isActionPossible = false;\n return false;\n }\n });\n var nodeModRollbacks = [];\n var affectedColumnsIndexes = [];\n\n if (isActionPossible) {\n arrayEach(filteredCoords, function (_ref5) {\n var row = _ref5.row,\n column = _ref5.col;\n\n var _this4$headerStateMan2 = _this4.headerStateManager.triggerNodeModification(action, row, column),\n colspanCompensation = _this4$headerStateMan2.colspanCompensation,\n affectedColumns = _this4$headerStateMan2.affectedColumns,\n rollbackModification = _this4$headerStateMan2.rollbackModification;\n\n if (colspanCompensation > 0) {\n affectedColumnsIndexes.push.apply(affectedColumnsIndexes, _toConsumableArray(affectedColumns));\n nodeModRollbacks.push(rollbackModification);\n }\n });\n }\n\n var currentCollapsedColumns = this.getCollapsedColumns();\n var destinationCollapsedColumns = [];\n\n if (action === 'collapse') {\n destinationCollapsedColumns = arrayUnique([].concat(_toConsumableArray(currentCollapsedColumns), affectedColumnsIndexes));\n } else if (action === 'expand') {\n destinationCollapsedColumns = arrayFilter(currentCollapsedColumns, function (index) {\n return !affectedColumnsIndexes.includes(index);\n });\n }\n\n var actionTranslator = actionDictionary.get(action);\n var isActionAllowed = this.hot.runHooks(actionTranslator.beforeHook, currentCollapsedColumns, destinationCollapsedColumns, isActionPossible);\n\n if (isActionAllowed === false) {\n // Rollback all header nodes modification (collapse or expand).\n arrayEach(nodeModRollbacks, function (nodeModRollback) {\n nodeModRollback();\n });\n return;\n }\n\n this.hot.batchExecution(function () {\n arrayEach(affectedColumnsIndexes, function (visualColumn) {\n _classPrivateFieldGet(_this4, _collapsedColumnsMap).setValueAtIndex(_this4.hot.toPhysicalColumn(visualColumn), actionTranslator.hideColumn);\n });\n }, true);\n var isActionPerformed = this.getCollapsedColumns().length !== currentCollapsedColumns.length;\n this.hot.runHooks(actionTranslator.afterHook, currentCollapsedColumns, destinationCollapsedColumns, isActionPossible, isActionPerformed);\n this.hot.render();\n this.hot.view.adjustElementsSize(true);\n }\n /**\n * Gets an array of physical indexes of collapsed columns.\n *\n * @private\n * @returns {number[]}\n */\n\n }, {\n key: \"getCollapsedColumns\",\n value: function getCollapsedColumns() {\n return _classPrivateFieldGet(this, _collapsedColumnsMap).getHiddenIndexes();\n }\n /**\n * Generates the indicator element.\n *\n * @private\n * @param {number} row Row index.\n * @param {number} column Column index.\n * @returns {HTMLElement}\n */\n\n }, {\n key: \"generateIndicator\",\n value: function generateIndicator(row, column) {\n var divEl = this.hot.rootDocument.createElement('div');\n var columnSettings = this.headerStateManager.getHeaderSettings(row, column);\n addClass(divEl, 'collapsibleIndicator');\n\n if (columnSettings.isCollapsed) {\n addClass(divEl, 'collapsed');\n fastInnerText(divEl, '+');\n } else {\n addClass(divEl, 'expanded');\n fastInnerText(divEl, '-');\n }\n\n return divEl;\n }\n /**\n * Adds the indicator to the headers.\n *\n * @private\n * @param {number} column Column index.\n * @param {HTMLElement} TH TH element.\n */\n\n }, {\n key: \"onAfterGetColHeader\",\n value: function onAfterGetColHeader(column, TH) {\n var _this$headerStateMana;\n\n var TR = TH.parentNode;\n var THEAD = TR.parentNode;\n var row = -1 * THEAD.childNodes.length + Array.prototype.indexOf.call(THEAD.childNodes, TR);\n\n var _ref6 = (_this$headerStateMana = this.headerStateManager.getHeaderSettings(row, column)) !== null && _this$headerStateMana !== void 0 ? _this$headerStateMana : {},\n collapsible = _ref6.collapsible,\n origColspan = _ref6.origColspan;\n\n if (collapsible && origColspan > 1 && column >= this.hot.getSettings().fixedColumnsLeft) {\n var button = this.generateIndicator(row, column);\n TH.querySelector('div:first-child').appendChild(button);\n }\n }\n /**\n * Indicator mouse event callback.\n *\n * @private\n * @param {object} event Mouse event.\n * @param {object} coords Event coordinates.\n */\n\n }, {\n key: \"onBeforeOnCellMouseDown\",\n value: function onBeforeOnCellMouseDown(event, coords) {\n if (hasClass(event.target, 'collapsibleIndicator')) {\n if (hasClass(event.target, 'expanded')) {\n this.eventManager.fireEvent(event.target, 'mouseup');\n this.toggleCollapsibleSection([coords], 'collapse');\n } else if (hasClass(event.target, 'collapsed')) {\n this.eventManager.fireEvent(event.target, 'mouseup');\n this.toggleCollapsibleSection([coords], 'expand');\n }\n\n stopImmediatePropagation(event);\n }\n }\n /**\n * Updates the plugin state after HoT initialization.\n *\n * @private\n */\n\n }, {\n key: \"onInit\",\n value: function onInit() {\n // @TODO: Workaround for broken plugin initialization abstraction (#6806).\n this.updatePlugin();\n }\n /**\n * Updates the plugin state after new dataset load.\n *\n * @private\n * @param {Array[]} sourceData Array of arrays or array of objects containing data.\n * @param {boolean} initialLoad Flag that determines whether the data has been loaded\n * during the initialization.\n */\n\n }, {\n key: \"onAfterLoadData\",\n value: function onAfterLoadData(sourceData, initialLoad) {\n if (!initialLoad) {\n this.updatePlugin();\n }\n }\n /**\n * Destroys the plugin instance.\n */\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n _classPrivateFieldSet(this, _collapsedColumnsMap, null);\n\n _get(_getPrototypeOf(CollapsibleColumns.prototype), \"destroy\", this).call(this);\n }\n }], [{\n key: \"PLUGIN_KEY\",\n get: function get() {\n return PLUGIN_KEY;\n }\n }, {\n key: \"PLUGIN_PRIORITY\",\n get: function get() {\n return PLUGIN_PRIORITY;\n }\n }, {\n key: \"PLUGIN_DEPS\",\n get: function get() {\n return ['plugin:NestedHeaders'];\n }\n /**\n * Cached reference to the NestedHeaders plugin.\n *\n * @private\n * @type {NestedHeaders}\n */\n\n }]);\n\n return CollapsibleColumns;\n}(BasePlugin);","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport \"core-js/modules/es.array.includes.js\";\nimport \"core-js/modules/es.array.find-index.js\";\nimport \"core-js/modules/es.array.map.js\";\nimport \"core-js/modules/es.symbol.js\";\nimport \"core-js/modules/es.symbol.description.js\";\nimport \"core-js/modules/es.object.to-string.js\";\nimport \"core-js/modules/es.symbol.iterator.js\";\nimport \"core-js/modules/es.array.iterator.js\";\nimport \"core-js/modules/es.string.iterator.js\";\nimport \"core-js/modules/web.dom-collections.iterator.js\";\nimport \"core-js/modules/es.array.slice.js\";\nimport \"core-js/modules/es.function.name.js\";\nimport \"core-js/modules/es.array.from.js\";\nimport \"core-js/modules/es.object.keys.js\";\nimport \"core-js/modules/es.array.filter.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptor.js\";\nimport \"core-js/modules/web.dom-collections.for-each.js\";\nimport \"core-js/modules/es.object.get-own-property-descriptors.js\";\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport { isObject, objectEach } from \"../../helpers/object.mjs\";\nimport { LinkedPhysicalIndexToValueMap as IndexToValueMap } from \"../../translations/index.mjs\";\nimport { isDefined } from \"../../helpers/mixed.mjs\";\nvar inheritedColumnProperties = ['sortEmptyCells', 'indicator', 'headerAction', 'compareFunctionFactory'];\nvar SORT_EMPTY_CELLS_DEFAULT = false;\nvar SHOW_SORT_INDICATOR_DEFAULT = true;\nvar HEADER_ACTION_DEFAULT = true;\n/**\n * Store and manages states of sorted columns.\n *\n * @class ColumnStatesManager\n * @plugin ColumnSorting\n */\n\nexport var ColumnStatesManager = /*#__PURE__*/function () {\n function ColumnStatesManager(hot, mapName) {\n _classCallCheck(this, ColumnStatesManager);\n\n /**\n * Handsontable instance.\n *\n * @type {Core}\n */\n this.hot = hot;\n /**\n * Index map storing sorting states for every column. ColumnStatesManager write and read to/from this element.\n *\n * @type {LinkedPhysicalIndexToValueMap}\n */\n\n this.sortingStates = new IndexToValueMap();\n /**\n * Determines whether we should sort empty cells.\n *\n * @type {boolean}\n */\n\n this.sortEmptyCells = SORT_EMPTY_CELLS_DEFAULT;\n /**\n * Determines whether indicator should be visible (for sorted columns).\n *\n * @type {boolean}\n */\n\n this.indicator = SHOW_SORT_INDICATOR_DEFAULT;\n /**\n * Determines whether click on the header perform sorting.\n *\n * @type {boolean}\n */\n\n this.headerAction = HEADER_ACTION_DEFAULT;\n /**\n * Determines compare function factory. Method get as parameters `sortOder` and `columnMeta` and return compare function.\n */\n\n this.compareFunctionFactory = void 0;\n /**\n * Name of map storing sorting states. Required for unique name (PR #7440 introduced it). It's needed as\n * both ColumnSorting and MultiColumnSorting plugins create state manager and as a consequence register maps.\n * Objects are destroyed in strange order as the updateSettings doesn't work well.\n */\n\n this.mapName = mapName;\n this.hot.columnIndexMapper.registerMap(mapName, this.sortingStates);\n }\n /**\n * Update column properties which affect the sorting result.\n *\n * **Note**: All column properties can be overwritten by {@link Options#columns} option.\n *\n * @param {object} allSortSettings Column sorting plugin's configuration object.\n */\n\n\n _createClass(ColumnStatesManager, [{\n key: \"updateAllColumnsProperties\",\n value: function updateAllColumnsProperties(allSortSettings) {\n var _this = this;\n\n if (!isObject(allSortSettings)) {\n return;\n }\n\n objectEach(allSortSettings, function (newValue, propertyName) {\n if (inheritedColumnProperties.includes(propertyName)) {\n _this[propertyName] = newValue;\n }\n });\n }\n /**\n * Get all column properties which affect the sorting result.\n *\n * @returns {object}\n */\n\n }, {\n key: \"getAllColumnsProperties\",\n value: function getAllColumnsProperties() {\n var columnProperties = {\n sortEmptyCells: this.sortEmptyCells,\n indicator: this.indicator,\n headerAction: this.headerAction\n };\n\n if (typeof this.compareFunctionFactory === 'function') {\n columnProperties.compareFunctionFactory = this.compareFunctionFactory;\n }\n\n return columnProperties;\n }\n /**\n * Get sort order of column.\n *\n * @param {number} searchedColumn Visual column index.\n * @returns {string|undefined} Sort order (`asc` for ascending, `desc` for descending and undefined for not sorted).\n */\n\n }, {\n key: \"getSortOrderOfColumn\",\n value: function getSortOrderOfColumn(searchedColumn) {\n var _this$sortingStates$g;\n\n return (_this$sortingStates$g = this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(searchedColumn))) === null || _this$sortingStates$g === void 0 ? void 0 : _this$sortingStates$g.sortOrder;\n }\n /**\n * Get order of particular column in the states queue.\n *\n * @param {number} column Visual column index.\n * @returns {number}\n */\n\n }, {\n key: \"getIndexOfColumnInSortQueue\",\n value: function getIndexOfColumnInSortQueue(column) {\n column = this.hot.toPhysicalColumn(column);\n return this.sortingStates.getEntries().findIndex(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 1),\n physicalColumn = _ref2[0];\n\n return physicalColumn === column;\n });\n }\n /**\n * Get number of sorted columns.\n *\n * @returns {number}\n */\n\n }, {\n key: \"getNumberOfSortedColumns\",\n value: function getNumberOfSortedColumns() {\n return this.sortingStates.getLength();\n }\n /**\n * Get if list of sorted columns is empty.\n *\n * @returns {boolean}\n */\n\n }, {\n key: \"isListOfSortedColumnsEmpty\",\n value: function isListOfSortedColumnsEmpty() {\n return this.getNumberOfSortedColumns() === 0;\n }\n /**\n * Get if particular column is sorted.\n *\n * @param {number} column Visual column index.\n * @returns {boolean}\n */\n\n }, {\n key: \"isColumnSorted\",\n value: function isColumnSorted(column) {\n return isObject(this.sortingStates.getValueAtIndex(this.hot.toPhysicalColumn(column)));\n }\n /**\n * Queue of sort states containing sorted columns and their orders (Array of objects containing `column` and `sortOrder` properties).\n *\n * **Note**: Please keep in mind that returned objects expose **visual** column index under the `column` key.\n *\n * @returns {Array |