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, css, nothing, customElement } from '../../../../../../external/lit/index.js';
import { UmbTextStyles } from '../../../../style/index.js';
import { UmbModalBaseElement } from '../../../../modal/index.js';
let UmbExamineFieldsViewerModalElement = class UmbExamineFieldsViewerModalElement extends UmbModalBaseElement {
    _handleClose() {
        this.modalContext?.reject();
    }
    render() {
        if (!this.data)
            return nothing;
        return html `
			<umb-body-layout headline="${this.data?.name}">
				<uui-scroll-container id="field-viewer">
					<span>
						<uui-table>
							<uui-table-head>
								<uui-table-head-cell> Field </uui-table-head-cell>
								<uui-table-head-cell> Value </uui-table-head-cell>
							</uui-table-head>
							${Object.values(this.data.searchResult.fields ?? []).map((cell) => {
            return html `<uui-table-row>
									<uui-table-cell> ${cell.name} </uui-table-cell>
									<uui-table-cell> ${cell.values?.join(', ')} </uui-table-cell>
								</uui-table-row>`;
        })}
						</uui-table>
					</span>
				</uui-scroll-container>
				<div slot="actions">
					<uui-button
						look="primary"
						label=${this.localize.term('general_close')}
						@click=${this._rejectModal}></uui-button>
				</div>
			</umb-body-layout>
		`;
    }
    static { this.styles = [
        UmbTextStyles,
        css `
			:host {
				display: relative;
			}

			span {
				display: block;
				padding-right: var(--uui-size-space-5);
			}

			uui-scroll-container {
				overflow-y: scroll;
				max-height: 100%;
				min-height: 0;
			}
		`,
    ]; }
};
UmbExamineFieldsViewerModalElement = __decorate([
    customElement('umb-examine-fields-viewer-modal')
], UmbExamineFieldsViewerModalElement);
export { UmbExamineFieldsViewerModalElement };
export default UmbExamineFieldsViewerModalElement;
