import "../motion-utils/dist-es-errors.js";
import { mapEasingToNativeEasing } from "../motion-dom/dist-es-animation-waapi-utils-easing.js";
function startWaapiAnimation(element, valueName, keyframes, { delay = 0, duration = 300, repeat = 0, repeatType = "loop", ease = "easeInOut", times } = {}) {
  const keyframeOptions = { [valueName]: keyframes };
  if (times)
    keyframeOptions.offset = times;
  const easing = mapEasingToNativeEasing(ease, duration);
  if (Array.isArray(easing))
    keyframeOptions.easing = easing;
  return element.animate(keyframeOptions, {
    delay,
    duration,
    easing: !Array.isArray(easing) ? easing : "linear",
    fill: "both",
    iterations: repeat + 1,
    direction: repeatType === "reverse" ? "alternate" : "normal"
  });
}
export {
  startWaapiAnimation
};
//# sourceMappingURL=dist-es-animation-animators-waapi-index.js.map
