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 { UMB_DATA_TYPE_WORKSPACE_CONTEXT } from '../../data-type-workspace.context-token.js';
import { UmbTextStyles } from '../../../../core/style/index.js';
import { css, html, customElement, state, nothing } from '../../../../../external/lit/index.js';
import { UmbLitElement } from '../../../../core/lit-element/index.js';
let UmbWorkspaceViewDataTypeInfoElement = class UmbWorkspaceViewDataTypeInfoElement extends UmbLitElement {
    constructor() {
        super();
        this._unique = '';
        this.consumeContext(UMB_DATA_TYPE_WORKSPACE_CONTEXT, (dataTypeContext) => {
            this._workspaceContext = dataTypeContext;
            this._observeDataType();
        });
    }
    _observeDataType() {
        if (!this._workspaceContext)
            return;
        this.observe(this._workspaceContext.unique, (unique) => {
            this._unique = unique;
        });
        this.observe(this._workspaceContext.propertyEditorSchemaAlias, (schemaAlias) => {
            this._schemaAlias = schemaAlias;
        });
        this.observe(this._workspaceContext.propertyEditorUiAlias, (editorUiAlias) => {
            this._uiAlias = editorUiAlias;
        });
        this.observe(this._workspaceContext.propertyEditorDataSourceAlias, (dataSourceAlias) => {
            this._dataSourceAlias = dataSourceAlias;
        });
    }
    render() {
        return html `
			<div class="container">
				<umb-extension-slot id="workspace-info-apps" type="workspaceInfoApp"></umb-extension-slot>
			</div>
			<div class="container">${this.#renderGeneralInfo()}</div>
		`;
    }
    #renderGeneralInfo() {
        return html `
			<uui-box id="general-section" headline="General">
				<div class="general-item">
					<strong><umb-localize key="template_id">Id</umb-localize></strong>
					<span>${this._unique}</span>
				</div>
				<div class="general-item">
					<strong>Property Editor Schema Alias</strong>
					<span>${this._schemaAlias}</span>
				</div>
				<div class="general-item">
					<strong>Property Editor UI Alias</strong>
					<span>${this._uiAlias}</span>
				</div>
				${this.#renderDataSourceInfo()}
			</uui-box>
		`;
    }
    #renderDataSourceInfo() {
        if (!this._dataSourceAlias)
            return nothing;
        return html `
			<div class="general-item">
				<strong>Property Editor Data Source Alias</strong>
				<span>${this._dataSourceAlias}</span>
			</div>
		`;
    }
    static { this.styles = [
        UmbTextStyles,
        css `
			:host {
				display: grid;
				gap: var(--uui-size-layout-1);
				padding: var(--uui-size-layout-1);
				grid-template-columns: 1fr 350px;
			}

			.container {
				display: flex;
				flex-direction: column;
				gap: var(--uui-size-layout-1);
			}

			#general-section {
				display: flex;
				flex-direction: column;
			}

			.general-item {
				display: flex;
				flex-direction: column;
				gap: var(--uui-size-space-1);
			}

			.general-item:not(:last-child) {
				margin-bottom: var(--uui-size-space-6);
			}
		`,
    ]; }
};
__decorate([
    state()
], UmbWorkspaceViewDataTypeInfoElement.prototype, "_unique", void 0);
__decorate([
    state()
], UmbWorkspaceViewDataTypeInfoElement.prototype, "_schemaAlias", void 0);
__decorate([
    state()
], UmbWorkspaceViewDataTypeInfoElement.prototype, "_uiAlias", void 0);
__decorate([
    state()
], UmbWorkspaceViewDataTypeInfoElement.prototype, "_dataSourceAlias", void 0);
UmbWorkspaceViewDataTypeInfoElement = __decorate([
    customElement('umb-workspace-view-data-type-info')
], UmbWorkspaceViewDataTypeInfoElement);
export { UmbWorkspaceViewDataTypeInfoElement };
export default UmbWorkspaceViewDataTypeInfoElement;
