import { g as getDefaultExportFromCjs } from './ccjk.BAGoDD49.mjs';
import require$$0 from 'node:async_hooks';
import { r as requireCliSpinners } from './ccjk.DeWpAShp.mjs';
import { r as requireCliWidth, a as requireWrapAnsi, b as requireStripAnsi } from '../chunks/index6.mjs';
import readline__default from 'node:readline';
import require$$0$1 from 'stream';
import process__default from 'node:process';

var dist = {};

var cjs$2 = {};

var key = {};

var hasRequiredKey;

function requireKey () {
	if (hasRequiredKey) return key;
	hasRequiredKey = 1;
	Object.defineProperty(key, "__esModule", { value: true });
	key.isEnterKey = key.isNumberKey = key.isBackspaceKey = key.isSpaceKey = key.isDownKey = key.isUpKey = void 0;
	const isUpKey = (key) => 
	// The up key
	key.name === 'up' ||
	    // Vim keybinding
	    key.name === 'k' ||
	    // Emacs keybinding
	    (key.ctrl && key.name === 'p');
	key.isUpKey = isUpKey;
	const isDownKey = (key) => 
	// The down key
	key.name === 'down' ||
	    // Vim keybinding
	    key.name === 'j' ||
	    // Emacs keybinding
	    (key.ctrl && key.name === 'n');
	key.isDownKey = isDownKey;
	const isSpaceKey = (key) => key.name === 'space';
	key.isSpaceKey = isSpaceKey;
	const isBackspaceKey = (key) => key.name === 'backspace';
	key.isBackspaceKey = isBackspaceKey;
	const isNumberKey = (key) => '123456789'.includes(key.name);
	key.isNumberKey = isNumberKey;
	const isEnterKey = (key) => key.name === 'enter' || key.name === 'return';
	key.isEnterKey = isEnterKey;
	return key;
}

var errors = {};

var hasRequiredErrors;

function requireErrors () {
	if (hasRequiredErrors) return errors;
	hasRequiredErrors = 1;
	Object.defineProperty(errors, "__esModule", { value: true });
	errors.ValidationError = errors.HookError = errors.ExitPromptError = errors.CancelPromptError = void 0;
	class CancelPromptError extends Error {
	    constructor() {
	        super(...arguments);
	        Object.defineProperty(this, "message", {
	            enumerable: true,
	            configurable: true,
	            writable: true,
	            value: 'Prompt was canceled'
	        });
	    }
	}
	errors.CancelPromptError = CancelPromptError;
	class ExitPromptError extends Error {
	}
	errors.ExitPromptError = ExitPromptError;
	class HookError extends Error {
	}
	errors.HookError = HookError;
	class ValidationError extends Error {
	}
	errors.ValidationError = ValidationError;
	return errors;
}

var usePrefix = {};

var useState = {};

var hookEngine = {};

var hasRequiredHookEngine;

function requireHookEngine () {
	if (hasRequiredHookEngine) return hookEngine;
	hasRequiredHookEngine = 1;
	/* eslint @typescript-eslint/no-explicit-any: ["off"] */
	Object.defineProperty(hookEngine, "__esModule", { value: true });
	hookEngine.effectScheduler = void 0;
	hookEngine.withHooks = withHooks;
	hookEngine.readline = readline;
	hookEngine.withUpdates = withUpdates;
	hookEngine.withPointer = withPointer;
	hookEngine.handleChange = handleChange;
	const node_async_hooks_1 = require$$0;
	const errors_mjs_1 = /*@__PURE__*/ requireErrors();
	const hookStorage = new node_async_hooks_1.AsyncLocalStorage();
	function createStore(rl) {
	    const store = {
	        rl,
	        hooks: [],
	        hooksCleanup: [],
	        hooksEffect: [],
	        index: 0,
	        handleChange() { },
	    };
	    return store;
	}
	// Run callback in with the hook engine setup.
	function withHooks(rl, cb) {
	    const store = createStore(rl);
	    return hookStorage.run(store, () => {
	        cb(store);
	    });
	}
	// Safe getStore utility that'll return the store or throw if undefined.
	function getStore() {
	    const store = hookStorage.getStore();
	    if (!store) {
	        throw new errors_mjs_1.HookError('[Inquirer] Hook functions can only be called from within a prompt');
	    }
	    return store;
	}
	function readline() {
	    return getStore().rl;
	}
	// Merge state updates happening within the callback function to avoid multiple renders.
	function withUpdates(fn) {
	    const wrapped = (...args) => {
	        const store = getStore();
	        let shouldUpdate = false;
	        const oldHandleChange = store.handleChange;
	        store.handleChange = () => {
	            shouldUpdate = true;
	        };
	        const returnValue = fn(...args);
	        if (shouldUpdate) {
	            oldHandleChange();
	        }
	        store.handleChange = oldHandleChange;
	        return returnValue;
	    };
	    return node_async_hooks_1.AsyncResource.bind(wrapped);
	}
	function withPointer(cb) {
	    const store = getStore();
	    const { index } = store;
	    const pointer = {
	        get() {
	            return store.hooks[index];
	        },
	        set(value) {
	            store.hooks[index] = value;
	        },
	        initialized: index in store.hooks,
	    };
	    const returnValue = cb(pointer);
	    store.index++;
	    return returnValue;
	}
	function handleChange() {
	    getStore().handleChange();
	}
	hookEngine.effectScheduler = {
	    queue(cb) {
	        const store = getStore();
	        const { index } = store;
	        store.hooksEffect.push(() => {
	            var _a, _b;
	            (_b = (_a = store.hooksCleanup)[index]) === null || _b === void 0 ? void 0 : _b.call(_a);
	            const cleanFn = cb(readline());
	            if (cleanFn != null && typeof cleanFn !== 'function') {
	                throw new errors_mjs_1.ValidationError('useEffect return value must be a cleanup function or nothing.');
	            }
	            store.hooksCleanup[index] = cleanFn;
	        });
	    },
	    run() {
	        const store = getStore();
	        withUpdates(() => {
	            store.hooksEffect.forEach((effect) => {
	                effect();
	            });
	            // Warning: Clean the hooks before exiting the `withUpdates` block.
	            // Failure to do so means an updates would hit the same effects again.
	            store.hooksEffect.length = 0;
	        })();
	    },
	};
	return hookEngine;
}

var hasRequiredUseState;

function requireUseState () {
	if (hasRequiredUseState) return useState;
	hasRequiredUseState = 1;
	Object.defineProperty(useState, "__esModule", { value: true });
	useState.useState = useState$1;
	const hook_engine_mjs_1 = /*@__PURE__*/ requireHookEngine();
	function useState$1(defaultValue) {
	    return (0, hook_engine_mjs_1.withPointer)((pointer) => {
	        const setFn = (newValue) => {
	            // Noop if the value is still the same.
	            if (pointer.get() !== newValue) {
	                pointer.set(newValue);
	                // Trigger re-render
	                (0, hook_engine_mjs_1.handleChange)();
	            }
	        };
	        if (pointer.initialized) {
	            return [pointer.get(), setFn];
	        }
	        const value = typeof defaultValue === 'function' ? defaultValue() : defaultValue;
	        pointer.set(value);
	        return [value, setFn];
	    });
	}
	return useState;
}

var useEffect = {};

var hasRequiredUseEffect;

function requireUseEffect () {
	if (hasRequiredUseEffect) return useEffect;
	hasRequiredUseEffect = 1;
	Object.defineProperty(useEffect, "__esModule", { value: true });
	useEffect.useEffect = useEffect$1;
	const hook_engine_mjs_1 = /*@__PURE__*/ requireHookEngine();
	function useEffect$1(cb, depArray) {
	    (0, hook_engine_mjs_1.withPointer)((pointer) => {
	        const oldDeps = pointer.get();
	        const hasChanged = !Array.isArray(oldDeps) || depArray.some((dep, i) => !Object.is(dep, oldDeps[i]));
	        if (hasChanged) {
	            hook_engine_mjs_1.effectScheduler.queue(cb);
	        }
	        pointer.set(depArray);
	    });
	}
	return useEffect;
}

var makeTheme = {};

var theme = {};

var picocolors = {exports: {}};

var hasRequiredPicocolors;

