'use strict';

var ebec = require('ebec');

function _classCallCheck(instance, Constructor) {
  if (!(instance instanceof Constructor)) {
    throw new TypeError("Cannot call a class as a function");
  }
}
function _defineProperties(target, props) {
  for (var i = 0; i < props.length; i++) {
    var descriptor = props[i];
    descriptor.enumerable = descriptor.enumerable || false;
    descriptor.configurable = true;
    if ("value" in descriptor) descriptor.writable = true;
    Object.defineProperty(target, descriptor.key, descriptor);
  }
}
function _createClass(Constructor, protoProps, staticProps) {
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  if (staticProps) _defineProperties(Constructor, staticProps);
  Object.defineProperty(Constructor, "prototype", {
    writable: false
  });
  return Constructor;
}
function _inherits(subClass, superClass) {
  if (typeof superClass !== "function" && superClass !== null) {
    throw new TypeError("Super expression must either be null or a function");
  }
  subClass.prototype = Object.create(superClass && superClass.prototype, {
    constructor: {
      value: subClass,
      writable: true,
      configurable: true
    }
  });
  Object.defineProperty(subClass, "prototype", {
    writable: false
  });
  if (superClass) _setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
  _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
    return o.__proto__ || Object.getPrototypeOf(o);
  };
  return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
    o.__proto__ = p;
    return o;
  };
  return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  if (Reflect.construct.sham) return false;
  if (typeof Proxy === "function") return true;
  try {
    Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
    return true;
  } catch (e) {
    return false;
  }
}
function _assertThisInitialized(self) {
  if (self === void 0) {
    throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  }
  return self;
}
function _possibleConstructorReturn(self, call) {
  if (call && (typeof call === "object" || typeof call === "function")) {
    return call;
  } else if (call !== void 0) {
    throw new TypeError("Derived constructors may only return object or undefined");
  }
  return _assertThisInitialized(self);
}
function _createSuper(Derived) {
  var hasNativeReflectConstruct = _isNativeReflectConstruct();
  return function _createSuperInternal() {
    var Super = _getPrototypeOf(Derived),
      result;
    if (hasNativeReflectConstruct) {
      var NewTarget = _getPrototypeOf(this).constructor;
      result = Reflect.construct(Super, arguments, NewTarget);
    } else {
      result = Super.apply(this, arguments);
    }
    return _possibleConstructorReturn(this, result);
  };
}

var ClientError = /*#__PURE__*/function (_BaseError) {
  _inherits(ClientError, _BaseError);
  var _super = _createSuper(ClientError);
  function ClientError() {
    _classCallCheck(this, ClientError);
    return _super.apply(this, arguments);
  }
  return _createClass(ClientError);
}(ebec.BaseError);

var ServerError = /*#__PURE__*/function (_BaseError) {
  _inherits(ServerError, _BaseError);
  var _super = _createSuper(ServerError);
  function ServerError() {
    _classCallCheck(this, ServerError);
    return _super.apply(this, arguments);
  }
  return _createClass(ServerError);
}(ebec.BaseError);

var BadRequestErrorOptions = {
  code: "BAD_REQUEST",
  statusCode: 400,
  decorateMessage: false,
  logMessage: false,
  message: "Bad Request"
};
var BadRequestError = /*#__PURE__*/function (_ClientError) {
  _inherits(BadRequestError, _ClientError);
  var _super = _createSuper(BadRequestError);
  function BadRequestError(data, options) {
    _classCallCheck(this, BadRequestError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), BadRequestErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Bad Request";
    }
    return _super.call(this, message, options);
  }
  return _createClass(BadRequestError);
}(ClientError);

var UnauthorizedErrorOptions = {
  code: "UNAUTHORIZED",
  statusCode: 401,
  decorateMessage: false,
  logMessage: false,
  message: "Unauthorized"
};
var UnauthorizedError = /*#__PURE__*/function (_ClientError) {
  _inherits(UnauthorizedError, _ClientError);
  var _super = _createSuper(UnauthorizedError);
  function UnauthorizedError(data, options) {
    _classCallCheck(this, UnauthorizedError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), UnauthorizedErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Unauthorized";
    }
    return _super.call(this, message, options);
  }
  return _createClass(UnauthorizedError);
}(ClientError);

var ForbiddenErrorOptions = {
  code: "FORBIDDEN",
  statusCode: 403,
  decorateMessage: false,
  logMessage: false,
  message: "Forbidden"
};
var ForbiddenError = /*#__PURE__*/function (_ClientError) {
  _inherits(ForbiddenError, _ClientError);
  var _super = _createSuper(ForbiddenError);
  function ForbiddenError(data, options) {
    _classCallCheck(this, ForbiddenError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), ForbiddenErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Forbidden";
    }
    return _super.call(this, message, options);
  }
  return _createClass(ForbiddenError);
}(ClientError);

