"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
/**
 * penguins-eggs
 * lib: select_languages.ts
 * author: Piero Proietti
 * email: piero.proietti@gmail.com
 * license: MIT
 */
const inquirer = require('inquirer');
const locales_1 = tslib_1.__importDefault(require("../classes/locales"));
async function selectLanguages(selectedLanguage = '') {
    const locales = new locales_1.default();
    const supported = await locales.getSupported();
    const selected = selectedLanguage;
    const questions = [
        {
            type: 'list',
            name: 'language',
            message: 'Select language: ',
            choices: supported,
            default: selected,
        },
    ];
    return new Promise(function (resolve) {
        inquirer.prompt(questions).then(function (options) {
            resolve(options.language);
        });
    });
}
exports.default = selectLanguages;