function requirePicocolors () {
	if (hasRequiredPicocolors) return picocolors.exports;
	hasRequiredPicocolors = 1;
	let p = process || {}, argv = p.argv || [], env = p.env || {};
	let isColorSupported =
		!(!!env.NO_COLOR || argv.includes("--no-color")) &&
		(!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI);

	let formatter = (open, close, replace = open) =>
		input => {
			let string = "" + input, index = string.indexOf(close, open.length);
			return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close
		};

	let replaceClose = (string, close, replace, index) => {
		let result = "", cursor = 0;
		do {
			result += string.substring(cursor, index) + replace;
			cursor = index + close.length;
			index = string.indexOf(close, cursor);
		} while (~index)
		return result + string.substring(cursor)
	};

	let createColors = (enabled = isColorSupported) => {
		let f = enabled ? formatter : () => String;
		return {
			isColorSupported: enabled,
			reset: f("\x1b[0m", "\x1b[0m"),
			bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
			dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
			italic: f("\x1b[3m", "\x1b[23m"),
			underline: f("\x1b[4m", "\x1b[24m"),
			inverse: f("\x1b[7m", "\x1b[27m"),
			hidden: f("\x1b[8m", "\x1b[28m"),
			strikethrough: f("\x1b[9m", "\x1b[29m"),

			black: f("\x1b[30m", "\x1b[39m"),
			red: f("\x1b[31m", "\x1b[39m"),
			green: f("\x1b[32m", "\x1b[39m"),
			yellow: f("\x1b[33m", "\x1b[39m"),
			blue: f("\x1b[34m", "\x1b[39m"),
			magenta: f("\x1b[35m", "\x1b[39m"),
			cyan: f("\x1b[36m", "\x1b[39m"),
			white: f("\x1b[37m", "\x1b[39m"),
			gray: f("\x1b[90m", "\x1b[39m"),

			bgBlack: f("\x1b[40m", "\x1b[49m"),
			bgRed: f("\x1b[41m", "\x1b[49m"),
			bgGreen: f("\x1b[42m", "\x1b[49m"),
			bgYellow: f("\x1b[43m", "\x1b[49m"),
			bgBlue: f("\x1b[44m", "\x1b[49m"),
			bgMagenta: f("\x1b[45m", "\x1b[49m"),
			bgCyan: f("\x1b[46m", "\x1b[49m"),
			bgWhite: f("\x1b[47m", "\x1b[49m"),

			blackBright: f("\x1b[90m", "\x1b[39m"),
			redBright: f("\x1b[91m", "\x1b[39m"),
			greenBright: f("\x1b[92m", "\x1b[39m"),
			yellowBright: f("\x1b[93m", "\x1b[39m"),
			blueBright: f("\x1b[94m", "\x1b[39m"),
			magentaBright: f("\x1b[95m", "\x1b[39m"),
			cyanBright: f("\x1b[96m", "\x1b[39m"),
			whiteBright: f("\x1b[97m", "\x1b[39m"),

			bgBlackBright: f("\x1b[100m", "\x1b[49m"),
			bgRedBright: f("\x1b[101m", "\x1b[49m"),
			bgGreenBright: f("\x1b[102m", "\x1b[49m"),
			bgYellowBright: f("\x1b[103m", "\x1b[49m"),
			bgBlueBright: f("\x1b[104m", "\x1b[49m"),
			bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
			bgCyanBright: f("\x1b[106m", "\x1b[49m"),
			bgWhiteBright: f("\x1b[107m", "\x1b[49m"),
		}
	};

	picocolors.exports = createColors();
	picocolors.exports.createColors = createColors;
	return picocolors.exports;
}

var hasRequiredTheme;

function requireTheme () {
	if (hasRequiredTheme) return theme;
	hasRequiredTheme = 1;
	var __importDefault = (theme && theme.__importDefault) || function (mod) {
	    return (mod && mod.__esModule) ? mod : { "default": mod };
	};
	Object.defineProperty(theme, "__esModule", { value: true });
	theme.defaultTheme = void 0;
	const picocolors_1 = __importDefault(/*@__PURE__*/ requirePicocolors());
	const cli_spinners_1 = __importDefault(requireCliSpinners());
	theme.defaultTheme = {
	    prefix: picocolors_1.default.green('?'),
	    spinner: {
	        interval: cli_spinners_1.default.dots.interval,
	        frames: cli_spinners_1.default.dots.frames.map((frame) => picocolors_1.default.yellow(frame)),
	    },
	    style: {
	        answer: picocolors_1.default.cyan,
	        message: picocolors_1.default.bold,
	        error: (text) => picocolors_1.default.red(`> ${text}`),
	        defaultAnswer: (text) => picocolors_1.default.dim(`(${text})`),
	        help: picocolors_1.default.dim,
	        highlight: picocolors_1.default.cyan,
	        key: (text) => picocolors_1.default.cyan(picocolors_1.default.bold(`<${text}>`)),
	    },
	};
	return theme;
}

var hasRequiredMakeTheme;

function requireMakeTheme () {
	if (hasRequiredMakeTheme) return makeTheme;
	hasRequiredMakeTheme = 1;
	Object.defineProperty(makeTheme, "__esModule", { value: true });
	makeTheme.makeTheme = makeTheme$1;
	const theme_mjs_1 = /*@__PURE__*/ requireTheme();
	function isPlainObject(value) {
	    if (typeof value !== 'object' || value === null)
	        return false;
	    let proto = value;
	    while (Object.getPrototypeOf(proto) !== null) {
	        proto = Object.getPrototypeOf(proto);
	    }
	    return Object.getPrototypeOf(value) === proto;
	}
	function deepMerge(...objects) {
	    const output = {};
	    for (const obj of objects) {
	        for (const [key, value] of Object.entries(obj)) {
	            const prevValue = output[key];
	            output[key] =
	                isPlainObject(prevValue) && isPlainObject(value)
	                    ? deepMerge(prevValue, value)
	                    : value;
	        }
	    }
	    return output;
	}
	function makeTheme$1(...themes) {
	    const themesToMerge = [
	        theme_mjs_1.defaultTheme,
	        ...themes.filter((theme) => theme != null),
	    ];
	    return deepMerge(...themesToMerge);
	}
	return makeTheme;
}

var hasRequiredUsePrefix;

function requireUsePrefix () {
	if (hasRequiredUsePrefix) return usePrefix;
	hasRequiredUsePrefix = 1;
	Object.defineProperty(usePrefix, "__esModule", { value: true });
	usePrefix.usePrefix = usePrefix$1;
	const node_async_hooks_1 = require$$0;
	const use_state_mjs_1 = /*@__PURE__*/ requireUseState();
	const use_effect_mjs_1 = /*@__PURE__*/ requireUseEffect();
	const make_theme_mjs_1 = /*@__PURE__*/ requireMakeTheme();
	function usePrefix$1({ isLoading = false, theme, }) {
	    const [showLoader, setShowLoader] = (0, use_state_mjs_1.useState)(false);
	    const [tick, setTick] = (0, use_state_mjs_1.useState)(0);
	    const { prefix, spinner } = (0, make_theme_mjs_1.makeTheme)(theme);
	    (0, use_effect_mjs_1.useEffect)(() => {
	        if (isLoading) {
	            let tickInterval;
	            let inc = -1;
	            // Delay displaying spinner by 300ms, to avoid flickering
	            const delayTimeout = setTimeout(node_async_hooks_1.AsyncResource.bind(() => {
	                setShowLoader(true);
	                tickInterval = setInterval(node_async_hooks_1.AsyncResource.bind(() => {
	                    inc = inc + 1;
	                    setTick(inc % spinner.frames.length);
	                }), spinner.interval);
	            }), 300);
	            return () => {
	                clearTimeout(delayTimeout);
	                clearInterval(tickInterval);
	            };
	        }
	        else {
	            setShowLoader(false);
	        }
	    }, [isLoading]);
	    if (showLoader) {
	        return spinner.frames[tick];
	    }
	    return prefix;
	}
	return usePrefix;
}

var useMemo = {};

var hasRequiredUseMemo;

function requireUseMemo () {
	if (hasRequiredUseMemo) return useMemo;
	hasRequiredUseMemo = 1;
	Object.defineProperty(useMemo, "__esModule", { value: true });
	useMemo.useMemo = useMemo$1;
	const hook_engine_mjs_1 = /*@__PURE__*/ requireHookEngine();
	function useMemo$1(fn, dependencies) {
	    return (0, hook_engine_mjs_1.withPointer)((pointer) => {
	        const prev = pointer.get();
	        if (!prev ||
	            prev.dependencies.length !== dependencies.length ||
	            prev.dependencies.some((dep, i) => dep !== dependencies[i])) {
	            const value = fn();
	            pointer.set({ value, dependencies });
	            return value;
	        }
	        return prev.value;
	    });
	}
	return useMemo;
}

var useRef = {};

var hasRequiredUseRef;

function requireUseRef () {
	if (hasRequiredUseRef) return useRef;
	hasRequiredUseRef = 1;
	Object.defineProperty(useRef, "__esModule", { value: true });
	useRef.useRef = useRef$1;
	const use_state_mjs_1 = /*@__PURE__*/ requireUseState();
	function useRef$1(val) {
	    return (0, use_state_mjs_1.useState)({ current: val })[0];
	}
	return useRef;
}

var useKeypress = {};

var hasRequiredUseKeypress;

function requireUseKeypress () {
	if (hasRequiredUseKeypress) return useKeypress;
	hasRequiredUseKeypress = 1;
	Object.defineProperty(useKeypress, "__esModule", { value: true });
	useKeypress.useKeypress = useKeypress$1;
	const use_ref_mjs_1 = /*@__PURE__*/ requireUseRef();
	const use_effect_mjs_1 = /*@__PURE__*/ requireUseEffect();
	const hook_engine_mjs_1 = /*@__PURE__*/ requireHookEngine();
	function useKeypress$1(userHandler) {
	    const signal = (0, use_ref_mjs_1.useRef)(userHandler);
	    signal.current = userHandler;
	    (0, use_effect_mjs_1.useEffect)((rl) => {
	        const handler = (0, hook_engine_mjs_1.withUpdates)((_input, event) => {
	            signal.current(event, rl);
	        });
	        rl.input.on('keypress', handler);
	        return () => {
	            rl.input.removeListener('keypress', handler);
	        };
	    }, []);
	}
	return useKeypress;
}

var usePagination = {};

var utils$1 = {};

var hasRequiredUtils$1;

