const VALID_MODES = new Set(['none', 'ai_upload', 'basic_upload']);
/**
 * Validate and return a FileAcceptMode value.
 * Logs warnings/errors for invalid or unsupported values and returns a safe fallback.
 *
 * @param value    - The raw value from config
 * @param field_id - Field/group ID for error context
 * @param prop_name - Property name (e.g. 'accept_public_files') for error context
 * @returns A valid FileAcceptMode
 */
export function validate_file_accept_mode(value, field_id, prop_name) {
    // undefined/null → 'none'
    if (value === undefined || value === null) {
        return 'none';
    }
    // Legacy boolean format: true → 'basic_upload', false → 'none'
    if (typeof value === 'boolean') {
        return value ? 'basic_upload' : 'none';
    }
    if (typeof value !== 'string' || !VALID_MODES.has(value)) {
        console.error(`[hazo_collab_forms] "${field_id}": ${prop_name} has invalid value "${String(value)}". ` +
            `Expected one of: 'none', 'ai_upload', 'basic_upload'. Falling back to 'none'.`);
        return 'none';
    }
    // ai_upload on private files is not supported
    if (value === 'ai_upload' && prop_name === 'accept_private_files') {
        console.error(`[hazo_collab_forms] "${field_id}": accept_private_files='ai_upload' is not supported. ` +
            `AI autofill only works with public files. Falling back to 'basic_upload'.`);
        return 'basic_upload';
    }
    return value;
}
//# sourceMappingURL=file_accept_mode.js.map