/**
 * DevExtreme (cjs/ui/calendar/ui.calendar.single.selection.strategy.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";
exports.default = void 0;
var _uiCalendarSelection = _interopRequireDefault(require("./ui.calendar.selection.strategy"));

function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    }
}

function _inheritsLoose(subClass, superClass) {
    subClass.prototype = Object.create(superClass.prototype);
    subClass.prototype.constructor = subClass;
    _setPrototypeOf(subClass, superClass)
}

function _setPrototypeOf(o, p) {
    _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(o, p) {
        o.__proto__ = p;
        return o
    };
    return _setPrototypeOf(o, p)
}
let CalendarSingleSelectionStrategy = function(_CalendarSelectionStr) {
    _inheritsLoose(CalendarSingleSelectionStrategy, _CalendarSelectionStr);

    function CalendarSingleSelectionStrategy(component) {
        var _this;
        _this = _CalendarSelectionStr.call(this, component) || this;
        _this.NAME = "SingleSelection";
        return _this
    }
    var _proto = CalendarSingleSelectionStrategy.prototype;
    _proto.getViewOptions = function() {
        return {
            value: this.dateOption("value"),
            range: [],
            selectionMode: "single"
        }
    };
    _proto.selectValue = function(selectedValue, e) {
        this.skipNavigate();
        this.dateValue(selectedValue, e)
    };
    _proto.updateAriaSelected = function(value, previousValue) {
        var _value, _previousValue;
        null !== (_value = value) && void 0 !== _value ? _value : value = [this.dateOption("value")];
        null !== (_previousValue = previousValue) && void 0 !== _previousValue ? _previousValue : previousValue = [];
        _CalendarSelectionStr.prototype.updateAriaSelected.call(this, value, previousValue)
    };
    _proto.getDefaultCurrentDate = function() {
        return this.dateOption("value")
    };
    _proto.restoreValue = function() {
        this.calendar.option("value", null)
    };
    _proto._updateViewsValue = function(value) {
        this._updateViewsOption("value", value[0])
    };
    return CalendarSingleSelectionStrategy
}(_uiCalendarSelection.default);
var _default = CalendarSingleSelectionStrategy;
exports.default = _default;
module.exports = exports.default;
module.exports.default = exports.default;