var NotFoundErrorOptions = {
  code: "NOT_FOUND",
  statusCode: 404,
  decorateMessage: false,
  logMessage: false,
  message: "Not Found"
};
var NotFoundError = /*#__PURE__*/function (_ClientError) {
  _inherits(NotFoundError, _ClientError);
  var _super = _createSuper(NotFoundError);
  function NotFoundError(data, options) {
    _classCallCheck(this, NotFoundError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), NotFoundErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Not Found";
    }
    return _super.call(this, message, options);
  }
  return _createClass(NotFoundError);
}(ClientError);

var MethodNotAllowedErrorOptions = {
  code: "METHOD_NOT_ALLOWED",
  statusCode: 405,
  decorateMessage: false,
  logMessage: false,
  message: "Method Not Allowed"
};
var MethodNotAllowedError = /*#__PURE__*/function (_ClientError) {
  _inherits(MethodNotAllowedError, _ClientError);
  var _super = _createSuper(MethodNotAllowedError);
  function MethodNotAllowedError(data, options) {
    _classCallCheck(this, MethodNotAllowedError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), MethodNotAllowedErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Method Not Allowed";
    }
    return _super.call(this, message, options);
  }
  return _createClass(MethodNotAllowedError);
}(ClientError);

var NotAcceptableErrorOptions = {
  code: "NOT_ACCEPTABLE",
  statusCode: 406,
  decorateMessage: false,
  logMessage: false,
  message: "Not Acceptable"
};
var NotAcceptableError = /*#__PURE__*/function (_ClientError) {
  _inherits(NotAcceptableError, _ClientError);
  var _super = _createSuper(NotAcceptableError);
  function NotAcceptableError(data, options) {
    _classCallCheck(this, NotAcceptableError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), NotAcceptableErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Not Acceptable";
    }
    return _super.call(this, message, options);
  }
  return _createClass(NotAcceptableError);
}(ClientError);

var ProxyAuthenticationRequiredErrorOptions = {
  code: "PROXY_AUTHENTICATION_REQUIRED",
  statusCode: 407,
  decorateMessage: false,
  logMessage: false,
  message: "Proxy Authentication Required"
};
var ProxyAuthenticationRequiredError = /*#__PURE__*/function (_ClientError) {
  _inherits(ProxyAuthenticationRequiredError, _ClientError);
  var _super = _createSuper(ProxyAuthenticationRequiredError);
  function ProxyAuthenticationRequiredError(data, options) {
    _classCallCheck(this, ProxyAuthenticationRequiredError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), ProxyAuthenticationRequiredErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Proxy Authentication Required";
    }
    return _super.call(this, message, options);
  }
  return _createClass(ProxyAuthenticationRequiredError);
}(ClientError);

var RequestTimeoutErrorOptions = {
  code: "REQUEST_TIMEOUT",
  statusCode: 408,
  decorateMessage: false,
  logMessage: false,
  message: "Request Timeout"
};
var RequestTimeoutError = /*#__PURE__*/function (_ClientError) {
  _inherits(RequestTimeoutError, _ClientError);
  var _super = _createSuper(RequestTimeoutError);
  function RequestTimeoutError(data, options) {
    _classCallCheck(this, RequestTimeoutError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), RequestTimeoutErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Request Timeout";
    }
    return _super.call(this, message, options);
  }
  return _createClass(RequestTimeoutError);
}(ClientError);

var ConflictErrorOptions = {
  code: "CONFLICT",
  statusCode: 409,
  decorateMessage: false,
  logMessage: false,
  message: "Conflict"
};
var ConflictError = /*#__PURE__*/function (_ClientError) {
  _inherits(ConflictError, _ClientError);
  var _super = _createSuper(ConflictError);
  function ConflictError(data, options) {
    _classCallCheck(this, ConflictError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), ConflictErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Conflict";
    }
    return _super.call(this, message, options);
  }
  return _createClass(ConflictError);
}(ClientError);

var GoneErrorOptions = {
  code: "GONE",
  statusCode: 410,
  decorateMessage: false,
  logMessage: false,
  message: "Gone"
};
var GoneError = /*#__PURE__*/function (_ClientError) {
  _inherits(GoneError, _ClientError);
  var _super = _createSuper(GoneError);
  function GoneError(data, options) {
    _classCallCheck(this, GoneError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), GoneErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Gone";
    }
    return _super.call(this, message, options);
  }
  return _createClass(GoneError);
}(ClientError);

var LengthRequiredErrorOptions = {
  code: "LENGTH_REQUIRED",
  statusCode: 411,
  decorateMessage: false,
  logMessage: false,
  message: "Length Required"
};
var LengthRequiredError = /*#__PURE__*/function (_ClientError) {
  _inherits(LengthRequiredError, _ClientError);
  var _super = _createSuper(LengthRequiredError);
  function LengthRequiredError(data, options) {
    _classCallCheck(this, LengthRequiredError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), LengthRequiredErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Length Required";
    }
    return _super.call(this, message, options);
  }
  return _createClass(LengthRequiredError);
}(ClientError);

