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iBAC3B,MAAO,CAAC,EAAG,EACb,GAOC,CACD,IAAK,WACL,MAAO,WACL,OAAO,KAAK,WAAW,UAAW,IACpC,GACC,CACD,IAAK,QACL,IAAK,WACH,OAAO,KAAK,IAAI,QAClB,GAOC,CACD,IAAK,SACL,IAAK,WACH,OAAO,KAAK,IAAI,SAClB,KAGK,CACT,CAzR4B","file":"/npm/immutable-table@1.0.0/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/immutable-table@1.0.0/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.Table = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_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\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _immutable = require('immutable');\n\nvar _immutable2 = _interopRequireDefault(_immutable);\n\nvar _inheritableMap = require('inheritable-map');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n/**\n * Used to identify tables inside JSON blobs\n */\nvar TABLE_JSON_ID = '__IMMUTABLE-TABLE';\n\n/**\n * Represents a data table in memory. Immutable\n *\n * This implementation uses nexted hash tables to represent rows/columns.  The\n * advantage of this is that a table with no data can take almost no space.  As\n * the table becomes filled, it will occupy more memory.\n */\n\nvar Table = exports.Table = function (_InheritableMap) {\n  _inherits(Table, _InheritableMap);\n\n  _createClass(Table, null, [{\n    key: 'makeReviver',\n\n\n    /**\n     * Makes a reviver function to be used to deserialize Tables using JSON.parse.\n     *\n     * Serialization can be done using JSON.stringify(table)\n     * @param  {function} [wrappedReviver] optionally specify another reviver\n     * @return {function}\n     */\n    value: function makeReviver(wrappedReviver) {\n      return function (key, value) {\n        var newValue = value;\n        if (wrappedReviver) {\n          newValue = wrappedReviver(key, newValue);\n        }\n\n        if (newValue[TABLE_JSON_ID] !== undefined) {\n          var object = JSON.parse(newValue[TABLE_JSON_ID]);\n          var map = _immutable2.default.fromJS(object).update('data', function (data) {\n            return data.mapKeys(function (x) {\n              return parseInt(x, 10);\n            }).map(function (values) {\n              return values.mapKeys(function (y) {\n                return parseInt(y, 10);\n              });\n            });\n          });\n\n          // Copy to Table instance\n          var table = new Table(map.get('width'), map.get('height'));\n          return table.set('data', map.get('data'));\n        }\n        return newValue;\n      };\n    }\n\n    /**\n     * Create a table from a CSV representation\n     * @param  {string} csv comma separated value representation\n     * @return {Table}\n     */\n\n  }, {\n    key: 'fromCSV',\n    value: function fromCSV(csv) {\n      var width = 0;\n      var lines = csv.split('\\n').map(function (line) {\n        var newLine = line.split(',').map(function (x) {\n          return x.trim();\n        });\n        width = Math.max(width, newLine.length);\n        return newLine;\n      });\n      var table = new Table(width, lines.length);\n      lines.forEach(function (line, y) {\n        line.forEach(function (item, x) {\n          table = table.setCell(x, y, item);\n        });\n      });\n      return table;\n    }\n\n    /**\n     * Public constructor\n     * @param  {number} width\n     * @param  {number} height\n     */\n\n  }]);\n\n  function Table(width, height) {\n    var _ret;\n\n    _classCallCheck(this, Table);\n\n    var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Table).call(this));\n\n    return _ret = _this.set('width', width).set('height', height).set('data', new _immutable2.default.Map()), _possibleConstructorReturn(_this, _ret);\n  }\n\n  /**\n   * The width of the table\n   * @return {number}\n   */\n\n\n  _createClass(Table, [{\n    key: 'getCell',\n\n\n    /**\n     * Gets a value in the table\n     * @param {number} x        column index.  Negative numbers can be used to\n     *                          address columns from the right side of the table.\n     * @param {number} y        row index. Negative numbers can be used to address\n     *                          rows from the bottom side of the table.\n     * @return {any}\n     */\n    value: function getCell(x, y, defaultValue) {\n      var _validate2 = this._validate(x, y);\n\n      var _validate3 = _slicedToArray(_validate2, 2);\n\n      x = _validate3[0];\n      y = _validate3[1];\n\n      return this.getIn(['data', x, y], defaultValue);\n    }\n\n    /**\n     * Sets a value or values in the table.\n     * @param {number} x        column index.  Negative numbers can be used to\n     *                          address columns from the right side of the table.\n     * @param {number} y        row index. Negative numbers can be used to address\n     *                          rows from the bottom side of the table.\n     * @param {any|Table} value value to set in the table.  If the value is a\n     *                          table, the values of that table are used to set\n     *                          the equavalent set of cells in the destination at\n     *                          the offset specified.\n     * @return {Table}          derived table\n     */\n\n  }, {\n    key: 'setCell',\n    value: function setCell(x, y, value) {\n      var _this2 = this;\n\n      var _validate4 = this._validate(x, y);\n\n      var _validate5 = _slicedToArray(_validate4, 2);\n\n      x = _validate5[0];\n      y = _validate5[1];\n\n      if (value instanceof Table) {\n        if (value.width + x > this.width) throw new Error('table overflows x dimension');\n        if (value.height + y > this.height) throw new Error('table overflows y dimension');\n        return this.mergeDeep(value.delete('width').delete('height').update('data', function (data) {\n          return data.mapKeys(function (fromX) {\n            return fromX + x;\n          }).filter(function (_, fromX) {\n            return fromX < _this2.width;\n          }).map(function (map) {\n            return map.mapKeys(function (fromY) {\n              return fromY + y;\n            }).filter(function (_, fromY) {\n              return fromY < _this2.height;\n            });\n          });\n        }));\n      }\n      return this.setIn(['data', x, y], value);\n    }\n\n    /**\n     * Get a subset of the table\n     * @param  {number} startX the left most column index of the subset.  Negative\n     *                         numbers can be used to address columns from the\n     *                         right side of the table.\n     * @param  {number} startY the top most row of the subset.  Negative numbers\n     *                         can be used to address rows from the bottom side of\n     *                         the table.\n     * @param  {number} [endX] the right most column index, exclusive, of the\n     *                         subset.  Negative numbers can be used to address\n     *                         columns from the right side of the table.\n     * @param  {number} [endY] the bottom most row index, exclusive, of the\n     *                         subset.  Negative numbers can be used to address\n     *                         rows from the bottom side of the table.\n     * @return {Table}         subset\n     */\n\n  }, {\n    key: 'slice',\n    value: function slice(startX, startY, endX, endY) {\n\n      // If a right isn't defined, use the right edge and bottom edge for x/y lims\n\n      var _validate6 = this._validate(startX, startY);\n\n      var _validate7 = _slicedToArray(_validate6, 2);\n\n      startX = _validate7[0];\n      startY = _validate7[1];\n      if (endX === undefined) {\n        endX = this.width;\n        endY = this.height;\n      } else {\n        var _validate8 = this._validate(endX, endY);\n\n        var _validate9 = _slicedToArray(_validate8, 2);\n\n        endX = _validate9[0];\n        endY = _validate9[1];\n      }\n\n      return this.set('width', endX - startX).set('height', endY - startY).update('data', function (data) {\n        return data.filter(function (values, fromX) {\n          return startX <= fromX && fromX < endX;\n        }).mapKeys(function (fromX) {\n          return fromX - startX;\n        }).map(function (map) {\n          return map.filter(function (values, fromY) {\n            return startY <= fromY && fromY < endY;\n          }).mapKeys(function (fromY) {\n            return fromY - startY;\n          });\n        });\n      });\n    }\n\n    /**\n     * Serialize the table to a JSON representation.\n     *\n     * Deserialization can be done using the static Table.makeReviver() function\n     * in combination with JSON.parse();\n     * @return {string} JSON representation\n     */\n\n  }, {\n    key: 'toJSON',\n    value: function toJSON() {\n      var serialized = {};\n      serialized[TABLE_JSON_ID] = JSON.stringify(this.toJS());\n      return serialized;\n    }\n\n    /**\n     * Converts negative indicies into positive ones and also validates indices.\n     *\n     * Throws if coordinates are invalid.\n     * @param  {number} x column index, can be negative\n     * @param  {number} y row index, can be negative\n     * @return {number[]} tuple of x, y indicies\n     */\n\n  }, {\n    key: '_validate',\n    value: function _validate(x, y) {\n      if (x < 0) x += this.width;\n      if (y < 0) y += this.height;\n      if (x >= this.width) throw new Error('x larger than table width');\n      if (y >= this.height) throw new Error('y larger than table height');\n      if (x < 0) throw new Error('x less than 0');\n      if (y < 0) throw new Error('y less than 0');\n      return [x, y];\n    }\n\n    /**\n     * Create a friendly string representation of the Table\n     * @return {string}\n     */\n\n  }, {\n    key: 'toString',\n    value: function toString() {\n      return this.__toString('Table {', '}');\n    }\n  }, {\n    key: 'width',\n    get: function get() {\n      return this.get('width');\n    }\n\n    /**\n     * The height of the table\n     * @return {number}\n     */\n\n  }, {\n    key: 'height',\n    get: function get() {\n      return this.get('height');\n    }\n  }]);\n\n  return Table;\n}(_inheritableMap.InheritableMap);"]}