/**
 * DevExtreme (esm/ui/scheduler/utils.js)
 * Version: 21.2.0 (build 21200-0321)
 * Build date: Mon Jul 19 2021
 *
 * Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
 * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
 */
import $ from "../../core/renderer";
import {
    extend
} from "../../core/utils/extend";
import {
    each
} from "../../core/utils/iterator";
import {
    getResourceManager
} from "./instanceFactory";
import {
    APPOINTMENT_SETTINGS_KEY
} from "./constants";
export var utils = {
    dataAccessors: {
        getAppointmentSettings: element => $(element).data(APPOINTMENT_SETTINGS_KEY),
        getAppointmentInfo: element => {
            var settings = utils.dataAccessors.getAppointmentSettings(element);
            return null === settings || void 0 === settings ? void 0 : settings.info
        },
        combine: (key, dataAccessors) => {
            var result = extend(true, {}, dataAccessors);
            var resourceManager = getResourceManager(key);
            if (dataAccessors && resourceManager) {
                each(resourceManager._dataAccessors, (type, accessor) => {
                    result[type].resources = accessor
                })
            }
            return result
        }
    },
    DOM: {
        getHeaderHeight: header => header._$element && parseInt(header._$element.outerHeight(), 10)
    }
};