var PreconditionFailedErrorOptions = {
  code: "PRECONDITION_FAILED",
  statusCode: 412,
  decorateMessage: false,
  logMessage: false,
  message: "Precondition Failed"
};
var PreconditionFailedError = /*#__PURE__*/function (_ClientError) {
  _inherits(PreconditionFailedError, _ClientError);
  var _super = _createSuper(PreconditionFailedError);
  function PreconditionFailedError(data, options) {
    _classCallCheck(this, PreconditionFailedError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), PreconditionFailedErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Precondition Failed";
    }
    return _super.call(this, message, options);
  }
  return _createClass(PreconditionFailedError);
}(ClientError);

var RequestEntityTooLargeErrorOptions = {
  code: "REQUEST_ENTITY_TOO_LARGE",
  statusCode: 413,
  decorateMessage: false,
  logMessage: false,
  message: "REQUEST_ENTITY_TOO_LARGE"
};
var RequestEntityTooLargeError = /*#__PURE__*/function (_ClientError) {
  _inherits(RequestEntityTooLargeError, _ClientError);
  var _super = _createSuper(RequestEntityTooLargeError);
  function RequestEntityTooLargeError(data, options) {
    _classCallCheck(this, RequestEntityTooLargeError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), RequestEntityTooLargeErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "REQUEST_ENTITY_TOO_LARGE";
    }
    return _super.call(this, message, options);
  }
  return _createClass(RequestEntityTooLargeError);
}(ClientError);

var RequestURITooLongErrorOptions = {
  code: "REQUEST_URI_TOO_LONG",
  statusCode: 414,
  decorateMessage: false,
  logMessage: false,
  message: "Request-URI Too Long"
};
var RequestURITooLongError = /*#__PURE__*/function (_ClientError) {
  _inherits(RequestURITooLongError, _ClientError);
  var _super = _createSuper(RequestURITooLongError);
  function RequestURITooLongError(data, options) {
    _classCallCheck(this, RequestURITooLongError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), RequestURITooLongErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Request-URI Too Long";
    }
    return _super.call(this, message, options);
  }
  return _createClass(RequestURITooLongError);
}(ClientError);

var UnsupportedMediaTypeErrorOptions = {
  code: "UNSUPPORTED_MEDIA_TYPE",
  statusCode: 415,
  decorateMessage: false,
  logMessage: false,
  message: "Unsupported Media Type"
};
var UnsupportedMediaTypeError = /*#__PURE__*/function (_ClientError) {
  _inherits(UnsupportedMediaTypeError, _ClientError);
  var _super = _createSuper(UnsupportedMediaTypeError);
  function UnsupportedMediaTypeError(data, options) {
    _classCallCheck(this, UnsupportedMediaTypeError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), UnsupportedMediaTypeErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Unsupported Media Type";
    }
    return _super.call(this, message, options);
  }
  return _createClass(UnsupportedMediaTypeError);
}(ClientError);

var RequestedRangeNotSatisfiableErrorOptions = {
  code: "REQUESTED_RANGE_NOT_SATISFIABLE",
  statusCode: 416,
  decorateMessage: false,
  logMessage: false,
  message: "Requested Range Not Satisfiable"
};
var RequestedRangeNotSatisfiableError = /*#__PURE__*/function (_ClientError) {
  _inherits(RequestedRangeNotSatisfiableError, _ClientError);
  var _super = _createSuper(RequestedRangeNotSatisfiableError);
  function RequestedRangeNotSatisfiableError(data, options) {
    _classCallCheck(this, RequestedRangeNotSatisfiableError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), RequestedRangeNotSatisfiableErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Requested Range Not Satisfiable";
    }
    return _super.call(this, message, options);
  }
  return _createClass(RequestedRangeNotSatisfiableError);
}(ClientError);

var ExpectationFailedErrorOptions = {
  code: "EXPECTATION_FAILED",
  statusCode: 417,
  decorateMessage: false,
  logMessage: false,
  message: "Expectation Failed"
};
var ExpectationFailedError = /*#__PURE__*/function (_ClientError) {
  _inherits(ExpectationFailedError, _ClientError);
  var _super = _createSuper(ExpectationFailedError);
  function ExpectationFailedError(data, options) {
    _classCallCheck(this, ExpectationFailedError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), ExpectationFailedErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Expectation Failed";
    }
    return _super.call(this, message, options);
  }
  return _createClass(ExpectationFailedError);
}(ClientError);

var ImATeapotErrorOptions = {
  code: "IM_A_TEAPOT",
  statusCode: 418,
  decorateMessage: false,
  logMessage: false,
  message: "I&#39;m a Teapot"
};
var ImATeapotError = /*#__PURE__*/function (_ClientError) {
  _inherits(ImATeapotError, _ClientError);
  var _super = _createSuper(ImATeapotError);
  function ImATeapotError(data, options) {
    _classCallCheck(this, ImATeapotError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), ImATeapotErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "I'm a Teapot";
    }
    return _super.call(this, message, options);
  }
  return _createClass(ImATeapotError);
}(ClientError);

