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 { customElement, html, property } from '../../../../../external/lit/index.js';
import { UmbLitElement } from '../../../../core/lit-element/index.js';
import { UmbServerFilePathUniqueSerializer } from '../../../../core/server-file-system/index.js';
import { UmbChangeEvent } from '../../../../core/event/index.js';
let UmbPropertyEditorUIStylesheetPickerElement = class UmbPropertyEditorUIStylesheetPickerElement extends UmbLitElement {
    #serverFilePathUniqueSerializer = new UmbServerFilePathUniqueSerializer();
    set value(value) {
        if (!value)
            return;
        this.#value = value.map((unique) => this.#serverFilePathUniqueSerializer.toUnique(unique));
    }
    get value() {
        if (!this.#value)
            return [];
        return this.#value.map((unique) => this.#serverFilePathUniqueSerializer.toServerPath(unique));
    }
    #value = [];
    #onChange(event) {
        const target = event.target;
        this.#value = target.selection ?? [];
        this.dispatchEvent(new UmbChangeEvent());
    }
    render() {
        return html `<umb-stylesheet-input @change=${this.#onChange} .selection=${this.#value}></umb-stylesheet-input>`;
    }
};
__decorate([
    property({ type: Array })
], UmbPropertyEditorUIStylesheetPickerElement.prototype, "value", null);
__decorate([
    property({ type: Object, attribute: false })
], UmbPropertyEditorUIStylesheetPickerElement.prototype, "config", void 0);
UmbPropertyEditorUIStylesheetPickerElement = __decorate([
    customElement('umb-property-editor-ui-stylesheet-picker')
], UmbPropertyEditorUIStylesheetPickerElement);
export { UmbPropertyEditorUIStylesheetPickerElement };
export default UmbPropertyEditorUIStylesheetPickerElement;
