text: /**
   * @generated-from ./$zip.js
   * This file is autogenerated from a template. Please do not edit it directly.
   * To rebuild it from its template use the command
   * > npm run generate
   * More information can be found in CONTRIBUTING.md
   */
  
  import { asyncIterableCurry } from '../../internal/async-iterable.js';
  import { asyncParallelEach } from '../../internal/async-parallel-each.js';
  import { __asyncPeekerate } from '../$peekerate/async-peekerate.js';
  import { __asyncMap } from '../$map/async-map.js';
  import { __map } from '../$map/map.js';
  import { __some } from '../$some/some.js';
  import { __asyncToArray } from '../$to-array/async-to-array.js';
  
  const isDone = (peekr) => peekr.done;
  
  export async function* __asyncZip(sources) {
    const peekrs = await __asyncToArray(__asyncMap(sources, __asyncPeekerate));
    let done = __some(peekrs, isDone);
  
    try {
      while (!done) {
        yield peekrs.map(({ value }) => value);
  
        await Promise.all(__map(peekrs, (peekr) => peekr.advance()));
  
        done = __some(peekrs, isDone);
      }
    } finally {
      await asyncParallelEach(peekrs, (peekr) => peekr.return());
    }
  }
  
  export const asyncZip = /*#__PURE__*/ asyncIterableCurry(__asyncZip, {
    variadic: true,
  });
  