var EnhanceYourCalmErrorOptions = {
  code: "ENHANCE_YOUR_CALM",
  statusCode: 420,
  decorateMessage: false,
  logMessage: false,
  message: "Enhance Your Calm"
};
var EnhanceYourCalmError = /*#__PURE__*/function (_ClientError) {
  _inherits(EnhanceYourCalmError, _ClientError);
  var _super = _createSuper(EnhanceYourCalmError);
  function EnhanceYourCalmError(data, options) {
    _classCallCheck(this, EnhanceYourCalmError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), EnhanceYourCalmErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Enhance Your Calm";
    }
    return _super.call(this, message, options);
  }
  return _createClass(EnhanceYourCalmError);
}(ClientError);

var UnprocessableEntityErrorOptions = {
  code: "UNPROCESSABLE_ENTITY",
  statusCode: 422,
  decorateMessage: false,
  logMessage: false,
  message: "Unprocessable Entity"
};
var UnprocessableEntityError = /*#__PURE__*/function (_ClientError) {
  _inherits(UnprocessableEntityError, _ClientError);
  var _super = _createSuper(UnprocessableEntityError);
  function UnprocessableEntityError(data, options) {
    _classCallCheck(this, UnprocessableEntityError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), UnprocessableEntityErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Unprocessable Entity";
    }
    return _super.call(this, message, options);
  }
  return _createClass(UnprocessableEntityError);
}(ClientError);

var LockedErrorOptions = {
  code: "LOCKED",
  statusCode: 423,
  decorateMessage: false,
  logMessage: false,
  message: "Locked"
};
var LockedError = /*#__PURE__*/function (_ClientError) {
  _inherits(LockedError, _ClientError);
  var _super = _createSuper(LockedError);
  function LockedError(data, options) {
    _classCallCheck(this, LockedError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), LockedErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Locked";
    }
    return _super.call(this, message, options);
  }
  return _createClass(LockedError);
}(ClientError);

var FailedDependencyErrorOptions = {
  code: "FAILED_DEPENDENCY",
  statusCode: 424,
  decorateMessage: false,
  logMessage: false,
  message: "Failed Dependency"
};
var FailedDependencyError = /*#__PURE__*/function (_ClientError) {
  _inherits(FailedDependencyError, _ClientError);
  var _super = _createSuper(FailedDependencyError);
  function FailedDependencyError(data, options) {
    _classCallCheck(this, FailedDependencyError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), FailedDependencyErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Failed Dependency";
    }
    return _super.call(this, message, options);
  }
  return _createClass(FailedDependencyError);
}(ClientError);

var UnorderedCollectionErrorOptions = {
  code: "UNORDERED_COLLECTION",
  statusCode: 425,
  decorateMessage: false,
  logMessage: false,
  message: "Unordered Collection"
};
var UnorderedCollectionError = /*#__PURE__*/function (_ClientError) {
  _inherits(UnorderedCollectionError, _ClientError);
  var _super = _createSuper(UnorderedCollectionError);
  function UnorderedCollectionError(data, options) {
    _classCallCheck(this, UnorderedCollectionError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), UnorderedCollectionErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Unordered Collection";
    }
    return _super.call(this, message, options);
  }
  return _createClass(UnorderedCollectionError);
}(ClientError);

var UpgradeRequiredErrorOptions = {
  code: "UPGRADE_REQUIRED",
  statusCode: 426,
  decorateMessage: false,
  logMessage: false,
  message: "Upgrade Required"
};
var UpgradeRequiredError = /*#__PURE__*/function (_ClientError) {
  _inherits(UpgradeRequiredError, _ClientError);
  var _super = _createSuper(UpgradeRequiredError);
  function UpgradeRequiredError(data, options) {
    _classCallCheck(this, UpgradeRequiredError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), UpgradeRequiredErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Upgrade Required";
    }
    return _super.call(this, message, options);
  }
  return _createClass(UpgradeRequiredError);
}(ClientError);

var PreconditionRequiredErrorOptions = {
  code: "PRECONDITION_REQUIRED",
  statusCode: 428,
  decorateMessage: false,
  logMessage: false,
  message: "Precondition Required"
};
var PreconditionRequiredError = /*#__PURE__*/function (_ClientError) {
  _inherits(PreconditionRequiredError, _ClientError);
  var _super = _createSuper(PreconditionRequiredError);
  function PreconditionRequiredError(data, options) {
    _classCallCheck(this, PreconditionRequiredError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), PreconditionRequiredErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Precondition Required";
    }
    return _super.call(this, message, options);
  }
  return _createClass(PreconditionRequiredError);
}(ClientError);

var TooManyRequestsErrorOptions = {
  code: "TOO_MANY_REQUESTS",
  statusCode: 429,
  decorateMessage: false,
  logMessage: false,
  message: "Too Many Requests"
};
var TooManyRequestsError = /*#__PURE__*/function (_ClientError) {
  _inherits(TooManyRequestsError, _ClientError);
  var _super = _createSuper(TooManyRequestsError);
  function TooManyRequestsError(data, options) {
    _classCallCheck(this, TooManyRequestsError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), TooManyRequestsErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Too Many Requests";
    }
    return _super.call(this, message, options);
  }
  return _createClass(TooManyRequestsError);
}(ClientError);

