/**
 * DevExtreme (cjs/__internal/grids/grid_core/focus/m_focus_utils.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/
 */
"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.UiGridCoreFocusUtils = void 0;
var _date_serialization = _interopRequireDefault(require("../../../../core/utils/date_serialization"));
var _type = require("../../../../core/utils/type");

function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    }
}
const getSortFilterValue = (sortInfo, rowData, _ref) => {
    let {
        isRemoteFiltering: isRemoteFiltering,
        dateSerializationFormat: dateSerializationFormat,
        getSelector: getSelector
    } = _ref;
    const {
        selector: selector
    } = sortInfo;
    const getter = (0, _type.isFunction)(selector) ? selector : getSelector(selector);
    const rawValue = getter ? getter(rowData) : rowData[selector];
    const safeValue = isRemoteFiltering && (0, _type.isDate)(rawValue) ? _date_serialization.default.serializeDate(rawValue, dateSerializationFormat) : rawValue;
    return {
        getter: getter,
        rawValue: rawValue,
        safeValue: safeValue
    }
};
const UiGridCoreFocusUtils = {
    getSortFilterValue: getSortFilterValue
};
exports.UiGridCoreFocusUtils = UiGridCoreFocusUtils;
