UNPKG

@qc2168/mib

Version:
4 lines 1.01 MB
{ "version": 3, "sources": ["../../node_modules/.pnpm/picocolors@1.0.0/node_modules/picocolors/picocolors.js", "../../node_modules/.pnpm/kleur@3.0.3/node_modules/kleur/index.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/action.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/strip.js", "../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/clear.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/figures.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/style.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/lines.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/wrap.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/entriesToDisplay.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/util/index.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/prompt.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/select.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/toggle.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/datepart.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/meridiem.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/day.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/hours.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/milliseconds.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/minutes.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/month.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/seconds.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/year.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/dateparts/index.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/multiselect.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocompleteMultiselect.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/confirm.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/index.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/prompts.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/index.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/action.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/strip.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/clear.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/figures.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/style.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/lines.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/wrap.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/entriesToDisplay.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/util/index.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/prompt.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/text.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/select.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/toggle.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/datepart.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/meridiem.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/day.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/hours.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/milliseconds.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/minutes.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/month.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/seconds.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/year.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/dateparts/index.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/date.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/number.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/multiselect.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocomplete.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/autocompleteMultiselect.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/confirm.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/elements/index.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/prompts.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/lib/index.js", "../../node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/index.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/format.js", "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/styles.js", "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/system/has-flag.js", "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/system/supports-colors.js", "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/custom/trap.js", "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/custom/zalgo.js", "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/maps/america.js", "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/maps/zebra.js", "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/maps/rainbow.js", "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/maps/random.js", "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/lib/colors.js", "../../node_modules/.pnpm/colors@1.4.0/node_modules/colors/safe.js", "../../node_modules/.pnpm/triple-beam@1.3.0/node_modules/triple-beam/config/cli.js", "../../node_modules/.pnpm/triple-beam@1.3.0/node_modules/triple-beam/config/npm.js", "../../node_modules/.pnpm/triple-beam@1.3.0/node_modules/triple-beam/config/syslog.js", "../../node_modules/.pnpm/triple-beam@1.3.0/node_modules/triple-beam/config/index.js", "../../node_modules/.pnpm/triple-beam@1.3.0/node_modules/triple-beam/index.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/colorize.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/levels.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/align.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/errors.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/pad-levels.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/cli.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/combine.js", "../../node_modules/.pnpm/safe-stable-stringify@1.1.1/node_modules/safe-stable-stringify/stable.js", "../../node_modules/.pnpm/safe-stable-stringify@1.1.1/node_modules/safe-stable-stringify/index.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/json.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/label.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/logstash.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/metadata.js", "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/ms.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/pretty-print.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/printf.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/simple.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/splat.js", "../../node_modules/.pnpm/fecha@4.2.1/node_modules/fecha/src/fecha.ts", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/timestamp.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/uncolorize.js", "../../node_modules/.pnpm/logform@2.3.2/node_modules/logform/index.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/common.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/package.json", "../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/internal/streams/stream.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/internal/streams/destroy.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/errors.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/internal/streams/state.js", "../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js", "../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/internal/streams/buffer_list.js", "../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js", "../../node_modules/.pnpm/string_decoder@1.3.0/node_modules/string_decoder/lib/string_decoder.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/internal/streams/end-of-stream.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/internal/streams/async_iterator.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/internal/streams/from.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_readable.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_duplex.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_writable.js", "../../node_modules/.pnpm/winston-transport@4.4.2/node_modules/winston-transport/legacy.js", "../../node_modules/.pnpm/winston-transport@4.4.2/node_modules/winston-transport/index.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/transports/console.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/isArrayLike.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/initialParams.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/setImmediate.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/asyncify.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/wrapAsync.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/awaitify.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/parallel.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/once.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/getIterator.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/iterator.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/onlyOnce.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/breakLoop.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/asyncEachOfLimit.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/eachOfLimit.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/eachOfLimit.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/eachOfSeries.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/series.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_transform.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/_stream_passthrough.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/lib/internal/streams/pipeline.js", "../../node_modules/.pnpm/readable-stream@3.6.0/node_modules/readable-stream/readable.js", "../../node_modules/.pnpm/@dabh+diagnostics@2.0.2/node_modules/@dabh/diagnostics/diagnostics.js", "../../node_modules/.pnpm/@dabh+diagnostics@2.0.2/node_modules/@dabh/diagnostics/node/production.js", "../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js", "../../node_modules/.pnpm/is-arrayish@0.3.2/node_modules/is-arrayish/index.js", "../../node_modules/.pnpm/simple-swizzle@0.2.2/node_modules/simple-swizzle/index.js", "../../node_modules/.pnpm/color-string@1.9.0/node_modules/color-string/index.js", "../../node_modules/.pnpm/registry.nlark.com+color-name@1.1.3/node_modules/color-name/index.js", "../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/conversions.js", "../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/route.js", "../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/index.js", "../../node_modules/.pnpm/color@3.2.1/node_modules/color/index.js", "../../node_modules/.pnpm/text-hex@1.0.0/node_modules/text-hex/index.js", "../../node_modules/.pnpm/colorspace@1.1.4/node_modules/colorspace/index.js", "../../node_modules/.pnpm/kuler@2.0.0/node_modules/kuler/index.js", "../../node_modules/.pnpm/@dabh+diagnostics@2.0.2/node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js", "../../node_modules/.pnpm/enabled@2.0.0/node_modules/enabled/index.js", "../../node_modules/.pnpm/@dabh+diagnostics@2.0.2/node_modules/@dabh/diagnostics/adapters/index.js", "../../node_modules/.pnpm/@dabh+diagnostics@2.0.2/node_modules/@dabh/diagnostics/adapters/process.env.js", "../../node_modules/.pnpm/@dabh+diagnostics@2.0.2/node_modules/@dabh/diagnostics/logger/console.js", "../../node_modules/.pnpm/@dabh+diagnostics@2.0.2/node_modules/@dabh/diagnostics/node/development.js", "../../node_modules/.pnpm/@dabh+diagnostics@2.0.2/node_modules/@dabh/diagnostics/node/index.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/tail-file.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/transports/file.js", "../../node_modules/.pnpm/safe-stable-stringify@2.3.1/node_modules/safe-stable-stringify/index.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/transports/http.js", "../../node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/transports/stream.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/transports/index.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/config/index.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/eachOf.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/internal/withoutIndex.js", "../../node_modules/.pnpm/async@3.2.3/node_modules/async/forEach.js", "../../node_modules/.pnpm/fn.name@1.1.0/node_modules/fn.name/index.js", "../../node_modules/.pnpm/one-time@1.0.0/node_modules/one-time/index.js", "../../node_modules/.pnpm/stack-trace@0.0.10/node_modules/stack-trace/lib/stack-trace.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/exception-stream.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/exception-handler.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/rejection-handler.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/profiler.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/logger.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/create-logger.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston/container.js", "../../node_modules/.pnpm/winston@3.5.1/node_modules/winston/lib/winston.js", "../../src/bin.ts", "../../src/devices.ts", "../../src/utils/logger.ts", "../../src/config.ts", "../../src/utils/getCParams.ts", "../../src/utils/adb.ts", "../../src/mib.ts", "../../src/adbCmd.ts", "../../src/utils/pathRepair.ts", "../../src/node.ts", "../../src/utils/hash.ts", "../../src/utils/error.ts", "../../src/utils/isPath.ts"], "sourcesContent": ["let tty = require(\"tty\")\n\nlet isColorSupported =\n\t!(\"NO_COLOR\" in process.env || process.argv.includes(\"--no-color\")) &&\n\t(\"FORCE_COLOR\" in process.env ||\n\t\tprocess.argv.includes(\"--color\") ||\n\t\tprocess.platform === \"win32\" ||\n\t\t(tty.isatty(1) && process.env.TERM !== \"dumb\") ||\n\t\t\"CI\" in process.env)\n\nlet formatter =\n\t(open, close, replace = open) =>\n\tinput => {\n\t\tlet string = \"\" + input\n\t\tlet index = string.indexOf(close, open.length)\n\t\treturn ~index\n\t\t\t? open + replaceClose(string, close, replace, index) + close\n\t\t\t: open + string + close\n\t}\n\nlet replaceClose = (string, close, replace, index) => {\n\tlet start = string.substring(0, index) + replace\n\tlet end = string.substring(index + close.length)\n\tlet nextIndex = end.indexOf(close)\n\treturn ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end\n}\n\nlet createColors = (enabled = isColorSupported) => ({\n\tisColorSupported: enabled,\n\treset: enabled ? s => `\\x1b[0m${s}\\x1b[0m` : String,\n\tbold: enabled ? formatter(\"\\x1b[1m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[1m\") : String,\n\tdim: enabled ? formatter(\"\\x1b[2m\", \"\\x1b[22m\", \"\\x1b[22m\\x1b[2m\") : String,\n\titalic: enabled ? formatter(\"\\x1b[3m\", \"\\x1b[23m\") : String,\n\tunderline: enabled ? formatter(\"\\x1b[4m\", \"\\x1b[24m\") : String,\n\tinverse: enabled ? formatter(\"\\x1b[7m\", \"\\x1b[27m\") : String,\n\thidden: enabled ? formatter(\"\\x1b[8m\", \"\\x1b[28m\") : String,\n\tstrikethrough: enabled ? formatter(\"\\x1b[9m\", \"\\x1b[29m\") : String,\n\tblack: enabled ? formatter(\"\\x1b[30m\", \"\\x1b[39m\") : String,\n\tred: enabled ? formatter(\"\\x1b[31m\", \"\\x1b[39m\") : String,\n\tgreen: enabled ? formatter(\"\\x1b[32m\", \"\\x1b[39m\") : String,\n\tyellow: enabled ? formatter(\"\\x1b[33m\", \"\\x1b[39m\") : String,\n\tblue: enabled ? formatter(\"\\x1b[34m\", \"\\x1b[39m\") : String,\n\tmagenta: enabled ? formatter(\"\\x1b[35m\", \"\\x1b[39m\") : String,\n\tcyan: enabled ? formatter(\"\\x1b[36m\", \"\\x1b[39m\") : String,\n\twhite: enabled ? formatter(\"\\x1b[37m\", \"\\x1b[39m\") : String,\n\tgray: enabled ? formatter(\"\\x1b[90m\", \"\\x1b[39m\") : String,\n\tbgBlack: enabled ? formatter(\"\\x1b[40m\", \"\\x1b[49m\") : String,\n\tbgRed: enabled ? formatter(\"\\x1b[41m\", \"\\x1b[49m\") : String,\n\tbgGreen: enabled ? formatter(\"\\x1b[42m\", \"\\x1b[49m\") : String,\n\tbgYellow: enabled ? formatter(\"\\x1b[43m\", \"\\x1b[49m\") : String,\n\tbgBlue: enabled ? formatter(\"\\x1b[44m\", \"\\x1b[49m\") : String,\n\tbgMagenta: enabled ? formatter(\"\\x1b[45m\", \"\\x1b[49m\") : String,\n\tbgCyan: enabled ? formatter(\"\\x1b[46m\", \"\\x1b[49m\") : String,\n\tbgWhite: enabled ? formatter(\"\\x1b[47m\", \"\\x1b[49m\") : String,\n})\n\nmodule.exports = createColors()\nmodule.exports.createColors = createColors\n", "'use strict';\n\nconst { FORCE_COLOR, NODE_DISABLE_COLORS, TERM } = process.env;\n\nconst $ = {\n\tenabled: !NODE_DISABLE_COLORS && TERM !== 'dumb' && FORCE_COLOR !== '0',\n\n\t// modifiers\n\treset: init(0, 0),\n\tbold: init(1, 22),\n\tdim: init(2, 22),\n\titalic: init(3, 23),\n\tunderline: init(4, 24),\n\tinverse: init(7, 27),\n\thidden: init(8, 28),\n\tstrikethrough: init(9, 29),\n\n\t// colors\n\tblack: init(30, 39),\n\tred: init(31, 39),\n\tgreen: init(32, 39),\n\tyellow: init(33, 39),\n\tblue: init(34, 39),\n\tmagenta: init(35, 39),\n\tcyan: init(36, 39),\n\twhite: init(37, 39),\n\tgray: init(90, 39),\n\tgrey: init(90, 39),\n\n\t// background colors\n\tbgBlack: init(40, 49),\n\tbgRed: init(41, 49),\n\tbgGreen: init(42, 49),\n\tbgYellow: init(43, 49),\n\tbgBlue: init(44, 49),\n\tbgMagenta: init(45, 49),\n\tbgCyan: init(46, 49),\n\tbgWhite: init(47, 49)\n};\n\nfunction run(arr, str) {\n\tlet i=0, tmp, beg='', end='';\n\tfor (; i < arr.length; i++) {\n\t\ttmp = arr[i];\n\t\tbeg += tmp.open;\n\t\tend += tmp.close;\n\t\tif (str.includes(tmp.close)) {\n\t\t\tstr = str.replace(tmp.rgx, tmp.close + tmp.open);\n\t\t}\n\t}\n\treturn beg + str + end;\n}\n\nfunction chain(has, keys) {\n\tlet ctx = { has, keys };\n\n\tctx.reset = $.reset.bind(ctx);\n\tctx.bold = $.bold.bind(ctx);\n\tctx.dim = $.dim.bind(ctx);\n\tctx.italic = $.italic.bind(ctx);\n\tctx.underline = $.underline.bind(ctx);\n\tctx.inverse = $.inverse.bind(ctx);\n\tctx.hidden = $.hidden.bind(ctx);\n\tctx.strikethrough = $.strikethrough.bind(ctx);\n\n\tctx.black = $.black.bind(ctx);\n\tctx.red = $.red.bind(ctx);\n\tctx.green = $.green.bind(ctx);\n\tctx.yellow = $.yellow.bind(ctx);\n\tctx.blue = $.blue.bind(ctx);\n\tctx.magenta = $.magenta.bind(ctx);\n\tctx.cyan = $.cyan.bind(ctx);\n\tctx.white = $.white.bind(ctx);\n\tctx.gray = $.gray.bind(ctx);\n\tctx.grey = $.grey.bind(ctx);\n\n\tctx.bgBlack = $.bgBlack.bind(ctx);\n\tctx.bgRed = $.bgRed.bind(ctx);\n\tctx.bgGreen = $.bgGreen.bind(ctx);\n\tctx.bgYellow = $.bgYellow.bind(ctx);\n\tctx.bgBlue = $.bgBlue.bind(ctx);\n\tctx.bgMagenta = $.bgMagenta.bind(ctx);\n\tctx.bgCyan = $.bgCyan.bind(ctx);\n\tctx.bgWhite = $.bgWhite.bind(ctx);\n\n\treturn ctx;\n}\n\nfunction init(open, close) {\n\tlet blk = {\n\t\topen: `\\x1b[${open}m`,\n\t\tclose: `\\x1b[${close}m`,\n\t\trgx: new RegExp(`\\\\x1b\\\\[${close}m`, 'g')\n\t};\n\treturn function (txt) {\n\t\tif (this !== void 0 && this.has !== void 0) {\n\t\t\tthis.has.includes(open) || (this.has.push(open),this.keys.push(blk));\n\t\t\treturn txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+'';\n\t\t}\n\t\treturn txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+'';\n\t};\n}\n\nmodule.exports = $;\n", "'use strict';\n\nmodule.exports = (key, isSelect) => {\n if (key.meta && key.name !== 'escape') return;\n\n if (key.ctrl) {\n if (key.name === 'a') return 'first';\n if (key.name === 'c') return 'abort';\n if (key.name === 'd') return 'abort';\n if (key.name === 'e') return 'last';\n if (key.name === 'g') return 'reset';\n }\n\n if (isSelect) {\n if (key.name === 'j') return 'down';\n if (key.name === 'k') return 'up';\n }\n\n if (key.name === 'return') return 'submit';\n if (key.name === 'enter') return 'submit'; // ctrl + J\n\n if (key.name === 'backspace') return 'delete';\n if (key.name === 'delete') return 'deleteForward';\n if (key.name === 'abort') return 'abort';\n if (key.name === 'escape') return 'exit';\n if (key.name === 'tab') return 'next';\n if (key.name === 'pagedown') return 'nextPage';\n if (key.name === 'pageup') return 'prevPage'; // TODO create home() in prompt types (e.g. TextPrompt)\n\n if (key.name === 'home') return 'home'; // TODO create end() in prompt types (e.g. TextPrompt)\n\n if (key.name === 'end') return 'end';\n if (key.name === 'up') return 'up';\n if (key.name === 'down') return 'down';\n if (key.name === 'right') return 'right';\n if (key.name === 'left') return 'left';\n return false;\n};", "'use strict';\n\nmodule.exports = str => {\n const pattern = ['[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)', '(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PRZcf-ntqry=><~]))'].join('|');\n const RGX = new RegExp(pattern, 'g');\n return typeof str === 'string' ? str.replace(RGX, '') : str;\n};", "'use strict';\n\nconst ESC = '\\x1B';\nconst CSI = `${ESC}[`;\nconst beep = '\\u0007';\n\nconst cursor = {\n to(x, y) {\n if (!y) return `${CSI}${x + 1}G`;\n return `${CSI}${y + 1};${x + 1}H`;\n },\n move(x, y) {\n let ret = '';\n\n if (x < 0) ret += `${CSI}${-x}D`;\n else if (x > 0) ret += `${CSI}${x}C`;\n\n if (y < 0) ret += `${CSI}${-y}A`;\n else if (y > 0) ret += `${CSI}${y}B`;\n\n return ret;\n },\n up: (count = 1) => `${CSI}${count}A`,\n down: (count = 1) => `${CSI}${count}B`,\n forward: (count = 1) => `${CSI}${count}C`,\n backward: (count = 1) => `${CSI}${count}D`,\n nextLine: (count = 1) => `${CSI}E`.repeat(count),\n prevLine: (count = 1) => `${CSI}F`.repeat(count),\n left: `${CSI}G`,\n hide: `${CSI}?25l`,\n show: `${CSI}?25h`,\n save: `${ESC}7`,\n restore: `${ESC}8`\n}\n\nconst scroll = {\n up: (count = 1) => `${CSI}S`.repeat(count),\n down: (count = 1) => `${CSI}T`.repeat(count)\n}\n\nconst erase = {\n screen: `${CSI}2J`,\n up: (count = 1) => `${CSI}1J`.repeat(count),\n down: (count = 1) => `${CSI}J`.repeat(count),\n line: `${CSI}2K`,\n lineEnd: `${CSI}K`,\n lineStart: `${CSI}1K`,\n lines(count) {\n let clear = '';\n for (let i = 0; i < count; i++)\n clear += this.line + (i < count - 1 ? cursor.up() : '');\n if (count)\n clear += cursor.left;\n return clear;\n }\n}\n\nmodule.exports = { cursor, scroll, erase, beep };\n", "'use strict';\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\n\nconst strip = require('./strip');\n\nconst _require = require('sisteransi'),\n erase = _require.erase,\n cursor = _require.cursor;\n\nconst width = str => [...strip(str)].length;\n/**\n * @param {string} prompt\n * @param {number} perLine\n */\n\n\nmodule.exports = function (prompt, perLine) {\n if (!perLine) return erase.line + cursor.to(0);\n let rows = 0;\n const lines = prompt.split(/\\r?\\n/);\n\n var _iterator = _createForOfIteratorHelper(lines),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n let line = _step.value;\n rows += 1 + Math.floor(Math.max(width(line) - 1, 0) / perLine);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return erase.lines(rows);\n};", "'use strict';\n\nconst main = {\n arrowUp: '\u2191',\n arrowDown: '\u2193',\n arrowLeft: '\u2190',\n arrowRight: '\u2192',\n radioOn: '\u25C9',\n radioOff: '\u25EF',\n tick: '\u2714',\n cross: '\u2716',\n ellipsis: '\u2026',\n pointerSmall: '\u203A',\n line: '\u2500',\n pointer: '\u276F'\n};\nconst win = {\n arrowUp: main.arrowUp,\n arrowDown: main.arrowDown,\n arrowLeft: main.arrowLeft,\n arrowRight: main.arrowRight,\n radioOn: '(*)',\n radioOff: '( )',\n tick: '\u221A',\n cross: '\u00D7',\n ellipsis: '...',\n pointerSmall: '\u00BB',\n line: '\u2500',\n pointer: '>'\n};\nconst figures = process.platform === 'win32' ? win : main;\nmodule.exports = figures;", "'use strict';\n\nconst c = require('kleur');\n\nconst figures = require('./figures'); // rendering user input.\n\n\nconst styles = Object.freeze({\n password: {\n scale: 1,\n render: input => '*'.repeat(input.length)\n },\n emoji: {\n scale: 2,\n render: input => '\uD83D\uDE03'.repeat(input.length)\n },\n invisible: {\n scale: 0,\n render: input => ''\n },\n default: {\n scale: 1,\n render: input => `${input}`\n }\n});\n\nconst render = type => styles[type] || styles.default; // icon to signalize a prompt.\n\n\nconst symbols = Object.freeze({\n aborted: c.red(figures.cross),\n done: c.green(figures.tick),\n exited: c.yellow(figures.cross),\n default: c.cyan('?')\n});\n\nconst symbol = (done, aborted, exited) => aborted ? symbols.aborted : exited ? symbols.exited : done ? symbols.done : symbols.default; // between the question and the user's input.\n\n\nconst delimiter = completing => c.gray(completing ? figures.ellipsis : figures.pointerSmall);\n\nconst item = (expandable, expanded) => c.gray(expandable ? expanded ? figures.pointerSmall : '+' : figures.line);\n\nmodule.exports = {\n styles,\n render,\n symbols,\n symbol,\n delimiter,\n item\n};", "'use strict';\n\nconst strip = require('./strip');\n/**\n * @param {string} msg\n * @param {number} perLine\n */\n\n\nmodule.exports = function (msg, perLine) {\n let lines = String(strip(msg) || '').split(/\\r?\\n/);\n if (!perLine) return lines.length;\n return lines.map(l => Math.ceil(l.length / perLine)).reduce((a, b) => a + b);\n};", "'use strict';\n/**\n * @param {string} msg The message to wrap\n * @param {object} opts\n * @param {number|string} [opts.margin] Left margin\n * @param {number} opts.width Maximum characters per line including the margin\n */\n\nmodule.exports = (msg, opts = {}) => {\n const tab = Number.isSafeInteger(parseInt(opts.margin)) ? new Array(parseInt(opts.margin)).fill(' ').join('') : opts.margin || '';\n const width = opts.width;\n return (msg || '').split(/\\r?\\n/g).map(line => line.split(/\\s+/g).reduce((arr, w) => {\n if (w.length + tab.length >= width || arr[arr.length - 1].length + w.length + 1 < width) arr[arr.length - 1] += ` ${w}`;else arr.push(`${tab}${w}`);\n return arr;\n }, [tab]).join('\\n')).join('\\n');\n};", "'use strict';\n/**\n * Determine what entries should be displayed on the screen, based on the\n * currently selected index and the maximum visible. Used in list-based\n * prompts like `select` and `multiselect`.\n *\n * @param {number} cursor the currently selected entry\n * @param {number} total the total entries available to display\n * @param {number} [maxVisible] the number of entries that can be displayed\n */\n\nmodule.exports = (cursor, total, maxVisible) => {\n maxVisible = maxVisible || total;\n let startIndex = Math.min(total - maxVisible, cursor - Math.floor(maxVisible / 2));\n if (startIndex < 0) startIndex = 0;\n let endIndex = Math.min(startIndex + maxVisible, total);\n return {\n startIndex,\n endIndex\n };\n};", "'use strict';\n\nmodule.exports = {\n action: require('./action'),\n clear: require('./clear'),\n style: require('./style'),\n strip: require('./strip'),\n figures: require('./figures'),\n lines: require('./lines'),\n wrap: require('./wrap'),\n entriesToDisplay: require('./entriesToDisplay')\n};", "'use strict';\n\nconst readline = require('readline');\n\nconst _require = require('../util'),\n action = _require.action;\n\nconst EventEmitter = require('events');\n\nconst _require2 = require('sisteransi'),\n beep = _require2.beep,\n cursor = _require2.cursor;\n\nconst color = require('kleur');\n/**\n * Base prompt skeleton\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\n\n\nclass Prompt extends EventEmitter {\n constructor(opts = {}) {\n super();\n this.firstRender = true;\n this.in = opts.stdin || process.stdin;\n this.out = opts.stdout || process.stdout;\n\n this.onRender = (opts.onRender || (() => void 0)).bind(this);\n\n const rl = readline.createInterface({\n input: this.in,\n escapeCodeTimeout: 50\n });\n readline.emitKeypressEvents(this.in, rl);\n if (this.in.isTTY) this.in.setRawMode(true);\n const isSelect = ['SelectPrompt', 'MultiselectPrompt'].indexOf(this.constructor.name) > -1;\n\n const keypress = (str, key) => {\n let a = action(key, isSelect);\n\n if (a === false) {\n this._ && this._(str, key);\n } else if (typeof this[a] === 'function') {\n this[a](key);\n } else {\n this.bell();\n }\n };\n\n this.close = () => {\n this.out.write(cursor.show);\n this.in.removeListener('keypress', keypress);\n if (this.in.isTTY) this.in.setRawMode(false);\n rl.close();\n this.emit(this.aborted ? 'abort' : this.exited ? 'exit' : 'submit', this.value);\n this.closed = true;\n };\n\n this.in.on('keypress', keypress);\n }\n\n fire() {\n this.emit('state', {\n value: this.value,\n aborted: !!this.aborted,\n exited: !!this.exited\n });\n }\n\n bell() {\n this.out.write(beep);\n }\n\n render() {\n this.onRender(color);\n if (this.firstRender) this.firstRender = false;\n }\n\n}\n\nmodule.exports = Prompt;", "\"use strict\";\n\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\n\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('sisteransi'),\n erase = _require.erase,\n cursor = _require.cursor;\n\nconst _require2 = require('../util'),\n style = _require2.style,\n clear = _require2.clear,\n lines = _require2.lines,\n figures = _require2.figures;\n/**\n * TextPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {String} [opts.style='default'] Render style\n * @param {String} [opts.initial] Default value\n * @param {Function} [opts.validate] Validate function\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {String} [opts.error] The invalid error label\n */\n\n\nclass TextPrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.transform = style.render(opts.style);\n this.scale = this.transform.scale;\n this.msg = opts.message;\n this.initial = opts.initial || ``;\n\n this.validator = opts.validate || (() => true);\n\n this.value = ``;\n this.errorMsg = opts.error || `Please Enter A Valid Value`;\n this.cursor = Number(!!this.initial);\n this.cursorOffset = 0;\n this.clear = clear(``, this.out.columns);\n this.render();\n }\n\n set value(v) {\n if (!v && this.initial) {\n this.placeholder = true;\n this.rendered = color.gray(this.transform.render(this.initial));\n } else {\n this.placeholder = false;\n this.rendered = this.transform.render(v);\n }\n\n this._value = v;\n this.fire();\n }\n\n get value() {\n return this._value;\n }\n\n reset() {\n this.value = ``;\n this.cursor = Number(!!this.initial);\n this.cursorOffset = 0;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.value = this.value || this.initial;\n this.done = this.aborted = true;\n this.error = false;\n this.red = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n validate() {\n var _this = this;\n\n return _asyncToGenerator(function* () {\n let valid = yield _this.validator(_this.value);\n\n if (typeof valid === `string`) {\n _this.errorMsg = valid;\n valid = false;\n }\n\n _this.error = !valid;\n })();\n }\n\n submit() {\n var _this2 = this;\n\n return _asyncToGenerator(function* () {\n _this2.value = _this2.value || _this2.initial;\n _this2.cursorOffset = 0;\n _this2.cursor = _this2.rendered.length;\n yield _this2.validate();\n\n if (_this2.error) {\n _this2.red = true;\n\n _this2.fire();\n\n _this2.render();\n\n return;\n }\n\n _this2.done = true;\n _this2.aborted = false;\n\n _this2.fire();\n\n _this2.render();\n\n _this2.out.write('\\n');\n\n _this2.close();\n })();\n }\n\n next() {\n if (!this.placeholder) return this.bell();\n this.value = this.initial;\n this.cursor = this.rendered.length;\n this.fire();\n this.render();\n }\n\n moveCursor(n) {\n if (this.placeholder) return;\n this.cursor = this.cursor + n;\n this.cursorOffset += n;\n }\n\n _(c, key) {\n let s1 = this.value.slice(0, this.cursor);\n let s2 = this.value.slice(this.cursor);\n this.value = `${s1}${c}${s2}`;\n this.red = false;\n this.cursor = this.placeholder ? 0 : s1.length + 1;\n this.render();\n }\n\n delete() {\n if (this.isCursorAtStart()) return this.bell();\n let s1 = this.value.slice(0, this.cursor - 1);\n let s2 = this.value.slice(this.cursor);\n this.value = `${s1}${s2}`;\n this.red = false;\n\n if (this.isCursorAtStart()) {\n this.cursorOffset = 0;\n } else {\n this.cursorOffset++;\n this.moveCursor(-1);\n }\n\n this.render();\n }\n\n deleteForward() {\n if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();\n let s1 = this.value.slice(0, this.cursor);\n let s2 = this.value.slice(this.cursor + 1);\n this.value = `${s1}${s2}`;\n this.red = false;\n\n if (this.isCursorAtEnd()) {\n this.cursorOffset = 0;\n } else {\n this.cursorOffset++;\n }\n\n this.render();\n }\n\n first() {\n this.cursor = 0;\n this.render();\n }\n\n last() {\n this.cursor = this.value.length;\n this.render();\n }\n\n left() {\n if (this.cursor <= 0 || this.placeholder) return this.bell();\n this.moveCursor(-1);\n this.render();\n }\n\n right() {\n if (this.cursor * this.scale >= this.rendered.length || this.placeholder) return this.bell();\n this.moveCursor(1);\n this.render();\n }\n\n isCursorAtStart() {\n return this.cursor === 0 || this.placeholder && this.cursor === 1;\n }\n\n isCursorAtEnd() {\n return this.cursor === this.rendered.length || this.placeholder && this.cursor === this.rendered.length + 1;\n }\n\n render() {\n if (this.closed) return;\n\n if (!this.firstRender) {\n if (this.outputError) this.out.write(cursor.down(lines(this.outputError, this.out.columns) - 1) + clear(this.outputError, this.out.columns));\n this.out.write(clear(this.outputText, this.out.columns));\n }\n\n super.render();\n this.outputError = '';\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.red ? color.red(this.rendered) : this.rendered].join(` `);\n\n if (this.error) {\n this.outputError += this.errorMsg.split(`\\n`).reduce((a, l, i) => a + `\\n${i ? ' ' : figures.pointerSmall} ${color.red().italic(l)}`, ``);\n }\n\n this.out.write(erase.line + cursor.to(0) + this.outputText + cursor.save + this.outputError + cursor.restore + cursor.move(this.cursorOffset, 0));\n }\n\n}\n\nmodule.exports = TextPrompt;", "'use strict';\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('../util'),\n style = _require.style,\n clear = _require.clear,\n figures = _require.figures,\n wrap = _require.wrap,\n entriesToDisplay = _require.entriesToDisplay;\n\nconst _require2 = require('sisteransi'),\n cursor = _require2.cursor;\n/**\n * SelectPrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Array} opts.choices Array of choice objects\n * @param {String} [opts.hint] Hint to display\n * @param {Number} [opts.initial] Index of default value\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n * @param {Number} [opts.optionsPerPage=10] Max options to display at once\n */\n\n\nclass SelectPrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.hint = opts.hint || '- Use arrow-keys. Return to submit.';\n this.warn = opts.warn || '- This option is disabled';\n this.cursor = opts.initial || 0;\n this.choices = opts.choices.map((ch, idx) => {\n if (typeof ch === 'string') ch = {\n title: ch,\n value: idx\n };\n return {\n title: ch && (ch.title || ch.value || ch),\n value: ch && (ch.value === undefined ? idx : ch.value),\n description: ch && ch.description,\n selected: ch && ch.selected,\n disabled: ch && ch.disabled\n };\n });\n this.optionsPerPage = opts.optionsPerPage || 10;\n this.value = (this.choices[this.cursor] || {}).value;\n this.clear = clear('', this.out.columns);\n this.render();\n }\n\n moveCursor(n) {\n this.cursor = n;\n this.value = this.choices[n].value;\n this.fire();\n }\n\n reset() {\n this.moveCursor(0);\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n if (!this.selection.disabled) {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n } else this.bell();\n }\n\n first() {\n this.moveCursor(0);\n this.render();\n }\n\n last() {\n this.moveCursor(this.choices.length - 1);\n this.render();\n }\n\n up() {\n if (this.cursor === 0) {\n this.moveCursor(this.choices.length - 1);\n } else {\n this.moveCursor(this.cursor - 1);\n }\n\n this.render();\n }\n\n down() {\n if (this.cursor === this.choices.length - 1) {\n this.moveCursor(0);\n } else {\n this.moveCursor(this.cursor + 1);\n }\n\n this.render();\n }\n\n next() {\n this.moveCursor((this.cursor + 1) % this.choices.length);\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') return this.submit();\n }\n\n get selection() {\n return this.choices[this.cursor];\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n\n let _entriesToDisplay = entriesToDisplay(this.cursor, this.choices.length, this.optionsPerPage),\n startIndex = _entriesToDisplay.startIndex,\n endIndex = _entriesToDisplay.endIndex; // Print prompt\n\n\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.done ? this.selection.title : this.selection.disabled ? color.yellow(this.warn) : color.gray(this.hint)].join(' '); // Print choices\n\n if (!this.done) {\n this.outputText += '\\n';\n\n for (let i = startIndex; i < endIndex; i++) {\n let title,\n prefix,\n desc = '',\n v = this.choices[i]; // Determine whether to display \"more choices\" indicators\n\n if (i === startIndex && startIndex > 0) {\n prefix = figures.arrowUp;\n } else if (i === endIndex - 1 && endIndex < this.choices.length) {\n prefix = figures.arrowDown;\n } else {\n prefix = ' ';\n }\n\n if (v.disabled) {\n title = this.cursor === i ? color.gray().underline(v.title) : color.strikethrough().gray(v.title);\n prefix = (this.cursor === i ? color.bold().gray(figures.pointer) + ' ' : ' ') + prefix;\n } else {\n title = this.cursor === i ? color.cyan().underline(v.title) : v.title;\n prefix = (this.cursor === i ? color.cyan(figures.pointer) + ' ' : ' ') + prefix;\n\n if (v.description && this.cursor === i) {\n desc = ` - ${v.description}`;\n\n if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\\r?\\n/).length > 1) {\n desc = '\\n' + wrap(v.description, {\n margin: 3,\n width: this.out.columns\n });\n }\n }\n }\n\n this.outputText += `${prefix} ${title}${color.gray(desc)}\\n`;\n }\n }\n\n this.out.write(this.outputText);\n }\n\n}\n\nmodule.exports = SelectPrompt;", "\"use strict\";\n\nconst color = require('kleur');\n\nconst Prompt = require('./prompt');\n\nconst _require = require('../util'),\n style = _require.style,\n clear = _require.clear;\n\nconst _require2 = require('sisteransi'),\n cursor = _require2.cursor,\n erase = _require2.erase;\n/**\n * TogglePrompt Base Element\n * @param {Object} opts Options\n * @param {String} opts.message Message\n * @param {Boolean} [opts.initial=false] Default value\n * @param {String} [opts.active='no'] Active label\n * @param {String} [opts.inactive='off'] Inactive label\n * @param {Stream} [opts.stdin] The Readable stream to listen to\n * @param {Stream} [opts.stdout] The Writable stream to write readline data to\n */\n\n\nclass TogglePrompt extends Prompt {\n constructor(opts = {}) {\n super(opts);\n this.msg = opts.message;\n this.value = !!opts.initial;\n this.active = opts.active || 'on';\n this.inactive = opts.inactive || 'off';\n this.initialValue = this.value;\n this.render();\n }\n\n reset() {\n this.value = this.initialValue;\n this.fire();\n this.render();\n }\n\n exit() {\n this.abort();\n }\n\n abort() {\n this.done = this.aborted = true;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n submit() {\n this.done = true;\n this.aborted = false;\n this.fire();\n this.render();\n this.out.write('\\n');\n this.close();\n }\n\n deactivate() {\n if (this.value === false) return this.bell();\n this.value = false;\n this.render();\n }\n\n activate() {\n if (this.value === true) return this.bell();\n this.value = true;\n this.render();\n }\n\n delete() {\n this.deactivate();\n }\n\n left() {\n this.deactivate();\n }\n\n right() {\n this.activate();\n }\n\n down() {\n this.deactivate();\n }\n\n up() {\n this.activate();\n }\n\n next() {\n this.value = !this.value;\n this.fire();\n this.render();\n }\n\n _(c, key) {\n if (c === ' ') {\n this.value = !this.value;\n } else if (c === '1') {\n this.value = true;\n } else if (c === '0') {\n this.value = false;\n } else return this.bell();\n\n this.render();\n }\n\n render() {\n if (this.closed) return;\n if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));\n super.render();\n this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(this.done), this.value ? this.inactive : color.cyan().underline(this.inactive), color.gray('/'), this.value ? color.cyan().underline(this.active) : this.active].join(' ');\n this.out.write(erase.line + cursor.to(0) + this.outputText);\n }\n\n}\n\nmodule.exports = TogglePrompt;", "'use strict';\n\nclass DatePart {\n constructor({\n token,\n date,\n parts,\n locales\n }) {\n this.token = token;\n this.date = date || new Date();\n this.parts = parts || [this];\n this.locales = locales || {};\n }\n\n up() {}\n\n down() {}\n\n next() {\n const currentIdx = this.parts.indexOf(this);\n return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n }\n\n setTo(val) {}\n\n prev() {\n let parts = [].concat(this.parts).reverse();\n const currentIdx = parts.indexOf(this);\n return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);\n }\n\n toString() {\n return String(this.date);\n }\n\n}\n\nmodule.exports = DatePart;", "'use strict';\n\nconst DatePart = require('./datepart');\n\nclass Meridiem extends DatePart {\n constructor(opts = {}) {\n super(opts);\n }\n\n up() {\n this.date.setHours((this.date.getHours() + 12) % 24);\n }\n\n down() {\n this.up();\n }\n\n toString() {\n let meridiem = this.date.getHours() > 12 ? 'pm' : 'am';\n return /\\A/.test(this.token) ? me