var RequestHeaderFieldsTooLargeErrorOptions = {
  code: "REQUEST_HEADER_FIELDS_TOO_LARGE",
  statusCode: 431,
  decorateMessage: false,
  logMessage: false,
  message: "Request Header Fields Too Large"
};
var RequestHeaderFieldsTooLargeError = /*#__PURE__*/function (_ClientError) {
  _inherits(RequestHeaderFieldsTooLargeError, _ClientError);
  var _super = _createSuper(RequestHeaderFieldsTooLargeError);
  function RequestHeaderFieldsTooLargeError(data, options) {
    _classCallCheck(this, RequestHeaderFieldsTooLargeError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), RequestHeaderFieldsTooLargeErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Request Header Fields Too Large";
    }
    return _super.call(this, message, options);
  }
  return _createClass(RequestHeaderFieldsTooLargeError);
}(ClientError);

var NoResponseErrorOptions = {
  code: "NO_RESPONSE",
  statusCode: 444,
  decorateMessage: false,
  logMessage: false,
  message: "No Response"
};
var NoResponseError = /*#__PURE__*/function (_ClientError) {
  _inherits(NoResponseError, _ClientError);
  var _super = _createSuper(NoResponseError);
  function NoResponseError(data, options) {
    _classCallCheck(this, NoResponseError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), NoResponseErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "No Response";
    }
    return _super.call(this, message, options);
  }
  return _createClass(NoResponseError);
}(ClientError);

var RetryWithErrorOptions = {
  code: "RETRY_WITH",
  statusCode: 449,
  decorateMessage: false,
  logMessage: false,
  message: "Retry With"
};
var RetryWithError = /*#__PURE__*/function (_ClientError) {
  _inherits(RetryWithError, _ClientError);
  var _super = _createSuper(RetryWithError);
  function RetryWithError(data, options) {
    _classCallCheck(this, RetryWithError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), RetryWithErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Retry With";
    }
    return _super.call(this, message, options);
  }
  return _createClass(RetryWithError);
}(ClientError);

var BlockedByWindowsParentalControlsErrorOptions = {
  code: "BLOCKED_BY_WINDOWS_PARENTAL_CONTROLS",
  statusCode: 450,
  decorateMessage: false,
  logMessage: false,
  message: "Blocked By Windows Parental Controls"
};
var BlockedByWindowsParentalControlsError = /*#__PURE__*/function (_ClientError) {
  _inherits(BlockedByWindowsParentalControlsError, _ClientError);
  var _super = _createSuper(BlockedByWindowsParentalControlsError);
  function BlockedByWindowsParentalControlsError(data, options) {
    _classCallCheck(this, BlockedByWindowsParentalControlsError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), BlockedByWindowsParentalControlsErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Blocked By Windows Parental Controls";
    }
    return _super.call(this, message, options);
  }
  return _createClass(BlockedByWindowsParentalControlsError);
}(ClientError);

var ClientClosedRequestErrorOptions = {
  code: "CLIENT_CLOSED_REQUEST",
  statusCode: 499,
  decorateMessage: false,
  logMessage: false,
  message: "Client Closed Request"
};
var ClientClosedRequestError = /*#__PURE__*/function (_ClientError) {
  _inherits(ClientClosedRequestError, _ClientError);
  var _super = _createSuper(ClientClosedRequestError);
  function ClientClosedRequestError(data, options) {
    _classCallCheck(this, ClientClosedRequestError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), ClientClosedRequestErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Client Closed Request";
    }
    return _super.call(this, message, options);
  }
  return _createClass(ClientClosedRequestError);
}(ClientError);

var InternalServerErrorOptions = {
  code: "INTERNAL_SERVER_ERROR",
  statusCode: 500,
  decorateMessage: true,
  logMessage: true,
  message: "Internal Server Error"
};
var InternalServerError = /*#__PURE__*/function (_ServerError) {
  _inherits(InternalServerError, _ServerError);
  var _super = _createSuper(InternalServerError);
  function InternalServerError(data, options) {
    _classCallCheck(this, InternalServerError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), InternalServerErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Internal Server Error";
    }
    return _super.call(this, message, options);
  }
  return _createClass(InternalServerError);
}(ServerError);

var NotImplementedErrorOptions = {
  code: "NOT_IMPLEMENTED",
  statusCode: 501,
  decorateMessage: true,
  logMessage: true,
  message: "Not Implemented"
};
var NotImplementedError = /*#__PURE__*/function (_ServerError) {
  _inherits(NotImplementedError, _ServerError);
  var _super = _createSuper(NotImplementedError);
  function NotImplementedError(data, options) {
    _classCallCheck(this, NotImplementedError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), NotImplementedErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Not Implemented";
    }
    return _super.call(this, message, options);
  }
  return _createClass(NotImplementedError);
}(ServerError);

