(function (_, kotlin_kotlin) {
  'use strict';
  //region block: imports
  var constructor = (class IteratorYieldResult {
    static [Symbol.hasInstance](instance) {
        return instance && (typeof instance === 'object') && (instance.done === false)
    }
    }.prototype).constructor;
  var protoOf = kotlin_kotlin.$_$.wc;
  var classMeta = kotlin_kotlin.$_$.lb;
  var setMetadataFor = kotlin_kotlin.$_$.xc;
  var VOID = kotlin_kotlin.$_$.f;
  var toSet = kotlin_kotlin.$_$.ba;
  var iterator = kotlin_kotlin.$_$.fe;
  var CoroutineImpl = kotlin_kotlin.$_$.va;
  var Unit_instance = kotlin_kotlin.$_$.m5;
  var THROW_CCE = kotlin_kotlin.$_$.hi;
  var SequenceScope = kotlin_kotlin.$_$.xd;
  var get_COROUTINE_SUSPENDED = kotlin_kotlin.$_$.ha;
  //endregion
  //region block: pre-declaration
  setMetadataFor(AsyncIteratorAdapter, 'AsyncIteratorAdapter', classMeta, VOID, VOID, VOID, VOID, VOID, [0]);
  setMetadataFor(iteratorFor$slambda, 'iteratorFor$slambda', classMeta, CoroutineImpl, VOID, VOID, VOID, VOID, [1]);
  //endregion
  function iteratorFor(source) {
    // Inline function 'js.iterable.AsyncIterator.iterator' call
    var this_0 = source[Symbol.asyncIterator]();
    return iteratorFor_0(this_0);
  }
  function iteratorFor_0(source) {
    return new AsyncIteratorAdapter(source);
  }
  function AsyncIteratorAdapter(source) {
    this.c5d_1 = source;
    this.d5d_1 = null;
  }
  function iteratorFor_1(source) {
    // Inline function 'js.iterable.JsIterator.iterator' call
    var this_0 = source[Symbol.iterator]();
    return iteratorFor_2(this_0);
  }
  function toSet_0(_this__u8e3s4) {
    return toSet(toArray(_this__u8e3s4));
  }
  function toArray(_this__u8e3s4) {
    return Array.from(_this__u8e3s4);
  }
  function iteratorFor_2(source) {
    return iterator(iteratorFor$slambda_0(source, null));
  }
  function iteratorFor$slambda($source, resultContinuation) {
    this.m5d_1 = $source;
    CoroutineImpl.call(this, resultContinuation);
  }
  protoOf(iteratorFor$slambda).r5d = function ($this$iterator, $completion) {
    var tmp = this.s5d($this$iterator, $completion);
    tmp.jd_1 = Unit_instance;
    tmp.kd_1 = null;
    return tmp.ud();
  };
  protoOf(iteratorFor$slambda).he = function (p1, $completion) {
    return this.r5d(p1 instanceof SequenceScope ? p1 : THROW_CCE(), $completion);
  };
  protoOf(iteratorFor$slambda).ud = function () {
    var suspendResult = this.jd_1;
    $sm: do
      try {
        var tmp = this.hd_1;
        switch (tmp) {
          case 0:
            this.id_1 = 5;
            this.hd_1 = 1;
            continue $sm;
          case 1:
            var tmp_0 = this;
            var tmp_1 = this.m5d_1.next();
            tmp_0.o5d_1 = tmp_1 instanceof constructor ? tmp_1 : null;
            if (this.o5d_1 == null) {
              this.hd_1 = 4;
              var tmp_2 = this;
              continue $sm;
            } else {
              this.p5d_1 = this.o5d_1;
              this.hd_1 = 2;
              continue $sm;
            }

          case 2:
            this.q5d_1 = this.p5d_1;
            this.hd_1 = 3;
            suspendResult = this.n5d_1.ig(this.q5d_1.value, this);
            if (suspendResult === get_COROUTINE_SUSPENDED()) {
              return suspendResult;
            }

            continue $sm;
          case 3:
            this.hd_1 = 1;
            continue $sm;
          case 4:
            return Unit_instance;
          case 5:
            throw this.kd_1;
        }
      } catch ($p) {
        var e = $p;
        if (this.id_1 === 5) {
          throw e;
        } else {
          this.hd_1 = this.id_1;
          this.kd_1 = e;
        }
      }
     while (true);
  };
  protoOf(iteratorFor$slambda).s5d = function ($this$iterator, completion) {
    var i = new iteratorFor$slambda(this.m5d_1, completion);
    i.n5d_1 = $this$iterator;
    return i;
  };
  function iteratorFor$slambda_0($source, resultContinuation) {
    var i = new iteratorFor$slambda($source, resultContinuation);
    var l = function ($this$iterator, $completion) {
      return i.r5d($this$iterator, $completion);
    };
    l.$arity = 1;
    return l;
  }
  //region block: exports
  _.$_$ = _.$_$ || {};
  _.$_$.a = iteratorFor_1;
  _.$_$.b = toSet_0;
  //endregion
  return _;
}(module.exports, require('./kotlin-kotlin-stdlib.js')));

//# sourceMappingURL=kotlin-js.js.map
