import { __exports as async } from '../../../../../../../../_virtual/async3.mjs';
import { __require as requireAsync$1 } from '../readers/async.mjs';

var hasRequiredAsync;
function requireAsync() {
  if (hasRequiredAsync) return async;
  hasRequiredAsync = 1;
  Object.defineProperty(async, "__esModule", {
    value: true
  });
  const async_1 = requireAsync$1();
  class AsyncProvider {
    constructor(_root, _settings) {
      this._root = _root;
      this._settings = _settings;
      this._reader = new async_1.default(this._root, this._settings);
      this._storage = [];
    }
    read(callback) {
      this._reader.onError(error => {
        callFailureCallback(callback, error);
      });
      this._reader.onEntry(entry => {
        this._storage.push(entry);
      });
      this._reader.onEnd(() => {
        callSuccessCallback(callback, this._storage);
      });
      this._reader.read();
    }
  }
  async.default = AsyncProvider;
  function callFailureCallback(callback, error) {
    callback(error);
  }
  function callSuccessCallback(callback, entries) {
    callback(null, entries);
  }
  return async;
}

export { requireAsync as __require };