function requireUtils$1 () {
	if (hasRequiredUtils$1) return utils$1;
	hasRequiredUtils$1 = 1;
	var __importDefault = (utils$1 && utils$1.__importDefault) || function (mod) {
	    return (mod && mod.__esModule) ? mod : { "default": mod };
	};
	Object.defineProperty(utils$1, "__esModule", { value: true });
	utils$1.breakLines = breakLines;
	utils$1.readlineWidth = readlineWidth;
	const cli_width_1 = __importDefault(requireCliWidth());
	const wrap_ansi_1 = __importDefault(requireWrapAnsi());
	const hook_engine_mjs_1 = /*@__PURE__*/ requireHookEngine();
	/**
	 * Force line returns at specific width. This function is ANSI code friendly and it'll
	 * ignore invisible codes during width calculation.
	 * @param {string} content
	 * @param {number} width
	 * @return {string}
	 */
	function breakLines(content, width) {
	    return content
	        .split('\n')
	        .flatMap((line) => (0, wrap_ansi_1.default)(line, width, { trim: false, hard: true })
	        .split('\n')
	        .map((str) => str.trimEnd()))
	        .join('\n');
	}
	/**
	 * Returns the width of the active readline, or 80 as default value.
	 * @returns {number}
	 */
	function readlineWidth() {
	    return (0, cli_width_1.default)({ defaultWidth: 80, output: (0, hook_engine_mjs_1.readline)().output });
	}
	return utils$1;
}

var lines = {};

var hasRequiredLines;

function requireLines () {
	if (hasRequiredLines) return lines;
	hasRequiredLines = 1;
	Object.defineProperty(lines, "__esModule", { value: true });
	lines.lines = lines$1;
	const utils_mjs_1 = /*@__PURE__*/ requireUtils$1();
	function split(content, width) {
	    return (0, utils_mjs_1.breakLines)(content, width).split('\n');
	}
	/**
	 * Rotates an array of items by an integer number of positions.
	 * @param {number} count The number of positions to rotate by
	 * @param {T[]} items The items to rotate
	 */
	function rotate(count, items) {
	    const max = items.length;
	    const offset = ((count % max) + max) % max;
	    return [...items.slice(offset), ...items.slice(0, offset)];
	}
	/**
	 * Renders a page of items as lines that fit within the given width ensuring
	 * that the number of lines is not greater than the page size, and the active
	 * item renders at the provided position, while prioritizing that as many lines
	 * of the active item get rendered as possible.
	 */
	function lines$1({ items, width, renderItem, active, position: requested, pageSize, }) {
	    const layouts = items.map((item, index) => ({
	        item,
	        index,
	        isActive: index === active,
	    }));
	    const layoutsInPage = rotate(active - requested, layouts).slice(0, pageSize);
	    const renderItemAt = (index) => split(renderItem(layoutsInPage[index]), width);
	    // Create a blank array of lines for the page
	    const pageBuffer = Array.from({ length: pageSize });
	    // Render the active item to decide the position
	    const activeItem = renderItemAt(requested).slice(0, pageSize);
	    const position = requested + activeItem.length <= pageSize ? requested : pageSize - activeItem.length;
	    // Add the lines of the active item into the page
	    pageBuffer.splice(position, activeItem.length, ...activeItem);
	    // Fill the page under the active item
	    let bufferPointer = position + activeItem.length;
	    let layoutPointer = requested + 1;
	    while (bufferPointer < pageSize && layoutPointer < layoutsInPage.length) {
	        for (const line of renderItemAt(layoutPointer)) {
	            pageBuffer[bufferPointer++] = line;
	            if (bufferPointer >= pageSize)
	                break;
	        }
	        layoutPointer++;
	    }
	    // Fill the page over the active item
	    bufferPointer = position - 1;
	    layoutPointer = requested - 1;
	    while (bufferPointer >= 0 && layoutPointer >= 0) {
	        for (const line of renderItemAt(layoutPointer).reverse()) {
	            pageBuffer[bufferPointer--] = line;
	            if (bufferPointer < 0)
	                break;
	        }
	        layoutPointer--;
	    }
	    return pageBuffer.filter((line) => typeof line === 'string');
	}
	return lines;
}

var position = {};

var hasRequiredPosition;

function requirePosition () {
	if (hasRequiredPosition) return position;
	hasRequiredPosition = 1;
	Object.defineProperty(position, "__esModule", { value: true });
	position.finite = finite;
	position.infinite = infinite;
	/**
	 * Creates the next position for the active item considering a finite list of
	 * items to be rendered on a page.
	 */
	function finite({ active, pageSize, total, }) {
	    const middle = Math.floor(pageSize / 2);
	    if (total <= pageSize || active < middle)
	        return active;
	    if (active >= total - middle)
	        return active + pageSize - total;
	    return middle;
	}
	/**
	 * Creates the next position for the active item considering an infinitely
	 * looping list of items to be rendered on the page.
	 */
	function infinite({ active, lastActive, total, pageSize, pointer, }) {
	    if (total <= pageSize)
	        return active;
	    // Move the position only when the user moves down, and when the
	    // navigation fits within a single page
	    if (lastActive < active && active - lastActive < pageSize) {
	        // Limit it to the middle of the list
	        return Math.min(Math.floor(pageSize / 2), pointer + active - lastActive);
	    }
	    return pointer;
	}
	return position;
}

var hasRequiredUsePagination;

function requireUsePagination () {
	if (hasRequiredUsePagination) return usePagination;
	hasRequiredUsePagination = 1;
	Object.defineProperty(usePagination, "__esModule", { value: true });
	usePagination.usePagination = usePagination$1;
	const use_ref_mjs_1 = /*@__PURE__*/ requireUseRef();
	const utils_mjs_1 = /*@__PURE__*/ requireUtils$1();
	const lines_mjs_1 = /*@__PURE__*/ requireLines();
	const position_mjs_1 = /*@__PURE__*/ requirePosition();
	function usePagination$1({ items, active, renderItem, pageSize, loop = true, }) {
	    const state = (0, use_ref_mjs_1.useRef)({ position: 0, lastActive: 0 });
	    const position = loop
	        ? (0, position_mjs_1.infinite)({
	            active,
	            lastActive: state.current.lastActive,
	            total: items.length,
	            pageSize,
	            pointer: state.current.position,
	        })
	        : (0, position_mjs_1.finite)({
	            active,
	            total: items.length,
	            pageSize,
	        });
	    state.current.position = position;
	    state.current.lastActive = active;
	    return (0, lines_mjs_1.lines)({
	        items,
	        width: (0, utils_mjs_1.readlineWidth)(),
	        renderItem,
	        active,
	        position,
	        pageSize,
	    }).join('\n');
	}
	return usePagination;
}

var createPrompt = {};

var cjs$1 = {};

var inquirer = {};

var hasRequiredInquirer;

function requireInquirer () {
	if (hasRequiredInquirer) return inquirer;
	hasRequiredInquirer = 1;
	Object.defineProperty(inquirer, "__esModule", { value: true });
	inquirer.CancelablePromise = void 0;
	class CancelablePromise extends Promise {
	    constructor() {
	        super(...arguments);
	        Object.defineProperty(this, "cancel", {
	            enumerable: true,
	            configurable: true,
	            writable: true,
	            value: () => { }
	        });
	    }
	    static withResolver() {
	        let resolve;
	        let reject;
	        const promise = new CancelablePromise((res, rej) => {
	            resolve = res;
	            reject = rej;
	        });
	        return { promise, resolve: resolve, reject: reject };
	    }
	}
	inquirer.CancelablePromise = CancelablePromise;
	return inquirer;
}

var utils = {};

var hasRequiredUtils;

function requireUtils () {
	if (hasRequiredUtils) return utils;
	hasRequiredUtils = 1;
	/* eslint-disable @typescript-eslint/no-explicit-any */
	Object.defineProperty(utils, "__esModule", { value: true });
	return utils;
}

var hasRequiredCjs$2;

function requireCjs$2 () {
	if (hasRequiredCjs$2) return cjs$1;
	hasRequiredCjs$2 = 1;
	(function (exports) {
		var __createBinding = (cjs$1 && cjs$1.__createBinding) || (Object.create ? (function(o, m, k, k2) {
		    if (k2 === undefined) k2 = k;
		    var desc = Object.getOwnPropertyDescriptor(m, k);
		    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
		      desc = { enumerable: true, get: function() { return m[k]; } };
		    }
		    Object.defineProperty(o, k2, desc);
		}) : (function(o, m, k, k2) {
		    if (k2 === undefined) k2 = k;
		    o[k2] = m[k];
		}));
		var __exportStar = (cjs$1 && cjs$1.__exportStar) || function(m, exports) {
		    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
		};
		Object.defineProperty(exports, "__esModule", { value: true });
		__exportStar(/*@__PURE__*/ requireInquirer(), exports);
		__exportStar(/*@__PURE__*/ requireUtils(), exports); 
	} (cjs$1));
	return cjs$1;
}

var lib;
var hasRequiredLib;

