"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Feature_1 = require("./Feature");
class GuestTitleFieldFeature extends Feature_1.Feature {
    constructor() {
        super('GuestTitleFieldFeature');
        this.titleOptions = [];
        this.setDefaultTitleOptions();
    }
    getTitleOptions() {
        return this.titleOptions;
    }
    onLoad(options) {
        if (options && options.titleOptions) {
            if (Array.isArray(options.titleOptions) && options.titleOptions.every(this.isValidTitleOption)) {
                this.titleOptions = options.titleOptions;
            }
            else {
                console.warn("Found invalid options for 'GuestTitleFieldFeature'. Falling back to default title options.");
            }
        }
    }
    setDefaultTitleOptions() {
        this.titleOptions = [
            { label: 'Mr.', value: 'Mr' },
            { label: 'Ms.', value: 'Ms' },
            { label: 'Mrs.', value: 'Mrs' },
            { label: 'Dr.', value: 'Dr' },
            { label: 'Other', value: 'Other' },
        ];
    }
    isValidTitleOption(option) {
        return option && typeof option === 'object' && typeof option.label === 'string' && typeof option.value === 'string';
    }
}
exports.default = new GuestTitleFieldFeature();
//# sourceMappingURL=GuestTitleFieldFeature.js.map