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 { html, customElement, query } from '../../../../external/lit/index.js';
import { UmbTextStyles } from '../../../core/style/index.js';
import { UmbModalBaseElement } from '../../../core/modal/index.js';
let UmbExportDictionaryModalElement = class UmbExportDictionaryModalElement extends UmbModalBaseElement {
    #handleClose() {
        this.modalContext?.reject();
    }
    #submitForm() {
        this._form?.requestSubmit();
    }
    async #handleSubmit(e) {
        e.preventDefault();
        const form = e.target;
        if (!form)
            return;
        const formData = new FormData(form);
        this.value = { includeChildren: formData.get('includeDescendants') === 'on' };
        this.modalContext?.submit();
    }
    render() {
        return html ` <umb-body-layout headline=${this.localize.term('actions_export')}>
			<uui-form>
				<form id="form" name="form" @submit=${this.#handleSubmit}>
					<uui-form-layout-item>
						<uui-label for="includeDescendants" slot="label">${this.localize.term('defaultdialogs_includeDescendants')}</uui-label>
						<uui-toggle id="includeDescendants" name="includeDescendants"></uui-toggle>
					</uui-form-layout-item>
				</form>
			</uui-form>
			<uui-button slot="actions" type="button" label=${this.localize.term('general_cancel')} look="secondary" @click=${this.#handleClose}></uui-button>
			<uui-button slot="actions" type="button" label=${this.localize.term('actions_export')} look="primary" @click=${this.#submitForm}></uui-button>
		</umb-body-layout>`;
    }
    static { this.styles = [UmbTextStyles]; }
};
__decorate([
    query('#form')
], UmbExportDictionaryModalElement.prototype, "_form", void 0);
UmbExportDictionaryModalElement = __decorate([
    customElement('umb-export-dictionary-modal')
], UmbExportDictionaryModalElement);
export { UmbExportDictionaryModalElement };
export default UmbExportDictionaryModalElement;
