import { isWillChangeMotionValue } from "./is.js";
import { MotionGlobalConfig } from "../../../../../motion-utils/dist/es/global-config.js";
function addValueToWillChange(visualElement, key) {
  const willChange = visualElement.getValue("willChange");
  if (isWillChangeMotionValue(willChange)) {
    return willChange.add(key);
  } else if (!willChange && MotionGlobalConfig.WillChange) {
    const newWillChange = new MotionGlobalConfig.WillChange("auto");
    visualElement.addValue("willChange", newWillChange);
    newWillChange.add(key);
  }
}
export {
  addValueToWillChange
};
//# sourceMappingURL=add-will-change.js.map
