System.register(["__unresolved_0", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7", "__unresolved_8", "__unresolved_9"], function (_export, _context) {
  "use strict";

  var _req, _req2, _req3, _req4, _req5, _req6, _req7, _req8, _req9, _loader, _cjsExports, __cjsMetaURL;

  _export("default", void 0);

  return {
    setters: [function (_unresolved_) {
      _req = _unresolved_.__cjsMetaURL;
    }, function (_unresolved_2) {
      _req2 = _unresolved_2.__cjsMetaURL;
    }, function (_unresolved_3) {
      _req3 = _unresolved_3.__cjsMetaURL;
    }, function (_unresolved_4) {
      _req4 = _unresolved_4.__cjsMetaURL;
    }, function (_unresolved_5) {
      _req5 = _unresolved_5.__cjsMetaURL;
    }, function (_unresolved_6) {
      _req6 = _unresolved_6.__cjsMetaURL;
    }, function (_unresolved_7) {
      _req7 = _unresolved_7.__cjsMetaURL;
    }, function (_unresolved_8) {
      _req8 = _unresolved_8.__cjsMetaURL;
    }, function (_unresolved_9) {
      _req9 = _unresolved_9.__cjsMetaURL;
    }, function (_unresolved_10) {
      _loader = _unresolved_10.default;
    }],
    execute: function () {
      _loader.define(_context.meta.url, function (exports, _require, module, __filename, __dirname) {
        var require = _loader.createRequireWithReqMap({
          "../internals/export": _req,
          "../internals/global": _req2,
          "../internals/to-absolute-index": _req3,
          "../internals/to-integer-or-infinity": _req4,
          "../internals/length-of-array-like": _req5,
          "../internals/to-object": _req6,
          "../internals/array-species-create": _req7,
          "../internals/create-property": _req8,
          "../internals/array-method-has-species-support": _req9
        }, _require);

        (function () {
          var $ = require('../internals/export');

          var global = require('../internals/global');

          var toAbsoluteIndex = require('../internals/to-absolute-index');

          var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');

          var lengthOfArrayLike = require('../internals/length-of-array-like');

          var toObject = require('../internals/to-object');

          var arraySpeciesCreate = require('../internals/array-species-create');

          var createProperty = require('../internals/create-property');

          var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');

          var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
          var TypeError = global.TypeError;
          var max = Math.max;
          var min = Math.min;
          var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
          var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; // `Array.prototype.splice` method
          // https://tc39.es/ecma262/#sec-array.prototype.splice
          // with adding support of @@species

          $({
            target: 'Array',
            proto: true,
            forced: !HAS_SPECIES_SUPPORT
          }, {
            splice: function splice(start, deleteCount
            /* , ...items */
            ) {
              var O = toObject(this);
              var len = lengthOfArrayLike(O);
              var actualStart = toAbsoluteIndex(start, len);
              var argumentsLength = arguments.length;
              var insertCount, actualDeleteCount, A, k, from, to;

              if (argumentsLength === 0) {
                insertCount = actualDeleteCount = 0;
              } else if (argumentsLength === 1) {
                insertCount = 0;
                actualDeleteCount = len - actualStart;
              } else {
                insertCount = argumentsLength - 2;
                actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
              }

              if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
                throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
              }

              A = arraySpeciesCreate(O, actualDeleteCount);

              for (k = 0; k < actualDeleteCount; k++) {
                from = actualStart + k;
                if (from in O) createProperty(A, k, O[from]);
              }

              A.length = actualDeleteCount;

              if (insertCount < actualDeleteCount) {
                for (k = actualStart; k < len - actualDeleteCount; k++) {
                  from = k + actualDeleteCount;
                  to = k + insertCount;
                  if (from in O) O[to] = O[from];else delete O[to];
                }

                for (k = len; k > len - actualDeleteCount + insertCount; k--) {
                  delete O[k - 1];
                }
              } else if (insertCount > actualDeleteCount) {
                for (k = len - actualDeleteCount; k > actualStart; k--) {
                  from = k + actualDeleteCount - 1;
                  to = k + insertCount - 1;
                  if (from in O) O[to] = O[from];else delete O[to];
                }
              }

              for (k = 0; k < insertCount; k++) {
                O[k + actualStart] = arguments[k + 2];
              }

              O.length = len - actualDeleteCount + insertCount;
              return A;
            }
          });
        })();

        _export("default", _cjsExports = module.exports);
      });

      _export("__cjsMetaURL", __cjsMetaURL = _context.meta.url);
    }
  };
});
//# sourceMappingURL=es.array.splice.js.map