"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const showProblem_js_1 = __importDefault(require("./showProblem.js"));
const inquirerWrapper_js_1 = __importDefault(require("./utils/inquirerWrapper.js"));
const getProblems_js_1 = __importDefault(require("./utils/getProblems.js"));
const problemPrompt = async () => {
    const problems = (0, getProblems_js_1.default)();
    const { category } = await (0, inquirerWrapper_js_1.default)([
        {
            type: 'list',
            name: 'category',
            message: 'Select a category',
            choices: [...Object.keys(problems), 'exit'],
        },
    ]);
    if (category === 'exit') {
        return;
    }
    const { problem } = await (0, inquirerWrapper_js_1.default)([
        {
            type: 'list',
            name: 'problem',
            message: 'Select a problem',
            choices: [...problems[category], 'back'],
        },
    ]);
    if (problem !== 'back') {
        (0, showProblem_js_1.default)(problem);
    }
    console.clear();
    await problemPrompt();
};
exports.default = problemPrompt;
