import { __exports as stream } from '../../../../../../../_virtual/stream3.mjs';
import { __require as requireMerge2 } from '../../../../../merge2@1.4.1/node_modules/merge2/index.mjs';

var hasRequiredStream;
function requireStream() {
  if (hasRequiredStream) return stream;
  hasRequiredStream = 1;
  Object.defineProperty(stream, "__esModule", {
    value: true
  });
  stream.merge = void 0;
  const merge2 = requireMerge2();
  function merge(streams) {
    const mergedStream = merge2(streams);
    streams.forEach(stream => {
      stream.once('error', error => mergedStream.emit('error', error));
    });
    mergedStream.once('close', () => propagateCloseEventToSources(streams));
    mergedStream.once('end', () => propagateCloseEventToSources(streams));
    return mergedStream;
  }
  stream.merge = merge;
  function propagateCloseEventToSources(streams) {
    streams.forEach(stream => stream.emit('close'));
  }
  return stream;
}

export { requireStream as __require };
