import { rangeIncludesDate } from './rangeIncludesDate.js';
import { defaultDateLib } from '../classes/DateLib.js';

/**
 * Determines whether a given range overlaps with another range.
 *
 * @since 9.2.2
 * @group Utilities
 */
function rangeOverlaps(rangeLeft, rangeRight, dateLib = defaultDateLib) {
    return (rangeIncludesDate(rangeLeft, rangeRight.from, false, dateLib) ||
        rangeIncludesDate(rangeLeft, rangeRight.to, false, dateLib) ||
        rangeIncludesDate(rangeRight, rangeLeft.from, false, dateLib) ||
        rangeIncludesDate(rangeRight, rangeLeft.to, false, dateLib));
}

export { rangeOverlaps };
//# sourceMappingURL=rangeOverlaps.js.map
