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

  var _req, _req2, _req3, _req4, _req5, _req6, _req7, _req8, _req9, _req10, _req11, _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) {
      _req10 = _unresolved_10.__cjsMetaURL;
    }, function (_unresolved_11) {
      _req11 = _unresolved_11.__cjsMetaURL;
    }, function (_unresolved_12) {
      _loader = _unresolved_12.default;
    }],
    execute: function () {
      _loader.define(_context.meta.url, function (exports, _require, module, __filename, __dirname) {
        var require = _loader.createRequireWithReqMap({
          "../internals/global": _req,
          "../internals/function-bind-context": _req2,
          "../internals/function-call": _req3,
          "../internals/an-object": _req4,
          "../internals/try-to-string": _req5,
          "../internals/is-array-iterator-method": _req6,
          "../internals/length-of-array-like": _req7,
          "../internals/object-is-prototype-of": _req8,
          "../internals/get-iterator": _req9,
          "../internals/get-iterator-method": _req10,
          "../internals/iterator-close": _req11
        }, _require);

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

          var bind = require('../internals/function-bind-context');

          var call = require('../internals/function-call');

          var anObject = require('../internals/an-object');

          var tryToString = require('../internals/try-to-string');

          var isArrayIteratorMethod = require('../internals/is-array-iterator-method');

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

          var isPrototypeOf = require('../internals/object-is-prototype-of');

          var getIterator = require('../internals/get-iterator');

          var getIteratorMethod = require('../internals/get-iterator-method');

          var iteratorClose = require('../internals/iterator-close');

          var TypeError = global.TypeError;

          var Result = function Result(stopped, result) {
            this.stopped = stopped;
            this.result = result;
          };

          var ResultPrototype = Result.prototype;

          module.exports = function (iterable, unboundFunction, options) {
            var that = options && options.that;
            var AS_ENTRIES = !!(options && options.AS_ENTRIES);
            var IS_ITERATOR = !!(options && options.IS_ITERATOR);
            var INTERRUPTED = !!(options && options.INTERRUPTED);
            var fn = bind(unboundFunction, that);
            var iterator, iterFn, index, length, result, next, step;

            var stop = function stop(condition) {
              if (iterator) iteratorClose(iterator, 'normal', condition);
              return new Result(true, condition);
            };

            var callFn = function callFn(value) {
              if (AS_ENTRIES) {
                anObject(value);
                return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
              }

              return INTERRUPTED ? fn(value, stop) : fn(value);
            };

            if (IS_ITERATOR) {
              iterator = iterable;
            } else {
              iterFn = getIteratorMethod(iterable);
              if (!iterFn) throw TypeError(tryToString(iterable) + ' is not iterable'); // optimisation for array iterators

              if (isArrayIteratorMethod(iterFn)) {
                for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
                  result = callFn(iterable[index]);
                  if (result && isPrototypeOf(ResultPrototype, result)) return result;
                }

                return new Result(false);
              }

              iterator = getIterator(iterable, iterFn);
            }

            next = iterator.next;

            while (!(step = call(next, iterator)).done) {
              try {
                result = callFn(step.value);
              } catch (error) {
                iteratorClose(iterator, 'throw', error);
              }

              if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
            }

            return new Result(false);
          };
        })();

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

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