import r from "./format.es.js";
import { modifierPhases as c } from "../enums.es.js";
var a = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s', u = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available', f = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
function i(o) {
  o.forEach(function(e) {
    [].concat(Object.keys(e), f).filter(function(s, n, t) {
      return t.indexOf(s) === n;
    }).forEach(function(s) {
      switch (s) {
        case "name":
          typeof e.name != "string" && console.error(r(a, String(e.name), '"name"', '"string"', '"' + String(e.name) + '"'));
          break;
        case "enabled":
          typeof e.enabled != "boolean" && console.error(r(a, e.name, '"enabled"', '"boolean"', '"' + String(e.enabled) + '"'));
          break;
        case "phase":
          c.indexOf(e.phase) < 0 && console.error(r(a, e.name, '"phase"', "either " + c.join(", "), '"' + String(e.phase) + '"'));
          break;
        case "fn":
          typeof e.fn != "function" && console.error(r(a, e.name, '"fn"', '"function"', '"' + String(e.fn) + '"'));
          break;
        case "effect":
          e.effect != null && typeof e.effect != "function" && console.error(r(a, e.name, '"effect"', '"function"', '"' + String(e.fn) + '"'));
          break;
        case "requires":
          e.requires != null && !Array.isArray(e.requires) && console.error(r(a, e.name, '"requires"', '"array"', '"' + String(e.requires) + '"'));
          break;
        case "requiresIfExists":
          Array.isArray(e.requiresIfExists) || console.error(r(a, e.name, '"requiresIfExists"', '"array"', '"' + String(e.requiresIfExists) + '"'));
          break;
        case "options":
        case "data":
          break;
        default:
          console.error('PopperJS: an invalid property has been provided to the "' + e.name + '" modifier, valid properties are ' + f.map(function(n) {
            return '"' + n + '"';
          }).join(", ") + '; but "' + s + '" was provided.');
      }
      e.requires && e.requires.forEach(function(n) {
        o.find(function(t) {
          return t.name === n;
        }) == null && console.error(r(u, String(e.name), n, n));
      });
    });
  });
}
export {
  i as default
};
//# sourceMappingURL=validateModifiers.es.js.map
