/**
 * DevExtreme (esm/__internal/scheduler/r1/components/base/header_panel.js)
 * Version: 23.2.6 (build 24140-0112)
 * Build date: Sun May 19 2024
 *
 * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import _extends from "@babel/runtime/helpers/esm/extends";
import {
    createVNode,
    createComponentVNode
} from "inferno";
import {
    createReRenderEffect,
    InfernoWrapperComponent
} from "@devextreme/runtime/inferno";
import {
    getTemplate
} from "../../../../core/r1/utils/index";
import {
    isHorizontalGroupingApplied
} from "../../utils/index";
import {
    DateHeader
} from "./date_header";
import {
    GroupPanel,
    GroupPanelDefaultProps
} from "./group_panel";
export var HeaderPanelDefaultProps = _extends(_extends({}, GroupPanelDefaultProps), {
    isRenderDateHeader: true,
    dateHeaderTemplate: DateHeader
});
export class HeaderPanel extends InfernoWrapperComponent {
    createEffects() {
        return [createReRenderEffect()]
    }
    render() {
        var {
            dateHeaderData: dateHeaderData,
            groupByDate: groupByDate,
            groupOrientation: groupOrientation,
            groupPanelData: groupPanelData,
            groups: groups,
            isRenderDateHeader: isRenderDateHeader,
            dateCellTemplate: dateCellTemplate,
            dateHeaderTemplate: dateHeaderTemplate,
            resourceCellTemplate: resourceCellTemplate,
            timeCellTemplate: timeCellTemplate
        } = this.props;
        var isHorizontalGrouping = isHorizontalGroupingApplied(groups, groupOrientation);
        var DateCellTemplateComponent = getTemplate(dateCellTemplate);
        var DateHeaderTemplateComponent = getTemplate(dateHeaderTemplate);
        var ResourceCellTemplateComponent = getTemplate(resourceCellTemplate);
        var TimeCellTemplateComponent = getTemplate(timeCellTemplate);
        return createVNode(1, "thead", null, [isHorizontalGrouping && !groupByDate && createComponentVNode(2, GroupPanel, {
            groupPanelData: groupPanelData,
            groups: groups,
            groupByDate: groupByDate,
            groupOrientation: groupOrientation,
            resourceCellTemplate: ResourceCellTemplateComponent
        }), isRenderDateHeader && DateHeaderTemplateComponent({
            groupByDate: groupByDate,
            dateHeaderData: dateHeaderData,
            groupOrientation: groupOrientation,
            groups: groups,
            dateCellTemplate: DateCellTemplateComponent,
            timeCellTemplate: TimeCellTemplateComponent
        }), groupByDate && createComponentVNode(2, GroupPanel, {
            groupPanelData: groupPanelData,
            groups: groups,
            groupByDate: groupByDate,
            groupOrientation: groupOrientation,
            resourceCellTemplate: ResourceCellTemplateComponent
        })], 0)
    }
}
HeaderPanel.defaultProps = HeaderPanelDefaultProps;
