import { invariant } from "../motion-utils/dist-es-errors.js";
import { noop } from "../motion-utils/dist-es-noop.js";
import { isBezierDefinition } from "../motion-dom/dist-es-utils-is-bezier-definition.js";
import { anticipate } from "./dist-es-easing-anticipate.js";
import { backOut, backInOut, backIn } from "./dist-es-easing-back.js";
import { circOut, circInOut, circIn } from "./dist-es-easing-circ.js";
import { cubicBezier } from "./dist-es-easing-cubic-bezier.js";
import { easeOut, easeInOut, easeIn } from "./dist-es-easing-ease.js";
const easingLookup = {
  linear: noop,
  easeIn,
  easeInOut,
  easeOut,
  circIn,
  circInOut,
  circOut,
  backIn,
  backInOut,
  backOut,
  anticipate
};
const easingDefinitionToFunction = (definition) => {
  if (isBezierDefinition(definition)) {
    invariant(definition.length === 4, `Cubic bezier arrays must contain four numerical values.`);
    const [x1, y1, x2, y2] = definition;
    return cubicBezier(x1, y1, x2, y2);
  } else if (typeof definition === "string") {
    invariant(easingLookup[definition] !== void 0, `Invalid easing type '${definition}'`);
    return easingLookup[definition];
  }
  return definition;
};
export {
  easingDefinitionToFunction
};
//# sourceMappingURL=dist-es-easing-utils-map.js.map
