import { useMemo } from 'react';
import { normalizeSnapPoints } from '../utilities';
export const useNormalizedSnapPoints = function (snapPoints) {
  let containerHeight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
  let handleHeight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
  return useMemo(() => {
    const normalizedSnapPoints = normalizeSnapPoints(snapPoints, containerHeight);
    return normalizedSnapPoints.map(normalizedSnapPoint => {
      /**
       * we subset handleHeight from the `normalizedSnapPoint` to make
       * sure that sheets and its handle will be out of the screen.
       */
      if (normalizedSnapPoint === 0 && handleHeight !== 0) {
        normalizedSnapPoint = normalizedSnapPoint - handleHeight;
      }
      return Math.max(containerHeight - normalizedSnapPoint - handleHeight, 0);
    });
  }, [snapPoints, containerHeight, handleHeight]);
};
//# sourceMappingURL=useNormalizedSnapPoints.js.map