/**
 * DevExtreme (cjs/ui/tooltip/tooltip.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 _renderer = _interopRequireDefault(require("../../core/renderer"));
var _guid = _interopRequireDefault(require("../../core/guid"));
var _component_registrator = _interopRequireDefault(require("../../core/component_registrator"));
var _extend = require("../../core/utils/extend");
var _ui = _interopRequireDefault(require("../popover/ui.popover"));
var _type = require("../../core/utils/type");

function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    }
}
const TOOLTIP_CLASS = "dx-tooltip";
const TOOLTIP_WRAPPER_CLASS = "dx-tooltip-wrapper";
const Tooltip = _ui.default.inherit({
    _getDefaultOptions: function() {
        return (0, _extend.extend)(this.callBase(), {
            toolbarItems: [],
            showCloseButton: false,
            enableBodyScroll: true,
            showTitle: false,
            title: null,
            titleTemplate: null,
            onTitleRendered: null,
            bottomTemplate: null,
            preventScrollEvents: false,
            propagateOutsideClick: true
        })
    },
    _render: function() {
        this.$element().addClass("dx-tooltip");
        this.$wrapper().addClass("dx-tooltip-wrapper");
        this.callBase()
    },
    _renderContent: function() {
        this.callBase();
        this._toggleAriaAttributes()
    },
    _toggleAriaDescription: function(showing) {
        const $target = (0, _renderer.default)(this.option("target"));
        const label = showing ? this._contentId : void 0;
        if (!(0, _type.isWindow)($target.get(0))) {
            this.setAria("describedby", label, $target)
        }
    },
    _toggleAriaAttributes: function() {
        this._contentId = "dx-".concat(new _guid.default);
        this.$overlayContent().attr({
            id: this._contentId
        });
        this._toggleAriaDescription(true)
    }
});
(0, _component_registrator.default)("dxTooltip", Tooltip);
var _default = Tooltip;
exports.default = _default;
module.exports = exports.default;
module.exports.default = exports.default;
