var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { UmbSectionSidebarMenuElement } from '../section-sidebar-menu/section-sidebar-menu.element.js';
import { css, html, customElement, state } from '../../../../external/lit/index.js';
import { UmbParentEntityContext } from '../../entity/index.js';
let UmbSectionSidebarMenuWithEntityActionsElement = class UmbSectionSidebarMenuWithEntityActionsElement extends UmbSectionSidebarMenuElement {
    constructor() {
        super(...arguments);
        this._unique = null;
        this.#parentContext = new UmbParentEntityContext(this);
    }
    #parentContext;
    updated(_changedProperties) {
        if (_changedProperties.has('manifest')) {
            const entityType = this.manifest?.meta.entityType;
            this.#parentContext.setParent(entityType ? { unique: this._unique, entityType } : undefined);
        }
    }
    renderHeader() {
        const label = this.localize.string(this.manifest?.meta?.label ?? '');
        return html `
			<div id="header">
				<h3>${label}</h3>
				<umb-entity-actions-bundle
					slot="actions"
					.unique=${this._unique}
					.entityType=${this.manifest?.meta.entityType}
					.label=${label}>
				</umb-entity-actions-bundle>
			</div>
		`;
    }
    static { this.styles = [
        ...UmbSectionSidebarMenuElement.styles,
        css `
			#header {
				display: flex;
				flex-direction: row;
				align-items: center;
			}
			#header > :first-child {
				flex-grow: 1;
			}
		`,
    ]; }
};
__decorate([
    state()
], UmbSectionSidebarMenuWithEntityActionsElement.prototype, "_unique", void 0);
__decorate([
    state()
], UmbSectionSidebarMenuWithEntityActionsElement.prototype, "_entityType", void 0);
UmbSectionSidebarMenuWithEntityActionsElement = __decorate([
    customElement('umb-section-sidebar-menu-with-entity-actions')
], UmbSectionSidebarMenuWithEntityActionsElement);
export { UmbSectionSidebarMenuWithEntityActionsElement };
export default UmbSectionSidebarMenuWithEntityActionsElement;