var BadGatewayErrorOptions = {
  code: "BAD_GATEWAY",
  statusCode: 502,
  decorateMessage: true,
  logMessage: true,
  message: "Bad Gateway"
};
var BadGatewayError = /*#__PURE__*/function (_ServerError) {
  _inherits(BadGatewayError, _ServerError);
  var _super = _createSuper(BadGatewayError);
  function BadGatewayError(data, options) {
    _classCallCheck(this, BadGatewayError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), BadGatewayErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Bad Gateway";
    }
    return _super.call(this, message, options);
  }
  return _createClass(BadGatewayError);
}(ServerError);

var ServiceUnavailableErrorOptions = {
  code: "SERVICE_UNAVAILABLE",
  statusCode: 503,
  decorateMessage: true,
  logMessage: true,
  message: "Service Unavailable"
};
var ServiceUnavailableError = /*#__PURE__*/function (_ServerError) {
  _inherits(ServiceUnavailableError, _ServerError);
  var _super = _createSuper(ServiceUnavailableError);
  function ServiceUnavailableError(data, options) {
    _classCallCheck(this, ServiceUnavailableError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), ServiceUnavailableErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Service Unavailable";
    }
    return _super.call(this, message, options);
  }
  return _createClass(ServiceUnavailableError);
}(ServerError);

var GatewayTimeoutErrorOptions = {
  code: "GATEWAY_TIMEOUT",
  statusCode: 504,
  decorateMessage: true,
  logMessage: true,
  message: "Gateway Timeout"
};
var GatewayTimeoutError = /*#__PURE__*/function (_ServerError) {
  _inherits(GatewayTimeoutError, _ServerError);
  var _super = _createSuper(GatewayTimeoutError);
  function GatewayTimeoutError(data, options) {
    _classCallCheck(this, GatewayTimeoutError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), GatewayTimeoutErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Gateway Timeout";
    }
    return _super.call(this, message, options);
  }
  return _createClass(GatewayTimeoutError);
}(ServerError);

var HTTPVersionNotSupportedErrorOptions = {
  code: "HTTP_VERSION_NOT_SUPPORTED",
  statusCode: 505,
  decorateMessage: true,
  logMessage: true,
  message: "HTTP Version Not Supported"
};
var HTTPVersionNotSupportedError = /*#__PURE__*/function (_ServerError) {
  _inherits(HTTPVersionNotSupportedError, _ServerError);
  var _super = _createSuper(HTTPVersionNotSupportedError);
  function HTTPVersionNotSupportedError(data, options) {
    _classCallCheck(this, HTTPVersionNotSupportedError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), HTTPVersionNotSupportedErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "HTTP Version Not Supported";
    }
    return _super.call(this, message, options);
  }
  return _createClass(HTTPVersionNotSupportedError);
}(ServerError);

var VariantAlsoNegotiatesErrorOptions = {
  code: "VARIANT_ALSO_NEGOTIATES",
  statusCode: 506,
  decorateMessage: true,
  logMessage: true,
  message: "Variant Also Negotiates"
};
var VariantAlsoNegotiatesError = /*#__PURE__*/function (_ServerError) {
  _inherits(VariantAlsoNegotiatesError, _ServerError);
  var _super = _createSuper(VariantAlsoNegotiatesError);
  function VariantAlsoNegotiatesError(data, options) {
    _classCallCheck(this, VariantAlsoNegotiatesError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), VariantAlsoNegotiatesErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Variant Also Negotiates";
    }
    return _super.call(this, message, options);
  }
  return _createClass(VariantAlsoNegotiatesError);
}(ServerError);

var InsufficientStorageErrorOptions = {
  code: "INSUFFICIENT_STORAGE",
  statusCode: 507,
  decorateMessage: true,
  logMessage: true,
  message: "Insufficient Storage"
};
var InsufficientStorageError = /*#__PURE__*/function (_ServerError) {
  _inherits(InsufficientStorageError, _ServerError);
  var _super = _createSuper(InsufficientStorageError);
  function InsufficientStorageError(data, options) {
    _classCallCheck(this, InsufficientStorageError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), InsufficientStorageErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Insufficient Storage";
    }
    return _super.call(this, message, options);
  }
  return _createClass(InsufficientStorageError);
}(ServerError);

var LoopDetectedErrorOptions = {
  code: "LOOP_DETECTED",
  statusCode: 508,
  decorateMessage: true,
  logMessage: true,
  message: "Loop Detected"
};
var LoopDetectedError = /*#__PURE__*/function (_ServerError) {
  _inherits(LoopDetectedError, _ServerError);
  var _super = _createSuper(LoopDetectedError);
  function LoopDetectedError(data, options) {
    _classCallCheck(this, LoopDetectedError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), LoopDetectedErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Loop Detected";
    }
    return _super.call(this, message, options);
  }
  return _createClass(LoopDetectedError);
}(ServerError);

