/**
 * @internal
 */ export const getTabRoleOnly = (container)=>[
        ...container.querySelectorAll('[role="tab"]')
    ];
/**
 * @internal
 */ export const getTabPanelRoleOnly = (container)=>[
        ...container.querySelectorAll('[role="tabpanel"]')
    ];
/**
 * @internal
 */ export const scrollTabIntoView = (options)=>{
    const { container, vertical, forward, backward, activeIndex } = options;
    if (!container) {
        return;
    }
    const activeTab = getTabRoleOnly(container)[activeIndex];
    if (!activeTab) {
        return;
    }
    const sizeAttribute = vertical ? "offsetHeight" : "offsetWidth";
    const offsetAttribute = vertical ? "offsetTop" : "offsetLeft";
    const scrollAttribute = vertical ? "scrollTop" : "scrollLeft";
    const firstOffset = backward?.[sizeAttribute] || 0;
    const lastOffset = forward?.[sizeAttribute] || 0;
    const elementStart = activeTab[offsetAttribute];
    const elementEnd = elementStart + activeTab[sizeAttribute];
    const containerStart = container[scrollAttribute];
    const containerEnd = containerStart + container[sizeAttribute] - lastOffset;
    if (elementEnd > containerEnd) {
        const containerSize = container[sizeAttribute] - lastOffset;
        container[scrollAttribute] = elementEnd - containerSize;
    } else if (elementStart < containerStart + firstOffset) {
        container[scrollAttribute] = elementStart - firstOffset;
    }
};

//# sourceMappingURL=utils.js.map