import { ViewsGroup } from './views-group';
import { ZoomGroup } from './zoom-group';
import { ShowGroup } from './show-group';
import { RIBBON_ID } from '../ribbon-base/ribbon-constants';
export var VIEW_TAB_ID = '_view_tab';
/**
 * View tab implementation
 * @private
 */
var ViewTab = /** @class */ (function () {
    /**
     * Constructor for ViewTab class
     * @param {DocumentEditorContainer} container - DocumentEditorContainer instance
     */
    function ViewTab(container) {
        this.container = container;
        // Initialize groups
        this.viewsGroup = new ViewsGroup(container);
        this.zoomGroup = new ZoomGroup(container);
        this.showGroup = new ShowGroup(container);
    }
    /**
     * Get the View tab configuration
     * @returns {RibbonTabModel} The ribbon tab model
     */
    ViewTab.prototype.getViewTab = function () {
        return {
            id: this.container.element.id + RIBBON_ID + VIEW_TAB_ID,
            header: this.container.localObj.getConstant('View'),
            keyTip: 'W',
            groups: [
                this.viewsGroup.getGroupModel(),
                this.zoomGroup.getGroupModel(),
                this.showGroup.getGroupModel()
            ]
        };
    };
    /**
     * Handle selection change to update ribbon controls state
     * @returns {void}
     */
    ViewTab.prototype.onSelectionChange = function () {
        this.viewsGroup.updateSelection();
        this.showGroup.updateSelection();
    };
    /**
     * Clean up resources when tab is destroyed
     * This method properly disposes all group components and clears references
     * @returns {void}
     */
    ViewTab.prototype.destroy = function () {
        // Clean up group resources
        if (this.viewsGroup) {
            this.viewsGroup.destroy();
        }
        if (this.zoomGroup) {
            this.zoomGroup.destroy();
        }
        if (this.showGroup) {
            this.showGroup.destroy();
        }
        // Clear references
        this.viewsGroup = undefined;
        this.zoomGroup = undefined;
        this.showGroup = undefined;
        this.container = undefined;
    };
    return ViewTab;
}());
export { ViewTab };