var BandwidthLimitExceededErrorOptions = {
  code: "BANDWIDTH_LIMIT_EXCEEDED",
  statusCode: 509,
  decorateMessage: true,
  logMessage: true,
  message: "Bandwidth Limit Exceeded"
};
var BandwidthLimitExceededError = /*#__PURE__*/function (_ServerError) {
  _inherits(BandwidthLimitExceededError, _ServerError);
  var _super = _createSuper(BandwidthLimitExceededError);
  function BandwidthLimitExceededError(data, options) {
    _classCallCheck(this, BandwidthLimitExceededError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), BandwidthLimitExceededErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Bandwidth Limit Exceeded";
    }
    return _super.call(this, message, options);
  }
  return _createClass(BandwidthLimitExceededError);
}(ServerError);

var NotExtendedErrorOptions = {
  code: "NOT_EXTENDED",
  statusCode: 510,
  decorateMessage: true,
  logMessage: true,
  message: "Not Extended"
};
var NotExtendedError = /*#__PURE__*/function (_ServerError) {
  _inherits(NotExtendedError, _ServerError);
  var _super = _createSuper(NotExtendedError);
  function NotExtendedError(data, options) {
    _classCallCheck(this, NotExtendedError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), NotExtendedErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Not Extended";
    }
    return _super.call(this, message, options);
  }
  return _createClass(NotExtendedError);
}(ServerError);

var NetworkAuthenticationRequiredErrorOptions = {
  code: "NETWORK_AUTHENTICATION_REQUIRED",
  statusCode: 511,
  decorateMessage: true,
  logMessage: true,
  message: "Network Authentication Required"
};
var NetworkAuthenticationRequiredError = /*#__PURE__*/function (_ServerError) {
  _inherits(NetworkAuthenticationRequiredError, _ServerError);
  var _super = _createSuper(NetworkAuthenticationRequiredError);
  function NetworkAuthenticationRequiredError(data, options) {
    _classCallCheck(this, NetworkAuthenticationRequiredError);
    options = ebec.mergeOptions(ebec.buildOptions(data, options), NetworkAuthenticationRequiredErrorOptions);
    var message = ebec.buildMessage(data, options);
    if (!message) {
      message = "Network Authentication Required";
    }
    return _super.call(this, message, options);
  }
  return _createClass(NetworkAuthenticationRequiredError);
}(ServerError);

/*
 * Copyright (c) 2022.
 * Author Peter Placzek (tada5hi)
 * For the full copyright and license information,
 * view the LICENSE file that was distributed with this source code.
 */
function extendsClientError(error) {
  if (error instanceof ClientError) {
    return true;
  }

  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  // @ts-ignore
  return ebec.extendsBaseError(error) && (error.getOption('statusCode') >= 400 || error.getOption('statusCode') < 500);
}
function extendsServerError(error) {
  if (error instanceof ServerError) {
    return true;
  }

  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  // @ts-ignore
  return ebec.extendsBaseError(error) && (error.getOption('statusCode') >= 500 || error.getOption('statusCode') < 600);
}

