"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "BaseSelector", {
    enumerable: true,
    get: function() {
        return BaseSelector;
    }
});
const _Mixin = require("../prompts/Mixin.js");
function wrapChoice(choice) {
    if (typeof choice === "string") {
        return {
            description: choice
        };
    } else {
        return choice;
    }
}
function wrapQuery(query) {
    if (typeof query === "string") {
        return {
            queryStr: query
        };
    }
    return query;
}
class BaseSelector extends _Mixin.PromptMixin {
    async select(choices, query) {
        const metadatas = choices.map((choice)=>wrapChoice(choice));
        const queryBundle = wrapQuery(query);
        return await this._select(metadatas, queryBundle);
    }
}