function requireLib () {
	if (hasRequiredLib) return lib;
	hasRequiredLib = 1;
	const Stream = require$$0$1;

	class MuteStream extends Stream {
	  #isTTY = null

	  constructor (opts = {}) {
	    super(opts);
	    this.writable = this.readable = true;
	    this.muted = false;
	    this.on('pipe', this._onpipe);
	    this.replace = opts.replace;

	    // For readline-type situations
	    // This much at the start of a line being redrawn after a ctrl char
	    // is seen (such as backspace) won't be redrawn as the replacement
	    this._prompt = opts.prompt || null;
	    this._hadControl = false;
	  }

	  #destSrc (key, def) {
	    if (this._dest) {
	      return this._dest[key]
	    }
	    if (this._src) {
	      return this._src[key]
	    }
	    return def
	  }

	  #proxy (method, ...args) {
	    if (typeof this._dest?.[method] === 'function') {
	      this._dest[method](...args);
	    }
	    if (typeof this._src?.[method] === 'function') {
	      this._src[method](...args);
	    }
	  }

	  get isTTY () {
	    if (this.#isTTY !== null) {
	      return this.#isTTY
	    }
	    return this.#destSrc('isTTY', false)
	  }

	  // basically just get replace the getter/setter with a regular value
	  set isTTY (val) {
	    this.#isTTY = val;
	  }

	  get rows () {
	    return this.#destSrc('rows')
	  }

	  get columns () {
	    return this.#destSrc('columns')
	  }

	  mute () {
	    this.muted = true;
	  }

	  unmute () {
	    this.muted = false;
	  }

	  _onpipe (src) {
	    this._src = src;
	  }

	  pipe (dest, options) {
	    this._dest = dest;
	    return super.pipe(dest, options)
	  }

	  pause () {
	    if (this._src) {
	      return this._src.pause()
	    }
	  }

	  resume () {
	    if (this._src) {
	      return this._src.resume()
	    }
	  }

	  write (c) {
	    if (this.muted) {
	      if (!this.replace) {
	        return true
	      }
	      // eslint-disable-next-line no-control-regex
	      if (c.match(/^\u001b/)) {
	        if (c.indexOf(this._prompt) === 0) {
	          c = c.slice(this._prompt.length);
	          c = c.replace(/./g, this.replace);
	          c = this._prompt + c;
	        }
	        this._hadControl = true;
	        return this.emit('data', c)
	      } else {
	        if (this._prompt && this._hadControl &&
	          c.indexOf(this._prompt) === 0) {
	          this._hadControl = false;
	          this.emit('data', this._prompt);
	          c = c.slice(this._prompt.length);
	        }
	        c = c.toString().replace(/./g, this.replace);
	      }
	    }
	    this.emit('data', c);
	  }

	  end (c) {
	    if (this.muted) {
	      if (c && this.replace) {
	        c = c.toString().replace(/./g, this.replace);
	      } else {
	        c = null;
	      }
	    }
	    if (c) {
	      this.emit('data', c);
	    }
	    this.emit('end');
	  }

	  destroy (...args) {
	    return this.#proxy('destroy', ...args)
	  }

	  destroySoon (...args) {
	    return this.#proxy('destroySoon', ...args)
	  }

	  close (...args) {
	    return this.#proxy('close', ...args)
	  }
	}

	lib = MuteStream;
	return lib;
}

var cjs = {};

var signals = {};

var hasRequiredSignals;

function requireSignals () {
	if (hasRequiredSignals) return signals;
	hasRequiredSignals = 1;
	(function (exports) {
		Object.defineProperty(exports, "__esModule", { value: true });
		exports.signals = void 0;
		/**
		 * This is not the set of all possible signals.
		 *
		 * It IS, however, the set of all signals that trigger
		 * an exit on either Linux or BSD systems.  Linux is a
		 * superset of the signal names supported on BSD, and
		 * the unknown signals just fail to register, so we can
		 * catch that easily enough.
		 *
		 * Windows signals are a different set, since there are
		 * signals that terminate Windows processes, but don't
		 * terminate (or don't even exist) on Posix systems.
		 *
		 * Don't bother with SIGKILL.  It's uncatchable, which
		 * means that we can't fire any callbacks anyway.
		 *
		 * If a user does happen to register a handler on a non-
		 * fatal signal like SIGWINCH or something, and then
		 * exit, it'll end up firing `process.emit('exit')`, so
		 * the handler will be fired anyway.
		 *
		 * SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
		 * artificially, inherently leave the process in a
		 * state from which it is not safe to try and enter JS
		 * listeners.
		 */
		exports.signals = [];
		exports.signals.push('SIGHUP', 'SIGINT', 'SIGTERM');
		if (process.platform !== 'win32') {
		    exports.signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT'
		    // should detect profiler and enable/disable accordingly.
		    // see #21
		    // 'SIGPROF'
		    );
		}
		if (process.platform === 'linux') {
		    exports.signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT');
		}
		
	} (signals));
	return signals;
}

var hasRequiredCjs$1;

function requireCjs$1 () {
	if (hasRequiredCjs$1) return cjs;
	hasRequiredCjs$1 = 1;
	(function (exports) {
		var _a;
		Object.defineProperty(exports, "__esModule", { value: true });
		exports.unload = exports.load = exports.onExit = exports.signals = void 0;
		// Note: since nyc uses this module to output coverage, any lines
		// that are in the direct sync flow of nyc's outputCoverage are
		// ignored, since we can never get coverage for them.
		// grab a reference to node's real process object right away
		const signals_js_1 = requireSignals();
		Object.defineProperty(exports, "signals", { enumerable: true, get: function () { return signals_js_1.signals; } });
		const processOk = (process) => !!process &&
		    typeof process === 'object' &&
		    typeof process.removeListener === 'function' &&
		    typeof process.emit === 'function' &&
		    typeof process.reallyExit === 'function' &&
		    typeof process.listeners === 'function' &&
		    typeof process.kill === 'function' &&
		    typeof process.pid === 'number' &&
		    typeof process.on === 'function';
		const kExitEmitter = Symbol.for('signal-exit emitter');
		const global = globalThis;
		const ObjectDefineProperty = Object.defineProperty.bind(Object);
		// teeny special purpose ee
		class Emitter {
		    emitted = {
		        afterExit: false,
		        exit: false,
		    };
		    listeners = {
		        afterExit: [],
		        exit: [],
		    };
		    count = 0;
		    id = Math.random();
		    constructor() {
		        if (global[kExitEmitter]) {
		            return global[kExitEmitter];
		        }
		        ObjectDefineProperty(global, kExitEmitter, {
		            value: this,
		            writable: false,
		            enumerable: false,
		            configurable: false,
		        });
		    }
		    on(ev, fn) {
		        this.listeners[ev].push(fn);
		    }
		    removeListener(ev, fn) {
		        const list = this.listeners[ev];
		        const i = list.indexOf(fn);
		        /* c8 ignore start */
		        if (i === -1) {
		            return;
		        }
		        /* c8 ignore stop */
		        if (i === 0 && list.length === 1) {
		            list.length = 0;
		        }
		        else {
		            list.splice(i, 1);
		        }
		    }
		    emit(ev, code, signal) {
		        if (this.emitted[ev]) {
		            return false;
		        }
		        this.emitted[ev] = true;
		        let ret = false;
		        for (const fn of this.listeners[ev]) {
		            ret = fn(code, signal) === true || ret;
		        }
		        if (ev === 'exit') {
		            ret = this.emit('afterExit', code, signal) || ret;
		        }
		        return ret;
		    }
		}
		class SignalExitBase {
		}
		const signalExitWrap = (handler) => {
		    return {
		        onExit(cb, opts) {
		            return handler.onExit(cb, opts);
		        },
		        load() {
		            return handler.load();
		        },
		        unload() {
		            return handler.unload();
		        },
		    };
		};
		class SignalExitFallback extends SignalExitBase {
		    onExit() {
		        return () => { };
		    }
		    load() { }
		    unload() { }
		}
		class SignalExit extends SignalExitBase {
		    // "SIGHUP" throws an `ENOSYS` error on Windows,
		    // so use a supported signal instead
		    /* c8 ignore start */
		    #hupSig = process.platform === 'win32' ? 'SIGINT' : 'SIGHUP';
		    /* c8 ignore stop */
		    #emitter = new Emitter();
		    #process;
		    #originalProcessEmit;
		    #originalProcessReallyExit;
		    #sigListeners = {};
		    #loaded = false;
		    constructor(process) {
		        super();
		        this.#process = process;
		        // { <signal>: <listener fn>, ... }
		        this.#sigListeners = {};
		        for (const sig of signals_js_1.signals) {
		            this.#sigListeners[sig] = () => {
		                // If there are no other listeners, an exit is coming!
		                // Simplest way: remove us and then re-send the signal.
		                // We know that this will kill the process, so we can
		                // safely emit now.
		                const listeners = this.#process.listeners(sig);
		                let { count } = this.#emitter;
		                // This is a workaround for the fact that signal-exit v3 and signal
		                // exit v4 are not aware of each other, and each will attempt to let
		                // the other handle it, so neither of them do. To correct this, we
		                // detect if we're the only handler *except* for previous versions
		                // of signal-exit, and increment by the count of listeners it has
		                // created.
		                /* c8 ignore start */
		                const p = process;
		                if (typeof p.__signal_exit_emitter__ === 'object' &&
		                    typeof p.__signal_exit_emitter__.count === 'number') {
		                    count += p.__signal_exit_emitter__.count;
		                }
		                /* c8 ignore stop */
		                if (listeners.length === count) {
		                    this.unload();
		                    const ret = this.#emitter.emit('exit', null, sig);
		                    /* c8 ignore start */
		                    const s = sig === 'SIGHUP' ? this.#hupSig : sig;
		                    if (!ret)
		                        process.kill(process.pid, s);
		                    /* c8 ignore stop */
		                }
		            };
		        }
		        this.#originalProcessReallyExit = process.reallyExit;
		        this.#originalProcessEmit = process.emit;
		    }
		    onExit(cb, opts) {
		        /* c8 ignore start */
		        if (!processOk(this.#process)) {
		            return () => { };
		        }
		        /* c8 ignore stop */
		        if (this.#loaded === false) {
		            this.load();
		        }
		        const ev = opts?.alwaysLast ? 'afterExit' : 'exit';
		        this.#emitter.on(ev, cb);
		        return () => {
		            this.#emitter.removeListener(ev, cb);
		            if (this.#emitter.listeners['exit'].length === 0 &&
		                this.#emitter.listeners['afterExit'].length === 0) {
		                this.unload();
		            }
		        };
		    }
		    load() {
		        if (this.#loaded) {
		            return;
		        }
		        this.#loaded = true;
		        // This is the number of onSignalExit's that are in play.
		        // It's important so that we can count the correct number of
		        // listeners on signals, and don't wait for the other one to
		        // handle it instead of us.
		        this.#emitter.count += 1;
		        for (const sig of signals_js_1.signals) {
		            try {
		                const fn = this.#sigListeners[sig];
		                if (fn)
		                    this.#process.on(sig, fn);
		            }
		            catch (_) { }
		        }
		        this.#process.emit = (ev, ...a) => {
		            return this.#processEmit(ev, ...a);
		        };
		        this.#process.reallyExit = (code) => {
		            return this.#processReallyExit(code);
		        };
		    }
		    unload() {
		        if (!this.#loaded) {
		            return;
		        }
		        this.#loaded = false;
		        signals_js_1.signals.forEach(sig => {
		            const listener = this.#sigListeners[sig];
		            /* c8 ignore start */
		            if (!listener) {
		                throw new Error('Listener not defined for signal: ' + sig);
		            }
		            /* c8 ignore stop */
		            try {
		                this.#process.removeListener(sig, listener);
		                /* c8 ignore start */
		            }
		            catch (_) { }
		            /* c8 ignore stop */
		        });
		        this.#process.emit = this.#originalProcessEmit;
		        this.#process.reallyExit = this.#originalProcessReallyExit;
		        this.#emitter.count -= 1;
		    }
		    #processReallyExit(code) {
		        /* c8 ignore start */
		        if (!processOk(this.#process)) {
		            return 0;
		        }
		        this.#process.exitCode = code || 0;
		        /* c8 ignore stop */
		        this.#emitter.emit('exit', this.#process.exitCode, null);
		        return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
		    }
		    #processEmit(ev, ...args) {
		        const og = this.#originalProcessEmit;
		        if (ev === 'exit' && processOk(this.#process)) {
		            if (typeof args[0] === 'number') {
		                this.#process.exitCode = args[0];
		                /* c8 ignore start */
		            }
		            /* c8 ignore start */
		            const ret = og.call(this.#process, ev, ...args);
		            /* c8 ignore start */
		            this.#emitter.emit('exit', this.#process.exitCode, null);
		            /* c8 ignore stop */
		            return ret;
		        }
		        else {
		            return og.call(this.#process, ev, ...args);
		        }
		    }
		}
		const process = globalThis.process;
		// wrap so that we call the method on the actual handler, without
		// exporting it directly.
		_a = signalExitWrap(processOk(process) ? new SignalExit(process) : new SignalExitFallback()), 
		/**
		 * Called when the process is exiting, whether via signal, explicit
		 * exit, or running out of stuff to do.
		 *
		 * If the global process object is not suitable for instrumentation,
		 * then this will be a no-op.
		 *
		 * Returns a function that may be used to unload signal-exit.
		 */
		exports.onExit = _a.onExit, 
		/**
		 * Load the listeners.  Likely you never need to call this, unless
		 * doing a rather deep integration with signal-exit functionality.
		 * Mostly exposed for the benefit of testing.
		 *
		 * @internal
		 */
		exports.load = _a.load, 
		/**
		 * Unload the listeners.  Likely you never need to call this, unless
		 * doing a rather deep integration with signal-exit functionality.
		 * Mostly exposed for the benefit of testing.
		 *
		 * @internal
		 */
		exports.unload = _a.unload;
		
	} (cjs));
	return cjs;
}