Object.defineProperty(exports, 'BaseError', {
  enumerable: true,
  get: function () { return ebec.BaseError; }
});
Object.defineProperty(exports, 'buildMessage', {
  enumerable: true,
  get: function () { return ebec.buildMessage; }
});
Object.defineProperty(exports, 'buildOptions', {
  enumerable: true,
  get: function () { return ebec.buildOptions; }
});
Object.defineProperty(exports, 'extendsBaseError', {
  enumerable: true,
  get: function () { return ebec.extendsBaseError; }
});
Object.defineProperty(exports, 'mergeOptions', {
  enumerable: true,
  get: function () { return ebec.mergeOptions; }
});
exports.BadGatewayError = BadGatewayError;
exports.BadGatewayErrorOptions = BadGatewayErrorOptions;
exports.BadRequestError = BadRequestError;
exports.BadRequestErrorOptions = BadRequestErrorOptions;
exports.BandwidthLimitExceededError = BandwidthLimitExceededError;
exports.BandwidthLimitExceededErrorOptions = BandwidthLimitExceededErrorOptions;
exports.BlockedByWindowsParentalControlsError = BlockedByWindowsParentalControlsError;
exports.BlockedByWindowsParentalControlsErrorOptions = BlockedByWindowsParentalControlsErrorOptions;
exports.ClientClosedRequestError = ClientClosedRequestError;
exports.ClientClosedRequestErrorOptions = ClientClosedRequestErrorOptions;
exports.ClientError = ClientError;
exports.ConflictError = ConflictError;
exports.ConflictErrorOptions = ConflictErrorOptions;
exports.EnhanceYourCalmError = EnhanceYourCalmError;
exports.EnhanceYourCalmErrorOptions = EnhanceYourCalmErrorOptions;
exports.ExpectationFailedError = ExpectationFailedError;
exports.ExpectationFailedErrorOptions = ExpectationFailedErrorOptions;
exports.FailedDependencyError = FailedDependencyError;
exports.FailedDependencyErrorOptions = FailedDependencyErrorOptions;
exports.ForbiddenError = ForbiddenError;
exports.ForbiddenErrorOptions = ForbiddenErrorOptions;
exports.GatewayTimeoutError = GatewayTimeoutError;
exports.GatewayTimeoutErrorOptions = GatewayTimeoutErrorOptions;
exports.GoneError = GoneError;
exports.GoneErrorOptions = GoneErrorOptions;
exports.HTTPVersionNotSupportedError = HTTPVersionNotSupportedError;
exports.HTTPVersionNotSupportedErrorOptions = HTTPVersionNotSupportedErrorOptions;
exports.ImATeapotError = ImATeapotError;
exports.ImATeapotErrorOptions = ImATeapotErrorOptions;
exports.InsufficientStorageError = InsufficientStorageError;
exports.InsufficientStorageErrorOptions = InsufficientStorageErrorOptions;
exports.InternalServerError = InternalServerError;
exports.InternalServerErrorOptions = InternalServerErrorOptions;
exports.LengthRequiredError = LengthRequiredError;
exports.LengthRequiredErrorOptions = LengthRequiredErrorOptions;
exports.LockedError = LockedError;
exports.LockedErrorOptions = LockedErrorOptions;
exports.LoopDetectedError = LoopDetectedError;
exports.LoopDetectedErrorOptions = LoopDetectedErrorOptions;
exports.MethodNotAllowedError = MethodNotAllowedError;
exports.MethodNotAllowedErrorOptions = MethodNotAllowedErrorOptions;
exports.NetworkAuthenticationRequiredError = NetworkAuthenticationRequiredError;
exports.NetworkAuthenticationRequiredErrorOptions = NetworkAuthenticationRequiredErrorOptions;
exports.NoResponseError = NoResponseError;
exports.NoResponseErrorOptions = NoResponseErrorOptions;
exports.NotAcceptableError = NotAcceptableError;
exports.NotAcceptableErrorOptions = NotAcceptableErrorOptions;
exports.NotExtendedError = NotExtendedError;
exports.NotExtendedErrorOptions = NotExtendedErrorOptions;
exports.NotFoundError = NotFoundError;
exports.NotFoundErrorOptions = NotFoundErrorOptions;
exports.NotImplementedError = NotImplementedError;
exports.NotImplementedErrorOptions = NotImplementedErrorOptions;
exports.PreconditionFailedError = PreconditionFailedError;
exports.PreconditionFailedErrorOptions = PreconditionFailedErrorOptions;
exports.PreconditionRequiredError = PreconditionRequiredError;
exports.PreconditionRequiredErrorOptions = PreconditionRequiredErrorOptions;
exports.ProxyAuthenticationRequiredError = ProxyAuthenticationRequiredError;
exports.ProxyAuthenticationRequiredErrorOptions = ProxyAuthenticationRequiredErrorOptions;
exports.RequestEntityTooLargeError = RequestEntityTooLargeError;
exports.RequestEntityTooLargeErrorOptions = RequestEntityTooLargeErrorOptions;
exports.RequestHeaderFieldsTooLargeError = RequestHeaderFieldsTooLargeError;
exports.RequestHeaderFieldsTooLargeErrorOptions = RequestHeaderFieldsTooLargeErrorOptions;
exports.RequestTimeoutError = RequestTimeoutError;
exports.RequestTimeoutErrorOptions = RequestTimeoutErrorOptions;
exports.RequestURITooLongError = RequestURITooLongError;
exports.RequestURITooLongErrorOptions = RequestURITooLongErrorOptions;
exports.RequestedRangeNotSatisfiableError = RequestedRangeNotSatisfiableError;
exports.RequestedRangeNotSatisfiableErrorOptions = RequestedRangeNotSatisfiableErrorOptions;
exports.RetryWithError = RetryWithError;
exports.RetryWithErrorOptions = RetryWithErrorOptions;
exports.ServerError = ServerError;
exports.ServiceUnavailableError = ServiceUnavailableError;
exports.ServiceUnavailableErrorOptions = ServiceUnavailableErrorOptions;
exports.TooManyRequestsError = TooManyRequestsError;
exports.TooManyRequestsErrorOptions = TooManyRequestsErrorOptions;
exports.UnauthorizedError = UnauthorizedError;
exports.UnauthorizedErrorOptions = UnauthorizedErrorOptions;
exports.UnorderedCollectionError = UnorderedCollectionError;
exports.UnorderedCollectionErrorOptions = UnorderedCollectionErrorOptions;
exports.UnprocessableEntityError = UnprocessableEntityError;
exports.UnprocessableEntityErrorOptions = UnprocessableEntityErrorOptions;
exports.UnsupportedMediaTypeError = UnsupportedMediaTypeError;
exports.UnsupportedMediaTypeErrorOptions = UnsupportedMediaTypeErrorOptions;
exports.UpgradeRequiredError = UpgradeRequiredError;
exports.UpgradeRequiredErrorOptions = UpgradeRequiredErrorOptions;
exports.VariantAlsoNegotiatesError = VariantAlsoNegotiatesError;
exports.VariantAlsoNegotiatesErrorOptions = VariantAlsoNegotiatesErrorOptions;
exports.extendsClientError = extendsClientError;
exports.extendsServerError = extendsServerError;
//# sourceMappingURL=index.cjs.js.map
