import { r as registerInstance, c as createEvent, h } from './index-BIwHMk6j.js';

const InfoTileAdminConfig = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.change = createEvent(this, "change");
        this.getOptionValue = (option) => option.value || undefined;
        this.handleChangeOptions = (property, getValue = (value) => value) => (event) => {
            event.stopPropagation();
            this.change.emit(Object.assign(Object.assign({}, this.value), { options: Object.assign(Object.assign({}, this.value.options), { [property]: getValue(event.detail) || undefined }) }));
        };
    }
    render() {
        return [this.renderStyle(), this.renderNumeric()];
    }
    renderStyle() {
        const options = [
            {
                value: 'long',
                text: 'Long',
            },
            {
                value: 'narrow',
                text: 'Narrow',
            },
            {
                value: 'short',
                text: 'Short',
            },
        ];
        const value = options.find((o) => { var _a; return o.value && o.value === ((_a = this.value.options) === null || _a === void 0 ? void 0 : _a.style); });
        return (h("limel-select", { label: "Style", helperText: "The style of the formatted relative time", options: options, value: value, onChange: this.handleChangeOptions('style', this.getOptionValue) }));
    }
    renderNumeric() {
        const options = [
            {
                value: 'always',
                text: 'Always',
                secondaryText: 'E.g. "in 1 day"',
            },
            {
                value: 'auto',
                text: 'Auto',
                secondaryText: 'E.g. "tomorrow"',
            },
        ];
        const value = options.find((o) => { var _a; return o.value && o.value === ((_a = this.value.options) === null || _a === void 0 ? void 0 : _a.numeric); });
        return (h("limel-select", { label: "Numeric", helperText: "Whether to use numeric values in the output", options: options, value: value, onChange: this.handleChangeOptions('numeric', this.getOptionValue) }));
    }
};

export { InfoTileAdminConfig as limebb_info_tile_relative_date_format };
