const top = 'top', right = 'right', bottom = 'bottom', left = 'left', width = 'width', height = 'height';
// Screen offsets from bounding client rect
const getBounds = (component) => component.element.dom.getBoundingClientRect();
const getBoundsProperty = (bounds, property) => bounds[property];
const getMinXBounds = (component) => {
    const bounds = getBounds(component);
    return getBoundsProperty(bounds, left);
};
const getMaxXBounds = (component) => {
    const bounds = getBounds(component);
    return getBoundsProperty(bounds, right);
};
const getMinYBounds = (component) => {
    const bounds = getBounds(component);
    return getBoundsProperty(bounds, top);
};
const getMaxYBounds = (component) => {
    const bounds = getBounds(component);
    return getBoundsProperty(bounds, bottom);
};
const getXScreenRange = (component) => {
    const bounds = getBounds(component);
    return getBoundsProperty(bounds, width);
};
const getYScreenRange = (component) => {
    const bounds = getBounds(component);
    return getBoundsProperty(bounds, height);
};
const getCenterOffsetOf = (componentMinEdge, componentMaxEdge, spectrumMinEdge) => (componentMinEdge + componentMaxEdge) / 2 - spectrumMinEdge;
const getXCenterOffSetOf = (component, spectrum) => {
    const componentBounds = getBounds(component);
    const spectrumBounds = getBounds(spectrum);
    const componentMinEdge = getBoundsProperty(componentBounds, left);
    const componentMaxEdge = getBoundsProperty(componentBounds, right);
    const spectrumMinEdge = getBoundsProperty(spectrumBounds, left);
    return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge);
};
const getYCenterOffSetOf = (component, spectrum) => {
    const componentBounds = getBounds(component);
    const spectrumBounds = getBounds(spectrum);
    const componentMinEdge = getBoundsProperty(componentBounds, top);
    const componentMaxEdge = getBoundsProperty(componentBounds, bottom);
    const spectrumMinEdge = getBoundsProperty(spectrumBounds, top);
    return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge);
};
export { getMinXBounds, getMaxXBounds, getMinYBounds, getMaxYBounds, getXScreenRange, getYScreenRange, getXCenterOffSetOf, getYCenterOffSetOf };
//# sourceMappingURL=SliderOffsets.js.map