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 { UmbChangeEvent } from '../../../../core/event/index.js';
import { html, customElement, property } from '../../../../../external/lit/index.js';
import { UmbLitElement } from '../../../../core/lit-element/index.js';
import { UMB_VALIDATION_EMPTY_LOCALIZATION_KEY, UmbFormControlMixin } from '../../../../core/validation/index.js';
/**
 * @element umb-property-editor-ui-user-picker
 */
let UmbPropertyEditorUIUserPickerElement = class UmbPropertyEditorUIUserPickerElement extends UmbFormControlMixin(UmbLitElement, undefined) {
    constructor() {
        super(...arguments);
        this.readonly = false;
        this.mandatoryMessage = UMB_VALIDATION_EMPTY_LOCALIZATION_KEY;
    }
    firstUpdated() {
        this.addFormControlElement(this.shadowRoot.querySelector('umb-user-input'));
    }
    #onChange(event) {
        this.value = event.target.value;
        this.dispatchEvent(new UmbChangeEvent());
    }
    render() {
        return html `
			<umb-user-input
				min="0"
				max="1"
				.value=${this.value}
				@change=${this.#onChange}
				?readonly=${this.readonly}
				?required=${this.mandatory}
				.requiredMessage=${this.mandatoryMessage}></umb-user-input>
		`;
    }
};
__decorate([
    property({ type: Boolean, reflect: true })
], UmbPropertyEditorUIUserPickerElement.prototype, "readonly", void 0);
__decorate([
    property({ type: Boolean })
], UmbPropertyEditorUIUserPickerElement.prototype, "mandatory", void 0);
__decorate([
    property({ type: String })
], UmbPropertyEditorUIUserPickerElement.prototype, "mandatoryMessage", void 0);
__decorate([
    property({ attribute: false })
], UmbPropertyEditorUIUserPickerElement.prototype, "config", void 0);
UmbPropertyEditorUIUserPickerElement = __decorate([
    customElement('umb-property-editor-ui-user-picker')
], UmbPropertyEditorUIUserPickerElement);
export { UmbPropertyEditorUIUserPickerElement };
export default UmbPropertyEditorUIUserPickerElement;
