/**
 * DevExtreme (cjs/ui/list/item.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 _item = _interopRequireDefault(require("../collection/item"));

function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    }
}
const LIST_ITEM_BADGE_CONTAINER_CLASS = "dx-list-item-badge-container";
const LIST_ITEM_BADGE_CLASS = "dx-list-item-badge";
const BADGE_CLASS = "dx-badge";
const LIST_ITEM_CHEVRON_CONTAINER_CLASS = "dx-list-item-chevron-container";
const LIST_ITEM_CHEVRON_CLASS = "dx-list-item-chevron";
const ListItem = _item.default.inherit({
    _renderWatchers: function() {
        this.callBase();
        this._startWatcher("badge", this._renderBadge.bind(this));
        this._startWatcher("showChevron", this._renderShowChevron.bind(this))
    },
    _renderBadge: function(badge) {
        this._$element.children(".dx-list-item-badge-container").remove();
        if (!badge) {
            return
        }
        const $badge = (0, _renderer.default)("<div>").addClass("dx-list-item-badge-container").append((0, _renderer.default)("<div>").addClass("dx-list-item-badge").addClass("dx-badge").text(badge));
        const $chevron = this._$element.children(".dx-list-item-chevron-container").first();
        $chevron.length > 0 ? $badge.insertBefore($chevron) : $badge.appendTo(this._$element)
    },
    _renderShowChevron: function(showChevron) {
        this._$element.children(".dx-list-item-chevron-container").remove();
        if (!showChevron) {
            return
        }
        const $chevronContainer = (0, _renderer.default)("<div>").addClass("dx-list-item-chevron-container");
        const $chevron = (0, _renderer.default)("<div>").addClass("dx-list-item-chevron");
        $chevronContainer.append($chevron).appendTo(this._$element)
    }
});
var _default = ListItem;
exports.default = _default;
module.exports = exports.default;
module.exports.default = exports.default;
