// Pure photosensitivity helper. WCAG 2.3.1: no more than 3 general flashes
// (luminance transitions) per second. Given a transition COUNT, returns the
// minimum total duration that keeps the rate at or below 3/sec, and a clamp
// that only ever slows a transition down. UMD: browser `HEFFlash` + require().
(function (root, factory) {
  const api = factory();
  if (typeof module !== "undefined" && module.exports) module.exports = api;
  else root.HEFFlash = api;
})(typeof self !== "undefined" ? self : this, function () {
  "use strict";
  const MAX_PER_SEC = 3;
  function minSafeDurationMs(count) {
    const n = Math.max(0, Number(count) || 0);
    return (n / MAX_PER_SEC) * 1000;
  }
  function clampDurationMs(requestedMs, count) {
    return Math.max(Number(requestedMs) || 0, minSafeDurationMs(count));
  }
  return { MAX_PER_SEC, minSafeDurationMs, clampDurationMs };
});
