import{__exports as r}from"../../../_virtual/esnext.async-iterator.flat-map.mjs";import{__require as e}from"../internals/export.mjs";import{__require as t}from"../internals/function-call.mjs";import{__require as n}from"../internals/a-callable.mjs";import{__require as a}from"../internals/an-object.mjs";import{__require as i}from"../internals/is-object.mjs";import{__require as o}from"../internals/get-iterator-direct.mjs";import{__require as s}from"../internals/async-iterator-create-proxy.mjs";import{__require as c}from"../internals/create-iter-result-object.mjs";import{__require as m}from"../internals/get-async-iterator-flattenable.mjs";import{__require as l}from"../internals/async-iterator-close.mjs";var u;function f(){if(u)return r;u=1;var f=e(),_=t(),p=n(),j=a(),v=i(),h=o(),y=s(),q=c(),d=m(),x=l(),b=y(function(r){var e=this,t=e.iterator,n=e.mapper;return new r(function(a,i){var o=function(r){e.done=!0,i(r)},s=function(r){x(t,o,r,o)},c=function(){try{r.resolve(j(_(e.next,t))).then(function(t){try{if(j(t).done)e.done=!0,a(q(void 0,!0));else{var i=t.value;try{var c=n(i,e.counter++),l=function(r){try{e.inner=d(r),m()}catch(r){s(r)}};v(c)?r.resolve(c).then(l,s):l(c)}catch(r){s(r)}}}catch(r){o(r)}},o)}catch(r){o(r)}},m=function(){var t=e.inner;if(t)try{r.resolve(j(_(t.next,t.iterator))).then(function(r){try{j(r).done?(e.inner=null,c()):a(q(r.value,!1))}catch(r){s(r)}},s)}catch(r){s(r)}else c()};m()})});return f({target:"AsyncIterator",proto:!0,real:!0,forced:!0},{flatMap:function(r){return j(this),p(r),new b(h(this),{mapper:r,inner:null})}}),r}export{f as __require};