var screenManager = {};

var ansiEscapes = {exports: {}};

var hasRequiredAnsiEscapes;

function requireAnsiEscapes () {
	if (hasRequiredAnsiEscapes) return ansiEscapes.exports;
	hasRequiredAnsiEscapes = 1;
	(function (module) {
		const ansiEscapes = module.exports;
		// TODO: remove this in the next major version
		module.exports.default = ansiEscapes;

		const ESC = '\u001B[';
		const OSC = '\u001B]';
		const BEL = '\u0007';
		const SEP = ';';
		const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';

		ansiEscapes.cursorTo = (x, y) => {
			if (typeof x !== 'number') {
				throw new TypeError('The `x` argument is required');
			}

			if (typeof y !== 'number') {
				return ESC + (x + 1) + 'G';
			}

			return ESC + (y + 1) + ';' + (x + 1) + 'H';
		};

		ansiEscapes.cursorMove = (x, y) => {
			if (typeof x !== 'number') {
				throw new TypeError('The `x` argument is required');
			}

			let ret = '';

			if (x < 0) {
				ret += ESC + (-x) + 'D';
			} else if (x > 0) {
				ret += ESC + x + 'C';
			}

			if (y < 0) {
				ret += ESC + (-y) + 'A';
			} else if (y > 0) {
				ret += ESC + y + 'B';
			}

			return ret;
		};

		ansiEscapes.cursorUp = (count = 1) => ESC + count + 'A';
		ansiEscapes.cursorDown = (count = 1) => ESC + count + 'B';
		ansiEscapes.cursorForward = (count = 1) => ESC + count + 'C';
		ansiEscapes.cursorBackward = (count = 1) => ESC + count + 'D';

		ansiEscapes.cursorLeft = ESC + 'G';
		ansiEscapes.cursorSavePosition = isTerminalApp ? '\u001B7' : ESC + 's';
		ansiEscapes.cursorRestorePosition = isTerminalApp ? '\u001B8' : ESC + 'u';
		ansiEscapes.cursorGetPosition = ESC + '6n';
		ansiEscapes.cursorNextLine = ESC + 'E';
		ansiEscapes.cursorPrevLine = ESC + 'F';
		ansiEscapes.cursorHide = ESC + '?25l';
		ansiEscapes.cursorShow = ESC + '?25h';

		ansiEscapes.eraseLines = count => {
			let clear = '';

			for (let i = 0; i < count; i++) {
				clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : '');
			}

			if (count) {
				clear += ansiEscapes.cursorLeft;
			}

			return clear;
		};

		ansiEscapes.eraseEndLine = ESC + 'K';
		ansiEscapes.eraseStartLine = ESC + '1K';
		ansiEscapes.eraseLine = ESC + '2K';
		ansiEscapes.eraseDown = ESC + 'J';
		ansiEscapes.eraseUp = ESC + '1J';
		ansiEscapes.eraseScreen = ESC + '2J';
		ansiEscapes.scrollUp = ESC + 'S';
		ansiEscapes.scrollDown = ESC + 'T';

		ansiEscapes.clearScreen = '\u001Bc';

		ansiEscapes.clearTerminal = process.platform === 'win32' ?
			`${ansiEscapes.eraseScreen}${ESC}0f` :
			// 1. Erases the screen (Only done in case `2` is not supported)
			// 2. Erases the whole screen including scrollback buffer
			// 3. Moves cursor to the top-left position
			// More info: https://www.real-world-systems.com/docs/ANSIcode.html
			`${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;

		ansiEscapes.beep = BEL;

		ansiEscapes.link = (text, url) => {
			return [
				OSC,
				'8',
				SEP,
				SEP,
				url,
				BEL,
				text,
				OSC,
				'8',
				SEP,
				SEP,
				BEL
			].join('');
		};

		ansiEscapes.image = (buffer, options = {}) => {
			let ret = `${OSC}1337;File=inline=1`;

			if (options.width) {
				ret += `;width=${options.width}`;
			}

			if (options.height) {
				ret += `;height=${options.height}`;
			}

			if (options.preserveAspectRatio === false) {
				ret += ';preserveAspectRatio=0';
			}

			return ret + ':' + buffer.toString('base64') + BEL;
		};

		ansiEscapes.iTerm = {
			setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,

			annotation: (message, options = {}) => {
				let ret = `${OSC}1337;`;

				const hasX = typeof options.x !== 'undefined';
				const hasY = typeof options.y !== 'undefined';
				if ((hasX || hasY) && !(hasX && hasY && typeof options.length !== 'undefined')) {
					throw new Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');
				}

				message = message.replace(/\|/g, '');

				ret += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';

				if (options.length > 0) {
					ret +=
							(hasX ?
								[message, options.length, options.x, options.y] :
								[options.length, message]).join('|');
				} else {
					ret += message;
				}

				return ret + BEL;
			}
		}; 
	} (ansiEscapes));
	return ansiEscapes.exports;
}

var hasRequiredScreenManager;

function requireScreenManager () {
	if (hasRequiredScreenManager) return screenManager;
	hasRequiredScreenManager = 1;
	var __importDefault = (screenManager && screenManager.__importDefault) || function (mod) {
	    return (mod && mod.__esModule) ? mod : { "default": mod };
	};
	Object.defineProperty(screenManager, "__esModule", { value: true });
	const strip_ansi_1 = __importDefault(requireStripAnsi());
	const ansi_escapes_1 = __importDefault(requireAnsiEscapes());
	const utils_mjs_1 = /*@__PURE__*/ requireUtils$1();
	const height = (content) => content.split('\n').length;
	const lastLine = (content) => { var _a; return (_a = content.split('\n').pop()) !== null && _a !== void 0 ? _a : ''; };
	class ScreenManager {
	    constructor(rl) {
	        Object.defineProperty(this, "rl", {
	            enumerable: true,
	            configurable: true,
	            writable: true,
	            value: rl
	        });
	        // These variables are keeping information to allow correct prompt re-rendering
	        Object.defineProperty(this, "height", {
	            enumerable: true,
	            configurable: true,
	            writable: true,
	            value: 0
	        });
	        Object.defineProperty(this, "extraLinesUnderPrompt", {
	            enumerable: true,
	            configurable: true,
	            writable: true,
	            value: 0
	        });
	        Object.defineProperty(this, "cursorPos", {
	            enumerable: true,
	            configurable: true,
	            writable: true,
	            value: void 0
	        });
	        this.rl = rl;
	        this.cursorPos = rl.getCursorPos();
	    }
	    render(content, bottomContent = '') {
	        /**
	         * Write message to screen and setPrompt to control backspace
	         */
	        const promptLine = lastLine(content);
	        const rawPromptLine = (0, strip_ansi_1.default)(promptLine);
	        // Remove the rl.line from our prompt. We can't rely on the content of
	        // rl.line (mainly because of the password prompt), so just rely on it's
	        // length.
	        let prompt = rawPromptLine;
	        if (this.rl.line.length > 0) {
	            prompt = prompt.slice(0, -this.rl.line.length);
	        }
	        this.rl.setPrompt(prompt);
	        // SetPrompt will change cursor position, now we can get correct value
	        this.cursorPos = this.rl.getCursorPos();
	        const width = (0, utils_mjs_1.readlineWidth)();
	        content = (0, utils_mjs_1.breakLines)(content, width);
	        bottomContent = (0, utils_mjs_1.breakLines)(bottomContent, width);
	        // Manually insert an extra line if we're at the end of the line.
	        // This prevent the cursor from appearing at the beginning of the
	        // current line.
	        if (rawPromptLine.length % width === 0) {
	            content += '\n';
	        }
	        let output = content + (bottomContent ? '\n' + bottomContent : '');
	        /**
	         * Re-adjust the cursor at the correct position.
	         */
	        // We need to consider parts of the prompt under the cursor as part of the bottom
	        // content in order to correctly cleanup and re-render.
	        const promptLineUpDiff = Math.floor(rawPromptLine.length / width) - this.cursorPos.rows;
	        const bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
	        // Return cursor to the input position (on top of the bottomContent)
	        if (bottomContentHeight > 0)
	            output += ansi_escapes_1.default.cursorUp(bottomContentHeight);
	        // Return cursor to the initial left offset.
	        output += ansi_escapes_1.default.cursorTo(this.cursorPos.cols);
	        this.clean();
	        this.rl.output.unmute();
	        /**
	         * Set up state for next re-rendering
	         */
	        this.extraLinesUnderPrompt = bottomContentHeight;
	        this.height = height(output);
	        this.rl.output.write(output);
	        this.rl.output.mute();
	    }
	    checkCursorPos() {
	        const cursorPos = this.rl.getCursorPos();
	        if (cursorPos.cols !== this.cursorPos.cols) {
	            this.rl.output.unmute();
	            this.rl.output.write(ansi_escapes_1.default.cursorTo(cursorPos.cols));
	            this.rl.output.mute();
	            this.cursorPos = cursorPos;
	        }
	    }
	    clean() {
	        this.rl.output.unmute();
	        this.rl.output.write([
	            this.extraLinesUnderPrompt > 0
	                ? ansi_escapes_1.default.cursorDown(this.extraLinesUnderPrompt)
	                : '',
	            ansi_escapes_1.default.eraseLines(this.height),
	        ].join(''));
	        this.extraLinesUnderPrompt = 0;
	        this.rl.output.mute();
	    }
	    clearContent() {
	        this.rl.output.unmute();
	        // Reset the cursor at the end of the previously displayed content
	        this.rl.output.write([
	            this.extraLinesUnderPrompt > 0
	                ? ansi_escapes_1.default.cursorDown(this.extraLinesUnderPrompt)
	                : '',
	            '\n',
	        ].join(''));
	        this.rl.output.mute();
	    }
	    done() {
	        this.rl.setPrompt('');
	        this.rl.output.unmute();
	        this.rl.output.write(ansi_escapes_1.default.cursorShow);
	        this.rl.output.end();
	        this.rl.close();
	    }
	}
	screenManager.default = ScreenManager;
	return screenManager;
}

var hasRequiredCreatePrompt;

function requireCreatePrompt () {
	if (hasRequiredCreatePrompt) return createPrompt;
	hasRequiredCreatePrompt = 1;
	var __createBinding = (createPrompt && createPrompt.__createBinding) || (Object.create ? (function(o, m, k, k2) {
	    if (k2 === undefined) k2 = k;
	    var desc = Object.getOwnPropertyDescriptor(m, k);
	    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
	      desc = { enumerable: true, get: function() { return m[k]; } };
	    }
	    Object.defineProperty(o, k2, desc);
	}) : (function(o, m, k, k2) {
	    if (k2 === undefined) k2 = k;
	    o[k2] = m[k];
	}));
	var __setModuleDefault = (createPrompt && createPrompt.__setModuleDefault) || (Object.create ? (function(o, v) {
	    Object.defineProperty(o, "default", { enumerable: true, value: v });
	}) : function(o, v) {
	    o["default"] = v;
	});
	var __importStar = (createPrompt && createPrompt.__importStar) || function (mod) {
	    if (mod && mod.__esModule) return mod;
	    var result = {};
	    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
	    __setModuleDefault(result, mod);
	    return result;
	};
	var __importDefault = (createPrompt && createPrompt.__importDefault) || function (mod) {
	    return (mod && mod.__esModule) ? mod : { "default": mod };
	};
	Object.defineProperty(createPrompt, "__esModule", { value: true });
	createPrompt.createPrompt = createPrompt$1;
	const readline = __importStar(readline__default);
	const type_1 = /*@__PURE__*/ requireCjs$2();
	const mute_stream_1 = __importDefault(requireLib());
	const signal_exit_1 = requireCjs$1();
	const screen_manager_mjs_1 = __importDefault(/*@__PURE__*/ requireScreenManager());
	const hook_engine_mjs_1 = /*@__PURE__*/ requireHookEngine();
	const errors_mjs_1 = /*@__PURE__*/ requireErrors();
	function createPrompt$1(view) {
	    const prompt = (config, context) => {
	        var _a, _b;
	        // Default `input` to stdin
	        const input = (_a = context === null || context === void 0 ? void 0 : context.input) !== null && _a !== void 0 ? _a : process.stdin;
	        // Add mute capabilities to the output
	        const output = new mute_stream_1.default();
	        output.pipe((_b = context === null || context === void 0 ? void 0 : context.output) !== null && _b !== void 0 ? _b : process.stdout);
	        const rl = readline.createInterface({
	            terminal: true,
	            input,
	            output,
	        });
	        const screen = new screen_manager_mjs_1.default(rl);
	        let cancel = () => { };
	        const answer = new type_1.CancelablePromise((resolve, reject) => {
	            (0, hook_engine_mjs_1.withHooks)(rl, (store) => {
	                function checkCursorPos() {
	                    screen.checkCursorPos();
	                }
	                const removeExitListener = (0, signal_exit_1.onExit)((code, signal) => {
	                    onExit();
	                    reject(new errors_mjs_1.ExitPromptError(`User force closed the prompt with ${code} ${signal}`));
	                });
	                function onExit() {
	                    try {
	                        store.hooksCleanup.forEach((cleanFn) => {
	                            cleanFn === null || cleanFn === void 0 ? void 0 : cleanFn();
	                        });
	                    }
	                    catch (error) {
	                        reject(error);
	                    }
	                    if (context === null || context === void 0 ? void 0 : context.clearPromptOnDone) {
	                        screen.clean();
	                    }
	                    else {
	                        screen.clearContent();
	                    }
	                    screen.done();
	                    removeExitListener();
	                    store.rl.input.removeListener('keypress', checkCursorPos);
	                }
	                cancel = () => {
	                    onExit();
	                    reject(new errors_mjs_1.CancelPromptError());
	                };
	                function done(value) {
	                    // Delay execution to let time to the hookCleanup functions to registers.
	                    setImmediate(() => {
	                        onExit();
	                        // Finally we resolve our promise
	                        resolve(value);
	                    });
	                }
	                function workLoop() {
	                    store.index = 0;
	                    try {
	                        const nextView = view(config, done);
	                        const [content, bottomContent] = typeof nextView === 'string' ? [nextView] : nextView;
	                        screen.render(content, bottomContent);
	                        hook_engine_mjs_1.effectScheduler.run();
	                    }
	                    catch (error) {
	                        onExit();
	                        reject(error);
	                    }
	                }
	                store.handleChange = () => workLoop();
	                workLoop();
	                // Re-renders only happen when the state change; but the readline cursor could change position
	                // and that also requires a re-render (and a manual one because we mute the streams).
	                // We set the listener after the initial workLoop to avoid a double render if render triggered
	                // by a state change sets the cursor to the right position.
	                store.rl.input.on('keypress', checkCursorPos);
	            });
	        });
	        answer.cancel = cancel;
	        return answer;
	    };
	    return prompt;
	}
	return createPrompt;
}

var Separator = {};

var commonjs = {};

var hasRequiredCommonjs;

function requireCommonjs () {
	if (hasRequiredCommonjs) return commonjs;
	hasRequiredCommonjs = 1;
	(function (exports) {
		var __importDefault = (commonjs && commonjs.__importDefault) || function (mod) {
		    return (mod && mod.__esModule) ? mod : { "default": mod };
		};
		Object.defineProperty(exports, "__esModule", { value: true });
		exports.replaceSymbols = exports.fallbackSymbols = exports.mainSymbols = void 0;
		// process.env dot-notation access prints:
		// Property 'TERM' comes from an index signature, so it must be accessed with ['TERM'].ts(4111)
		/* eslint dot-notation: ["off"] */
		const node_process_1 = __importDefault(process__default);
		// Ported from is-unicode-supported
		function isUnicodeSupported() {
		    if (node_process_1.default.platform !== 'win32') {
		        return node_process_1.default.env['TERM'] !== 'linux'; // Linux console (kernel)
		    }
		    return (Boolean(node_process_1.default.env['WT_SESSION']) || // Windows Terminal
		        Boolean(node_process_1.default.env['TERMINUS_SUBLIME']) || // Terminus (<0.2.27)
		        node_process_1.default.env['ConEmuTask'] === '{cmd::Cmder}' || // ConEmu and cmder
		        node_process_1.default.env['TERM_PROGRAM'] === 'Terminus-Sublime' ||
		        node_process_1.default.env['TERM_PROGRAM'] === 'vscode' ||
		        node_process_1.default.env['TERM'] === 'xterm-256color' ||
		        node_process_1.default.env['TERM'] === 'alacritty' ||
		        node_process_1.default.env['TERMINAL_EMULATOR'] === 'JetBrains-JediTerm');
		}
		// Ported from figures
		const common = {
		    circleQuestionMark: '(?)',
		    questionMarkPrefix: '(?)',
		    square: '█',
		    squareDarkShade: '▓',
		    squareMediumShade: '▒',
		    squareLightShade: '░',
		    squareTop: '▀',
		    squareBottom: '▄',
		    squareLeft: '▌',
		    squareRight: '▐',
		    squareCenter: '■',
		    bullet: '●',
		    dot: '․',
		    ellipsis: '…',
		    pointerSmall: '›',
		    triangleUp: '▲',
		    triangleUpSmall: '▴',
		    triangleDown: '▼',
		    triangleDownSmall: '▾',
		    triangleLeftSmall: '◂',
		    triangleRightSmall: '▸',
		    home: '⌂',
		    heart: '♥',
		    musicNote: '♪',
		    musicNoteBeamed: '♫',
		    arrowUp: '↑',
		    arrowDown: '↓',
		    arrowLeft: '←',
		    arrowRight: '→',
		    arrowLeftRight: '↔',
		    arrowUpDown: '↕',
		    almostEqual: '≈',
		    notEqual: '≠',
		    lessOrEqual: '≤',
		    greaterOrEqual: '≥',
		    identical: '≡',
		    infinity: '∞',
		    subscriptZero: '₀',
		    subscriptOne: '₁',
		    subscriptTwo: '₂',
		    subscriptThree: '₃',
		    subscriptFour: '₄',
		    subscriptFive: '₅',
		    subscriptSix: '₆',
		    subscriptSeven: '₇',
		    subscriptEight: '₈',
		    subscriptNine: '₉',
		    oneHalf: '½',
		    oneThird: '⅓',
		    oneQuarter: '¼',
		    oneFifth: '⅕',
		    oneSixth: '⅙',
		    oneEighth: '⅛',
		    twoThirds: '⅔',
		    twoFifths: '⅖',
		    threeQuarters: '¾',
		    threeFifths: '⅗',
		    threeEighths: '⅜',
		    fourFifths: '⅘',
		    fiveSixths: '⅚',
		    fiveEighths: '⅝',
		    sevenEighths: '⅞',
		    line: '─',
		    lineBold: '━',
		    lineDouble: '═',
		    lineDashed0: '┄',
		    lineDashed1: '┅',
		    lineDashed2: '┈',
		    lineDashed3: '┉',
		    lineDashed4: '╌',
		    lineDashed5: '╍',
		    lineDashed6: '╴',
		    lineDashed7: '╶',
		    lineDashed8: '╸',
		    lineDashed9: '╺',
		    lineDashed10: '╼',
		    lineDashed11: '╾',
		    lineDashed12: '−',
		    lineDashed13: '–',
		    lineDashed14: '‐',
		    lineDashed15: '⁃',
		    lineVertical: '│',
		    lineVerticalBold: '┃',
		    lineVerticalDouble: '║',
		    lineVerticalDashed0: '┆',
		    lineVerticalDashed1: '┇',
		    lineVerticalDashed2: '┊',
		    lineVerticalDashed3: '┋',
		    lineVerticalDashed4: '╎',
		    lineVerticalDashed5: '╏',
		    lineVerticalDashed6: '╵',
		    lineVerticalDashed7: '╷',
		    lineVerticalDashed8: '╹',
		    lineVerticalDashed9: '╻',
		    lineVerticalDashed10: '╽',
		    lineVerticalDashed11: '╿',
		    lineDownLeft: '┐',
		    lineDownLeftArc: '╮',
		    lineDownBoldLeftBold: '┓',
		    lineDownBoldLeft: '┒',
		    lineDownLeftBold: '┑',
		    lineDownDoubleLeftDouble: '╗',
		    lineDownDoubleLeft: '╖',
		    lineDownLeftDouble: '╕',
		    lineDownRight: '┌',
		    lineDownRightArc: '╭',
		    lineDownBoldRightBold: '┏',
		    lineDownBoldRight: '┎',
		    lineDownRightBold: '┍',
		    lineDownDoubleRightDouble: '╔',
		    lineDownDoubleRight: '╓',
		    lineDownRightDouble: '╒',
		    lineUpLeft: '┘',
		    lineUpLeftArc: '╯',
		    lineUpBoldLeftBold: '┛',
		    lineUpBoldLeft: '┚',
		    lineUpLeftBold: '┙',
		    lineUpDoubleLeftDouble: '╝',
		    lineUpDoubleLeft: '╜',
		    lineUpLeftDouble: '╛',
		    lineUpRight: '└',
		    lineUpRightArc: '╰',
		    lineUpBoldRightBold: '┗',
		    lineUpBoldRight: '┖',
		    lineUpRightBold: '┕',
		    lineUpDoubleRightDouble: '╚',
		    lineUpDoubleRight: '╙',
		    lineUpRightDouble: '╘',
		    lineUpDownLeft: '┤',
		    lineUpBoldDownBoldLeftBold: '┫',
		    lineUpBoldDownBoldLeft: '┨',
		    lineUpDownLeftBold: '┥',
		    lineUpBoldDownLeftBold: '┩',
		    lineUpDownBoldLeftBold: '┪',
		    lineUpDownBoldLeft: '┧',
		    lineUpBoldDownLeft: '┦',
		    lineUpDoubleDownDoubleLeftDouble: '╣',
		    lineUpDoubleDownDoubleLeft: '╢',
		    lineUpDownLeftDouble: '╡',
		    lineUpDownRight: '├',
		    lineUpBoldDownBoldRightBold: '┣',
		    lineUpBoldDownBoldRight: '┠',
		    lineUpDownRightBold: '┝',
		    lineUpBoldDownRightBold: '┡',
		    lineUpDownBoldRightBold: '┢',
		    lineUpDownBoldRight: '┟',
		    lineUpBoldDownRight: '┞',
		    lineUpDoubleDownDoubleRightDouble: '╠',
		    lineUpDoubleDownDoubleRight: '╟',
		    lineUpDownRightDouble: '╞',
		    lineDownLeftRight: '┬',
		    lineDownBoldLeftBoldRightBold: '┳',
		    lineDownLeftBoldRightBold: '┯',
		    lineDownBoldLeftRight: '┰',
		    lineDownBoldLeftBoldRight: '┱',
		    lineDownBoldLeftRightBold: '┲',
		    lineDownLeftRightBold: '┮',
		    lineDownLeftBoldRight: '┭',
		    lineDownDoubleLeftDoubleRightDouble: '╦',
		    lineDownDoubleLeftRight: '╥',
		    lineDownLeftDoubleRightDouble: '╤',
		    lineUpLeftRight: '┴',
		    lineUpBoldLeftBoldRightBold: '┻',
		    lineUpLeftBoldRightBold: '┷',
		    lineUpBoldLeftRight: '┸',
		    lineUpBoldLeftBoldRight: '┹',
		    lineUpBoldLeftRightBold: '┺',
		    lineUpLeftRightBold: '┶',
		    lineUpLeftBoldRight: '┵',
		    lineUpDoubleLeftDoubleRightDouble: '╩',
		    lineUpDoubleLeftRight: '╨',
		    lineUpLeftDoubleRightDouble: '╧',
		    lineUpDownLeftRight: '┼',
		    lineUpBoldDownBoldLeftBoldRightBold: '╋',
		    lineUpDownBoldLeftBoldRightBold: '╈',
		    lineUpBoldDownLeftBoldRightBold: '╇',
		    lineUpBoldDownBoldLeftRightBold: '╊',
		    lineUpBoldDownBoldLeftBoldRight: '╉',
		    lineUpBoldDownLeftRight: '╀',
		    lineUpDownBoldLeftRight: '╁',
		    lineUpDownLeftBoldRight: '┽',
		    lineUpDownLeftRightBold: '┾',
		    lineUpBoldDownBoldLeftRight: '╂',
		    lineUpDownLeftBoldRightBold: '┿',
		    lineUpBoldDownLeftBoldRight: '╃',
		    lineUpBoldDownLeftRightBold: '╄',
		    lineUpDownBoldLeftBoldRight: '╅',
		    lineUpDownBoldLeftRightBold: '╆',
		    lineUpDoubleDownDoubleLeftDoubleRightDouble: '╬',
		    lineUpDoubleDownDoubleLeftRight: '╫',
		    lineUpDownLeftDoubleRightDouble: '╪',
		    lineCross: '╳',
		    lineBackslash: '╲',
		    lineSlash: '╱',
		};
		const specialMainSymbols = {
		    tick: '✔',
		    info: 'ℹ',
		    warning: '⚠',
		    cross: '✘',
		    squareSmall: '◻',
		    squareSmallFilled: '◼',
		    circle: '◯',
		    circleFilled: '◉',
		    circleDotted: '◌',
		    circleDouble: '◎',
		    circleCircle: 'ⓞ',
		    circleCross: 'ⓧ',
		    circlePipe: 'Ⓘ',
		    radioOn: '◉',
		    radioOff: '◯',
		    checkboxOn: '☒',
		    checkboxOff: '☐',
		    checkboxCircleOn: 'ⓧ',
		    checkboxCircleOff: 'Ⓘ',
		    pointer: '❯',
		    triangleUpOutline: '△',
		    triangleLeft: '◀',
		    triangleRight: '▶',
		    lozenge: '◆',
		    lozengeOutline: '◇',
		    hamburger: '☰',
		    smiley: '㋡',
		    mustache: '෴',
		    star: '★',
		    play: '▶',
		    nodejs: '⬢',
		    oneSeventh: '⅐',
		    oneNinth: '⅑',
		    oneTenth: '⅒',
		};
		const specialFallbackSymbols = {
		    tick: '√',
		    info: 'i',
		    warning: '‼',
		    cross: '×',
		    squareSmall: '□',
		    squareSmallFilled: '■',
		    circle: '( )',
		    circleFilled: '(*)',
		    circleDotted: '( )',
		    circleDouble: '( )',
		    circleCircle: '(○)',
		    circleCross: '(×)',
		    circlePipe: '(│)',
		    radioOn: '(*)',
		    radioOff: '( )',
		    checkboxOn: '[×]',
		    checkboxOff: '[ ]',
		    checkboxCircleOn: '(×)',
		    checkboxCircleOff: '( )',
		    pointer: '>',
		    triangleUpOutline: '∆',
		    triangleLeft: '◄',
		    triangleRight: '►',
		    lozenge: '♦',
		    lozengeOutline: '◊',
		    hamburger: '≡',
		    smiley: '☺',
		    mustache: '┌─┐',
		    star: '✶',
		    play: '►',
		    nodejs: '♦',
		    oneSeventh: '1/7',
		    oneNinth: '1/9',
		    oneTenth: '1/10',
		};
		exports.mainSymbols = { ...common, ...specialMainSymbols };
		exports.fallbackSymbols = {
		    ...common,
		    ...specialFallbackSymbols,
		};
		const shouldUseMain = isUnicodeSupported();
		const figures = shouldUseMain ? exports.mainSymbols : exports.fallbackSymbols;
		exports.default = figures;
		const replacements = Object.entries(specialMainSymbols);
		// On terminals which do not support Unicode symbols, substitute them to other symbols
		const replaceSymbols = (string, { useFallback = !shouldUseMain } = {}) => {
		    if (useFallback) {
		        for (const [key, mainSymbol] of replacements) {
		            const fallbackSymbol = exports.fallbackSymbols[key];
		            if (!fallbackSymbol) {
		                throw new Error(`Unable to find fallback for ${key}`);
		            }
		            string = string.replaceAll(mainSymbol, fallbackSymbol);
		        }
		    }
		    return string;
		};
		exports.replaceSymbols = replaceSymbols; 
	} (commonjs));
	return commonjs;
}

var hasRequiredSeparator;

function requireSeparator () {
	if (hasRequiredSeparator) return Separator;
	hasRequiredSeparator = 1;
	var __importDefault = (Separator && Separator.__importDefault) || function (mod) {
	    return (mod && mod.__esModule) ? mod : { "default": mod };
	};
	Object.defineProperty(Separator, "__esModule", { value: true });
	Separator.Separator = void 0;
	const picocolors_1 = __importDefault(/*@__PURE__*/ requirePicocolors());
	const figures_1 = __importDefault(/*@__PURE__*/ requireCommonjs());
	/**
	 * Separator object
	 * Used to space/separate choices group
	 */
	let Separator$1 = class Separator {
	    constructor(separator) {
	        Object.defineProperty(this, "separator", {
	            enumerable: true,
	            configurable: true,
	            writable: true,
	            value: picocolors_1.default.dim(Array.from({ length: 15 }).join(figures_1.default.line))
	        });
	        Object.defineProperty(this, "type", {
	            enumerable: true,
	            configurable: true,
	            writable: true,
	            value: 'separator'
	        });
	        if (separator) {
	            this.separator = separator;
	        }
	    }
	    static isSeparator(choice) {
	        return Boolean(choice && choice.type === 'separator');
	    }
	};
	Separator.Separator = Separator$1;
	return Separator;
}

var hasRequiredCjs;

function requireCjs () {
	if (hasRequiredCjs) return cjs$2;
	hasRequiredCjs = 1;
	(function (exports) {
		var __createBinding = (cjs$2 && cjs$2.__createBinding) || (Object.create ? (function(o, m, k, k2) {
		    if (k2 === undefined) k2 = k;
		    var desc = Object.getOwnPropertyDescriptor(m, k);
		    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
		      desc = { enumerable: true, get: function() { return m[k]; } };
		    }
		    Object.defineProperty(o, k2, desc);
		}) : (function(o, m, k, k2) {
		    if (k2 === undefined) k2 = k;
		    o[k2] = m[k];
		}));
		var __exportStar = (cjs$2 && cjs$2.__exportStar) || function(m, exports) {
		    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
		};
		Object.defineProperty(exports, "__esModule", { value: true });
		exports.Separator = exports.createPrompt = exports.usePagination = exports.makeTheme = exports.useKeypress = exports.useRef = exports.useMemo = exports.useEffect = exports.useState = exports.usePrefix = void 0;
		__exportStar(/*@__PURE__*/ requireKey(), exports);
		__exportStar(/*@__PURE__*/ requireErrors(), exports);
		var use_prefix_mjs_1 = /*@__PURE__*/ requireUsePrefix();
		Object.defineProperty(exports, "usePrefix", { enumerable: true, get: function () { return use_prefix_mjs_1.usePrefix; } });
		var use_state_mjs_1 = /*@__PURE__*/ requireUseState();
		Object.defineProperty(exports, "useState", { enumerable: true, get: function () { return use_state_mjs_1.useState; } });
		var use_effect_mjs_1 = /*@__PURE__*/ requireUseEffect();
		Object.defineProperty(exports, "useEffect", { enumerable: true, get: function () { return use_effect_mjs_1.useEffect; } });
		var use_memo_mjs_1 = /*@__PURE__*/ requireUseMemo();
		Object.defineProperty(exports, "useMemo", { enumerable: true, get: function () { return use_memo_mjs_1.useMemo; } });
		var use_ref_mjs_1 = /*@__PURE__*/ requireUseRef();
		Object.defineProperty(exports, "useRef", { enumerable: true, get: function () { return use_ref_mjs_1.useRef; } });
		var use_keypress_mjs_1 = /*@__PURE__*/ requireUseKeypress();
		Object.defineProperty(exports, "useKeypress", { enumerable: true, get: function () { return use_keypress_mjs_1.useKeypress; } });
		var make_theme_mjs_1 = /*@__PURE__*/ requireMakeTheme();
		Object.defineProperty(exports, "makeTheme", { enumerable: true, get: function () { return make_theme_mjs_1.makeTheme; } });
		var use_pagination_mjs_1 = /*@__PURE__*/ requireUsePagination();
		Object.defineProperty(exports, "usePagination", { enumerable: true, get: function () { return use_pagination_mjs_1.usePagination; } });
		var create_prompt_mjs_1 = /*@__PURE__*/ requireCreatePrompt();
		Object.defineProperty(exports, "createPrompt", { enumerable: true, get: function () { return create_prompt_mjs_1.createPrompt; } });
		var Separator_mjs_1 = /*@__PURE__*/ requireSeparator();
		Object.defineProperty(exports, "Separator", { enumerable: true, get: function () { return Separator_mjs_1.Separator; } }); 
	} (cjs$2));
	return cjs$2;
}

var hasRequiredDist;

function requireDist () {
	if (hasRequiredDist) return dist;
	hasRequiredDist = 1;
	var __importDefault = (dist && dist.__importDefault) || function (mod) {
	    return (mod && mod.__esModule) ? mod : { "default": mod };
	};
	Object.defineProperty(dist, "__esModule", { value: true });
	const core_1 = /*@__PURE__*/ requireCjs();
	const core_2 = /*@__PURE__*/ requireCjs();
	const ansi_escapes_1 = __importDefault(requireAnsiEscapes());
	function isLeftKey(key) {
	    return key.name === "left";
	}
	function isRightKey(key) {
	    return key.name === "right";
	}
	dist.default = (0, core_2.createPrompt)((config, done) => {
	    var _a;
	    const theme = (0, core_2.makeTheme)({ active: "yes", inactive: "no" }, config.theme);
	    const prefix = (0, core_2.usePrefix)({ theme });
	    const [value, setValue] = (0, core_1.useState)((_a = config.default) !== null && _a !== void 0 ? _a : false);
	    const [isDone, setIsDone] = (0, core_1.useState)(false);
	    (0, core_1.useKeypress)((key) => {
	        if ((0, core_1.isEnterKey)(key)) {
	            setIsDone(true);
	            done(value);
	        }
	        else if (isLeftKey(key) || isRightKey(key) || (0, core_1.isUpKey)(key) || (0, core_1.isDownKey)(key)) {
	            setValue(!value);
	        }
	    });
	    const message = theme.style.message(config.message);
	    if (isDone) {
	        return `${prefix} ${message} ${theme.style.answer(value ? theme.active : theme.inactive)}`;
	    }
	    const activeMessage = value ? theme.style.highlight(theme.active) : theme.active;
	    const inactiveMessage = value ? theme.inactive : theme.style.highlight(theme.inactive);
	    return `${prefix} ${message} ${inactiveMessage} / ${activeMessage}${ansi_escapes_1.default.cursorHide}`;
	});
	return dist;
}

var distExports = requireDist();
const toggleModule = /*@__PURE__*/getDefaultExportFromCjs(distExports);

const togglePrompt = toggleModule?.default?.default || toggleModule?.default || toggleModule;
async function promptBoolean(options) {
  const { message, defaultValue = false, theme } = options;
  return await togglePrompt({
    message,
    default: defaultValue,
    ...theme ? { theme } : {}
  });
}

export { promptBoolean as p };
