diff --git a/.gitignore b/.gitignore index b376e71..aeb8181 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ test.py file_generator.py .env *.md +test_results \ No newline at end of file diff --git a/README.md b/README.md index 56f276f..71b4e1f 100644 --- a/README.md +++ b/README.md @@ -61,11 +61,58 @@ jobs: security/detect-non-literal-regexp, security/detect-object-injection - # Log forwarding + # Log output sumo_logic_enabled: true sumo_logic_http_source_url: https://example/url ms_sentinel_enabled: true ms_sentinel_workspace_id: REPLACE_ME ms_sentinel_shared_key: REPLACE_ME + # Scan scope settings + scan_all: false # Set to true to always scan the whole directory + scan_files: "" # Comma-separated list of files to scan (overrides git diff) ``` + +## Local Development & Testing + +You can run the security-wrapper locally using Docker. This is useful for testing changes or scanning code outside of GitHub Actions. + +### Build the Docker Image + +```sh +git clone git@github.com:SocketDev/security-wrapper.git + +# Build the Docker image +docker build -t socketdev/security-wrapper . +``` + +### Run the Security Wrapper Locally + +```sh +docker run --rm --name security-wrapper \ + -v "$PWD:/code" \ + -e "GIT_REPO=socketdev-demo/sast-testing" \ + -e "GITHUB_REPOSITORY=socketdev-demo/sast-testing" \ + -e "GITHUB_WORKSPACE=/code" \ + -e "INPUT_CONSOLE_ENABLED=true" \ + # Uncomment and set if you want to scan images (requires Docker-in-Docker) + # -e "INPUT_DOCKER_IMAGES=trickyhu/sigsci-rule-editor:latest,socketdev/cli:latest" \ + -e "INPUT_DOCKERFILE_ENABLED=true" \ + -e "INPUT_DOCKERFILES=Dockerfile,Dockerfile.sigsci" \ + -e "INPUT_ESLINT_SAST_ENABLED=true" \ + -e "INPUT_FINDING_SEVERITIES=critical" \ + -e "INPUT_GOSEC_SAST_ENABLED=true" \ + -e "INPUT_IMAGE_ENABLED=true" \ + -e "INPUT_PYTHON_SAST_ENABLED=true" \ + -e "PYTHONUNBUFFERED=1" \ + -e "INPUT_SECRET_SCANNING_ENABLED=true" \ + -e "SOCKET_SCM_DISABLED=true" \ + -e "INPUT_SOCKET_CONSOLE_MODE=json" \ + socketdev/security-wrapper +``` + +**Notes:** +- You can adjust the environment variables to enable/disable specific scanners. +- For image scanning, Docker-in-Docker must be enabled, and you may need to add a `docker pull` step before running. +- Results will be printed to the console or output as JSON, depending on `INPUT_SOCKET_CONSOLE_MODE`. +- You can also run the wrapper directly with Bash and Python for rapid local development (see `entrypoint.sh`). diff --git a/action.yml b/action.yml index 92c3e57..25baf30 100644 --- a/action.yml +++ b/action.yml @@ -129,6 +129,16 @@ inputs: required: false default: "REPLACE_ME" + # Scan Scope Configuration + scan_all: + description: "If true, always scan the whole directory regardless of git or file list." + required: false + default: "false" + scan_files: + description: "Comma-separated list of files to scan. If not set, will use git diff or scan all." + required: false + default: "" + branding: icon: "shield" color: "blue" diff --git a/entrypoint.sh b/entrypoint.sh index 8aa282d..222c815 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,16 +13,115 @@ GOSEC_RULES=${INPUT_GOSEC_RULES:-} TRIVY_EXCLUDE_DIR=${INPUT_TRIVY_EXCLUDE_DIR:-} TRIVY_RULES=${INPUT_TRIVY_RULES:-} +# Set output directory for temp files +if [[ -n "$OUTPUT_DIR" ]]; then + TEMP_OUTPUT_DIR="$OUTPUT_DIR" +else + TEMP_OUTPUT_DIR="$(pwd)" +fi + +# Run Trivy on Container Images if enabled +if [[ "$INPUT_TRIVY_IMAGE_ENABLED" == "true" ]]; then + echo "Running Trivy on Container Images" + IFS=',' read -ra DOCKER_IMAGES <<< "${INPUT_DOCKER_IMAGES}" + for image in "${DOCKER_IMAGES[@]}"; do + echo "Scanning image: $image" + trivy image --scanners vuln --format json --output "$TEMP_OUTPUT_DIR/trivy_image_${image//\//_}.json" "$image" || : + done +fi + +# Run Trivy on Dockerfiles if enabled +if [[ "$INPUT_TRIVY_DOCKERFILE_ENABLED" == "true" ]]; then + IFS=',' read -ra DOCKERFILES <<< "${INPUT_DOCKERFILES}" + for dockerfile in "${DOCKERFILES[@]}"; do + echo "Scanning Dockerfile: $dockerfile" + trivy config --format json --output "$TEMP_OUTPUT_DIR/trivy_dockerfile_${dockerfile//\//_}.json" "$GITHUB_WORKSPACE/$dockerfile" || : + done +fi + +# Run Secret Scanning (Trufflehog) if enabled +if [[ "$INPUT_SECRET_SCANNING_ENABLED" == "true" ]]; then + echo "Running Secret Scanning with Trufflehog" + trufflehog_cmd="trufflehog filesystem " + TRUFFLEHOG_EXCLUDE_FILE=$(mktemp) + if [[ -n "$TRUFFLEHOG_EXCLUDE_DIR" ]]; then + IFS=',' read -ra EXCLUDE_DIRS <<< "$TRUFFLEHOG_EXCLUDE_DIR" + for dir in "${EXCLUDE_DIRS[@]}"; do + echo "$dir" >> "$TRUFFLEHOG_EXCLUDE_FILE" + done + trufflehog_cmd+=" -x $TRUFFLEHOG_EXCLUDE_FILE" + fi + if [[ -n "$TRUFFLEHOG_RULES" ]]; then + trufflehog_cmd+=" --rules $TRUFFLEHOG_RULES" + fi + trufflehog_cmd+=" --no-verification -j $GITHUB_WORKSPACE > $TEMP_OUTPUT_DIR/trufflehog_output.json" + eval $trufflehog_cmd || : +fi -# Run ESLint (JavaScript SAST) if enabled -if [[ "${INPUT_JAVASCRIPT_SAST_ENABLED:-false}" == "true" ]]; then - echo "Running ESLint" - ESLINT_EXCLUDE_DIR=${INPUT_ESLINT_EXCLUDE_DIR:-} - ESLINT_RULES=${INPUT_ESLINT_RULES:-} +# POSIX-compatible file collection (replace mapfile) +scan_files=() +if [[ "$INPUT_SCAN_ALL" == "true" ]]; then + while IFS= read -r file; do + scan_files+=("$file") + done < <(find . -type f \( -name '*.py' -o -name '*.go' -o -name '*.js' -o -name '*.jsx' -o -name '*.ts' -o -name '*.tsx' \)) +elif [[ -n "$INPUT_SCAN_FILES" ]]; then + IFS=',' read -ra scan_files <<< "$INPUT_SCAN_FILES" +else + if [[ -d .git ]]; then + while IFS= read -r file; do + scan_files+=("$file") + done < <(git diff --name-only HEAD~1 HEAD) + else + while IFS= read -r file; do + scan_files+=("$file") + done < <(find . -type f \( -name '*.py' -o -name '*.go' -o -name '*.js' -o -name '*.jsx' -o -name '*.ts' -o -name '*.tsx' \)) + fi +fi + +# Separate files by language +python_files=() +go_files=() +js_files=() +for file in "${scan_files[@]}"; do + case "$file" in + *.py) python_files+=("$file") ;; + *.go) go_files+=("$file") ;; + *.js|*.jsx|*.ts|*.tsx) js_files+=("$file") ;; + esac +done + +# Run Bandit on Python files +if [[ "${#python_files[@]}" -gt 0 && "$INPUT_PYTHON_SAST_ENABLED" == "true" ]]; then + echo "Running Bandit on Python files: ${python_files[*]}" + bandit_cmd="bandit -f json -o $TEMP_OUTPUT_DIR/bandit_output.json ${python_files[*]}" + if [[ -n "$BANDIT_EXCLUDE_DIR" ]]; then + bandit_cmd+=" --exclude $BANDIT_EXCLUDE_DIR" + fi + if [[ -n "$BANDIT_RULES" ]]; then + bandit_cmd+=" --skip $BANDIT_RULES" + fi + echo $bandit_cmd + eval $bandit_cmd || : +fi - if [[ -z "$ESLINT_RULES" ]]; then - echo "Using default ESLint rules" - ESLINT_RULES=$(cat <<'EOF' +# Run Gosec on Go files +if [[ "${#go_files[@]}" -gt 0 && "$INPUT_GOLANG_SAST_ENABLED" == "true" ]]; then + echo "Running Gosec on Go files: ${go_files[*]}" + gosec_cmd="gosec -fmt json -out $TEMP_OUTPUT_DIR/gosec_output.json ${go_files[*]}" + if [[ -n "$GOSEC_EXCLUDE_DIR" ]]; then + gosec_cmd+=" -exclude-dir=$GOSEC_EXCLUDE_DIR" + fi + if [[ -n "$GOSEC_RULES" ]]; then + gosec_cmd+=" -severity=$GOSEC_RULES" + fi + eval $gosec_cmd || : +fi + +# ESLint rules setup (needed for JS/TS SAST) +ESLINT_EXCLUDE_DIR=${INPUT_ESLINT_EXCLUDE_DIR:-} +ESLINT_RULES=${INPUT_ESLINT_RULES:-} +if [[ -z "$ESLINT_RULES" ]]; then + ESLINT_RULES=$(cat <<'EOF' security/detect-eval-with-expression, security/detect-non-literal-require, security/detect-non-literal-fs-filename, @@ -75,14 +174,14 @@ security/detect-object-injection, @typescript-eslint/prefer-as-const EOF ) - fi +fi - # Convert rule list to JSON map: "rule-name": "error" - ESLINT_RULES_JSON=$(echo "$ESLINT_RULES" | tr ',' '\n' | sed '/^\s*$/d' | awk '{printf "\"%s\": \"error\",\n", $0}' | sed '$s/,$//') +# Convert rule list to JSON map: "rule-name": "error" +ESLINT_RULES_JSON=$(echo "$ESLINT_RULES" | tr ',' '\n' | sed '/^\s*$/d' | awk '{printf "\"%s\": \"error\",\n", $0}' | sed '$s/,$//') - if [[ ! -f "$WORKSPACE/eslint.config.mjs" ]]; then - echo "Adding fallback ESLint config" - cat < "$WORKSPACE/eslint.config.mjs" +if [[ ! -f "$WORKSPACE/eslint.config.mjs" ]]; then + echo "Adding fallback ESLint config" + cat < "$WORKSPACE/eslint.config.mjs" export default [ { files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'], @@ -92,94 +191,38 @@ $ESLINT_RULES_JSON }, ]; EOF - fi - - eslint_cmd="npx --yes eslint --config $WORKSPACE/eslint.config.mjs $WORKSPACE --ext .js,.jsx,.ts,.tsx --format json --output-file $OUTPUT_DIR/eslint_output.json" +fi +# Run ESLint on JS/TS files +if [[ "${#js_files[@]}" -gt 0 && "${INPUT_JAVASCRIPT_SAST_ENABLED:-false}" == "true" ]]; then + echo "Running ESLint on JS/TS files: ${js_files[*]}" + eslint_cmd="npx --yes eslint --config $WORKSPACE/eslint.config.mjs ${js_files[*]} --ext .js,.jsx,.ts,.tsx --format json --output-file $TEMP_OUTPUT_DIR/eslint_output.json" if [[ -n "$ESLINT_EXCLUDE_DIR" ]]; then IFS=',' read -ra EXCLUDES <<< "$ESLINT_EXCLUDE_DIR" for exclude in "${EXCLUDES[@]}"; do eslint_cmd+=" --ignore-pattern $exclude" done fi - eval $eslint_cmd || : fi - -# Run Bandit (Python SAST) if enabled -if [[ "$INPUT_PYTHON_SAST_ENABLED" == "true" ]]; then - echo "Running Bandit" - bandit_cmd="bandit -r $GITHUB_WORKSPACE -f json -o /tmp/bandit_output.json" - if [[ -n "$BANDIT_EXCLUDE_DIR" ]]; then - bandit_cmd+=" --exclude $BANDIT_EXCLUDE_DIR" - fi - if [[ -n "$BANDIT_RULES" ]]; then - bandit_cmd+=" --skip $BANDIT_RULES" - fi - echo $bandit_cmd - eval $bandit_cmd || : -fi - -# Run Gosec (Golang SAST) if enabled -if [[ "$INPUT_GOLANG_SAST_ENABLED" == "true" ]]; then - echo "Running Gosec" - gosec_cmd="gosec -fmt json -out /tmp/gosec_output.json " - if [[ -n "$GOSEC_EXCLUDE_DIR" ]]; then - gosec_cmd+=" -exclude-dir=$GOSEC_EXCLUDE_DIR" - fi - if [[ -n "$GOSEC_RULES" ]]; then - gosec_cmd+=" -severity=$GOSEC_RULES" - fi - gosec_cmd+=" $GITHUB_WORKSPACE/..." - eval $gosec_cmd || : -fi - -# Run Trivy on Container Images if enabled -if [[ "$INPUT_TRIVY_IMAGE_ENABLED" == "true" ]]; then - echo "Running Trivy on Container Images" - IFS=',' read -ra DOCKER_IMAGES <<< "${INPUT_DOCKER_IMAGES}" - for image in "${DOCKER_IMAGES[@]}"; do - echo "Scanning image: $image" - trivy image --scanners vuln --format json --output "/tmp/trivy_image_${image//\//_}.json" "$image" || : - done -fi - -# Run Trivy on Dockerfiles if enabled -if [[ "$INPUT_TRIVY_DOCKERFILE_ENABLED" == "true" ]]; then - IFS=',' read -ra DOCKERFILES <<< "${INPUT_DOCKERFILES}" - for dockerfile in "${DOCKERFILES[@]}"; do - echo "Scanning Dockerfile: $dockerfile" - trivy config --format json --output "/tmp/trivy_dockerfile_${dockerfile//\//_}.json" "$GITHUB_WORKSPACE/$dockerfile" || : - done +# Move output files (no-op if already in correct place) +# Only cd in GitHub Actions, not local +if [ "$LOCAL_TESTING" != "true" ]; then + cd "$WORKSPACE" fi - -# Run Secret Scanning (Trufflehog) if enabled -if [[ "$INPUT_SECRET_SCANNING_ENABLED" == "true" ]]; then - echo "Running Secret Scanning with Trufflehog" - trufflehog_cmd="trufflehog filesystem " - TRUFFLEHOG_EXCLUDE_FILE=$(mktemp) - if [[ -n "$TRUFFLEHOG_EXCLUDE_DIR" ]]; then - IFS=',' read -ra EXCLUDE_DIRS <<< "$TRUFFLEHOG_EXCLUDE_DIR" - for dir in "${EXCLUDE_DIRS[@]}"; do - echo "$dir" >> "$TRUFFLEHOG_EXCLUDE_FILE" - done - trufflehog_cmd+=" -x $TRUFFLEHOG_EXCLUDE_FILE" - fi - if [[ -n "$TRUFFLEHOG_RULES" ]]; then - trufflehog_cmd+=" --rules $TRUFFLEHOG_RULES" - fi - trufflehog_cmd+=" --no-verification -j $GITHUB_WORKSPACE > /tmp/trufflehog_output.json" - eval $trufflehog_cmd || : +# Run the Python script from the correct directory and path +if [[ -n "$PY_SCRIPT_PATH" ]]; then + FINAL_PY_SCRIPT_PATH="$PY_SCRIPT_PATH" +elif [[ "$DEV_MODE" == "true" ]]; then + FINAL_PY_SCRIPT_PATH="$WORKSPACE/src/socket_external_tools_runner.py" +else + FINAL_PY_SCRIPT_PATH="$WORKSPACE/socket_external_tools_runner.py" fi -# Execute the custom Python script to process findings -if [ "$LOCAL_TESTING" != "true" ]; then - cd / -fi -mv /tmp/*.json . -if [ "$LOCAL_TESTING" != "true" ]; then - python socket_external_tools_runner.py +if [[ -f "$FINAL_PY_SCRIPT_PATH" ]]; then + python "$FINAL_PY_SCRIPT_PATH" else - python socket_external_tools_runner.py + echo "Error: Python script not found at $FINAL_PY_SCRIPT_PATH" >&2 + exit 1 fi diff --git a/node_modules/.bin/cli b/node_modules/.bin/cli new file mode 120000 index 0000000..cf9d2a7 --- /dev/null +++ b/node_modules/.bin/cli @@ -0,0 +1 @@ +../@coana-tech/cli/cli.mjs \ No newline at end of file diff --git a/node_modules/@coana-tech/cli/cli.mjs b/node_modules/@coana-tech/cli/cli.mjs new file mode 100755 index 0000000..c65f7ce --- /dev/null +++ b/node_modules/@coana-tech/cli/cli.mjs @@ -0,0 +1,212057 @@ +#!/usr/bin/env node +import { createRequire } from 'module'; const require = createRequire(import.meta.url); +const __dirname = (typeof import.meta.url === 'string' ? new URL('.', import.meta.url).pathname : ''); +const __filename = (typeof import.meta.url === 'string' ? import.meta.url : ''); +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __require = /* @__PURE__ */ ((x3) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x3, { + get: (a2, b) => (typeof require !== "undefined" ? require : a2)[b] +}) : x3)(function(x3) { + if (typeof require !== "undefined") return require.apply(this, arguments); + throw Error('Dynamic require of "' + x3 + '" is not supported'); +}); +var __esm = (fn2, res) => function __init() { + return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res; +}; +var __commonJS = (cb, mod) => function __require2() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all3) => { + for (var name in all3) + __defProp(target, name, { get: all3[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/error.js +var require_error = __commonJS({ + "../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/error.js"(exports2) { + var CommanderError2 = class extends Error { + /** + * Constructs the CommanderError class + * @param {number} exitCode suggested exit code which could be used with process.exit + * @param {string} code an id string representing the error + * @param {string} message human-readable description of the error + */ + constructor(exitCode, code, message2) { + super(message2); + Error.captureStackTrace(this, this.constructor); + this.name = this.constructor.name; + this.code = code; + this.exitCode = exitCode; + this.nestedError = void 0; + } + }; + var InvalidArgumentError2 = class extends CommanderError2 { + /** + * Constructs the InvalidArgumentError class + * @param {string} [message] explanation of why argument is invalid + */ + constructor(message2) { + super(1, "commander.invalidArgument", message2); + Error.captureStackTrace(this, this.constructor); + this.name = this.constructor.name; + } + }; + exports2.CommanderError = CommanderError2; + exports2.InvalidArgumentError = InvalidArgumentError2; + } +}); + +// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/argument.js +var require_argument = __commonJS({ + "../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/argument.js"(exports2) { + var { InvalidArgumentError: InvalidArgumentError2 } = require_error(); + var Argument2 = class { + /** + * Initialize a new command argument with the given name and description. + * The default is that the argument is required, and you can explicitly + * indicate this with <> around the name. Put [] around the name for an optional argument. + * + * @param {string} name + * @param {string} [description] + */ + constructor(name, description) { + this.description = description || ""; + this.variadic = false; + this.parseArg = void 0; + this.defaultValue = void 0; + this.defaultValueDescription = void 0; + this.argChoices = void 0; + switch (name[0]) { + case "<": + this.required = true; + this._name = name.slice(1, -1); + break; + case "[": + this.required = false; + this._name = name.slice(1, -1); + break; + default: + this.required = true; + this._name = name; + break; + } + if (this._name.length > 3 && this._name.slice(-3) === "...") { + this.variadic = true; + this._name = this._name.slice(0, -3); + } + } + /** + * Return argument name. + * + * @return {string} + */ + name() { + return this._name; + } + /** + * @package + */ + _concatValue(value, previous) { + if (previous === this.defaultValue || !Array.isArray(previous)) { + return [value]; + } + return previous.concat(value); + } + /** + * Set the default value, and optionally supply the description to be displayed in the help. + * + * @param {*} value + * @param {string} [description] + * @return {Argument} + */ + default(value, description) { + this.defaultValue = value; + this.defaultValueDescription = description; + return this; + } + /** + * Set the custom handler for processing CLI command arguments into argument values. + * + * @param {Function} [fn] + * @return {Argument} + */ + argParser(fn2) { + this.parseArg = fn2; + return this; + } + /** + * Only allow argument value to be one of choices. + * + * @param {string[]} values + * @return {Argument} + */ + choices(values) { + this.argChoices = values.slice(); + this.parseArg = (arg, previous) => { + if (!this.argChoices.includes(arg)) { + throw new InvalidArgumentError2( + `Allowed choices are ${this.argChoices.join(", ")}.` + ); + } + if (this.variadic) { + return this._concatValue(arg, previous); + } + return arg; + }; + return this; + } + /** + * Make argument required. + * + * @returns {Argument} + */ + argRequired() { + this.required = true; + return this; + } + /** + * Make argument optional. + * + * @returns {Argument} + */ + argOptional() { + this.required = false; + return this; + } + }; + function humanReadableArgName(arg) { + const nameOutput = arg.name() + (arg.variadic === true ? "..." : ""); + return arg.required ? "<" + nameOutput + ">" : "[" + nameOutput + "]"; + } + exports2.Argument = Argument2; + exports2.humanReadableArgName = humanReadableArgName; + } +}); + +// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/help.js +var require_help = __commonJS({ + "../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/help.js"(exports2) { + var { humanReadableArgName } = require_argument(); + var Help2 = class { + constructor() { + this.helpWidth = void 0; + this.sortSubcommands = false; + this.sortOptions = false; + this.showGlobalOptions = false; + } + /** + * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one. + * + * @param {Command} cmd + * @returns {Command[]} + */ + visibleCommands(cmd) { + const visibleCommands = cmd.commands.filter((cmd2) => !cmd2._hidden); + const helpCommand = cmd._getHelpCommand(); + if (helpCommand && !helpCommand._hidden) { + visibleCommands.push(helpCommand); + } + if (this.sortSubcommands) { + visibleCommands.sort((a2, b) => { + return a2.name().localeCompare(b.name()); + }); + } + return visibleCommands; + } + /** + * Compare options for sort. + * + * @param {Option} a + * @param {Option} b + * @returns {number} + */ + compareOptions(a2, b) { + const getSortKey = (option) => { + return option.short ? option.short.replace(/^-/, "") : option.long.replace(/^--/, ""); + }; + return getSortKey(a2).localeCompare(getSortKey(b)); + } + /** + * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one. + * + * @param {Command} cmd + * @returns {Option[]} + */ + visibleOptions(cmd) { + const visibleOptions = cmd.options.filter((option) => !option.hidden); + const helpOption = cmd._getHelpOption(); + if (helpOption && !helpOption.hidden) { + const removeShort = helpOption.short && cmd._findOption(helpOption.short); + const removeLong = helpOption.long && cmd._findOption(helpOption.long); + if (!removeShort && !removeLong) { + visibleOptions.push(helpOption); + } else if (helpOption.long && !removeLong) { + visibleOptions.push( + cmd.createOption(helpOption.long, helpOption.description) + ); + } else if (helpOption.short && !removeShort) { + visibleOptions.push( + cmd.createOption(helpOption.short, helpOption.description) + ); + } + } + if (this.sortOptions) { + visibleOptions.sort(this.compareOptions); + } + return visibleOptions; + } + /** + * Get an array of the visible global options. (Not including help.) + * + * @param {Command} cmd + * @returns {Option[]} + */ + visibleGlobalOptions(cmd) { + if (!this.showGlobalOptions) return []; + const globalOptions = []; + for (let ancestorCmd = cmd.parent; ancestorCmd; ancestorCmd = ancestorCmd.parent) { + const visibleOptions = ancestorCmd.options.filter( + (option) => !option.hidden + ); + globalOptions.push(...visibleOptions); + } + if (this.sortOptions) { + globalOptions.sort(this.compareOptions); + } + return globalOptions; + } + /** + * Get an array of the arguments if any have a description. + * + * @param {Command} cmd + * @returns {Argument[]} + */ + visibleArguments(cmd) { + if (cmd._argsDescription) { + cmd.registeredArguments.forEach((argument) => { + argument.description = argument.description || cmd._argsDescription[argument.name()] || ""; + }); + } + if (cmd.registeredArguments.find((argument) => argument.description)) { + return cmd.registeredArguments; + } + return []; + } + /** + * Get the command term to show in the list of subcommands. + * + * @param {Command} cmd + * @returns {string} + */ + subcommandTerm(cmd) { + const args2 = cmd.registeredArguments.map((arg) => humanReadableArgName(arg)).join(" "); + return cmd._name + (cmd._aliases[0] ? "|" + cmd._aliases[0] : "") + (cmd.options.length ? " [options]" : "") + // simplistic check for non-help option + (args2 ? " " + args2 : ""); + } + /** + * Get the option term to show in the list of options. + * + * @param {Option} option + * @returns {string} + */ + optionTerm(option) { + return option.flags; + } + /** + * Get the argument term to show in the list of arguments. + * + * @param {Argument} argument + * @returns {string} + */ + argumentTerm(argument) { + return argument.name(); + } + /** + * Get the longest command term length. + * + * @param {Command} cmd + * @param {Help} helper + * @returns {number} + */ + longestSubcommandTermLength(cmd, helper) { + return helper.visibleCommands(cmd).reduce((max, command) => { + return Math.max(max, helper.subcommandTerm(command).length); + }, 0); + } + /** + * Get the longest option term length. + * + * @param {Command} cmd + * @param {Help} helper + * @returns {number} + */ + longestOptionTermLength(cmd, helper) { + return helper.visibleOptions(cmd).reduce((max, option) => { + return Math.max(max, helper.optionTerm(option).length); + }, 0); + } + /** + * Get the longest global option term length. + * + * @param {Command} cmd + * @param {Help} helper + * @returns {number} + */ + longestGlobalOptionTermLength(cmd, helper) { + return helper.visibleGlobalOptions(cmd).reduce((max, option) => { + return Math.max(max, helper.optionTerm(option).length); + }, 0); + } + /** + * Get the longest argument term length. + * + * @param {Command} cmd + * @param {Help} helper + * @returns {number} + */ + longestArgumentTermLength(cmd, helper) { + return helper.visibleArguments(cmd).reduce((max, argument) => { + return Math.max(max, helper.argumentTerm(argument).length); + }, 0); + } + /** + * Get the command usage to be displayed at the top of the built-in help. + * + * @param {Command} cmd + * @returns {string} + */ + commandUsage(cmd) { + let cmdName = cmd._name; + if (cmd._aliases[0]) { + cmdName = cmdName + "|" + cmd._aliases[0]; + } + let ancestorCmdNames = ""; + for (let ancestorCmd = cmd.parent; ancestorCmd; ancestorCmd = ancestorCmd.parent) { + ancestorCmdNames = ancestorCmd.name() + " " + ancestorCmdNames; + } + return ancestorCmdNames + cmdName + " " + cmd.usage(); + } + /** + * Get the description for the command. + * + * @param {Command} cmd + * @returns {string} + */ + commandDescription(cmd) { + return cmd.description(); + } + /** + * Get the subcommand summary to show in the list of subcommands. + * (Fallback to description for backwards compatibility.) + * + * @param {Command} cmd + * @returns {string} + */ + subcommandDescription(cmd) { + return cmd.summary() || cmd.description(); + } + /** + * Get the option description to show in the list of options. + * + * @param {Option} option + * @return {string} + */ + optionDescription(option) { + const extraInfo = []; + if (option.argChoices) { + extraInfo.push( + // use stringify to match the display of the default value + `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(", ")}` + ); + } + if (option.defaultValue !== void 0) { + const showDefault = option.required || option.optional || option.isBoolean() && typeof option.defaultValue === "boolean"; + if (showDefault) { + extraInfo.push( + `default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}` + ); + } + } + if (option.presetArg !== void 0 && option.optional) { + extraInfo.push(`preset: ${JSON.stringify(option.presetArg)}`); + } + if (option.envVar !== void 0) { + extraInfo.push(`env: ${option.envVar}`); + } + if (extraInfo.length > 0) { + return `${option.description} (${extraInfo.join(", ")})`; + } + return option.description; + } + /** + * Get the argument description to show in the list of arguments. + * + * @param {Argument} argument + * @return {string} + */ + argumentDescription(argument) { + const extraInfo = []; + if (argument.argChoices) { + extraInfo.push( + // use stringify to match the display of the default value + `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(", ")}` + ); + } + if (argument.defaultValue !== void 0) { + extraInfo.push( + `default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}` + ); + } + if (extraInfo.length > 0) { + const extraDescripton = `(${extraInfo.join(", ")})`; + if (argument.description) { + return `${argument.description} ${extraDescripton}`; + } + return extraDescripton; + } + return argument.description; + } + /** + * Generate the built-in help text. + * + * @param {Command} cmd + * @param {Help} helper + * @returns {string} + */ + formatHelp(cmd, helper) { + const termWidth = helper.padWidth(cmd, helper); + const helpWidth = helper.helpWidth || 80; + const itemIndentWidth = 2; + const itemSeparatorWidth = 2; + function formatItem(term, description) { + if (description) { + const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`; + return helper.wrap( + fullText, + helpWidth - itemIndentWidth, + termWidth + itemSeparatorWidth + ); + } + return term; + } + function formatList(textArray) { + return textArray.join("\n").replace(/^/gm, " ".repeat(itemIndentWidth)); + } + let output = [`Usage: ${helper.commandUsage(cmd)}`, ""]; + const commandDescription = helper.commandDescription(cmd); + if (commandDescription.length > 0) { + output = output.concat([ + helper.wrap(commandDescription, helpWidth, 0), + "" + ]); + } + const argumentList = helper.visibleArguments(cmd).map((argument) => { + return formatItem( + helper.argumentTerm(argument), + helper.argumentDescription(argument) + ); + }); + if (argumentList.length > 0) { + output = output.concat(["Arguments:", formatList(argumentList), ""]); + } + const optionList = helper.visibleOptions(cmd).map((option) => { + return formatItem( + helper.optionTerm(option), + helper.optionDescription(option) + ); + }); + if (optionList.length > 0) { + output = output.concat(["Options:", formatList(optionList), ""]); + } + if (this.showGlobalOptions) { + const globalOptionList = helper.visibleGlobalOptions(cmd).map((option) => { + return formatItem( + helper.optionTerm(option), + helper.optionDescription(option) + ); + }); + if (globalOptionList.length > 0) { + output = output.concat([ + "Global Options:", + formatList(globalOptionList), + "" + ]); + } + } + const commandList = helper.visibleCommands(cmd).map((cmd2) => { + return formatItem( + helper.subcommandTerm(cmd2), + helper.subcommandDescription(cmd2) + ); + }); + if (commandList.length > 0) { + output = output.concat(["Commands:", formatList(commandList), ""]); + } + return output.join("\n"); + } + /** + * Calculate the pad width from the maximum term length. + * + * @param {Command} cmd + * @param {Help} helper + * @returns {number} + */ + padWidth(cmd, helper) { + return Math.max( + helper.longestOptionTermLength(cmd, helper), + helper.longestGlobalOptionTermLength(cmd, helper), + helper.longestSubcommandTermLength(cmd, helper), + helper.longestArgumentTermLength(cmd, helper) + ); + } + /** + * Wrap the given string to width characters per line, with lines after the first indented. + * Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted. + * + * @param {string} str + * @param {number} width + * @param {number} indent + * @param {number} [minColumnWidth=40] + * @return {string} + * + */ + wrap(str, width, indent, minColumnWidth = 40) { + const indents = " \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF"; + const manualIndent = new RegExp(`[\\n][${indents}]+`); + if (str.match(manualIndent)) return str; + const columnWidth = width - indent; + if (columnWidth < minColumnWidth) return str; + const leadingStr = str.slice(0, indent); + const columnText = str.slice(indent).replace("\r\n", "\n"); + const indentString = " ".repeat(indent); + const zeroWidthSpace = "\u200B"; + const breaks = `\\s${zeroWidthSpace}`; + const regex = new RegExp( + ` +|.{1,${columnWidth - 1}}([${breaks}]|$)|[^${breaks}]+?([${breaks}]|$)`, + "g" + ); + const lines = columnText.match(regex) || []; + return leadingStr + lines.map((line, i6) => { + if (line === "\n") return ""; + return (i6 > 0 ? indentString : "") + line.trimEnd(); + }).join("\n"); + } + }; + exports2.Help = Help2; + } +}); + +// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/option.js +var require_option = __commonJS({ + "../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/option.js"(exports2) { + var { InvalidArgumentError: InvalidArgumentError2 } = require_error(); + var Option2 = class { + /** + * Initialize a new `Option` with the given `flags` and `description`. + * + * @param {string} flags + * @param {string} [description] + */ + constructor(flags, description) { + this.flags = flags; + this.description = description || ""; + this.required = flags.includes("<"); + this.optional = flags.includes("["); + this.variadic = /\w\.\.\.[>\]]$/.test(flags); + this.mandatory = false; + const optionFlags = splitOptionFlags(flags); + this.short = optionFlags.shortFlag; + this.long = optionFlags.longFlag; + this.negate = false; + if (this.long) { + this.negate = this.long.startsWith("--no-"); + } + this.defaultValue = void 0; + this.defaultValueDescription = void 0; + this.presetArg = void 0; + this.envVar = void 0; + this.parseArg = void 0; + this.hidden = false; + this.argChoices = void 0; + this.conflictsWith = []; + this.implied = void 0; + } + /** + * Set the default value, and optionally supply the description to be displayed in the help. + * + * @param {*} value + * @param {string} [description] + * @return {Option} + */ + default(value, description) { + this.defaultValue = value; + this.defaultValueDescription = description; + return this; + } + /** + * Preset to use when option used without option-argument, especially optional but also boolean and negated. + * The custom processing (parseArg) is called. + * + * @example + * new Option('--color').default('GREYSCALE').preset('RGB'); + * new Option('--donate [amount]').preset('20').argParser(parseFloat); + * + * @param {*} arg + * @return {Option} + */ + preset(arg) { + this.presetArg = arg; + return this; + } + /** + * Add option name(s) that conflict with this option. + * An error will be displayed if conflicting options are found during parsing. + * + * @example + * new Option('--rgb').conflicts('cmyk'); + * new Option('--js').conflicts(['ts', 'jsx']); + * + * @param {(string | string[])} names + * @return {Option} + */ + conflicts(names) { + this.conflictsWith = this.conflictsWith.concat(names); + return this; + } + /** + * Specify implied option values for when this option is set and the implied options are not. + * + * The custom processing (parseArg) is not called on the implied values. + * + * @example + * program + * .addOption(new Option('--log', 'write logging information to file')) + * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' })); + * + * @param {object} impliedOptionValues + * @return {Option} + */ + implies(impliedOptionValues) { + let newImplied = impliedOptionValues; + if (typeof impliedOptionValues === "string") { + newImplied = { [impliedOptionValues]: true }; + } + this.implied = Object.assign(this.implied || {}, newImplied); + return this; + } + /** + * Set environment variable to check for option value. + * + * An environment variable is only used if when processed the current option value is + * undefined, or the source of the current value is 'default' or 'config' or 'env'. + * + * @param {string} name + * @return {Option} + */ + env(name) { + this.envVar = name; + return this; + } + /** + * Set the custom handler for processing CLI option arguments into option values. + * + * @param {Function} [fn] + * @return {Option} + */ + argParser(fn2) { + this.parseArg = fn2; + return this; + } + /** + * Whether the option is mandatory and must have a value after parsing. + * + * @param {boolean} [mandatory=true] + * @return {Option} + */ + makeOptionMandatory(mandatory = true) { + this.mandatory = !!mandatory; + return this; + } + /** + * Hide option in help. + * + * @param {boolean} [hide=true] + * @return {Option} + */ + hideHelp(hide = true) { + this.hidden = !!hide; + return this; + } + /** + * @package + */ + _concatValue(value, previous) { + if (previous === this.defaultValue || !Array.isArray(previous)) { + return [value]; + } + return previous.concat(value); + } + /** + * Only allow option value to be one of choices. + * + * @param {string[]} values + * @return {Option} + */ + choices(values) { + this.argChoices = values.slice(); + this.parseArg = (arg, previous) => { + if (!this.argChoices.includes(arg)) { + throw new InvalidArgumentError2( + `Allowed choices are ${this.argChoices.join(", ")}.` + ); + } + if (this.variadic) { + return this._concatValue(arg, previous); + } + return arg; + }; + return this; + } + /** + * Return option name. + * + * @return {string} + */ + name() { + if (this.long) { + return this.long.replace(/^--/, ""); + } + return this.short.replace(/^-/, ""); + } + /** + * Return option name, in a camelcase format that can be used + * as a object attribute key. + * + * @return {string} + */ + attributeName() { + return camelcase(this.name().replace(/^no-/, "")); + } + /** + * Check if `arg` matches the short or long flag. + * + * @param {string} arg + * @return {boolean} + * @package + */ + is(arg) { + return this.short === arg || this.long === arg; + } + /** + * Return whether a boolean option. + * + * Options are one of boolean, negated, required argument, or optional argument. + * + * @return {boolean} + * @package + */ + isBoolean() { + return !this.required && !this.optional && !this.negate; + } + }; + var DualOptions = class { + /** + * @param {Option[]} options + */ + constructor(options) { + this.positiveOptions = /* @__PURE__ */ new Map(); + this.negativeOptions = /* @__PURE__ */ new Map(); + this.dualOptions = /* @__PURE__ */ new Set(); + options.forEach((option) => { + if (option.negate) { + this.negativeOptions.set(option.attributeName(), option); + } else { + this.positiveOptions.set(option.attributeName(), option); + } + }); + this.negativeOptions.forEach((value, key) => { + if (this.positiveOptions.has(key)) { + this.dualOptions.add(key); + } + }); + } + /** + * Did the value come from the option, and not from possible matching dual option? + * + * @param {*} value + * @param {Option} option + * @returns {boolean} + */ + valueFromOption(value, option) { + const optionKey = option.attributeName(); + if (!this.dualOptions.has(optionKey)) return true; + const preset = this.negativeOptions.get(optionKey).presetArg; + const negativeValue = preset !== void 0 ? preset : false; + return option.negate === (negativeValue === value); + } + }; + function camelcase(str) { + return str.split("-").reduce((str2, word) => { + return str2 + word[0].toUpperCase() + word.slice(1); + }); + } + function splitOptionFlags(flags) { + let shortFlag; + let longFlag; + const flagParts = flags.split(/[ |,]+/); + if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1])) + shortFlag = flagParts.shift(); + longFlag = flagParts.shift(); + if (!shortFlag && /^-[^-]$/.test(longFlag)) { + shortFlag = longFlag; + longFlag = void 0; + } + return { shortFlag, longFlag }; + } + exports2.Option = Option2; + exports2.DualOptions = DualOptions; + } +}); + +// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/suggestSimilar.js +var require_suggestSimilar = __commonJS({ + "../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/suggestSimilar.js"(exports2) { + var maxDistance = 3; + function editDistance(a2, b) { + if (Math.abs(a2.length - b.length) > maxDistance) + return Math.max(a2.length, b.length); + const d3 = []; + for (let i6 = 0; i6 <= a2.length; i6++) { + d3[i6] = [i6]; + } + for (let j = 0; j <= b.length; j++) { + d3[0][j] = j; + } + for (let j = 1; j <= b.length; j++) { + for (let i6 = 1; i6 <= a2.length; i6++) { + let cost = 1; + if (a2[i6 - 1] === b[j - 1]) { + cost = 0; + } else { + cost = 1; + } + d3[i6][j] = Math.min( + d3[i6 - 1][j] + 1, + // deletion + d3[i6][j - 1] + 1, + // insertion + d3[i6 - 1][j - 1] + cost + // substitution + ); + if (i6 > 1 && j > 1 && a2[i6 - 1] === b[j - 2] && a2[i6 - 2] === b[j - 1]) { + d3[i6][j] = Math.min(d3[i6][j], d3[i6 - 2][j - 2] + 1); + } + } + } + return d3[a2.length][b.length]; + } + function suggestSimilar(word, candidates) { + if (!candidates || candidates.length === 0) return ""; + candidates = Array.from(new Set(candidates)); + const searchingOptions = word.startsWith("--"); + if (searchingOptions) { + word = word.slice(2); + candidates = candidates.map((candidate) => candidate.slice(2)); + } + let similar = []; + let bestDistance = maxDistance; + const minSimilarity = 0.4; + candidates.forEach((candidate) => { + if (candidate.length <= 1) return; + const distance = editDistance(word, candidate); + const length = Math.max(word.length, candidate.length); + const similarity = (length - distance) / length; + if (similarity > minSimilarity) { + if (distance < bestDistance) { + bestDistance = distance; + similar = [candidate]; + } else if (distance === bestDistance) { + similar.push(candidate); + } + } + }); + similar.sort((a2, b) => a2.localeCompare(b)); + if (searchingOptions) { + similar = similar.map((candidate) => `--${candidate}`); + } + if (similar.length > 1) { + return ` +(Did you mean one of ${similar.join(", ")}?)`; + } + if (similar.length === 1) { + return ` +(Did you mean ${similar[0]}?)`; + } + return ""; + } + exports2.suggestSimilar = suggestSimilar; + } +}); + +// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/command.js +var require_command = __commonJS({ + "../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/lib/command.js"(exports2) { + var EventEmitter3 = __require("node:events").EventEmitter; + var childProcess = __require("node:child_process"); + var path2 = __require("node:path"); + var fs = __require("node:fs"); + var process2 = __require("node:process"); + var { Argument: Argument2, humanReadableArgName } = require_argument(); + var { CommanderError: CommanderError2 } = require_error(); + var { Help: Help2 } = require_help(); + var { Option: Option2, DualOptions } = require_option(); + var { suggestSimilar } = require_suggestSimilar(); + var Command2 = class _Command extends EventEmitter3 { + /** + * Initialize a new `Command`. + * + * @param {string} [name] + */ + constructor(name) { + super(); + this.commands = []; + this.options = []; + this.parent = null; + this._allowUnknownOption = false; + this._allowExcessArguments = true; + this.registeredArguments = []; + this._args = this.registeredArguments; + this.args = []; + this.rawArgs = []; + this.processedArgs = []; + this._scriptPath = null; + this._name = name || ""; + this._optionValues = {}; + this._optionValueSources = {}; + this._storeOptionsAsProperties = false; + this._actionHandler = null; + this._executableHandler = false; + this._executableFile = null; + this._executableDir = null; + this._defaultCommandName = null; + this._exitCallback = null; + this._aliases = []; + this._combineFlagAndOptionalValue = true; + this._description = ""; + this._summary = ""; + this._argsDescription = void 0; + this._enablePositionalOptions = false; + this._passThroughOptions = false; + this._lifeCycleHooks = {}; + this._showHelpAfterError = false; + this._showSuggestionAfterError = true; + this._outputConfiguration = { + writeOut: (str) => process2.stdout.write(str), + writeErr: (str) => process2.stderr.write(str), + getOutHelpWidth: () => process2.stdout.isTTY ? process2.stdout.columns : void 0, + getErrHelpWidth: () => process2.stderr.isTTY ? process2.stderr.columns : void 0, + outputError: (str, write) => write(str) + }; + this._hidden = false; + this._helpOption = void 0; + this._addImplicitHelpCommand = void 0; + this._helpCommand = void 0; + this._helpConfiguration = {}; + } + /** + * Copy settings that are useful to have in common across root command and subcommands. + * + * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.) + * + * @param {Command} sourceCommand + * @return {Command} `this` command for chaining + */ + copyInheritedSettings(sourceCommand) { + this._outputConfiguration = sourceCommand._outputConfiguration; + this._helpOption = sourceCommand._helpOption; + this._helpCommand = sourceCommand._helpCommand; + this._helpConfiguration = sourceCommand._helpConfiguration; + this._exitCallback = sourceCommand._exitCallback; + this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties; + this._combineFlagAndOptionalValue = sourceCommand._combineFlagAndOptionalValue; + this._allowExcessArguments = sourceCommand._allowExcessArguments; + this._enablePositionalOptions = sourceCommand._enablePositionalOptions; + this._showHelpAfterError = sourceCommand._showHelpAfterError; + this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError; + return this; + } + /** + * @returns {Command[]} + * @private + */ + _getCommandAndAncestors() { + const result = []; + for (let command = this; command; command = command.parent) { + result.push(command); + } + return result; + } + /** + * Define a command. + * + * There are two styles of command: pay attention to where to put the description. + * + * @example + * // Command implemented using action handler (description is supplied separately to `.command`) + * program + * .command('clone [destination]') + * .description('clone a repository into a newly created directory') + * .action((source, destination) => { + * console.log('clone command called'); + * }); + * + * // Command implemented using separate executable file (description is second parameter to `.command`) + * program + * .command('start ', 'start named service') + * .command('stop [service]', 'stop named service, or all if no name supplied'); + * + * @param {string} nameAndArgs - command name and arguments, args are `` or `[optional]` and last may also be `variadic...` + * @param {(object | string)} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable) + * @param {object} [execOpts] - configuration options (for executable) + * @return {Command} returns new command for action handler, or `this` for executable command + */ + command(nameAndArgs, actionOptsOrExecDesc, execOpts) { + let desc = actionOptsOrExecDesc; + let opts = execOpts; + if (typeof desc === "object" && desc !== null) { + opts = desc; + desc = null; + } + opts = opts || {}; + const [, name, args2] = nameAndArgs.match(/([^ ]+) *(.*)/); + const cmd = this.createCommand(name); + if (desc) { + cmd.description(desc); + cmd._executableHandler = true; + } + if (opts.isDefault) this._defaultCommandName = cmd._name; + cmd._hidden = !!(opts.noHelp || opts.hidden); + cmd._executableFile = opts.executableFile || null; + if (args2) cmd.arguments(args2); + this._registerCommand(cmd); + cmd.parent = this; + cmd.copyInheritedSettings(this); + if (desc) return this; + return cmd; + } + /** + * Factory routine to create a new unattached command. + * + * See .command() for creating an attached subcommand, which uses this routine to + * create the command. You can override createCommand to customise subcommands. + * + * @param {string} [name] + * @return {Command} new command + */ + createCommand(name) { + return new _Command(name); + } + /** + * You can customise the help with a subclass of Help by overriding createHelp, + * or by overriding Help properties using configureHelp(). + * + * @return {Help} + */ + createHelp() { + return Object.assign(new Help2(), this.configureHelp()); + } + /** + * You can customise the help by overriding Help properties using configureHelp(), + * or with a subclass of Help by overriding createHelp(). + * + * @param {object} [configuration] - configuration options + * @return {(Command | object)} `this` command for chaining, or stored configuration + */ + configureHelp(configuration) { + if (configuration === void 0) return this._helpConfiguration; + this._helpConfiguration = configuration; + return this; + } + /** + * The default output goes to stdout and stderr. You can customise this for special + * applications. You can also customise the display of errors by overriding outputError. + * + * The configuration properties are all functions: + * + * // functions to change where being written, stdout and stderr + * writeOut(str) + * writeErr(str) + * // matching functions to specify width for wrapping help + * getOutHelpWidth() + * getErrHelpWidth() + * // functions based on what is being written out + * outputError(str, write) // used for displaying errors, and not used for displaying help + * + * @param {object} [configuration] - configuration options + * @return {(Command | object)} `this` command for chaining, or stored configuration + */ + configureOutput(configuration) { + if (configuration === void 0) return this._outputConfiguration; + Object.assign(this._outputConfiguration, configuration); + return this; + } + /** + * Display the help or a custom message after an error occurs. + * + * @param {(boolean|string)} [displayHelp] + * @return {Command} `this` command for chaining + */ + showHelpAfterError(displayHelp = true) { + if (typeof displayHelp !== "string") displayHelp = !!displayHelp; + this._showHelpAfterError = displayHelp; + return this; + } + /** + * Display suggestion of similar commands for unknown commands, or options for unknown options. + * + * @param {boolean} [displaySuggestion] + * @return {Command} `this` command for chaining + */ + showSuggestionAfterError(displaySuggestion = true) { + this._showSuggestionAfterError = !!displaySuggestion; + return this; + } + /** + * Add a prepared subcommand. + * + * See .command() for creating an attached subcommand which inherits settings from its parent. + * + * @param {Command} cmd - new subcommand + * @param {object} [opts] - configuration options + * @return {Command} `this` command for chaining + */ + addCommand(cmd, opts) { + if (!cmd._name) { + throw new Error(`Command passed to .addCommand() must have a name +- specify the name in Command constructor or using .name()`); + } + opts = opts || {}; + if (opts.isDefault) this._defaultCommandName = cmd._name; + if (opts.noHelp || opts.hidden) cmd._hidden = true; + this._registerCommand(cmd); + cmd.parent = this; + cmd._checkForBrokenPassThrough(); + return this; + } + /** + * Factory routine to create a new unattached argument. + * + * See .argument() for creating an attached argument, which uses this routine to + * create the argument. You can override createArgument to return a custom argument. + * + * @param {string} name + * @param {string} [description] + * @return {Argument} new argument + */ + createArgument(name, description) { + return new Argument2(name, description); + } + /** + * Define argument syntax for command. + * + * The default is that the argument is required, and you can explicitly + * indicate this with <> around the name. Put [] around the name for an optional argument. + * + * @example + * program.argument(''); + * program.argument('[output-file]'); + * + * @param {string} name + * @param {string} [description] + * @param {(Function|*)} [fn] - custom argument processing function + * @param {*} [defaultValue] + * @return {Command} `this` command for chaining + */ + argument(name, description, fn2, defaultValue) { + const argument = this.createArgument(name, description); + if (typeof fn2 === "function") { + argument.default(defaultValue).argParser(fn2); + } else { + argument.default(fn2); + } + this.addArgument(argument); + return this; + } + /** + * Define argument syntax for command, adding multiple at once (without descriptions). + * + * See also .argument(). + * + * @example + * program.arguments(' [env]'); + * + * @param {string} names + * @return {Command} `this` command for chaining + */ + arguments(names) { + names.trim().split(/ +/).forEach((detail) => { + this.argument(detail); + }); + return this; + } + /** + * Define argument syntax for command, adding a prepared argument. + * + * @param {Argument} argument + * @return {Command} `this` command for chaining + */ + addArgument(argument) { + const previousArgument = this.registeredArguments.slice(-1)[0]; + if (previousArgument && previousArgument.variadic) { + throw new Error( + `only the last argument can be variadic '${previousArgument.name()}'` + ); + } + if (argument.required && argument.defaultValue !== void 0 && argument.parseArg === void 0) { + throw new Error( + `a default value for a required argument is never used: '${argument.name()}'` + ); + } + this.registeredArguments.push(argument); + return this; + } + /** + * Customise or override default help command. By default a help command is automatically added if your command has subcommands. + * + * @example + * program.helpCommand('help [cmd]'); + * program.helpCommand('help [cmd]', 'show help'); + * program.helpCommand(false); // suppress default help command + * program.helpCommand(true); // add help command even if no subcommands + * + * @param {string|boolean} enableOrNameAndArgs - enable with custom name and/or arguments, or boolean to override whether added + * @param {string} [description] - custom description + * @return {Command} `this` command for chaining + */ + helpCommand(enableOrNameAndArgs, description) { + if (typeof enableOrNameAndArgs === "boolean") { + this._addImplicitHelpCommand = enableOrNameAndArgs; + return this; + } + enableOrNameAndArgs = enableOrNameAndArgs ?? "help [command]"; + const [, helpName, helpArgs] = enableOrNameAndArgs.match(/([^ ]+) *(.*)/); + const helpDescription = description ?? "display help for command"; + const helpCommand = this.createCommand(helpName); + helpCommand.helpOption(false); + if (helpArgs) helpCommand.arguments(helpArgs); + if (helpDescription) helpCommand.description(helpDescription); + this._addImplicitHelpCommand = true; + this._helpCommand = helpCommand; + return this; + } + /** + * Add prepared custom help command. + * + * @param {(Command|string|boolean)} helpCommand - custom help command, or deprecated enableOrNameAndArgs as for `.helpCommand()` + * @param {string} [deprecatedDescription] - deprecated custom description used with custom name only + * @return {Command} `this` command for chaining + */ + addHelpCommand(helpCommand, deprecatedDescription) { + if (typeof helpCommand !== "object") { + this.helpCommand(helpCommand, deprecatedDescription); + return this; + } + this._addImplicitHelpCommand = true; + this._helpCommand = helpCommand; + return this; + } + /** + * Lazy create help command. + * + * @return {(Command|null)} + * @package + */ + _getHelpCommand() { + const hasImplicitHelpCommand = this._addImplicitHelpCommand ?? (this.commands.length && !this._actionHandler && !this._findCommand("help")); + if (hasImplicitHelpCommand) { + if (this._helpCommand === void 0) { + this.helpCommand(void 0, void 0); + } + return this._helpCommand; + } + return null; + } + /** + * Add hook for life cycle event. + * + * @param {string} event + * @param {Function} listener + * @return {Command} `this` command for chaining + */ + hook(event, listener) { + const allowedValues = ["preSubcommand", "preAction", "postAction"]; + if (!allowedValues.includes(event)) { + throw new Error(`Unexpected value for event passed to hook : '${event}'. +Expecting one of '${allowedValues.join("', '")}'`); + } + if (this._lifeCycleHooks[event]) { + this._lifeCycleHooks[event].push(listener); + } else { + this._lifeCycleHooks[event] = [listener]; + } + return this; + } + /** + * Register callback to use as replacement for calling process.exit. + * + * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing + * @return {Command} `this` command for chaining + */ + exitOverride(fn2) { + if (fn2) { + this._exitCallback = fn2; + } else { + this._exitCallback = (err) => { + if (err.code !== "commander.executeSubCommandAsync") { + throw err; + } else { + } + }; + } + return this; + } + /** + * Call process.exit, and _exitCallback if defined. + * + * @param {number} exitCode exit code for using with process.exit + * @param {string} code an id string representing the error + * @param {string} message human-readable description of the error + * @return never + * @private + */ + _exit(exitCode, code, message2) { + if (this._exitCallback) { + this._exitCallback(new CommanderError2(exitCode, code, message2)); + } + process2.exit(exitCode); + } + /** + * Register callback `fn` for the command. + * + * @example + * program + * .command('serve') + * .description('start service') + * .action(function() { + * // do work here + * }); + * + * @param {Function} fn + * @return {Command} `this` command for chaining + */ + action(fn2) { + const listener = (args2) => { + const expectedArgsCount = this.registeredArguments.length; + const actionArgs = args2.slice(0, expectedArgsCount); + if (this._storeOptionsAsProperties) { + actionArgs[expectedArgsCount] = this; + } else { + actionArgs[expectedArgsCount] = this.opts(); + } + actionArgs.push(this); + return fn2.apply(this, actionArgs); + }; + this._actionHandler = listener; + return this; + } + /** + * Factory routine to create a new unattached option. + * + * See .option() for creating an attached option, which uses this routine to + * create the option. You can override createOption to return a custom option. + * + * @param {string} flags + * @param {string} [description] + * @return {Option} new option + */ + createOption(flags, description) { + return new Option2(flags, description); + } + /** + * Wrap parseArgs to catch 'commander.invalidArgument'. + * + * @param {(Option | Argument)} target + * @param {string} value + * @param {*} previous + * @param {string} invalidArgumentMessage + * @private + */ + _callParseArg(target, value, previous, invalidArgumentMessage) { + try { + return target.parseArg(value, previous); + } catch (err) { + if (err.code === "commander.invalidArgument") { + const message2 = `${invalidArgumentMessage} ${err.message}`; + this.error(message2, { exitCode: err.exitCode, code: err.code }); + } + throw err; + } + } + /** + * Check for option flag conflicts. + * Register option if no conflicts found, or throw on conflict. + * + * @param {Option} option + * @private + */ + _registerOption(option) { + const matchingOption = option.short && this._findOption(option.short) || option.long && this._findOption(option.long); + if (matchingOption) { + const matchingFlag = option.long && this._findOption(option.long) ? option.long : option.short; + throw new Error(`Cannot add option '${option.flags}'${this._name && ` to command '${this._name}'`} due to conflicting flag '${matchingFlag}' +- already used by option '${matchingOption.flags}'`); + } + this.options.push(option); + } + /** + * Check for command name and alias conflicts with existing commands. + * Register command if no conflicts found, or throw on conflict. + * + * @param {Command} command + * @private + */ + _registerCommand(command) { + const knownBy = (cmd) => { + return [cmd.name()].concat(cmd.aliases()); + }; + const alreadyUsed = knownBy(command).find( + (name) => this._findCommand(name) + ); + if (alreadyUsed) { + const existingCmd = knownBy(this._findCommand(alreadyUsed)).join("|"); + const newCmd = knownBy(command).join("|"); + throw new Error( + `cannot add command '${newCmd}' as already have command '${existingCmd}'` + ); + } + this.commands.push(command); + } + /** + * Add an option. + * + * @param {Option} option + * @return {Command} `this` command for chaining + */ + addOption(option) { + this._registerOption(option); + const oname = option.name(); + const name = option.attributeName(); + if (option.negate) { + const positiveLongFlag = option.long.replace(/^--no-/, "--"); + if (!this._findOption(positiveLongFlag)) { + this.setOptionValueWithSource( + name, + option.defaultValue === void 0 ? true : option.defaultValue, + "default" + ); + } + } else if (option.defaultValue !== void 0) { + this.setOptionValueWithSource(name, option.defaultValue, "default"); + } + const handleOptionValue = (val2, invalidValueMessage, valueSource) => { + if (val2 == null && option.presetArg !== void 0) { + val2 = option.presetArg; + } + const oldValue = this.getOptionValue(name); + if (val2 !== null && option.parseArg) { + val2 = this._callParseArg(option, val2, oldValue, invalidValueMessage); + } else if (val2 !== null && option.variadic) { + val2 = option._concatValue(val2, oldValue); + } + if (val2 == null) { + if (option.negate) { + val2 = false; + } else if (option.isBoolean() || option.optional) { + val2 = true; + } else { + val2 = ""; + } + } + this.setOptionValueWithSource(name, val2, valueSource); + }; + this.on("option:" + oname, (val2) => { + const invalidValueMessage = `error: option '${option.flags}' argument '${val2}' is invalid.`; + handleOptionValue(val2, invalidValueMessage, "cli"); + }); + if (option.envVar) { + this.on("optionEnv:" + oname, (val2) => { + const invalidValueMessage = `error: option '${option.flags}' value '${val2}' from env '${option.envVar}' is invalid.`; + handleOptionValue(val2, invalidValueMessage, "env"); + }); + } + return this; + } + /** + * Internal implementation shared by .option() and .requiredOption() + * + * @return {Command} `this` command for chaining + * @private + */ + _optionEx(config3, flags, description, fn2, defaultValue) { + if (typeof flags === "object" && flags instanceof Option2) { + throw new Error( + "To add an Option object use addOption() instead of option() or requiredOption()" + ); + } + const option = this.createOption(flags, description); + option.makeOptionMandatory(!!config3.mandatory); + if (typeof fn2 === "function") { + option.default(defaultValue).argParser(fn2); + } else if (fn2 instanceof RegExp) { + const regex = fn2; + fn2 = (val2, def) => { + const m2 = regex.exec(val2); + return m2 ? m2[0] : def; + }; + option.default(defaultValue).argParser(fn2); + } else { + option.default(fn2); + } + return this.addOption(option); + } + /** + * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both. + * + * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required + * option-argument is indicated by `<>` and an optional option-argument by `[]`. + * + * See the README for more details, and see also addOption() and requiredOption(). + * + * @example + * program + * .option('-p, --pepper', 'add pepper') + * .option('-p, --pizza-type ', 'type of pizza') // required option-argument + * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default + * .option('-t, --tip ', 'add tip to purchase cost', parseFloat) // custom parse function + * + * @param {string} flags + * @param {string} [description] + * @param {(Function|*)} [parseArg] - custom option processing function or default value + * @param {*} [defaultValue] + * @return {Command} `this` command for chaining + */ + option(flags, description, parseArg, defaultValue) { + return this._optionEx({}, flags, description, parseArg, defaultValue); + } + /** + * Add a required option which must have a value after parsing. This usually means + * the option must be specified on the command line. (Otherwise the same as .option().) + * + * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. + * + * @param {string} flags + * @param {string} [description] + * @param {(Function|*)} [parseArg] - custom option processing function or default value + * @param {*} [defaultValue] + * @return {Command} `this` command for chaining + */ + requiredOption(flags, description, parseArg, defaultValue) { + return this._optionEx( + { mandatory: true }, + flags, + description, + parseArg, + defaultValue + ); + } + /** + * Alter parsing of short flags with optional values. + * + * @example + * // for `.option('-f,--flag [value]'): + * program.combineFlagAndOptionalValue(true); // `-f80` is treated like `--flag=80`, this is the default behaviour + * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b` + * + * @param {boolean} [combine] - if `true` or omitted, an optional value can be specified directly after the flag. + * @return {Command} `this` command for chaining + */ + combineFlagAndOptionalValue(combine = true) { + this._combineFlagAndOptionalValue = !!combine; + return this; + } + /** + * Allow unknown options on the command line. + * + * @param {boolean} [allowUnknown] - if `true` or omitted, no error will be thrown for unknown options. + * @return {Command} `this` command for chaining + */ + allowUnknownOption(allowUnknown = true) { + this._allowUnknownOption = !!allowUnknown; + return this; + } + /** + * Allow excess command-arguments on the command line. Pass false to make excess arguments an error. + * + * @param {boolean} [allowExcess] - if `true` or omitted, no error will be thrown for excess arguments. + * @return {Command} `this` command for chaining + */ + allowExcessArguments(allowExcess = true) { + this._allowExcessArguments = !!allowExcess; + return this; + } + /** + * Enable positional options. Positional means global options are specified before subcommands which lets + * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions. + * The default behaviour is non-positional and global options may appear anywhere on the command line. + * + * @param {boolean} [positional] + * @return {Command} `this` command for chaining + */ + enablePositionalOptions(positional = true) { + this._enablePositionalOptions = !!positional; + return this; + } + /** + * Pass through options that come after command-arguments rather than treat them as command-options, + * so actual command-options come before command-arguments. Turning this on for a subcommand requires + * positional options to have been enabled on the program (parent commands). + * The default behaviour is non-positional and options may appear before or after command-arguments. + * + * @param {boolean} [passThrough] for unknown options. + * @return {Command} `this` command for chaining + */ + passThroughOptions(passThrough = true) { + this._passThroughOptions = !!passThrough; + this._checkForBrokenPassThrough(); + return this; + } + /** + * @private + */ + _checkForBrokenPassThrough() { + if (this.parent && this._passThroughOptions && !this.parent._enablePositionalOptions) { + throw new Error( + `passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)` + ); + } + } + /** + * Whether to store option values as properties on command object, + * or store separately (specify false). In both cases the option values can be accessed using .opts(). + * + * @param {boolean} [storeAsProperties=true] + * @return {Command} `this` command for chaining + */ + storeOptionsAsProperties(storeAsProperties = true) { + if (this.options.length) { + throw new Error("call .storeOptionsAsProperties() before adding options"); + } + if (Object.keys(this._optionValues).length) { + throw new Error( + "call .storeOptionsAsProperties() before setting option values" + ); + } + this._storeOptionsAsProperties = !!storeAsProperties; + return this; + } + /** + * Retrieve option value. + * + * @param {string} key + * @return {object} value + */ + getOptionValue(key) { + if (this._storeOptionsAsProperties) { + return this[key]; + } + return this._optionValues[key]; + } + /** + * Store option value. + * + * @param {string} key + * @param {object} value + * @return {Command} `this` command for chaining + */ + setOptionValue(key, value) { + return this.setOptionValueWithSource(key, value, void 0); + } + /** + * Store option value and where the value came from. + * + * @param {string} key + * @param {object} value + * @param {string} source - expected values are default/config/env/cli/implied + * @return {Command} `this` command for chaining + */ + setOptionValueWithSource(key, value, source) { + if (this._storeOptionsAsProperties) { + this[key] = value; + } else { + this._optionValues[key] = value; + } + this._optionValueSources[key] = source; + return this; + } + /** + * Get source of option value. + * Expected values are default | config | env | cli | implied + * + * @param {string} key + * @return {string} + */ + getOptionValueSource(key) { + return this._optionValueSources[key]; + } + /** + * Get source of option value. See also .optsWithGlobals(). + * Expected values are default | config | env | cli | implied + * + * @param {string} key + * @return {string} + */ + getOptionValueSourceWithGlobals(key) { + let source; + this._getCommandAndAncestors().forEach((cmd) => { + if (cmd.getOptionValueSource(key) !== void 0) { + source = cmd.getOptionValueSource(key); + } + }); + return source; + } + /** + * Get user arguments from implied or explicit arguments. + * Side-effects: set _scriptPath if args included script. Used for default program name, and subcommand searches. + * + * @private + */ + _prepareUserArgs(argv, parseOptions) { + if (argv !== void 0 && !Array.isArray(argv)) { + throw new Error("first parameter to parse must be array or undefined"); + } + parseOptions = parseOptions || {}; + if (argv === void 0 && parseOptions.from === void 0) { + if (process2.versions?.electron) { + parseOptions.from = "electron"; + } + const execArgv = process2.execArgv ?? []; + if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) { + parseOptions.from = "eval"; + } + } + if (argv === void 0) { + argv = process2.argv; + } + this.rawArgs = argv.slice(); + let userArgs; + switch (parseOptions.from) { + case void 0: + case "node": + this._scriptPath = argv[1]; + userArgs = argv.slice(2); + break; + case "electron": + if (process2.defaultApp) { + this._scriptPath = argv[1]; + userArgs = argv.slice(2); + } else { + userArgs = argv.slice(1); + } + break; + case "user": + userArgs = argv.slice(0); + break; + case "eval": + userArgs = argv.slice(1); + break; + default: + throw new Error( + `unexpected parse option { from: '${parseOptions.from}' }` + ); + } + if (!this._name && this._scriptPath) + this.nameFromFilename(this._scriptPath); + this._name = this._name || "program"; + return userArgs; + } + /** + * Parse `argv`, setting options and invoking commands when defined. + * + * Use parseAsync instead of parse if any of your action handlers are async. + * + * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode! + * + * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`: + * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that + * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged + * - `'user'`: just user arguments + * + * @example + * program.parse(); // parse process.argv and auto-detect electron and special node flags + * program.parse(process.argv); // assume argv[0] is app and argv[1] is script + * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0] + * + * @param {string[]} [argv] - optional, defaults to process.argv + * @param {object} [parseOptions] - optionally specify style of options with from: node/user/electron + * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron' + * @return {Command} `this` command for chaining + */ + parse(argv, parseOptions) { + const userArgs = this._prepareUserArgs(argv, parseOptions); + this._parseCommand([], userArgs); + return this; + } + /** + * Parse `argv`, setting options and invoking commands when defined. + * + * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode! + * + * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`: + * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that + * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged + * - `'user'`: just user arguments + * + * @example + * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags + * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script + * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0] + * + * @param {string[]} [argv] + * @param {object} [parseOptions] + * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron' + * @return {Promise} + */ + async parseAsync(argv, parseOptions) { + const userArgs = this._prepareUserArgs(argv, parseOptions); + await this._parseCommand([], userArgs); + return this; + } + /** + * Execute a sub-command executable. + * + * @private + */ + _executeSubCommand(subcommand, args2) { + args2 = args2.slice(); + let launchWithNode = false; + const sourceExt = [".js", ".ts", ".tsx", ".mjs", ".cjs"]; + function findFile(baseDir, baseName) { + const localBin = path2.resolve(baseDir, baseName); + if (fs.existsSync(localBin)) return localBin; + if (sourceExt.includes(path2.extname(baseName))) return void 0; + const foundExt = sourceExt.find( + (ext2) => fs.existsSync(`${localBin}${ext2}`) + ); + if (foundExt) return `${localBin}${foundExt}`; + return void 0; + } + this._checkForMissingMandatoryOptions(); + this._checkForConflictingOptions(); + let executableFile = subcommand._executableFile || `${this._name}-${subcommand._name}`; + let executableDir = this._executableDir || ""; + if (this._scriptPath) { + let resolvedScriptPath; + try { + resolvedScriptPath = fs.realpathSync(this._scriptPath); + } catch (err) { + resolvedScriptPath = this._scriptPath; + } + executableDir = path2.resolve( + path2.dirname(resolvedScriptPath), + executableDir + ); + } + if (executableDir) { + let localFile = findFile(executableDir, executableFile); + if (!localFile && !subcommand._executableFile && this._scriptPath) { + const legacyName = path2.basename( + this._scriptPath, + path2.extname(this._scriptPath) + ); + if (legacyName !== this._name) { + localFile = findFile( + executableDir, + `${legacyName}-${subcommand._name}` + ); + } + } + executableFile = localFile || executableFile; + } + launchWithNode = sourceExt.includes(path2.extname(executableFile)); + let proc2; + if (process2.platform !== "win32") { + if (launchWithNode) { + args2.unshift(executableFile); + args2 = incrementNodeInspectorPort(process2.execArgv).concat(args2); + proc2 = childProcess.spawn(process2.argv[0], args2, { stdio: "inherit" }); + } else { + proc2 = childProcess.spawn(executableFile, args2, { stdio: "inherit" }); + } + } else { + args2.unshift(executableFile); + args2 = incrementNodeInspectorPort(process2.execArgv).concat(args2); + proc2 = childProcess.spawn(process2.execPath, args2, { stdio: "inherit" }); + } + if (!proc2.killed) { + const signals = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"]; + signals.forEach((signal) => { + process2.on(signal, () => { + if (proc2.killed === false && proc2.exitCode === null) { + proc2.kill(signal); + } + }); + }); + } + const exitCallback = this._exitCallback; + proc2.on("close", (code) => { + code = code ?? 1; + if (!exitCallback) { + process2.exit(code); + } else { + exitCallback( + new CommanderError2( + code, + "commander.executeSubCommandAsync", + "(close)" + ) + ); + } + }); + proc2.on("error", (err) => { + if (err.code === "ENOENT") { + const executableDirMessage = executableDir ? `searched for local subcommand relative to directory '${executableDir}'` : "no directory for search for local subcommand, use .executableDir() to supply a custom directory"; + const executableMissing = `'${executableFile}' does not exist + - if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead + - if the default executable name is not suitable, use the executableFile option to supply a custom name or path + - ${executableDirMessage}`; + throw new Error(executableMissing); + } else if (err.code === "EACCES") { + throw new Error(`'${executableFile}' not executable`); + } + if (!exitCallback) { + process2.exit(1); + } else { + const wrappedError = new CommanderError2( + 1, + "commander.executeSubCommandAsync", + "(error)" + ); + wrappedError.nestedError = err; + exitCallback(wrappedError); + } + }); + this.runningCommand = proc2; + } + /** + * @private + */ + _dispatchSubcommand(commandName, operands, unknown) { + const subCommand = this._findCommand(commandName); + if (!subCommand) this.help({ error: true }); + let promiseChain; + promiseChain = this._chainOrCallSubCommandHook( + promiseChain, + subCommand, + "preSubcommand" + ); + promiseChain = this._chainOrCall(promiseChain, () => { + if (subCommand._executableHandler) { + this._executeSubCommand(subCommand, operands.concat(unknown)); + } else { + return subCommand._parseCommand(operands, unknown); + } + }); + return promiseChain; + } + /** + * Invoke help directly if possible, or dispatch if necessary. + * e.g. help foo + * + * @private + */ + _dispatchHelpCommand(subcommandName) { + if (!subcommandName) { + this.help(); + } + const subCommand = this._findCommand(subcommandName); + if (subCommand && !subCommand._executableHandler) { + subCommand.help(); + } + return this._dispatchSubcommand( + subcommandName, + [], + [this._getHelpOption()?.long ?? this._getHelpOption()?.short ?? "--help"] + ); + } + /** + * Check this.args against expected this.registeredArguments. + * + * @private + */ + _checkNumberOfArguments() { + this.registeredArguments.forEach((arg, i6) => { + if (arg.required && this.args[i6] == null) { + this.missingArgument(arg.name()); + } + }); + if (this.registeredArguments.length > 0 && this.registeredArguments[this.registeredArguments.length - 1].variadic) { + return; + } + if (this.args.length > this.registeredArguments.length) { + this._excessArguments(this.args); + } + } + /** + * Process this.args using this.registeredArguments and save as this.processedArgs! + * + * @private + */ + _processArguments() { + const myParseArg = (argument, value, previous) => { + let parsedValue = value; + if (value !== null && argument.parseArg) { + const invalidValueMessage = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'.`; + parsedValue = this._callParseArg( + argument, + value, + previous, + invalidValueMessage + ); + } + return parsedValue; + }; + this._checkNumberOfArguments(); + const processedArgs = []; + this.registeredArguments.forEach((declaredArg, index2) => { + let value = declaredArg.defaultValue; + if (declaredArg.variadic) { + if (index2 < this.args.length) { + value = this.args.slice(index2); + if (declaredArg.parseArg) { + value = value.reduce((processed, v) => { + return myParseArg(declaredArg, v, processed); + }, declaredArg.defaultValue); + } + } else if (value === void 0) { + value = []; + } + } else if (index2 < this.args.length) { + value = this.args[index2]; + if (declaredArg.parseArg) { + value = myParseArg(declaredArg, value, declaredArg.defaultValue); + } + } + processedArgs[index2] = value; + }); + this.processedArgs = processedArgs; + } + /** + * Once we have a promise we chain, but call synchronously until then. + * + * @param {(Promise|undefined)} promise + * @param {Function} fn + * @return {(Promise|undefined)} + * @private + */ + _chainOrCall(promise, fn2) { + if (promise && promise.then && typeof promise.then === "function") { + return promise.then(() => fn2()); + } + return fn2(); + } + /** + * + * @param {(Promise|undefined)} promise + * @param {string} event + * @return {(Promise|undefined)} + * @private + */ + _chainOrCallHooks(promise, event) { + let result = promise; + const hooks = []; + this._getCommandAndAncestors().reverse().filter((cmd) => cmd._lifeCycleHooks[event] !== void 0).forEach((hookedCommand) => { + hookedCommand._lifeCycleHooks[event].forEach((callback) => { + hooks.push({ hookedCommand, callback }); + }); + }); + if (event === "postAction") { + hooks.reverse(); + } + hooks.forEach((hookDetail) => { + result = this._chainOrCall(result, () => { + return hookDetail.callback(hookDetail.hookedCommand, this); + }); + }); + return result; + } + /** + * + * @param {(Promise|undefined)} promise + * @param {Command} subCommand + * @param {string} event + * @return {(Promise|undefined)} + * @private + */ + _chainOrCallSubCommandHook(promise, subCommand, event) { + let result = promise; + if (this._lifeCycleHooks[event] !== void 0) { + this._lifeCycleHooks[event].forEach((hook) => { + result = this._chainOrCall(result, () => { + return hook(this, subCommand); + }); + }); + } + return result; + } + /** + * Process arguments in context of this command. + * Returns action result, in case it is a promise. + * + * @private + */ + _parseCommand(operands, unknown) { + const parsed = this.parseOptions(unknown); + this._parseOptionsEnv(); + this._parseOptionsImplied(); + operands = operands.concat(parsed.operands); + unknown = parsed.unknown; + this.args = operands.concat(unknown); + if (operands && this._findCommand(operands[0])) { + return this._dispatchSubcommand(operands[0], operands.slice(1), unknown); + } + if (this._getHelpCommand() && operands[0] === this._getHelpCommand().name()) { + return this._dispatchHelpCommand(operands[1]); + } + if (this._defaultCommandName) { + this._outputHelpIfRequested(unknown); + return this._dispatchSubcommand( + this._defaultCommandName, + operands, + unknown + ); + } + if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) { + this.help({ error: true }); + } + this._outputHelpIfRequested(parsed.unknown); + this._checkForMissingMandatoryOptions(); + this._checkForConflictingOptions(); + const checkForUnknownOptions = () => { + if (parsed.unknown.length > 0) { + this.unknownOption(parsed.unknown[0]); + } + }; + const commandEvent = `command:${this.name()}`; + if (this._actionHandler) { + checkForUnknownOptions(); + this._processArguments(); + let promiseChain; + promiseChain = this._chainOrCallHooks(promiseChain, "preAction"); + promiseChain = this._chainOrCall( + promiseChain, + () => this._actionHandler(this.processedArgs) + ); + if (this.parent) { + promiseChain = this._chainOrCall(promiseChain, () => { + this.parent.emit(commandEvent, operands, unknown); + }); + } + promiseChain = this._chainOrCallHooks(promiseChain, "postAction"); + return promiseChain; + } + if (this.parent && this.parent.listenerCount(commandEvent)) { + checkForUnknownOptions(); + this._processArguments(); + this.parent.emit(commandEvent, operands, unknown); + } else if (operands.length) { + if (this._findCommand("*")) { + return this._dispatchSubcommand("*", operands, unknown); + } + if (this.listenerCount("command:*")) { + this.emit("command:*", operands, unknown); + } else if (this.commands.length) { + this.unknownCommand(); + } else { + checkForUnknownOptions(); + this._processArguments(); + } + } else if (this.commands.length) { + checkForUnknownOptions(); + this.help({ error: true }); + } else { + checkForUnknownOptions(); + this._processArguments(); + } + } + /** + * Find matching command. + * + * @private + * @return {Command | undefined} + */ + _findCommand(name) { + if (!name) return void 0; + return this.commands.find( + (cmd) => cmd._name === name || cmd._aliases.includes(name) + ); + } + /** + * Return an option matching `arg` if any. + * + * @param {string} arg + * @return {Option} + * @package + */ + _findOption(arg) { + return this.options.find((option) => option.is(arg)); + } + /** + * Display an error message if a mandatory option does not have a value. + * Called after checking for help flags in leaf subcommand. + * + * @private + */ + _checkForMissingMandatoryOptions() { + this._getCommandAndAncestors().forEach((cmd) => { + cmd.options.forEach((anOption) => { + if (anOption.mandatory && cmd.getOptionValue(anOption.attributeName()) === void 0) { + cmd.missingMandatoryOptionValue(anOption); + } + }); + }); + } + /** + * Display an error message if conflicting options are used together in this. + * + * @private + */ + _checkForConflictingLocalOptions() { + const definedNonDefaultOptions = this.options.filter((option) => { + const optionKey = option.attributeName(); + if (this.getOptionValue(optionKey) === void 0) { + return false; + } + return this.getOptionValueSource(optionKey) !== "default"; + }); + const optionsWithConflicting = definedNonDefaultOptions.filter( + (option) => option.conflictsWith.length > 0 + ); + optionsWithConflicting.forEach((option) => { + const conflictingAndDefined = definedNonDefaultOptions.find( + (defined) => option.conflictsWith.includes(defined.attributeName()) + ); + if (conflictingAndDefined) { + this._conflictingOption(option, conflictingAndDefined); + } + }); + } + /** + * Display an error message if conflicting options are used together. + * Called after checking for help flags in leaf subcommand. + * + * @private + */ + _checkForConflictingOptions() { + this._getCommandAndAncestors().forEach((cmd) => { + cmd._checkForConflictingLocalOptions(); + }); + } + /** + * Parse options from `argv` removing known options, + * and return argv split into operands and unknown arguments. + * + * Examples: + * + * argv => operands, unknown + * --known kkk op => [op], [] + * op --known kkk => [op], [] + * sub --unknown uuu op => [sub], [--unknown uuu op] + * sub -- --unknown uuu op => [sub --unknown uuu op], [] + * + * @param {string[]} argv + * @return {{operands: string[], unknown: string[]}} + */ + parseOptions(argv) { + const operands = []; + const unknown = []; + let dest = operands; + const args2 = argv.slice(); + function maybeOption(arg) { + return arg.length > 1 && arg[0] === "-"; + } + let activeVariadicOption = null; + while (args2.length) { + const arg = args2.shift(); + if (arg === "--") { + if (dest === unknown) dest.push(arg); + dest.push(...args2); + break; + } + if (activeVariadicOption && !maybeOption(arg)) { + this.emit(`option:${activeVariadicOption.name()}`, arg); + continue; + } + activeVariadicOption = null; + if (maybeOption(arg)) { + const option = this._findOption(arg); + if (option) { + if (option.required) { + const value = args2.shift(); + if (value === void 0) this.optionMissingArgument(option); + this.emit(`option:${option.name()}`, value); + } else if (option.optional) { + let value = null; + if (args2.length > 0 && !maybeOption(args2[0])) { + value = args2.shift(); + } + this.emit(`option:${option.name()}`, value); + } else { + this.emit(`option:${option.name()}`); + } + activeVariadicOption = option.variadic ? option : null; + continue; + } + } + if (arg.length > 2 && arg[0] === "-" && arg[1] !== "-") { + const option = this._findOption(`-${arg[1]}`); + if (option) { + if (option.required || option.optional && this._combineFlagAndOptionalValue) { + this.emit(`option:${option.name()}`, arg.slice(2)); + } else { + this.emit(`option:${option.name()}`); + args2.unshift(`-${arg.slice(2)}`); + } + continue; + } + } + if (/^--[^=]+=/.test(arg)) { + const index2 = arg.indexOf("="); + const option = this._findOption(arg.slice(0, index2)); + if (option && (option.required || option.optional)) { + this.emit(`option:${option.name()}`, arg.slice(index2 + 1)); + continue; + } + } + if (maybeOption(arg)) { + dest = unknown; + } + if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) { + if (this._findCommand(arg)) { + operands.push(arg); + if (args2.length > 0) unknown.push(...args2); + break; + } else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) { + operands.push(arg); + if (args2.length > 0) operands.push(...args2); + break; + } else if (this._defaultCommandName) { + unknown.push(arg); + if (args2.length > 0) unknown.push(...args2); + break; + } + } + if (this._passThroughOptions) { + dest.push(arg); + if (args2.length > 0) dest.push(...args2); + break; + } + dest.push(arg); + } + return { operands, unknown }; + } + /** + * Return an object containing local option values as key-value pairs. + * + * @return {object} + */ + opts() { + if (this._storeOptionsAsProperties) { + const result = {}; + const len = this.options.length; + for (let i6 = 0; i6 < len; i6++) { + const key = this.options[i6].attributeName(); + result[key] = key === this._versionOptionName ? this._version : this[key]; + } + return result; + } + return this._optionValues; + } + /** + * Return an object containing merged local and global option values as key-value pairs. + * + * @return {object} + */ + optsWithGlobals() { + return this._getCommandAndAncestors().reduce( + (combinedOptions, cmd) => Object.assign(combinedOptions, cmd.opts()), + {} + ); + } + /** + * Display error message and exit (or call exitOverride). + * + * @param {string} message + * @param {object} [errorOptions] + * @param {string} [errorOptions.code] - an id string representing the error + * @param {number} [errorOptions.exitCode] - used with process.exit + */ + error(message2, errorOptions) { + this._outputConfiguration.outputError( + `${message2} +`, + this._outputConfiguration.writeErr + ); + if (typeof this._showHelpAfterError === "string") { + this._outputConfiguration.writeErr(`${this._showHelpAfterError} +`); + } else if (this._showHelpAfterError) { + this._outputConfiguration.writeErr("\n"); + this.outputHelp({ error: true }); + } + const config3 = errorOptions || {}; + const exitCode = config3.exitCode || 1; + const code = config3.code || "commander.error"; + this._exit(exitCode, code, message2); + } + /** + * Apply any option related environment variables, if option does + * not have a value from cli or client code. + * + * @private + */ + _parseOptionsEnv() { + this.options.forEach((option) => { + if (option.envVar && option.envVar in process2.env) { + const optionKey = option.attributeName(); + if (this.getOptionValue(optionKey) === void 0 || ["default", "config", "env"].includes( + this.getOptionValueSource(optionKey) + )) { + if (option.required || option.optional) { + this.emit(`optionEnv:${option.name()}`, process2.env[option.envVar]); + } else { + this.emit(`optionEnv:${option.name()}`); + } + } + } + }); + } + /** + * Apply any implied option values, if option is undefined or default value. + * + * @private + */ + _parseOptionsImplied() { + const dualHelper = new DualOptions(this.options); + const hasCustomOptionValue = (optionKey) => { + return this.getOptionValue(optionKey) !== void 0 && !["default", "implied"].includes(this.getOptionValueSource(optionKey)); + }; + this.options.filter( + (option) => option.implied !== void 0 && hasCustomOptionValue(option.attributeName()) && dualHelper.valueFromOption( + this.getOptionValue(option.attributeName()), + option + ) + ).forEach((option) => { + Object.keys(option.implied).filter((impliedKey) => !hasCustomOptionValue(impliedKey)).forEach((impliedKey) => { + this.setOptionValueWithSource( + impliedKey, + option.implied[impliedKey], + "implied" + ); + }); + }); + } + /** + * Argument `name` is missing. + * + * @param {string} name + * @private + */ + missingArgument(name) { + const message2 = `error: missing required argument '${name}'`; + this.error(message2, { code: "commander.missingArgument" }); + } + /** + * `Option` is missing an argument. + * + * @param {Option} option + * @private + */ + optionMissingArgument(option) { + const message2 = `error: option '${option.flags}' argument missing`; + this.error(message2, { code: "commander.optionMissingArgument" }); + } + /** + * `Option` does not have a value, and is a mandatory option. + * + * @param {Option} option + * @private + */ + missingMandatoryOptionValue(option) { + const message2 = `error: required option '${option.flags}' not specified`; + this.error(message2, { code: "commander.missingMandatoryOptionValue" }); + } + /** + * `Option` conflicts with another option. + * + * @param {Option} option + * @param {Option} conflictingOption + * @private + */ + _conflictingOption(option, conflictingOption) { + const findBestOptionFromValue = (option2) => { + const optionKey = option2.attributeName(); + const optionValue = this.getOptionValue(optionKey); + const negativeOption = this.options.find( + (target) => target.negate && optionKey === target.attributeName() + ); + const positiveOption = this.options.find( + (target) => !target.negate && optionKey === target.attributeName() + ); + if (negativeOption && (negativeOption.presetArg === void 0 && optionValue === false || negativeOption.presetArg !== void 0 && optionValue === negativeOption.presetArg)) { + return negativeOption; + } + return positiveOption || option2; + }; + const getErrorMessage = (option2) => { + const bestOption = findBestOptionFromValue(option2); + const optionKey = bestOption.attributeName(); + const source = this.getOptionValueSource(optionKey); + if (source === "env") { + return `environment variable '${bestOption.envVar}'`; + } + return `option '${bestOption.flags}'`; + }; + const message2 = `error: ${getErrorMessage(option)} cannot be used with ${getErrorMessage(conflictingOption)}`; + this.error(message2, { code: "commander.conflictingOption" }); + } + /** + * Unknown option `flag`. + * + * @param {string} flag + * @private + */ + unknownOption(flag) { + if (this._allowUnknownOption) return; + let suggestion = ""; + if (flag.startsWith("--") && this._showSuggestionAfterError) { + let candidateFlags = []; + let command = this; + do { + const moreFlags = command.createHelp().visibleOptions(command).filter((option) => option.long).map((option) => option.long); + candidateFlags = candidateFlags.concat(moreFlags); + command = command.parent; + } while (command && !command._enablePositionalOptions); + suggestion = suggestSimilar(flag, candidateFlags); + } + const message2 = `error: unknown option '${flag}'${suggestion}`; + this.error(message2, { code: "commander.unknownOption" }); + } + /** + * Excess arguments, more than expected. + * + * @param {string[]} receivedArgs + * @private + */ + _excessArguments(receivedArgs) { + if (this._allowExcessArguments) return; + const expected = this.registeredArguments.length; + const s4 = expected === 1 ? "" : "s"; + const forSubcommand = this.parent ? ` for '${this.name()}'` : ""; + const message2 = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s4} but got ${receivedArgs.length}.`; + this.error(message2, { code: "commander.excessArguments" }); + } + /** + * Unknown command. + * + * @private + */ + unknownCommand() { + const unknownName = this.args[0]; + let suggestion = ""; + if (this._showSuggestionAfterError) { + const candidateNames = []; + this.createHelp().visibleCommands(this).forEach((command) => { + candidateNames.push(command.name()); + if (command.alias()) candidateNames.push(command.alias()); + }); + suggestion = suggestSimilar(unknownName, candidateNames); + } + const message2 = `error: unknown command '${unknownName}'${suggestion}`; + this.error(message2, { code: "commander.unknownCommand" }); + } + /** + * Get or set the program version. + * + * This method auto-registers the "-V, --version" option which will print the version number. + * + * You can optionally supply the flags and description to override the defaults. + * + * @param {string} [str] + * @param {string} [flags] + * @param {string} [description] + * @return {(this | string | undefined)} `this` command for chaining, or version string if no arguments + */ + version(str, flags, description) { + if (str === void 0) return this._version; + this._version = str; + flags = flags || "-V, --version"; + description = description || "output the version number"; + const versionOption = this.createOption(flags, description); + this._versionOptionName = versionOption.attributeName(); + this._registerOption(versionOption); + this.on("option:" + versionOption.name(), () => { + this._outputConfiguration.writeOut(`${str} +`); + this._exit(0, "commander.version", str); + }); + return this; + } + /** + * Set the description. + * + * @param {string} [str] + * @param {object} [argsDescription] + * @return {(string|Command)} + */ + description(str, argsDescription) { + if (str === void 0 && argsDescription === void 0) + return this._description; + this._description = str; + if (argsDescription) { + this._argsDescription = argsDescription; + } + return this; + } + /** + * Set the summary. Used when listed as subcommand of parent. + * + * @param {string} [str] + * @return {(string|Command)} + */ + summary(str) { + if (str === void 0) return this._summary; + this._summary = str; + return this; + } + /** + * Set an alias for the command. + * + * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help. + * + * @param {string} [alias] + * @return {(string|Command)} + */ + alias(alias) { + if (alias === void 0) return this._aliases[0]; + let command = this; + if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) { + command = this.commands[this.commands.length - 1]; + } + if (alias === command._name) + throw new Error("Command alias can't be the same as its name"); + const matchingCommand = this.parent?._findCommand(alias); + if (matchingCommand) { + const existingCmd = [matchingCommand.name()].concat(matchingCommand.aliases()).join("|"); + throw new Error( + `cannot add alias '${alias}' to command '${this.name()}' as already have command '${existingCmd}'` + ); + } + command._aliases.push(alias); + return this; + } + /** + * Set aliases for the command. + * + * Only the first alias is shown in the auto-generated help. + * + * @param {string[]} [aliases] + * @return {(string[]|Command)} + */ + aliases(aliases2) { + if (aliases2 === void 0) return this._aliases; + aliases2.forEach((alias) => this.alias(alias)); + return this; + } + /** + * Set / get the command usage `str`. + * + * @param {string} [str] + * @return {(string|Command)} + */ + usage(str) { + if (str === void 0) { + if (this._usage) return this._usage; + const args2 = this.registeredArguments.map((arg) => { + return humanReadableArgName(arg); + }); + return [].concat( + this.options.length || this._helpOption !== null ? "[options]" : [], + this.commands.length ? "[command]" : [], + this.registeredArguments.length ? args2 : [] + ).join(" "); + } + this._usage = str; + return this; + } + /** + * Get or set the name of the command. + * + * @param {string} [str] + * @return {(string|Command)} + */ + name(str) { + if (str === void 0) return this._name; + this._name = str; + return this; + } + /** + * Set the name of the command from script filename, such as process.argv[1], + * or require.main.filename, or __filename. + * + * (Used internally and public although not documented in README.) + * + * @example + * program.nameFromFilename(require.main.filename); + * + * @param {string} filename + * @return {Command} + */ + nameFromFilename(filename) { + this._name = path2.basename(filename, path2.extname(filename)); + return this; + } + /** + * Get or set the directory for searching for executable subcommands of this command. + * + * @example + * program.executableDir(__dirname); + * // or + * program.executableDir('subcommands'); + * + * @param {string} [path] + * @return {(string|null|Command)} + */ + executableDir(path3) { + if (path3 === void 0) return this._executableDir; + this._executableDir = path3; + return this; + } + /** + * Return program help documentation. + * + * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout + * @return {string} + */ + helpInformation(contextOptions) { + const helper = this.createHelp(); + if (helper.helpWidth === void 0) { + helper.helpWidth = contextOptions && contextOptions.error ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth(); + } + return helper.formatHelp(this, helper); + } + /** + * @private + */ + _getHelpContext(contextOptions) { + contextOptions = contextOptions || {}; + const context2 = { error: !!contextOptions.error }; + let write; + if (context2.error) { + write = (arg) => this._outputConfiguration.writeErr(arg); + } else { + write = (arg) => this._outputConfiguration.writeOut(arg); + } + context2.write = contextOptions.write || write; + context2.command = this; + return context2; + } + /** + * Output help information for this command. + * + * Outputs built-in help, and custom text added using `.addHelpText()`. + * + * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout + */ + outputHelp(contextOptions) { + let deprecatedCallback; + if (typeof contextOptions === "function") { + deprecatedCallback = contextOptions; + contextOptions = void 0; + } + const context2 = this._getHelpContext(contextOptions); + this._getCommandAndAncestors().reverse().forEach((command) => command.emit("beforeAllHelp", context2)); + this.emit("beforeHelp", context2); + let helpInformation = this.helpInformation(context2); + if (deprecatedCallback) { + helpInformation = deprecatedCallback(helpInformation); + if (typeof helpInformation !== "string" && !Buffer.isBuffer(helpInformation)) { + throw new Error("outputHelp callback must return a string or a Buffer"); + } + } + context2.write(helpInformation); + if (this._getHelpOption()?.long) { + this.emit(this._getHelpOption().long); + } + this.emit("afterHelp", context2); + this._getCommandAndAncestors().forEach( + (command) => command.emit("afterAllHelp", context2) + ); + } + /** + * You can pass in flags and a description to customise the built-in help option. + * Pass in false to disable the built-in help option. + * + * @example + * program.helpOption('-?, --help' 'show help'); // customise + * program.helpOption(false); // disable + * + * @param {(string | boolean)} flags + * @param {string} [description] + * @return {Command} `this` command for chaining + */ + helpOption(flags, description) { + if (typeof flags === "boolean") { + if (flags) { + this._helpOption = this._helpOption ?? void 0; + } else { + this._helpOption = null; + } + return this; + } + flags = flags ?? "-h, --help"; + description = description ?? "display help for command"; + this._helpOption = this.createOption(flags, description); + return this; + } + /** + * Lazy create help option. + * Returns null if has been disabled with .helpOption(false). + * + * @returns {(Option | null)} the help option + * @package + */ + _getHelpOption() { + if (this._helpOption === void 0) { + this.helpOption(void 0, void 0); + } + return this._helpOption; + } + /** + * Supply your own option to use for the built-in help option. + * This is an alternative to using helpOption() to customise the flags and description etc. + * + * @param {Option} option + * @return {Command} `this` command for chaining + */ + addHelpOption(option) { + this._helpOption = option; + return this; + } + /** + * Output help information and exit. + * + * Outputs built-in help, and custom text added using `.addHelpText()`. + * + * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout + */ + help(contextOptions) { + this.outputHelp(contextOptions); + let exitCode = process2.exitCode || 0; + if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) { + exitCode = 1; + } + this._exit(exitCode, "commander.help", "(outputHelp)"); + } + /** + * Add additional text to be displayed with the built-in help. + * + * Position is 'before' or 'after' to affect just this command, + * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands. + * + * @param {string} position - before or after built-in help + * @param {(string | Function)} text - string to add, or a function returning a string + * @return {Command} `this` command for chaining + */ + addHelpText(position, text3) { + const allowedValues = ["beforeAll", "before", "after", "afterAll"]; + if (!allowedValues.includes(position)) { + throw new Error(`Unexpected value for position to addHelpText. +Expecting one of '${allowedValues.join("', '")}'`); + } + const helpEvent = `${position}Help`; + this.on(helpEvent, (context2) => { + let helpStr; + if (typeof text3 === "function") { + helpStr = text3({ error: context2.error, command: context2.command }); + } else { + helpStr = text3; + } + if (helpStr) { + context2.write(`${helpStr} +`); + } + }); + return this; + } + /** + * Output help information if help flags specified + * + * @param {Array} args - array of options to search for help flags + * @private + */ + _outputHelpIfRequested(args2) { + const helpOption = this._getHelpOption(); + const helpRequested = helpOption && args2.find((arg) => helpOption.is(arg)); + if (helpRequested) { + this.outputHelp(); + this._exit(0, "commander.helpDisplayed", "(outputHelp)"); + } + } + }; + function incrementNodeInspectorPort(args2) { + return args2.map((arg) => { + if (!arg.startsWith("--inspect")) { + return arg; + } + let debugOption; + let debugHost = "127.0.0.1"; + let debugPort = "9229"; + let match2; + if ((match2 = arg.match(/^(--inspect(-brk)?)$/)) !== null) { + debugOption = match2[1]; + } else if ((match2 = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) { + debugOption = match2[1]; + if (/^\d+$/.test(match2[3])) { + debugPort = match2[3]; + } else { + debugHost = match2[3]; + } + } else if ((match2 = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) { + debugOption = match2[1]; + debugHost = match2[3]; + debugPort = match2[4]; + } + if (debugOption && debugPort !== "0") { + return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`; + } + return arg; + }); + } + exports2.Command = Command2; + } +}); + +// ../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/index.js +var require_commander = __commonJS({ + "../../node_modules/.pnpm/commander@12.1.0/node_modules/commander/index.js"(exports2) { + var { Argument: Argument2 } = require_argument(); + var { Command: Command2 } = require_command(); + var { CommanderError: CommanderError2, InvalidArgumentError: InvalidArgumentError2 } = require_error(); + var { Help: Help2 } = require_help(); + var { Option: Option2 } = require_option(); + exports2.program = new Command2(); + exports2.createCommand = (name) => new Command2(name); + exports2.createOption = (flags, description) => new Option2(flags, description); + exports2.createArgument = (name, description) => new Argument2(name, description); + exports2.Command = Command2; + exports2.Option = Option2; + exports2.Argument = Argument2; + exports2.Help = Help2; + exports2.CommanderError = CommanderError2; + exports2.InvalidArgumentError = InvalidArgumentError2; + exports2.InvalidOptionArgumentError = InvalidArgumentError2; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js +var require_constants = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js"(exports2, module2) { + var SEMVER_SPEC_VERSION = "2.0.0"; + var MAX_LENGTH = 256; + var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ + 9007199254740991; + var MAX_SAFE_COMPONENT_LENGTH = 16; + var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; + var RELEASE_TYPES = [ + "major", + "premajor", + "minor", + "preminor", + "patch", + "prepatch", + "prerelease" + ]; + module2.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 1, + FLAG_LOOSE: 2 + }; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js"(exports2, module2) { + var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args2) => console.error("SEMVER", ...args2) : () => { + }; + module2.exports = debug; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js +var require_re = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js"(exports2, module2) { + var { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH + } = require_constants(); + var debug = require_debug(); + exports2 = module2.exports = {}; + var re = exports2.re = []; + var safeRe = exports2.safeRe = []; + var src = exports2.src = []; + var safeSrc = exports2.safeSrc = []; + var t4 = exports2.t = {}; + var R = 0; + var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; + var safeRegexReplacements = [ + ["\\s", 1], + ["\\d", MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] + ]; + var makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); + } + return value; + }; + var createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value); + const index2 = R++; + debug(name, index2, value); + t4[name] = index2; + src[index2] = value; + safeSrc[index2] = safe; + re[index2] = new RegExp(value, isGlobal ? "g" : void 0); + safeRe[index2] = new RegExp(safe, isGlobal ? "g" : void 0); + }; + createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); + createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); + createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); + createToken("MAINVERSION", `(${src[t4.NUMERICIDENTIFIER]})\\.(${src[t4.NUMERICIDENTIFIER]})\\.(${src[t4.NUMERICIDENTIFIER]})`); + createToken("MAINVERSIONLOOSE", `(${src[t4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t4.NUMERICIDENTIFIERLOOSE]})\\.(${src[t4.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASEIDENTIFIER", `(?:${src[t4.NUMERICIDENTIFIER]}|${src[t4.NONNUMERICIDENTIFIER]})`); + createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t4.NUMERICIDENTIFIERLOOSE]}|${src[t4.NONNUMERICIDENTIFIER]})`); + createToken("PRERELEASE", `(?:-(${src[t4.PRERELEASEIDENTIFIER]}(?:\\.${src[t4.PRERELEASEIDENTIFIER]})*))`); + createToken("PRERELEASELOOSE", `(?:-?(${src[t4.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t4.PRERELEASEIDENTIFIERLOOSE]})*))`); + createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); + createToken("BUILD", `(?:\\+(${src[t4.BUILDIDENTIFIER]}(?:\\.${src[t4.BUILDIDENTIFIER]})*))`); + createToken("FULLPLAIN", `v?${src[t4.MAINVERSION]}${src[t4.PRERELEASE]}?${src[t4.BUILD]}?`); + createToken("FULL", `^${src[t4.FULLPLAIN]}$`); + createToken("LOOSEPLAIN", `[v=\\s]*${src[t4.MAINVERSIONLOOSE]}${src[t4.PRERELEASELOOSE]}?${src[t4.BUILD]}?`); + createToken("LOOSE", `^${src[t4.LOOSEPLAIN]}$`); + createToken("GTLT", "((?:<|>)?=?)"); + createToken("XRANGEIDENTIFIERLOOSE", `${src[t4.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); + createToken("XRANGEIDENTIFIER", `${src[t4.NUMERICIDENTIFIER]}|x|X|\\*`); + createToken("XRANGEPLAIN", `[v=\\s]*(${src[t4.XRANGEIDENTIFIER]})(?:\\.(${src[t4.XRANGEIDENTIFIER]})(?:\\.(${src[t4.XRANGEIDENTIFIER]})(?:${src[t4.PRERELEASE]})?${src[t4.BUILD]}?)?)?`); + createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t4.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t4.XRANGEIDENTIFIERLOOSE]})(?:${src[t4.PRERELEASELOOSE]})?${src[t4.BUILD]}?)?)?`); + createToken("XRANGE", `^${src[t4.GTLT]}\\s*${src[t4.XRANGEPLAIN]}$`); + createToken("XRANGELOOSE", `^${src[t4.GTLT]}\\s*${src[t4.XRANGEPLAINLOOSE]}$`); + createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); + createToken("COERCE", `${src[t4.COERCEPLAIN]}(?:$|[^\\d])`); + createToken("COERCEFULL", src[t4.COERCEPLAIN] + `(?:${src[t4.PRERELEASE]})?(?:${src[t4.BUILD]})?(?:$|[^\\d])`); + createToken("COERCERTL", src[t4.COERCE], true); + createToken("COERCERTLFULL", src[t4.COERCEFULL], true); + createToken("LONETILDE", "(?:~>?)"); + createToken("TILDETRIM", `(\\s*)${src[t4.LONETILDE]}\\s+`, true); + exports2.tildeTrimReplace = "$1~"; + createToken("TILDE", `^${src[t4.LONETILDE]}${src[t4.XRANGEPLAIN]}$`); + createToken("TILDELOOSE", `^${src[t4.LONETILDE]}${src[t4.XRANGEPLAINLOOSE]}$`); + createToken("LONECARET", "(?:\\^)"); + createToken("CARETTRIM", `(\\s*)${src[t4.LONECARET]}\\s+`, true); + exports2.caretTrimReplace = "$1^"; + createToken("CARET", `^${src[t4.LONECARET]}${src[t4.XRANGEPLAIN]}$`); + createToken("CARETLOOSE", `^${src[t4.LONECARET]}${src[t4.XRANGEPLAINLOOSE]}$`); + createToken("COMPARATORLOOSE", `^${src[t4.GTLT]}\\s*(${src[t4.LOOSEPLAIN]})$|^$`); + createToken("COMPARATOR", `^${src[t4.GTLT]}\\s*(${src[t4.FULLPLAIN]})$|^$`); + createToken("COMPARATORTRIM", `(\\s*)${src[t4.GTLT]}\\s*(${src[t4.LOOSEPLAIN]}|${src[t4.XRANGEPLAIN]})`, true); + exports2.comparatorTrimReplace = "$1$2$3"; + createToken("HYPHENRANGE", `^\\s*(${src[t4.XRANGEPLAIN]})\\s+-\\s+(${src[t4.XRANGEPLAIN]})\\s*$`); + createToken("HYPHENRANGELOOSE", `^\\s*(${src[t4.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t4.XRANGEPLAINLOOSE]})\\s*$`); + createToken("STAR", "(<|>)?=?\\s*\\*"); + createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); + createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js +var require_parse_options = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js"(exports2, module2) { + var looseOption = Object.freeze({ loose: true }); + var emptyOpts = Object.freeze({}); + var parseOptions = (options) => { + if (!options) { + return emptyOpts; + } + if (typeof options !== "object") { + return looseOption; + } + return options; + }; + module2.exports = parseOptions; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js +var require_identifiers = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js"(exports2, module2) { + var numeric = /^[0-9]+$/; + var compareIdentifiers = (a2, b) => { + const anum = numeric.test(a2); + const bnum = numeric.test(b); + if (anum && bnum) { + a2 = +a2; + b = +b; + } + return a2 === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b ? -1 : 1; + }; + var rcompareIdentifiers = (a2, b) => compareIdentifiers(b, a2); + module2.exports = { + compareIdentifiers, + rcompareIdentifiers + }; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js +var require_semver = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js"(exports2, module2) { + var debug = require_debug(); + var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants(); + var { safeRe: re, safeSrc: src, t: t4 } = require_re(); + var parseOptions = require_parse_options(); + var { compareIdentifiers } = require_identifiers(); + var SemVer = class _SemVer { + constructor(version3, options) { + options = parseOptions(options); + if (version3 instanceof _SemVer) { + if (version3.loose === !!options.loose && version3.includePrerelease === !!options.includePrerelease) { + return version3; + } else { + version3 = version3.version; + } + } else if (typeof version3 !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version3}".`); + } + if (version3.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ); + } + debug("SemVer", version3, options); + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + const m2 = version3.trim().match(options.loose ? re[t4.LOOSE] : re[t4.FULL]); + if (!m2) { + throw new TypeError(`Invalid Version: ${version3}`); + } + this.raw = version3; + this.major = +m2[1]; + this.minor = +m2[2]; + this.patch = +m2[3]; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError("Invalid major version"); + } + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); + } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); + } + if (!m2[4]) { + this.prerelease = []; + } else { + this.prerelease = m2[4].split(".").map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num; + } + } + return id; + }); + } + this.build = m2[5] ? m2[5].split(".") : []; + this.format(); + } + format() { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join(".")}`; + } + return this.version; + } + toString() { + return this.version; + } + compare(other) { + debug("SemVer.compare", this.version, this.options, other); + if (!(other instanceof _SemVer)) { + if (typeof other === "string" && other === this.version) { + return 0; + } + other = new _SemVer(other, this.options); + } + if (other.version === this.version) { + return 0; + } + return this.compareMain(other) || this.comparePre(other); + } + compareMain(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); + } + comparePre(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; + } + let i6 = 0; + do { + const a2 = this.prerelease[i6]; + const b = other.prerelease[i6]; + debug("prerelease compare", i6, a2, b); + if (a2 === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a2 === void 0) { + return -1; + } else if (a2 === b) { + continue; + } else { + return compareIdentifiers(a2, b); + } + } while (++i6); + } + compareBuild(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + let i6 = 0; + do { + const a2 = this.build[i6]; + const b = other.build[i6]; + debug("build compare", i6, a2, b); + if (a2 === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a2 === void 0) { + return -1; + } else if (a2 === b) { + continue; + } else { + return compareIdentifiers(a2, b); + } + } while (++i6); + } + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc(release, identifier, identifierBase) { + if (release.startsWith("pre")) { + if (!identifier && identifierBase === false) { + throw new Error("invalid increment argument: identifier is empty"); + } + if (identifier) { + const r2 = new RegExp(`^${this.options.loose ? src[t4.PRERELEASELOOSE] : src[t4.PRERELEASE]}$`); + const match2 = `-${identifier}`.match(r2); + if (!match2 || match2[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`); + } + } + } + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier, identifierBase); + break; + case "preminor": + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc("pre", identifier, identifierBase); + break; + case "prepatch": + this.prerelease.length = 0; + this.inc("patch", identifier, identifierBase); + this.inc("pre", identifier, identifierBase); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case "prerelease": + if (this.prerelease.length === 0) { + this.inc("patch", identifier, identifierBase); + } + this.inc("pre", identifier, identifierBase); + break; + case "release": + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`); + } + this.prerelease.length = 0; + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case "pre": { + const base = Number(identifierBase) ? 1 : 0; + if (this.prerelease.length === 0) { + this.prerelease = [base]; + } else { + let i6 = this.prerelease.length; + while (--i6 >= 0) { + if (typeof this.prerelease[i6] === "number") { + this.prerelease[i6]++; + i6 = -2; + } + } + if (i6 === -1) { + if (identifier === this.prerelease.join(".") && identifierBase === false) { + throw new Error("invalid increment argument: identifier already exists"); + } + this.prerelease.push(base); + } + } + if (identifier) { + let prerelease = [identifier, base]; + if (identifierBase === false) { + prerelease = [identifier]; + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease; + } + } else { + this.prerelease = prerelease; + } + } + break; + } + default: + throw new Error(`invalid increment argument: ${release}`); + } + this.raw = this.format(); + if (this.build.length) { + this.raw += `+${this.build.join(".")}`; + } + return this; + } + }; + module2.exports = SemVer; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js +var require_parse = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js"(exports2, module2) { + var SemVer = require_semver(); + var parse12 = (version3, options, throwErrors = false) => { + if (version3 instanceof SemVer) { + return version3; + } + try { + return new SemVer(version3, options); + } catch (er) { + if (!throwErrors) { + return null; + } + throw er; + } + }; + module2.exports = parse12; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/valid.js +var require_valid = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/valid.js"(exports2, module2) { + var parse12 = require_parse(); + var valid = (version3, options) => { + const v = parse12(version3, options); + return v ? v.version : null; + }; + module2.exports = valid; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/clean.js +var require_clean = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/clean.js"(exports2, module2) { + var parse12 = require_parse(); + var clean = (version3, options) => { + const s4 = parse12(version3.trim().replace(/^[=v]+/, ""), options); + return s4 ? s4.version : null; + }; + module2.exports = clean; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/inc.js +var require_inc = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/inc.js"(exports2, module2) { + var SemVer = require_semver(); + var inc = (version3, release, options, identifier, identifierBase) => { + if (typeof options === "string") { + identifierBase = identifier; + identifier = options; + options = void 0; + } + try { + return new SemVer( + version3 instanceof SemVer ? version3.version : version3, + options + ).inc(release, identifier, identifierBase).version; + } catch (er) { + return null; + } + }; + module2.exports = inc; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js +var require_diff = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js"(exports2, module2) { + var parse12 = require_parse(); + var diff = (version1, version22) => { + const v12 = parse12(version1, null, true); + const v2 = parse12(version22, null, true); + const comparison = v12.compare(v2); + if (comparison === 0) { + return null; + } + const v1Higher = comparison > 0; + const highVersion = v1Higher ? v12 : v2; + const lowVersion = v1Higher ? v2 : v12; + const highHasPre = !!highVersion.prerelease.length; + const lowHasPre = !!lowVersion.prerelease.length; + if (lowHasPre && !highHasPre) { + if (!lowVersion.patch && !lowVersion.minor) { + return "major"; + } + if (lowVersion.compareMain(highVersion) === 0) { + if (lowVersion.minor && !lowVersion.patch) { + return "minor"; + } + return "patch"; + } + } + const prefix = highHasPre ? "pre" : ""; + if (v12.major !== v2.major) { + return prefix + "major"; + } + if (v12.minor !== v2.minor) { + return prefix + "minor"; + } + if (v12.patch !== v2.patch) { + return prefix + "patch"; + } + return "prerelease"; + }; + module2.exports = diff; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/major.js +var require_major = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/major.js"(exports2, module2) { + var SemVer = require_semver(); + var major = (a2, loose) => new SemVer(a2, loose).major; + module2.exports = major; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/minor.js +var require_minor = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/minor.js"(exports2, module2) { + var SemVer = require_semver(); + var minor = (a2, loose) => new SemVer(a2, loose).minor; + module2.exports = minor; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/patch.js +var require_patch = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/patch.js"(exports2, module2) { + var SemVer = require_semver(); + var patch = (a2, loose) => new SemVer(a2, loose).patch; + module2.exports = patch; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js +var require_prerelease = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js"(exports2, module2) { + var parse12 = require_parse(); + var prerelease = (version3, options) => { + const parsed = parse12(version3, options); + return parsed && parsed.prerelease.length ? parsed.prerelease : null; + }; + module2.exports = prerelease; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js +var require_compare = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js"(exports2, module2) { + var SemVer = require_semver(); + var compare = (a2, b, loose) => new SemVer(a2, loose).compare(new SemVer(b, loose)); + module2.exports = compare; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rcompare.js +var require_rcompare = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rcompare.js"(exports2, module2) { + var compare = require_compare(); + var rcompare = (a2, b, loose) => compare(b, a2, loose); + module2.exports = rcompare; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-loose.js +var require_compare_loose = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-loose.js"(exports2, module2) { + var compare = require_compare(); + var compareLoose = (a2, b) => compare(a2, b, true); + module2.exports = compareLoose; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js +var require_compare_build = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare-build.js"(exports2, module2) { + var SemVer = require_semver(); + var compareBuild = (a2, b, loose) => { + const versionA = new SemVer(a2, loose); + const versionB = new SemVer(b, loose); + return versionA.compare(versionB) || versionA.compareBuild(versionB); + }; + module2.exports = compareBuild; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/sort.js +var require_sort = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/sort.js"(exports2, module2) { + var compareBuild = require_compare_build(); + var sort = (list, loose) => list.sort((a2, b) => compareBuild(a2, b, loose)); + module2.exports = sort; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rsort.js +var require_rsort = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/rsort.js"(exports2, module2) { + var compareBuild = require_compare_build(); + var rsort = (list, loose) => list.sort((a2, b) => compareBuild(b, a2, loose)); + module2.exports = rsort; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js +var require_gt = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js"(exports2, module2) { + var compare = require_compare(); + var gt = (a2, b, loose) => compare(a2, b, loose) > 0; + module2.exports = gt; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js +var require_lt = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js"(exports2, module2) { + var compare = require_compare(); + var lt = (a2, b, loose) => compare(a2, b, loose) < 0; + module2.exports = lt; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js +var require_eq = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js"(exports2, module2) { + var compare = require_compare(); + var eq2 = (a2, b, loose) => compare(a2, b, loose) === 0; + module2.exports = eq2; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js +var require_neq = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js"(exports2, module2) { + var compare = require_compare(); + var neq = (a2, b, loose) => compare(a2, b, loose) !== 0; + module2.exports = neq; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js +var require_gte = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js"(exports2, module2) { + var compare = require_compare(); + var gte2 = (a2, b, loose) => compare(a2, b, loose) >= 0; + module2.exports = gte2; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js +var require_lte = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js"(exports2, module2) { + var compare = require_compare(); + var lte = (a2, b, loose) => compare(a2, b, loose) <= 0; + module2.exports = lte; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js +var require_cmp = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js"(exports2, module2) { + var eq2 = require_eq(); + var neq = require_neq(); + var gt = require_gt(); + var gte2 = require_gte(); + var lt = require_lt(); + var lte = require_lte(); + var cmp = (a2, op, b, loose) => { + switch (op) { + case "===": + if (typeof a2 === "object") { + a2 = a2.version; + } + if (typeof b === "object") { + b = b.version; + } + return a2 === b; + case "!==": + if (typeof a2 === "object") { + a2 = a2.version; + } + if (typeof b === "object") { + b = b.version; + } + return a2 !== b; + case "": + case "=": + case "==": + return eq2(a2, b, loose); + case "!=": + return neq(a2, b, loose); + case ">": + return gt(a2, b, loose); + case ">=": + return gte2(a2, b, loose); + case "<": + return lt(a2, b, loose); + case "<=": + return lte(a2, b, loose); + default: + throw new TypeError(`Invalid operator: ${op}`); + } + }; + module2.exports = cmp; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/coerce.js +var require_coerce = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/coerce.js"(exports2, module2) { + var SemVer = require_semver(); + var parse12 = require_parse(); + var { safeRe: re, t: t4 } = require_re(); + var coerce = (version3, options) => { + if (version3 instanceof SemVer) { + return version3; + } + if (typeof version3 === "number") { + version3 = String(version3); + } + if (typeof version3 !== "string") { + return null; + } + options = options || {}; + let match2 = null; + if (!options.rtl) { + match2 = version3.match(options.includePrerelease ? re[t4.COERCEFULL] : re[t4.COERCE]); + } else { + const coerceRtlRegex = options.includePrerelease ? re[t4.COERCERTLFULL] : re[t4.COERCERTL]; + let next2; + while ((next2 = coerceRtlRegex.exec(version3)) && (!match2 || match2.index + match2[0].length !== version3.length)) { + if (!match2 || next2.index + next2[0].length !== match2.index + match2[0].length) { + match2 = next2; + } + coerceRtlRegex.lastIndex = next2.index + next2[1].length + next2[2].length; + } + coerceRtlRegex.lastIndex = -1; + } + if (match2 === null) { + return null; + } + const major = match2[2]; + const minor = match2[3] || "0"; + const patch = match2[4] || "0"; + const prerelease = options.includePrerelease && match2[5] ? `-${match2[5]}` : ""; + const build = options.includePrerelease && match2[6] ? `+${match2[6]}` : ""; + return parse12(`${major}.${minor}.${patch}${prerelease}${build}`, options); + }; + module2.exports = coerce; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js +var require_lrucache = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js"(exports2, module2) { + var LRUCache2 = class { + constructor() { + this.max = 1e3; + this.map = /* @__PURE__ */ new Map(); + } + get(key) { + const value = this.map.get(key); + if (value === void 0) { + return void 0; + } else { + this.map.delete(key); + this.map.set(key, value); + return value; + } + } + delete(key) { + return this.map.delete(key); + } + set(key, value) { + const deleted = this.delete(key); + if (!deleted && value !== void 0) { + if (this.map.size >= this.max) { + const firstKey = this.map.keys().next().value; + this.delete(firstKey); + } + this.map.set(key, value); + } + return this; + } + }; + module2.exports = LRUCache2; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js +var require_range = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js"(exports2, module2) { + var SPACE_CHARACTERS = /\s+/g; + var Range = class _Range { + constructor(range, options) { + options = parseOptions(options); + if (range instanceof _Range) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new _Range(range.raw, options); + } + } + if (range instanceof Comparator) { + this.raw = range.value; + this.set = [[range]]; + this.formatted = void 0; + return this; + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().replace(SPACE_CHARACTERS, " "); + this.set = this.raw.split("||").map((r2) => this.parseRange(r2.trim())).filter((c2) => c2.length); + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`); + } + if (this.set.length > 1) { + const first2 = this.set[0]; + this.set = this.set.filter((c2) => !isNullSet(c2[0])); + if (this.set.length === 0) { + this.set = [first2]; + } else if (this.set.length > 1) { + for (const c2 of this.set) { + if (c2.length === 1 && isAny(c2[0])) { + this.set = [c2]; + break; + } + } + } + } + this.formatted = void 0; + } + get range() { + if (this.formatted === void 0) { + this.formatted = ""; + for (let i6 = 0; i6 < this.set.length; i6++) { + if (i6 > 0) { + this.formatted += "||"; + } + const comps = this.set[i6]; + for (let k = 0; k < comps.length; k++) { + if (k > 0) { + this.formatted += " "; + } + this.formatted += comps[k].toString().trim(); + } + } + } + return this.formatted; + } + format() { + return this.range; + } + toString() { + return this.range; + } + parseRange(range) { + const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); + const memoKey = memoOpts + ":" + range; + const cached = cache2.get(memoKey); + if (cached) { + return cached; + } + const loose = this.options.loose; + const hr = loose ? re[t4.HYPHENRANGELOOSE] : re[t4.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); + debug("hyphen replace", range); + range = range.replace(re[t4.COMPARATORTRIM], comparatorTrimReplace); + debug("comparator trim", range); + range = range.replace(re[t4.TILDETRIM], tildeTrimReplace); + debug("tilde trim", range); + range = range.replace(re[t4.CARETTRIM], caretTrimReplace); + debug("caret trim", range); + let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); + if (loose) { + rangeList = rangeList.filter((comp) => { + debug("loose invalid filter", comp, this.options); + return !!comp.match(re[t4.COMPARATORLOOSE]); + }); + } + debug("range list", rangeList); + const rangeMap = /* @__PURE__ */ new Map(); + const comparators = rangeList.map((comp) => new Comparator(comp, this.options)); + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp]; + } + rangeMap.set(comp.value, comp); + } + if (rangeMap.size > 1 && rangeMap.has("")) { + rangeMap.delete(""); + } + const result = [...rangeMap.values()]; + cache2.set(memoKey, result); + return result; + } + intersects(range, options) { + if (!(range instanceof _Range)) { + throw new TypeError("a Range is required"); + } + return this.set.some((thisComparators) => { + return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { + return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); + } + // if ANY of the sets match ALL of its comparators, then pass + test(version3) { + if (!version3) { + return false; + } + if (typeof version3 === "string") { + try { + version3 = new SemVer(version3, this.options); + } catch (er) { + return false; + } + } + for (let i6 = 0; i6 < this.set.length; i6++) { + if (testSet(this.set[i6], version3, this.options)) { + return true; + } + } + return false; + } + }; + module2.exports = Range; + var LRU = require_lrucache(); + var cache2 = new LRU(); + var parseOptions = require_parse_options(); + var Comparator = require_comparator(); + var debug = require_debug(); + var SemVer = require_semver(); + var { + safeRe: re, + t: t4, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace + } = require_re(); + var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants(); + var isNullSet = (c2) => c2.value === "<0.0.0-0"; + var isAny = (c2) => c2.value === ""; + var isSatisfiable = (comparators, options) => { + let result = true; + const remainingComparators = comparators.slice(); + let testComparator = remainingComparators.pop(); + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options); + }); + testComparator = remainingComparators.pop(); + } + return result; + }; + var parseComparator = (comp, options) => { + debug("comp", comp, options); + comp = replaceCarets(comp, options); + debug("caret", comp); + comp = replaceTildes(comp, options); + debug("tildes", comp); + comp = replaceXRanges(comp, options); + debug("xrange", comp); + comp = replaceStars(comp, options); + debug("stars", comp); + return comp; + }; + var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; + var replaceTildes = (comp, options) => { + return comp.trim().split(/\s+/).map((c2) => replaceTilde(c2, options)).join(" "); + }; + var replaceTilde = (comp, options) => { + const r2 = options.loose ? re[t4.TILDELOOSE] : re[t4.TILDE]; + return comp.replace(r2, (_, M, m2, p3, pr) => { + debug("tilde", comp, _, M, m2, p3, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m2)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; + } else if (isX(p3)) { + ret = `>=${M}.${m2}.0 <${M}.${+m2 + 1}.0-0`; + } else if (pr) { + debug("replaceTilde pr", pr); + ret = `>=${M}.${m2}.${p3}-${pr} <${M}.${+m2 + 1}.0-0`; + } else { + ret = `>=${M}.${m2}.${p3} <${M}.${+m2 + 1}.0-0`; + } + debug("tilde return", ret); + return ret; + }); + }; + var replaceCarets = (comp, options) => { + return comp.trim().split(/\s+/).map((c2) => replaceCaret(c2, options)).join(" "); + }; + var replaceCaret = (comp, options) => { + debug("caret", comp, options); + const r2 = options.loose ? re[t4.CARETLOOSE] : re[t4.CARET]; + const z = options.includePrerelease ? "-0" : ""; + return comp.replace(r2, (_, M, m2, p3, pr) => { + debug("caret", comp, _, M, m2, p3, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m2)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; + } else if (isX(p3)) { + if (M === "0") { + ret = `>=${M}.${m2}.0${z} <${M}.${+m2 + 1}.0-0`; + } else { + ret = `>=${M}.${m2}.0${z} <${+M + 1}.0.0-0`; + } + } else if (pr) { + debug("replaceCaret pr", pr); + if (M === "0") { + if (m2 === "0") { + ret = `>=${M}.${m2}.${p3}-${pr} <${M}.${m2}.${+p3 + 1}-0`; + } else { + ret = `>=${M}.${m2}.${p3}-${pr} <${M}.${+m2 + 1}.0-0`; + } + } else { + ret = `>=${M}.${m2}.${p3}-${pr} <${+M + 1}.0.0-0`; + } + } else { + debug("no pr"); + if (M === "0") { + if (m2 === "0") { + ret = `>=${M}.${m2}.${p3}${z} <${M}.${m2}.${+p3 + 1}-0`; + } else { + ret = `>=${M}.${m2}.${p3}${z} <${M}.${+m2 + 1}.0-0`; + } + } else { + ret = `>=${M}.${m2}.${p3} <${+M + 1}.0.0-0`; + } + } + debug("caret return", ret); + return ret; + }); + }; + var replaceXRanges = (comp, options) => { + debug("replaceXRanges", comp, options); + return comp.split(/\s+/).map((c2) => replaceXRange(c2, options)).join(" "); + }; + var replaceXRange = (comp, options) => { + comp = comp.trim(); + const r2 = options.loose ? re[t4.XRANGELOOSE] : re[t4.XRANGE]; + return comp.replace(r2, (ret, gtlt, M, m2, p3, pr) => { + debug("xRange", comp, ret, gtlt, M, m2, p3, pr); + const xM = isX(M); + const xm = xM || isX(m2); + const xp = xm || isX(p3); + const anyX = xp; + if (gtlt === "=" && anyX) { + gtlt = ""; + } + pr = options.includePrerelease ? "-0" : ""; + if (xM) { + if (gtlt === ">" || gtlt === "<") { + ret = "<0.0.0-0"; + } else { + ret = "*"; + } + } else if (gtlt && anyX) { + if (xm) { + m2 = 0; + } + p3 = 0; + if (gtlt === ">") { + gtlt = ">="; + if (xm) { + M = +M + 1; + m2 = 0; + p3 = 0; + } else { + m2 = +m2 + 1; + p3 = 0; + } + } else if (gtlt === "<=") { + gtlt = "<"; + if (xm) { + M = +M + 1; + } else { + m2 = +m2 + 1; + } + } + if (gtlt === "<") { + pr = "-0"; + } + ret = `${gtlt + M}.${m2}.${p3}${pr}`; + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; + } else if (xp) { + ret = `>=${M}.${m2}.0${pr} <${M}.${+m2 + 1}.0-0`; + } + debug("xRange return", ret); + return ret; + }); + }; + var replaceStars = (comp, options) => { + debug("replaceStars", comp, options); + return comp.trim().replace(re[t4.STAR], ""); + }; + var replaceGTE0 = (comp, options) => { + debug("replaceGTE0", comp, options); + return comp.trim().replace(re[options.includePrerelease ? t4.GTE0PRE : t4.GTE0], ""); + }; + var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { + if (isX(fM)) { + from = ""; + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? "-0" : ""}`; + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; + } else if (fpr) { + from = `>=${from}`; + } else { + from = `>=${from}${incPr ? "-0" : ""}`; + } + if (isX(tM)) { + to = ""; + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0`; + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0`; + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}`; + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0`; + } else { + to = `<=${to}`; + } + return `${from} ${to}`.trim(); + }; + var testSet = (set, version3, options) => { + for (let i6 = 0; i6 < set.length; i6++) { + if (!set[i6].test(version3)) { + return false; + } + } + if (version3.prerelease.length && !options.includePrerelease) { + for (let i6 = 0; i6 < set.length; i6++) { + debug(set[i6].semver); + if (set[i6].semver === Comparator.ANY) { + continue; + } + if (set[i6].semver.prerelease.length > 0) { + const allowed = set[i6].semver; + if (allowed.major === version3.major && allowed.minor === version3.minor && allowed.patch === version3.patch) { + return true; + } + } + } + return false; + } + return true; + }; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js +var require_comparator = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js"(exports2, module2) { + var ANY = Symbol("SemVer ANY"); + var Comparator = class _Comparator { + static get ANY() { + return ANY; + } + constructor(comp, options) { + options = parseOptions(options); + if (comp instanceof _Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; + } + } + comp = comp.trim().split(/\s+/).join(" "); + debug("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; + } else { + this.value = this.operator + this.semver.version; + } + debug("comp", this); + } + parse(comp) { + const r2 = this.options.loose ? re[t4.COMPARATORLOOSE] : re[t4.COMPARATOR]; + const m2 = comp.match(r2); + if (!m2) { + throw new TypeError(`Invalid comparator: ${comp}`); + } + this.operator = m2[1] !== void 0 ? m2[1] : ""; + if (this.operator === "=") { + this.operator = ""; + } + if (!m2[2]) { + this.semver = ANY; + } else { + this.semver = new SemVer(m2[2], this.options.loose); + } + } + toString() { + return this.value; + } + test(version3) { + debug("Comparator.test", version3, this.options.loose); + if (this.semver === ANY || version3 === ANY) { + return true; + } + if (typeof version3 === "string") { + try { + version3 = new SemVer(version3, this.options); + } catch (er) { + return false; + } + } + return cmp(version3, this.operator, this.semver, this.options); + } + intersects(comp, options) { + if (!(comp instanceof _Comparator)) { + throw new TypeError("a Comparator is required"); + } + if (this.operator === "") { + if (this.value === "") { + return true; + } + return new Range(comp.value, options).test(this.value); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; + } + return new Range(this.value, options).test(comp.semver); + } + options = parseOptions(options); + if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) { + return false; + } + if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) { + return false; + } + if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { + return true; + } + if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { + return true; + } + if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { + return true; + } + if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { + return true; + } + if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { + return true; + } + return false; + } + }; + module2.exports = Comparator; + var parseOptions = require_parse_options(); + var { safeRe: re, t: t4 } = require_re(); + var cmp = require_cmp(); + var debug = require_debug(); + var SemVer = require_semver(); + var Range = require_range(); + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js +var require_satisfies = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js"(exports2, module2) { + var Range = require_range(); + var satisfies2 = (version3, range, options) => { + try { + range = new Range(range, options); + } catch (er) { + return false; + } + return range.test(version3); + }; + module2.exports = satisfies2; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/to-comparators.js +var require_to_comparators = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/to-comparators.js"(exports2, module2) { + var Range = require_range(); + var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c2) => c2.value).join(" ").trim().split(" ")); + module2.exports = toComparators; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/max-satisfying.js +var require_max_satisfying = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/max-satisfying.js"(exports2, module2) { + var SemVer = require_semver(); + var Range = require_range(); + var maxSatisfying = (versions, range, options) => { + let max = null; + let maxSV = null; + let rangeObj = null; + try { + rangeObj = new Range(range, options); + } catch (er) { + return null; + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + if (!max || maxSV.compare(v) === -1) { + max = v; + maxSV = new SemVer(max, options); + } + } + }); + return max; + }; + module2.exports = maxSatisfying; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-satisfying.js +var require_min_satisfying = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-satisfying.js"(exports2, module2) { + var SemVer = require_semver(); + var Range = require_range(); + var minSatisfying = (versions, range, options) => { + let min = null; + let minSV = null; + let rangeObj = null; + try { + rangeObj = new Range(range, options); + } catch (er) { + return null; + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + if (!min || minSV.compare(v) === 1) { + min = v; + minSV = new SemVer(min, options); + } + } + }); + return min; + }; + module2.exports = minSatisfying; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-version.js +var require_min_version = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/min-version.js"(exports2, module2) { + var SemVer = require_semver(); + var Range = require_range(); + var gt = require_gt(); + var minVersion = (range, loose) => { + range = new Range(range, loose); + let minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; + } + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; + } + minver = null; + for (let i6 = 0; i6 < range.set.length; ++i6) { + const comparators = range.set[i6]; + let setMin = null; + comparators.forEach((comparator) => { + const compver = new SemVer(comparator.semver.version); + switch (comparator.operator) { + case ">": + if (compver.prerelease.length === 0) { + compver.patch++; + } else { + compver.prerelease.push(0); + } + compver.raw = compver.format(); + /* fallthrough */ + case "": + case ">=": + if (!setMin || gt(compver, setMin)) { + setMin = compver; + } + break; + case "<": + case "<=": + break; + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`); + } + }); + if (setMin && (!minver || gt(minver, setMin))) { + minver = setMin; + } + } + if (minver && range.test(minver)) { + return minver; + } + return null; + }; + module2.exports = minVersion; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/valid.js +var require_valid2 = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/valid.js"(exports2, module2) { + var Range = require_range(); + var validRange = (range, options) => { + try { + return new Range(range, options).range || "*"; + } catch (er) { + return null; + } + }; + module2.exports = validRange; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js +var require_outside = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/outside.js"(exports2, module2) { + var SemVer = require_semver(); + var Comparator = require_comparator(); + var { ANY } = Comparator; + var Range = require_range(); + var satisfies2 = require_satisfies(); + var gt = require_gt(); + var lt = require_lt(); + var lte = require_lte(); + var gte2 = require_gte(); + var outside = (version3, range, hilo, options) => { + version3 = new SemVer(version3, options); + range = new Range(range, options); + let gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte2; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + if (satisfies2(version3, range, options)) { + return false; + } + for (let i6 = 0; i6 < range.set.length; ++i6) { + const comparators = range.set[i6]; + let high = null; + let low = null; + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); + } + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator; + } + }); + if (high.operator === comp || high.operator === ecomp) { + return false; + } + if ((!low.operator || low.operator === comp) && ltefn(version3, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version3, low.semver)) { + return false; + } + } + return true; + }; + module2.exports = outside; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/gtr.js +var require_gtr = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/gtr.js"(exports2, module2) { + var outside = require_outside(); + var gtr = (version3, range, options) => outside(version3, range, ">", options); + module2.exports = gtr; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/ltr.js +var require_ltr = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/ltr.js"(exports2, module2) { + var outside = require_outside(); + var ltr = (version3, range, options) => outside(version3, range, "<", options); + module2.exports = ltr; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/intersects.js +var require_intersects = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/intersects.js"(exports2, module2) { + var Range = require_range(); + var intersects = (r1, r2, options) => { + r1 = new Range(r1, options); + r2 = new Range(r2, options); + return r1.intersects(r2, options); + }; + module2.exports = intersects; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/simplify.js +var require_simplify = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/simplify.js"(exports2, module2) { + var satisfies2 = require_satisfies(); + var compare = require_compare(); + module2.exports = (versions, range, options) => { + const set = []; + let first2 = null; + let prev2 = null; + const v = versions.sort((a2, b) => compare(a2, b, options)); + for (const version3 of v) { + const included = satisfies2(version3, range, options); + if (included) { + prev2 = version3; + if (!first2) { + first2 = version3; + } + } else { + if (prev2) { + set.push([first2, prev2]); + } + prev2 = null; + first2 = null; + } + } + if (first2) { + set.push([first2, null]); + } + const ranges = []; + for (const [min, max] of set) { + if (min === max) { + ranges.push(min); + } else if (!max && min === v[0]) { + ranges.push("*"); + } else if (!max) { + ranges.push(`>=${min}`); + } else if (min === v[0]) { + ranges.push(`<=${max}`); + } else { + ranges.push(`${min} - ${max}`); + } + } + const simplified = ranges.join(" || "); + const original = typeof range.raw === "string" ? range.raw : String(range); + return simplified.length < original.length ? simplified : range; + }; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/subset.js +var require_subset = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/ranges/subset.js"(exports2, module2) { + var Range = require_range(); + var Comparator = require_comparator(); + var { ANY } = Comparator; + var satisfies2 = require_satisfies(); + var compare = require_compare(); + var subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true; + } + sub = new Range(sub, options); + dom = new Range(dom, options); + let sawNonNull = false; + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options); + sawNonNull = sawNonNull || isSub !== null; + if (isSub) { + continue OUTER; + } + } + if (sawNonNull) { + return false; + } + } + return true; + }; + var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")]; + var minimumVersion = [new Comparator(">=0.0.0")]; + var simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true; + } + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true; + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease; + } else { + sub = minimumVersion; + } + } + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true; + } else { + dom = minimumVersion; + } + } + const eqSet = /* @__PURE__ */ new Set(); + let gt, lt; + for (const c2 of sub) { + if (c2.operator === ">" || c2.operator === ">=") { + gt = higherGT(gt, c2, options); + } else if (c2.operator === "<" || c2.operator === "<=") { + lt = lowerLT(lt, c2, options); + } else { + eqSet.add(c2.semver); + } + } + if (eqSet.size > 1) { + return null; + } + let gtltComp; + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options); + if (gtltComp > 0) { + return null; + } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) { + return null; + } + } + for (const eq2 of eqSet) { + if (gt && !satisfies2(eq2, String(gt), options)) { + return null; + } + if (lt && !satisfies2(eq2, String(lt), options)) { + return null; + } + for (const c2 of dom) { + if (!satisfies2(eq2, String(c2), options)) { + return false; + } + } + return true; + } + let higher, lower; + let hasDomLT, hasDomGT; + let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false; + let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false; + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false; + } + for (const c2 of dom) { + hasDomGT = hasDomGT || c2.operator === ">" || c2.operator === ">="; + hasDomLT = hasDomLT || c2.operator === "<" || c2.operator === "<="; + if (gt) { + if (needDomGTPre) { + if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomGTPre.major && c2.semver.minor === needDomGTPre.minor && c2.semver.patch === needDomGTPre.patch) { + needDomGTPre = false; + } + } + if (c2.operator === ">" || c2.operator === ">=") { + higher = higherGT(gt, c2, options); + if (higher === c2 && higher !== gt) { + return false; + } + } else if (gt.operator === ">=" && !satisfies2(gt.semver, String(c2), options)) { + return false; + } + } + if (lt) { + if (needDomLTPre) { + if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomLTPre.major && c2.semver.minor === needDomLTPre.minor && c2.semver.patch === needDomLTPre.patch) { + needDomLTPre = false; + } + } + if (c2.operator === "<" || c2.operator === "<=") { + lower = lowerLT(lt, c2, options); + if (lower === c2 && lower !== lt) { + return false; + } + } else if (lt.operator === "<=" && !satisfies2(lt.semver, String(c2), options)) { + return false; + } + } + if (!c2.operator && (lt || gt) && gtltComp !== 0) { + return false; + } + } + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false; + } + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false; + } + if (needDomGTPre || needDomLTPre) { + return false; + } + return true; + }; + var higherGT = (a2, b, options) => { + if (!a2) { + return b; + } + const comp = compare(a2.semver, b.semver, options); + return comp > 0 ? a2 : comp < 0 ? b : b.operator === ">" && a2.operator === ">=" ? b : a2; + }; + var lowerLT = (a2, b, options) => { + if (!a2) { + return b; + } + const comp = compare(a2.semver, b.semver, options); + return comp < 0 ? a2 : comp > 0 ? b : b.operator === "<" && a2.operator === "<=" ? b : a2; + }; + module2.exports = subset; + } +}); + +// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/index.js +var require_semver2 = __commonJS({ + "../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/index.js"(exports2, module2) { + var internalRe = require_re(); + var constants3 = require_constants(); + var SemVer = require_semver(); + var identifiers = require_identifiers(); + var parse12 = require_parse(); + var valid = require_valid(); + var clean = require_clean(); + var inc = require_inc(); + var diff = require_diff(); + var major = require_major(); + var minor = require_minor(); + var patch = require_patch(); + var prerelease = require_prerelease(); + var compare = require_compare(); + var rcompare = require_rcompare(); + var compareLoose = require_compare_loose(); + var compareBuild = require_compare_build(); + var sort = require_sort(); + var rsort = require_rsort(); + var gt = require_gt(); + var lt = require_lt(); + var eq2 = require_eq(); + var neq = require_neq(); + var gte2 = require_gte(); + var lte = require_lte(); + var cmp = require_cmp(); + var coerce = require_coerce(); + var Comparator = require_comparator(); + var Range = require_range(); + var satisfies2 = require_satisfies(); + var toComparators = require_to_comparators(); + var maxSatisfying = require_max_satisfying(); + var minSatisfying = require_min_satisfying(); + var minVersion = require_min_version(); + var validRange = require_valid2(); + var outside = require_outside(); + var gtr = require_gtr(); + var ltr = require_ltr(); + var intersects = require_intersects(); + var simplifyRange = require_simplify(); + var subset = require_subset(); + module2.exports = { + parse: parse12, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq: eq2, + neq, + gte: gte2, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies: satisfies2, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants3.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants3.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers + }; + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/format.js +var require_format = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/format.js"(exports2, module2) { + "use strict"; + var InvalidFormatError = class _InvalidFormatError extends Error { + constructor(formatFn) { + super(`Format functions must be synchronous taking a two arguments: (info, opts) +Found: ${formatFn.toString().split("\n")[0]} +`); + Error.captureStackTrace(this, _InvalidFormatError); + } + }; + module2.exports = (formatFn) => { + if (formatFn.length > 2) { + throw new InvalidFormatError(formatFn); + } + function Format(options = {}) { + this.options = options; + } + Format.prototype.transform = formatFn; + function createFormatWrap(opts) { + return new Format(opts); + } + createFormatWrap.Format = Format; + return createFormatWrap; + }; + } +}); + +// ../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/styles.js +var require_styles = __commonJS({ + "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/styles.js"(exports2, module2) { + var styles = {}; + module2["exports"] = styles; + var codes = { + reset: [0, 0], + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29], + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], + grey: [90, 39], + brightRed: [91, 39], + brightGreen: [92, 39], + brightYellow: [93, 39], + brightBlue: [94, 39], + brightMagenta: [95, 39], + brightCyan: [96, 39], + brightWhite: [97, 39], + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + bgGray: [100, 49], + bgGrey: [100, 49], + bgBrightRed: [101, 49], + bgBrightGreen: [102, 49], + bgBrightYellow: [103, 49], + bgBrightBlue: [104, 49], + bgBrightMagenta: [105, 49], + bgBrightCyan: [106, 49], + bgBrightWhite: [107, 49], + // legacy styles for colors pre v1.0.0 + blackBG: [40, 49], + redBG: [41, 49], + greenBG: [42, 49], + yellowBG: [43, 49], + blueBG: [44, 49], + magentaBG: [45, 49], + cyanBG: [46, 49], + whiteBG: [47, 49] + }; + Object.keys(codes).forEach(function(key) { + var val2 = codes[key]; + var style = styles[key] = []; + style.open = "\x1B[" + val2[0] + "m"; + style.close = "\x1B[" + val2[1] + "m"; + }); + } +}); + +// ../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/system/has-flag.js +var require_has_flag = __commonJS({ + "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/system/has-flag.js"(exports2, module2) { + "use strict"; + module2.exports = function(flag, argv) { + argv = argv || process.argv || []; + var terminatorPos = argv.indexOf("--"); + var prefix = /^-{1,2}/.test(flag) ? "" : "--"; + var pos = argv.indexOf(prefix + flag); + return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); + }; + } +}); + +// ../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/system/supports-colors.js +var require_supports_colors = __commonJS({ + "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module2) { + "use strict"; + var os2 = __require("os"); + var hasFlag = require_has_flag(); + var env = process.env; + var forceColor = void 0; + if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false")) { + forceColor = false; + } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + forceColor = true; + } + if ("FORCE_COLOR" in env) { + forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0; + } + function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; + } + function supportsColor(stream5) { + if (forceColor === false) { + return 0; + } + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; + } + if (hasFlag("color=256")) { + return 2; + } + if (stream5 && !stream5.isTTY && forceColor !== true) { + return 0; + } + var min = forceColor ? 1 : 0; + if (process.platform === "win32") { + var osRelease = os2.release().split("."); + if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + return 1; + } + if ("CI" in env) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(sign) { + return sign in env; + }) || env.CI_NAME === "codeship") { + return 1; + } + return min; + } + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + if ("TERM_PROGRAM" in env) { + var version3 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env.TERM_PROGRAM) { + case "iTerm.app": + return version3 >= 3 ? 3 : 2; + case "Hyper": + return 3; + case "Apple_Terminal": + return 2; + } + } + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + if ("COLORTERM" in env) { + return 1; + } + if (env.TERM === "dumb") { + return min; + } + return min; + } + function getSupportLevel(stream5) { + var level = supportsColor(stream5); + return translateLevel(level); + } + module2.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel(process.stdout), + stderr: getSupportLevel(process.stderr) + }; + } +}); + +// ../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/custom/trap.js +var require_trap = __commonJS({ + "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/custom/trap.js"(exports2, module2) { + module2["exports"] = function runTheTrap(text3, options) { + var result = ""; + text3 = text3 || "Run the trap, drop the bass"; + text3 = text3.split(""); + var trap = { + a: ["@", "\u0104", "\u023A", "\u0245", "\u0394", "\u039B", "\u0414"], + b: ["\xDF", "\u0181", "\u0243", "\u026E", "\u03B2", "\u0E3F"], + c: ["\xA9", "\u023B", "\u03FE"], + d: ["\xD0", "\u018A", "\u0500", "\u0501", "\u0502", "\u0503"], + e: [ + "\xCB", + "\u0115", + "\u018E", + "\u0258", + "\u03A3", + "\u03BE", + "\u04BC", + "\u0A6C" + ], + f: ["\u04FA"], + g: ["\u0262"], + h: ["\u0126", "\u0195", "\u04A2", "\u04BA", "\u04C7", "\u050A"], + i: ["\u0F0F"], + j: ["\u0134"], + k: ["\u0138", "\u04A0", "\u04C3", "\u051E"], + l: ["\u0139"], + m: ["\u028D", "\u04CD", "\u04CE", "\u0520", "\u0521", "\u0D69"], + n: ["\xD1", "\u014B", "\u019D", "\u0376", "\u03A0", "\u048A"], + o: [ + "\xD8", + "\xF5", + "\xF8", + "\u01FE", + "\u0298", + "\u047A", + "\u05DD", + "\u06DD", + "\u0E4F" + ], + p: ["\u01F7", "\u048E"], + q: ["\u09CD"], + r: ["\xAE", "\u01A6", "\u0210", "\u024C", "\u0280", "\u042F"], + s: ["\xA7", "\u03DE", "\u03DF", "\u03E8"], + t: ["\u0141", "\u0166", "\u0373"], + u: ["\u01B1", "\u054D"], + v: ["\u05D8"], + w: ["\u0428", "\u0460", "\u047C", "\u0D70"], + x: ["\u04B2", "\u04FE", "\u04FC", "\u04FD"], + y: ["\xA5", "\u04B0", "\u04CB"], + z: ["\u01B5", "\u0240"] + }; + text3.forEach(function(c2) { + c2 = c2.toLowerCase(); + var chars = trap[c2] || [" "]; + var rand = Math.floor(Math.random() * chars.length); + if (typeof trap[c2] !== "undefined") { + result += trap[c2][rand]; + } else { + result += c2; + } + }); + return result; + }; + } +}); + +// ../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/custom/zalgo.js +var require_zalgo = __commonJS({ + "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/custom/zalgo.js"(exports2, module2) { + module2["exports"] = function zalgo(text3, options) { + text3 = text3 || " he is here "; + var soul = { + "up": [ + "\u030D", + "\u030E", + "\u0304", + "\u0305", + "\u033F", + "\u0311", + "\u0306", + "\u0310", + "\u0352", + "\u0357", + "\u0351", + "\u0307", + "\u0308", + "\u030A", + "\u0342", + "\u0313", + "\u0308", + "\u034A", + "\u034B", + "\u034C", + "\u0303", + "\u0302", + "\u030C", + "\u0350", + "\u0300", + "\u0301", + "\u030B", + "\u030F", + "\u0312", + "\u0313", + "\u0314", + "\u033D", + "\u0309", + "\u0363", + "\u0364", + "\u0365", + "\u0366", + "\u0367", + "\u0368", + "\u0369", + "\u036A", + "\u036B", + "\u036C", + "\u036D", + "\u036E", + "\u036F", + "\u033E", + "\u035B", + "\u0346", + "\u031A" + ], + "down": [ + "\u0316", + "\u0317", + "\u0318", + "\u0319", + "\u031C", + "\u031D", + "\u031E", + "\u031F", + "\u0320", + "\u0324", + "\u0325", + "\u0326", + "\u0329", + "\u032A", + "\u032B", + "\u032C", + "\u032D", + "\u032E", + "\u032F", + "\u0330", + "\u0331", + "\u0332", + "\u0333", + "\u0339", + "\u033A", + "\u033B", + "\u033C", + "\u0345", + "\u0347", + "\u0348", + "\u0349", + "\u034D", + "\u034E", + "\u0353", + "\u0354", + "\u0355", + "\u0356", + "\u0359", + "\u035A", + "\u0323" + ], + "mid": [ + "\u0315", + "\u031B", + "\u0300", + "\u0301", + "\u0358", + "\u0321", + "\u0322", + "\u0327", + "\u0328", + "\u0334", + "\u0335", + "\u0336", + "\u035C", + "\u035D", + "\u035E", + "\u035F", + "\u0360", + "\u0362", + "\u0338", + "\u0337", + "\u0361", + " \u0489" + ] + }; + var all3 = [].concat(soul.up, soul.down, soul.mid); + function randomNumber(range) { + var r2 = Math.floor(Math.random() * range); + return r2; + } + function isChar(character) { + var bool = false; + all3.filter(function(i6) { + bool = i6 === character; + }); + return bool; + } + function heComes(text4, options2) { + var result = ""; + var counts; + var l5; + options2 = options2 || {}; + options2["up"] = typeof options2["up"] !== "undefined" ? options2["up"] : true; + options2["mid"] = typeof options2["mid"] !== "undefined" ? options2["mid"] : true; + options2["down"] = typeof options2["down"] !== "undefined" ? options2["down"] : true; + options2["size"] = typeof options2["size"] !== "undefined" ? options2["size"] : "maxi"; + text4 = text4.split(""); + for (l5 in text4) { + if (isChar(l5)) { + continue; + } + result = result + text4[l5]; + counts = { "up": 0, "down": 0, "mid": 0 }; + switch (options2.size) { + case "mini": + counts.up = randomNumber(8); + counts.mid = randomNumber(2); + counts.down = randomNumber(8); + break; + case "maxi": + counts.up = randomNumber(16) + 3; + counts.mid = randomNumber(4) + 1; + counts.down = randomNumber(64) + 3; + break; + default: + counts.up = randomNumber(8) + 1; + counts.mid = randomNumber(6) / 2; + counts.down = randomNumber(8) + 1; + break; + } + var arr = ["up", "mid", "down"]; + for (var d3 in arr) { + var index2 = arr[d3]; + for (var i6 = 0; i6 <= counts[index2]; i6++) { + if (options2[index2]) { + result = result + soul[index2][randomNumber(soul[index2].length)]; + } + } + } + } + return result; + } + return heComes(text3, options); + }; + } +}); + +// ../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/maps/america.js +var require_america = __commonJS({ + "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/maps/america.js"(exports2, module2) { + module2["exports"] = function(colors) { + return function(letter, i6, exploded) { + if (letter === " ") return letter; + switch (i6 % 3) { + case 0: + return colors.red(letter); + case 1: + return colors.white(letter); + case 2: + return colors.blue(letter); + } + }; + }; + } +}); + +// ../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/maps/zebra.js +var require_zebra = __commonJS({ + "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/maps/zebra.js"(exports2, module2) { + module2["exports"] = function(colors) { + return function(letter, i6, exploded) { + return i6 % 2 === 0 ? letter : colors.inverse(letter); + }; + }; + } +}); + +// ../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/maps/rainbow.js +var require_rainbow = __commonJS({ + "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/maps/rainbow.js"(exports2, module2) { + module2["exports"] = function(colors) { + var rainbowColors = ["red", "yellow", "green", "blue", "magenta"]; + return function(letter, i6, exploded) { + if (letter === " ") { + return letter; + } else { + return colors[rainbowColors[i6++ % rainbowColors.length]](letter); + } + }; + }; + } +}); + +// ../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/maps/random.js +var require_random = __commonJS({ + "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/maps/random.js"(exports2, module2) { + module2["exports"] = function(colors) { + var available = [ + "underline", + "inverse", + "grey", + "yellow", + "red", + "green", + "blue", + "white", + "cyan", + "magenta", + "brightYellow", + "brightRed", + "brightGreen", + "brightBlue", + "brightWhite", + "brightCyan", + "brightMagenta" + ]; + return function(letter, i6, exploded) { + return letter === " " ? letter : colors[available[Math.round(Math.random() * (available.length - 2))]](letter); + }; + }; + } +}); + +// ../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/colors.js +var require_colors = __commonJS({ + "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/lib/colors.js"(exports2, module2) { + var colors = {}; + module2["exports"] = colors; + colors.themes = {}; + var util5 = __require("util"); + var ansiStyles = colors.styles = require_styles(); + var defineProps = Object.defineProperties; + var newLineRegex = new RegExp(/[\r\n]+/g); + colors.supportsColor = require_supports_colors().supportsColor; + if (typeof colors.enabled === "undefined") { + colors.enabled = colors.supportsColor() !== false; + } + colors.enable = function() { + colors.enabled = true; + }; + colors.disable = function() { + colors.enabled = false; + }; + colors.stripColors = colors.strip = function(str) { + return ("" + str).replace(/\x1B\[\d+m/g, ""); + }; + var stylize = colors.stylize = function stylize2(str, style) { + if (!colors.enabled) { + return str + ""; + } + var styleMap = ansiStyles[style]; + if (!styleMap && style in colors) { + return colors[style](str); + } + return styleMap.open + str + styleMap.close; + }; + var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; + var escapeStringRegexp = function(str) { + if (typeof str !== "string") { + throw new TypeError("Expected a string"); + } + return str.replace(matchOperatorsRe, "\\$&"); + }; + function build(_styles) { + var builder = function builder2() { + return applyStyle.apply(builder2, arguments); + }; + builder._styles = _styles; + builder.__proto__ = proto; + return builder; + } + var styles = function() { + var ret = {}; + ansiStyles.grey = ansiStyles.gray; + Object.keys(ansiStyles).forEach(function(key) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), "g"); + ret[key] = { + get: function() { + return build(this._styles.concat(key)); + } + }; + }); + return ret; + }(); + var proto = defineProps(function colors2() { + }, styles); + function applyStyle() { + var args2 = Array.prototype.slice.call(arguments); + var str = args2.map(function(arg) { + if (arg != null && arg.constructor === String) { + return arg; + } else { + return util5.inspect(arg); + } + }).join(" "); + if (!colors.enabled || !str) { + return str; + } + var newLinesPresent = str.indexOf("\n") != -1; + var nestedStyles = this._styles; + var i6 = nestedStyles.length; + while (i6--) { + var code = ansiStyles[nestedStyles[i6]]; + str = code.open + str.replace(code.closeRe, code.open) + code.close; + if (newLinesPresent) { + str = str.replace(newLineRegex, function(match2) { + return code.close + match2 + code.open; + }); + } + } + return str; + } + colors.setTheme = function(theme) { + if (typeof theme === "string") { + console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));"); + return; + } + for (var style in theme) { + (function(style2) { + colors[style2] = function(str) { + if (typeof theme[style2] === "object") { + var out = str; + for (var i6 in theme[style2]) { + out = colors[theme[style2][i6]](out); + } + return out; + } + return colors[theme[style2]](str); + }; + })(style); + } + }; + function init2() { + var ret = {}; + Object.keys(styles).forEach(function(name) { + ret[name] = { + get: function() { + return build([name]); + } + }; + }); + return ret; + } + var sequencer = function sequencer2(map3, str) { + var exploded = str.split(""); + exploded = exploded.map(map3); + return exploded.join(""); + }; + colors.trap = require_trap(); + colors.zalgo = require_zalgo(); + colors.maps = {}; + colors.maps.america = require_america()(colors); + colors.maps.zebra = require_zebra()(colors); + colors.maps.rainbow = require_rainbow()(colors); + colors.maps.random = require_random()(colors); + for (map2 in colors.maps) { + (function(map3) { + colors[map3] = function(str) { + return sequencer(colors.maps[map3], str); + }; + })(map2); + } + var map2; + defineProps(colors, init2()); + } +}); + +// ../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/safe.js +var require_safe = __commonJS({ + "../../node_modules/.pnpm/@colors+colors@1.6.0/node_modules/@colors/colors/safe.js"(exports2, module2) { + var colors = require_colors(); + module2["exports"] = colors; + } +}); + +// ../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/config/cli.js +var require_cli = __commonJS({ + "../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/config/cli.js"(exports2) { + "use strict"; + exports2.levels = { + error: 0, + warn: 1, + help: 2, + data: 3, + info: 4, + debug: 5, + prompt: 6, + verbose: 7, + input: 8, + silly: 9 + }; + exports2.colors = { + error: "red", + warn: "yellow", + help: "cyan", + data: "grey", + info: "green", + debug: "blue", + prompt: "grey", + verbose: "cyan", + input: "grey", + silly: "magenta" + }; + } +}); + +// ../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/config/npm.js +var require_npm = __commonJS({ + "../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/config/npm.js"(exports2) { + "use strict"; + exports2.levels = { + error: 0, + warn: 1, + info: 2, + http: 3, + verbose: 4, + debug: 5, + silly: 6 + }; + exports2.colors = { + error: "red", + warn: "yellow", + info: "green", + http: "green", + verbose: "cyan", + debug: "blue", + silly: "magenta" + }; + } +}); + +// ../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/config/syslog.js +var require_syslog = __commonJS({ + "../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/config/syslog.js"(exports2) { + "use strict"; + exports2.levels = { + emerg: 0, + alert: 1, + crit: 2, + error: 3, + warning: 4, + notice: 5, + info: 6, + debug: 7 + }; + exports2.colors = { + emerg: "red", + alert: "yellow", + crit: "red", + error: "red", + warning: "red", + notice: "yellow", + info: "green", + debug: "blue" + }; + } +}); + +// ../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/config/index.js +var require_config = __commonJS({ + "../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/config/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "cli", { + value: require_cli() + }); + Object.defineProperty(exports2, "npm", { + value: require_npm() + }); + Object.defineProperty(exports2, "syslog", { + value: require_syslog() + }); + } +}); + +// ../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/index.js +var require_triple_beam = __commonJS({ + "../../node_modules/.pnpm/triple-beam@1.4.1/node_modules/triple-beam/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "LEVEL", { + value: Symbol.for("level") + }); + Object.defineProperty(exports2, "MESSAGE", { + value: Symbol.for("message") + }); + Object.defineProperty(exports2, "SPLAT", { + value: Symbol.for("splat") + }); + Object.defineProperty(exports2, "configs", { + value: require_config() + }); + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/colorize.js +var require_colorize = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/colorize.js"(exports2, module2) { + "use strict"; + var colors = require_safe(); + var { LEVEL, MESSAGE } = require_triple_beam(); + colors.enabled = true; + var hasSpace = /\s+/; + var Colorizer = class _Colorizer { + constructor(opts = {}) { + if (opts.colors) { + this.addColors(opts.colors); + } + this.options = opts; + } + /* + * Adds the colors Object to the set of allColors + * known by the Colorizer + * + * @param {Object} colors Set of color mappings to add. + */ + static addColors(clrs) { + const nextColors = Object.keys(clrs).reduce((acc, level) => { + acc[level] = hasSpace.test(clrs[level]) ? clrs[level].split(hasSpace) : clrs[level]; + return acc; + }, {}); + _Colorizer.allColors = Object.assign({}, _Colorizer.allColors || {}, nextColors); + return _Colorizer.allColors; + } + /* + * Adds the colors Object to the set of allColors + * known by the Colorizer + * + * @param {Object} colors Set of color mappings to add. + */ + addColors(clrs) { + return _Colorizer.addColors(clrs); + } + /* + * function colorize (lookup, level, message) + * Performs multi-step colorization using @colors/colors/safe + */ + colorize(lookup, level, message2) { + if (typeof message2 === "undefined") { + message2 = level; + } + if (!Array.isArray(_Colorizer.allColors[lookup])) { + return colors[_Colorizer.allColors[lookup]](message2); + } + for (let i6 = 0, len = _Colorizer.allColors[lookup].length; i6 < len; i6++) { + message2 = colors[_Colorizer.allColors[lookup][i6]](message2); + } + return message2; + } + /* + * function transform (info, opts) + * Attempts to colorize the { level, message } of the given + * `logform` info object. + */ + transform(info, opts) { + if (opts.all && typeof info[MESSAGE] === "string") { + info[MESSAGE] = this.colorize(info[LEVEL], info.level, info[MESSAGE]); + } + if (opts.level || opts.all || !opts.message) { + info.level = this.colorize(info[LEVEL], info.level); + } + if (opts.all || opts.message) { + info.message = this.colorize(info[LEVEL], info.level, info.message); + } + return info; + } + }; + module2.exports = (opts) => new Colorizer(opts); + module2.exports.Colorizer = module2.exports.Format = Colorizer; + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/levels.js +var require_levels = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/levels.js"(exports2, module2) { + "use strict"; + var { Colorizer } = require_colorize(); + module2.exports = (config3) => { + Colorizer.addColors(config3.colors || config3); + return config3; + }; + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/align.js +var require_align = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/align.js"(exports2, module2) { + "use strict"; + var format5 = require_format(); + module2.exports = format5((info) => { + info.message = ` ${info.message}`; + return info; + }); + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/errors.js +var require_errors = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/errors.js"(exports2, module2) { + "use strict"; + var format5 = require_format(); + var { LEVEL, MESSAGE } = require_triple_beam(); + module2.exports = format5((einfo, { stack: stack2, cause }) => { + if (einfo instanceof Error) { + const info = Object.assign({}, einfo, { + level: einfo.level, + [LEVEL]: einfo[LEVEL] || einfo.level, + message: einfo.message, + [MESSAGE]: einfo[MESSAGE] || einfo.message + }); + if (stack2) info.stack = einfo.stack; + if (cause) info.cause = einfo.cause; + return info; + } + if (!(einfo.message instanceof Error)) return einfo; + const err = einfo.message; + Object.assign(einfo, err); + einfo.message = err.message; + einfo[MESSAGE] = err.message; + if (stack2) einfo.stack = err.stack; + if (cause) einfo.cause = err.cause; + return einfo; + }); + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/pad-levels.js +var require_pad_levels = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/pad-levels.js"(exports2, module2) { + "use strict"; + var { configs, LEVEL, MESSAGE } = require_triple_beam(); + var Padder = class _Padder { + constructor(opts = { levels: configs.npm.levels }) { + this.paddings = _Padder.paddingForLevels(opts.levels, opts.filler); + this.options = opts; + } + /** + * Returns the maximum length of keys in the specified `levels` Object. + * @param {Object} levels Set of all levels to calculate longest level against. + * @returns {Number} Maximum length of the longest level string. + */ + static getLongestLevel(levels) { + const lvls = Object.keys(levels).map((level) => level.length); + return Math.max(...lvls); + } + /** + * Returns the padding for the specified `level` assuming that the + * maximum length of all levels it's associated with is `maxLength`. + * @param {String} level Level to calculate padding for. + * @param {String} filler Repeatable text to use for padding. + * @param {Number} maxLength Length of the longest level + * @returns {String} Padding string for the `level` + */ + static paddingForLevel(level, filler, maxLength) { + const targetLen = maxLength + 1 - level.length; + const rep = Math.floor(targetLen / filler.length); + const padding = `${filler}${filler.repeat(rep)}`; + return padding.slice(0, targetLen); + } + /** + * Returns an object with the string paddings for the given `levels` + * using the specified `filler`. + * @param {Object} levels Set of all levels to calculate padding for. + * @param {String} filler Repeatable text to use for padding. + * @returns {Object} Mapping of level to desired padding. + */ + static paddingForLevels(levels, filler = " ") { + const maxLength = _Padder.getLongestLevel(levels); + return Object.keys(levels).reduce((acc, level) => { + acc[level] = _Padder.paddingForLevel(level, filler, maxLength); + return acc; + }, {}); + } + /** + * Prepends the padding onto the `message` based on the `LEVEL` of + * the `info`. This is based on the behavior of `winston@2` which also + * prepended the level onto the message. + * + * See: https://github.com/winstonjs/winston/blob/2.x/lib/winston/logger.js#L198-L201 + * + * @param {Info} info Logform info object + * @param {Object} opts Options passed along to this instance. + * @returns {Info} Modified logform info object. + */ + transform(info, opts) { + info.message = `${this.paddings[info[LEVEL]]}${info.message}`; + if (info[MESSAGE]) { + info[MESSAGE] = `${this.paddings[info[LEVEL]]}${info[MESSAGE]}`; + } + return info; + } + }; + module2.exports = (opts) => new Padder(opts); + module2.exports.Padder = module2.exports.Format = Padder; + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/cli.js +var require_cli2 = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/cli.js"(exports2, module2) { + "use strict"; + var { Colorizer } = require_colorize(); + var { Padder } = require_pad_levels(); + var { configs, MESSAGE } = require_triple_beam(); + var CliFormat = class { + constructor(opts = {}) { + if (!opts.levels) { + opts.levels = configs.cli.levels; + } + this.colorizer = new Colorizer(opts); + this.padder = new Padder(opts); + this.options = opts; + } + /* + * function transform (info, opts) + * Attempts to both: + * 1. Pad the { level } + * 2. Colorize the { level, message } + * of the given `logform` info object depending on the `opts`. + */ + transform(info, opts) { + this.colorizer.transform( + this.padder.transform(info, opts), + opts + ); + info[MESSAGE] = `${info.level}:${info.message}`; + return info; + } + }; + module2.exports = (opts) => new CliFormat(opts); + module2.exports.Format = CliFormat; + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/combine.js +var require_combine = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/combine.js"(exports2, module2) { + "use strict"; + var format5 = require_format(); + function cascade(formats) { + if (!formats.every(isValidFormat)) { + return; + } + return (info) => { + let obj = info; + for (let i6 = 0; i6 < formats.length; i6++) { + obj = formats[i6].transform(obj, formats[i6].options); + if (!obj) { + return false; + } + } + return obj; + }; + } + function isValidFormat(fmt) { + if (typeof fmt.transform !== "function") { + throw new Error([ + "No transform function found on format. Did you create a format instance?", + "const myFormat = format(formatFn);", + "const instance = myFormat();" + ].join("\n")); + } + return true; + } + module2.exports = (...formats) => { + const combinedFormat = format5(cascade(formats)); + const instance = combinedFormat(); + instance.Format = combinedFormat.Format; + return instance; + }; + module2.exports.cascade = cascade; + } +}); + +// ../../node_modules/.pnpm/safe-stable-stringify@2.4.3/node_modules/safe-stable-stringify/index.js +var require_safe_stable_stringify = __commonJS({ + "../../node_modules/.pnpm/safe-stable-stringify@2.4.3/node_modules/safe-stable-stringify/index.js"(exports2, module2) { + "use strict"; + var { hasOwnProperty: hasOwnProperty2 } = Object.prototype; + var stringify3 = configure(); + stringify3.configure = configure; + stringify3.stringify = stringify3; + stringify3.default = stringify3; + exports2.stringify = stringify3; + exports2.configure = configure; + module2.exports = stringify3; + var strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/; + function strEscape(str) { + if (str.length < 5e3 && !strEscapeSequencesRegExp.test(str)) { + return `"${str}"`; + } + return JSON.stringify(str); + } + function insertSort(array) { + if (array.length > 200) { + return array.sort(); + } + for (let i6 = 1; i6 < array.length; i6++) { + const currentValue = array[i6]; + let position = i6; + while (position !== 0 && array[position - 1] > currentValue) { + array[position] = array[position - 1]; + position--; + } + array[position] = currentValue; + } + return array; + } + var typedArrayPrototypeGetSymbolToStringTag = Object.getOwnPropertyDescriptor( + Object.getPrototypeOf( + Object.getPrototypeOf( + new Int8Array() + ) + ), + Symbol.toStringTag + ).get; + function isTypedArrayWithEntries(value) { + return typedArrayPrototypeGetSymbolToStringTag.call(value) !== void 0 && value.length !== 0; + } + function stringifyTypedArray(array, separator, maximumBreadth) { + if (array.length < maximumBreadth) { + maximumBreadth = array.length; + } + const whitespace2 = separator === "," ? "" : " "; + let res = `"0":${whitespace2}${array[0]}`; + for (let i6 = 1; i6 < maximumBreadth; i6++) { + res += `${separator}"${i6}":${whitespace2}${array[i6]}`; + } + return res; + } + function getCircularValueOption(options) { + if (hasOwnProperty2.call(options, "circularValue")) { + const circularValue = options.circularValue; + if (typeof circularValue === "string") { + return `"${circularValue}"`; + } + if (circularValue == null) { + return circularValue; + } + if (circularValue === Error || circularValue === TypeError) { + return { + toString() { + throw new TypeError("Converting circular structure to JSON"); + } + }; + } + throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined'); + } + return '"[Circular]"'; + } + function getBooleanOption(options, key) { + let value; + if (hasOwnProperty2.call(options, key)) { + value = options[key]; + if (typeof value !== "boolean") { + throw new TypeError(`The "${key}" argument must be of type boolean`); + } + } + return value === void 0 ? true : value; + } + function getPositiveIntegerOption(options, key) { + let value; + if (hasOwnProperty2.call(options, key)) { + value = options[key]; + if (typeof value !== "number") { + throw new TypeError(`The "${key}" argument must be of type number`); + } + if (!Number.isInteger(value)) { + throw new TypeError(`The "${key}" argument must be an integer`); + } + if (value < 1) { + throw new RangeError(`The "${key}" argument must be >= 1`); + } + } + return value === void 0 ? Infinity : value; + } + function getItemCount(number) { + if (number === 1) { + return "1 item"; + } + return `${number} items`; + } + function getUniqueReplacerSet(replacerArray) { + const replacerSet = /* @__PURE__ */ new Set(); + for (const value of replacerArray) { + if (typeof value === "string" || typeof value === "number") { + replacerSet.add(String(value)); + } + } + return replacerSet; + } + function getStrictOption(options) { + if (hasOwnProperty2.call(options, "strict")) { + const value = options.strict; + if (typeof value !== "boolean") { + throw new TypeError('The "strict" argument must be of type boolean'); + } + if (value) { + return (value2) => { + let message2 = `Object can not safely be stringified. Received type ${typeof value2}`; + if (typeof value2 !== "function") message2 += ` (${value2.toString()})`; + throw new Error(message2); + }; + } + } + } + function configure(options) { + options = { ...options }; + const fail = getStrictOption(options); + if (fail) { + if (options.bigint === void 0) { + options.bigint = false; + } + if (!("circularValue" in options)) { + options.circularValue = Error; + } + } + const circularValue = getCircularValueOption(options); + const bigint = getBooleanOption(options, "bigint"); + const deterministic = getBooleanOption(options, "deterministic"); + const maximumDepth = getPositiveIntegerOption(options, "maximumDepth"); + const maximumBreadth = getPositiveIntegerOption(options, "maximumBreadth"); + function stringifyFnReplacer(key, parent2, stack2, replacer, spacer, indentation) { + let value = parent2[key]; + if (typeof value === "object" && value !== null && typeof value.toJSON === "function") { + value = value.toJSON(key); + } + value = replacer.call(parent2, key, value); + switch (typeof value) { + case "string": + return strEscape(value); + case "object": { + if (value === null) { + return "null"; + } + if (stack2.indexOf(value) !== -1) { + return circularValue; + } + let res = ""; + let join17 = ","; + const originalIndentation = indentation; + if (Array.isArray(value)) { + if (value.length === 0) { + return "[]"; + } + if (maximumDepth < stack2.length + 1) { + return '"[Array]"'; + } + stack2.push(value); + if (spacer !== "") { + indentation += spacer; + res += ` +${indentation}`; + join17 = `, +${indentation}`; + } + const maximumValuesToStringify = Math.min(value.length, maximumBreadth); + let i6 = 0; + for (; i6 < maximumValuesToStringify - 1; i6++) { + const tmp2 = stringifyFnReplacer(String(i6), value, stack2, replacer, spacer, indentation); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += join17; + } + const tmp = stringifyFnReplacer(String(i6), value, stack2, replacer, spacer, indentation); + res += tmp !== void 0 ? tmp : "null"; + if (value.length - 1 > maximumBreadth) { + const removedKeys = value.length - maximumBreadth - 1; + res += `${join17}"... ${getItemCount(removedKeys)} not stringified"`; + } + if (spacer !== "") { + res += ` +${originalIndentation}`; + } + stack2.pop(); + return `[${res}]`; + } + let keys = Object.keys(value); + const keyLength = keys.length; + if (keyLength === 0) { + return "{}"; + } + if (maximumDepth < stack2.length + 1) { + return '"[Object]"'; + } + let whitespace2 = ""; + let separator = ""; + if (spacer !== "") { + indentation += spacer; + join17 = `, +${indentation}`; + whitespace2 = " "; + } + const maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth); + if (deterministic && !isTypedArrayWithEntries(value)) { + keys = insertSort(keys); + } + stack2.push(value); + for (let i6 = 0; i6 < maximumPropertiesToStringify; i6++) { + const key2 = keys[i6]; + const tmp = stringifyFnReplacer(key2, value, stack2, replacer, spacer, indentation); + if (tmp !== void 0) { + res += `${separator}${strEscape(key2)}:${whitespace2}${tmp}`; + separator = join17; + } + } + if (keyLength > maximumBreadth) { + const removedKeys = keyLength - maximumBreadth; + res += `${separator}"...":${whitespace2}"${getItemCount(removedKeys)} not stringified"`; + separator = join17; + } + if (spacer !== "" && separator.length > 1) { + res = ` +${indentation}${res} +${originalIndentation}`; + } + stack2.pop(); + return `{${res}}`; + } + case "number": + return isFinite(value) ? String(value) : fail ? fail(value) : "null"; + case "boolean": + return value === true ? "true" : "false"; + case "undefined": + return void 0; + case "bigint": + if (bigint) { + return String(value); + } + // fallthrough + default: + return fail ? fail(value) : void 0; + } + } + function stringifyArrayReplacer(key, value, stack2, replacer, spacer, indentation) { + if (typeof value === "object" && value !== null && typeof value.toJSON === "function") { + value = value.toJSON(key); + } + switch (typeof value) { + case "string": + return strEscape(value); + case "object": { + if (value === null) { + return "null"; + } + if (stack2.indexOf(value) !== -1) { + return circularValue; + } + const originalIndentation = indentation; + let res = ""; + let join17 = ","; + if (Array.isArray(value)) { + if (value.length === 0) { + return "[]"; + } + if (maximumDepth < stack2.length + 1) { + return '"[Array]"'; + } + stack2.push(value); + if (spacer !== "") { + indentation += spacer; + res += ` +${indentation}`; + join17 = `, +${indentation}`; + } + const maximumValuesToStringify = Math.min(value.length, maximumBreadth); + let i6 = 0; + for (; i6 < maximumValuesToStringify - 1; i6++) { + const tmp2 = stringifyArrayReplacer(String(i6), value[i6], stack2, replacer, spacer, indentation); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += join17; + } + const tmp = stringifyArrayReplacer(String(i6), value[i6], stack2, replacer, spacer, indentation); + res += tmp !== void 0 ? tmp : "null"; + if (value.length - 1 > maximumBreadth) { + const removedKeys = value.length - maximumBreadth - 1; + res += `${join17}"... ${getItemCount(removedKeys)} not stringified"`; + } + if (spacer !== "") { + res += ` +${originalIndentation}`; + } + stack2.pop(); + return `[${res}]`; + } + stack2.push(value); + let whitespace2 = ""; + if (spacer !== "") { + indentation += spacer; + join17 = `, +${indentation}`; + whitespace2 = " "; + } + let separator = ""; + for (const key2 of replacer) { + const tmp = stringifyArrayReplacer(key2, value[key2], stack2, replacer, spacer, indentation); + if (tmp !== void 0) { + res += `${separator}${strEscape(key2)}:${whitespace2}${tmp}`; + separator = join17; + } + } + if (spacer !== "" && separator.length > 1) { + res = ` +${indentation}${res} +${originalIndentation}`; + } + stack2.pop(); + return `{${res}}`; + } + case "number": + return isFinite(value) ? String(value) : fail ? fail(value) : "null"; + case "boolean": + return value === true ? "true" : "false"; + case "undefined": + return void 0; + case "bigint": + if (bigint) { + return String(value); + } + // fallthrough + default: + return fail ? fail(value) : void 0; + } + } + function stringifyIndent(key, value, stack2, spacer, indentation) { + switch (typeof value) { + case "string": + return strEscape(value); + case "object": { + if (value === null) { + return "null"; + } + if (typeof value.toJSON === "function") { + value = value.toJSON(key); + if (typeof value !== "object") { + return stringifyIndent(key, value, stack2, spacer, indentation); + } + if (value === null) { + return "null"; + } + } + if (stack2.indexOf(value) !== -1) { + return circularValue; + } + const originalIndentation = indentation; + if (Array.isArray(value)) { + if (value.length === 0) { + return "[]"; + } + if (maximumDepth < stack2.length + 1) { + return '"[Array]"'; + } + stack2.push(value); + indentation += spacer; + let res2 = ` +${indentation}`; + const join18 = `, +${indentation}`; + const maximumValuesToStringify = Math.min(value.length, maximumBreadth); + let i6 = 0; + for (; i6 < maximumValuesToStringify - 1; i6++) { + const tmp2 = stringifyIndent(String(i6), value[i6], stack2, spacer, indentation); + res2 += tmp2 !== void 0 ? tmp2 : "null"; + res2 += join18; + } + const tmp = stringifyIndent(String(i6), value[i6], stack2, spacer, indentation); + res2 += tmp !== void 0 ? tmp : "null"; + if (value.length - 1 > maximumBreadth) { + const removedKeys = value.length - maximumBreadth - 1; + res2 += `${join18}"... ${getItemCount(removedKeys)} not stringified"`; + } + res2 += ` +${originalIndentation}`; + stack2.pop(); + return `[${res2}]`; + } + let keys = Object.keys(value); + const keyLength = keys.length; + if (keyLength === 0) { + return "{}"; + } + if (maximumDepth < stack2.length + 1) { + return '"[Object]"'; + } + indentation += spacer; + const join17 = `, +${indentation}`; + let res = ""; + let separator = ""; + let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth); + if (isTypedArrayWithEntries(value)) { + res += stringifyTypedArray(value, join17, maximumBreadth); + keys = keys.slice(value.length); + maximumPropertiesToStringify -= value.length; + separator = join17; + } + if (deterministic) { + keys = insertSort(keys); + } + stack2.push(value); + for (let i6 = 0; i6 < maximumPropertiesToStringify; i6++) { + const key2 = keys[i6]; + const tmp = stringifyIndent(key2, value[key2], stack2, spacer, indentation); + if (tmp !== void 0) { + res += `${separator}${strEscape(key2)}: ${tmp}`; + separator = join17; + } + } + if (keyLength > maximumBreadth) { + const removedKeys = keyLength - maximumBreadth; + res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`; + separator = join17; + } + if (separator !== "") { + res = ` +${indentation}${res} +${originalIndentation}`; + } + stack2.pop(); + return `{${res}}`; + } + case "number": + return isFinite(value) ? String(value) : fail ? fail(value) : "null"; + case "boolean": + return value === true ? "true" : "false"; + case "undefined": + return void 0; + case "bigint": + if (bigint) { + return String(value); + } + // fallthrough + default: + return fail ? fail(value) : void 0; + } + } + function stringifySimple(key, value, stack2) { + switch (typeof value) { + case "string": + return strEscape(value); + case "object": { + if (value === null) { + return "null"; + } + if (typeof value.toJSON === "function") { + value = value.toJSON(key); + if (typeof value !== "object") { + return stringifySimple(key, value, stack2); + } + if (value === null) { + return "null"; + } + } + if (stack2.indexOf(value) !== -1) { + return circularValue; + } + let res = ""; + if (Array.isArray(value)) { + if (value.length === 0) { + return "[]"; + } + if (maximumDepth < stack2.length + 1) { + return '"[Array]"'; + } + stack2.push(value); + const maximumValuesToStringify = Math.min(value.length, maximumBreadth); + let i6 = 0; + for (; i6 < maximumValuesToStringify - 1; i6++) { + const tmp2 = stringifySimple(String(i6), value[i6], stack2); + res += tmp2 !== void 0 ? tmp2 : "null"; + res += ","; + } + const tmp = stringifySimple(String(i6), value[i6], stack2); + res += tmp !== void 0 ? tmp : "null"; + if (value.length - 1 > maximumBreadth) { + const removedKeys = value.length - maximumBreadth - 1; + res += `,"... ${getItemCount(removedKeys)} not stringified"`; + } + stack2.pop(); + return `[${res}]`; + } + let keys = Object.keys(value); + const keyLength = keys.length; + if (keyLength === 0) { + return "{}"; + } + if (maximumDepth < stack2.length + 1) { + return '"[Object]"'; + } + let separator = ""; + let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth); + if (isTypedArrayWithEntries(value)) { + res += stringifyTypedArray(value, ",", maximumBreadth); + keys = keys.slice(value.length); + maximumPropertiesToStringify -= value.length; + separator = ","; + } + if (deterministic) { + keys = insertSort(keys); + } + stack2.push(value); + for (let i6 = 0; i6 < maximumPropertiesToStringify; i6++) { + const key2 = keys[i6]; + const tmp = stringifySimple(key2, value[key2], stack2); + if (tmp !== void 0) { + res += `${separator}${strEscape(key2)}:${tmp}`; + separator = ","; + } + } + if (keyLength > maximumBreadth) { + const removedKeys = keyLength - maximumBreadth; + res += `${separator}"...":"${getItemCount(removedKeys)} not stringified"`; + } + stack2.pop(); + return `{${res}}`; + } + case "number": + return isFinite(value) ? String(value) : fail ? fail(value) : "null"; + case "boolean": + return value === true ? "true" : "false"; + case "undefined": + return void 0; + case "bigint": + if (bigint) { + return String(value); + } + // fallthrough + default: + return fail ? fail(value) : void 0; + } + } + function stringify4(value, replacer, space) { + if (arguments.length > 1) { + let spacer = ""; + if (typeof space === "number") { + spacer = " ".repeat(Math.min(space, 10)); + } else if (typeof space === "string") { + spacer = space.slice(0, 10); + } + if (replacer != null) { + if (typeof replacer === "function") { + return stringifyFnReplacer("", { "": value }, [], replacer, spacer, ""); + } + if (Array.isArray(replacer)) { + return stringifyArrayReplacer("", value, [], getUniqueReplacerSet(replacer), spacer, ""); + } + } + if (spacer.length !== 0) { + return stringifyIndent("", value, [], spacer, ""); + } + } + return stringifySimple("", value, []); + } + return stringify4; + } + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/json.js +var require_json = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/json.js"(exports2, module2) { + "use strict"; + var format5 = require_format(); + var { MESSAGE } = require_triple_beam(); + var stringify3 = require_safe_stable_stringify(); + function replacer(key, value) { + if (typeof value === "bigint") + return value.toString(); + return value; + } + module2.exports = format5((info, opts) => { + const jsonStringify = stringify3.configure(opts); + info[MESSAGE] = jsonStringify(info, opts.replacer || replacer, opts.space); + return info; + }); + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/label.js +var require_label = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/label.js"(exports2, module2) { + "use strict"; + var format5 = require_format(); + module2.exports = format5((info, opts) => { + if (opts.message) { + info.message = `[${opts.label}] ${info.message}`; + return info; + } + info.label = opts.label; + return info; + }); + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/logstash.js +var require_logstash = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/logstash.js"(exports2, module2) { + "use strict"; + var format5 = require_format(); + var { MESSAGE } = require_triple_beam(); + var jsonStringify = require_safe_stable_stringify(); + module2.exports = format5((info) => { + const logstash = {}; + if (info.message) { + logstash["@message"] = info.message; + delete info.message; + } + if (info.timestamp) { + logstash["@timestamp"] = info.timestamp; + delete info.timestamp; + } + logstash["@fields"] = info; + info[MESSAGE] = jsonStringify(logstash); + return info; + }); + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/metadata.js +var require_metadata = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/metadata.js"(exports2, module2) { + "use strict"; + var format5 = require_format(); + function fillExcept(info, fillExceptKeys, metadataKey) { + const savedKeys = fillExceptKeys.reduce((acc, key) => { + acc[key] = info[key]; + delete info[key]; + return acc; + }, {}); + const metadata = Object.keys(info).reduce((acc, key) => { + acc[key] = info[key]; + delete info[key]; + return acc; + }, {}); + Object.assign(info, savedKeys, { + [metadataKey]: metadata + }); + return info; + } + function fillWith(info, fillWithKeys, metadataKey) { + info[metadataKey] = fillWithKeys.reduce((acc, key) => { + acc[key] = info[key]; + delete info[key]; + return acc; + }, {}); + return info; + } + module2.exports = format5((info, opts = {}) => { + let metadataKey = "metadata"; + if (opts.key) { + metadataKey = opts.key; + } + let fillExceptKeys = []; + if (!opts.fillExcept && !opts.fillWith) { + fillExceptKeys.push("level"); + fillExceptKeys.push("message"); + } + if (opts.fillExcept) { + fillExceptKeys = opts.fillExcept; + } + if (fillExceptKeys.length > 0) { + return fillExcept(info, fillExceptKeys, metadataKey); + } + if (opts.fillWith) { + return fillWith(info, opts.fillWith, metadataKey); + } + return info; + }); + } +}); + +// ../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +var require_ms = __commonJS({ + "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports2, module2) { + var s4 = 1e3; + var m2 = s4 * 60; + var h = m2 * 60; + var d3 = h * 24; + var w = d3 * 7; + var y6 = d3 * 365.25; + module2.exports = function(val2, options) { + options = options || {}; + var type = typeof val2; + if (type === "string" && val2.length > 0) { + return parse12(val2); + } else if (type === "number" && isFinite(val2)) { + return options.long ? fmtLong(val2) : fmtShort(val2); + } + throw new Error( + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) + ); + }; + function parse12(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match2) { + return; + } + var n2 = parseFloat(match2[1]); + var type = (match2[2] || "ms").toLowerCase(); + switch (type) { + case "years": + case "year": + case "yrs": + case "yr": + case "y": + return n2 * y6; + case "weeks": + case "week": + case "w": + return n2 * w; + case "days": + case "day": + case "d": + return n2 * d3; + case "hours": + case "hour": + case "hrs": + case "hr": + case "h": + return n2 * h; + case "minutes": + case "minute": + case "mins": + case "min": + case "m": + return n2 * m2; + case "seconds": + case "second": + case "secs": + case "sec": + case "s": + return n2 * s4; + case "milliseconds": + case "millisecond": + case "msecs": + case "msec": + case "ms": + return n2; + default: + return void 0; + } + } + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d3) { + return Math.round(ms / d3) + "d"; + } + if (msAbs >= h) { + return Math.round(ms / h) + "h"; + } + if (msAbs >= m2) { + return Math.round(ms / m2) + "m"; + } + if (msAbs >= s4) { + return Math.round(ms / s4) + "s"; + } + return ms + "ms"; + } + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d3) { + return plural(ms, msAbs, d3, "day"); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, "hour"); + } + if (msAbs >= m2) { + return plural(ms, msAbs, m2, "minute"); + } + if (msAbs >= s4) { + return plural(ms, msAbs, s4, "second"); + } + return ms + " ms"; + } + function plural(ms, msAbs, n2, name) { + var isPlural = msAbs >= n2 * 1.5; + return Math.round(ms / n2) + " " + name + (isPlural ? "s" : ""); + } + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/ms.js +var require_ms2 = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/ms.js"(exports2, module2) { + "use strict"; + var format5 = require_format(); + var ms = require_ms(); + module2.exports = format5((info) => { + const curr = +/* @__PURE__ */ new Date(); + exports2.diff = curr - (exports2.prevTime || curr); + exports2.prevTime = curr; + info.ms = `+${ms(exports2.diff)}`; + return info; + }); + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/pretty-print.js +var require_pretty_print = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/pretty-print.js"(exports2, module2) { + "use strict"; + var inspect = __require("util").inspect; + var format5 = require_format(); + var { LEVEL, MESSAGE, SPLAT } = require_triple_beam(); + module2.exports = format5((info, opts = {}) => { + const stripped = Object.assign({}, info); + delete stripped[LEVEL]; + delete stripped[MESSAGE]; + delete stripped[SPLAT]; + info[MESSAGE] = inspect(stripped, false, opts.depth || null, opts.colorize); + return info; + }); + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/printf.js +var require_printf = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/printf.js"(exports2, module2) { + "use strict"; + var { MESSAGE } = require_triple_beam(); + var Printf = class { + constructor(templateFn) { + this.template = templateFn; + } + transform(info) { + info[MESSAGE] = this.template(info); + return info; + } + }; + module2.exports = (opts) => new Printf(opts); + module2.exports.Printf = module2.exports.Format = Printf; + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/simple.js +var require_simple = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/simple.js"(exports2, module2) { + "use strict"; + var format5 = require_format(); + var { MESSAGE } = require_triple_beam(); + var jsonStringify = require_safe_stable_stringify(); + module2.exports = format5((info) => { + const stringifiedRest = jsonStringify(Object.assign({}, info, { + level: void 0, + message: void 0, + splat: void 0 + })); + const padding = info.padding && info.padding[info.level] || ""; + if (stringifiedRest !== "{}") { + info[MESSAGE] = `${info.level}:${padding} ${info.message} ${stringifiedRest}`; + } else { + info[MESSAGE] = `${info.level}:${padding} ${info.message}`; + } + return info; + }); + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/splat.js +var require_splat = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/splat.js"(exports2, module2) { + "use strict"; + var util5 = __require("util"); + var { SPLAT } = require_triple_beam(); + var formatRegExp = /%[scdjifoO%]/g; + var escapedPercent = /%%/g; + var Splatter = class { + constructor(opts) { + this.options = opts; + } + /** + * Check to see if tokens <= splat.length, assign { splat, meta } into the + * `info` accordingly, and write to this instance. + * + * @param {Info} info Logform info message. + * @param {String[]} tokens Set of string interpolation tokens. + * @returns {Info} Modified info message + * @private + */ + _splat(info, tokens) { + const msg = info.message; + const splat = info[SPLAT] || info.splat || []; + const percents = msg.match(escapedPercent); + const escapes = percents && percents.length || 0; + const expectedSplat = tokens.length - escapes; + const extraSplat = expectedSplat - splat.length; + const metas = extraSplat < 0 ? splat.splice(extraSplat, -1 * extraSplat) : []; + const metalen = metas.length; + if (metalen) { + for (let i6 = 0; i6 < metalen; i6++) { + Object.assign(info, metas[i6]); + } + } + info.message = util5.format(msg, ...splat); + return info; + } + /** + * Transforms the `info` message by using `util.format` to complete + * any `info.message` provided it has string interpolation tokens. + * If no tokens exist then `info` is immutable. + * + * @param {Info} info Logform info message. + * @param {Object} opts Options for this instance. + * @returns {Info} Modified info message + */ + transform(info) { + const msg = info.message; + const splat = info[SPLAT] || info.splat; + if (!splat || !splat.length) { + return info; + } + const tokens = msg && msg.match && msg.match(formatRegExp); + if (!tokens && (splat || splat.length)) { + const metas = splat.length > 1 ? splat.splice(0) : splat; + const metalen = metas.length; + if (metalen) { + for (let i6 = 0; i6 < metalen; i6++) { + Object.assign(info, metas[i6]); + } + } + return info; + } + if (tokens) { + return this._splat(info, tokens); + } + return info; + } + }; + module2.exports = (opts) => new Splatter(opts); + } +}); + +// ../../node_modules/.pnpm/fecha@4.2.3/node_modules/fecha/lib/fecha.umd.js +var require_fecha_umd = __commonJS({ + "../../node_modules/.pnpm/fecha@4.2.3/node_modules/fecha/lib/fecha.umd.js"(exports2, module2) { + (function(global2, factory) { + typeof exports2 === "object" && typeof module2 !== "undefined" ? factory(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory) : factory(global2.fecha = {}); + })(exports2, function(exports3) { + "use strict"; + var token = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g; + var twoDigitsOptional = "\\d\\d?"; + var twoDigits = "\\d\\d"; + var threeDigits = "\\d{3}"; + var fourDigits = "\\d{4}"; + var word = "[^\\s]+"; + var literal = /\[([^]*?)\]/gm; + function shorten(arr, sLen) { + var newArr = []; + for (var i6 = 0, len = arr.length; i6 < len; i6++) { + newArr.push(arr[i6].substr(0, sLen)); + } + return newArr; + } + var monthUpdate = function(arrName) { + return function(v, i18n) { + var lowerCaseArr = i18n[arrName].map(function(v2) { + return v2.toLowerCase(); + }); + var index2 = lowerCaseArr.indexOf(v.toLowerCase()); + if (index2 > -1) { + return index2; + } + return null; + }; + }; + function assign(origObj) { + var args2 = []; + for (var _i = 1; _i < arguments.length; _i++) { + args2[_i - 1] = arguments[_i]; + } + for (var _a2 = 0, args_1 = args2; _a2 < args_1.length; _a2++) { + var obj = args_1[_a2]; + for (var key in obj) { + origObj[key] = obj[key]; + } + } + return origObj; + } + var dayNames = [ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday" + ]; + var monthNames = [ + "January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December" + ]; + var monthNamesShort = shorten(monthNames, 3); + var dayNamesShort = shorten(dayNames, 3); + var defaultI18n = { + dayNamesShort, + dayNames, + monthNamesShort, + monthNames, + amPm: ["am", "pm"], + DoFn: function(dayOfMonth) { + return dayOfMonth + ["th", "st", "nd", "rd"][dayOfMonth % 10 > 3 ? 0 : (dayOfMonth - dayOfMonth % 10 !== 10 ? 1 : 0) * dayOfMonth % 10]; + } + }; + var globalI18n = assign({}, defaultI18n); + var setGlobalDateI18n = function(i18n) { + return globalI18n = assign(globalI18n, i18n); + }; + var regexEscape = function(str) { + return str.replace(/[|\\{()[^$+*?.-]/g, "\\$&"); + }; + var pad = function(val2, len) { + if (len === void 0) { + len = 2; + } + val2 = String(val2); + while (val2.length < len) { + val2 = "0" + val2; + } + return val2; + }; + var formatFlags = { + D: function(dateObj) { + return String(dateObj.getDate()); + }, + DD: function(dateObj) { + return pad(dateObj.getDate()); + }, + Do: function(dateObj, i18n) { + return i18n.DoFn(dateObj.getDate()); + }, + d: function(dateObj) { + return String(dateObj.getDay()); + }, + dd: function(dateObj) { + return pad(dateObj.getDay()); + }, + ddd: function(dateObj, i18n) { + return i18n.dayNamesShort[dateObj.getDay()]; + }, + dddd: function(dateObj, i18n) { + return i18n.dayNames[dateObj.getDay()]; + }, + M: function(dateObj) { + return String(dateObj.getMonth() + 1); + }, + MM: function(dateObj) { + return pad(dateObj.getMonth() + 1); + }, + MMM: function(dateObj, i18n) { + return i18n.monthNamesShort[dateObj.getMonth()]; + }, + MMMM: function(dateObj, i18n) { + return i18n.monthNames[dateObj.getMonth()]; + }, + YY: function(dateObj) { + return pad(String(dateObj.getFullYear()), 4).substr(2); + }, + YYYY: function(dateObj) { + return pad(dateObj.getFullYear(), 4); + }, + h: function(dateObj) { + return String(dateObj.getHours() % 12 || 12); + }, + hh: function(dateObj) { + return pad(dateObj.getHours() % 12 || 12); + }, + H: function(dateObj) { + return String(dateObj.getHours()); + }, + HH: function(dateObj) { + return pad(dateObj.getHours()); + }, + m: function(dateObj) { + return String(dateObj.getMinutes()); + }, + mm: function(dateObj) { + return pad(dateObj.getMinutes()); + }, + s: function(dateObj) { + return String(dateObj.getSeconds()); + }, + ss: function(dateObj) { + return pad(dateObj.getSeconds()); + }, + S: function(dateObj) { + return String(Math.round(dateObj.getMilliseconds() / 100)); + }, + SS: function(dateObj) { + return pad(Math.round(dateObj.getMilliseconds() / 10), 2); + }, + SSS: function(dateObj) { + return pad(dateObj.getMilliseconds(), 3); + }, + a: function(dateObj, i18n) { + return dateObj.getHours() < 12 ? i18n.amPm[0] : i18n.amPm[1]; + }, + A: function(dateObj, i18n) { + return dateObj.getHours() < 12 ? i18n.amPm[0].toUpperCase() : i18n.amPm[1].toUpperCase(); + }, + ZZ: function(dateObj) { + var offset = dateObj.getTimezoneOffset(); + return (offset > 0 ? "-" : "+") + pad(Math.floor(Math.abs(offset) / 60) * 100 + Math.abs(offset) % 60, 4); + }, + Z: function(dateObj) { + var offset = dateObj.getTimezoneOffset(); + return (offset > 0 ? "-" : "+") + pad(Math.floor(Math.abs(offset) / 60), 2) + ":" + pad(Math.abs(offset) % 60, 2); + } + }; + var monthParse = function(v) { + return +v - 1; + }; + var emptyDigits = [null, twoDigitsOptional]; + var emptyWord = [null, word]; + var amPm = [ + "isPm", + word, + function(v, i18n) { + var val2 = v.toLowerCase(); + if (val2 === i18n.amPm[0]) { + return 0; + } else if (val2 === i18n.amPm[1]) { + return 1; + } + return null; + } + ]; + var timezoneOffset = [ + "timezoneOffset", + "[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?", + function(v) { + var parts = (v + "").match(/([+-]|\d\d)/gi); + if (parts) { + var minutes = +parts[1] * 60 + parseInt(parts[2], 10); + return parts[0] === "+" ? minutes : -minutes; + } + return 0; + } + ]; + var parseFlags = { + D: ["day", twoDigitsOptional], + DD: ["day", twoDigits], + Do: ["day", twoDigitsOptional + word, function(v) { + return parseInt(v, 10); + }], + M: ["month", twoDigitsOptional, monthParse], + MM: ["month", twoDigits, monthParse], + YY: [ + "year", + twoDigits, + function(v) { + var now = /* @__PURE__ */ new Date(); + var cent = +("" + now.getFullYear()).substr(0, 2); + return +("" + (+v > 68 ? cent - 1 : cent) + v); + } + ], + h: ["hour", twoDigitsOptional, void 0, "isPm"], + hh: ["hour", twoDigits, void 0, "isPm"], + H: ["hour", twoDigitsOptional], + HH: ["hour", twoDigits], + m: ["minute", twoDigitsOptional], + mm: ["minute", twoDigits], + s: ["second", twoDigitsOptional], + ss: ["second", twoDigits], + YYYY: ["year", fourDigits], + S: ["millisecond", "\\d", function(v) { + return +v * 100; + }], + SS: ["millisecond", twoDigits, function(v) { + return +v * 10; + }], + SSS: ["millisecond", threeDigits], + d: emptyDigits, + dd: emptyDigits, + ddd: emptyWord, + dddd: emptyWord, + MMM: ["month", word, monthUpdate("monthNamesShort")], + MMMM: ["month", word, monthUpdate("monthNames")], + a: amPm, + A: amPm, + ZZ: timezoneOffset, + Z: timezoneOffset + }; + var globalMasks = { + default: "ddd MMM DD YYYY HH:mm:ss", + shortDate: "M/D/YY", + mediumDate: "MMM D, YYYY", + longDate: "MMMM D, YYYY", + fullDate: "dddd, MMMM D, YYYY", + isoDate: "YYYY-MM-DD", + isoDateTime: "YYYY-MM-DDTHH:mm:ssZ", + shortTime: "HH:mm", + mediumTime: "HH:mm:ss", + longTime: "HH:mm:ss.SSS" + }; + var setGlobalDateMasks = function(masks) { + return assign(globalMasks, masks); + }; + var format5 = function(dateObj, mask, i18n) { + if (mask === void 0) { + mask = globalMasks["default"]; + } + if (i18n === void 0) { + i18n = {}; + } + if (typeof dateObj === "number") { + dateObj = new Date(dateObj); + } + if (Object.prototype.toString.call(dateObj) !== "[object Date]" || isNaN(dateObj.getTime())) { + throw new Error("Invalid Date pass to format"); + } + mask = globalMasks[mask] || mask; + var literals = []; + mask = mask.replace(literal, function($0, $1) { + literals.push($1); + return "@@@"; + }); + var combinedI18nSettings = assign(assign({}, globalI18n), i18n); + mask = mask.replace(token, function($0) { + return formatFlags[$0](dateObj, combinedI18nSettings); + }); + return mask.replace(/@@@/g, function() { + return literals.shift(); + }); + }; + function parse12(dateStr, format6, i18n) { + if (i18n === void 0) { + i18n = {}; + } + if (typeof format6 !== "string") { + throw new Error("Invalid format in fecha parse"); + } + format6 = globalMasks[format6] || format6; + if (dateStr.length > 1e3) { + return null; + } + var today = /* @__PURE__ */ new Date(); + var dateInfo = { + year: today.getFullYear(), + month: 0, + day: 1, + hour: 0, + minute: 0, + second: 0, + millisecond: 0, + isPm: null, + timezoneOffset: null + }; + var parseInfo = []; + var literals = []; + var newFormat = format6.replace(literal, function($0, $1) { + literals.push(regexEscape($1)); + return "@@@"; + }); + var specifiedFields = {}; + var requiredFields = {}; + newFormat = regexEscape(newFormat).replace(token, function($0) { + var info = parseFlags[$0]; + var field2 = info[0], regex = info[1], requiredField = info[3]; + if (specifiedFields[field2]) { + throw new Error("Invalid format. " + field2 + " specified twice in format"); + } + specifiedFields[field2] = true; + if (requiredField) { + requiredFields[requiredField] = true; + } + parseInfo.push(info); + return "(" + regex + ")"; + }); + Object.keys(requiredFields).forEach(function(field2) { + if (!specifiedFields[field2]) { + throw new Error("Invalid format. " + field2 + " is required in specified format"); + } + }); + newFormat = newFormat.replace(/@@@/g, function() { + return literals.shift(); + }); + var matches = dateStr.match(new RegExp(newFormat, "i")); + if (!matches) { + return null; + } + var combinedI18nSettings = assign(assign({}, globalI18n), i18n); + for (var i6 = 1; i6 < matches.length; i6++) { + var _a2 = parseInfo[i6 - 1], field = _a2[0], parser = _a2[2]; + var value = parser ? parser(matches[i6], combinedI18nSettings) : +matches[i6]; + if (value == null) { + return null; + } + dateInfo[field] = value; + } + if (dateInfo.isPm === 1 && dateInfo.hour != null && +dateInfo.hour !== 12) { + dateInfo.hour = +dateInfo.hour + 12; + } else if (dateInfo.isPm === 0 && +dateInfo.hour === 12) { + dateInfo.hour = 0; + } + var dateTZ; + if (dateInfo.timezoneOffset == null) { + dateTZ = new Date(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute, dateInfo.second, dateInfo.millisecond); + var validateFields = [ + ["month", "getMonth"], + ["day", "getDate"], + ["hour", "getHours"], + ["minute", "getMinutes"], + ["second", "getSeconds"] + ]; + for (var i6 = 0, len = validateFields.length; i6 < len; i6++) { + if (specifiedFields[validateFields[i6][0]] && dateInfo[validateFields[i6][0]] !== dateTZ[validateFields[i6][1]]()) { + return null; + } + } + } else { + dateTZ = new Date(Date.UTC(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute - dateInfo.timezoneOffset, dateInfo.second, dateInfo.millisecond)); + if (dateInfo.month > 11 || dateInfo.month < 0 || dateInfo.day > 31 || dateInfo.day < 1 || dateInfo.hour > 23 || dateInfo.hour < 0 || dateInfo.minute > 59 || dateInfo.minute < 0 || dateInfo.second > 59 || dateInfo.second < 0) { + return null; + } + } + return dateTZ; + } + var fecha = { + format: format5, + parse: parse12, + defaultI18n, + setGlobalDateI18n, + setGlobalDateMasks + }; + exports3.assign = assign; + exports3.default = fecha; + exports3.format = format5; + exports3.parse = parse12; + exports3.defaultI18n = defaultI18n; + exports3.setGlobalDateI18n = setGlobalDateI18n; + exports3.setGlobalDateMasks = setGlobalDateMasks; + Object.defineProperty(exports3, "__esModule", { value: true }); + }); + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/timestamp.js +var require_timestamp = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/timestamp.js"(exports2, module2) { + "use strict"; + var fecha = require_fecha_umd(); + var format5 = require_format(); + module2.exports = format5((info, opts = {}) => { + if (opts.format) { + info.timestamp = typeof opts.format === "function" ? opts.format() : fecha.format(/* @__PURE__ */ new Date(), opts.format); + } + if (!info.timestamp) { + info.timestamp = (/* @__PURE__ */ new Date()).toISOString(); + } + if (opts.alias) { + info[opts.alias] = info.timestamp; + } + return info; + }); + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/uncolorize.js +var require_uncolorize = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/uncolorize.js"(exports2, module2) { + "use strict"; + var colors = require_safe(); + var format5 = require_format(); + var { MESSAGE } = require_triple_beam(); + module2.exports = format5((info, opts) => { + if (opts.level !== false) { + info.level = colors.strip(info.level); + } + if (opts.message !== false) { + info.message = colors.strip(String(info.message)); + } + if (opts.raw !== false && info[MESSAGE]) { + info[MESSAGE] = colors.strip(String(info[MESSAGE])); + } + return info; + }); + } +}); + +// ../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/index.js +var require_logform = __commonJS({ + "../../node_modules/.pnpm/logform@2.6.0/node_modules/logform/index.js"(exports2) { + "use strict"; + var format5 = exports2.format = require_format(); + exports2.levels = require_levels(); + function exposeFormat(name, requireFormat) { + Object.defineProperty(format5, name, { + get() { + return requireFormat(); + }, + configurable: true + }); + } + exposeFormat("align", function() { + return require_align(); + }); + exposeFormat("errors", function() { + return require_errors(); + }); + exposeFormat("cli", function() { + return require_cli2(); + }); + exposeFormat("combine", function() { + return require_combine(); + }); + exposeFormat("colorize", function() { + return require_colorize(); + }); + exposeFormat("json", function() { + return require_json(); + }); + exposeFormat("label", function() { + return require_label(); + }); + exposeFormat("logstash", function() { + return require_logstash(); + }); + exposeFormat("metadata", function() { + return require_metadata(); + }); + exposeFormat("ms", function() { + return require_ms2(); + }); + exposeFormat("padLevels", function() { + return require_pad_levels(); + }); + exposeFormat("prettyPrint", function() { + return require_pretty_print(); + }); + exposeFormat("printf", function() { + return require_printf(); + }); + exposeFormat("simple", function() { + return require_simple(); + }); + exposeFormat("splat", function() { + return require_splat(); + }); + exposeFormat("timestamp", function() { + return require_timestamp(); + }); + exposeFormat("uncolorize", function() { + return require_uncolorize(); + }); + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/common.js +var require_common = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/common.js"(exports2) { + "use strict"; + var { format: format5 } = __require("util"); + exports2.warn = { + deprecated(prop2) { + return () => { + throw new Error(format5("{ %s } was removed in winston@3.0.0.", prop2)); + }; + }, + useFormat(prop2) { + return () => { + throw new Error([ + format5("{ %s } was removed in winston@3.0.0.", prop2), + "Use a custom winston.format = winston.format(function) instead." + ].join("\n")); + }; + }, + forFunctions(obj, type, props) { + props.forEach((prop2) => { + obj[prop2] = exports2.warn[type](prop2); + }); + }, + forProperties(obj, type, props) { + props.forEach((prop2) => { + const notice = exports2.warn[type](prop2); + Object.defineProperty(obj, prop2, { + get: notice, + set: notice + }); + }); + } + }; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/package.json +var require_package = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/package.json"(exports2, module2) { + module2.exports = { + name: "winston", + description: "A logger for just about everything.", + version: "3.14.2", + author: "Charlie Robbins ", + maintainers: [ + "David Hyde " + ], + repository: { + type: "git", + url: "https://github.com/winstonjs/winston.git" + }, + keywords: [ + "winston", + "logger", + "logging", + "logs", + "sysadmin", + "bunyan", + "pino", + "loglevel", + "tools", + "json", + "stream" + ], + dependencies: { + "@dabh/diagnostics": "^2.0.2", + "@colors/colors": "^1.6.0", + async: "^3.2.3", + "is-stream": "^2.0.0", + logform: "^2.6.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.7.0" + }, + devDependencies: { + "@babel/cli": "^7.23.9", + "@babel/core": "^7.24.0", + "@babel/preset-env": "^7.24.0", + "@dabh/eslint-config-populist": "^4.4.0", + "@types/node": "^20.11.24", + "abstract-winston-transport": "^0.5.1", + assume: "^2.2.0", + "cross-spawn-async": "^2.2.5", + eslint: "^8.57.0", + hock: "^1.4.1", + mocha: "^10.3.0", + nyc: "^15.1.0", + rimraf: "5.0.1", + split2: "^4.1.0", + "std-mocks": "^2.0.0", + through2: "^4.0.2", + "winston-compat": "^0.1.5" + }, + main: "./lib/winston.js", + browser: "./dist/winston", + types: "./index.d.ts", + scripts: { + lint: "eslint lib/*.js lib/winston/*.js lib/winston/**/*.js --resolve-plugins-relative-to ./node_modules/@dabh/eslint-config-populist", + test: "rimraf test/fixtures/logs/* && mocha", + "test:coverage": "nyc npm run test:unit", + "test:unit": "mocha test/unit", + "test:integration": "mocha test/integration", + build: "rimraf dist && babel lib -d dist", + prepublishOnly: "npm run build" + }, + engines: { + node: ">= 12.0.0" + }, + license: "MIT" + }; + } +}); + +// ../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js +var require_node = __commonJS({ + "../../node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/node.js"(exports2, module2) { + module2.exports = __require("util").deprecate; + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/stream.js +var require_stream = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/stream.js"(exports2, module2) { + module2.exports = __require("stream"); + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/destroy.js +var require_destroy = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/destroy.js"(exports2, module2) { + "use strict"; + function destroy(err, cb) { + var _this = this; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err) { + if (!this._writableState) { + process.nextTick(emitErrorNT, this, err); + } else if (!this._writableState.errorEmitted) { + this._writableState.errorEmitted = true; + process.nextTick(emitErrorNT, this, err); + } + } + return this; + } + if (this._readableState) { + this._readableState.destroyed = true; + } + if (this._writableState) { + this._writableState.destroyed = true; + } + this._destroy(err || null, function(err2) { + if (!cb && err2) { + if (!_this._writableState) { + process.nextTick(emitErrorAndCloseNT, _this, err2); + } else if (!_this._writableState.errorEmitted) { + _this._writableState.errorEmitted = true; + process.nextTick(emitErrorAndCloseNT, _this, err2); + } else { + process.nextTick(emitCloseNT, _this); + } + } else if (cb) { + process.nextTick(emitCloseNT, _this); + cb(err2); + } else { + process.nextTick(emitCloseNT, _this); + } + }); + return this; + } + function emitErrorAndCloseNT(self2, err) { + emitErrorNT(self2, err); + emitCloseNT(self2); + } + function emitCloseNT(self2) { + if (self2._writableState && !self2._writableState.emitClose) return; + if (self2._readableState && !self2._readableState.emitClose) return; + self2.emit("close"); + } + function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finalCalled = false; + this._writableState.prefinished = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } + } + function emitErrorNT(self2, err) { + self2.emit("error", err); + } + function errorOrDestroy(stream5, err) { + var rState = stream5._readableState; + var wState = stream5._writableState; + if (rState && rState.autoDestroy || wState && wState.autoDestroy) stream5.destroy(err); + else stream5.emit("error", err); + } + module2.exports = { + destroy, + undestroy, + errorOrDestroy + }; + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/errors.js +var require_errors2 = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/errors.js"(exports2, module2) { + "use strict"; + var codes = {}; + function createErrorType(code, message2, Base) { + if (!Base) { + Base = Error; + } + function getMessage(arg1, arg2, arg3) { + if (typeof message2 === "string") { + return message2; + } else { + return message2(arg1, arg2, arg3); + } + } + class NodeError extends Base { + constructor(arg1, arg2, arg3) { + super(getMessage(arg1, arg2, arg3)); + } + } + NodeError.prototype.name = Base.name; + NodeError.prototype.code = code; + codes[code] = NodeError; + } + function oneOf(expected, thing) { + if (Array.isArray(expected)) { + const len = expected.length; + expected = expected.map((i6) => String(i6)); + if (len > 2) { + return `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1]; + } else if (len === 2) { + return `one of ${thing} ${expected[0]} or ${expected[1]}`; + } else { + return `of ${thing} ${expected[0]}`; + } + } else { + return `of ${thing} ${String(expected)}`; + } + } + function startsWith(str, search, pos) { + return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search; + } + function endsWith2(str, search, this_len) { + if (this_len === void 0 || this_len > str.length) { + this_len = str.length; + } + return str.substring(this_len - search.length, this_len) === search; + } + function includes(str, search, start) { + if (typeof start !== "number") { + start = 0; + } + if (start + search.length > str.length) { + return false; + } else { + return str.indexOf(search, start) !== -1; + } + } + createErrorType("ERR_INVALID_OPT_VALUE", function(name, value) { + return 'The value "' + value + '" is invalid for option "' + name + '"'; + }, TypeError); + createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) { + let determiner; + if (typeof expected === "string" && startsWith(expected, "not ")) { + determiner = "must not be"; + expected = expected.replace(/^not /, ""); + } else { + determiner = "must be"; + } + let msg; + if (endsWith2(name, " argument")) { + msg = `The ${name} ${determiner} ${oneOf(expected, "type")}`; + } else { + const type = includes(name, ".") ? "property" : "argument"; + msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, "type")}`; + } + msg += `. Received type ${typeof actual}`; + return msg; + }, TypeError); + createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); + createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name) { + return "The " + name + " method is not implemented"; + }); + createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); + createErrorType("ERR_STREAM_DESTROYED", function(name) { + return "Cannot call " + name + " after a stream was destroyed"; + }); + createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); + createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); + createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"); + createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); + createErrorType("ERR_UNKNOWN_ENCODING", function(arg) { + return "Unknown encoding: " + arg; + }, TypeError); + createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); + module2.exports.codes = codes; + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/state.js +var require_state = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/state.js"(exports2, module2) { + "use strict"; + var ERR_INVALID_OPT_VALUE = require_errors2().codes.ERR_INVALID_OPT_VALUE; + function highWaterMarkFrom(options, isDuplex, duplexKey) { + return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null; + } + function getHighWaterMark(state, options, duplexKey, isDuplex) { + var hwm = highWaterMarkFrom(options, isDuplex, duplexKey); + if (hwm != null) { + if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) { + var name = isDuplex ? duplexKey : "highWaterMark"; + throw new ERR_INVALID_OPT_VALUE(name, hwm); + } + return Math.floor(hwm); + } + return state.objectMode ? 16 : 16 * 1024; + } + module2.exports = { + getHighWaterMark + }; + } +}); + +// ../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js +var require_inherits_browser = __commonJS({ + "../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js"(exports2, module2) { + if (typeof Object.create === "function") { + module2.exports = function inherits2(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + } + }; + } else { + module2.exports = function inherits2(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + } +}); + +// ../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js +var require_inherits = __commonJS({ + "../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js"(exports2, module2) { + try { + util5 = __require("util"); + if (typeof util5.inherits !== "function") throw ""; + module2.exports = util5.inherits; + } catch (e) { + module2.exports = require_inherits_browser(); + } + var util5; + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/buffer_list.js +var require_buffer_list = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(exports2, module2) { + "use strict"; + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread(target) { + for (var i6 = 1; i6 < arguments.length; i6++) { + var source = null != arguments[i6] ? arguments[i6] : {}; + i6 % 2 ? ownKeys(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + function _defineProperties(target, props) { + for (var i6 = 0; i6 < props.length; i6++) { + var descriptor = props[i6]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); + } + } + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { writable: false }); + return Constructor; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var _require = __require("buffer"); + var Buffer2 = _require.Buffer; + var _require2 = __require("util"); + var inspect = _require2.inspect; + var custom = inspect && inspect.custom || "inspect"; + function copyBuffer(src, target, offset) { + Buffer2.prototype.copy.call(src, target, offset); + } + module2.exports = /* @__PURE__ */ function() { + function BufferList() { + _classCallCheck(this, BufferList); + this.head = null; + this.tail = null; + this.length = 0; + } + _createClass(BufferList, [{ + key: "push", + value: function push(v) { + var entry = { + data: v, + next: null + }; + if (this.length > 0) this.tail.next = entry; + else this.head = entry; + this.tail = entry; + ++this.length; + } + }, { + key: "unshift", + value: function unshift(v) { + var entry = { + data: v, + next: this.head + }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + } + }, { + key: "shift", + value: function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null; + else this.head = this.head.next; + --this.length; + return ret; + } + }, { + key: "clear", + value: function clear() { + this.head = this.tail = null; + this.length = 0; + } + }, { + key: "join", + value: function join17(s4) { + if (this.length === 0) return ""; + var p3 = this.head; + var ret = "" + p3.data; + while (p3 = p3.next) ret += s4 + p3.data; + return ret; + } + }, { + key: "concat", + value: function concat(n2) { + if (this.length === 0) return Buffer2.alloc(0); + var ret = Buffer2.allocUnsafe(n2 >>> 0); + var p3 = this.head; + var i6 = 0; + while (p3) { + copyBuffer(p3.data, ret, i6); + i6 += p3.data.length; + p3 = p3.next; + } + return ret; + } + // Consumes a specified amount of bytes or characters from the buffered data. + }, { + key: "consume", + value: function consume(n2, hasStrings) { + var ret; + if (n2 < this.head.data.length) { + ret = this.head.data.slice(0, n2); + this.head.data = this.head.data.slice(n2); + } else if (n2 === this.head.data.length) { + ret = this.shift(); + } else { + ret = hasStrings ? this._getString(n2) : this._getBuffer(n2); + } + return ret; + } + }, { + key: "first", + value: function first2() { + return this.head.data; + } + // Consumes a specified amount of characters from the buffered data. + }, { + key: "_getString", + value: function _getString(n2) { + var p3 = this.head; + var c2 = 1; + var ret = p3.data; + n2 -= ret.length; + while (p3 = p3.next) { + var str = p3.data; + var nb = n2 > str.length ? str.length : n2; + if (nb === str.length) ret += str; + else ret += str.slice(0, n2); + n2 -= nb; + if (n2 === 0) { + if (nb === str.length) { + ++c2; + if (p3.next) this.head = p3.next; + else this.head = this.tail = null; + } else { + this.head = p3; + p3.data = str.slice(nb); + } + break; + } + ++c2; + } + this.length -= c2; + return ret; + } + // Consumes a specified amount of bytes from the buffered data. + }, { + key: "_getBuffer", + value: function _getBuffer(n2) { + var ret = Buffer2.allocUnsafe(n2); + var p3 = this.head; + var c2 = 1; + p3.data.copy(ret); + n2 -= p3.data.length; + while (p3 = p3.next) { + var buf = p3.data; + var nb = n2 > buf.length ? buf.length : n2; + buf.copy(ret, ret.length - n2, 0, nb); + n2 -= nb; + if (n2 === 0) { + if (nb === buf.length) { + ++c2; + if (p3.next) this.head = p3.next; + else this.head = this.tail = null; + } else { + this.head = p3; + p3.data = buf.slice(nb); + } + break; + } + ++c2; + } + this.length -= c2; + return ret; + } + // Make sure the linked list only shows the minimal necessary information. + }, { + key: custom, + value: function value(_, options) { + return inspect(this, _objectSpread(_objectSpread({}, options), {}, { + // Only inspect one level. + depth: 0, + // It should not recurse. + customInspect: false + })); + } + }]); + return BufferList; + }(); + } +}); + +// ../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js +var require_safe_buffer = __commonJS({ + "../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports2, module2) { + var buffer = __require("buffer"); + var Buffer2 = buffer.Buffer; + function copyProps(src, dst) { + for (var key in src) { + dst[key] = src[key]; + } + } + if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) { + module2.exports = buffer; + } else { + copyProps(buffer, exports2); + exports2.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer2(arg, encodingOrOffset, length); + } + SafeBuffer.prototype = Object.create(Buffer2.prototype); + copyProps(Buffer2, SafeBuffer); + SafeBuffer.from = function(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer2(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function(size, fill, encoding) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer2(size); + if (fill !== void 0) { + if (typeof encoding === "string") { + buf.fill(fill, encoding); + } else { + buf.fill(fill); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function(size) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer2(size); + }; + SafeBuffer.allocUnsafeSlow = function(size) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + return buffer.SlowBuffer(size); + }; + } +}); + +// ../../node_modules/.pnpm/string_decoder@1.3.0/node_modules/string_decoder/lib/string_decoder.js +var require_string_decoder = __commonJS({ + "../../node_modules/.pnpm/string_decoder@1.3.0/node_modules/string_decoder/lib/string_decoder.js"(exports2) { + "use strict"; + var Buffer2 = require_safe_buffer().Buffer; + var isEncoding = Buffer2.isEncoding || function(encoding) { + encoding = "" + encoding; + switch (encoding && encoding.toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + case "raw": + return true; + default: + return false; + } + }; + function _normalizeEncoding(enc) { + if (!enc) return "utf8"; + var retried; + while (true) { + switch (enc) { + case "utf8": + case "utf-8": + return "utf8"; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return "utf16le"; + case "latin1": + case "binary": + return "latin1"; + case "base64": + case "ascii": + case "hex": + return enc; + default: + if (retried) return; + enc = ("" + enc).toLowerCase(); + retried = true; + } + } + } + function normalizeEncoding(enc) { + var nenc = _normalizeEncoding(enc); + if (typeof nenc !== "string" && (Buffer2.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); + return nenc || enc; + } + exports2.StringDecoder = StringDecoder2; + function StringDecoder2(encoding) { + this.encoding = normalizeEncoding(encoding); + var nb; + switch (this.encoding) { + case "utf16le": + this.text = utf16Text; + this.end = utf16End; + nb = 4; + break; + case "utf8": + this.fillLast = utf8FillLast; + nb = 4; + break; + case "base64": + this.text = base64Text; + this.end = base64End; + nb = 3; + break; + default: + this.write = simpleWrite; + this.end = simpleEnd; + return; + } + this.lastNeed = 0; + this.lastTotal = 0; + this.lastChar = Buffer2.allocUnsafe(nb); + } + StringDecoder2.prototype.write = function(buf) { + if (buf.length === 0) return ""; + var r2; + var i6; + if (this.lastNeed) { + r2 = this.fillLast(buf); + if (r2 === void 0) return ""; + i6 = this.lastNeed; + this.lastNeed = 0; + } else { + i6 = 0; + } + if (i6 < buf.length) return r2 ? r2 + this.text(buf, i6) : this.text(buf, i6); + return r2 || ""; + }; + StringDecoder2.prototype.end = utf8End; + StringDecoder2.prototype.text = utf8Text; + StringDecoder2.prototype.fillLast = function(buf) { + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length); + this.lastNeed -= buf.length; + }; + function utf8CheckByte(byte) { + if (byte <= 127) return 0; + else if (byte >> 5 === 6) return 2; + else if (byte >> 4 === 14) return 3; + else if (byte >> 3 === 30) return 4; + return byte >> 6 === 2 ? -1 : -2; + } + function utf8CheckIncomplete(self2, buf, i6) { + var j = buf.length - 1; + if (j < i6) return 0; + var nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self2.lastNeed = nb - 1; + return nb; + } + if (--j < i6 || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) self2.lastNeed = nb - 2; + return nb; + } + if (--j < i6 || nb === -2) return 0; + nb = utf8CheckByte(buf[j]); + if (nb >= 0) { + if (nb > 0) { + if (nb === 2) nb = 0; + else self2.lastNeed = nb - 3; + } + return nb; + } + return 0; + } + function utf8CheckExtraBytes(self2, buf, p3) { + if ((buf[0] & 192) !== 128) { + self2.lastNeed = 0; + return "\uFFFD"; + } + if (self2.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 192) !== 128) { + self2.lastNeed = 1; + return "\uFFFD"; + } + if (self2.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 192) !== 128) { + self2.lastNeed = 2; + return "\uFFFD"; + } + } + } + } + function utf8FillLast(buf) { + var p3 = this.lastTotal - this.lastNeed; + var r2 = utf8CheckExtraBytes(this, buf, p3); + if (r2 !== void 0) return r2; + if (this.lastNeed <= buf.length) { + buf.copy(this.lastChar, p3, 0, this.lastNeed); + return this.lastChar.toString(this.encoding, 0, this.lastTotal); + } + buf.copy(this.lastChar, p3, 0, buf.length); + this.lastNeed -= buf.length; + } + function utf8Text(buf, i6) { + var total = utf8CheckIncomplete(this, buf, i6); + if (!this.lastNeed) return buf.toString("utf8", i6); + this.lastTotal = total; + var end2 = buf.length - (total - this.lastNeed); + buf.copy(this.lastChar, 0, end2); + return buf.toString("utf8", i6, end2); + } + function utf8End(buf) { + var r2 = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) return r2 + "\uFFFD"; + return r2; + } + function utf16Text(buf, i6) { + if ((buf.length - i6) % 2 === 0) { + var r2 = buf.toString("utf16le", i6); + if (r2) { + var c2 = r2.charCodeAt(r2.length - 1); + if (c2 >= 55296 && c2 <= 56319) { + this.lastNeed = 2; + this.lastTotal = 4; + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + return r2.slice(0, -1); + } + } + return r2; + } + this.lastNeed = 1; + this.lastTotal = 2; + this.lastChar[0] = buf[buf.length - 1]; + return buf.toString("utf16le", i6, buf.length - 1); + } + function utf16End(buf) { + var r2 = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) { + var end2 = this.lastTotal - this.lastNeed; + return r2 + this.lastChar.toString("utf16le", 0, end2); + } + return r2; + } + function base64Text(buf, i6) { + var n2 = (buf.length - i6) % 3; + if (n2 === 0) return buf.toString("base64", i6); + this.lastNeed = 3 - n2; + this.lastTotal = 3; + if (n2 === 1) { + this.lastChar[0] = buf[buf.length - 1]; + } else { + this.lastChar[0] = buf[buf.length - 2]; + this.lastChar[1] = buf[buf.length - 1]; + } + return buf.toString("base64", i6, buf.length - n2); + } + function base64End(buf) { + var r2 = buf && buf.length ? this.write(buf) : ""; + if (this.lastNeed) return r2 + this.lastChar.toString("base64", 0, 3 - this.lastNeed); + return r2; + } + function simpleWrite(buf) { + return buf.toString(this.encoding); + } + function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ""; + } + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +var require_end_of_stream = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(exports2, module2) { + "use strict"; + var ERR_STREAM_PREMATURE_CLOSE = require_errors2().codes.ERR_STREAM_PREMATURE_CLOSE; + function once8(callback) { + var called = false; + return function() { + if (called) return; + called = true; + for (var _len = arguments.length, args2 = new Array(_len), _key = 0; _key < _len; _key++) { + args2[_key] = arguments[_key]; + } + callback.apply(this, args2); + }; + } + function noop2() { + } + function isRequest2(stream5) { + return stream5.setHeader && typeof stream5.abort === "function"; + } + function eos(stream5, opts, callback) { + if (typeof opts === "function") return eos(stream5, null, opts); + if (!opts) opts = {}; + callback = once8(callback || noop2); + var readable = opts.readable || opts.readable !== false && stream5.readable; + var writable = opts.writable || opts.writable !== false && stream5.writable; + var onlegacyfinish = function onlegacyfinish2() { + if (!stream5.writable) onfinish(); + }; + var writableEnded = stream5._writableState && stream5._writableState.finished; + var onfinish = function onfinish2() { + writable = false; + writableEnded = true; + if (!readable) callback.call(stream5); + }; + var readableEnded = stream5._readableState && stream5._readableState.endEmitted; + var onend = function onend2() { + readable = false; + readableEnded = true; + if (!writable) callback.call(stream5); + }; + var onerror = function onerror2(err) { + callback.call(stream5, err); + }; + var onclose = function onclose2() { + var err; + if (readable && !readableEnded) { + if (!stream5._readableState || !stream5._readableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream5, err); + } + if (writable && !writableEnded) { + if (!stream5._writableState || !stream5._writableState.ended) err = new ERR_STREAM_PREMATURE_CLOSE(); + return callback.call(stream5, err); + } + }; + var onrequest = function onrequest2() { + stream5.req.on("finish", onfinish); + }; + if (isRequest2(stream5)) { + stream5.on("complete", onfinish); + stream5.on("abort", onclose); + if (stream5.req) onrequest(); + else stream5.on("request", onrequest); + } else if (writable && !stream5._writableState) { + stream5.on("end", onlegacyfinish); + stream5.on("close", onlegacyfinish); + } + stream5.on("end", onend); + stream5.on("finish", onfinish); + if (opts.error !== false) stream5.on("error", onerror); + stream5.on("close", onclose); + return function() { + stream5.removeListener("complete", onfinish); + stream5.removeListener("abort", onclose); + stream5.removeListener("request", onrequest); + if (stream5.req) stream5.req.removeListener("finish", onfinish); + stream5.removeListener("end", onlegacyfinish); + stream5.removeListener("close", onlegacyfinish); + stream5.removeListener("finish", onfinish); + stream5.removeListener("end", onend); + stream5.removeListener("error", onerror); + stream5.removeListener("close", onclose); + }; + } + module2.exports = eos; + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/async_iterator.js +var require_async_iterator = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(exports2, module2) { + "use strict"; + var _Object$setPrototypeO; + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var finished = require_end_of_stream(); + var kLastResolve = Symbol("lastResolve"); + var kLastReject = Symbol("lastReject"); + var kError = Symbol("error"); + var kEnded = Symbol("ended"); + var kLastPromise = Symbol("lastPromise"); + var kHandlePromise = Symbol("handlePromise"); + var kStream = Symbol("stream"); + function createIterResult(value, done) { + return { + value, + done + }; + } + function readAndResolve(iter) { + var resolve25 = iter[kLastResolve]; + if (resolve25 !== null) { + var data2 = iter[kStream].read(); + if (data2 !== null) { + iter[kLastPromise] = null; + iter[kLastResolve] = null; + iter[kLastReject] = null; + resolve25(createIterResult(data2, false)); + } + } + } + function onReadable(iter) { + process.nextTick(readAndResolve, iter); + } + function wrapForNext(lastPromise, iter) { + return function(resolve25, reject) { + lastPromise.then(function() { + if (iter[kEnded]) { + resolve25(createIterResult(void 0, true)); + return; + } + iter[kHandlePromise](resolve25, reject); + }, reject); + }; + } + var AsyncIteratorPrototype = Object.getPrototypeOf(function() { + }); + var ReadableStreamAsyncIteratorPrototype = Object.setPrototypeOf((_Object$setPrototypeO = { + get stream() { + return this[kStream]; + }, + next: function next2() { + var _this = this; + var error = this[kError]; + if (error !== null) { + return Promise.reject(error); + } + if (this[kEnded]) { + return Promise.resolve(createIterResult(void 0, true)); + } + if (this[kStream].destroyed) { + return new Promise(function(resolve25, reject) { + process.nextTick(function() { + if (_this[kError]) { + reject(_this[kError]); + } else { + resolve25(createIterResult(void 0, true)); + } + }); + }); + } + var lastPromise = this[kLastPromise]; + var promise; + if (lastPromise) { + promise = new Promise(wrapForNext(lastPromise, this)); + } else { + var data2 = this[kStream].read(); + if (data2 !== null) { + return Promise.resolve(createIterResult(data2, false)); + } + promise = new Promise(this[kHandlePromise]); + } + this[kLastPromise] = promise; + return promise; + } + }, _defineProperty(_Object$setPrototypeO, Symbol.asyncIterator, function() { + return this; + }), _defineProperty(_Object$setPrototypeO, "return", function _return() { + var _this2 = this; + return new Promise(function(resolve25, reject) { + _this2[kStream].destroy(null, function(err) { + if (err) { + reject(err); + return; + } + resolve25(createIterResult(void 0, true)); + }); + }); + }), _Object$setPrototypeO), AsyncIteratorPrototype); + var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator2(stream5) { + var _Object$create; + var iterator = Object.create(ReadableStreamAsyncIteratorPrototype, (_Object$create = {}, _defineProperty(_Object$create, kStream, { + value: stream5, + writable: true + }), _defineProperty(_Object$create, kLastResolve, { + value: null, + writable: true + }), _defineProperty(_Object$create, kLastReject, { + value: null, + writable: true + }), _defineProperty(_Object$create, kError, { + value: null, + writable: true + }), _defineProperty(_Object$create, kEnded, { + value: stream5._readableState.endEmitted, + writable: true + }), _defineProperty(_Object$create, kHandlePromise, { + value: function value(resolve25, reject) { + var data2 = iterator[kStream].read(); + if (data2) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve25(createIterResult(data2, false)); + } else { + iterator[kLastResolve] = resolve25; + iterator[kLastReject] = reject; + } + }, + writable: true + }), _Object$create)); + iterator[kLastPromise] = null; + finished(stream5, function(err) { + if (err && err.code !== "ERR_STREAM_PREMATURE_CLOSE") { + var reject = iterator[kLastReject]; + if (reject !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + reject(err); + } + iterator[kError] = err; + return; + } + var resolve25 = iterator[kLastResolve]; + if (resolve25 !== null) { + iterator[kLastPromise] = null; + iterator[kLastResolve] = null; + iterator[kLastReject] = null; + resolve25(createIterResult(void 0, true)); + } + iterator[kEnded] = true; + }); + stream5.on("readable", onReadable.bind(null, iterator)); + return iterator; + }; + module2.exports = createReadableStreamAsyncIterator; + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/from.js +var require_from = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/from.js"(exports2, module2) { + "use strict"; + function asyncGeneratorStep(gen, resolve25, reject, _next, _throw, key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + if (info.done) { + resolve25(value); + } else { + Promise.resolve(value).then(_next, _throw); + } + } + function _asyncToGenerator(fn2) { + return function() { + var self2 = this, args2 = arguments; + return new Promise(function(resolve25, reject) { + var gen = fn2.apply(self2, args2); + function _next(value) { + asyncGeneratorStep(gen, resolve25, reject, _next, _throw, "next", value); + } + function _throw(err) { + asyncGeneratorStep(gen, resolve25, reject, _next, _throw, "throw", err); + } + _next(void 0); + }); + }; + } + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); + } + return keys; + } + function _objectSpread(target) { + for (var i6 = 1; i6 < arguments.length; i6++) { + var source = null != arguments[i6] ? arguments[i6] : {}; + i6 % 2 ? ownKeys(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + return target; + } + function _defineProperty(obj, key, value) { + key = _toPropertyKey(key); + if (key in obj) { + Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true }); + } else { + obj[key] = value; + } + return obj; + } + function _toPropertyKey(arg) { + var key = _toPrimitive(arg, "string"); + return typeof key === "symbol" ? key : String(key); + } + function _toPrimitive(input, hint) { + if (typeof input !== "object" || input === null) return input; + var prim = input[Symbol.toPrimitive]; + if (prim !== void 0) { + var res = prim.call(input, hint || "default"); + if (typeof res !== "object") return res; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + return (hint === "string" ? String : Number)(input); + } + var ERR_INVALID_ARG_TYPE = require_errors2().codes.ERR_INVALID_ARG_TYPE; + function from(Readable2, iterable, opts) { + var iterator; + if (iterable && typeof iterable.next === "function") { + iterator = iterable; + } else if (iterable && iterable[Symbol.asyncIterator]) iterator = iterable[Symbol.asyncIterator](); + else if (iterable && iterable[Symbol.iterator]) iterator = iterable[Symbol.iterator](); + else throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable); + var readable = new Readable2(_objectSpread({ + objectMode: true + }, opts)); + var reading = false; + readable._read = function() { + if (!reading) { + reading = true; + next2(); + } + }; + function next2() { + return _next2.apply(this, arguments); + } + function _next2() { + _next2 = _asyncToGenerator(function* () { + try { + var _yield$iterator$next = yield iterator.next(), value = _yield$iterator$next.value, done = _yield$iterator$next.done; + if (done) { + readable.push(null); + } else if (readable.push(yield value)) { + next2(); + } else { + reading = false; + } + } catch (err) { + readable.destroy(err); + } + }); + return _next2.apply(this, arguments); + } + return readable; + } + module2.exports = from; + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_readable.js +var require_stream_readable = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_readable.js"(exports2, module2) { + "use strict"; + module2.exports = Readable2; + var Duplex; + Readable2.ReadableState = ReadableState; + var EE = __require("events").EventEmitter; + var EElistenerCount = function EElistenerCount2(emitter, type) { + return emitter.listeners(type).length; + }; + var Stream2 = require_stream(); + var Buffer2 = __require("buffer").Buffer; + var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk) { + return Buffer2.from(chunk); + } + function _isUint8Array(obj) { + return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; + } + var debugUtil = __require("util"); + var debug; + if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog("stream"); + } else { + debug = function debug2() { + }; + } + var BufferList = require_buffer_list(); + var destroyImpl = require_destroy(); + var _require = require_state(); + var getHighWaterMark = _require.getHighWaterMark; + var _require$codes = require_errors2().codes; + var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; + var ERR_STREAM_PUSH_AFTER_EOF = _require$codes.ERR_STREAM_PUSH_AFTER_EOF; + var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; + var ERR_STREAM_UNSHIFT_AFTER_END_EVENT = _require$codes.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; + var StringDecoder2; + var createReadableStreamAsyncIterator; + var from; + require_inherits()(Readable2, Stream2); + var errorOrDestroy = destroyImpl.errorOrDestroy; + var kProxyEvents = ["error", "close", "destroy", "pause", "resume"]; + function prependListener(emitter, event, fn2) { + if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn2); + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn2); + else if (Array.isArray(emitter._events[event])) emitter._events[event].unshift(fn2); + else emitter._events[event] = [fn2, emitter._events[event]]; + } + function ReadableState(options, stream5, isDuplex) { + Duplex = Duplex || require_stream_duplex(); + options = options || {}; + if (typeof isDuplex !== "boolean") isDuplex = stream5 instanceof Duplex; + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "readableHighWaterMark", isDuplex); + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + this.sync = true; + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + this.paused = true; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.destroyed = false; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.awaitDrain = 0; + this.readingMore = false; + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder2) StringDecoder2 = require_string_decoder().StringDecoder; + this.decoder = new StringDecoder2(options.encoding); + this.encoding = options.encoding; + } + } + function Readable2(options) { + Duplex = Duplex || require_stream_duplex(); + if (!(this instanceof Readable2)) return new Readable2(options); + var isDuplex = this instanceof Duplex; + this._readableState = new ReadableState(options, this, isDuplex); + this.readable = true; + if (options) { + if (typeof options.read === "function") this._read = options.read; + if (typeof options.destroy === "function") this._destroy = options.destroy; + } + Stream2.call(this); + } + Object.defineProperty(Readable2.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + if (this._readableState === void 0) { + return false; + } + return this._readableState.destroyed; + }, + set: function set(value) { + if (!this._readableState) { + return; + } + this._readableState.destroyed = value; + } + }); + Readable2.prototype.destroy = destroyImpl.destroy; + Readable2.prototype._undestroy = destroyImpl.undestroy; + Readable2.prototype._destroy = function(err, cb) { + cb(err); + }; + Readable2.prototype.push = function(chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; + if (!state.objectMode) { + if (typeof chunk === "string") { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer2.from(chunk, encoding); + encoding = ""; + } + skipChunkCheck = true; + } + } else { + skipChunkCheck = true; + } + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); + }; + Readable2.prototype.unshift = function(chunk) { + return readableAddChunk(this, chunk, null, true, false); + }; + function readableAddChunk(stream5, chunk, encoding, addToFront, skipChunkCheck) { + debug("readableAddChunk", chunk); + var state = stream5._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream5, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + errorOrDestroy(stream5, er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer2.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } + if (addToFront) { + if (state.endEmitted) errorOrDestroy(stream5, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT()); + else addChunk(stream5, state, chunk, true); + } else if (state.ended) { + errorOrDestroy(stream5, new ERR_STREAM_PUSH_AFTER_EOF()); + } else if (state.destroyed) { + return false; + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream5, state, chunk, false); + else maybeReadMore(stream5, state); + } else { + addChunk(stream5, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + maybeReadMore(stream5, state); + } + } + return !state.ended && (state.length < state.highWaterMark || state.length === 0); + } + function addChunk(stream5, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + state.awaitDrain = 0; + stream5.emit("data", chunk); + } else { + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk); + else state.buffer.push(chunk); + if (state.needReadable) emitReadable(stream5); + } + maybeReadMore(stream5, state); + } + function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== void 0 && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer", "Uint8Array"], chunk); + } + return er; + } + Readable2.prototype.isPaused = function() { + return this._readableState.flowing === false; + }; + Readable2.prototype.setEncoding = function(enc) { + if (!StringDecoder2) StringDecoder2 = require_string_decoder().StringDecoder; + var decoder = new StringDecoder2(enc); + this._readableState.decoder = decoder; + this._readableState.encoding = this._readableState.decoder.encoding; + var p3 = this._readableState.buffer.head; + var content = ""; + while (p3 !== null) { + content += decoder.write(p3.data); + p3 = p3.next; + } + this._readableState.buffer.clear(); + if (content !== "") this._readableState.buffer.push(content); + this._readableState.length = content.length; + return this; + }; + var MAX_HWM = 1073741824; + function computeNewHighWaterMark(n2) { + if (n2 >= MAX_HWM) { + n2 = MAX_HWM; + } else { + n2--; + n2 |= n2 >>> 1; + n2 |= n2 >>> 2; + n2 |= n2 >>> 4; + n2 |= n2 >>> 8; + n2 |= n2 >>> 16; + n2++; + } + return n2; + } + function howMuchToRead(n2, state) { + if (n2 <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n2 !== n2) { + if (state.flowing && state.length) return state.buffer.head.data.length; + else return state.length; + } + if (n2 > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n2); + if (n2 <= state.length) return n2; + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; + } + Readable2.prototype.read = function(n2) { + debug("read", n2); + n2 = parseInt(n2, 10); + var state = this._readableState; + var nOrig = n2; + if (n2 !== 0) state.emittedReadable = false; + if (n2 === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) { + debug("read: emitReadable", state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this); + else emitReadable(this); + return null; + } + n2 = howMuchToRead(n2, state); + if (n2 === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + var doRead = state.needReadable; + debug("need readable", doRead); + if (state.length === 0 || state.length - n2 < state.highWaterMark) { + doRead = true; + debug("length less than watermark", doRead); + } + if (state.ended || state.reading) { + doRead = false; + debug("reading or ended", doRead); + } else if (doRead) { + debug("do read"); + state.reading = true; + state.sync = true; + if (state.length === 0) state.needReadable = true; + this._read(state.highWaterMark); + state.sync = false; + if (!state.reading) n2 = howMuchToRead(nOrig, state); + } + var ret; + if (n2 > 0) ret = fromList(n2, state); + else ret = null; + if (ret === null) { + state.needReadable = state.length <= state.highWaterMark; + n2 = 0; + } else { + state.length -= n2; + state.awaitDrain = 0; + } + if (state.length === 0) { + if (!state.ended) state.needReadable = true; + if (nOrig !== n2 && state.ended) endReadable(this); + } + if (ret !== null) this.emit("data", ret); + return ret; + }; + function onEofChunk(stream5, state) { + debug("onEofChunk"); + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + if (state.sync) { + emitReadable(stream5); + } else { + state.needReadable = false; + if (!state.emittedReadable) { + state.emittedReadable = true; + emitReadable_(stream5); + } + } + } + function emitReadable(stream5) { + var state = stream5._readableState; + debug("emitReadable", state.needReadable, state.emittedReadable); + state.needReadable = false; + if (!state.emittedReadable) { + debug("emitReadable", state.flowing); + state.emittedReadable = true; + process.nextTick(emitReadable_, stream5); + } + } + function emitReadable_(stream5) { + var state = stream5._readableState; + debug("emitReadable_", state.destroyed, state.length, state.ended); + if (!state.destroyed && (state.length || state.ended)) { + stream5.emit("readable"); + state.emittedReadable = false; + } + state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark; + flow(stream5); + } + function maybeReadMore(stream5, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(maybeReadMore_, stream5, state); + } + } + function maybeReadMore_(stream5, state) { + while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) { + var len = state.length; + debug("maybeReadMore read 0"); + stream5.read(0); + if (len === state.length) + break; + } + state.readingMore = false; + } + Readable2.prototype._read = function(n2) { + errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()")); + }; + Readable2.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts); + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) process.nextTick(endFn); + else src.once("end", endFn); + dest.on("unpipe", onunpipe); + function onunpipe(readable, unpipeInfo) { + debug("onunpipe"); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } + } + function onend() { + debug("onend"); + dest.end(); + } + var ondrain = pipeOnDrain(src); + dest.on("drain", ondrain); + var cleanedUp = false; + function cleanup() { + debug("cleanup"); + dest.removeListener("close", onclose); + dest.removeListener("finish", onfinish); + dest.removeListener("drain", ondrain); + dest.removeListener("error", onerror); + dest.removeListener("unpipe", onunpipe); + src.removeListener("end", onend); + src.removeListener("end", unpipe); + src.removeListener("data", ondata); + cleanedUp = true; + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + src.on("data", ondata); + function ondata(chunk) { + debug("ondata"); + var ret = dest.write(chunk); + debug("dest.write", ret); + if (ret === false) { + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug("false write response, pause", state.awaitDrain); + state.awaitDrain++; + } + src.pause(); + } + } + function onerror(er) { + debug("onerror", er); + unpipe(); + dest.removeListener("error", onerror); + if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er); + } + prependListener(dest, "error", onerror); + function onclose() { + dest.removeListener("finish", onfinish); + unpipe(); + } + dest.once("close", onclose); + function onfinish() { + debug("onfinish"); + dest.removeListener("close", onclose); + unpipe(); + } + dest.once("finish", onfinish); + function unpipe() { + debug("unpipe"); + src.unpipe(dest); + } + dest.emit("pipe", src); + if (!state.flowing) { + debug("pipe resume"); + src.resume(); + } + return dest; + }; + function pipeOnDrain(src) { + return function pipeOnDrainFunctionResult() { + var state = src._readableState; + debug("pipeOnDrain", state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, "data")) { + state.flowing = true; + flow(src); + } + }; + } + Readable2.prototype.unpipe = function(dest) { + var state = this._readableState; + var unpipeInfo = { + hasUnpiped: false + }; + if (state.pipesCount === 0) return this; + if (state.pipesCount === 1) { + if (dest && dest !== state.pipes) return this; + if (!dest) dest = state.pipes; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit("unpipe", this, unpipeInfo); + return this; + } + if (!dest) { + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + for (var i6 = 0; i6 < len; i6++) dests[i6].emit("unpipe", this, { + hasUnpiped: false + }); + return this; + } + var index2 = indexOf(state.pipes, dest); + if (index2 === -1) return this; + state.pipes.splice(index2, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + dest.emit("unpipe", this, unpipeInfo); + return this; + }; + Readable2.prototype.on = function(ev, fn2) { + var res = Stream2.prototype.on.call(this, ev, fn2); + var state = this._readableState; + if (ev === "data") { + state.readableListening = this.listenerCount("readable") > 0; + if (state.flowing !== false) this.resume(); + } else if (ev === "readable") { + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.flowing = false; + state.emittedReadable = false; + debug("on readable", state.length, state.reading); + if (state.length) { + emitReadable(this); + } else if (!state.reading) { + process.nextTick(nReadingNextTick, this); + } + } + } + return res; + }; + Readable2.prototype.addListener = Readable2.prototype.on; + Readable2.prototype.removeListener = function(ev, fn2) { + var res = Stream2.prototype.removeListener.call(this, ev, fn2); + if (ev === "readable") { + process.nextTick(updateReadableListening, this); + } + return res; + }; + Readable2.prototype.removeAllListeners = function(ev) { + var res = Stream2.prototype.removeAllListeners.apply(this, arguments); + if (ev === "readable" || ev === void 0) { + process.nextTick(updateReadableListening, this); + } + return res; + }; + function updateReadableListening(self2) { + var state = self2._readableState; + state.readableListening = self2.listenerCount("readable") > 0; + if (state.resumeScheduled && !state.paused) { + state.flowing = true; + } else if (self2.listenerCount("data") > 0) { + self2.resume(); + } + } + function nReadingNextTick(self2) { + debug("readable nexttick read 0"); + self2.read(0); + } + Readable2.prototype.resume = function() { + var state = this._readableState; + if (!state.flowing) { + debug("resume"); + state.flowing = !state.readableListening; + resume(this, state); + } + state.paused = false; + return this; + }; + function resume(stream5, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process.nextTick(resume_, stream5, state); + } + } + function resume_(stream5, state) { + debug("resume", state.reading); + if (!state.reading) { + stream5.read(0); + } + state.resumeScheduled = false; + stream5.emit("resume"); + flow(stream5); + if (state.flowing && !state.reading) stream5.read(0); + } + Readable2.prototype.pause = function() { + debug("call pause flowing=%j", this._readableState.flowing); + if (this._readableState.flowing !== false) { + debug("pause"); + this._readableState.flowing = false; + this.emit("pause"); + } + this._readableState.paused = true; + return this; + }; + function flow(stream5) { + var state = stream5._readableState; + debug("flow", state.flowing); + while (state.flowing && stream5.read() !== null) ; + } + Readable2.prototype.wrap = function(stream5) { + var _this = this; + var state = this._readableState; + var paused = false; + stream5.on("end", function() { + debug("wrapped end"); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } + _this.push(null); + }); + stream5.on("data", function(chunk) { + debug("wrapped data"); + if (state.decoder) chunk = state.decoder.write(chunk); + if (state.objectMode && (chunk === null || chunk === void 0)) return; + else if (!state.objectMode && (!chunk || !chunk.length)) return; + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream5.pause(); + } + }); + for (var i6 in stream5) { + if (this[i6] === void 0 && typeof stream5[i6] === "function") { + this[i6] = /* @__PURE__ */ function methodWrap(method) { + return function methodWrapReturnFunction() { + return stream5[method].apply(stream5, arguments); + }; + }(i6); + } + } + for (var n2 = 0; n2 < kProxyEvents.length; n2++) { + stream5.on(kProxyEvents[n2], this.emit.bind(this, kProxyEvents[n2])); + } + this._read = function(n3) { + debug("wrapped _read", n3); + if (paused) { + paused = false; + stream5.resume(); + } + }; + return this; + }; + if (typeof Symbol === "function") { + Readable2.prototype[Symbol.asyncIterator] = function() { + if (createReadableStreamAsyncIterator === void 0) { + createReadableStreamAsyncIterator = require_async_iterator(); + } + return createReadableStreamAsyncIterator(this); + }; + } + Object.defineProperty(Readable2.prototype, "readableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._readableState.highWaterMark; + } + }); + Object.defineProperty(Readable2.prototype, "readableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._readableState && this._readableState.buffer; + } + }); + Object.defineProperty(Readable2.prototype, "readableFlowing", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._readableState.flowing; + }, + set: function set(state) { + if (this._readableState) { + this._readableState.flowing = state; + } + } + }); + Readable2._fromList = fromList; + Object.defineProperty(Readable2.prototype, "readableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._readableState.length; + } + }); + function fromList(n2, state) { + if (state.length === 0) return null; + var ret; + if (state.objectMode) ret = state.buffer.shift(); + else if (!n2 || n2 >= state.length) { + if (state.decoder) ret = state.buffer.join(""); + else if (state.buffer.length === 1) ret = state.buffer.first(); + else ret = state.buffer.concat(state.length); + state.buffer.clear(); + } else { + ret = state.buffer.consume(n2, state.decoder); + } + return ret; + } + function endReadable(stream5) { + var state = stream5._readableState; + debug("endReadable", state.endEmitted); + if (!state.endEmitted) { + state.ended = true; + process.nextTick(endReadableNT, state, stream5); + } + } + function endReadableNT(state, stream5) { + debug("endReadableNT", state.endEmitted, state.length); + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream5.readable = false; + stream5.emit("end"); + if (state.autoDestroy) { + var wState = stream5._writableState; + if (!wState || wState.autoDestroy && wState.finished) { + stream5.destroy(); + } + } + } + } + if (typeof Symbol === "function") { + Readable2.from = function(iterable, opts) { + if (from === void 0) { + from = require_from(); + } + return from(Readable2, iterable, opts); + }; + } + function indexOf(xs, x3) { + for (var i6 = 0, l5 = xs.length; i6 < l5; i6++) { + if (xs[i6] === x3) return i6; + } + return -1; + } + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_duplex.js +var require_stream_duplex = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_duplex.js"(exports2, module2) { + "use strict"; + var objectKeys = Object.keys || function(obj) { + var keys2 = []; + for (var key in obj) keys2.push(key); + return keys2; + }; + module2.exports = Duplex; + var Readable2 = require_stream_readable(); + var Writable = require_stream_writable(); + require_inherits()(Duplex, Readable2); + { + keys = objectKeys(Writable.prototype); + for (v = 0; v < keys.length; v++) { + method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; + } + } + var keys; + var method; + var v; + function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); + Readable2.call(this, options); + Writable.call(this, options); + this.allowHalfOpen = true; + if (options) { + if (options.readable === false) this.readable = false; + if (options.writable === false) this.writable = false; + if (options.allowHalfOpen === false) { + this.allowHalfOpen = false; + this.once("end", onend); + } + } + } + Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._writableState.highWaterMark; + } + }); + Object.defineProperty(Duplex.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._writableState && this._writableState.getBuffer(); + } + }); + Object.defineProperty(Duplex.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._writableState.length; + } + }); + function onend() { + if (this._writableState.ended) return; + process.nextTick(onEndNT, this); + } + function onEndNT(self2) { + self2.end(); + } + Object.defineProperty(Duplex.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + if (this._readableState === void 0 || this._writableState === void 0) { + return false; + } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function set(value) { + if (this._readableState === void 0 || this._writableState === void 0) { + return; + } + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } + }); + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_writable.js +var require_stream_writable = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_writable.js"(exports2, module2) { + "use strict"; + module2.exports = Writable; + function CorkedRequest(state) { + var _this = this; + this.next = null; + this.entry = null; + this.finish = function() { + onCorkedFinish(_this, state); + }; + } + var Duplex; + Writable.WritableState = WritableState; + var internalUtil = { + deprecate: require_node() + }; + var Stream2 = require_stream(); + var Buffer2 = __require("buffer").Buffer; + var OurUint8Array = (typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() { + }; + function _uint8ArrayToBuffer(chunk) { + return Buffer2.from(chunk); + } + function _isUint8Array(obj) { + return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; + } + var destroyImpl = require_destroy(); + var _require = require_state(); + var getHighWaterMark = _require.getHighWaterMark; + var _require$codes = require_errors2().codes; + var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE; + var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; + var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; + var ERR_STREAM_CANNOT_PIPE = _require$codes.ERR_STREAM_CANNOT_PIPE; + var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; + var ERR_STREAM_NULL_VALUES = _require$codes.ERR_STREAM_NULL_VALUES; + var ERR_STREAM_WRITE_AFTER_END = _require$codes.ERR_STREAM_WRITE_AFTER_END; + var ERR_UNKNOWN_ENCODING = _require$codes.ERR_UNKNOWN_ENCODING; + var errorOrDestroy = destroyImpl.errorOrDestroy; + require_inherits()(Writable, Stream2); + function nop() { + } + function WritableState(options, stream5, isDuplex) { + Duplex = Duplex || require_stream_duplex(); + options = options || {}; + if (typeof isDuplex !== "boolean") isDuplex = stream5 instanceof Duplex; + this.objectMode = !!options.objectMode; + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + this.highWaterMark = getHighWaterMark(this, options, "writableHighWaterMark", isDuplex); + this.finalCalled = false; + this.needDrain = false; + this.ending = false; + this.ended = false; + this.finished = false; + this.destroyed = false; + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + this.defaultEncoding = options.defaultEncoding || "utf8"; + this.length = 0; + this.writing = false; + this.corked = 0; + this.sync = true; + this.bufferProcessing = false; + this.onwrite = function(er) { + onwrite(stream5, er); + }; + this.writecb = null; + this.writelen = 0; + this.bufferedRequest = null; + this.lastBufferedRequest = null; + this.pendingcb = 0; + this.prefinished = false; + this.errorEmitted = false; + this.emitClose = options.emitClose !== false; + this.autoDestroy = !!options.autoDestroy; + this.bufferedRequestCount = 0; + this.corkedRequestsFree = new CorkedRequest(this); + } + WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; + }; + (function() { + try { + Object.defineProperty(WritableState.prototype, "buffer", { + get: internalUtil.deprecate(function writableStateBufferGetter() { + return this.getBuffer(); + }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003") + }); + } catch (_) { + } + })(); + var realHasInstance; + if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function value(object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; + return object && object._writableState instanceof WritableState; + } + }); + } else { + realHasInstance = function realHasInstance2(object) { + return object instanceof this; + }; + } + function Writable(options) { + Duplex = Duplex || require_stream_duplex(); + var isDuplex = this instanceof Duplex; + if (!isDuplex && !realHasInstance.call(Writable, this)) return new Writable(options); + this._writableState = new WritableState(options, this, isDuplex); + this.writable = true; + if (options) { + if (typeof options.write === "function") this._write = options.write; + if (typeof options.writev === "function") this._writev = options.writev; + if (typeof options.destroy === "function") this._destroy = options.destroy; + if (typeof options.final === "function") this._final = options.final; + } + Stream2.call(this); + } + Writable.prototype.pipe = function() { + errorOrDestroy(this, new ERR_STREAM_CANNOT_PIPE()); + }; + function writeAfterEnd(stream5, cb) { + var er = new ERR_STREAM_WRITE_AFTER_END(); + errorOrDestroy(stream5, er); + process.nextTick(cb, er); + } + function validChunk(stream5, state, chunk, cb) { + var er; + if (chunk === null) { + er = new ERR_STREAM_NULL_VALUES(); + } else if (typeof chunk !== "string" && !state.objectMode) { + er = new ERR_INVALID_ARG_TYPE("chunk", ["string", "Buffer"], chunk); + } + if (er) { + errorOrDestroy(stream5, er); + process.nextTick(cb, er); + return false; + } + return true; + } + Writable.prototype.write = function(chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); + if (isBuf && !Buffer2.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); + } + if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (isBuf) encoding = "buffer"; + else if (!encoding) encoding = state.defaultEncoding; + if (typeof cb !== "function") cb = nop; + if (state.ending) writeAfterEnd(this, cb); + else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); + } + return ret; + }; + Writable.prototype.cork = function() { + this._writableState.corked++; + }; + Writable.prototype.uncork = function() { + var state = this._writableState; + if (state.corked) { + state.corked--; + if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } + }; + Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + if (typeof encoding === "string") encoding = encoding.toLowerCase(); + if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new ERR_UNKNOWN_ENCODING(encoding); + this._writableState.defaultEncoding = encoding; + return this; + }; + Object.defineProperty(Writable.prototype, "writableBuffer", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._writableState && this._writableState.getBuffer(); + } + }); + function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") { + chunk = Buffer2.from(chunk, encoding); + } + return chunk; + } + Object.defineProperty(Writable.prototype, "writableHighWaterMark", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._writableState.highWaterMark; + } + }); + function writeOrBuffer(stream5, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = "buffer"; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; + state.length += len; + var ret = state.length < state.highWaterMark; + if (!ret) state.needDrain = true; + if (state.writing || state.corked) { + var last2 = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk, + encoding, + isBuf, + callback: cb, + next: null + }; + if (last2) { + last2.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream5, state, false, len, chunk, encoding, cb); + } + return ret; + } + function doWrite(stream5, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write")); + else if (writev) stream5._writev(chunk, state.onwrite); + else stream5._write(chunk, encoding, state.onwrite); + state.sync = false; + } + function onwriteError(stream5, state, sync2, er, cb) { + --state.pendingcb; + if (sync2) { + process.nextTick(cb, er); + process.nextTick(finishMaybe, stream5, state); + stream5._writableState.errorEmitted = true; + errorOrDestroy(stream5, er); + } else { + cb(er); + stream5._writableState.errorEmitted = true; + errorOrDestroy(stream5, er); + finishMaybe(stream5, state); + } + } + function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; + } + function onwrite(stream5, er) { + var state = stream5._writableState; + var sync2 = state.sync; + var cb = state.writecb; + if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK(); + onwriteStateUpdate(state); + if (er) onwriteError(stream5, state, sync2, er, cb); + else { + var finished = needFinish(state) || stream5.destroyed; + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream5, state); + } + if (sync2) { + process.nextTick(afterWrite, stream5, state, finished, cb); + } else { + afterWrite(stream5, state, finished, cb); + } + } + } + function afterWrite(stream5, state, finished, cb) { + if (!finished) onwriteDrain(stream5, state); + state.pendingcb--; + cb(); + finishMaybe(stream5, state); + } + function onwriteDrain(stream5, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream5.emit("drain"); + } + } + function clearBuffer(stream5, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + if (stream5._writev && entry && entry.next) { + var l5 = state.bufferedRequestCount; + var buffer = new Array(l5); + var holder = state.corkedRequestsFree; + holder.entry = entry; + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; + doWrite(stream5, state, true, state.length, buffer, "", holder.finish); + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + doWrite(stream5, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + if (state.writing) { + break; + } + } + if (entry === null) state.lastBufferedRequest = null; + } + state.bufferedRequest = entry; + state.bufferProcessing = false; + } + Writable.prototype._write = function(chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_write()")); + }; + Writable.prototype._writev = null; + Writable.prototype.end = function(chunk, encoding, cb) { + var state = this._writableState; + if (typeof chunk === "function") { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === "function") { + cb = encoding; + encoding = null; + } + if (chunk !== null && chunk !== void 0) this.write(chunk, encoding); + if (state.corked) { + state.corked = 1; + this.uncork(); + } + if (!state.ending) endWritable(this, state, cb); + return this; + }; + Object.defineProperty(Writable.prototype, "writableLength", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + return this._writableState.length; + } + }); + function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; + } + function callFinal(stream5, state) { + stream5._final(function(err) { + state.pendingcb--; + if (err) { + errorOrDestroy(stream5, err); + } + state.prefinished = true; + stream5.emit("prefinish"); + finishMaybe(stream5, state); + }); + } + function prefinish(stream5, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream5._final === "function" && !state.destroyed) { + state.pendingcb++; + state.finalCalled = true; + process.nextTick(callFinal, stream5, state); + } else { + state.prefinished = true; + stream5.emit("prefinish"); + } + } + } + function finishMaybe(stream5, state) { + var need = needFinish(state); + if (need) { + prefinish(stream5, state); + if (state.pendingcb === 0) { + state.finished = true; + stream5.emit("finish"); + if (state.autoDestroy) { + var rState = stream5._readableState; + if (!rState || rState.autoDestroy && rState.endEmitted) { + stream5.destroy(); + } + } + } + } + return need; + } + function endWritable(stream5, state, cb) { + state.ending = true; + finishMaybe(stream5, state); + if (cb) { + if (state.finished) process.nextTick(cb); + else stream5.once("finish", cb); + } + state.ended = true; + stream5.writable = false; + } + function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + state.corkedRequestsFree.next = corkReq; + } + Object.defineProperty(Writable.prototype, "destroyed", { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function get2() { + if (this._writableState === void 0) { + return false; + } + return this._writableState.destroyed; + }, + set: function set(value) { + if (!this._writableState) { + return; + } + this._writableState.destroyed = value; + } + }); + Writable.prototype.destroy = destroyImpl.destroy; + Writable.prototype._undestroy = destroyImpl.undestroy; + Writable.prototype._destroy = function(err, cb) { + cb(err); + }; + } +}); + +// ../../node_modules/.pnpm/winston-transport@4.7.0/node_modules/winston-transport/modern.js +var require_modern = __commonJS({ + "../../node_modules/.pnpm/winston-transport@4.7.0/node_modules/winston-transport/modern.js"(exports2, module2) { + "use strict"; + var util5 = __require("util"); + var Writable = require_stream_writable(); + var { LEVEL } = require_triple_beam(); + var TransportStream = module2.exports = function TransportStream2(options = {}) { + Writable.call(this, { objectMode: true, highWaterMark: options.highWaterMark }); + this.format = options.format; + this.level = options.level; + this.handleExceptions = options.handleExceptions; + this.handleRejections = options.handleRejections; + this.silent = options.silent; + if (options.log) this.log = options.log; + if (options.logv) this.logv = options.logv; + if (options.close) this.close = options.close; + this.once("pipe", (logger4) => { + this.levels = logger4.levels; + this.parent = logger4; + }); + this.once("unpipe", (src) => { + if (src === this.parent) { + this.parent = null; + if (this.close) { + this.close(); + } + } + }); + }; + util5.inherits(TransportStream, Writable); + TransportStream.prototype._write = function _write(info, enc, callback) { + if (this.silent || info.exception === true && !this.handleExceptions) { + return callback(null); + } + const level = this.level || this.parent && this.parent.level; + if (!level || this.levels[level] >= this.levels[info[LEVEL]]) { + if (info && !this.format) { + return this.log(info, callback); + } + let errState; + let transformed; + try { + transformed = this.format.transform(Object.assign({}, info), this.format.options); + } catch (err) { + errState = err; + } + if (errState || !transformed) { + callback(); + if (errState) throw errState; + return; + } + return this.log(transformed, callback); + } + this._writableState.sync = false; + return callback(null); + }; + TransportStream.prototype._writev = function _writev(chunks, callback) { + if (this.logv) { + const infos = chunks.filter(this._accept, this); + if (!infos.length) { + return callback(null); + } + return this.logv(infos, callback); + } + for (let i6 = 0; i6 < chunks.length; i6++) { + if (!this._accept(chunks[i6])) continue; + if (chunks[i6].chunk && !this.format) { + this.log(chunks[i6].chunk, chunks[i6].callback); + continue; + } + let errState; + let transformed; + try { + transformed = this.format.transform( + Object.assign({}, chunks[i6].chunk), + this.format.options + ); + } catch (err) { + errState = err; + } + if (errState || !transformed) { + chunks[i6].callback(); + if (errState) { + callback(null); + throw errState; + } + } else { + this.log(transformed, chunks[i6].callback); + } + } + return callback(null); + }; + TransportStream.prototype._accept = function _accept(write) { + const info = write.chunk; + if (this.silent) { + return false; + } + const level = this.level || this.parent && this.parent.level; + if (info.exception === true || !level || this.levels[level] >= this.levels[info[LEVEL]]) { + if (this.handleExceptions || info.exception !== true) { + return true; + } + } + return false; + }; + TransportStream.prototype._nop = function _nop() { + return void 0; + }; + } +}); + +// ../../node_modules/.pnpm/winston-transport@4.7.0/node_modules/winston-transport/legacy.js +var require_legacy = __commonJS({ + "../../node_modules/.pnpm/winston-transport@4.7.0/node_modules/winston-transport/legacy.js"(exports2, module2) { + "use strict"; + var util5 = __require("util"); + var { LEVEL } = require_triple_beam(); + var TransportStream = require_modern(); + var LegacyTransportStream = module2.exports = function LegacyTransportStream2(options = {}) { + TransportStream.call(this, options); + if (!options.transport || typeof options.transport.log !== "function") { + throw new Error("Invalid transport, must be an object with a log method."); + } + this.transport = options.transport; + this.level = this.level || options.transport.level; + this.handleExceptions = this.handleExceptions || options.transport.handleExceptions; + this._deprecated(); + function transportError(err) { + this.emit("error", err, this.transport); + } + if (!this.transport.__winstonError) { + this.transport.__winstonError = transportError.bind(this); + this.transport.on("error", this.transport.__winstonError); + } + }; + util5.inherits(LegacyTransportStream, TransportStream); + LegacyTransportStream.prototype._write = function _write(info, enc, callback) { + if (this.silent || info.exception === true && !this.handleExceptions) { + return callback(null); + } + if (!this.level || this.levels[this.level] >= this.levels[info[LEVEL]]) { + this.transport.log(info[LEVEL], info.message, info, this._nop); + } + callback(null); + }; + LegacyTransportStream.prototype._writev = function _writev(chunks, callback) { + for (let i6 = 0; i6 < chunks.length; i6++) { + if (this._accept(chunks[i6])) { + this.transport.log( + chunks[i6].chunk[LEVEL], + chunks[i6].chunk.message, + chunks[i6].chunk, + this._nop + ); + chunks[i6].callback(); + } + } + return callback(null); + }; + LegacyTransportStream.prototype._deprecated = function _deprecated() { + console.error([ + `${this.transport.name} is a legacy winston transport. Consider upgrading: `, + "- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md" + ].join("\n")); + }; + LegacyTransportStream.prototype.close = function close() { + if (this.transport.close) { + this.transport.close(); + } + if (this.transport.__winstonError) { + this.transport.removeListener("error", this.transport.__winstonError); + this.transport.__winstonError = null; + } + }; + } +}); + +// ../../node_modules/.pnpm/winston-transport@4.7.0/node_modules/winston-transport/index.js +var require_winston_transport = __commonJS({ + "../../node_modules/.pnpm/winston-transport@4.7.0/node_modules/winston-transport/index.js"(exports2, module2) { + "use strict"; + module2.exports = require_modern(); + module2.exports.LegacyTransportStream = require_legacy(); + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/console.js +var require_console = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/console.js"(exports2, module2) { + "use strict"; + var os2 = __require("os"); + var { LEVEL, MESSAGE } = require_triple_beam(); + var TransportStream = require_winston_transport(); + module2.exports = class Console extends TransportStream { + /** + * Constructor function for the Console transport object responsible for + * persisting log messages and metadata to a terminal or TTY. + * @param {!Object} [options={}] - Options for this instance. + */ + constructor(options = {}) { + super(options); + this.name = options.name || "console"; + this.stderrLevels = this._stringArrayToSet(options.stderrLevels); + this.consoleWarnLevels = this._stringArrayToSet(options.consoleWarnLevels); + this.eol = typeof options.eol === "string" ? options.eol : os2.EOL; + this.forceConsole = options.forceConsole || false; + this._consoleLog = console.log.bind(console); + this._consoleWarn = console.warn.bind(console); + this._consoleError = console.error.bind(console); + this.setMaxListeners(30); + } + /** + * Core logging method exposed to Winston. + * @param {Object} info - TODO: add param description. + * @param {Function} callback - TODO: add param description. + * @returns {undefined} + */ + log(info, callback) { + setImmediate(() => this.emit("logged", info)); + if (this.stderrLevels[info[LEVEL]]) { + if (console._stderr && !this.forceConsole) { + console._stderr.write(`${info[MESSAGE]}${this.eol}`); + } else { + this._consoleError(info[MESSAGE]); + } + if (callback) { + callback(); + } + return; + } else if (this.consoleWarnLevels[info[LEVEL]]) { + if (console._stderr && !this.forceConsole) { + console._stderr.write(`${info[MESSAGE]}${this.eol}`); + } else { + this._consoleWarn(info[MESSAGE]); + } + if (callback) { + callback(); + } + return; + } + if (console._stdout && !this.forceConsole) { + console._stdout.write(`${info[MESSAGE]}${this.eol}`); + } else { + this._consoleLog(info[MESSAGE]); + } + if (callback) { + callback(); + } + } + /** + * Returns a Set-like object with strArray's elements as keys (each with the + * value true). + * @param {Array} strArray - Array of Set-elements as strings. + * @param {?string} [errMsg] - Custom error message thrown on invalid input. + * @returns {Object} - TODO: add return description. + * @private + */ + _stringArrayToSet(strArray, errMsg) { + if (!strArray) return {}; + errMsg = errMsg || "Cannot make set from type other than Array of string elements"; + if (!Array.isArray(strArray)) { + throw new Error(errMsg); + } + return strArray.reduce((set, el) => { + if (typeof el !== "string") { + throw new Error(errMsg); + } + set[el] = true; + return set; + }, {}); + } + }; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/isArrayLike.js +var require_isArrayLike = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/isArrayLike.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.default = isArrayLike2; + function isArrayLike2(value) { + return value && typeof value.length === "number" && value.length >= 0 && value.length % 1 === 0; + } + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/initialParams.js +var require_initialParams = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/initialParams.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.default = function(fn2) { + return function(...args2) { + var callback = args2.pop(); + return fn2.call(this, args2, callback); + }; + }; + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/setImmediate.js +var require_setImmediate = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/setImmediate.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.fallback = fallback; + exports2.wrap = wrap2; + var hasQueueMicrotask = exports2.hasQueueMicrotask = typeof queueMicrotask === "function" && queueMicrotask; + var hasSetImmediate = exports2.hasSetImmediate = typeof setImmediate === "function" && setImmediate; + var hasNextTick = exports2.hasNextTick = typeof process === "object" && typeof process.nextTick === "function"; + function fallback(fn2) { + setTimeout(fn2, 0); + } + function wrap2(defer2) { + return (fn2, ...args2) => defer2(() => fn2(...args2)); + } + var _defer; + if (hasQueueMicrotask) { + _defer = queueMicrotask; + } else if (hasSetImmediate) { + _defer = setImmediate; + } else if (hasNextTick) { + _defer = process.nextTick; + } else { + _defer = fallback; + } + exports2.default = wrap2(_defer); + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/asyncify.js +var require_asyncify = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/asyncify.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.default = asyncify; + var _initialParams = require_initialParams(); + var _initialParams2 = _interopRequireDefault(_initialParams); + var _setImmediate2 = require_setImmediate(); + var _setImmediate22 = _interopRequireDefault(_setImmediate2); + var _wrapAsync = require_wrapAsync(); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function asyncify(func) { + if ((0, _wrapAsync.isAsync)(func)) { + return function(...args2) { + const callback = args2.pop(); + const promise = func.apply(this, args2); + return handlePromise(promise, callback); + }; + } + return (0, _initialParams2.default)(function(args2, callback) { + var result; + try { + result = func.apply(this, args2); + } catch (e) { + return callback(e); + } + if (result && typeof result.then === "function") { + return handlePromise(result, callback); + } else { + callback(null, result); + } + }); + } + function handlePromise(promise, callback) { + return promise.then((value) => { + invokeCallback(callback, null, value); + }, (err) => { + invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); + }); + } + function invokeCallback(callback, error, value) { + try { + callback(error, value); + } catch (err) { + (0, _setImmediate22.default)((e) => { + throw e; + }, err); + } + } + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/wrapAsync.js +var require_wrapAsync = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/wrapAsync.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.isAsyncIterable = exports2.isAsyncGenerator = exports2.isAsync = void 0; + var _asyncify = require_asyncify(); + var _asyncify2 = _interopRequireDefault(_asyncify); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function isAsync(fn2) { + return fn2[Symbol.toStringTag] === "AsyncFunction"; + } + function isAsyncGenerator(fn2) { + return fn2[Symbol.toStringTag] === "AsyncGenerator"; + } + function isAsyncIterable(obj) { + return typeof obj[Symbol.asyncIterator] === "function"; + } + function wrapAsync2(asyncFn) { + if (typeof asyncFn !== "function") throw new Error("expected a function"); + return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn; + } + exports2.default = wrapAsync2; + exports2.isAsync = isAsync; + exports2.isAsyncGenerator = isAsyncGenerator; + exports2.isAsyncIterable = isAsyncIterable; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/awaitify.js +var require_awaitify = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/awaitify.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.default = awaitify; + function awaitify(asyncFn, arity) { + if (!arity) arity = asyncFn.length; + if (!arity) throw new Error("arity is undefined"); + function awaitable(...args2) { + if (typeof args2[arity - 1] === "function") { + return asyncFn.apply(this, args2); + } + return new Promise((resolve25, reject) => { + args2[arity - 1] = (err, ...cbArgs) => { + if (err) return reject(err); + resolve25(cbArgs.length > 1 ? cbArgs : cbArgs[0]); + }; + asyncFn.apply(this, args2); + }); + } + return awaitable; + } + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/parallel.js +var require_parallel = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/parallel.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + var _isArrayLike = require_isArrayLike(); + var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + var _wrapAsync = require_wrapAsync(); + var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + var _awaitify = require_awaitify(); + var _awaitify2 = _interopRequireDefault(_awaitify); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + exports2.default = (0, _awaitify2.default)((eachfn, tasks, callback) => { + var results = (0, _isArrayLike2.default)(tasks) ? [] : {}; + eachfn(tasks, (task, key, taskCb) => { + (0, _wrapAsync2.default)(task)((err, ...result) => { + if (result.length < 2) { + [result] = result; + } + results[key] = result; + taskCb(err); + }); + }, (err) => callback(err, results)); + }, 3); + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/once.js +var require_once = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/once.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.default = once8; + function once8(fn2) { + function wrapper(...args2) { + if (fn2 === null) return; + var callFn = fn2; + fn2 = null; + callFn.apply(this, args2); + } + Object.assign(wrapper, fn2); + return wrapper; + } + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/getIterator.js +var require_getIterator = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/getIterator.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.default = function(coll) { + return coll[Symbol.iterator] && coll[Symbol.iterator](); + }; + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/iterator.js +var require_iterator = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/iterator.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.default = createIterator; + var _isArrayLike = require_isArrayLike(); + var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + var _getIterator = require_getIterator(); + var _getIterator2 = _interopRequireDefault(_getIterator); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function createArrayIterator(coll) { + var i6 = -1; + var len = coll.length; + return function next2() { + return ++i6 < len ? { value: coll[i6], key: i6 } : null; + }; + } + function createES2015Iterator(iterator) { + var i6 = -1; + return function next2() { + var item = iterator.next(); + if (item.done) return null; + i6++; + return { value: item.value, key: i6 }; + }; + } + function createObjectIterator(obj) { + var okeys = obj ? Object.keys(obj) : []; + var i6 = -1; + var len = okeys.length; + return function next2() { + var key = okeys[++i6]; + if (key === "__proto__") { + return next2(); + } + return i6 < len ? { value: obj[key], key } : null; + }; + } + function createIterator(coll) { + if ((0, _isArrayLike2.default)(coll)) { + return createArrayIterator(coll); + } + var iterator = (0, _getIterator2.default)(coll); + return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll); + } + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/onlyOnce.js +var require_onlyOnce = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/onlyOnce.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.default = onlyOnce; + function onlyOnce(fn2) { + return function(...args2) { + if (fn2 === null) throw new Error("Callback was already called."); + var callFn = fn2; + fn2 = null; + callFn.apply(this, args2); + }; + } + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/breakLoop.js +var require_breakLoop = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/breakLoop.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + var breakLoop = {}; + exports2.default = breakLoop; + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/asyncEachOfLimit.js +var require_asyncEachOfLimit = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/asyncEachOfLimit.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.default = asyncEachOfLimit; + var _breakLoop = require_breakLoop(); + var _breakLoop2 = _interopRequireDefault(_breakLoop); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function asyncEachOfLimit(generator, limit, iteratee, callback) { + let done = false; + let canceled = false; + let awaiting = false; + let running = 0; + let idx = 0; + function replenish() { + if (running >= limit || awaiting || done) return; + awaiting = true; + generator.next().then(({ value, done: iterDone }) => { + if (canceled || done) return; + awaiting = false; + if (iterDone) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running++; + iteratee(value, idx, iterateeCallback); + idx++; + replenish(); + }).catch(handleError3); + } + function iterateeCallback(err, result) { + running -= 1; + if (canceled) return; + if (err) return handleError3(err); + if (err === false) { + done = true; + canceled = true; + return; + } + if (result === _breakLoop2.default || done && running <= 0) { + done = true; + return callback(null); + } + replenish(); + } + function handleError3(err) { + if (canceled) return; + awaiting = false; + done = true; + callback(err); + } + replenish(); + } + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/eachOfLimit.js +var require_eachOfLimit = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/eachOfLimit.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + var _once = require_once(); + var _once2 = _interopRequireDefault(_once); + var _iterator = require_iterator(); + var _iterator2 = _interopRequireDefault(_iterator); + var _onlyOnce = require_onlyOnce(); + var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + var _wrapAsync = require_wrapAsync(); + var _asyncEachOfLimit = require_asyncEachOfLimit(); + var _asyncEachOfLimit2 = _interopRequireDefault(_asyncEachOfLimit); + var _breakLoop = require_breakLoop(); + var _breakLoop2 = _interopRequireDefault(_breakLoop); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + exports2.default = (limit) => { + return (obj, iteratee, callback) => { + callback = (0, _once2.default)(callback); + if (limit <= 0) { + throw new RangeError("concurrency limit cannot be less than 1"); + } + if (!obj) { + return callback(null); + } + if ((0, _wrapAsync.isAsyncGenerator)(obj)) { + return (0, _asyncEachOfLimit2.default)(obj, limit, iteratee, callback); + } + if ((0, _wrapAsync.isAsyncIterable)(obj)) { + return (0, _asyncEachOfLimit2.default)(obj[Symbol.asyncIterator](), limit, iteratee, callback); + } + var nextElem = (0, _iterator2.default)(obj); + var done = false; + var canceled = false; + var running = 0; + var looping = false; + function iterateeCallback(err, value) { + if (canceled) return; + running -= 1; + if (err) { + done = true; + callback(err); + } else if (err === false) { + done = true; + canceled = true; + } else if (value === _breakLoop2.default || done && running <= 0) { + done = true; + return callback(null); + } else if (!looping) { + replenish(); + } + } + function replenish() { + looping = true; + while (running < limit && !done) { + var elem = nextElem(); + if (elem === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(iterateeCallback)); + } + looping = false; + } + replenish(); + }; + }; + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/eachOfLimit.js +var require_eachOfLimit2 = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/eachOfLimit.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + var _eachOfLimit2 = require_eachOfLimit(); + var _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2); + var _wrapAsync = require_wrapAsync(); + var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + var _awaitify = require_awaitify(); + var _awaitify2 = _interopRequireDefault(_awaitify); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function eachOfLimit(coll, limit, iteratee, callback) { + return (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback); + } + exports2.default = (0, _awaitify2.default)(eachOfLimit, 4); + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/eachOfSeries.js +var require_eachOfSeries = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/eachOfSeries.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + var _eachOfLimit = require_eachOfLimit2(); + var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + var _awaitify = require_awaitify(); + var _awaitify2 = _interopRequireDefault(_awaitify); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function eachOfSeries(coll, iteratee, callback) { + return (0, _eachOfLimit2.default)(coll, 1, iteratee, callback); + } + exports2.default = (0, _awaitify2.default)(eachOfSeries, 3); + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/series.js +var require_series = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/series.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.default = series; + var _parallel2 = require_parallel(); + var _parallel3 = _interopRequireDefault(_parallel2); + var _eachOfSeries = require_eachOfSeries(); + var _eachOfSeries2 = _interopRequireDefault(_eachOfSeries); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function series(tasks, callback) { + return (0, _parallel3.default)(_eachOfSeries2.default, tasks, callback); + } + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_transform.js +var require_stream_transform = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_transform.js"(exports2, module2) { + "use strict"; + module2.exports = Transform; + var _require$codes = require_errors2().codes; + var ERR_METHOD_NOT_IMPLEMENTED = _require$codes.ERR_METHOD_NOT_IMPLEMENTED; + var ERR_MULTIPLE_CALLBACK = _require$codes.ERR_MULTIPLE_CALLBACK; + var ERR_TRANSFORM_ALREADY_TRANSFORMING = _require$codes.ERR_TRANSFORM_ALREADY_TRANSFORMING; + var ERR_TRANSFORM_WITH_LENGTH_0 = _require$codes.ERR_TRANSFORM_WITH_LENGTH_0; + var Duplex = require_stream_duplex(); + require_inherits()(Transform, Duplex); + function afterTransform(er, data2) { + var ts = this._transformState; + ts.transforming = false; + var cb = ts.writecb; + if (cb === null) { + return this.emit("error", new ERR_MULTIPLE_CALLBACK()); + } + ts.writechunk = null; + ts.writecb = null; + if (data2 != null) + this.push(data2); + cb(er); + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } + } + function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + Duplex.call(this, options); + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + this._readableState.needReadable = true; + this._readableState.sync = false; + if (options) { + if (typeof options.transform === "function") this._transform = options.transform; + if (typeof options.flush === "function") this._flush = options.flush; + } + this.on("prefinish", prefinish); + } + function prefinish() { + var _this = this; + if (typeof this._flush === "function" && !this._readableState.destroyed) { + this._flush(function(er, data2) { + done(_this, er, data2); + }); + } else { + done(this, null, null); + } + } + Transform.prototype.push = function(chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); + }; + Transform.prototype._transform = function(chunk, encoding, cb) { + cb(new ERR_METHOD_NOT_IMPLEMENTED("_transform()")); + }; + Transform.prototype._write = function(chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } + }; + Transform.prototype._read = function(n2) { + var ts = this._transformState; + if (ts.writechunk !== null && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + ts.needTransform = true; + } + }; + Transform.prototype._destroy = function(err, cb) { + Duplex.prototype._destroy.call(this, err, function(err2) { + cb(err2); + }); + }; + function done(stream5, er, data2) { + if (er) return stream5.emit("error", er); + if (data2 != null) + stream5.push(data2); + if (stream5._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); + if (stream5._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); + return stream5.push(null); + } + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_passthrough.js +var require_stream_passthrough = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_passthrough.js"(exports2, module2) { + "use strict"; + module2.exports = PassThrough; + var Transform = require_stream_transform(); + require_inherits()(PassThrough, Transform); + function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); + Transform.call(this, options); + } + PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); + }; + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/pipeline.js +var require_pipeline = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/pipeline.js"(exports2, module2) { + "use strict"; + var eos; + function once8(callback) { + var called = false; + return function() { + if (called) return; + called = true; + callback.apply(void 0, arguments); + }; + } + var _require$codes = require_errors2().codes; + var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS; + var ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED; + function noop2(err) { + if (err) throw err; + } + function isRequest2(stream5) { + return stream5.setHeader && typeof stream5.abort === "function"; + } + function destroyer(stream5, reading, writing, callback) { + callback = once8(callback); + var closed = false; + stream5.on("close", function() { + closed = true; + }); + if (eos === void 0) eos = require_end_of_stream(); + eos(stream5, { + readable: reading, + writable: writing + }, function(err) { + if (err) return callback(err); + closed = true; + callback(); + }); + var destroyed = false; + return function(err) { + if (closed) return; + if (destroyed) return; + destroyed = true; + if (isRequest2(stream5)) return stream5.abort(); + if (typeof stream5.destroy === "function") return stream5.destroy(); + callback(err || new ERR_STREAM_DESTROYED("pipe")); + }; + } + function call(fn2) { + fn2(); + } + function pipe(from, to) { + return from.pipe(to); + } + function popCallback(streams) { + if (!streams.length) return noop2; + if (typeof streams[streams.length - 1] !== "function") return noop2; + return streams.pop(); + } + function pipeline() { + for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { + streams[_key] = arguments[_key]; + } + var callback = popCallback(streams); + if (Array.isArray(streams[0])) streams = streams[0]; + if (streams.length < 2) { + throw new ERR_MISSING_ARGS("streams"); + } + var error; + var destroys = streams.map(function(stream5, i6) { + var reading = i6 < streams.length - 1; + var writing = i6 > 0; + return destroyer(stream5, reading, writing, function(err) { + if (!error) error = err; + if (err) destroys.forEach(call); + if (reading) return; + destroys.forEach(call); + callback(error); + }); + }); + return streams.reduce(pipe); + } + module2.exports = pipeline; + } +}); + +// ../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/readable.js +var require_readable = __commonJS({ + "../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/readable.js"(exports2, module2) { + var Stream2 = __require("stream"); + if (process.env.READABLE_STREAM === "disable" && Stream2) { + module2.exports = Stream2.Readable; + Object.assign(module2.exports, Stream2); + module2.exports.Stream = Stream2; + } else { + exports2 = module2.exports = require_stream_readable(); + exports2.Stream = Stream2 || exports2; + exports2.Readable = exports2; + exports2.Writable = require_stream_writable(); + exports2.Duplex = require_stream_duplex(); + exports2.Transform = require_stream_transform(); + exports2.PassThrough = require_stream_passthrough(); + exports2.finished = require_end_of_stream(); + exports2.pipeline = require_pipeline(); + } + } +}); + +// ../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/diagnostics.js +var require_diagnostics = __commonJS({ + "../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/diagnostics.js"(exports2, module2) { + var adapters = []; + var modifiers = []; + var logger4 = function devnull() { + }; + function use(adapter2) { + if (~adapters.indexOf(adapter2)) return false; + adapters.push(adapter2); + return true; + } + function set(custom) { + logger4 = custom; + } + function enabled(namespace2) { + var async = []; + for (var i6 = 0; i6 < adapters.length; i6++) { + if (adapters[i6].async) { + async.push(adapters[i6]); + continue; + } + if (adapters[i6](namespace2)) return true; + } + if (!async.length) return false; + return new Promise(function pinky(resolve25) { + Promise.all( + async.map(function prebind(fn2) { + return fn2(namespace2); + }) + ).then(function resolved(values) { + resolve25(values.some(Boolean)); + }); + }); + } + function modify(fn2) { + if (~modifiers.indexOf(fn2)) return false; + modifiers.push(fn2); + return true; + } + function write() { + logger4.apply(logger4, arguments); + } + function process2(message2) { + for (var i6 = 0; i6 < modifiers.length; i6++) { + message2 = modifiers[i6].apply(modifiers[i6], arguments); + } + return message2; + } + function introduce(fn2, options) { + var has2 = Object.prototype.hasOwnProperty; + for (var key in options) { + if (has2.call(options, key)) { + fn2[key] = options[key]; + } + } + return fn2; + } + function nope(options) { + options.enabled = false; + options.modify = modify; + options.set = set; + options.use = use; + return introduce(function diagnopes() { + return false; + }, options); + } + function yep(options) { + function diagnostics() { + var args2 = Array.prototype.slice.call(arguments, 0); + write.call(write, options, process2(args2, options)); + return true; + } + options.enabled = true; + options.modify = modify; + options.set = set; + options.use = use; + return introduce(diagnostics, options); + } + module2.exports = function create2(diagnostics) { + diagnostics.introduce = introduce; + diagnostics.enabled = enabled; + diagnostics.process = process2; + diagnostics.modify = modify; + diagnostics.write = write; + diagnostics.nope = nope; + diagnostics.yep = yep; + diagnostics.set = set; + diagnostics.use = use; + return diagnostics; + }; + } +}); + +// ../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/node/production.js +var require_production = __commonJS({ + "../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/node/production.js"(exports2, module2) { + var create2 = require_diagnostics(); + var diagnostics = create2(function prod(namespace2, options) { + options = options || {}; + options.namespace = namespace2; + options.prod = true; + options.dev = false; + if (!(options.force || prod.force)) return prod.nope(options); + return prod.yep(options); + }); + module2.exports = diagnostics; + } +}); + +// ../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js +var require_color_name = __commonJS({ + "../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(exports2, module2) { + "use strict"; + module2.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] + }; + } +}); + +// ../../node_modules/.pnpm/is-arrayish@0.3.2/node_modules/is-arrayish/index.js +var require_is_arrayish = __commonJS({ + "../../node_modules/.pnpm/is-arrayish@0.3.2/node_modules/is-arrayish/index.js"(exports2, module2) { + module2.exports = function isArrayish(obj) { + if (!obj || typeof obj === "string") { + return false; + } + return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== "String"); + }; + } +}); + +// ../../node_modules/.pnpm/simple-swizzle@0.2.2/node_modules/simple-swizzle/index.js +var require_simple_swizzle = __commonJS({ + "../../node_modules/.pnpm/simple-swizzle@0.2.2/node_modules/simple-swizzle/index.js"(exports2, module2) { + "use strict"; + var isArrayish = require_is_arrayish(); + var concat = Array.prototype.concat; + var slice2 = Array.prototype.slice; + var swizzle = module2.exports = function swizzle2(args2) { + var results = []; + for (var i6 = 0, len = args2.length; i6 < len; i6++) { + var arg = args2[i6]; + if (isArrayish(arg)) { + results = concat.call(results, slice2.call(arg)); + } else { + results.push(arg); + } + } + return results; + }; + swizzle.wrap = function(fn2) { + return function() { + return fn2(swizzle(arguments)); + }; + }; + } +}); + +// ../../node_modules/.pnpm/color-string@1.9.1/node_modules/color-string/index.js +var require_color_string = __commonJS({ + "../../node_modules/.pnpm/color-string@1.9.1/node_modules/color-string/index.js"(exports2, module2) { + var colorNames = require_color_name(); + var swizzle = require_simple_swizzle(); + var hasOwnProperty2 = Object.hasOwnProperty; + var reverseNames = /* @__PURE__ */ Object.create(null); + for (name in colorNames) { + if (hasOwnProperty2.call(colorNames, name)) { + reverseNames[colorNames[name]] = name; + } + } + var name; + var cs = module2.exports = { + to: {}, + get: {} + }; + cs.get = function(string) { + var prefix = string.substring(0, 3).toLowerCase(); + var val2; + var model; + switch (prefix) { + case "hsl": + val2 = cs.get.hsl(string); + model = "hsl"; + break; + case "hwb": + val2 = cs.get.hwb(string); + model = "hwb"; + break; + default: + val2 = cs.get.rgb(string); + model = "rgb"; + break; + } + if (!val2) { + return null; + } + return { model, value: val2 }; + }; + cs.get.rgb = function(string) { + if (!string) { + return null; + } + var abbr = /^#([a-f0-9]{3,4})$/i; + var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i; + var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/; + var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/; + var keyword = /^(\w+)$/; + var rgb = [0, 0, 0, 1]; + var match2; + var i6; + var hexAlpha; + if (match2 = string.match(hex)) { + hexAlpha = match2[2]; + match2 = match2[1]; + for (i6 = 0; i6 < 3; i6++) { + var i22 = i6 * 2; + rgb[i6] = parseInt(match2.slice(i22, i22 + 2), 16); + } + if (hexAlpha) { + rgb[3] = parseInt(hexAlpha, 16) / 255; + } + } else if (match2 = string.match(abbr)) { + match2 = match2[1]; + hexAlpha = match2[3]; + for (i6 = 0; i6 < 3; i6++) { + rgb[i6] = parseInt(match2[i6] + match2[i6], 16); + } + if (hexAlpha) { + rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255; + } + } else if (match2 = string.match(rgba)) { + for (i6 = 0; i6 < 3; i6++) { + rgb[i6] = parseInt(match2[i6 + 1], 0); + } + if (match2[4]) { + if (match2[5]) { + rgb[3] = parseFloat(match2[4]) * 0.01; + } else { + rgb[3] = parseFloat(match2[4]); + } + } + } else if (match2 = string.match(per)) { + for (i6 = 0; i6 < 3; i6++) { + rgb[i6] = Math.round(parseFloat(match2[i6 + 1]) * 2.55); + } + if (match2[4]) { + if (match2[5]) { + rgb[3] = parseFloat(match2[4]) * 0.01; + } else { + rgb[3] = parseFloat(match2[4]); + } + } + } else if (match2 = string.match(keyword)) { + if (match2[1] === "transparent") { + return [0, 0, 0, 0]; + } + if (!hasOwnProperty2.call(colorNames, match2[1])) { + return null; + } + rgb = colorNames[match2[1]]; + rgb[3] = 1; + return rgb; + } else { + return null; + } + for (i6 = 0; i6 < 3; i6++) { + rgb[i6] = clamp(rgb[i6], 0, 255); + } + rgb[3] = clamp(rgb[3], 0, 1); + return rgb; + }; + cs.get.hsl = function(string) { + if (!string) { + return null; + } + var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/; + var match2 = string.match(hsl); + if (match2) { + var alpha = parseFloat(match2[4]); + var h = (parseFloat(match2[1]) % 360 + 360) % 360; + var s4 = clamp(parseFloat(match2[2]), 0, 100); + var l5 = clamp(parseFloat(match2[3]), 0, 100); + var a2 = clamp(isNaN(alpha) ? 1 : alpha, 0, 1); + return [h, s4, l5, a2]; + } + return null; + }; + cs.get.hwb = function(string) { + if (!string) { + return null; + } + var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/; + var match2 = string.match(hwb); + if (match2) { + var alpha = parseFloat(match2[4]); + var h = (parseFloat(match2[1]) % 360 + 360) % 360; + var w = clamp(parseFloat(match2[2]), 0, 100); + var b = clamp(parseFloat(match2[3]), 0, 100); + var a2 = clamp(isNaN(alpha) ? 1 : alpha, 0, 1); + return [h, w, b, a2]; + } + return null; + }; + cs.to.hex = function() { + var rgba = swizzle(arguments); + return "#" + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : ""); + }; + cs.to.rgb = function() { + var rgba = swizzle(arguments); + return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ")" : "rgba(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ", " + rgba[3] + ")"; + }; + cs.to.rgb.percent = function() { + var rgba = swizzle(arguments); + var r2 = Math.round(rgba[0] / 255 * 100); + var g = Math.round(rgba[1] / 255 * 100); + var b = Math.round(rgba[2] / 255 * 100); + return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r2 + "%, " + g + "%, " + b + "%)" : "rgba(" + r2 + "%, " + g + "%, " + b + "%, " + rgba[3] + ")"; + }; + cs.to.hsl = function() { + var hsla = swizzle(arguments); + return hsla.length < 4 || hsla[3] === 1 ? "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)" : "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")"; + }; + cs.to.hwb = function() { + var hwba = swizzle(arguments); + var a2 = ""; + if (hwba.length >= 4 && hwba[3] !== 1) { + a2 = ", " + hwba[3]; + } + return "hwb(" + hwba[0] + ", " + hwba[1] + "%, " + hwba[2] + "%" + a2 + ")"; + }; + cs.to.keyword = function(rgb) { + return reverseNames[rgb.slice(0, 3)]; + }; + function clamp(num, min, max) { + return Math.min(Math.max(min, num), max); + } + function hexDouble(num) { + var str = Math.round(num).toString(16).toUpperCase(); + return str.length < 2 ? "0" + str : str; + } + } +}); + +// ../../node_modules/.pnpm/color-name@1.1.3/node_modules/color-name/index.js +var require_color_name2 = __commonJS({ + "../../node_modules/.pnpm/color-name@1.1.3/node_modules/color-name/index.js"(exports2, module2) { + "use strict"; + module2.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] + }; + } +}); + +// ../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/conversions.js +var require_conversions = __commonJS({ + "../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/conversions.js"(exports2, module2) { + var cssKeywords = require_color_name2(); + var reverseKeywords = {}; + for (key in cssKeywords) { + if (cssKeywords.hasOwnProperty(key)) { + reverseKeywords[cssKeywords[key]] = key; + } + } + var key; + var convert = module2.exports = { + rgb: { channels: 3, labels: "rgb" }, + hsl: { channels: 3, labels: "hsl" }, + hsv: { channels: 3, labels: "hsv" }, + hwb: { channels: 3, labels: "hwb" }, + cmyk: { channels: 4, labels: "cmyk" }, + xyz: { channels: 3, labels: "xyz" }, + lab: { channels: 3, labels: "lab" }, + lch: { channels: 3, labels: "lch" }, + hex: { channels: 1, labels: ["hex"] }, + keyword: { channels: 1, labels: ["keyword"] }, + ansi16: { channels: 1, labels: ["ansi16"] }, + ansi256: { channels: 1, labels: ["ansi256"] }, + hcg: { channels: 3, labels: ["h", "c", "g"] }, + apple: { channels: 3, labels: ["r16", "g16", "b16"] }, + gray: { channels: 1, labels: ["gray"] } + }; + for (model in convert) { + if (convert.hasOwnProperty(model)) { + if (!("channels" in convert[model])) { + throw new Error("missing channels property: " + model); + } + if (!("labels" in convert[model])) { + throw new Error("missing channel labels property: " + model); + } + if (convert[model].labels.length !== convert[model].channels) { + throw new Error("channel and label counts mismatch: " + model); + } + channels = convert[model].channels; + labels = convert[model].labels; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], "channels", { value: channels }); + Object.defineProperty(convert[model], "labels", { value: labels }); + } + } + var channels; + var labels; + var model; + convert.rgb.hsl = function(rgb) { + var r2 = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var min = Math.min(r2, g, b); + var max = Math.max(r2, g, b); + var delta = max - min; + var h; + var s4; + var l5; + if (max === min) { + h = 0; + } else if (r2 === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r2) / delta; + } else if (b === max) { + h = 4 + (r2 - g) / delta; + } + h = Math.min(h * 60, 360); + if (h < 0) { + h += 360; + } + l5 = (min + max) / 2; + if (max === min) { + s4 = 0; + } else if (l5 <= 0.5) { + s4 = delta / (max + min); + } else { + s4 = delta / (2 - max - min); + } + return [h, s4 * 100, l5 * 100]; + }; + convert.rgb.hsv = function(rgb) { + var rdif; + var gdif; + var bdif; + var h; + var s4; + var r2 = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var v = Math.max(r2, g, b); + var diff = v - Math.min(r2, g, b); + var diffc = function(c2) { + return (v - c2) / 6 / diff + 1 / 2; + }; + if (diff === 0) { + h = s4 = 0; + } else { + s4 = diff / v; + rdif = diffc(r2); + gdif = diffc(g); + bdif = diffc(b); + if (r2 === v) { + h = bdif - gdif; + } else if (g === v) { + h = 1 / 3 + rdif - bdif; + } else if (b === v) { + h = 2 / 3 + gdif - rdif; + } + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } + return [ + h * 360, + s4 * 100, + v * 100 + ]; + }; + convert.rgb.hwb = function(rgb) { + var r2 = rgb[0]; + var g = rgb[1]; + var b = rgb[2]; + var h = convert.rgb.hsl(rgb)[0]; + var w = 1 / 255 * Math.min(r2, Math.min(g, b)); + b = 1 - 1 / 255 * Math.max(r2, Math.max(g, b)); + return [h, w * 100, b * 100]; + }; + convert.rgb.cmyk = function(rgb) { + var r2 = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var c2; + var m2; + var y6; + var k; + k = Math.min(1 - r2, 1 - g, 1 - b); + c2 = (1 - r2 - k) / (1 - k) || 0; + m2 = (1 - g - k) / (1 - k) || 0; + y6 = (1 - b - k) / (1 - k) || 0; + return [c2 * 100, m2 * 100, y6 * 100, k * 100]; + }; + function comparativeDistance(x3, y6) { + return Math.pow(x3[0] - y6[0], 2) + Math.pow(x3[1] - y6[1], 2) + Math.pow(x3[2] - y6[2], 2); + } + convert.rgb.keyword = function(rgb) { + var reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } + var currentClosestDistance = Infinity; + var currentClosestKeyword; + for (var keyword in cssKeywords) { + if (cssKeywords.hasOwnProperty(keyword)) { + var value = cssKeywords[keyword]; + var distance = comparativeDistance(rgb, value); + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } + } + return currentClosestKeyword; + }; + convert.keyword.rgb = function(keyword) { + return cssKeywords[keyword]; + }; + convert.rgb.xyz = function(rgb) { + var r2 = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + r2 = r2 > 0.04045 ? Math.pow((r2 + 0.055) / 1.055, 2.4) : r2 / 12.92; + g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92; + b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92; + var x3 = r2 * 0.4124 + g * 0.3576 + b * 0.1805; + var y6 = r2 * 0.2126 + g * 0.7152 + b * 0.0722; + var z = r2 * 0.0193 + g * 0.1192 + b * 0.9505; + return [x3 * 100, y6 * 100, z * 100]; + }; + convert.rgb.lab = function(rgb) { + var xyz = convert.rgb.xyz(rgb); + var x3 = xyz[0]; + var y6 = xyz[1]; + var z = xyz[2]; + var l5; + var a2; + var b; + x3 /= 95.047; + y6 /= 100; + z /= 108.883; + x3 = x3 > 8856e-6 ? Math.pow(x3, 1 / 3) : 7.787 * x3 + 16 / 116; + y6 = y6 > 8856e-6 ? Math.pow(y6, 1 / 3) : 7.787 * y6 + 16 / 116; + z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116; + l5 = 116 * y6 - 16; + a2 = 500 * (x3 - y6); + b = 200 * (y6 - z); + return [l5, a2, b]; + }; + convert.hsl.rgb = function(hsl) { + var h = hsl[0] / 360; + var s4 = hsl[1] / 100; + var l5 = hsl[2] / 100; + var t1; + var t22; + var t32; + var rgb; + var val2; + if (s4 === 0) { + val2 = l5 * 255; + return [val2, val2, val2]; + } + if (l5 < 0.5) { + t22 = l5 * (1 + s4); + } else { + t22 = l5 + s4 - l5 * s4; + } + t1 = 2 * l5 - t22; + rgb = [0, 0, 0]; + for (var i6 = 0; i6 < 3; i6++) { + t32 = h + 1 / 3 * -(i6 - 1); + if (t32 < 0) { + t32++; + } + if (t32 > 1) { + t32--; + } + if (6 * t32 < 1) { + val2 = t1 + (t22 - t1) * 6 * t32; + } else if (2 * t32 < 1) { + val2 = t22; + } else if (3 * t32 < 2) { + val2 = t1 + (t22 - t1) * (2 / 3 - t32) * 6; + } else { + val2 = t1; + } + rgb[i6] = val2 * 255; + } + return rgb; + }; + convert.hsl.hsv = function(hsl) { + var h = hsl[0]; + var s4 = hsl[1] / 100; + var l5 = hsl[2] / 100; + var smin = s4; + var lmin = Math.max(l5, 0.01); + var sv; + var v; + l5 *= 2; + s4 *= l5 <= 1 ? l5 : 2 - l5; + smin *= lmin <= 1 ? lmin : 2 - lmin; + v = (l5 + s4) / 2; + sv = l5 === 0 ? 2 * smin / (lmin + smin) : 2 * s4 / (l5 + s4); + return [h, sv * 100, v * 100]; + }; + convert.hsv.rgb = function(hsv) { + var h = hsv[0] / 60; + var s4 = hsv[1] / 100; + var v = hsv[2] / 100; + var hi = Math.floor(h) % 6; + var f6 = h - Math.floor(h); + var p3 = 255 * v * (1 - s4); + var q = 255 * v * (1 - s4 * f6); + var t4 = 255 * v * (1 - s4 * (1 - f6)); + v *= 255; + switch (hi) { + case 0: + return [v, t4, p3]; + case 1: + return [q, v, p3]; + case 2: + return [p3, v, t4]; + case 3: + return [p3, q, v]; + case 4: + return [t4, p3, v]; + case 5: + return [v, p3, q]; + } + }; + convert.hsv.hsl = function(hsv) { + var h = hsv[0]; + var s4 = hsv[1] / 100; + var v = hsv[2] / 100; + var vmin = Math.max(v, 0.01); + var lmin; + var sl; + var l5; + l5 = (2 - s4) * v; + lmin = (2 - s4) * vmin; + sl = s4 * vmin; + sl /= lmin <= 1 ? lmin : 2 - lmin; + sl = sl || 0; + l5 /= 2; + return [h, sl * 100, l5 * 100]; + }; + convert.hwb.rgb = function(hwb) { + var h = hwb[0] / 360; + var wh = hwb[1] / 100; + var bl = hwb[2] / 100; + var ratio = wh + bl; + var i6; + var v; + var f6; + var n2; + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } + i6 = Math.floor(6 * h); + v = 1 - bl; + f6 = 6 * h - i6; + if ((i6 & 1) !== 0) { + f6 = 1 - f6; + } + n2 = wh + f6 * (v - wh); + var r2; + var g; + var b; + switch (i6) { + default: + case 6: + case 0: + r2 = v; + g = n2; + b = wh; + break; + case 1: + r2 = n2; + g = v; + b = wh; + break; + case 2: + r2 = wh; + g = v; + b = n2; + break; + case 3: + r2 = wh; + g = n2; + b = v; + break; + case 4: + r2 = n2; + g = wh; + b = v; + break; + case 5: + r2 = v; + g = wh; + b = n2; + break; + } + return [r2 * 255, g * 255, b * 255]; + }; + convert.cmyk.rgb = function(cmyk) { + var c2 = cmyk[0] / 100; + var m2 = cmyk[1] / 100; + var y6 = cmyk[2] / 100; + var k = cmyk[3] / 100; + var r2; + var g; + var b; + r2 = 1 - Math.min(1, c2 * (1 - k) + k); + g = 1 - Math.min(1, m2 * (1 - k) + k); + b = 1 - Math.min(1, y6 * (1 - k) + k); + return [r2 * 255, g * 255, b * 255]; + }; + convert.xyz.rgb = function(xyz) { + var x3 = xyz[0] / 100; + var y6 = xyz[1] / 100; + var z = xyz[2] / 100; + var r2; + var g; + var b; + r2 = x3 * 3.2406 + y6 * -1.5372 + z * -0.4986; + g = x3 * -0.9689 + y6 * 1.8758 + z * 0.0415; + b = x3 * 0.0557 + y6 * -0.204 + z * 1.057; + r2 = r2 > 31308e-7 ? 1.055 * Math.pow(r2, 1 / 2.4) - 0.055 : r2 * 12.92; + g = g > 31308e-7 ? 1.055 * Math.pow(g, 1 / 2.4) - 0.055 : g * 12.92; + b = b > 31308e-7 ? 1.055 * Math.pow(b, 1 / 2.4) - 0.055 : b * 12.92; + r2 = Math.min(Math.max(0, r2), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); + return [r2 * 255, g * 255, b * 255]; + }; + convert.xyz.lab = function(xyz) { + var x3 = xyz[0]; + var y6 = xyz[1]; + var z = xyz[2]; + var l5; + var a2; + var b; + x3 /= 95.047; + y6 /= 100; + z /= 108.883; + x3 = x3 > 8856e-6 ? Math.pow(x3, 1 / 3) : 7.787 * x3 + 16 / 116; + y6 = y6 > 8856e-6 ? Math.pow(y6, 1 / 3) : 7.787 * y6 + 16 / 116; + z = z > 8856e-6 ? Math.pow(z, 1 / 3) : 7.787 * z + 16 / 116; + l5 = 116 * y6 - 16; + a2 = 500 * (x3 - y6); + b = 200 * (y6 - z); + return [l5, a2, b]; + }; + convert.lab.xyz = function(lab) { + var l5 = lab[0]; + var a2 = lab[1]; + var b = lab[2]; + var x3; + var y6; + var z; + y6 = (l5 + 16) / 116; + x3 = a2 / 500 + y6; + z = y6 - b / 200; + var y22 = Math.pow(y6, 3); + var x22 = Math.pow(x3, 3); + var z2 = Math.pow(z, 3); + y6 = y22 > 8856e-6 ? y22 : (y6 - 16 / 116) / 7.787; + x3 = x22 > 8856e-6 ? x22 : (x3 - 16 / 116) / 7.787; + z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787; + x3 *= 95.047; + y6 *= 100; + z *= 108.883; + return [x3, y6, z]; + }; + convert.lab.lch = function(lab) { + var l5 = lab[0]; + var a2 = lab[1]; + var b = lab[2]; + var hr; + var h; + var c2; + hr = Math.atan2(b, a2); + h = hr * 360 / 2 / Math.PI; + if (h < 0) { + h += 360; + } + c2 = Math.sqrt(a2 * a2 + b * b); + return [l5, c2, h]; + }; + convert.lch.lab = function(lch) { + var l5 = lch[0]; + var c2 = lch[1]; + var h = lch[2]; + var a2; + var b; + var hr; + hr = h / 360 * 2 * Math.PI; + a2 = c2 * Math.cos(hr); + b = c2 * Math.sin(hr); + return [l5, a2, b]; + }; + convert.rgb.ansi16 = function(args2) { + var r2 = args2[0]; + var g = args2[1]; + var b = args2[2]; + var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args2)[2]; + value = Math.round(value / 50); + if (value === 0) { + return 30; + } + var ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r2 / 255)); + if (value === 2) { + ansi += 60; + } + return ansi; + }; + convert.hsv.ansi16 = function(args2) { + return convert.rgb.ansi16(convert.hsv.rgb(args2), args2[2]); + }; + convert.rgb.ansi256 = function(args2) { + var r2 = args2[0]; + var g = args2[1]; + var b = args2[2]; + if (r2 === g && g === b) { + if (r2 < 8) { + return 16; + } + if (r2 > 248) { + return 231; + } + return Math.round((r2 - 8) / 247 * 24) + 232; + } + var ansi = 16 + 36 * Math.round(r2 / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5); + return ansi; + }; + convert.ansi16.rgb = function(args2) { + var color = args2 % 10; + if (color === 0 || color === 7) { + if (args2 > 50) { + color += 3.5; + } + color = color / 10.5 * 255; + return [color, color, color]; + } + var mult = (~~(args2 > 50) + 1) * 0.5; + var r2 = (color & 1) * mult * 255; + var g = (color >> 1 & 1) * mult * 255; + var b = (color >> 2 & 1) * mult * 255; + return [r2, g, b]; + }; + convert.ansi256.rgb = function(args2) { + if (args2 >= 232) { + var c2 = (args2 - 232) * 10 + 8; + return [c2, c2, c2]; + } + args2 -= 16; + var rem; + var r2 = Math.floor(args2 / 36) / 5 * 255; + var g = Math.floor((rem = args2 % 36) / 6) / 5 * 255; + var b = rem % 6 / 5 * 255; + return [r2, g, b]; + }; + convert.rgb.hex = function(args2) { + var integer = ((Math.round(args2[0]) & 255) << 16) + ((Math.round(args2[1]) & 255) << 8) + (Math.round(args2[2]) & 255); + var string = integer.toString(16).toUpperCase(); + return "000000".substring(string.length) + string; + }; + convert.hex.rgb = function(args2) { + var match2 = args2.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match2) { + return [0, 0, 0]; + } + var colorString = match2[0]; + if (match2[0].length === 3) { + colorString = colorString.split("").map(function(char) { + return char + char; + }).join(""); + } + var integer = parseInt(colorString, 16); + var r2 = integer >> 16 & 255; + var g = integer >> 8 & 255; + var b = integer & 255; + return [r2, g, b]; + }; + convert.rgb.hcg = function(rgb) { + var r2 = rgb[0] / 255; + var g = rgb[1] / 255; + var b = rgb[2] / 255; + var max = Math.max(Math.max(r2, g), b); + var min = Math.min(Math.min(r2, g), b); + var chroma = max - min; + var grayscale; + var hue; + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; + } + if (chroma <= 0) { + hue = 0; + } else if (max === r2) { + hue = (g - b) / chroma % 6; + } else if (max === g) { + hue = 2 + (b - r2) / chroma; + } else { + hue = 4 + (r2 - g) / chroma + 4; + } + hue /= 6; + hue %= 1; + return [hue * 360, chroma * 100, grayscale * 100]; + }; + convert.hsl.hcg = function(hsl) { + var s4 = hsl[1] / 100; + var l5 = hsl[2] / 100; + var c2 = 1; + var f6 = 0; + if (l5 < 0.5) { + c2 = 2 * s4 * l5; + } else { + c2 = 2 * s4 * (1 - l5); + } + if (c2 < 1) { + f6 = (l5 - 0.5 * c2) / (1 - c2); + } + return [hsl[0], c2 * 100, f6 * 100]; + }; + convert.hsv.hcg = function(hsv) { + var s4 = hsv[1] / 100; + var v = hsv[2] / 100; + var c2 = s4 * v; + var f6 = 0; + if (c2 < 1) { + f6 = (v - c2) / (1 - c2); + } + return [hsv[0], c2 * 100, f6 * 100]; + }; + convert.hcg.rgb = function(hcg) { + var h = hcg[0] / 360; + var c2 = hcg[1] / 100; + var g = hcg[2] / 100; + if (c2 === 0) { + return [g * 255, g * 255, g * 255]; + } + var pure = [0, 0, 0]; + var hi = h % 1 * 6; + var v = hi % 1; + var w = 1 - v; + var mg = 0; + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; + pure[1] = v; + pure[2] = 0; + break; + case 1: + pure[0] = w; + pure[1] = 1; + pure[2] = 0; + break; + case 2: + pure[0] = 0; + pure[1] = 1; + pure[2] = v; + break; + case 3: + pure[0] = 0; + pure[1] = w; + pure[2] = 1; + break; + case 4: + pure[0] = v; + pure[1] = 0; + pure[2] = 1; + break; + default: + pure[0] = 1; + pure[1] = 0; + pure[2] = w; + } + mg = (1 - c2) * g; + return [ + (c2 * pure[0] + mg) * 255, + (c2 * pure[1] + mg) * 255, + (c2 * pure[2] + mg) * 255 + ]; + }; + convert.hcg.hsv = function(hcg) { + var c2 = hcg[1] / 100; + var g = hcg[2] / 100; + var v = c2 + g * (1 - c2); + var f6 = 0; + if (v > 0) { + f6 = c2 / v; + } + return [hcg[0], f6 * 100, v * 100]; + }; + convert.hcg.hsl = function(hcg) { + var c2 = hcg[1] / 100; + var g = hcg[2] / 100; + var l5 = g * (1 - c2) + 0.5 * c2; + var s4 = 0; + if (l5 > 0 && l5 < 0.5) { + s4 = c2 / (2 * l5); + } else if (l5 >= 0.5 && l5 < 1) { + s4 = c2 / (2 * (1 - l5)); + } + return [hcg[0], s4 * 100, l5 * 100]; + }; + convert.hcg.hwb = function(hcg) { + var c2 = hcg[1] / 100; + var g = hcg[2] / 100; + var v = c2 + g * (1 - c2); + return [hcg[0], (v - c2) * 100, (1 - v) * 100]; + }; + convert.hwb.hcg = function(hwb) { + var w = hwb[1] / 100; + var b = hwb[2] / 100; + var v = 1 - b; + var c2 = v - w; + var g = 0; + if (c2 < 1) { + g = (v - c2) / (1 - c2); + } + return [hwb[0], c2 * 100, g * 100]; + }; + convert.apple.rgb = function(apple) { + return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255]; + }; + convert.rgb.apple = function(rgb) { + return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535]; + }; + convert.gray.rgb = function(args2) { + return [args2[0] / 100 * 255, args2[0] / 100 * 255, args2[0] / 100 * 255]; + }; + convert.gray.hsl = convert.gray.hsv = function(args2) { + return [0, 0, args2[0]]; + }; + convert.gray.hwb = function(gray) { + return [0, 100, gray[0]]; + }; + convert.gray.cmyk = function(gray) { + return [0, 0, 0, gray[0]]; + }; + convert.gray.lab = function(gray) { + return [gray[0], 0, 0]; + }; + convert.gray.hex = function(gray) { + var val2 = Math.round(gray[0] / 100 * 255) & 255; + var integer = (val2 << 16) + (val2 << 8) + val2; + var string = integer.toString(16).toUpperCase(); + return "000000".substring(string.length) + string; + }; + convert.rgb.gray = function(rgb) { + var val2 = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val2 / 255 * 100]; + }; + } +}); + +// ../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/route.js +var require_route = __commonJS({ + "../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/route.js"(exports2, module2) { + var conversions = require_conversions(); + function buildGraph() { + var graph = {}; + var models = Object.keys(conversions); + for (var len = models.length, i6 = 0; i6 < len; i6++) { + graph[models[i6]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } + return graph; + } + function deriveBFS(fromModel) { + var graph = buildGraph(); + var queue = [fromModel]; + graph[fromModel].distance = 0; + while (queue.length) { + var current = queue.pop(); + var adjacents = Object.keys(conversions[current]); + for (var len = adjacents.length, i6 = 0; i6 < len; i6++) { + var adjacent = adjacents[i6]; + var node = graph[adjacent]; + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } + return graph; + } + function link(from, to) { + return function(args2) { + return to(from(args2)); + }; + } + function wrapConversion(toModel, graph) { + var path2 = [graph[toModel].parent, toModel]; + var fn2 = conversions[graph[toModel].parent][toModel]; + var cur = graph[toModel].parent; + while (graph[cur].parent) { + path2.unshift(graph[cur].parent); + fn2 = link(conversions[graph[cur].parent][cur], fn2); + cur = graph[cur].parent; + } + fn2.conversion = path2; + return fn2; + } + module2.exports = function(fromModel) { + var graph = deriveBFS(fromModel); + var conversion = {}; + var models = Object.keys(graph); + for (var len = models.length, i6 = 0; i6 < len; i6++) { + var toModel = models[i6]; + var node = graph[toModel]; + if (node.parent === null) { + continue; + } + conversion[toModel] = wrapConversion(toModel, graph); + } + return conversion; + }; + } +}); + +// ../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/index.js +var require_color_convert = __commonJS({ + "../../node_modules/.pnpm/color-convert@1.9.3/node_modules/color-convert/index.js"(exports2, module2) { + var conversions = require_conversions(); + var route = require_route(); + var convert = {}; + var models = Object.keys(conversions); + function wrapRaw(fn2) { + var wrappedFn = function(args2) { + if (args2 === void 0 || args2 === null) { + return args2; + } + if (arguments.length > 1) { + args2 = Array.prototype.slice.call(arguments); + } + return fn2(args2); + }; + if ("conversion" in fn2) { + wrappedFn.conversion = fn2.conversion; + } + return wrappedFn; + } + function wrapRounded(fn2) { + var wrappedFn = function(args2) { + if (args2 === void 0 || args2 === null) { + return args2; + } + if (arguments.length > 1) { + args2 = Array.prototype.slice.call(arguments); + } + var result = fn2(args2); + if (typeof result === "object") { + for (var len = result.length, i6 = 0; i6 < len; i6++) { + result[i6] = Math.round(result[i6]); + } + } + return result; + }; + if ("conversion" in fn2) { + wrappedFn.conversion = fn2.conversion; + } + return wrappedFn; + } + models.forEach(function(fromModel) { + convert[fromModel] = {}; + Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels }); + Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels }); + var routes = route(fromModel); + var routeModels = Object.keys(routes); + routeModels.forEach(function(toModel) { + var fn2 = routes[toModel]; + convert[fromModel][toModel] = wrapRounded(fn2); + convert[fromModel][toModel].raw = wrapRaw(fn2); + }); + }); + module2.exports = convert; + } +}); + +// ../../node_modules/.pnpm/color@3.2.1/node_modules/color/index.js +var require_color = __commonJS({ + "../../node_modules/.pnpm/color@3.2.1/node_modules/color/index.js"(exports2, module2) { + "use strict"; + var colorString = require_color_string(); + var convert = require_color_convert(); + var _slice = [].slice; + var skippedModels = [ + // to be honest, I don't really feel like keyword belongs in color convert, but eh. + "keyword", + // gray conflicts with some method names, and has its own method defined. + "gray", + // shouldn't really be in color-convert either... + "hex" + ]; + var hashedModelKeys = {}; + Object.keys(convert).forEach(function(model) { + hashedModelKeys[_slice.call(convert[model].labels).sort().join("")] = model; + }); + var limiters = {}; + function Color(obj, model) { + if (!(this instanceof Color)) { + return new Color(obj, model); + } + if (model && model in skippedModels) { + model = null; + } + if (model && !(model in convert)) { + throw new Error("Unknown model: " + model); + } + var i6; + var channels; + if (obj == null) { + this.model = "rgb"; + this.color = [0, 0, 0]; + this.valpha = 1; + } else if (obj instanceof Color) { + this.model = obj.model; + this.color = obj.color.slice(); + this.valpha = obj.valpha; + } else if (typeof obj === "string") { + var result = colorString.get(obj); + if (result === null) { + throw new Error("Unable to parse color from string: " + obj); + } + this.model = result.model; + channels = convert[this.model].channels; + this.color = result.value.slice(0, channels); + this.valpha = typeof result.value[channels] === "number" ? result.value[channels] : 1; + } else if (obj.length) { + this.model = model || "rgb"; + channels = convert[this.model].channels; + var newArr = _slice.call(obj, 0, channels); + this.color = zeroArray(newArr, channels); + this.valpha = typeof obj[channels] === "number" ? obj[channels] : 1; + } else if (typeof obj === "number") { + obj &= 16777215; + this.model = "rgb"; + this.color = [ + obj >> 16 & 255, + obj >> 8 & 255, + obj & 255 + ]; + this.valpha = 1; + } else { + this.valpha = 1; + var keys = Object.keys(obj); + if ("alpha" in obj) { + keys.splice(keys.indexOf("alpha"), 1); + this.valpha = typeof obj.alpha === "number" ? obj.alpha : 0; + } + var hashedKeys = keys.sort().join(""); + if (!(hashedKeys in hashedModelKeys)) { + throw new Error("Unable to parse color from object: " + JSON.stringify(obj)); + } + this.model = hashedModelKeys[hashedKeys]; + var labels = convert[this.model].labels; + var color = []; + for (i6 = 0; i6 < labels.length; i6++) { + color.push(obj[labels[i6]]); + } + this.color = zeroArray(color); + } + if (limiters[this.model]) { + channels = convert[this.model].channels; + for (i6 = 0; i6 < channels; i6++) { + var limit = limiters[this.model][i6]; + if (limit) { + this.color[i6] = limit(this.color[i6]); + } + } + } + this.valpha = Math.max(0, Math.min(1, this.valpha)); + if (Object.freeze) { + Object.freeze(this); + } + } + Color.prototype = { + toString: function() { + return this.string(); + }, + toJSON: function() { + return this[this.model](); + }, + string: function(places) { + var self2 = this.model in colorString.to ? this : this.rgb(); + self2 = self2.round(typeof places === "number" ? places : 1); + var args2 = self2.valpha === 1 ? self2.color : self2.color.concat(this.valpha); + return colorString.to[self2.model](args2); + }, + percentString: function(places) { + var self2 = this.rgb().round(typeof places === "number" ? places : 1); + var args2 = self2.valpha === 1 ? self2.color : self2.color.concat(this.valpha); + return colorString.to.rgb.percent(args2); + }, + array: function() { + return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha); + }, + object: function() { + var result = {}; + var channels = convert[this.model].channels; + var labels = convert[this.model].labels; + for (var i6 = 0; i6 < channels; i6++) { + result[labels[i6]] = this.color[i6]; + } + if (this.valpha !== 1) { + result.alpha = this.valpha; + } + return result; + }, + unitArray: function() { + var rgb = this.rgb().color; + rgb[0] /= 255; + rgb[1] /= 255; + rgb[2] /= 255; + if (this.valpha !== 1) { + rgb.push(this.valpha); + } + return rgb; + }, + unitObject: function() { + var rgb = this.rgb().object(); + rgb.r /= 255; + rgb.g /= 255; + rgb.b /= 255; + if (this.valpha !== 1) { + rgb.alpha = this.valpha; + } + return rgb; + }, + round: function(places) { + places = Math.max(places || 0, 0); + return new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model); + }, + alpha: function(val2) { + if (arguments.length) { + return new Color(this.color.concat(Math.max(0, Math.min(1, val2))), this.model); + } + return this.valpha; + }, + // rgb + red: getset("rgb", 0, maxfn(255)), + green: getset("rgb", 1, maxfn(255)), + blue: getset("rgb", 2, maxfn(255)), + hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, function(val2) { + return (val2 % 360 + 360) % 360; + }), + // eslint-disable-line brace-style + saturationl: getset("hsl", 1, maxfn(100)), + lightness: getset("hsl", 2, maxfn(100)), + saturationv: getset("hsv", 1, maxfn(100)), + value: getset("hsv", 2, maxfn(100)), + chroma: getset("hcg", 1, maxfn(100)), + gray: getset("hcg", 2, maxfn(100)), + white: getset("hwb", 1, maxfn(100)), + wblack: getset("hwb", 2, maxfn(100)), + cyan: getset("cmyk", 0, maxfn(100)), + magenta: getset("cmyk", 1, maxfn(100)), + yellow: getset("cmyk", 2, maxfn(100)), + black: getset("cmyk", 3, maxfn(100)), + x: getset("xyz", 0, maxfn(100)), + y: getset("xyz", 1, maxfn(100)), + z: getset("xyz", 2, maxfn(100)), + l: getset("lab", 0, maxfn(100)), + a: getset("lab", 1), + b: getset("lab", 2), + keyword: function(val2) { + if (arguments.length) { + return new Color(val2); + } + return convert[this.model].keyword(this.color); + }, + hex: function(val2) { + if (arguments.length) { + return new Color(val2); + } + return colorString.to.hex(this.rgb().round().color); + }, + rgbNumber: function() { + var rgb = this.rgb().color; + return (rgb[0] & 255) << 16 | (rgb[1] & 255) << 8 | rgb[2] & 255; + }, + luminosity: function() { + var rgb = this.rgb().color; + var lum = []; + for (var i6 = 0; i6 < rgb.length; i6++) { + var chan = rgb[i6] / 255; + lum[i6] = chan <= 0.03928 ? chan / 12.92 : Math.pow((chan + 0.055) / 1.055, 2.4); + } + return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2]; + }, + contrast: function(color2) { + var lum1 = this.luminosity(); + var lum2 = color2.luminosity(); + if (lum1 > lum2) { + return (lum1 + 0.05) / (lum2 + 0.05); + } + return (lum2 + 0.05) / (lum1 + 0.05); + }, + level: function(color2) { + var contrastRatio = this.contrast(color2); + if (contrastRatio >= 7.1) { + return "AAA"; + } + return contrastRatio >= 4.5 ? "AA" : ""; + }, + isDark: function() { + var rgb = this.rgb().color; + var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1e3; + return yiq < 128; + }, + isLight: function() { + return !this.isDark(); + }, + negate: function() { + var rgb = this.rgb(); + for (var i6 = 0; i6 < 3; i6++) { + rgb.color[i6] = 255 - rgb.color[i6]; + } + return rgb; + }, + lighten: function(ratio) { + var hsl = this.hsl(); + hsl.color[2] += hsl.color[2] * ratio; + return hsl; + }, + darken: function(ratio) { + var hsl = this.hsl(); + hsl.color[2] -= hsl.color[2] * ratio; + return hsl; + }, + saturate: function(ratio) { + var hsl = this.hsl(); + hsl.color[1] += hsl.color[1] * ratio; + return hsl; + }, + desaturate: function(ratio) { + var hsl = this.hsl(); + hsl.color[1] -= hsl.color[1] * ratio; + return hsl; + }, + whiten: function(ratio) { + var hwb = this.hwb(); + hwb.color[1] += hwb.color[1] * ratio; + return hwb; + }, + blacken: function(ratio) { + var hwb = this.hwb(); + hwb.color[2] += hwb.color[2] * ratio; + return hwb; + }, + grayscale: function() { + var rgb = this.rgb().color; + var val2 = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11; + return Color.rgb(val2, val2, val2); + }, + fade: function(ratio) { + return this.alpha(this.valpha - this.valpha * ratio); + }, + opaquer: function(ratio) { + return this.alpha(this.valpha + this.valpha * ratio); + }, + rotate: function(degrees) { + var hsl = this.hsl(); + var hue = hsl.color[0]; + hue = (hue + degrees) % 360; + hue = hue < 0 ? 360 + hue : hue; + hsl.color[0] = hue; + return hsl; + }, + mix: function(mixinColor, weight) { + if (!mixinColor || !mixinColor.rgb) { + throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor); + } + var color1 = mixinColor.rgb(); + var color2 = this.rgb(); + var p3 = weight === void 0 ? 0.5 : weight; + var w = 2 * p3 - 1; + var a2 = color1.alpha() - color2.alpha(); + var w1 = ((w * a2 === -1 ? w : (w + a2) / (1 + w * a2)) + 1) / 2; + var w2 = 1 - w1; + return Color.rgb( + w1 * color1.red() + w2 * color2.red(), + w1 * color1.green() + w2 * color2.green(), + w1 * color1.blue() + w2 * color2.blue(), + color1.alpha() * p3 + color2.alpha() * (1 - p3) + ); + } + }; + Object.keys(convert).forEach(function(model) { + if (skippedModels.indexOf(model) !== -1) { + return; + } + var channels = convert[model].channels; + Color.prototype[model] = function() { + if (this.model === model) { + return new Color(this); + } + if (arguments.length) { + return new Color(arguments, model); + } + var newAlpha = typeof arguments[channels] === "number" ? channels : this.valpha; + return new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model); + }; + Color[model] = function(color) { + if (typeof color === "number") { + color = zeroArray(_slice.call(arguments), channels); + } + return new Color(color, model); + }; + }); + function roundTo(num, places) { + return Number(num.toFixed(places)); + } + function roundToPlace(places) { + return function(num) { + return roundTo(num, places); + }; + } + function getset(model, channel, modifier) { + model = Array.isArray(model) ? model : [model]; + model.forEach(function(m2) { + (limiters[m2] || (limiters[m2] = []))[channel] = modifier; + }); + model = model[0]; + return function(val2) { + var result; + if (arguments.length) { + if (modifier) { + val2 = modifier(val2); + } + result = this[model](); + result.color[channel] = val2; + return result; + } + result = this[model]().color[channel]; + if (modifier) { + result = modifier(result); + } + return result; + }; + } + function maxfn(max) { + return function(v) { + return Math.max(0, Math.min(max, v)); + }; + } + function assertArray(val2) { + return Array.isArray(val2) ? val2 : [val2]; + } + function zeroArray(arr, length) { + for (var i6 = 0; i6 < length; i6++) { + if (typeof arr[i6] !== "number") { + arr[i6] = 0; + } + } + return arr; + } + module2.exports = Color; + } +}); + +// ../../node_modules/.pnpm/text-hex@1.0.0/node_modules/text-hex/index.js +var require_text_hex = __commonJS({ + "../../node_modules/.pnpm/text-hex@1.0.0/node_modules/text-hex/index.js"(exports2, module2) { + "use strict"; + module2.exports = function hex(str) { + for (var i6 = 0, hash = 0; i6 < str.length; hash = str.charCodeAt(i6++) + ((hash << 5) - hash)) ; + var color = Math.floor( + Math.abs( + Math.sin(hash) * 1e4 % 1 * 16777216 + ) + ).toString(16); + return "#" + Array(6 - color.length + 1).join("0") + color; + }; + } +}); + +// ../../node_modules/.pnpm/colorspace@1.1.4/node_modules/colorspace/index.js +var require_colorspace = __commonJS({ + "../../node_modules/.pnpm/colorspace@1.1.4/node_modules/colorspace/index.js"(exports2, module2) { + "use strict"; + var color = require_color(); + var hex = require_text_hex(); + module2.exports = function colorspace(namespace2, delimiter) { + var split = namespace2.split(delimiter || ":"); + var base = hex(split[0]); + if (!split.length) return base; + for (var i6 = 0, l5 = split.length - 1; i6 < l5; i6++) { + base = color(base).mix(color(hex(split[i6 + 1]))).saturate(1).hex(); + } + return base; + }; + } +}); + +// ../../node_modules/.pnpm/kuler@2.0.0/node_modules/kuler/index.js +var require_kuler = __commonJS({ + "../../node_modules/.pnpm/kuler@2.0.0/node_modules/kuler/index.js"(exports2, module2) { + "use strict"; + function Kuler(text3, color) { + if (color) return new Kuler(text3).style(color); + if (!(this instanceof Kuler)) return new Kuler(text3); + this.text = text3; + } + Kuler.prototype.prefix = "\x1B["; + Kuler.prototype.suffix = "m"; + Kuler.prototype.hex = function hex(color) { + color = color[0] === "#" ? color.substring(1) : color; + if (color.length === 3) { + color = color.split(""); + color[5] = color[2]; + color[4] = color[2]; + color[3] = color[1]; + color[2] = color[1]; + color[1] = color[0]; + color = color.join(""); + } + var r2 = color.substring(0, 2), g = color.substring(2, 4), b = color.substring(4, 6); + return [parseInt(r2, 16), parseInt(g, 16), parseInt(b, 16)]; + }; + Kuler.prototype.rgb = function rgb(r2, g, b) { + var red = r2 / 255 * 5, green = g / 255 * 5, blue = b / 255 * 5; + return this.ansi(red, green, blue); + }; + Kuler.prototype.ansi = function ansi(r2, g, b) { + var red = Math.round(r2), green = Math.round(g), blue = Math.round(b); + return 16 + red * 36 + green * 6 + blue; + }; + Kuler.prototype.reset = function reset() { + return this.prefix + "39;49" + this.suffix; + }; + Kuler.prototype.style = function style(color) { + return this.prefix + "38;5;" + this.rgb.apply(this, this.hex(color)) + this.suffix + this.text + this.reset(); + }; + module2.exports = Kuler; + } +}); + +// ../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js +var require_namespace_ansi = __commonJS({ + "../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js"(exports2, module2) { + var colorspace = require_colorspace(); + var kuler = require_kuler(); + module2.exports = function ansiModifier(args2, options) { + var namespace2 = options.namespace; + var ansi = options.colors !== false ? kuler(namespace2 + ":", colorspace(namespace2)) : namespace2 + ":"; + args2[0] = ansi + " " + args2[0]; + return args2; + }; + } +}); + +// ../../node_modules/.pnpm/enabled@2.0.0/node_modules/enabled/index.js +var require_enabled = __commonJS({ + "../../node_modules/.pnpm/enabled@2.0.0/node_modules/enabled/index.js"(exports2, module2) { + "use strict"; + module2.exports = function enabled(name, variable) { + if (!variable) return false; + var variables = variable.split(/[\s,]+/), i6 = 0; + for (; i6 < variables.length; i6++) { + variable = variables[i6].replace("*", ".*?"); + if ("-" === variable.charAt(0)) { + if (new RegExp("^" + variable.substr(1) + "$").test(name)) { + return false; + } + continue; + } + if (new RegExp("^" + variable + "$").test(name)) { + return true; + } + } + return false; + }; + } +}); + +// ../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/adapters/index.js +var require_adapters = __commonJS({ + "../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/adapters/index.js"(exports2, module2) { + var enabled = require_enabled(); + module2.exports = function create2(fn2) { + return function adapter2(namespace2) { + try { + return enabled(namespace2, fn2()); + } catch (e) { + } + return false; + }; + }; + } +}); + +// ../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/adapters/process.env.js +var require_process_env = __commonJS({ + "../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/adapters/process.env.js"(exports2, module2) { + var adapter2 = require_adapters(); + module2.exports = adapter2(function processenv() { + return process.env.DEBUG || process.env.DIAGNOSTICS; + }); + } +}); + +// ../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/logger/console.js +var require_console2 = __commonJS({ + "../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/logger/console.js"(exports2, module2) { + module2.exports = function(meta, messages) { + try { + Function.prototype.apply.call(console.log, console, messages); + } catch (e) { + } + }; + } +}); + +// ../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/node/development.js +var require_development = __commonJS({ + "../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/node/development.js"(exports2, module2) { + var create2 = require_diagnostics(); + var tty = __require("tty").isatty(1); + var diagnostics = create2(function dev(namespace2, options) { + options = options || {}; + options.colors = "colors" in options ? options.colors : tty; + options.namespace = namespace2; + options.prod = false; + options.dev = true; + if (!dev.enabled(namespace2) && !(options.force || dev.force)) { + return dev.nope(options); + } + return dev.yep(options); + }); + diagnostics.modify(require_namespace_ansi()); + diagnostics.use(require_process_env()); + diagnostics.set(require_console2()); + module2.exports = diagnostics; + } +}); + +// ../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/node/index.js +var require_node2 = __commonJS({ + "../../node_modules/.pnpm/@dabh+diagnostics@2.0.3/node_modules/@dabh/diagnostics/node/index.js"(exports2, module2) { + if (process.env.NODE_ENV === "production") { + module2.exports = require_production(); + } else { + module2.exports = require_development(); + } + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/tail-file.js +var require_tail_file = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/tail-file.js"(exports2, module2) { + "use strict"; + var fs = __require("fs"); + var { StringDecoder: StringDecoder2 } = __require("string_decoder"); + var { Stream: Stream2 } = require_readable(); + function noop2() { + } + module2.exports = (options, iter) => { + const buffer = Buffer.alloc(64 * 1024); + const decode = new StringDecoder2("utf8"); + const stream5 = new Stream2(); + let buff = ""; + let pos = 0; + let row = 0; + if (options.start === -1) { + delete options.start; + } + stream5.readable = true; + stream5.destroy = () => { + stream5.destroyed = true; + stream5.emit("end"); + stream5.emit("close"); + }; + fs.open(options.file, "a+", "0644", (err, fd) => { + if (err) { + if (!iter) { + stream5.emit("error", err); + } else { + iter(err); + } + stream5.destroy(); + return; + } + (function read() { + if (stream5.destroyed) { + fs.close(fd, noop2); + return; + } + return fs.read(fd, buffer, 0, buffer.length, pos, (error, bytes) => { + if (error) { + if (!iter) { + stream5.emit("error", error); + } else { + iter(error); + } + stream5.destroy(); + return; + } + if (!bytes) { + if (buff) { + if (options.start == null || row > options.start) { + if (!iter) { + stream5.emit("line", buff); + } else { + iter(null, buff); + } + } + row++; + buff = ""; + } + return setTimeout(read, 1e3); + } + let data2 = decode.write(buffer.slice(0, bytes)); + if (!iter) { + stream5.emit("data", data2); + } + data2 = (buff + data2).split(/\n+/); + const l5 = data2.length - 1; + let i6 = 0; + for (; i6 < l5; i6++) { + if (options.start == null || row > options.start) { + if (!iter) { + stream5.emit("line", data2[i6]); + } else { + iter(null, data2[i6]); + } + } + row++; + } + buff = data2[l5]; + pos += bytes; + return read(); + }); + })(); + }); + if (!iter) { + return stream5; + } + return stream5.destroy; + }; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/file.js +var require_file = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/file.js"(exports2, module2) { + "use strict"; + var fs = __require("fs"); + var path2 = __require("path"); + var asyncSeries = require_series(); + var zlib2 = __require("zlib"); + var { MESSAGE } = require_triple_beam(); + var { Stream: Stream2, PassThrough } = require_readable(); + var TransportStream = require_winston_transport(); + var debug = require_node2()("winston:file"); + var os2 = __require("os"); + var tailFile = require_tail_file(); + module2.exports = class File extends TransportStream { + /** + * Constructor function for the File transport object responsible for + * persisting log messages and metadata to one or more files. + * @param {Object} options - Options for this instance. + */ + constructor(options = {}) { + super(options); + this.name = options.name || "file"; + function throwIf(target, ...args2) { + args2.slice(1).forEach((name) => { + if (options[name]) { + throw new Error(`Cannot set ${name} and ${target} together`); + } + }); + } + this._stream = new PassThrough(); + this._stream.setMaxListeners(30); + this._onError = this._onError.bind(this); + if (options.filename || options.dirname) { + throwIf("filename or dirname", "stream"); + this._basename = this.filename = options.filename ? path2.basename(options.filename) : "winston.log"; + this.dirname = options.dirname || path2.dirname(options.filename); + this.options = options.options || { flags: "a" }; + } else if (options.stream) { + console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"); + throwIf("stream", "filename", "maxsize"); + this._dest = this._stream.pipe(this._setupStream(options.stream)); + this.dirname = path2.dirname(this._dest.path); + } else { + throw new Error("Cannot log to file without filename or stream."); + } + this.maxsize = options.maxsize || null; + this.rotationFormat = options.rotationFormat || false; + this.zippedArchive = options.zippedArchive || false; + this.maxFiles = options.maxFiles || null; + this.eol = typeof options.eol === "string" ? options.eol : os2.EOL; + this.tailable = options.tailable || false; + this.lazy = options.lazy || false; + this._size = 0; + this._pendingSize = 0; + this._created = 0; + this._drain = false; + this._opening = false; + this._ending = false; + this._fileExist = false; + if (this.dirname) this._createLogDirIfNotExist(this.dirname); + if (!this.lazy) this.open(); + } + finishIfEnding() { + if (this._ending) { + if (this._opening) { + this.once("open", () => { + this._stream.once("finish", () => this.emit("finish")); + setImmediate(() => this._stream.end()); + }); + } else { + this._stream.once("finish", () => this.emit("finish")); + setImmediate(() => this._stream.end()); + } + } + } + /** + * Core logging method exposed to Winston. Metadata is optional. + * @param {Object} info - TODO: add param description. + * @param {Function} callback - TODO: add param description. + * @returns {undefined} + */ + log(info, callback = () => { + }) { + if (this.silent) { + callback(); + return true; + } + if (this._drain) { + this._stream.once("drain", () => { + this._drain = false; + this.log(info, callback); + }); + return; + } + if (this._rotate) { + this._stream.once("rotate", () => { + this._rotate = false; + this.log(info, callback); + }); + return; + } + if (this.lazy) { + if (!this._fileExist) { + if (!this._opening) { + this.open(); + } + this.once("open", () => { + this._fileExist = true; + this.log(info, callback); + return; + }); + return; + } + if (this._needsNewFile(this._pendingSize)) { + this._dest.once("close", () => { + if (!this._opening) { + this.open(); + } + this.once("open", () => { + this.log(info, callback); + return; + }); + return; + }); + return; + } + } + const output = `${info[MESSAGE]}${this.eol}`; + const bytes = Buffer.byteLength(output); + function logged() { + this._size += bytes; + this._pendingSize -= bytes; + debug("logged %s %s", this._size, output); + this.emit("logged", info); + if (this._rotate) { + return; + } + if (this._opening) { + return; + } + if (!this._needsNewFile()) { + return; + } + if (this.lazy) { + this._endStream(() => { + this.emit("fileclosed"); + }); + return; + } + this._rotate = true; + this._endStream(() => this._rotateFile()); + } + this._pendingSize += bytes; + if (this._opening && !this.rotatedWhileOpening && this._needsNewFile(this._size + this._pendingSize)) { + this.rotatedWhileOpening = true; + } + const written = this._stream.write(output, logged.bind(this)); + if (!written) { + this._drain = true; + this._stream.once("drain", () => { + this._drain = false; + callback(); + }); + } else { + callback(); + } + debug("written", written, this._drain); + this.finishIfEnding(); + return written; + } + /** + * Query the transport. Options object is optional. + * @param {Object} options - Loggly-like query options for this instance. + * @param {function} callback - Continuation to respond to when complete. + * TODO: Refactor me. + */ + query(options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } + options = normalizeQuery(options); + const file = path2.join(this.dirname, this.filename); + let buff = ""; + let results = []; + let row = 0; + const stream5 = fs.createReadStream(file, { + encoding: "utf8" + }); + stream5.on("error", (err) => { + if (stream5.readable) { + stream5.destroy(); + } + if (!callback) { + return; + } + return err.code !== "ENOENT" ? callback(err) : callback(null, results); + }); + stream5.on("data", (data2) => { + data2 = (buff + data2).split(/\n+/); + const l5 = data2.length - 1; + let i6 = 0; + for (; i6 < l5; i6++) { + if (!options.start || row >= options.start) { + add2(data2[i6]); + } + row++; + } + buff = data2[l5]; + }); + stream5.on("close", () => { + if (buff) { + add2(buff, true); + } + if (options.order === "desc") { + results = results.reverse(); + } + if (callback) callback(null, results); + }); + function add2(buff2, attempt) { + try { + const log2 = JSON.parse(buff2); + if (check(log2)) { + push(log2); + } + } catch (e) { + if (!attempt) { + stream5.emit("error", e); + } + } + } + function push(log2) { + if (options.rows && results.length >= options.rows && options.order !== "desc") { + if (stream5.readable) { + stream5.destroy(); + } + return; + } + if (options.fields) { + log2 = options.fields.reduce((obj, key) => { + obj[key] = log2[key]; + return obj; + }, {}); + } + if (options.order === "desc") { + if (results.length >= options.rows) { + results.shift(); + } + } + results.push(log2); + } + function check(log2) { + if (!log2) { + return; + } + if (typeof log2 !== "object") { + return; + } + const time = new Date(log2.timestamp); + if (options.from && time < options.from || options.until && time > options.until || options.level && options.level !== log2.level) { + return; + } + return true; + } + function normalizeQuery(options2) { + options2 = options2 || {}; + options2.rows = options2.rows || options2.limit || 10; + options2.start = options2.start || 0; + options2.until = options2.until || /* @__PURE__ */ new Date(); + if (typeof options2.until !== "object") { + options2.until = new Date(options2.until); + } + options2.from = options2.from || options2.until - 24 * 60 * 60 * 1e3; + if (typeof options2.from !== "object") { + options2.from = new Date(options2.from); + } + options2.order = options2.order || "desc"; + return options2; + } + } + /** + * Returns a log stream for this transport. Options object is optional. + * @param {Object} options - Stream options for this instance. + * @returns {Stream} - TODO: add return description. + * TODO: Refactor me. + */ + stream(options = {}) { + const file = path2.join(this.dirname, this.filename); + const stream5 = new Stream2(); + const tail = { + file, + start: options.start + }; + stream5.destroy = tailFile(tail, (err, line) => { + if (err) { + return stream5.emit("error", err); + } + try { + stream5.emit("data", line); + line = JSON.parse(line); + stream5.emit("log", line); + } catch (e) { + stream5.emit("error", e); + } + }); + return stream5; + } + /** + * Checks to see the filesize of. + * @returns {undefined} + */ + open() { + if (!this.filename) return; + if (this._opening) return; + this._opening = true; + this.stat((err, size) => { + if (err) { + return this.emit("error", err); + } + debug("stat done: %s { size: %s }", this.filename, size); + this._size = size; + this._dest = this._createStream(this._stream); + this._opening = false; + this.once("open", () => { + if (!this._stream.emit("rotate")) { + this._rotate = false; + } + }); + }); + } + /** + * Stat the file and assess information in order to create the proper stream. + * @param {function} callback - TODO: add param description. + * @returns {undefined} + */ + stat(callback) { + const target = this._getFile(); + const fullpath = path2.join(this.dirname, target); + fs.stat(fullpath, (err, stat5) => { + if (err && err.code === "ENOENT") { + debug("ENOENT\xA0ok", fullpath); + this.filename = target; + return callback(null, 0); + } + if (err) { + debug(`err ${err.code} ${fullpath}`); + return callback(err); + } + if (!stat5 || this._needsNewFile(stat5.size)) { + return this._incFile(() => this.stat(callback)); + } + this.filename = target; + callback(null, stat5.size); + }); + } + /** + * Closes the stream associated with this instance. + * @param {function} cb - TODO: add param description. + * @returns {undefined} + */ + close(cb) { + if (!this._stream) { + return; + } + this._stream.end(() => { + if (cb) { + cb(); + } + this.emit("flush"); + this.emit("closed"); + }); + } + /** + * TODO: add method description. + * @param {number} size - TODO: add param description. + * @returns {undefined} + */ + _needsNewFile(size) { + size = size || this._size; + return this.maxsize && size >= this.maxsize; + } + /** + * TODO: add method description. + * @param {Error} err - TODO: add param description. + * @returns {undefined} + */ + _onError(err) { + this.emit("error", err); + } + /** + * TODO: add method description. + * @param {Stream} stream - TODO: add param description. + * @returns {mixed} - TODO: add return description. + */ + _setupStream(stream5) { + stream5.on("error", this._onError); + return stream5; + } + /** + * TODO: add method description. + * @param {Stream} stream - TODO: add param description. + * @returns {mixed} - TODO: add return description. + */ + _cleanupStream(stream5) { + stream5.removeListener("error", this._onError); + stream5.destroy(); + return stream5; + } + /** + * TODO: add method description. + */ + _rotateFile() { + this._incFile(() => this.open()); + } + /** + * Unpipe from the stream that has been marked as full and end it so it + * flushes to disk. + * + * @param {function} callback - Callback for when the current file has closed. + * @private + */ + _endStream(callback = () => { + }) { + if (this._dest) { + this._stream.unpipe(this._dest); + this._dest.end(() => { + this._cleanupStream(this._dest); + callback(); + }); + } else { + callback(); + } + } + /** + * Returns the WritableStream for the active file on this instance. If we + * should gzip the file then a zlib stream is returned. + * + * @param {ReadableStream} source –PassThrough to pipe to the file when open. + * @returns {WritableStream} Stream that writes to disk for the active file. + */ + _createStream(source) { + const fullpath = path2.join(this.dirname, this.filename); + debug("create stream start", fullpath, this.options); + const dest = fs.createWriteStream(fullpath, this.options).on("error", (err) => debug(err)).on("close", () => debug("close", dest.path, dest.bytesWritten)).on("open", () => { + debug("file open ok", fullpath); + this.emit("open", fullpath); + source.pipe(dest); + if (this.rotatedWhileOpening) { + this._stream = new PassThrough(); + this._stream.setMaxListeners(30); + this._rotateFile(); + this.rotatedWhileOpening = false; + this._cleanupStream(dest); + source.end(); + } + }); + debug("create stream ok", fullpath); + return dest; + } + /** + * TODO: add method description. + * @param {function} callback - TODO: add param description. + * @returns {undefined} + */ + _incFile(callback) { + debug("_incFile", this.filename); + const ext2 = path2.extname(this._basename); + const basename6 = path2.basename(this._basename, ext2); + const tasks = []; + if (this.zippedArchive) { + tasks.push( + function(cb) { + const num = this._created > 0 && !this.tailable ? this._created : ""; + this._compressFile( + path2.join(this.dirname, `${basename6}${num}${ext2}`), + path2.join(this.dirname, `${basename6}${num}${ext2}.gz`), + cb + ); + }.bind(this) + ); + } + tasks.push( + function(cb) { + if (!this.tailable) { + this._created += 1; + this._checkMaxFilesIncrementing(ext2, basename6, cb); + } else { + this._checkMaxFilesTailable(ext2, basename6, cb); + } + }.bind(this) + ); + asyncSeries(tasks, callback); + } + /** + * Gets the next filename to use for this instance in the case that log + * filesizes are being capped. + * @returns {string} - TODO: add return description. + * @private + */ + _getFile() { + const ext2 = path2.extname(this._basename); + const basename6 = path2.basename(this._basename, ext2); + const isRotation = this.rotationFormat ? this.rotationFormat() : this._created; + return !this.tailable && this._created ? `${basename6}${isRotation}${ext2}` : `${basename6}${ext2}`; + } + /** + * Increment the number of files created or checked by this instance. + * @param {mixed} ext - TODO: add param description. + * @param {mixed} basename - TODO: add param description. + * @param {mixed} callback - TODO: add param description. + * @returns {undefined} + * @private + */ + _checkMaxFilesIncrementing(ext2, basename6, callback) { + if (!this.maxFiles || this._created < this.maxFiles) { + return setImmediate(callback); + } + const oldest = this._created - this.maxFiles; + const isOldest = oldest !== 0 ? oldest : ""; + const isZipped = this.zippedArchive ? ".gz" : ""; + const filePath = `${basename6}${isOldest}${ext2}${isZipped}`; + const target = path2.join(this.dirname, filePath); + fs.unlink(target, callback); + } + /** + * Roll files forward based on integer, up to maxFiles. e.g. if base if + * file.log and it becomes oversized, roll to file1.log, and allow file.log + * to be re-used. If file is oversized again, roll file1.log to file2.log, + * roll file.log to file1.log, and so on. + * @param {mixed} ext - TODO: add param description. + * @param {mixed} basename - TODO: add param description. + * @param {mixed} callback - TODO: add param description. + * @returns {undefined} + * @private + */ + _checkMaxFilesTailable(ext2, basename6, callback) { + const tasks = []; + if (!this.maxFiles) { + return; + } + const isZipped = this.zippedArchive ? ".gz" : ""; + for (let x3 = this.maxFiles - 1; x3 > 1; x3--) { + tasks.push(function(i6, cb) { + let fileName3 = `${basename6}${i6 - 1}${ext2}${isZipped}`; + const tmppath = path2.join(this.dirname, fileName3); + fs.exists(tmppath, (exists2) => { + if (!exists2) { + return cb(null); + } + fileName3 = `${basename6}${i6}${ext2}${isZipped}`; + fs.rename(tmppath, path2.join(this.dirname, fileName3), cb); + }); + }.bind(this, x3)); + } + asyncSeries(tasks, () => { + fs.rename( + path2.join(this.dirname, `${basename6}${ext2}${isZipped}`), + path2.join(this.dirname, `${basename6}1${ext2}${isZipped}`), + callback + ); + }); + } + /** + * Compresses src to dest with gzip and unlinks src + * @param {string} src - path to source file. + * @param {string} dest - path to zipped destination file. + * @param {Function} callback - callback called after file has been compressed. + * @returns {undefined} + * @private + */ + _compressFile(src, dest, callback) { + fs.access(src, fs.F_OK, (err) => { + if (err) { + return callback(); + } + var gzip = zlib2.createGzip(); + var inp = fs.createReadStream(src); + var out = fs.createWriteStream(dest); + out.on("finish", () => { + fs.unlink(src, callback); + }); + inp.pipe(gzip).pipe(out); + }); + } + _createLogDirIfNotExist(dirPath) { + if (!fs.existsSync(dirPath)) { + fs.mkdirSync(dirPath, { recursive: true }); + } + } + }; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/http.js +var require_http = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/http.js"(exports2, module2) { + "use strict"; + var http2 = __require("http"); + var https2 = __require("https"); + var { Stream: Stream2 } = require_readable(); + var TransportStream = require_winston_transport(); + var { configure } = require_safe_stable_stringify(); + module2.exports = class Http extends TransportStream { + /** + * Constructor function for the Http transport object responsible for + * persisting log messages and metadata to a terminal or TTY. + * @param {!Object} [options={}] - Options for this instance. + */ + // eslint-disable-next-line max-statements + constructor(options = {}) { + super(options); + this.options = options; + this.name = options.name || "http"; + this.ssl = !!options.ssl; + this.host = options.host || "localhost"; + this.port = options.port; + this.auth = options.auth; + this.path = options.path || ""; + this.maximumDepth = options.maximumDepth; + this.agent = options.agent; + this.headers = options.headers || {}; + this.headers["content-type"] = "application/json"; + this.batch = options.batch || false; + this.batchInterval = options.batchInterval || 5e3; + this.batchCount = options.batchCount || 10; + this.batchOptions = []; + this.batchTimeoutID = -1; + this.batchCallback = {}; + if (!this.port) { + this.port = this.ssl ? 443 : 80; + } + } + /** + * Core logging method exposed to Winston. + * @param {Object} info - TODO: add param description. + * @param {function} callback - TODO: add param description. + * @returns {undefined} + */ + log(info, callback) { + this._request(info, null, null, (err, res) => { + if (res && res.statusCode !== 200) { + err = new Error(`Invalid HTTP Status Code: ${res.statusCode}`); + } + if (err) { + this.emit("warn", err); + } else { + this.emit("logged", info); + } + }); + if (callback) { + setImmediate(callback); + } + } + /** + * Query the transport. Options object is optional. + * @param {Object} options - Loggly-like query options for this instance. + * @param {function} callback - Continuation to respond to when complete. + * @returns {undefined} + */ + query(options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } + options = { + method: "query", + params: this.normalizeQuery(options) + }; + const auth = options.params.auth || null; + delete options.params.auth; + const path2 = options.params.path || null; + delete options.params.path; + this._request(options, auth, path2, (err, res, body) => { + if (res && res.statusCode !== 200) { + err = new Error(`Invalid HTTP Status Code: ${res.statusCode}`); + } + if (err) { + return callback(err); + } + if (typeof body === "string") { + try { + body = JSON.parse(body); + } catch (e) { + return callback(e); + } + } + callback(null, body); + }); + } + /** + * Returns a log stream for this transport. Options object is optional. + * @param {Object} options - Stream options for this instance. + * @returns {Stream} - TODO: add return description + */ + stream(options = {}) { + const stream5 = new Stream2(); + options = { + method: "stream", + params: options + }; + const path2 = options.params.path || null; + delete options.params.path; + const auth = options.params.auth || null; + delete options.params.auth; + let buff = ""; + const req = this._request(options, auth, path2); + stream5.destroy = () => req.destroy(); + req.on("data", (data2) => { + data2 = (buff + data2).split(/\n+/); + const l5 = data2.length - 1; + let i6 = 0; + for (; i6 < l5; i6++) { + try { + stream5.emit("log", JSON.parse(data2[i6])); + } catch (e) { + stream5.emit("error", e); + } + } + buff = data2[l5]; + }); + req.on("error", (err) => stream5.emit("error", err)); + return stream5; + } + /** + * Make a request to a winstond server or any http server which can + * handle json-rpc. + * @param {function} options - Options to sent the request. + * @param {Object?} auth - authentication options + * @param {string} path - request path + * @param {function} callback - Continuation to respond to when complete. + */ + _request(options, auth, path2, callback) { + options = options || {}; + auth = auth || this.auth; + path2 = path2 || this.path || ""; + if (this.batch) { + this._doBatch(options, callback, auth, path2); + } else { + this._doRequest(options, callback, auth, path2); + } + } + /** + * Send or memorize the options according to batch configuration + * @param {function} options - Options to sent the request. + * @param {function} callback - Continuation to respond to when complete. + * @param {Object?} auth - authentication options + * @param {string} path - request path + */ + _doBatch(options, callback, auth, path2) { + this.batchOptions.push(options); + if (this.batchOptions.length === 1) { + const me = this; + this.batchCallback = callback; + this.batchTimeoutID = setTimeout(function() { + me.batchTimeoutID = -1; + me._doBatchRequest(me.batchCallback, auth, path2); + }, this.batchInterval); + } + if (this.batchOptions.length === this.batchCount) { + this._doBatchRequest(this.batchCallback, auth, path2); + } + } + /** + * Initiate a request with the memorized batch options, stop the batch timeout + * @param {function} callback - Continuation to respond to when complete. + * @param {Object?} auth - authentication options + * @param {string} path - request path + */ + _doBatchRequest(callback, auth, path2) { + if (this.batchTimeoutID > 0) { + clearTimeout(this.batchTimeoutID); + this.batchTimeoutID = -1; + } + const batchOptionsCopy = this.batchOptions.slice(); + this.batchOptions = []; + this._doRequest(batchOptionsCopy, callback, auth, path2); + } + /** + * Make a request to a winstond server or any http server which can + * handle json-rpc. + * @param {function} options - Options to sent the request. + * @param {function} callback - Continuation to respond to when complete. + * @param {Object?} auth - authentication options + * @param {string} path - request path + */ + _doRequest(options, callback, auth, path2) { + const headers = Object.assign({}, this.headers); + if (auth && auth.bearer) { + headers.Authorization = `Bearer ${auth.bearer}`; + } + const req = (this.ssl ? https2 : http2).request({ + ...this.options, + method: "POST", + host: this.host, + port: this.port, + path: `/${path2.replace(/^\//, "")}`, + headers, + auth: auth && auth.username && auth.password ? `${auth.username}:${auth.password}` : "", + agent: this.agent + }); + req.on("error", callback); + req.on("response", (res) => res.on("end", () => callback(null, res)).resume()); + const jsonStringify = configure({ + ...this.maximumDepth && { maximumDepth: this.maximumDepth } + }); + req.end(Buffer.from(jsonStringify(options, this.options.replacer), "utf8")); + } + }; + } +}); + +// ../../node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js +var require_is_stream = __commonJS({ + "../../node_modules/.pnpm/is-stream@2.0.1/node_modules/is-stream/index.js"(exports2, module2) { + "use strict"; + var isStream3 = (stream5) => stream5 !== null && typeof stream5 === "object" && typeof stream5.pipe === "function"; + isStream3.writable = (stream5) => isStream3(stream5) && stream5.writable !== false && typeof stream5._write === "function" && typeof stream5._writableState === "object"; + isStream3.readable = (stream5) => isStream3(stream5) && stream5.readable !== false && typeof stream5._read === "function" && typeof stream5._readableState === "object"; + isStream3.duplex = (stream5) => isStream3.writable(stream5) && isStream3.readable(stream5); + isStream3.transform = (stream5) => isStream3.duplex(stream5) && typeof stream5._transform === "function"; + module2.exports = isStream3; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/stream.js +var require_stream2 = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/stream.js"(exports2, module2) { + "use strict"; + var isStream3 = require_is_stream(); + var { MESSAGE } = require_triple_beam(); + var os2 = __require("os"); + var TransportStream = require_winston_transport(); + module2.exports = class Stream extends TransportStream { + /** + * Constructor function for the Console transport object responsible for + * persisting log messages and metadata to a terminal or TTY. + * @param {!Object} [options={}] - Options for this instance. + */ + constructor(options = {}) { + super(options); + if (!options.stream || !isStream3(options.stream)) { + throw new Error("options.stream is required."); + } + this._stream = options.stream; + this._stream.setMaxListeners(Infinity); + this.isObjectMode = options.stream._writableState.objectMode; + this.eol = typeof options.eol === "string" ? options.eol : os2.EOL; + } + /** + * Core logging method exposed to Winston. + * @param {Object} info - TODO: add param description. + * @param {Function} callback - TODO: add param description. + * @returns {undefined} + */ + log(info, callback) { + setImmediate(() => this.emit("logged", info)); + if (this.isObjectMode) { + this._stream.write(info); + if (callback) { + callback(); + } + return; + } + this._stream.write(`${info[MESSAGE]}${this.eol}`); + if (callback) { + callback(); + } + return; + } + }; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/index.js +var require_transports = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "Console", { + configurable: true, + enumerable: true, + get() { + return require_console(); + } + }); + Object.defineProperty(exports2, "File", { + configurable: true, + enumerable: true, + get() { + return require_file(); + } + }); + Object.defineProperty(exports2, "Http", { + configurable: true, + enumerable: true, + get() { + return require_http(); + } + }); + Object.defineProperty(exports2, "Stream", { + configurable: true, + enumerable: true, + get() { + return require_stream2(); + } + }); + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/config/index.js +var require_config2 = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/config/index.js"(exports2) { + "use strict"; + var logform = require_logform(); + var { configs } = require_triple_beam(); + exports2.cli = logform.levels(configs.cli); + exports2.npm = logform.levels(configs.npm); + exports2.syslog = logform.levels(configs.syslog); + exports2.addColors = logform.levels; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/eachOf.js +var require_eachOf = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/eachOf.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + var _isArrayLike = require_isArrayLike(); + var _isArrayLike2 = _interopRequireDefault(_isArrayLike); + var _breakLoop = require_breakLoop(); + var _breakLoop2 = _interopRequireDefault(_breakLoop); + var _eachOfLimit = require_eachOfLimit2(); + var _eachOfLimit2 = _interopRequireDefault(_eachOfLimit); + var _once = require_once(); + var _once2 = _interopRequireDefault(_once); + var _onlyOnce = require_onlyOnce(); + var _onlyOnce2 = _interopRequireDefault(_onlyOnce); + var _wrapAsync = require_wrapAsync(); + var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + var _awaitify = require_awaitify(); + var _awaitify2 = _interopRequireDefault(_awaitify); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function eachOfArrayLike(coll, iteratee, callback) { + callback = (0, _once2.default)(callback); + var index2 = 0, completed = 0, { length } = coll, canceled = false; + if (length === 0) { + callback(null); + } + function iteratorCallback(err, value) { + if (err === false) { + canceled = true; + } + if (canceled === true) return; + if (err) { + callback(err); + } else if (++completed === length || value === _breakLoop2.default) { + callback(null); + } + } + for (; index2 < length; index2++) { + iteratee(coll[index2], index2, (0, _onlyOnce2.default)(iteratorCallback)); + } + } + function eachOfGeneric(coll, iteratee, callback) { + return (0, _eachOfLimit2.default)(coll, Infinity, iteratee, callback); + } + function eachOf(coll, iteratee, callback) { + var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric; + return eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback); + } + exports2.default = (0, _awaitify2.default)(eachOf, 3); + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/withoutIndex.js +var require_withoutIndex = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/internal/withoutIndex.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + exports2.default = _withoutIndex; + function _withoutIndex(iteratee) { + return (value, index2, callback) => iteratee(value, callback); + } + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/async@3.2.5/node_modules/async/forEach.js +var require_forEach = __commonJS({ + "../../node_modules/.pnpm/async@3.2.5/node_modules/async/forEach.js"(exports2, module2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { + value: true + }); + var _eachOf = require_eachOf(); + var _eachOf2 = _interopRequireDefault(_eachOf); + var _withoutIndex = require_withoutIndex(); + var _withoutIndex2 = _interopRequireDefault(_withoutIndex); + var _wrapAsync = require_wrapAsync(); + var _wrapAsync2 = _interopRequireDefault(_wrapAsync); + var _awaitify = require_awaitify(); + var _awaitify2 = _interopRequireDefault(_awaitify); + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { default: obj }; + } + function eachLimit(coll, iteratee, callback) { + return (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback); + } + exports2.default = (0, _awaitify2.default)(eachLimit, 3); + module2.exports = exports2.default; + } +}); + +// ../../node_modules/.pnpm/fn.name@1.1.0/node_modules/fn.name/index.js +var require_fn = __commonJS({ + "../../node_modules/.pnpm/fn.name@1.1.0/node_modules/fn.name/index.js"(exports2, module2) { + "use strict"; + var toString4 = Object.prototype.toString; + module2.exports = function name(fn2) { + if ("string" === typeof fn2.displayName && fn2.constructor.name) { + return fn2.displayName; + } else if ("string" === typeof fn2.name && fn2.name) { + return fn2.name; + } + if ("object" === typeof fn2 && fn2.constructor && "string" === typeof fn2.constructor.name) return fn2.constructor.name; + var named = fn2.toString(), type = toString4.call(fn2).slice(8, -1); + if ("Function" === type) { + named = named.substring(named.indexOf("(") + 1, named.indexOf(")")); + } else { + named = type; + } + return named || "anonymous"; + }; + } +}); + +// ../../node_modules/.pnpm/one-time@1.0.0/node_modules/one-time/index.js +var require_one_time = __commonJS({ + "../../node_modules/.pnpm/one-time@1.0.0/node_modules/one-time/index.js"(exports2, module2) { + "use strict"; + var name = require_fn(); + module2.exports = function one(fn2) { + var called = 0, value; + function onetime() { + if (called) return value; + called = 1; + value = fn2.apply(this, arguments); + fn2 = null; + return value; + } + onetime.displayName = name(fn2); + return onetime; + }; + } +}); + +// ../../node_modules/.pnpm/stack-trace@0.0.10/node_modules/stack-trace/lib/stack-trace.js +var require_stack_trace = __commonJS({ + "../../node_modules/.pnpm/stack-trace@0.0.10/node_modules/stack-trace/lib/stack-trace.js"(exports2) { + exports2.get = function(belowFn) { + var oldLimit = Error.stackTraceLimit; + Error.stackTraceLimit = Infinity; + var dummyObject = {}; + var v8Handler = Error.prepareStackTrace; + Error.prepareStackTrace = function(dummyObject2, v8StackTrace2) { + return v8StackTrace2; + }; + Error.captureStackTrace(dummyObject, belowFn || exports2.get); + var v8StackTrace = dummyObject.stack; + Error.prepareStackTrace = v8Handler; + Error.stackTraceLimit = oldLimit; + return v8StackTrace; + }; + exports2.parse = function(err) { + if (!err.stack) { + return []; + } + var self2 = this; + var lines = err.stack.split("\n").slice(1); + return lines.map(function(line) { + if (line.match(/^\s*[-]{4,}$/)) { + return self2._createParsedCallSite({ + fileName: line, + lineNumber: null, + functionName: null, + typeName: null, + methodName: null, + columnNumber: null, + "native": null + }); + } + var lineMatch = line.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/); + if (!lineMatch) { + return; + } + var object = null; + var method = null; + var functionName = null; + var typeName = null; + var methodName = null; + var isNative = lineMatch[5] === "native"; + if (lineMatch[1]) { + functionName = lineMatch[1]; + var methodStart = functionName.lastIndexOf("."); + if (functionName[methodStart - 1] == ".") + methodStart--; + if (methodStart > 0) { + object = functionName.substr(0, methodStart); + method = functionName.substr(methodStart + 1); + var objectEnd = object.indexOf(".Module"); + if (objectEnd > 0) { + functionName = functionName.substr(objectEnd + 1); + object = object.substr(0, objectEnd); + } + } + typeName = null; + } + if (method) { + typeName = object; + methodName = method; + } + if (method === "") { + methodName = null; + functionName = null; + } + var properties = { + fileName: lineMatch[2] || null, + lineNumber: parseInt(lineMatch[3], 10) || null, + functionName, + typeName, + methodName, + columnNumber: parseInt(lineMatch[4], 10) || null, + "native": isNative + }; + return self2._createParsedCallSite(properties); + }).filter(function(callSite) { + return !!callSite; + }); + }; + function CallSite(properties) { + for (var property in properties) { + this[property] = properties[property]; + } + } + var strProperties = [ + "this", + "typeName", + "functionName", + "methodName", + "fileName", + "lineNumber", + "columnNumber", + "function", + "evalOrigin" + ]; + var boolProperties = [ + "topLevel", + "eval", + "native", + "constructor" + ]; + strProperties.forEach(function(property) { + CallSite.prototype[property] = null; + CallSite.prototype["get" + property[0].toUpperCase() + property.substr(1)] = function() { + return this[property]; + }; + }); + boolProperties.forEach(function(property) { + CallSite.prototype[property] = false; + CallSite.prototype["is" + property[0].toUpperCase() + property.substr(1)] = function() { + return this[property]; + }; + }); + exports2._createParsedCallSite = function(properties) { + return new CallSite(properties); + }; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/exception-stream.js +var require_exception_stream = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/exception-stream.js"(exports2, module2) { + "use strict"; + var { Writable } = require_readable(); + module2.exports = class ExceptionStream extends Writable { + /** + * Constructor function for the ExceptionStream responsible for wrapping a + * TransportStream; only allowing writes of `info` objects with + * `info.exception` set to true. + * @param {!TransportStream} transport - Stream to filter to exceptions + */ + constructor(transport) { + super({ objectMode: true }); + if (!transport) { + throw new Error("ExceptionStream requires a TransportStream instance."); + } + this.handleExceptions = true; + this.transport = transport; + } + /** + * Writes the info object to our transport instance if (and only if) the + * `exception` property is set on the info. + * @param {mixed} info - TODO: add param description. + * @param {mixed} enc - TODO: add param description. + * @param {mixed} callback - TODO: add param description. + * @returns {mixed} - TODO: add return description. + * @private + */ + _write(info, enc, callback) { + if (info.exception) { + return this.transport.log(info, callback); + } + callback(); + return true; + } + }; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/exception-handler.js +var require_exception_handler = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/exception-handler.js"(exports2, module2) { + "use strict"; + var os2 = __require("os"); + var asyncForEach2 = require_forEach(); + var debug = require_node2()("winston:exception"); + var once8 = require_one_time(); + var stackTrace = require_stack_trace(); + var ExceptionStream = require_exception_stream(); + module2.exports = class ExceptionHandler { + /** + * TODO: add contructor description + * @param {!Logger} logger - TODO: add param description + */ + constructor(logger4) { + if (!logger4) { + throw new Error("Logger is required to handle exceptions"); + } + this.logger = logger4; + this.handlers = /* @__PURE__ */ new Map(); + } + /** + * Handles `uncaughtException` events for the current process by adding any + * handlers passed in. + * @returns {undefined} + */ + handle(...args2) { + args2.forEach((arg) => { + if (Array.isArray(arg)) { + return arg.forEach((handler) => this._addHandler(handler)); + } + this._addHandler(arg); + }); + if (!this.catcher) { + this.catcher = this._uncaughtException.bind(this); + process.on("uncaughtException", this.catcher); + } + } + /** + * Removes any handlers to `uncaughtException` events for the current + * process. This does not modify the state of the `this.handlers` set. + * @returns {undefined} + */ + unhandle() { + if (this.catcher) { + process.removeListener("uncaughtException", this.catcher); + this.catcher = false; + Array.from(this.handlers.values()).forEach((wrapper) => this.logger.unpipe(wrapper)); + } + } + /** + * TODO: add method description + * @param {Error} err - Error to get information about. + * @returns {mixed} - TODO: add return description. + */ + getAllInfo(err) { + let message2 = null; + if (err) { + message2 = typeof err === "string" ? err : err.message; + } + return { + error: err, + // TODO (indexzero): how do we configure this? + level: "error", + message: [ + `uncaughtException: ${message2 || "(no error message)"}`, + err && err.stack || " No stack trace" + ].join("\n"), + stack: err && err.stack, + exception: true, + date: (/* @__PURE__ */ new Date()).toString(), + process: this.getProcessInfo(), + os: this.getOsInfo(), + trace: this.getTrace(err) + }; + } + /** + * Gets all relevant process information for the currently running process. + * @returns {mixed} - TODO: add return description. + */ + getProcessInfo() { + return { + pid: process.pid, + uid: process.getuid ? process.getuid() : null, + gid: process.getgid ? process.getgid() : null, + cwd: process.cwd(), + execPath: process.execPath, + version: process.version, + argv: process.argv, + memoryUsage: process.memoryUsage() + }; + } + /** + * Gets all relevant OS information for the currently running process. + * @returns {mixed} - TODO: add return description. + */ + getOsInfo() { + return { + loadavg: os2.loadavg(), + uptime: os2.uptime() + }; + } + /** + * Gets a stack trace for the specified error. + * @param {mixed} err - TODO: add param description. + * @returns {mixed} - TODO: add return description. + */ + getTrace(err) { + const trace = err ? stackTrace.parse(err) : stackTrace.get(); + return trace.map((site2) => { + return { + column: site2.getColumnNumber(), + file: site2.getFileName(), + function: site2.getFunctionName(), + line: site2.getLineNumber(), + method: site2.getMethodName(), + native: site2.isNative() + }; + }); + } + /** + * Helper method to add a transport as an exception handler. + * @param {Transport} handler - The transport to add as an exception handler. + * @returns {void} + */ + _addHandler(handler) { + if (!this.handlers.has(handler)) { + handler.handleExceptions = true; + const wrapper = new ExceptionStream(handler); + this.handlers.set(handler, wrapper); + this.logger.pipe(wrapper); + } + } + /** + * Logs all relevant information around the `err` and exits the current + * process. + * @param {Error} err - Error to handle + * @returns {mixed} - TODO: add return description. + * @private + */ + _uncaughtException(err) { + const info = this.getAllInfo(err); + const handlers = this._getExceptionHandlers(); + let doExit = typeof this.logger.exitOnError === "function" ? this.logger.exitOnError(err) : this.logger.exitOnError; + let timeout; + if (!handlers.length && doExit) { + console.warn("winston: exitOnError cannot be true with no exception handlers."); + console.warn("winston: not exiting process."); + doExit = false; + } + function gracefulExit() { + debug("doExit", doExit); + debug("process._exiting", process._exiting); + if (doExit && !process._exiting) { + if (timeout) { + clearTimeout(timeout); + } + process.exit(1); + } + } + if (!handlers || handlers.length === 0) { + return process.nextTick(gracefulExit); + } + asyncForEach2(handlers, (handler, next2) => { + const done = once8(next2); + const transport = handler.transport || handler; + function onDone(event) { + return () => { + debug(event); + done(); + }; + } + transport._ending = true; + transport.once("finish", onDone("finished")); + transport.once("error", onDone("error")); + }, () => doExit && gracefulExit()); + this.logger.log(info); + if (doExit) { + timeout = setTimeout(gracefulExit, 3e3); + } + } + /** + * Returns the list of transports and exceptionHandlers for this instance. + * @returns {Array} - List of transports and exceptionHandlers for this + * instance. + * @private + */ + _getExceptionHandlers() { + return this.logger.transports.filter((wrap2) => { + const transport = wrap2.transport || wrap2; + return transport.handleExceptions; + }); + } + }; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/rejection-stream.js +var require_rejection_stream = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/rejection-stream.js"(exports2, module2) { + "use strict"; + var { Writable } = require_readable(); + module2.exports = class RejectionStream extends Writable { + /** + * Constructor function for the RejectionStream responsible for wrapping a + * TransportStream; only allowing writes of `info` objects with + * `info.rejection` set to true. + * @param {!TransportStream} transport - Stream to filter to rejections + */ + constructor(transport) { + super({ objectMode: true }); + if (!transport) { + throw new Error("RejectionStream requires a TransportStream instance."); + } + this.handleRejections = true; + this.transport = transport; + } + /** + * Writes the info object to our transport instance if (and only if) the + * `rejection` property is set on the info. + * @param {mixed} info - TODO: add param description. + * @param {mixed} enc - TODO: add param description. + * @param {mixed} callback - TODO: add param description. + * @returns {mixed} - TODO: add return description. + * @private + */ + _write(info, enc, callback) { + if (info.rejection) { + return this.transport.log(info, callback); + } + callback(); + return true; + } + }; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/rejection-handler.js +var require_rejection_handler = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/rejection-handler.js"(exports2, module2) { + "use strict"; + var os2 = __require("os"); + var asyncForEach2 = require_forEach(); + var debug = require_node2()("winston:rejection"); + var once8 = require_one_time(); + var stackTrace = require_stack_trace(); + var RejectionStream = require_rejection_stream(); + module2.exports = class RejectionHandler { + /** + * TODO: add contructor description + * @param {!Logger} logger - TODO: add param description + */ + constructor(logger4) { + if (!logger4) { + throw new Error("Logger is required to handle rejections"); + } + this.logger = logger4; + this.handlers = /* @__PURE__ */ new Map(); + } + /** + * Handles `unhandledRejection` events for the current process by adding any + * handlers passed in. + * @returns {undefined} + */ + handle(...args2) { + args2.forEach((arg) => { + if (Array.isArray(arg)) { + return arg.forEach((handler) => this._addHandler(handler)); + } + this._addHandler(arg); + }); + if (!this.catcher) { + this.catcher = this._unhandledRejection.bind(this); + process.on("unhandledRejection", this.catcher); + } + } + /** + * Removes any handlers to `unhandledRejection` events for the current + * process. This does not modify the state of the `this.handlers` set. + * @returns {undefined} + */ + unhandle() { + if (this.catcher) { + process.removeListener("unhandledRejection", this.catcher); + this.catcher = false; + Array.from(this.handlers.values()).forEach( + (wrapper) => this.logger.unpipe(wrapper) + ); + } + } + /** + * TODO: add method description + * @param {Error} err - Error to get information about. + * @returns {mixed} - TODO: add return description. + */ + getAllInfo(err) { + let message2 = null; + if (err) { + message2 = typeof err === "string" ? err : err.message; + } + return { + error: err, + // TODO (indexzero): how do we configure this? + level: "error", + message: [ + `unhandledRejection: ${message2 || "(no error message)"}`, + err && err.stack || " No stack trace" + ].join("\n"), + stack: err && err.stack, + rejection: true, + date: (/* @__PURE__ */ new Date()).toString(), + process: this.getProcessInfo(), + os: this.getOsInfo(), + trace: this.getTrace(err) + }; + } + /** + * Gets all relevant process information for the currently running process. + * @returns {mixed} - TODO: add return description. + */ + getProcessInfo() { + return { + pid: process.pid, + uid: process.getuid ? process.getuid() : null, + gid: process.getgid ? process.getgid() : null, + cwd: process.cwd(), + execPath: process.execPath, + version: process.version, + argv: process.argv, + memoryUsage: process.memoryUsage() + }; + } + /** + * Gets all relevant OS information for the currently running process. + * @returns {mixed} - TODO: add return description. + */ + getOsInfo() { + return { + loadavg: os2.loadavg(), + uptime: os2.uptime() + }; + } + /** + * Gets a stack trace for the specified error. + * @param {mixed} err - TODO: add param description. + * @returns {mixed} - TODO: add return description. + */ + getTrace(err) { + const trace = err ? stackTrace.parse(err) : stackTrace.get(); + return trace.map((site2) => { + return { + column: site2.getColumnNumber(), + file: site2.getFileName(), + function: site2.getFunctionName(), + line: site2.getLineNumber(), + method: site2.getMethodName(), + native: site2.isNative() + }; + }); + } + /** + * Helper method to add a transport as an exception handler. + * @param {Transport} handler - The transport to add as an exception handler. + * @returns {void} + */ + _addHandler(handler) { + if (!this.handlers.has(handler)) { + handler.handleRejections = true; + const wrapper = new RejectionStream(handler); + this.handlers.set(handler, wrapper); + this.logger.pipe(wrapper); + } + } + /** + * Logs all relevant information around the `err` and exits the current + * process. + * @param {Error} err - Error to handle + * @returns {mixed} - TODO: add return description. + * @private + */ + _unhandledRejection(err) { + const info = this.getAllInfo(err); + const handlers = this._getRejectionHandlers(); + let doExit = typeof this.logger.exitOnError === "function" ? this.logger.exitOnError(err) : this.logger.exitOnError; + let timeout; + if (!handlers.length && doExit) { + console.warn("winston: exitOnError cannot be true with no rejection handlers."); + console.warn("winston: not exiting process."); + doExit = false; + } + function gracefulExit() { + debug("doExit", doExit); + debug("process._exiting", process._exiting); + if (doExit && !process._exiting) { + if (timeout) { + clearTimeout(timeout); + } + process.exit(1); + } + } + if (!handlers || handlers.length === 0) { + return process.nextTick(gracefulExit); + } + asyncForEach2( + handlers, + (handler, next2) => { + const done = once8(next2); + const transport = handler.transport || handler; + function onDone(event) { + return () => { + debug(event); + done(); + }; + } + transport._ending = true; + transport.once("finish", onDone("finished")); + transport.once("error", onDone("error")); + }, + () => doExit && gracefulExit() + ); + this.logger.log(info); + if (doExit) { + timeout = setTimeout(gracefulExit, 3e3); + } + } + /** + * Returns the list of transports and exceptionHandlers for this instance. + * @returns {Array} - List of transports and exceptionHandlers for this + * instance. + * @private + */ + _getRejectionHandlers() { + return this.logger.transports.filter((wrap2) => { + const transport = wrap2.transport || wrap2; + return transport.handleRejections; + }); + } + }; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/profiler.js +var require_profiler = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/profiler.js"(exports2, module2) { + "use strict"; + var Profiler = class { + /** + * Constructor function for the Profiler instance used by + * `Logger.prototype.startTimer`. When done is called the timer will finish + * and log the duration. + * @param {!Logger} logger - TODO: add param description. + * @private + */ + constructor(logger4) { + const Logger3 = require_logger(); + if (typeof logger4 !== "object" || Array.isArray(logger4) || !(logger4 instanceof Logger3)) { + throw new Error("Logger is required for profiling"); + } else { + this.logger = logger4; + this.start = Date.now(); + } + } + /** + * Ends the current timer (i.e. Profiler) instance and logs the `msg` along + * with the duration since creation. + * @returns {mixed} - TODO: add return description. + * @private + */ + done(...args2) { + if (typeof args2[args2.length - 1] === "function") { + console.warn("Callback function no longer supported as of winston@3.0.0"); + args2.pop(); + } + const info = typeof args2[args2.length - 1] === "object" ? args2.pop() : {}; + info.level = info.level || "info"; + info.durationMs = Date.now() - this.start; + return this.logger.write(info); + } + }; + module2.exports = Profiler; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/logger.js +var require_logger = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/logger.js"(exports2, module2) { + "use strict"; + var { Stream: Stream2, Transform } = require_readable(); + var asyncForEach2 = require_forEach(); + var { LEVEL, SPLAT } = require_triple_beam(); + var isStream3 = require_is_stream(); + var ExceptionHandler = require_exception_handler(); + var RejectionHandler = require_rejection_handler(); + var LegacyTransportStream = require_legacy(); + var Profiler = require_profiler(); + var { warn } = require_common(); + var config3 = require_config2(); + var formatRegExp = /%[scdjifoO%]/g; + var Logger3 = class extends Transform { + /** + * Constructor function for the Logger object responsible for persisting log + * messages and metadata to one or more transports. + * @param {!Object} options - foo + */ + constructor(options) { + super({ objectMode: true }); + this.configure(options); + } + child(defaultRequestMetadata) { + const logger4 = this; + return Object.create(logger4, { + write: { + value: function(info) { + const infoClone = Object.assign( + {}, + defaultRequestMetadata, + info + ); + if (info instanceof Error) { + infoClone.stack = info.stack; + infoClone.message = info.message; + } + logger4.write(infoClone); + } + } + }); + } + /** + * This will wholesale reconfigure this instance by: + * 1. Resetting all transports. Older transports will be removed implicitly. + * 2. Set all other options including levels, colors, rewriters, filters, + * exceptionHandlers, etc. + * @param {!Object} options - TODO: add param description. + * @returns {undefined} + */ + configure({ + silent, + format: format5, + defaultMeta, + levels, + level = "info", + exitOnError = true, + transports, + colors, + emitErrs, + formatters, + padLevels, + rewriters, + stripColors, + exceptionHandlers, + rejectionHandlers + } = {}) { + if (this.transports.length) { + this.clear(); + } + this.silent = silent; + this.format = format5 || this.format || require_json()(); + this.defaultMeta = defaultMeta || null; + this.levels = levels || this.levels || config3.npm.levels; + this.level = level; + if (this.exceptions) { + this.exceptions.unhandle(); + } + if (this.rejections) { + this.rejections.unhandle(); + } + this.exceptions = new ExceptionHandler(this); + this.rejections = new RejectionHandler(this); + this.profilers = {}; + this.exitOnError = exitOnError; + if (transports) { + transports = Array.isArray(transports) ? transports : [transports]; + transports.forEach((transport) => this.add(transport)); + } + if (colors || emitErrs || formatters || padLevels || rewriters || stripColors) { + throw new Error( + [ + "{ colors, emitErrs, formatters, padLevels, rewriters, stripColors } were removed in winston@3.0.0.", + "Use a custom winston.format(function) instead.", + "See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md" + ].join("\n") + ); + } + if (exceptionHandlers) { + this.exceptions.handle(exceptionHandlers); + } + if (rejectionHandlers) { + this.rejections.handle(rejectionHandlers); + } + } + isLevelEnabled(level) { + const givenLevelValue = getLevelValue(this.levels, level); + if (givenLevelValue === null) { + return false; + } + const configuredLevelValue = getLevelValue(this.levels, this.level); + if (configuredLevelValue === null) { + return false; + } + if (!this.transports || this.transports.length === 0) { + return configuredLevelValue >= givenLevelValue; + } + const index2 = this.transports.findIndex((transport) => { + let transportLevelValue = getLevelValue(this.levels, transport.level); + if (transportLevelValue === null) { + transportLevelValue = configuredLevelValue; + } + return transportLevelValue >= givenLevelValue; + }); + return index2 !== -1; + } + /* eslint-disable valid-jsdoc */ + /** + * Ensure backwards compatibility with a `log` method + * @param {mixed} level - Level the log message is written at. + * @param {mixed} msg - TODO: add param description. + * @param {mixed} meta - TODO: add param description. + * @returns {Logger} - TODO: add return description. + * + * @example + * // Supports the existing API: + * logger.log('info', 'Hello world', { custom: true }); + * logger.log('info', new Error('Yo, it\'s on fire')); + * + * // Requires winston.format.splat() + * logger.log('info', '%s %d%%', 'A string', 50, { thisIsMeta: true }); + * + * // And the new API with a single JSON literal: + * logger.log({ level: 'info', message: 'Hello world', custom: true }); + * logger.log({ level: 'info', message: new Error('Yo, it\'s on fire') }); + * + * // Also requires winston.format.splat() + * logger.log({ + * level: 'info', + * message: '%s %d%%', + * [SPLAT]: ['A string', 50], + * meta: { thisIsMeta: true } + * }); + * + */ + /* eslint-enable valid-jsdoc */ + log(level, msg, ...splat) { + if (arguments.length === 1) { + level[LEVEL] = level.level; + this._addDefaultMeta(level); + this.write(level); + return this; + } + if (arguments.length === 2) { + if (msg && typeof msg === "object") { + msg[LEVEL] = msg.level = level; + this._addDefaultMeta(msg); + this.write(msg); + return this; + } + msg = { [LEVEL]: level, level, message: msg }; + this._addDefaultMeta(msg); + this.write(msg); + return this; + } + const [meta] = splat; + if (typeof meta === "object" && meta !== null) { + const tokens = msg && msg.match && msg.match(formatRegExp); + if (!tokens) { + const info = Object.assign({}, this.defaultMeta, meta, { + [LEVEL]: level, + [SPLAT]: splat, + level, + message: msg + }); + if (meta.message) info.message = `${info.message} ${meta.message}`; + if (meta.stack) info.stack = meta.stack; + this.write(info); + return this; + } + } + this.write(Object.assign({}, this.defaultMeta, { + [LEVEL]: level, + [SPLAT]: splat, + level, + message: msg + })); + return this; + } + /** + * Pushes data so that it can be picked up by all of our pipe targets. + * @param {mixed} info - TODO: add param description. + * @param {mixed} enc - TODO: add param description. + * @param {mixed} callback - Continues stream processing. + * @returns {undefined} + * @private + */ + _transform(info, enc, callback) { + if (this.silent) { + return callback(); + } + if (!info[LEVEL]) { + info[LEVEL] = info.level; + } + if (!this.levels[info[LEVEL]] && this.levels[info[LEVEL]] !== 0) { + console.error("[winston] Unknown logger level: %s", info[LEVEL]); + } + if (!this._readableState.pipes) { + console.error( + "[winston] Attempt to write logs with no transports, which can increase memory usage: %j", + info + ); + } + try { + this.push(this.format.transform(info, this.format.options)); + } finally { + this._writableState.sync = false; + callback(); + } + } + /** + * Delays the 'finish' event until all transport pipe targets have + * also emitted 'finish' or are already finished. + * @param {mixed} callback - Continues stream processing. + */ + _final(callback) { + const transports = this.transports.slice(); + asyncForEach2( + transports, + (transport, next2) => { + if (!transport || transport.finished) return setImmediate(next2); + transport.once("finish", next2); + transport.end(); + }, + callback + ); + } + /** + * Adds the transport to this logger instance by piping to it. + * @param {mixed} transport - TODO: add param description. + * @returns {Logger} - TODO: add return description. + */ + add(transport) { + const target = !isStream3(transport) || transport.log.length > 2 ? new LegacyTransportStream({ transport }) : transport; + if (!target._writableState || !target._writableState.objectMode) { + throw new Error( + "Transports must WritableStreams in objectMode. Set { objectMode: true }." + ); + } + this._onEvent("error", target); + this._onEvent("warn", target); + this.pipe(target); + if (transport.handleExceptions) { + this.exceptions.handle(); + } + if (transport.handleRejections) { + this.rejections.handle(); + } + return this; + } + /** + * Removes the transport from this logger instance by unpiping from it. + * @param {mixed} transport - TODO: add param description. + * @returns {Logger} - TODO: add return description. + */ + remove(transport) { + if (!transport) return this; + let target = transport; + if (!isStream3(transport) || transport.log.length > 2) { + target = this.transports.filter( + (match2) => match2.transport === transport + )[0]; + } + if (target) { + this.unpipe(target); + } + return this; + } + /** + * Removes all transports from this logger instance. + * @returns {Logger} - TODO: add return description. + */ + clear() { + this.unpipe(); + return this; + } + /** + * Cleans up resources (streams, event listeners) for all transports + * associated with this instance (if necessary). + * @returns {Logger} - TODO: add return description. + */ + close() { + this.exceptions.unhandle(); + this.rejections.unhandle(); + this.clear(); + this.emit("close"); + return this; + } + /** + * Sets the `target` levels specified on this instance. + * @param {Object} Target levels to use on this instance. + */ + setLevels() { + warn.deprecated("setLevels"); + } + /** + * Queries the all transports for this instance with the specified `options`. + * This will aggregate each transport's results into one object containing + * a property per transport. + * @param {Object} options - Query options for this instance. + * @param {function} callback - Continuation to respond to when complete. + */ + query(options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } + options = options || {}; + const results = {}; + const queryObject = Object.assign({}, options.query || {}); + function queryTransport(transport, next2) { + if (options.query && typeof transport.formatQuery === "function") { + options.query = transport.formatQuery(queryObject); + } + transport.query(options, (err, res) => { + if (err) { + return next2(err); + } + if (typeof transport.formatResults === "function") { + res = transport.formatResults(res, options.format); + } + next2(null, res); + }); + } + function addResults(transport, next2) { + queryTransport(transport, (err, result) => { + if (next2) { + result = err || result; + if (result) { + results[transport.name] = result; + } + next2(); + } + next2 = null; + }); + } + asyncForEach2( + this.transports.filter((transport) => !!transport.query), + addResults, + () => callback(null, results) + ); + } + /** + * Returns a log stream for all transports. Options object is optional. + * @param{Object} options={} - Stream options for this instance. + * @returns {Stream} - TODO: add return description. + */ + stream(options = {}) { + const out = new Stream2(); + const streams = []; + out._streams = streams; + out.destroy = () => { + let i6 = streams.length; + while (i6--) { + streams[i6].destroy(); + } + }; + this.transports.filter((transport) => !!transport.stream).forEach((transport) => { + const str = transport.stream(options); + if (!str) { + return; + } + streams.push(str); + str.on("log", (log2) => { + log2.transport = log2.transport || []; + log2.transport.push(transport.name); + out.emit("log", log2); + }); + str.on("error", (err) => { + err.transport = err.transport || []; + err.transport.push(transport.name); + out.emit("error", err); + }); + }); + return out; + } + /** + * Returns an object corresponding to a specific timing. When done is called + * the timer will finish and log the duration. e.g.: + * @returns {Profile} - TODO: add return description. + * @example + * const timer = winston.startTimer() + * setTimeout(() => { + * timer.done({ + * message: 'Logging message' + * }); + * }, 1000); + */ + startTimer() { + return new Profiler(this); + } + /** + * Tracks the time inbetween subsequent calls to this method with the same + * `id` parameter. The second call to this method will log the difference in + * milliseconds along with the message. + * @param {string} id Unique id of the profiler + * @returns {Logger} - TODO: add return description. + */ + profile(id, ...args2) { + const time = Date.now(); + if (this.profilers[id]) { + const timeEnd = this.profilers[id]; + delete this.profilers[id]; + if (typeof args2[args2.length - 2] === "function") { + console.warn( + "Callback function no longer supported as of winston@3.0.0" + ); + args2.pop(); + } + const info = typeof args2[args2.length - 1] === "object" ? args2.pop() : {}; + info.level = info.level || "info"; + info.durationMs = time - timeEnd; + info.message = info.message || id; + return this.write(info); + } + this.profilers[id] = time; + return this; + } + /** + * Backwards compatibility to `exceptions.handle` in winston < 3.0.0. + * @returns {undefined} + * @deprecated + */ + handleExceptions(...args2) { + console.warn( + "Deprecated: .handleExceptions() will be removed in winston@4. Use .exceptions.handle()" + ); + this.exceptions.handle(...args2); + } + /** + * Backwards compatibility to `exceptions.handle` in winston < 3.0.0. + * @returns {undefined} + * @deprecated + */ + unhandleExceptions(...args2) { + console.warn( + "Deprecated: .unhandleExceptions() will be removed in winston@4. Use .exceptions.unhandle()" + ); + this.exceptions.unhandle(...args2); + } + /** + * Throw a more meaningful deprecation notice + * @throws {Error} - TODO: add throws description. + */ + cli() { + throw new Error( + [ + "Logger.cli() was removed in winston@3.0.0", + "Use a custom winston.formats.cli() instead.", + "See: https://github.com/winstonjs/winston/tree/master/UPGRADE-3.0.md" + ].join("\n") + ); + } + /** + * Bubbles the `event` that occured on the specified `transport` up + * from this instance. + * @param {string} event - The event that occured + * @param {Object} transport - Transport on which the event occured + * @private + */ + _onEvent(event, transport) { + function transportEvent(err) { + if (event === "error" && !this.transports.includes(transport)) { + this.add(transport); + } + this.emit(event, err, transport); + } + if (!transport["__winston" + event]) { + transport["__winston" + event] = transportEvent.bind(this); + transport.on(event, transport["__winston" + event]); + } + } + _addDefaultMeta(msg) { + if (this.defaultMeta) { + Object.assign(msg, this.defaultMeta); + } + } + }; + function getLevelValue(levels, level) { + const value = levels[level]; + if (!value && value !== 0) { + return null; + } + return value; + } + Object.defineProperty(Logger3.prototype, "transports", { + configurable: false, + enumerable: true, + get() { + const { pipes } = this._readableState; + return !Array.isArray(pipes) ? [pipes].filter(Boolean) : pipes; + } + }); + module2.exports = Logger3; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/create-logger.js +var require_create_logger = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/create-logger.js"(exports2, module2) { + "use strict"; + var { LEVEL } = require_triple_beam(); + var config3 = require_config2(); + var Logger3 = require_logger(); + var debug = require_node2()("winston:create-logger"); + function isLevelEnabledFunctionName(level) { + return "is" + level.charAt(0).toUpperCase() + level.slice(1) + "Enabled"; + } + module2.exports = function(opts = {}) { + opts.levels = opts.levels || config3.npm.levels; + class DerivedLogger extends Logger3 { + /** + * Create a new class derived logger for which the levels can be attached to + * the prototype of. This is a V8 optimization that is well know to increase + * performance of prototype functions. + * @param {!Object} options - Options for the created logger. + */ + constructor(options) { + super(options); + } + } + const logger4 = new DerivedLogger(opts); + Object.keys(opts.levels).forEach(function(level) { + debug('Define prototype method for "%s"', level); + if (level === "log") { + console.warn('Level "log" not defined: conflicts with the method "log". Use a different level name.'); + return; + } + DerivedLogger.prototype[level] = function(...args2) { + const self2 = this || logger4; + if (args2.length === 1) { + const [msg] = args2; + const info = msg && msg.message && msg || { message: msg }; + info.level = info[LEVEL] = level; + self2._addDefaultMeta(info); + self2.write(info); + return this || logger4; + } + if (args2.length === 0) { + self2.log(level, ""); + return self2; + } + return self2.log(level, ...args2); + }; + DerivedLogger.prototype[isLevelEnabledFunctionName(level)] = function() { + return (this || logger4).isLevelEnabled(level); + }; + }); + return logger4; + }; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/container.js +var require_container = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/container.js"(exports2, module2) { + "use strict"; + var createLogger3 = require_create_logger(); + module2.exports = class Container { + /** + * Constructor function for the Container object responsible for managing a + * set of `winston.Logger` instances based on string ids. + * @param {!Object} [options={}] - Default pass-thru options for Loggers. + */ + constructor(options = {}) { + this.loggers = /* @__PURE__ */ new Map(); + this.options = options; + } + /** + * Retrieves a `winston.Logger` instance for the specified `id`. If an + * instance does not exist, one is created. + * @param {!string} id - The id of the Logger to get. + * @param {?Object} [options] - Options for the Logger instance. + * @returns {Logger} - A configured Logger instance with a specified id. + */ + add(id, options) { + if (!this.loggers.has(id)) { + options = Object.assign({}, options || this.options); + const existing = options.transports || this.options.transports; + if (existing) { + options.transports = Array.isArray(existing) ? existing.slice() : [existing]; + } else { + options.transports = []; + } + const logger4 = createLogger3(options); + logger4.on("close", () => this._delete(id)); + this.loggers.set(id, logger4); + } + return this.loggers.get(id); + } + /** + * Retreives a `winston.Logger` instance for the specified `id`. If + * an instance does not exist, one is created. + * @param {!string} id - The id of the Logger to get. + * @param {?Object} [options] - Options for the Logger instance. + * @returns {Logger} - A configured Logger instance with a specified id. + */ + get(id, options) { + return this.add(id, options); + } + /** + * Check if the container has a logger with the id. + * @param {?string} id - The id of the Logger instance to find. + * @returns {boolean} - Boolean value indicating if this instance has a + * logger with the specified `id`. + */ + has(id) { + return !!this.loggers.has(id); + } + /** + * Closes a `Logger` instance with the specified `id` if it exists. + * If no `id` is supplied then all Loggers are closed. + * @param {?string} id - The id of the Logger instance to close. + * @returns {undefined} + */ + close(id) { + if (id) { + return this._removeLogger(id); + } + this.loggers.forEach((val2, key) => this._removeLogger(key)); + } + /** + * Remove a logger based on the id. + * @param {!string} id - The id of the logger to remove. + * @returns {undefined} + * @private + */ + _removeLogger(id) { + if (!this.loggers.has(id)) { + return; + } + const logger4 = this.loggers.get(id); + logger4.close(); + this._delete(id); + } + /** + * Deletes a `Logger` instance with the specified `id`. + * @param {!string} id - The id of the Logger instance to delete from + * container. + * @returns {undefined} + * @private + */ + _delete(id) { + this.loggers.delete(id); + } + }; + } +}); + +// ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston.js +var require_winston = __commonJS({ + "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston.js"(exports2) { + "use strict"; + var logform = require_logform(); + var { warn } = require_common(); + exports2.version = require_package().version; + exports2.transports = require_transports(); + exports2.config = require_config2(); + exports2.addColors = logform.levels; + exports2.format = logform.format; + exports2.createLogger = require_create_logger(); + exports2.Logger = require_logger(); + exports2.ExceptionHandler = require_exception_handler(); + exports2.RejectionHandler = require_rejection_handler(); + exports2.Container = require_container(); + exports2.Transport = require_winston_transport(); + exports2.loggers = new exports2.Container(); + var defaultLogger = exports2.createLogger(); + Object.keys(exports2.config.npm.levels).concat([ + "log", + "query", + "stream", + "add", + "remove", + "clear", + "profile", + "startTimer", + "handleExceptions", + "unhandleExceptions", + "handleRejections", + "unhandleRejections", + "configure", + "child" + ]).forEach( + (method) => exports2[method] = (...args2) => defaultLogger[method](...args2) + ); + Object.defineProperty(exports2, "level", { + get() { + return defaultLogger.level; + }, + set(val2) { + defaultLogger.level = val2; + } + }); + Object.defineProperty(exports2, "exceptions", { + get() { + return defaultLogger.exceptions; + } + }); + Object.defineProperty(exports2, "rejections", { + get() { + return defaultLogger.rejections; + } + }); + ["exitOnError"].forEach((prop2) => { + Object.defineProperty(exports2, prop2, { + get() { + return defaultLogger[prop2]; + }, + set(val2) { + defaultLogger[prop2] = val2; + } + }); + }); + Object.defineProperty(exports2, "default", { + get() { + return { + exceptionHandlers: defaultLogger.exceptionHandlers, + rejectionHandlers: defaultLogger.rejectionHandlers, + transports: defaultLogger.transports + }; + } + }); + warn.deprecated(exports2, "setLevels"); + warn.forFunctions(exports2, "useFormat", ["cli"]); + warn.forProperties(exports2, "useFormat", ["padLevels", "stripColors"]); + warn.forFunctions(exports2, "deprecated", [ + "addRewriter", + "addFilter", + "clone", + "extend" + ]); + warn.forProperties(exports2, "deprecated", ["emitErrs", "levelLength"]); + } +}); + +// ../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js +var require_lodash = __commonJS({ + "../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"(exports2, module2) { + (function() { + var undefined2; + var VERSION3 = "4.17.21"; + var LARGE_ARRAY_SIZE = 200; + var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`"; + var HASH_UNDEFINED = "__lodash_hash_undefined__"; + var MAX_MEMOIZE_SIZE = 500; + var PLACEHOLDER = "__lodash_placeholder__"; + var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; + var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; + var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; + var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "..."; + var HOT_COUNT = 800, HOT_SPAN = 16; + var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; + var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0; + var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + var wrapFlags = [ + ["ary", WRAP_ARY_FLAG], + ["bind", WRAP_BIND_FLAG], + ["bindKey", WRAP_BIND_KEY_FLAG], + ["curry", WRAP_CURRY_FLAG], + ["curryRight", WRAP_CURRY_RIGHT_FLAG], + ["flip", WRAP_FLIP_FLAG], + ["partial", WRAP_PARTIAL_FLAG], + ["partialRight", WRAP_PARTIAL_RIGHT_FLAG], + ["rearg", WRAP_REARG_FLAG] + ]; + var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]"; + var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; + var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); + var reTrimStart = /^\s+/; + var reWhitespace = /\s/; + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; + var reEscapeChar = /\\(\\)?/g; + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + var reFlags = /\w*$/; + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + var reIsBinary = /^0b[01]+$/i; + var reIsHostCtor = /^\[object .+?Constructor\]$/; + var reIsOctal = /^0o[0-7]+$/i; + var reIsUint = /^(?:0|[1-9]\d*)$/; + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + var reNoMatch = /($^)/; + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + var rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d"; + var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; + var reApos = RegExp(rsApos, "g"); + var reComboMark = RegExp(rsCombo, "g"); + var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); + var reUnicodeWord = RegExp([ + rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", + rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")", + rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, + rsUpper + "+" + rsOptContrUpper, + rsOrdUpper, + rsOrdLower, + rsDigits, + rsEmoji + ].join("|"), "g"); + var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]"); + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + var contextProps = [ + "Array", + "Buffer", + "DataView", + "Date", + "Error", + "Float32Array", + "Float64Array", + "Function", + "Int8Array", + "Int16Array", + "Int32Array", + "Map", + "Math", + "Object", + "Promise", + "RegExp", + "Set", + "String", + "Symbol", + "TypeError", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "WeakMap", + "_", + "clearTimeout", + "isFinite", + "parseInt", + "setTimeout" + ]; + var templateCounter = -1; + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; + var deburredLetters = { + // Latin-1 Supplement block. + "\xC0": "A", + "\xC1": "A", + "\xC2": "A", + "\xC3": "A", + "\xC4": "A", + "\xC5": "A", + "\xE0": "a", + "\xE1": "a", + "\xE2": "a", + "\xE3": "a", + "\xE4": "a", + "\xE5": "a", + "\xC7": "C", + "\xE7": "c", + "\xD0": "D", + "\xF0": "d", + "\xC8": "E", + "\xC9": "E", + "\xCA": "E", + "\xCB": "E", + "\xE8": "e", + "\xE9": "e", + "\xEA": "e", + "\xEB": "e", + "\xCC": "I", + "\xCD": "I", + "\xCE": "I", + "\xCF": "I", + "\xEC": "i", + "\xED": "i", + "\xEE": "i", + "\xEF": "i", + "\xD1": "N", + "\xF1": "n", + "\xD2": "O", + "\xD3": "O", + "\xD4": "O", + "\xD5": "O", + "\xD6": "O", + "\xD8": "O", + "\xF2": "o", + "\xF3": "o", + "\xF4": "o", + "\xF5": "o", + "\xF6": "o", + "\xF8": "o", + "\xD9": "U", + "\xDA": "U", + "\xDB": "U", + "\xDC": "U", + "\xF9": "u", + "\xFA": "u", + "\xFB": "u", + "\xFC": "u", + "\xDD": "Y", + "\xFD": "y", + "\xFF": "y", + "\xC6": "Ae", + "\xE6": "ae", + "\xDE": "Th", + "\xFE": "th", + "\xDF": "ss", + // Latin Extended-A block. + "\u0100": "A", + "\u0102": "A", + "\u0104": "A", + "\u0101": "a", + "\u0103": "a", + "\u0105": "a", + "\u0106": "C", + "\u0108": "C", + "\u010A": "C", + "\u010C": "C", + "\u0107": "c", + "\u0109": "c", + "\u010B": "c", + "\u010D": "c", + "\u010E": "D", + "\u0110": "D", + "\u010F": "d", + "\u0111": "d", + "\u0112": "E", + "\u0114": "E", + "\u0116": "E", + "\u0118": "E", + "\u011A": "E", + "\u0113": "e", + "\u0115": "e", + "\u0117": "e", + "\u0119": "e", + "\u011B": "e", + "\u011C": "G", + "\u011E": "G", + "\u0120": "G", + "\u0122": "G", + "\u011D": "g", + "\u011F": "g", + "\u0121": "g", + "\u0123": "g", + "\u0124": "H", + "\u0126": "H", + "\u0125": "h", + "\u0127": "h", + "\u0128": "I", + "\u012A": "I", + "\u012C": "I", + "\u012E": "I", + "\u0130": "I", + "\u0129": "i", + "\u012B": "i", + "\u012D": "i", + "\u012F": "i", + "\u0131": "i", + "\u0134": "J", + "\u0135": "j", + "\u0136": "K", + "\u0137": "k", + "\u0138": "k", + "\u0139": "L", + "\u013B": "L", + "\u013D": "L", + "\u013F": "L", + "\u0141": "L", + "\u013A": "l", + "\u013C": "l", + "\u013E": "l", + "\u0140": "l", + "\u0142": "l", + "\u0143": "N", + "\u0145": "N", + "\u0147": "N", + "\u014A": "N", + "\u0144": "n", + "\u0146": "n", + "\u0148": "n", + "\u014B": "n", + "\u014C": "O", + "\u014E": "O", + "\u0150": "O", + "\u014D": "o", + "\u014F": "o", + "\u0151": "o", + "\u0154": "R", + "\u0156": "R", + "\u0158": "R", + "\u0155": "r", + "\u0157": "r", + "\u0159": "r", + "\u015A": "S", + "\u015C": "S", + "\u015E": "S", + "\u0160": "S", + "\u015B": "s", + "\u015D": "s", + "\u015F": "s", + "\u0161": "s", + "\u0162": "T", + "\u0164": "T", + "\u0166": "T", + "\u0163": "t", + "\u0165": "t", + "\u0167": "t", + "\u0168": "U", + "\u016A": "U", + "\u016C": "U", + "\u016E": "U", + "\u0170": "U", + "\u0172": "U", + "\u0169": "u", + "\u016B": "u", + "\u016D": "u", + "\u016F": "u", + "\u0171": "u", + "\u0173": "u", + "\u0174": "W", + "\u0175": "w", + "\u0176": "Y", + "\u0177": "y", + "\u0178": "Y", + "\u0179": "Z", + "\u017B": "Z", + "\u017D": "Z", + "\u017A": "z", + "\u017C": "z", + "\u017E": "z", + "\u0132": "IJ", + "\u0133": "ij", + "\u0152": "Oe", + "\u0153": "oe", + "\u0149": "'n", + "\u017F": "s" + }; + var htmlEscapes = { + "&": "&", + "<": "<", + ">": ">", + '"': """, + "'": "'" + }; + var htmlUnescapes = { + "&": "&", + "<": "<", + ">": ">", + """: '"', + "'": "'" + }; + var stringEscapes = { + "\\": "\\", + "'": "'", + "\n": "n", + "\r": "r", + "\u2028": "u2028", + "\u2029": "u2029" + }; + var freeParseFloat = parseFloat, freeParseInt = parseInt; + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root3 = freeGlobal || freeSelf || Function("return this")(); + var freeExports = typeof exports2 == "object" && exports2 && !exports2.nodeType && exports2; + var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2; + var moduleExports = freeModule && freeModule.exports === freeExports; + var freeProcess = moduleExports && freeGlobal.process; + var nodeUtil = function() { + try { + var types2 = freeModule && freeModule.require && freeModule.require("util").types; + if (types2) { + return types2; + } + return freeProcess && freeProcess.binding && freeProcess.binding("util"); + } catch (e) { + } + }(); + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + function apply(func, thisArg, args2) { + switch (args2.length) { + case 0: + return func.call(thisArg); + case 1: + return func.call(thisArg, args2[0]); + case 2: + return func.call(thisArg, args2[0], args2[1]); + case 3: + return func.call(thisArg, args2[0], args2[1], args2[2]); + } + return func.apply(thisArg, args2); + } + function arrayAggregator(array, setter, iteratee, accumulator) { + var index2 = -1, length = array == null ? 0 : array.length; + while (++index2 < length) { + var value = array[index2]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + function arrayEach(array, iteratee) { + var index2 = -1, length = array == null ? 0 : array.length; + while (++index2 < length) { + if (iteratee(array[index2], index2, array) === false) { + break; + } + } + return array; + } + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + function arrayEvery(array, predicate) { + var index2 = -1, length = array == null ? 0 : array.length; + while (++index2 < length) { + if (!predicate(array[index2], index2, array)) { + return false; + } + } + return true; + } + function arrayFilter(array, predicate) { + var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; + while (++index2 < length) { + var value = array[index2]; + if (predicate(value, index2, array)) { + result[resIndex++] = value; + } + } + return result; + } + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + function arrayIncludesWith(array, value, comparator) { + var index2 = -1, length = array == null ? 0 : array.length; + while (++index2 < length) { + if (comparator(value, array[index2])) { + return true; + } + } + return false; + } + function arrayMap(array, iteratee) { + var index2 = -1, length = array == null ? 0 : array.length, result = Array(length); + while (++index2 < length) { + result[index2] = iteratee(array[index2], index2, array); + } + return result; + } + function arrayPush(array, values) { + var index2 = -1, length = values.length, offset = array.length; + while (++index2 < length) { + array[offset + index2] = values[index2]; + } + return array; + } + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index2 = -1, length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[++index2]; + } + while (++index2 < length) { + accumulator = iteratee(accumulator, array[index2], index2, array); + } + return accumulator; + } + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + function arraySome(array, predicate) { + var index2 = -1, length = array == null ? 0 : array.length; + while (++index2 < length) { + if (predicate(array[index2], index2, array)) { + return true; + } + } + return false; + } + var asciiSize = baseProperty("length"); + function asciiToArray(string) { + return string.split(""); + } + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function(value, key, collection2) { + if (predicate(value, key, collection2)) { + result = key; + return false; + } + }); + return result; + } + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, index2 = fromIndex + (fromRight ? 1 : -1); + while (fromRight ? index2-- : ++index2 < length) { + if (predicate(array[index2], index2, array)) { + return index2; + } + } + return -1; + } + function baseIndexOf(array, value, fromIndex) { + return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); + } + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index2 = fromIndex - 1, length = array.length; + while (++index2 < length) { + if (comparator(array[index2], value)) { + return index2; + } + } + return -1; + } + function baseIsNaN(value) { + return value !== value; + } + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? baseSum(array, iteratee) / length : NAN; + } + function baseProperty(key) { + return function(object) { + return object == null ? undefined2 : object[key]; + }; + } + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined2 : object[key]; + }; + } + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index2, collection2) { + accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index2, collection2); + }); + return accumulator; + } + function baseSortBy(array, comparer) { + var length = array.length; + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + function baseSum(array, iteratee) { + var result, index2 = -1, length = array.length; + while (++index2 < length) { + var current = iteratee(array[index2]); + if (current !== undefined2) { + result = result === undefined2 ? current : result + current; + } + } + return result; + } + function baseTimes(n2, iteratee) { + var index2 = -1, result = Array(n2); + while (++index2 < n2) { + result[index2] = iteratee(index2); + } + return result; + } + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + function baseTrim(string) { + return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string; + } + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + function cacheHas(cache2, key) { + return cache2.has(key); + } + function charsStartIndex(strSymbols, chrSymbols) { + var index2 = -1, length = strSymbols.length; + while (++index2 < length && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) { + } + return index2; + } + function charsEndIndex(strSymbols, chrSymbols) { + var index2 = strSymbols.length; + while (index2-- && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) { + } + return index2; + } + function countHolders(array, placeholder) { + var length = array.length, result = 0; + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + return result; + } + var deburrLetter = basePropertyOf(deburredLetters); + var escapeHtmlChar = basePropertyOf(htmlEscapes); + function escapeStringChar(chr) { + return "\\" + stringEscapes[chr]; + } + function getValue(object, key) { + return object == null ? undefined2 : object[key]; + } + function hasUnicode(string) { + return reHasUnicode.test(string); + } + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + function iteratorToArray(iterator) { + var data2, result = []; + while (!(data2 = iterator.next()).done) { + result.push(data2.value); + } + return result; + } + function mapToArray(map2) { + var index2 = -1, result = Array(map2.size); + map2.forEach(function(value, key) { + result[++index2] = [key, value]; + }); + return result; + } + function overArg(func, transform3) { + return function(arg) { + return func(transform3(arg)); + }; + } + function replaceHolders(array, placeholder) { + var index2 = -1, length = array.length, resIndex = 0, result = []; + while (++index2 < length) { + var value = array[index2]; + if (value === placeholder || value === PLACEHOLDER) { + array[index2] = PLACEHOLDER; + result[resIndex++] = index2; + } + } + return result; + } + function setToArray(set) { + var index2 = -1, result = Array(set.size); + set.forEach(function(value) { + result[++index2] = value; + }); + return result; + } + function setToPairs(set) { + var index2 = -1, result = Array(set.size); + set.forEach(function(value) { + result[++index2] = [value, value]; + }); + return result; + } + function strictIndexOf(array, value, fromIndex) { + var index2 = fromIndex - 1, length = array.length; + while (++index2 < length) { + if (array[index2] === value) { + return index2; + } + } + return -1; + } + function strictLastIndexOf(array, value, fromIndex) { + var index2 = fromIndex + 1; + while (index2--) { + if (array[index2] === value) { + return index2; + } + } + return index2; + } + function stringSize(string) { + return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); + } + function stringToArray(string) { + return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); + } + function trimmedEndIndex(string) { + var index2 = string.length; + while (index2-- && reWhitespace.test(string.charAt(index2))) { + } + return index2; + } + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + ++result; + } + return result; + } + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + var runInContext = function runInContext2(context2) { + context2 = context2 == null ? root3 : _.defaults(root3.Object(), context2, _.pick(root3, contextProps)); + var Array2 = context2.Array, Date2 = context2.Date, Error2 = context2.Error, Function2 = context2.Function, Math2 = context2.Math, Object2 = context2.Object, RegExp2 = context2.RegExp, String2 = context2.String, TypeError2 = context2.TypeError; + var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype; + var coreJsData = context2["__core-js_shared__"]; + var funcToString = funcProto.toString; + var hasOwnProperty2 = objectProto.hasOwnProperty; + var idCounter = 0; + var maskSrcKey = function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + }(); + var nativeObjectToString = objectProto.toString; + var objectCtorString = funcToString.call(Object2); + var oldDash = root3._; + var reIsNative = RegExp2( + "^" + funcToString.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ); + var Buffer2 = moduleExports ? context2.Buffer : undefined2, Symbol2 = context2.Symbol, Uint8Array2 = context2.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined2, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined2, symIterator = Symbol2 ? Symbol2.iterator : undefined2, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined2; + var defineProperty = function() { + try { + var func = getNative(Object2, "defineProperty"); + func({}, "", {}); + return func; + } catch (e) { + } + }(); + var ctxClearTimeout = context2.clearTimeout !== root3.clearTimeout && context2.clearTimeout, ctxNow = Date2 && Date2.now !== root3.Date.now && Date2.now, ctxSetTimeout = context2.setTimeout !== root3.setTimeout && context2.setTimeout; + var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined2, nativeIsFinite = context2.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context2.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse; + var DataView2 = getNative(context2, "DataView"), Map2 = getNative(context2, "Map"), Promise2 = getNative(context2, "Promise"), Set2 = getNative(context2, "Set"), WeakMap2 = getNative(context2, "WeakMap"), nativeCreate = getNative(Object2, "create"); + var metaMap = WeakMap2 && new WeakMap2(); + var realNames = {}; + var dataViewCtorString = toSource(DataView2), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2); + var symbolProto = Symbol2 ? Symbol2.prototype : undefined2, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined2, symbolToString = symbolProto ? symbolProto.toString : undefined2; + function lodash16(value) { + if (isObjectLike(value) && !isArray2(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty2.call(value, "__wrapped__")) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + var baseCreate = /* @__PURE__ */ function() { + function object() { + } + return function(proto) { + if (!isObject2(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result2 = new object(); + object.prototype = undefined2; + return result2; + }; + }(); + function baseLodash() { + } + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined2; + } + lodash16.templateSettings = { + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + "escape": reEscape, + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + "evaluate": reEvaluate, + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + "interpolate": reInterpolate, + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + "variable": "", + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + "imports": { + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + "_": lodash16 + } + }; + lodash16.prototype = baseLodash.prototype; + lodash16.prototype.constructor = lodash16; + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + function lazyClone() { + var result2 = new LazyWrapper(this.__wrapped__); + result2.__actions__ = copyArray(this.__actions__); + result2.__dir__ = this.__dir__; + result2.__filtered__ = this.__filtered__; + result2.__iteratees__ = copyArray(this.__iteratees__); + result2.__takeCount__ = this.__takeCount__; + result2.__views__ = copyArray(this.__views__); + return result2; + } + function lazyReverse() { + if (this.__filtered__) { + var result2 = new LazyWrapper(this); + result2.__dir__ = -1; + result2.__filtered__ = true; + } else { + result2 = this.clone(); + result2.__dir__ *= -1; + } + return result2; + } + function lazyValue() { + var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray2(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end2 = view.end, length = end2 - start, index2 = isRight ? end2 : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); + if (!isArr || !isRight && arrLength == length && takeCount == length) { + return baseWrapperValue(array, this.__actions__); + } + var result2 = []; + outer: + while (length-- && resIndex < takeCount) { + index2 += dir; + var iterIndex = -1, value = array[index2]; + while (++iterIndex < iterLength) { + var data2 = iteratees[iterIndex], iteratee2 = data2.iteratee, type = data2.type, computed = iteratee2(value); + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result2[resIndex++] = value; + } + return result2; + } + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + function Hash(entries) { + var index2 = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index2 < length) { + var entry = entries[index2]; + this.set(entry[0], entry[1]); + } + } + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + function hashDelete(key) { + var result2 = this.has(key) && delete this.__data__[key]; + this.size -= result2 ? 1 : 0; + return result2; + } + function hashGet(key) { + var data2 = this.__data__; + if (nativeCreate) { + var result2 = data2[key]; + return result2 === HASH_UNDEFINED ? undefined2 : result2; + } + return hasOwnProperty2.call(data2, key) ? data2[key] : undefined2; + } + function hashHas(key) { + var data2 = this.__data__; + return nativeCreate ? data2[key] !== undefined2 : hasOwnProperty2.call(data2, key); + } + function hashSet(key, value) { + var data2 = this.__data__; + this.size += this.has(key) ? 0 : 1; + data2[key] = nativeCreate && value === undefined2 ? HASH_UNDEFINED : value; + return this; + } + Hash.prototype.clear = hashClear; + Hash.prototype["delete"] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + function ListCache(entries) { + var index2 = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index2 < length) { + var entry = entries[index2]; + this.set(entry[0], entry[1]); + } + } + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + function listCacheDelete(key) { + var data2 = this.__data__, index2 = assocIndexOf(data2, key); + if (index2 < 0) { + return false; + } + var lastIndex = data2.length - 1; + if (index2 == lastIndex) { + data2.pop(); + } else { + splice.call(data2, index2, 1); + } + --this.size; + return true; + } + function listCacheGet(key) { + var data2 = this.__data__, index2 = assocIndexOf(data2, key); + return index2 < 0 ? undefined2 : data2[index2][1]; + } + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + function listCacheSet(key, value) { + var data2 = this.__data__, index2 = assocIndexOf(data2, key); + if (index2 < 0) { + ++this.size; + data2.push([key, value]); + } else { + data2[index2][1] = value; + } + return this; + } + ListCache.prototype.clear = listCacheClear; + ListCache.prototype["delete"] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + function MapCache(entries) { + var index2 = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index2 < length) { + var entry = entries[index2]; + this.set(entry[0], entry[1]); + } + } + function mapCacheClear() { + this.size = 0; + this.__data__ = { + "hash": new Hash(), + "map": new (Map2 || ListCache)(), + "string": new Hash() + }; + } + function mapCacheDelete(key) { + var result2 = getMapData(this, key)["delete"](key); + this.size -= result2 ? 1 : 0; + return result2; + } + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + function mapCacheSet(key, value) { + var data2 = getMapData(this, key), size2 = data2.size; + data2.set(key, value); + this.size += data2.size == size2 ? 0 : 1; + return this; + } + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype["delete"] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + function SetCache(values2) { + var index2 = -1, length = values2 == null ? 0 : values2.length; + this.__data__ = new MapCache(); + while (++index2 < length) { + this.add(values2[index2]); + } + } + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; + } + function setCacheHas(value) { + return this.__data__.has(value); + } + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + function Stack2(entries) { + var data2 = this.__data__ = new ListCache(entries); + this.size = data2.size; + } + function stackClear() { + this.__data__ = new ListCache(); + this.size = 0; + } + function stackDelete(key) { + var data2 = this.__data__, result2 = data2["delete"](key); + this.size = data2.size; + return result2; + } + function stackGet(key) { + return this.__data__.get(key); + } + function stackHas(key) { + return this.__data__.has(key); + } + function stackSet(key, value) { + var data2 = this.__data__; + if (data2 instanceof ListCache) { + var pairs = data2.__data__; + if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) { + pairs.push([key, value]); + this.size = ++data2.size; + return this; + } + data2 = this.__data__ = new MapCache(pairs); + } + data2.set(key, value); + this.size = data2.size; + return this; + } + Stack2.prototype.clear = stackClear; + Stack2.prototype["delete"] = stackDelete; + Stack2.prototype.get = stackGet; + Stack2.prototype.has = stackHas; + Stack2.prototype.set = stackSet; + function arrayLikeKeys(value, inherited) { + var isArr = isArray2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer2(value), isType = !isArr && !isArg && !isBuff && isTypedArray2(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length; + for (var key in value) { + if ((inherited || hasOwnProperty2.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. + (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. + isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. + isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. + isIndex(key, length)))) { + result2.push(key); + } + } + return result2; + } + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined2; + } + function arraySampleSize(array, n2) { + return shuffleSelf(copyArray(array), baseClamp(n2, 0, array.length)); + } + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + function assignMergeValue(object, key, value) { + if (value !== undefined2 && !eq2(object[key], value) || value === undefined2 && !(key in object)) { + baseAssignValue(object, key, value); + } + } + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty2.call(object, key) && eq2(objValue, value)) || value === undefined2 && !(key in object)) { + baseAssignValue(object, key, value); + } + } + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq2(array[length][0], key)) { + return length; + } + } + return -1; + } + function baseAggregator(collection, setter, iteratee2, accumulator) { + baseEach(collection, function(value, key, collection2) { + setter(accumulator, value, iteratee2(value), collection2); + }); + return accumulator; + } + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + function baseAssignValue(object, key, value) { + if (key == "__proto__" && defineProperty) { + defineProperty(object, key, { + "configurable": true, + "enumerable": true, + "value": value, + "writable": true + }); + } else { + object[key] = value; + } + } + function baseAt(object, paths) { + var index2 = -1, length = paths.length, result2 = Array2(length), skip = object == null; + while (++index2 < length) { + result2[index2] = skip ? undefined2 : get2(object, paths[index2]); + } + return result2; + } + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined2) { + number = number <= upper ? number : upper; + } + if (lower !== undefined2) { + number = number >= lower ? number : lower; + } + } + return number; + } + function baseClone(value, bitmask, customizer, key, object, stack2) { + var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; + if (customizer) { + result2 = object ? customizer(value, key, object, stack2) : customizer(value); + } + if (result2 !== undefined2) { + return result2; + } + if (!isObject2(value)) { + return value; + } + var isArr = isArray2(value); + if (isArr) { + result2 = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result2); + } + } else { + var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; + if (isBuffer2(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || isFunc && !object) { + result2 = isFlat || isFunc ? {} : initCloneObject(value); + if (!isDeep) { + return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result2 = initCloneByTag(value, tag, isDeep); + } + } + stack2 || (stack2 = new Stack2()); + var stacked = stack2.get(value); + if (stacked) { + return stacked; + } + stack2.set(value, result2); + if (isSet(value)) { + value.forEach(function(subValue) { + result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack2)); + }); + } else if (isMap(value)) { + value.forEach(function(subValue, key2) { + result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack2)); + }); + } + var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; + var props = isArr ? undefined2 : keysFunc(value); + arrayEach(props || value, function(subValue, key2) { + if (props) { + key2 = subValue; + subValue = value[key2]; + } + assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack2)); + }); + return result2; + } + function baseConforms(source) { + var props = keys(source); + return function(object) { + return baseConformsTo(object, source, props); + }; + } + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object2(object); + while (length--) { + var key = props[length], predicate = source[key], value = object[key]; + if (value === undefined2 && !(key in object) || !predicate(value)) { + return false; + } + } + return true; + } + function baseDelay(func, wait, args2) { + if (typeof func != "function") { + throw new TypeError2(FUNC_ERROR_TEXT); + } + return setTimeout2(function() { + func.apply(undefined2, args2); + }, wait); + } + function baseDifference(array, values2, iteratee2, comparator) { + var index2 = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length; + if (!length) { + return result2; + } + if (iteratee2) { + values2 = arrayMap(values2, baseUnary(iteratee2)); + } + if (comparator) { + includes2 = arrayIncludesWith; + isCommon = false; + } else if (values2.length >= LARGE_ARRAY_SIZE) { + includes2 = cacheHas; + isCommon = false; + values2 = new SetCache(values2); + } + outer: + while (++index2 < length) { + var value = array[index2], computed = iteratee2 == null ? value : iteratee2(value); + value = comparator || value !== 0 ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values2[valuesIndex] === computed) { + continue outer; + } + } + result2.push(value); + } else if (!includes2(values2, computed, comparator)) { + result2.push(value); + } + } + return result2; + } + var baseEach = createBaseEach(baseForOwn); + var baseEachRight = createBaseEach(baseForOwnRight, true); + function baseEvery(collection, predicate) { + var result2 = true; + baseEach(collection, function(value, index2, collection2) { + result2 = !!predicate(value, index2, collection2); + return result2; + }); + return result2; + } + function baseExtremum(array, iteratee2, comparator) { + var index2 = -1, length = array.length; + while (++index2 < length) { + var value = array[index2], current = iteratee2(value); + if (current != null && (computed === undefined2 ? current === current && !isSymbol(current) : comparator(current, computed))) { + var computed = current, result2 = value; + } + } + return result2; + } + function baseFill(array, value, start, end2) { + var length = array.length; + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : length + start; + } + end2 = end2 === undefined2 || end2 > length ? length : toInteger(end2); + if (end2 < 0) { + end2 += length; + } + end2 = start > end2 ? 0 : toLength(end2); + while (start < end2) { + array[start++] = value; + } + return array; + } + function baseFilter(collection, predicate) { + var result2 = []; + baseEach(collection, function(value, index2, collection2) { + if (predicate(value, index2, collection2)) { + result2.push(value); + } + }); + return result2; + } + function baseFlatten(array, depth, predicate, isStrict, result2) { + var index2 = -1, length = array.length; + predicate || (predicate = isFlattenable); + result2 || (result2 = []); + while (++index2 < length) { + var value = array[index2]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + baseFlatten(value, depth - 1, predicate, isStrict, result2); + } else { + arrayPush(result2, value); + } + } else if (!isStrict) { + result2[result2.length] = value; + } + } + return result2; + } + var baseFor = createBaseFor(); + var baseForRight = createBaseFor(true); + function baseForOwn(object, iteratee2) { + return object && baseFor(object, iteratee2, keys); + } + function baseForOwnRight(object, iteratee2) { + return object && baseForRight(object, iteratee2, keys); + } + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction2(object[key]); + }); + } + function baseGet(object, path2) { + path2 = castPath(path2, object); + var index2 = 0, length = path2.length; + while (object != null && index2 < length) { + object = object[toKey(path2[index2++])]; + } + return index2 && index2 == length ? object : undefined2; + } + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result2 = keysFunc(object); + return isArray2(object) ? result2 : arrayPush(result2, symbolsFunc(object)); + } + function baseGetTag(value) { + if (value == null) { + return value === undefined2 ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value); + } + function baseGt(value, other) { + return value > other; + } + function baseHas(object, key) { + return object != null && hasOwnProperty2.call(object, key); + } + function baseHasIn(object, key) { + return object != null && key in Object2(object); + } + function baseInRange(number, start, end2) { + return number >= nativeMin(start, end2) && number < nativeMax(start, end2); + } + function baseIntersection(arrays, iteratee2, comparator) { + var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = []; + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee2) { + array = arrayMap(array, baseUnary(iteratee2)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined2; + } + array = arrays[0]; + var index2 = -1, seen = caches[0]; + outer: + while (++index2 < length && result2.length < maxLength) { + var value = array[index2], computed = iteratee2 ? iteratee2(value) : value; + value = comparator || value !== 0 ? value : 0; + if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) { + othIndex = othLength; + while (--othIndex) { + var cache2 = caches[othIndex]; + if (!(cache2 ? cacheHas(cache2, computed) : includes2(arrays[othIndex], computed, comparator))) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result2.push(value); + } + } + return result2; + } + function baseInverter(object, setter, iteratee2, accumulator) { + baseForOwn(object, function(value, key, object2) { + setter(accumulator, iteratee2(value), key, object2); + }); + return accumulator; + } + function baseInvoke(object, path2, args2) { + path2 = castPath(path2, object); + object = parent2(object, path2); + var func = object == null ? object : object[toKey(last2(path2))]; + return func == null ? undefined2 : apply(func, object, args2); + } + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + function baseIsEqual(value, other, bitmask, customizer, stack2) { + if (value === other) { + return true; + } + if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack2); + } + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack2) { + var objIsArr = isArray2(object), othIsArr = isArray2(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; + if (isSameTag && isBuffer2(object)) { + if (!isBuffer2(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } + if (isSameTag && !objIsObj) { + stack2 || (stack2 = new Stack2()); + return objIsArr || isTypedArray2(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack2) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack2); + } + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty2.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty2.call(other, "__wrapped__"); + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; + stack2 || (stack2 = new Stack2()); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack2); + } + } + if (!isSameTag) { + return false; + } + stack2 || (stack2 = new Stack2()); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack2); + } + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + function baseIsMatch(object, source, matchData, customizer) { + var index2 = matchData.length, length = index2, noCustomizer = !customizer; + if (object == null) { + return !length; + } + object = Object2(object); + while (index2--) { + var data2 = matchData[index2]; + if (noCustomizer && data2[2] ? data2[1] !== object[data2[0]] : !(data2[0] in object)) { + return false; + } + } + while (++index2 < length) { + data2 = matchData[index2]; + var key = data2[0], objValue = object[key], srcValue = data2[1]; + if (noCustomizer && data2[2]) { + if (objValue === undefined2 && !(key in object)) { + return false; + } + } else { + var stack2 = new Stack2(); + if (customizer) { + var result2 = customizer(objValue, srcValue, key, object, source, stack2); + } + if (!(result2 === undefined2 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack2) : result2)) { + return false; + } + } + } + return true; + } + function baseIsNative(value) { + if (!isObject2(value) || isMasked(value)) { + return false; + } + var pattern = isFunction2(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + function baseIsTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + function baseIteratee(value) { + if (typeof value == "function") { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == "object") { + return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); + } + return property(value); + } + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result2 = []; + for (var key in Object2(object)) { + if (hasOwnProperty2.call(object, key) && key != "constructor") { + result2.push(key); + } + } + return result2; + } + function baseKeysIn(object) { + if (!isObject2(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), result2 = []; + for (var key in object) { + if (!(key == "constructor" && (isProto || !hasOwnProperty2.call(object, key)))) { + result2.push(key); + } + } + return result2; + } + function baseLt(value, other) { + return value < other; + } + function baseMap(collection, iteratee2) { + var index2 = -1, result2 = isArrayLike2(collection) ? Array2(collection.length) : []; + baseEach(collection, function(value, key, collection2) { + result2[++index2] = iteratee2(value, key, collection2); + }); + return result2; + } + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + function baseMatchesProperty(path2, srcValue) { + if (isKey(path2) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path2), srcValue); + } + return function(object) { + var objValue = get2(object, path2); + return objValue === undefined2 && objValue === srcValue ? hasIn(object, path2) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); + }; + } + function baseMerge(object, source, srcIndex, customizer, stack2) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack2 || (stack2 = new Stack2()); + if (isObject2(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack2); + } else { + var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack2) : undefined2; + if (newValue === undefined2) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack2) { + var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack2.get(srcValue); + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack2) : undefined2; + var isCommon = newValue === undefined2; + if (isCommon) { + var isArr = isArray2(srcValue), isBuff = !isArr && isBuffer2(srcValue), isTyped = !isArr && !isBuff && isTypedArray2(srcValue); + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray2(objValue)) { + newValue = objValue; + } else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } else { + newValue = []; + } + } else if (isPlainObject2(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } else if (!isObject2(objValue) || isFunction2(objValue)) { + newValue = initCloneObject(srcValue); + } + } else { + isCommon = false; + } + } + if (isCommon) { + stack2.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack2); + stack2["delete"](srcValue); + } + assignMergeValue(object, key, newValue); + } + function baseNth(array, n2) { + var length = array.length; + if (!length) { + return; + } + n2 += n2 < 0 ? length : 0; + return isIndex(n2, length) ? array[n2] : undefined2; + } + function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function(iteratee2) { + if (isArray2(iteratee2)) { + return function(value) { + return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2); + }; + } + return iteratee2; + }); + } else { + iteratees = [identity]; + } + var index2 = -1; + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + var result2 = baseMap(collection, function(value, key, collection2) { + var criteria = arrayMap(iteratees, function(iteratee2) { + return iteratee2(value); + }); + return { "criteria": criteria, "index": ++index2, "value": value }; + }); + return baseSortBy(result2, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path2) { + return hasIn(object, path2); + }); + } + function basePickBy(object, paths, predicate) { + var index2 = -1, length = paths.length, result2 = {}; + while (++index2 < length) { + var path2 = paths[index2], value = baseGet(object, path2); + if (predicate(value, path2)) { + baseSet(result2, castPath(path2, object), value); + } + } + return result2; + } + function basePropertyDeep(path2) { + return function(object) { + return baseGet(object, path2); + }; + } + function basePullAll(array, values2, iteratee2, comparator) { + var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index2 = -1, length = values2.length, seen = array; + if (array === values2) { + values2 = copyArray(values2); + } + if (iteratee2) { + seen = arrayMap(array, baseUnary(iteratee2)); + } + while (++index2 < length) { + var fromIndex = 0, value = values2[index2], computed = iteratee2 ? iteratee2(value) : value; + while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, lastIndex = length - 1; + while (length--) { + var index2 = indexes[length]; + if (length == lastIndex || index2 !== previous) { + var previous = index2; + if (isIndex(index2)) { + splice.call(array, index2, 1); + } else { + baseUnset(array, index2); + } + } + } + return array; + } + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + function baseRange(start, end2, step, fromRight) { + var index2 = -1, length = nativeMax(nativeCeil((end2 - start) / (step || 1)), 0), result2 = Array2(length); + while (length--) { + result2[fromRight ? length : ++index2] = start; + start += step; + } + return result2; + } + function baseRepeat(string, n2) { + var result2 = ""; + if (!string || n2 < 1 || n2 > MAX_SAFE_INTEGER) { + return result2; + } + do { + if (n2 % 2) { + result2 += string; + } + n2 = nativeFloor(n2 / 2); + if (n2) { + string += string; + } + } while (n2); + return result2; + } + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ""); + } + function baseSample(collection) { + return arraySample(values(collection)); + } + function baseSampleSize(collection, n2) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n2, 0, array.length)); + } + function baseSet(object, path2, value, customizer) { + if (!isObject2(object)) { + return object; + } + path2 = castPath(path2, object); + var index2 = -1, length = path2.length, lastIndex = length - 1, nested = object; + while (nested != null && ++index2 < length) { + var key = toKey(path2[index2]), newValue = value; + if (key === "__proto__" || key === "constructor" || key === "prototype") { + return object; + } + if (index2 != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined2; + if (newValue === undefined2) { + newValue = isObject2(objValue) ? objValue : isIndex(path2[index2 + 1]) ? [] : {}; + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + var baseSetData = !metaMap ? identity : function(func, data2) { + metaMap.set(func, data2); + return func; + }; + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, "toString", { + "configurable": true, + "enumerable": false, + "value": constant(string), + "writable": true + }); + }; + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + function baseSlice(array, start, end2) { + var index2 = -1, length = array.length; + if (start < 0) { + start = -start > length ? 0 : length + start; + } + end2 = end2 > length ? length : end2; + if (end2 < 0) { + end2 += length; + } + length = start > end2 ? 0 : end2 - start >>> 0; + start >>>= 0; + var result2 = Array2(length); + while (++index2 < length) { + result2[index2] = array[index2 + start]; + } + return result2; + } + function baseSome(collection, predicate) { + var result2; + baseEach(collection, function(value, index2, collection2) { + result2 = predicate(value, index2, collection2); + return !result2; + }); + return !!result2; + } + function baseSortedIndex(array, value, retHighest) { + var low = 0, high = array == null ? low : array.length; + if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = low + high >>> 1, computed = array[mid]; + if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + function baseSortedIndexBy(array, value, iteratee2, retHighest) { + var low = 0, high = array == null ? 0 : array.length; + if (high === 0) { + return 0; + } + value = iteratee2(value); + var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined2; + while (low < high) { + var mid = nativeFloor((low + high) / 2), computed = iteratee2(array[mid]), othIsDefined = computed !== undefined2, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed); + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? computed <= value : computed < value; + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + function baseSortedUniq(array, iteratee2) { + var index2 = -1, length = array.length, resIndex = 0, result2 = []; + while (++index2 < length) { + var value = array[index2], computed = iteratee2 ? iteratee2(value) : value; + if (!index2 || !eq2(computed, seen)) { + var seen = computed; + result2[resIndex++] = value === 0 ? 0 : value; + } + } + return result2; + } + function baseToNumber(value) { + if (typeof value == "number") { + return value; + } + if (isSymbol(value)) { + return NAN; + } + return +value; + } + function baseToString(value) { + if (typeof value == "string") { + return value; + } + if (isArray2(value)) { + return arrayMap(value, baseToString) + ""; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ""; + } + var result2 = value + ""; + return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2; + } + function baseUniq(array, iteratee2, comparator) { + var index2 = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2; + if (comparator) { + isCommon = false; + includes2 = arrayIncludesWith; + } else if (length >= LARGE_ARRAY_SIZE) { + var set2 = iteratee2 ? null : createSet(array); + if (set2) { + return setToArray(set2); + } + isCommon = false; + includes2 = cacheHas; + seen = new SetCache(); + } else { + seen = iteratee2 ? [] : result2; + } + outer: + while (++index2 < length) { + var value = array[index2], computed = iteratee2 ? iteratee2(value) : value; + value = comparator || value !== 0 ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee2) { + seen.push(computed); + } + result2.push(value); + } else if (!includes2(seen, computed, comparator)) { + if (seen !== result2) { + seen.push(computed); + } + result2.push(value); + } + } + return result2; + } + function baseUnset(object, path2) { + path2 = castPath(path2, object); + object = parent2(object, path2); + return object == null || delete object[toKey(last2(path2))]; + } + function baseUpdate(object, path2, updater, customizer) { + return baseSet(object, path2, updater(baseGet(object, path2)), customizer); + } + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, index2 = fromRight ? length : -1; + while ((fromRight ? index2-- : ++index2 < length) && predicate(array[index2], index2, array)) { + } + return isDrop ? baseSlice(array, fromRight ? 0 : index2, fromRight ? index2 + 1 : length) : baseSlice(array, fromRight ? index2 + 1 : 0, fromRight ? length : index2); + } + function baseWrapperValue(value, actions) { + var result2 = value; + if (result2 instanceof LazyWrapper) { + result2 = result2.value(); + } + return arrayReduce(actions, function(result3, action) { + return action.func.apply(action.thisArg, arrayPush([result3], action.args)); + }, result2); + } + function baseXor(arrays, iteratee2, comparator) { + var length = arrays.length; + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + var index2 = -1, result2 = Array2(length); + while (++index2 < length) { + var array = arrays[index2], othIndex = -1; + while (++othIndex < length) { + if (othIndex != index2) { + result2[index2] = baseDifference(result2[index2] || array, arrays[othIndex], iteratee2, comparator); + } + } + } + return baseUniq(baseFlatten(result2, 1), iteratee2, comparator); + } + function baseZipObject(props, values2, assignFunc) { + var index2 = -1, length = props.length, valsLength = values2.length, result2 = {}; + while (++index2 < length) { + var value = index2 < valsLength ? values2[index2] : undefined2; + assignFunc(result2, props[index2], value); + } + return result2; + } + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + function castFunction(value) { + return typeof value == "function" ? value : identity; + } + function castPath(value, object) { + if (isArray2(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString4(value)); + } + var castRest = baseRest; + function castSlice(array, start, end2) { + var length = array.length; + end2 = end2 === undefined2 ? length : end2; + return !start && end2 >= length ? array : baseSlice(array, start, end2); + } + var clearTimeout2 = ctxClearTimeout || function(id) { + return root3.clearTimeout(id); + }; + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + buffer.copy(result2); + return result2; + } + function cloneArrayBuffer(arrayBuffer) { + var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer)); + return result2; + } + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + function cloneRegExp(regexp) { + var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result2.lastIndex = regexp.lastIndex; + return result2; + } + function cloneSymbol(symbol) { + return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {}; + } + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined2, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); + var othIsDefined = other !== undefined2, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); + if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { + return 1; + } + if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { + return -1; + } + } + return 0; + } + function compareMultiple(object, other, orders) { + var index2 = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; + while (++index2 < length) { + var result2 = compareAscending(objCriteria[index2], othCriteria[index2]); + if (result2) { + if (index2 >= ordersLength) { + return result2; + } + var order = orders[index2]; + return result2 * (order == "desc" ? -1 : 1); + } + } + return object.index - other.index; + } + function composeArgs(args2, partials, holders, isCurried) { + var argsIndex = -1, argsLength = args2.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried; + while (++leftIndex < leftLength) { + result2[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result2[holders[argsIndex]] = args2[argsIndex]; + } + } + while (rangeLength--) { + result2[leftIndex++] = args2[argsIndex++]; + } + return result2; + } + function composeArgsRight(args2, partials, holders, isCurried) { + var argsIndex = -1, argsLength = args2.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried; + while (++argsIndex < rangeLength) { + result2[argsIndex] = args2[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result2[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result2[offset + holders[holdersIndex]] = args2[argsIndex++]; + } + } + return result2; + } + function copyArray(source, array) { + var index2 = -1, length = source.length; + array || (array = Array2(length)); + while (++index2 < length) { + array[index2] = source[index2]; + } + return array; + } + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + var index2 = -1, length = props.length; + while (++index2 < length) { + var key = props[index2]; + var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined2; + if (newValue === undefined2) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + function createAggregator(setter, initializer) { + return function(collection, iteratee2) { + var func = isArray2(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; + return func(collection, setter, getIteratee(iteratee2, 2), accumulator); + }; + } + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index2 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined2, guard = length > 2 ? sources[2] : undefined2; + customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined2; + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined2 : customizer; + length = 1; + } + object = Object2(object); + while (++index2 < length) { + var source = sources[index2]; + if (source) { + assigner(object, source, index2, customizer); + } + } + return object; + }); + } + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee2) { + if (collection == null) { + return collection; + } + if (!isArrayLike2(collection)) { + return eachFunc(collection, iteratee2); + } + var length = collection.length, index2 = fromRight ? length : -1, iterable = Object2(collection); + while (fromRight ? index2-- : ++index2 < length) { + if (iteratee2(iterable[index2], index2, iterable) === false) { + break; + } + } + return collection; + }; + } + function createBaseFor(fromRight) { + return function(object, iteratee2, keysFunc) { + var index2 = -1, iterable = Object2(object), props = keysFunc(object), length = props.length; + while (length--) { + var key = props[fromRight ? length : ++index2]; + if (iteratee2(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); + function wrapper() { + var fn2 = this && this !== root3 && this instanceof wrapper ? Ctor : func; + return fn2.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + function createCaseFirst(methodName) { + return function(string) { + string = toString4(string); + var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined2; + var chr = strSymbols ? strSymbols[0] : string.charAt(0); + var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1); + return chr[methodName]() + trailing; + }; + } + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, "")), callback, ""); + }; + } + function createCtor(Ctor) { + return function() { + var args2 = arguments; + switch (args2.length) { + case 0: + return new Ctor(); + case 1: + return new Ctor(args2[0]); + case 2: + return new Ctor(args2[0], args2[1]); + case 3: + return new Ctor(args2[0], args2[1], args2[2]); + case 4: + return new Ctor(args2[0], args2[1], args2[2], args2[3]); + case 5: + return new Ctor(args2[0], args2[1], args2[2], args2[3], args2[4]); + case 6: + return new Ctor(args2[0], args2[1], args2[2], args2[3], args2[4], args2[5]); + case 7: + return new Ctor(args2[0], args2[1], args2[2], args2[3], args2[4], args2[5], args2[6]); + } + var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args2); + return isObject2(result2) ? result2 : thisBinding; + }; + } + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + function wrapper() { + var length = arguments.length, args2 = Array2(length), index2 = length, placeholder = getHolder(wrapper); + while (index2--) { + args2[index2] = arguments[index2]; + } + var holders = length < 3 && args2[0] !== placeholder && args2[length - 1] !== placeholder ? [] : replaceHolders(args2, placeholder); + length -= holders.length; + if (length < arity) { + return createRecurry( + func, + bitmask, + createHybrid, + wrapper.placeholder, + undefined2, + args2, + holders, + undefined2, + undefined2, + arity - length + ); + } + var fn2 = this && this !== root3 && this instanceof wrapper ? Ctor : func; + return apply(fn2, this, args2); + } + return wrapper; + } + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object2(collection); + if (!isArrayLike2(collection)) { + var iteratee2 = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { + return iteratee2(iterable[key], key, iterable); + }; + } + var index2 = findIndexFunc(collection, predicate, fromIndex); + return index2 > -1 ? iterable[iteratee2 ? collection[index2] : index2] : undefined2; + }; + } + function createFlow(fromRight) { + return flatRest(function(funcs) { + var length = funcs.length, index2 = length, prereq = LodashWrapper.prototype.thru; + if (fromRight) { + funcs.reverse(); + } + while (index2--) { + var func = funcs[index2]; + if (typeof func != "function") { + throw new TypeError2(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == "wrapper") { + var wrapper = new LodashWrapper([], true); + } + } + index2 = wrapper ? index2 : length; + while (++index2 < length) { + func = funcs[index2]; + var funcName = getFuncName(func), data2 = funcName == "wrapper" ? getData(func) : undefined2; + if (data2 && isLaziable(data2[0]) && data2[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data2[4].length && data2[9] == 1) { + wrapper = wrapper[getFuncName(data2[0])].apply(wrapper, data2[3]); + } else { + wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func); + } + } + return function() { + var args2 = arguments, value = args2[0]; + if (wrapper && args2.length == 1 && isArray2(value)) { + return wrapper.plant(value).value(); + } + var index3 = 0, result2 = length ? funcs[index3].apply(this, args2) : value; + while (++index3 < length) { + result2 = funcs[index3].call(this, result2); + } + return result2; + }; + }); + } + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined2 : createCtor(func); + function wrapper() { + var length = arguments.length, args2 = Array2(length), index2 = length; + while (index2--) { + args2[index2] = arguments[index2]; + } + if (isCurried) { + var placeholder = getHolder(wrapper), holdersCount = countHolders(args2, placeholder); + } + if (partials) { + args2 = composeArgs(args2, partials, holders, isCurried); + } + if (partialsRight) { + args2 = composeArgsRight(args2, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args2, placeholder); + return createRecurry( + func, + bitmask, + createHybrid, + wrapper.placeholder, + thisArg, + args2, + newHolders, + argPos, + ary2, + arity - length + ); + } + var thisBinding = isBind ? thisArg : this, fn2 = isBindKey ? thisBinding[func] : func; + length = args2.length; + if (argPos) { + args2 = reorder(args2, argPos); + } else if (isFlip && length > 1) { + args2.reverse(); + } + if (isAry && ary2 < length) { + args2.length = ary2; + } + if (this && this !== root3 && this instanceof wrapper) { + fn2 = Ctor || createCtor(fn2); + } + return fn2.apply(thisBinding, args2); + } + return wrapper; + } + function createInverter(setter, toIteratee) { + return function(object, iteratee2) { + return baseInverter(object, setter, toIteratee(iteratee2), {}); + }; + } + function createMathOperation(operator, defaultValue) { + return function(value, other) { + var result2; + if (value === undefined2 && other === undefined2) { + return defaultValue; + } + if (value !== undefined2) { + result2 = value; + } + if (other !== undefined2) { + if (result2 === undefined2) { + return other; + } + if (typeof value == "string" || typeof other == "string") { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + result2 = operator(value, other); + } + return result2; + }; + } + function createOver(arrayFunc) { + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function(args2) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee2) { + return apply(iteratee2, thisArg, args2); + }); + }); + }); + } + function createPadding(length, chars) { + chars = chars === undefined2 ? " " : baseToString(chars); + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length); + } + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); + function wrapper() { + var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args2 = Array2(leftLength + argsLength), fn2 = this && this !== root3 && this instanceof wrapper ? Ctor : func; + while (++leftIndex < leftLength) { + args2[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args2[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn2, isBind ? thisArg : this, args2); + } + return wrapper; + } + function createRange(fromRight) { + return function(start, end2, step) { + if (step && typeof step != "number" && isIterateeCall(start, end2, step)) { + end2 = step = undefined2; + } + start = toFinite(start); + if (end2 === undefined2) { + end2 = start; + start = 0; + } else { + end2 = toFinite(end2); + } + step = step === undefined2 ? start < end2 ? 1 : -1 : toFinite(step); + return baseRange(start, end2, step, fromRight); + }; + } + function createRelationalOperation(operator) { + return function(value, other) { + if (!(typeof value == "string" && typeof other == "string")) { + value = toNumber(value); + other = toNumber(other); + } + return operator(value, other); + }; + } + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined2, newHoldersRight = isCurry ? undefined2 : holders, newPartials = isCurry ? partials : undefined2, newPartialsRight = isCurry ? undefined2 : partials; + bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG; + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); + } + var newData = [ + func, + bitmask, + thisArg, + newPartials, + newHolders, + newPartialsRight, + newHoldersRight, + argPos, + ary2, + arity + ]; + var result2 = wrapFunc.apply(undefined2, newData); + if (isLaziable(func)) { + setData2(result2, newData); + } + result2.placeholder = placeholder; + return setWrapToString(result2, func, bitmask); + } + function createRound(methodName) { + var func = Math2[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + if (precision && nativeIsFinite(number)) { + var pair = (toString4(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision)); + pair = (toString4(value) + "e").split("e"); + return +(pair[0] + "e" + (+pair[1] - precision)); + } + return func(number); + }; + } + var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop2 : function(values2) { + return new Set2(values2); + }; + function createToPairs(keysFunc) { + return function(object) { + var tag = getTag(object); + if (tag == mapTag) { + return mapToArray(object); + } + if (tag == setTag) { + return setToPairs(object); + } + return baseToPairs(object, keysFunc(object)); + }; + } + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + if (!isBindKey && typeof func != "function") { + throw new TypeError2(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); + partials = holders = undefined2; + } + ary2 = ary2 === undefined2 ? ary2 : nativeMax(toInteger(ary2), 0); + arity = arity === undefined2 ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, holdersRight = holders; + partials = holders = undefined2; + } + var data2 = isBindKey ? undefined2 : getData(func); + var newData = [ + func, + bitmask, + thisArg, + partials, + holders, + partialsRight, + holdersRight, + argPos, + ary2, + arity + ]; + if (data2) { + mergeData(newData, data2); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined2 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0); + if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { + bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result2 = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result2 = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { + result2 = createPartial(func, bitmask, thisArg, partials); + } else { + result2 = createHybrid.apply(undefined2, newData); + } + var setter = data2 ? baseSetData : setData2; + return setWrapToString(setter(result2, newData), func, bitmask); + } + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined2 || eq2(objValue, objectProto[key]) && !hasOwnProperty2.call(object, key)) { + return srcValue; + } + return objValue; + } + function customDefaultsMerge(objValue, srcValue, key, object, source, stack2) { + if (isObject2(objValue) && isObject2(srcValue)) { + stack2.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack2); + stack2["delete"](srcValue); + } + return objValue; + } + function customOmitClone(value) { + return isPlainObject2(value) ? undefined2 : value; + } + function equalArrays(array, other, bitmask, customizer, equalFunc, stack2) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + var arrStacked = stack2.get(array); + var othStacked = stack2.get(other); + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + var index2 = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined2; + stack2.set(array, other); + stack2.set(other, array); + while (++index2 < arrLength) { + var arrValue = array[index2], othValue = other[index2]; + if (customizer) { + var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack2) : customizer(arrValue, othValue, index2, array, other, stack2); + } + if (compared !== undefined2) { + if (compared) { + continue; + } + result2 = false; + break; + } + if (seen) { + if (!arraySome(other, function(othValue2, othIndex) { + if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack2))) { + return seen.push(othIndex); + } + })) { + result2 = false; + break; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack2))) { + result2 = false; + break; + } + } + stack2["delete"](array); + stack2["delete"](other); + return result2; + } + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack2) { + switch (tag) { + case dataViewTag: + if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { + return false; + } + object = object.buffer; + other = other.buffer; + case arrayBufferTag: + if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) { + return false; + } + return true; + case boolTag: + case dateTag: + case numberTag: + return eq2(+object, +other); + case errorTag: + return object.name == other.name && object.message == other.message; + case regexpTag: + case stringTag: + return object == other + ""; + case mapTag: + var convert = mapToArray; + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + if (object.size != other.size && !isPartial) { + return false; + } + var stacked = stack2.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= COMPARE_UNORDERED_FLAG; + stack2.set(object, other); + var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack2); + stack2["delete"](object); + return result2; + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + function equalObjects(object, other, bitmask, customizer, equalFunc, stack2) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; + if (objLength != othLength && !isPartial) { + return false; + } + var index2 = objLength; + while (index2--) { + var key = objProps[index2]; + if (!(isPartial ? key in other : hasOwnProperty2.call(other, key))) { + return false; + } + } + var objStacked = stack2.get(object); + var othStacked = stack2.get(other); + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + var result2 = true; + stack2.set(object, other); + stack2.set(other, object); + var skipCtor = isPartial; + while (++index2 < objLength) { + key = objProps[index2]; + var objValue = object[key], othValue = other[key]; + if (customizer) { + var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack2) : customizer(objValue, othValue, key, object, other, stack2); + } + if (!(compared === undefined2 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack2) : compared)) { + result2 = false; + break; + } + skipCtor || (skipCtor = key == "constructor"); + } + if (result2 && !skipCtor) { + var objCtor = object.constructor, othCtor = other.constructor; + if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { + result2 = false; + } + } + stack2["delete"](object); + stack2["delete"](other); + return result2; + } + function flatRest(func) { + return setToString(overRest(func, undefined2, flatten2), func + ""); + } + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + var getData = !metaMap ? noop2 : function(func) { + return metaMap.get(func); + }; + function getFuncName(func) { + var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty2.call(realNames, result2) ? array.length : 0; + while (length--) { + var data2 = array[length], otherFunc = data2.func; + if (otherFunc == null || otherFunc == func) { + return data2.name; + } + } + return result2; + } + function getHolder(func) { + var object = hasOwnProperty2.call(lodash16, "placeholder") ? lodash16 : func; + return object.placeholder; + } + function getIteratee() { + var result2 = lodash16.iteratee || iteratee; + result2 = result2 === iteratee ? baseIteratee : result2; + return arguments.length ? result2(arguments[0], arguments[1]) : result2; + } + function getMapData(map3, key) { + var data2 = map3.__data__; + return isKeyable(key) ? data2[typeof key == "string" ? "string" : "hash"] : data2.map; + } + function getMatchData(object) { + var result2 = keys(object), length = result2.length; + while (length--) { + var key = result2[length], value = object[key]; + result2[length] = [key, value, isStrictComparable(value)]; + } + return result2; + } + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined2; + } + function getRawTag(value) { + var isOwn = hasOwnProperty2.call(value, symToStringTag), tag = value[symToStringTag]; + try { + value[symToStringTag] = undefined2; + var unmasked = true; + } catch (e) { + } + var result2 = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result2; + } + var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + if (object == null) { + return []; + } + object = Object2(object); + return arrayFilter(nativeGetSymbols(object), function(symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var result2 = []; + while (object) { + arrayPush(result2, getSymbols(object)); + object = getPrototype(object); + } + return result2; + }; + var getTag = baseGetTag; + if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) { + getTag = function(value) { + var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined2, ctorString = Ctor ? toSource(Ctor) : ""; + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: + return dataViewTag; + case mapCtorString: + return mapTag; + case promiseCtorString: + return promiseTag; + case setCtorString: + return setTag; + case weakMapCtorString: + return weakMapTag; + } + } + return result2; + }; + } + function getView(start, end2, transforms) { + var index2 = -1, length = transforms.length; + while (++index2 < length) { + var data2 = transforms[index2], size2 = data2.size; + switch (data2.type) { + case "drop": + start += size2; + break; + case "dropRight": + end2 -= size2; + break; + case "take": + end2 = nativeMin(end2, start + size2); + break; + case "takeRight": + start = nativeMax(start, end2 - size2); + break; + } + } + return { "start": start, "end": end2 }; + } + function getWrapDetails(source) { + var match2 = source.match(reWrapDetails); + return match2 ? match2[1].split(reSplitDetails) : []; + } + function hasPath(object, path2, hasFunc) { + path2 = castPath(path2, object); + var index2 = -1, length = path2.length, result2 = false; + while (++index2 < length) { + var key = toKey(path2[index2]); + if (!(result2 = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result2 || ++index2 != length) { + return result2; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && (isArray2(object) || isArguments(object)); + } + function initCloneArray(array) { + var length = array.length, result2 = new array.constructor(length); + if (length && typeof array[0] == "string" && hasOwnProperty2.call(array, "index")) { + result2.index = array.index; + result2.input = array.input; + } + return result2; + } + function initCloneObject(object) { + return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; + } + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + case boolTag: + case dateTag: + return new Ctor(+object); + case dataViewTag: + return cloneDataView(object, isDeep); + case float32Tag: + case float64Tag: + case int8Tag: + case int16Tag: + case int32Tag: + case uint8Tag: + case uint8ClampedTag: + case uint16Tag: + case uint32Tag: + return cloneTypedArray(object, isDeep); + case mapTag: + return new Ctor(); + case numberTag: + case stringTag: + return new Ctor(object); + case regexpTag: + return cloneRegExp(object); + case setTag: + return new Ctor(); + case symbolTag: + return cloneSymbol(object); + } + } + function insertWrapDetails(source, details) { + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex]; + details = details.join(length > 2 ? ", " : " "); + return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n"); + } + function isFlattenable(value) { + return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); + } + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); + } + function isIterateeCall(value, index2, object) { + if (!isObject2(object)) { + return false; + } + var type = typeof index2; + if (type == "number" ? isArrayLike2(object) && isIndex(index2, object.length) : type == "string" && index2 in object) { + return eq2(object[index2], value); + } + return false; + } + function isKey(value, object) { + if (isArray2(value)) { + return false; + } + var type = typeof value; + if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object); + } + function isKeyable(value) { + var type = typeof value; + return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; + } + function isLaziable(func) { + var funcName = getFuncName(func), other = lodash16[funcName]; + if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data2 = getData(other); + return !!data2 && func === data2[0]; + } + function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; + } + var isMaskable = coreJsData ? isFunction2 : stubFalse; + function isPrototype(value) { + var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; + return value === proto; + } + function isStrictComparable(value) { + return value === value && !isObject2(value); + } + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && (srcValue !== undefined2 || key in Object2(object)); + }; + } + function memoizeCapped(func) { + var result2 = memoize4(func, function(key) { + if (cache2.size === MAX_MEMOIZE_SIZE) { + cache2.clear(); + } + return key; + }); + var cache2 = result2.cache; + return result2; + } + function mergeData(data2, source) { + var bitmask = data2[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data2[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG; + if (!(isCommon || isCombo)) { + return data2; + } + if (srcBitmask & WRAP_BIND_FLAG) { + data2[2] = source[2]; + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + var value = source[3]; + if (value) { + var partials = data2[3]; + data2[3] = partials ? composeArgs(partials, value, source[4]) : value; + data2[4] = partials ? replaceHolders(data2[3], PLACEHOLDER) : source[4]; + } + value = source[5]; + if (value) { + partials = data2[5]; + data2[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data2[6] = partials ? replaceHolders(data2[5], PLACEHOLDER) : source[6]; + } + value = source[7]; + if (value) { + data2[7] = value; + } + if (srcBitmask & WRAP_ARY_FLAG) { + data2[8] = data2[8] == null ? source[8] : nativeMin(data2[8], source[8]); + } + if (data2[9] == null) { + data2[9] = source[9]; + } + data2[0] = source[0]; + data2[1] = newBitmask; + return data2; + } + function nativeKeysIn(object) { + var result2 = []; + if (object != null) { + for (var key in Object2(object)) { + result2.push(key); + } + } + return result2; + } + function objectToString(value) { + return nativeObjectToString.call(value); + } + function overRest(func, start, transform4) { + start = nativeMax(start === undefined2 ? func.length - 1 : start, 0); + return function() { + var args2 = arguments, index2 = -1, length = nativeMax(args2.length - start, 0), array = Array2(length); + while (++index2 < length) { + array[index2] = args2[start + index2]; + } + index2 = -1; + var otherArgs = Array2(start + 1); + while (++index2 < start) { + otherArgs[index2] = args2[index2]; + } + otherArgs[start] = transform4(array); + return apply(func, this, otherArgs); + }; + } + function parent2(object, path2) { + return path2.length < 2 ? object : baseGet(object, baseSlice(path2, 0, -1)); + } + function reorder(array, indexes) { + var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); + while (length--) { + var index2 = indexes[length]; + array[length] = isIndex(index2, arrLength) ? oldArray[index2] : undefined2; + } + return array; + } + function safeGet(object, key) { + if (key === "constructor" && typeof object[key] === "function") { + return; + } + if (key == "__proto__") { + return; + } + return object[key]; + } + var setData2 = shortOut(baseSetData); + var setTimeout2 = ctxSetTimeout || function(func, wait) { + return root3.setTimeout(func, wait); + }; + var setToString = shortOut(baseSetToString); + function setWrapToString(wrapper, reference, bitmask) { + var source = reference + ""; + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + function shortOut(func) { + var count = 0, lastCalled = 0; + return function() { + var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined2, arguments); + }; + } + function shuffleSelf(array, size2) { + var index2 = -1, length = array.length, lastIndex = length - 1; + size2 = size2 === undefined2 ? length : size2; + while (++index2 < size2) { + var rand = baseRandom(index2, lastIndex), value = array[rand]; + array[rand] = array[index2]; + array[index2] = value; + } + array.length = size2; + return array; + } + var stringToPath = memoizeCapped(function(string) { + var result2 = []; + if (string.charCodeAt(0) === 46) { + result2.push(""); + } + string.replace(rePropName, function(match2, number, quote, subString) { + result2.push(quote ? subString.replace(reEscapeChar, "$1") : number || match2); + }); + return result2; + }); + function toKey(value) { + if (typeof value == "string" || isSymbol(value)) { + return value; + } + var result2 = value + ""; + return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2; + } + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) { + } + try { + return func + ""; + } catch (e) { + } + } + return ""; + } + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = "_." + pair[0]; + if (bitmask & pair[1] && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result2.__actions__ = copyArray(wrapper.__actions__); + result2.__index__ = wrapper.__index__; + result2.__values__ = wrapper.__values__; + return result2; + } + function chunk(array, size2, guard) { + if (guard ? isIterateeCall(array, size2, guard) : size2 === undefined2) { + size2 = 1; + } else { + size2 = nativeMax(toInteger(size2), 0); + } + var length = array == null ? 0 : array.length; + if (!length || size2 < 1) { + return []; + } + var index2 = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2)); + while (index2 < length) { + result2[resIndex++] = baseSlice(array, index2, index2 += size2); + } + return result2; + } + function compact(array) { + var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = []; + while (++index2 < length) { + var value = array[index2]; + if (value) { + result2[resIndex++] = value; + } + } + return result2; + } + function concat() { + var length = arguments.length; + if (!length) { + return []; + } + var args2 = Array2(length - 1), array = arguments[0], index2 = length; + while (index2--) { + args2[index2 - 1] = arguments[index2]; + } + return arrayPush(isArray2(array) ? copyArray(array) : [array], baseFlatten(args2, 1)); + } + var difference = baseRest(function(array, values2) { + return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : []; + }); + var differenceBy = baseRest(function(array, values2) { + var iteratee2 = last2(values2); + if (isArrayLikeObject(iteratee2)) { + iteratee2 = undefined2; + } + return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : []; + }); + var differenceWith = baseRest(function(array, values2) { + var comparator = last2(values2); + if (isArrayLikeObject(comparator)) { + comparator = undefined2; + } + return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined2, comparator) : []; + }); + function drop(array, n2, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n2 = guard || n2 === undefined2 ? 1 : toInteger(n2); + return baseSlice(array, n2 < 0 ? 0 : n2, length); + } + function dropRight(array, n2, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n2 = guard || n2 === undefined2 ? 1 : toInteger(n2); + n2 = length - n2; + return baseSlice(array, 0, n2 < 0 ? 0 : n2); + } + function dropRightWhile(array, predicate) { + return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; + } + function dropWhile(array, predicate) { + return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : []; + } + function fill(array, value, start, end2) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (start && typeof start != "number" && isIterateeCall(array, value, start)) { + start = 0; + end2 = length; + } + return baseFill(array, value, start, end2); + } + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index2 = fromIndex == null ? 0 : toInteger(fromIndex); + if (index2 < 0) { + index2 = nativeMax(length + index2, 0); + } + return baseFindIndex(array, getIteratee(predicate, 3), index2); + } + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index2 = length - 1; + if (fromIndex !== undefined2) { + index2 = toInteger(fromIndex); + index2 = fromIndex < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1); + } + return baseFindIndex(array, getIteratee(predicate, 3), index2, true); + } + function flatten2(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + depth = depth === undefined2 ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + function fromPairs(pairs) { + var index2 = -1, length = pairs == null ? 0 : pairs.length, result2 = {}; + while (++index2 < length) { + var pair = pairs[index2]; + result2[pair[0]] = pair[1]; + } + return result2; + } + function head(array) { + return array && array.length ? array[0] : undefined2; + } + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index2 = fromIndex == null ? 0 : toInteger(fromIndex); + if (index2 < 0) { + index2 = nativeMax(length + index2, 0); + } + return baseIndexOf(array, value, index2); + } + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + var intersection = baseRest(function(arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : []; + }); + var intersectionBy = baseRest(function(arrays) { + var iteratee2 = last2(arrays), mapped = arrayMap(arrays, castArrayLikeObject); + if (iteratee2 === last2(mapped)) { + iteratee2 = undefined2; + } else { + mapped.pop(); + } + return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : []; + }); + var intersectionWith = baseRest(function(arrays) { + var comparator = last2(arrays), mapped = arrayMap(arrays, castArrayLikeObject); + comparator = typeof comparator == "function" ? comparator : undefined2; + if (comparator) { + mapped.pop(); + } + return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : []; + }); + function join17(array, separator) { + return array == null ? "" : nativeJoin.call(array, separator); + } + function last2(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined2; + } + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + if (!length) { + return -1; + } + var index2 = length; + if (fromIndex !== undefined2) { + index2 = toInteger(fromIndex); + index2 = index2 < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1); + } + return value === value ? strictLastIndexOf(array, value, index2) : baseFindIndex(array, baseIsNaN, index2, true); + } + function nth(array, n2) { + return array && array.length ? baseNth(array, toInteger(n2)) : undefined2; + } + var pull = baseRest(pullAll); + function pullAll(array, values2) { + return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array; + } + function pullAllBy(array, values2, iteratee2) { + return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array; + } + function pullAllWith(array, values2, comparator) { + return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined2, comparator) : array; + } + var pullAt = flatRest(function(array, indexes) { + var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes); + basePullAt(array, arrayMap(indexes, function(index2) { + return isIndex(index2, length) ? +index2 : index2; + }).sort(compareAscending)); + return result2; + }); + function remove2(array, predicate) { + var result2 = []; + if (!(array && array.length)) { + return result2; + } + var index2 = -1, indexes = [], length = array.length; + predicate = getIteratee(predicate, 3); + while (++index2 < length) { + var value = array[index2]; + if (predicate(value, index2, array)) { + result2.push(value); + indexes.push(index2); + } + } + basePullAt(array, indexes); + return result2; + } + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + function slice2(array, start, end2) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + if (end2 && typeof end2 != "number" && isIterateeCall(array, start, end2)) { + start = 0; + end2 = length; + } else { + start = start == null ? 0 : toInteger(start); + end2 = end2 === undefined2 ? length : toInteger(end2); + } + return baseSlice(array, start, end2); + } + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + function sortedIndexBy(array, value, iteratee2) { + return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2)); + } + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index2 = baseSortedIndex(array, value); + if (index2 < length && eq2(array[index2], value)) { + return index2; + } + } + return -1; + } + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + function sortedLastIndexBy(array, value, iteratee2) { + return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true); + } + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + if (length) { + var index2 = baseSortedIndex(array, value, true) - 1; + if (eq2(array[index2], value)) { + return index2; + } + } + return -1; + } + function sortedUniq(array) { + return array && array.length ? baseSortedUniq(array) : []; + } + function sortedUniqBy(array, iteratee2) { + return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : []; + } + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + function take2(array, n2, guard) { + if (!(array && array.length)) { + return []; + } + n2 = guard || n2 === undefined2 ? 1 : toInteger(n2); + return baseSlice(array, 0, n2 < 0 ? 0 : n2); + } + function takeRight(array, n2, guard) { + var length = array == null ? 0 : array.length; + if (!length) { + return []; + } + n2 = guard || n2 === undefined2 ? 1 : toInteger(n2); + n2 = length - n2; + return baseSlice(array, n2 < 0 ? 0 : n2, length); + } + function takeRightWhile(array, predicate) { + return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; + } + function takeWhile(array, predicate) { + return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : []; + } + var union = baseRest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + var unionBy = baseRest(function(arrays) { + var iteratee2 = last2(arrays); + if (isArrayLikeObject(iteratee2)) { + iteratee2 = undefined2; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)); + }); + var unionWith = baseRest(function(arrays) { + var comparator = last2(arrays); + comparator = typeof comparator == "function" ? comparator : undefined2; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined2, comparator); + }); + function uniq4(array) { + return array && array.length ? baseUniq(array) : []; + } + function uniqBy(array, iteratee2) { + return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : []; + } + function uniqWith(array, comparator) { + comparator = typeof comparator == "function" ? comparator : undefined2; + return array && array.length ? baseUniq(array, undefined2, comparator) : []; + } + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index2) { + return arrayMap(array, baseProperty(index2)); + }); + } + function unzipWith(array, iteratee2) { + if (!(array && array.length)) { + return []; + } + var result2 = unzip(array); + if (iteratee2 == null) { + return result2; + } + return arrayMap(result2, function(group) { + return apply(iteratee2, undefined2, group); + }); + } + var without = baseRest(function(array, values2) { + return isArrayLikeObject(array) ? baseDifference(array, values2) : []; + }); + var xor = baseRest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + var xorBy = baseRest(function(arrays) { + var iteratee2 = last2(arrays); + if (isArrayLikeObject(iteratee2)) { + iteratee2 = undefined2; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2)); + }); + var xorWith = baseRest(function(arrays) { + var comparator = last2(arrays); + comparator = typeof comparator == "function" ? comparator : undefined2; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined2, comparator); + }); + var zip = baseRest(unzip); + function zipObject(props, values2) { + return baseZipObject(props || [], values2 || [], assignValue); + } + function zipObjectDeep(props, values2) { + return baseZipObject(props || [], values2 || [], baseSet); + } + var zipWith = baseRest(function(arrays) { + var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined2; + iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined2; + return unzipWith(arrays, iteratee2); + }); + function chain2(value) { + var result2 = lodash16(value); + result2.__chain__ = true; + return result2; + } + function tap(value, interceptor) { + interceptor(value); + return value; + } + function thru(value, interceptor) { + return interceptor(value); + } + var wrapperAt = flatRest(function(paths) { + var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { + return baseAt(object, paths); + }; + if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + "func": thru, + "args": [interceptor], + "thisArg": undefined2 + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined2); + } + return array; + }); + }); + function wrapperChain() { + return chain2(this); + } + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + function wrapperNext() { + if (this.__values__ === undefined2) { + this.__values__ = toArray3(this.value()); + } + var done = this.__index__ >= this.__values__.length, value = done ? undefined2 : this.__values__[this.__index__++]; + return { "done": done, "value": value }; + } + function wrapperToIterator() { + return this; + } + function wrapperPlant(value) { + var result2, parent3 = this; + while (parent3 instanceof baseLodash) { + var clone3 = wrapperClone(parent3); + clone3.__index__ = 0; + clone3.__values__ = undefined2; + if (result2) { + previous.__wrapped__ = clone3; + } else { + result2 = clone3; + } + var previous = clone3; + parent3 = parent3.__wrapped__; + } + previous.__wrapped__ = value; + return result2; + } + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + "func": thru, + "args": [reverse], + "thisArg": undefined2 + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + var countBy = createAggregator(function(result2, value, key) { + if (hasOwnProperty2.call(result2, key)) { + ++result2[key]; + } else { + baseAssignValue(result2, key, 1); + } + }); + function every(collection, predicate, guard) { + var func = isArray2(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined2; + } + return func(collection, getIteratee(predicate, 3)); + } + function filter6(collection, predicate) { + var func = isArray2(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + var find4 = createFind(findIndex); + var findLast = createFind(findLastIndex); + function flatMap(collection, iteratee2) { + return baseFlatten(map2(collection, iteratee2), 1); + } + function flatMapDeep(collection, iteratee2) { + return baseFlatten(map2(collection, iteratee2), INFINITY); + } + function flatMapDepth(collection, iteratee2, depth) { + depth = depth === undefined2 ? 1 : toInteger(depth); + return baseFlatten(map2(collection, iteratee2), depth); + } + function forEach2(collection, iteratee2) { + var func = isArray2(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee2, 3)); + } + function forEachRight(collection, iteratee2) { + var func = isArray2(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee2, 3)); + } + var groupBy = createAggregator(function(result2, value, key) { + if (hasOwnProperty2.call(result2, key)) { + result2[key].push(value); + } else { + baseAssignValue(result2, key, [value]); + } + }); + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike2(collection) ? collection : values(collection); + fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString2(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; + } + var invokeMap = baseRest(function(collection, path2, args2) { + var index2 = -1, isFunc = typeof path2 == "function", result2 = isArrayLike2(collection) ? Array2(collection.length) : []; + baseEach(collection, function(value) { + result2[++index2] = isFunc ? apply(path2, value, args2) : baseInvoke(value, path2, args2); + }); + return result2; + }); + var keyBy = createAggregator(function(result2, value, key) { + baseAssignValue(result2, key, value); + }); + function map2(collection, iteratee2) { + var func = isArray2(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee2, 3)); + } + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray2(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined2 : orders; + if (!isArray2(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + var partition2 = createAggregator(function(result2, value, key) { + result2[key ? 0 : 1].push(value); + }, function() { + return [[], []]; + }); + function reduce(collection, iteratee2, accumulator) { + var func = isArray2(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; + return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach); + } + function reduceRight(collection, iteratee2, accumulator) { + var func = isArray2(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; + return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight); + } + function reject(collection, predicate) { + var func = isArray2(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + function sample(collection) { + var func = isArray2(collection) ? arraySample : baseSample; + return func(collection); + } + function sampleSize(collection, n2, guard) { + if (guard ? isIterateeCall(collection, n2, guard) : n2 === undefined2) { + n2 = 1; + } else { + n2 = toInteger(n2); + } + var func = isArray2(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n2); + } + function shuffle(collection) { + var func = isArray2(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike2(collection)) { + return isString2(collection) ? stringSize(collection) : collection.length; + } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + return baseKeys(collection).length; + } + function some2(collection, predicate, guard) { + var func = isArray2(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined2; + } + return func(collection, getIteratee(predicate, 3)); + } + var sortBy = baseRest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + var now = ctxNow || function() { + return root3.Date.now(); + }; + function after2(n2, func) { + if (typeof func != "function") { + throw new TypeError2(FUNC_ERROR_TEXT); + } + n2 = toInteger(n2); + return function() { + if (--n2 < 1) { + return func.apply(this, arguments); + } + }; + } + function ary(func, n2, guard) { + n2 = guard ? undefined2 : n2; + n2 = func && n2 == null ? func.length : n2; + return createWrap(func, WRAP_ARY_FLAG, undefined2, undefined2, undefined2, undefined2, n2); + } + function before2(n2, func) { + var result2; + if (typeof func != "function") { + throw new TypeError2(FUNC_ERROR_TEXT); + } + n2 = toInteger(n2); + return function() { + if (--n2 > 0) { + result2 = func.apply(this, arguments); + } + if (n2 <= 1) { + func = undefined2; + } + return result2; + }; + } + var bind2 = baseRest(function(func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind2)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(func, bitmask, thisArg, partials, holders); + }); + var bindKey = baseRest(function(object, key, partials) { + var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + return createWrap(key, bitmask, object, partials, holders); + }); + function curry(func, arity, guard) { + arity = guard ? undefined2 : arity; + var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity); + result2.placeholder = curry.placeholder; + return result2; + } + function curryRight(func, arity, guard) { + arity = guard ? undefined2 : arity; + var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity); + result2.placeholder = curryRight.placeholder; + return result2; + } + function debounce(func, wait, options) { + var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; + if (typeof func != "function") { + throw new TypeError2(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject2(options)) { + leading = !!options.leading; + maxing = "maxWait" in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = "trailing" in options ? !!options.trailing : trailing; + } + function invokeFunc(time) { + var args2 = lastArgs, thisArg = lastThis; + lastArgs = lastThis = undefined2; + lastInvokeTime = time; + result2 = func.apply(thisArg, args2); + return result2; + } + function leadingEdge(time) { + lastInvokeTime = time; + timerId = setTimeout2(timerExpired, wait); + return leading ? invokeFunc(time) : result2; + } + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; + return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; + } + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; + return lastCallTime === undefined2 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; + } + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + timerId = setTimeout2(timerExpired, remainingWait(time)); + } + function trailingEdge(time) { + timerId = undefined2; + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined2; + return result2; + } + function cancel() { + if (timerId !== undefined2) { + clearTimeout2(timerId); + } + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined2; + } + function flush() { + return timerId === undefined2 ? result2 : trailingEdge(now()); + } + function debounced() { + var time = now(), isInvoking = shouldInvoke(time); + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + if (isInvoking) { + if (timerId === undefined2) { + return leadingEdge(lastCallTime); + } + if (maxing) { + clearTimeout2(timerId); + timerId = setTimeout2(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + if (timerId === undefined2) { + timerId = setTimeout2(timerExpired, wait); + } + return result2; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + var defer2 = baseRest(function(func, args2) { + return baseDelay(func, 1, args2); + }); + var delay = baseRest(function(func, wait, args2) { + return baseDelay(func, toNumber(wait) || 0, args2); + }); + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + function memoize4(func, resolver) { + if (typeof func != "function" || resolver != null && typeof resolver != "function") { + throw new TypeError2(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args2 = arguments, key = resolver ? resolver.apply(this, args2) : args2[0], cache2 = memoized.cache; + if (cache2.has(key)) { + return cache2.get(key); + } + var result2 = func.apply(this, args2); + memoized.cache = cache2.set(key, result2) || cache2; + return result2; + }; + memoized.cache = new (memoize4.Cache || MapCache)(); + return memoized; + } + memoize4.Cache = MapCache; + function negate(predicate) { + if (typeof predicate != "function") { + throw new TypeError2(FUNC_ERROR_TEXT); + } + return function() { + var args2 = arguments; + switch (args2.length) { + case 0: + return !predicate.call(this); + case 1: + return !predicate.call(this, args2[0]); + case 2: + return !predicate.call(this, args2[0], args2[1]); + case 3: + return !predicate.call(this, args2[0], args2[1], args2[2]); + } + return !predicate.apply(this, args2); + }; + } + function once8(func) { + return before2(2, func); + } + var overArgs = castRest(function(func, transforms) { + transforms = transforms.length == 1 && isArray2(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + var funcsLength = transforms.length; + return baseRest(function(args2) { + var index2 = -1, length = nativeMin(args2.length, funcsLength); + while (++index2 < length) { + args2[index2] = transforms[index2].call(this, args2[index2]); + } + return apply(func, this, args2); + }); + }); + var partial = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined2, partials, holders); + }); + var partialRight = baseRest(function(func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined2, partials, holders); + }); + var rearg = flatRest(function(func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined2, undefined2, undefined2, indexes); + }); + function rest(func, start) { + if (typeof func != "function") { + throw new TypeError2(FUNC_ERROR_TEXT); + } + start = start === undefined2 ? start : toInteger(start); + return baseRest(func, start); + } + function spread3(func, start) { + if (typeof func != "function") { + throw new TypeError2(FUNC_ERROR_TEXT); + } + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function(args2) { + var array = args2[start], otherArgs = castSlice(args2, 0, start); + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + function throttle2(func, wait, options) { + var leading = true, trailing = true; + if (typeof func != "function") { + throw new TypeError2(FUNC_ERROR_TEXT); + } + if (isObject2(options)) { + leading = "leading" in options ? !!options.leading : leading; + trailing = "trailing" in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + "leading": leading, + "maxWait": wait, + "trailing": trailing + }); + } + function unary(func) { + return ary(func, 1); + } + function wrap2(value, wrapper) { + return partial(castFunction(wrapper), value); + } + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray2(value) ? value : [value]; + } + function clone2(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + function cloneWith(value, customizer) { + customizer = typeof customizer == "function" ? customizer : undefined2; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + function cloneDeep(value) { + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); + } + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == "function" ? customizer : undefined2; + return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); + } + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + function eq2(value, other) { + return value === other || value !== value && other !== other; + } + var gt = createRelationalOperation(baseGt); + var gte2 = createRelationalOperation(function(value, other) { + return value >= other; + }); + var isArguments = baseIsArguments(/* @__PURE__ */ function() { + return arguments; + }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty2.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); + }; + var isArray2 = Array2.isArray; + var isArrayBuffer2 = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + function isArrayLike2(value) { + return value != null && isLength(value.length) && !isFunction2(value); + } + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike2(value); + } + function isBoolean2(value) { + return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag; + } + var isBuffer2 = nativeIsBuffer || stubFalse; + var isDate2 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject2(value); + } + function isEmpty(value) { + if (value == null) { + return true; + } + if (isArrayLike2(value) && (isArray2(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer2(value) || isTypedArray2(value) || isArguments(value))) { + return !value.length; + } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (isPrototype(value)) { + return !baseKeys(value).length; + } + for (var key in value) { + if (hasOwnProperty2.call(value, key)) { + return false; + } + } + return true; + } + function isEqual(value, other) { + return baseIsEqual(value, other); + } + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == "function" ? customizer : undefined2; + var result2 = customizer ? customizer(value, other) : undefined2; + return result2 === undefined2 ? baseIsEqual(value, other, undefined2, customizer) : !!result2; + } + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject2(value); + } + function isFinite2(value) { + return typeof value == "number" && nativeIsFinite(value); + } + function isFunction2(value) { + if (!isObject2(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + function isInteger(value) { + return typeof value == "number" && value == toInteger(value); + } + function isLength(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + function isObject2(value) { + var type = typeof value; + return value != null && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + function isMatch4(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == "function" ? customizer : undefined2; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + function isNaN2(value) { + return isNumber4(value) && value != +value; + } + function isNative(value) { + if (isMaskable(value)) { + throw new Error2(CORE_ERROR_TEXT); + } + return baseIsNative(value); + } + function isNull(value) { + return value === null; + } + function isNil(value) { + return value == null; + } + function isNumber4(value) { + return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag; + } + function isPlainObject2(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty2.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; + } + var isRegExp2 = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + function isString2(value) { + return typeof value == "string" || !isArray2(value) && isObjectLike(value) && baseGetTag(value) == stringTag; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag; + } + var isTypedArray2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + function isUndefined2(value) { + return value === undefined2; + } + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + var lt = createRelationalOperation(baseLt); + var lte = createRelationalOperation(function(value, other) { + return value <= other; + }); + function toArray3(value) { + if (!value) { + return []; + } + if (isArrayLike2(value)) { + return isString2(value) ? stringToArray(value) : copyArray(value); + } + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values; + return func(value); + } + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = value < 0 ? -1 : 1; + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + function toInteger(value) { + var result2 = toFinite(value), remainder = result2 % 1; + return result2 === result2 ? remainder ? result2 - remainder : result2 : 0; + } + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + function toNumber(value) { + if (typeof value == "number") { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject2(value)) { + var other = typeof value.valueOf == "function" ? value.valueOf() : value; + value = isObject2(other) ? other + "" : other; + } + if (typeof value != "string") { + return value === 0 ? value : +value; + } + value = baseTrim(value); + var isBinary = reIsBinary.test(value); + return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + } + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + function toSafeInteger(value) { + return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0; + } + function toString4(value) { + return value == null ? "" : baseToString(value); + } + var assign = createAssigner(function(object, source) { + if (isPrototype(source) || isArrayLike2(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty2.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + var assignIn = createAssigner(function(object, source) { + copyObject(source, keysIn(source), object); + }); + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + var at = flatRest(baseAt); + function create2(prototype3, properties) { + var result2 = baseCreate(prototype3); + return properties == null ? result2 : baseAssign(result2, properties); + } + var defaults3 = baseRest(function(object, sources) { + object = Object2(object); + var index2 = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined2; + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + while (++index2 < length) { + var source = sources[index2]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + if (value === undefined2 || eq2(value, objectProto[key]) && !hasOwnProperty2.call(object, key)) { + object[key] = source[key]; + } + } + } + return object; + }); + var defaultsDeep = baseRest(function(args2) { + args2.push(undefined2, customDefaultsMerge); + return apply(mergeWith, undefined2, args2); + }); + function findKey2(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + function forIn(object, iteratee2) { + return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn); + } + function forInRight(object, iteratee2) { + return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn); + } + function forOwn(object, iteratee2) { + return object && baseForOwn(object, getIteratee(iteratee2, 3)); + } + function forOwnRight(object, iteratee2) { + return object && baseForOwnRight(object, getIteratee(iteratee2, 3)); + } + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + function get2(object, path2, defaultValue) { + var result2 = object == null ? undefined2 : baseGet(object, path2); + return result2 === undefined2 ? defaultValue : result2; + } + function has2(object, path2) { + return object != null && hasPath(object, path2, baseHas); + } + function hasIn(object, path2) { + return object != null && hasPath(object, path2, baseHasIn); + } + var invert = createInverter(function(result2, value, key) { + if (value != null && typeof value.toString != "function") { + value = nativeObjectToString.call(value); + } + result2[value] = key; + }, constant(identity)); + var invertBy = createInverter(function(result2, value, key) { + if (value != null && typeof value.toString != "function") { + value = nativeObjectToString.call(value); + } + if (hasOwnProperty2.call(result2, value)) { + result2[value].push(key); + } else { + result2[value] = [key]; + } + }, getIteratee); + var invoke = baseRest(baseInvoke); + function keys(object) { + return isArrayLike2(object) ? arrayLikeKeys(object) : baseKeys(object); + } + function keysIn(object) { + return isArrayLike2(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + function mapKeys(object, iteratee2) { + var result2 = {}; + iteratee2 = getIteratee(iteratee2, 3); + baseForOwn(object, function(value, key, object2) { + baseAssignValue(result2, iteratee2(value, key, object2), value); + }); + return result2; + } + function mapValues(object, iteratee2) { + var result2 = {}; + iteratee2 = getIteratee(iteratee2, 3); + baseForOwn(object, function(value, key, object2) { + baseAssignValue(result2, key, iteratee2(value, key, object2)); + }); + return result2; + } + var merge4 = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + var omit2 = flatRest(function(object, paths) { + var result2 = {}; + if (object == null) { + return result2; + } + var isDeep = false; + paths = arrayMap(paths, function(path2) { + path2 = castPath(path2, object); + isDeep || (isDeep = path2.length > 1); + return path2; + }); + copyObject(object, getAllKeysIn(object), result2); + if (isDeep) { + result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + } + var length = paths.length; + while (length--) { + baseUnset(result2, paths[length]); + } + return result2; + }); + function omitBy(object, predicate) { + return pickBy2(object, negate(getIteratee(predicate))); + } + var pick2 = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + function pickBy2(object, predicate) { + if (object == null) { + return {}; + } + var props = arrayMap(getAllKeysIn(object), function(prop2) { + return [prop2]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function(value, path2) { + return predicate(value, path2[0]); + }); + } + function result(object, path2, defaultValue) { + path2 = castPath(path2, object); + var index2 = -1, length = path2.length; + if (!length) { + length = 1; + object = undefined2; + } + while (++index2 < length) { + var value = object == null ? undefined2 : object[toKey(path2[index2])]; + if (value === undefined2) { + index2 = length; + value = defaultValue; + } + object = isFunction2(value) ? value.call(object) : value; + } + return object; + } + function set(object, path2, value) { + return object == null ? object : baseSet(object, path2, value); + } + function setWith(object, path2, value, customizer) { + customizer = typeof customizer == "function" ? customizer : undefined2; + return object == null ? object : baseSet(object, path2, value, customizer); + } + var toPairs = createToPairs(keys); + var toPairsIn = createToPairs(keysIn); + function transform3(object, iteratee2, accumulator) { + var isArr = isArray2(object), isArrLike = isArr || isBuffer2(object) || isTypedArray2(object); + iteratee2 = getIteratee(iteratee2, 4); + if (accumulator == null) { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor() : []; + } else if (isObject2(object)) { + accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object)) : {}; + } else { + accumulator = {}; + } + } + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index2, object2) { + return iteratee2(accumulator, value, index2, object2); + }); + return accumulator; + } + function unset(object, path2) { + return object == null ? true : baseUnset(object, path2); + } + function update2(object, path2, updater) { + return object == null ? object : baseUpdate(object, path2, castFunction(updater)); + } + function updateWith(object, path2, updater, customizer) { + customizer = typeof customizer == "function" ? customizer : undefined2; + return object == null ? object : baseUpdate(object, path2, castFunction(updater), customizer); + } + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + function clamp(number, lower, upper) { + if (upper === undefined2) { + upper = lower; + lower = undefined2; + } + if (upper !== undefined2) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined2) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + function inRange(number, start, end2) { + start = toFinite(start); + if (end2 === undefined2) { + end2 = start; + start = 0; + } else { + end2 = toFinite(end2); + } + number = toNumber(number); + return baseInRange(number, start, end2); + } + function random(lower, upper, floating) { + if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined2; + } + if (floating === undefined2) { + if (typeof upper == "boolean") { + floating = upper; + upper = undefined2; + } else if (typeof lower == "boolean") { + floating = lower; + lower = undefined2; + } + } + if (lower === undefined2 && upper === undefined2) { + lower = 0; + upper = 1; + } else { + lower = toFinite(lower); + if (upper === undefined2) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper); + } + return baseRandom(lower, upper); + } + var camelCase2 = createCompounder(function(result2, word, index2) { + word = word.toLowerCase(); + return result2 + (index2 ? capitalize(word) : word); + }); + function capitalize(string) { + return upperFirst(toString4(string).toLowerCase()); + } + function deburr(string) { + string = toString4(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ""); + } + function endsWith2(string, target, position) { + string = toString4(string); + target = baseToString(target); + var length = string.length; + position = position === undefined2 ? length : baseClamp(toInteger(position), 0, length); + var end2 = position; + position -= target.length; + return position >= 0 && string.slice(position, end2) == target; + } + function escape3(string) { + string = toString4(string); + return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; + } + function escapeRegExp(string) { + string = toString4(string); + return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string; + } + var kebabCase = createCompounder(function(result2, word, index2) { + return result2 + (index2 ? "-" : "") + word.toLowerCase(); + }); + var lowerCase = createCompounder(function(result2, word, index2) { + return result2 + (index2 ? " " : "") + word.toLowerCase(); + }); + var lowerFirst = createCaseFirst("toLowerCase"); + function pad(string, length, chars) { + string = toString4(string); + length = toInteger(length); + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars); + } + function padEnd(string, length, chars) { + string = toString4(string); + length = toInteger(length); + var strLength = length ? stringSize(string) : 0; + return length && strLength < length ? string + createPadding(length - strLength, chars) : string; + } + function padStart(string, length, chars) { + string = toString4(string); + length = toInteger(length); + var strLength = length ? stringSize(string) : 0; + return length && strLength < length ? createPadding(length - strLength, chars) + string : string; + } + function parseInt2(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + return nativeParseInt(toString4(string).replace(reTrimStart, ""), radix || 0); + } + function repeat(string, n2, guard) { + if (guard ? isIterateeCall(string, n2, guard) : n2 === undefined2) { + n2 = 1; + } else { + n2 = toInteger(n2); + } + return baseRepeat(toString4(string), n2); + } + function replace() { + var args2 = arguments, string = toString4(args2[0]); + return args2.length < 3 ? string : string.replace(args2[1], args2[2]); + } + var snakeCase = createCompounder(function(result2, word, index2) { + return result2 + (index2 ? "_" : "") + word.toLowerCase(); + }); + function split(string, separator, limit) { + if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) { + separator = limit = undefined2; + } + limit = limit === undefined2 ? MAX_ARRAY_LENGTH : limit >>> 0; + if (!limit) { + return []; + } + string = toString4(string); + if (string && (typeof separator == "string" || separator != null && !isRegExp2(separator))) { + separator = baseToString(separator); + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + return string.split(separator, limit); + } + var startCase = createCompounder(function(result2, word, index2) { + return result2 + (index2 ? " " : "") + upperFirst(word); + }); + function startsWith(string, target, position) { + string = toString4(string); + position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + function template(string, options, guard) { + var settings = lodash16.templateSettings; + if (guard && isIterateeCall(string, options, guard)) { + options = undefined2; + } + string = toString4(string); + options = assignInWith({}, options, settings, customDefaultsAssignIn); + var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys); + var isEscaping, isEvaluating, index2 = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '"; + var reDelimiters = RegExp2( + (options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$", + "g" + ); + var sourceURL = "//# sourceURL=" + (hasOwnProperty2.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n"; + string.replace(reDelimiters, function(match2, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { + interpolateValue || (interpolateValue = esTemplateValue); + source += string.slice(index2, offset).replace(reUnescapedString, escapeStringChar); + if (escapeValue) { + isEscaping = true; + source += "' +\n__e(" + escapeValue + ") +\n'"; + } + if (evaluateValue) { + isEvaluating = true; + source += "';\n" + evaluateValue + ";\n__p += '"; + } + if (interpolateValue) { + source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; + } + index2 = offset + match2.length; + return match2; + }); + source += "';\n"; + var variable = hasOwnProperty2.call(options, "variable") && options.variable; + if (!variable) { + source = "with (obj) {\n" + source + "\n}\n"; + } else if (reForbiddenIdentifierChars.test(variable)) { + throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT); + } + source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;"); + source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}"; + var result2 = attempt(function() { + return Function2(importsKeys, sourceURL + "return " + source).apply(undefined2, importsValues); + }); + result2.source = source; + if (isError(result2)) { + throw result2; + } + return result2; + } + function toLower(value) { + return toString4(value).toLowerCase(); + } + function toUpper(value) { + return toString4(value).toUpperCase(); + } + function trim2(string, chars, guard) { + string = toString4(string); + if (string && (guard || chars === undefined2)) { + return baseTrim(string); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end2 = charsEndIndex(strSymbols, chrSymbols) + 1; + return castSlice(strSymbols, start, end2).join(""); + } + function trimEnd(string, chars, guard) { + string = toString4(string); + if (string && (guard || chars === undefined2)) { + return string.slice(0, trimmedEndIndex(string) + 1); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), end2 = charsEndIndex(strSymbols, stringToArray(chars)) + 1; + return castSlice(strSymbols, 0, end2).join(""); + } + function trimStart(string, chars, guard) { + string = toString4(string); + if (string && (guard || chars === undefined2)) { + return string.replace(reTrimStart, ""); + } + if (!string || !(chars = baseToString(chars))) { + return string; + } + var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars)); + return castSlice(strSymbols, start).join(""); + } + function truncate(string, options) { + var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION; + if (isObject2(options)) { + var separator = "separator" in options ? options.separator : separator; + length = "length" in options ? toInteger(options.length) : length; + omission = "omission" in options ? baseToString(options.omission) : omission; + } + string = toString4(string); + var strLength = string.length; + if (hasUnicode(string)) { + var strSymbols = stringToArray(string); + strLength = strSymbols.length; + } + if (length >= strLength) { + return string; + } + var end2 = length - stringSize(omission); + if (end2 < 1) { + return omission; + } + var result2 = strSymbols ? castSlice(strSymbols, 0, end2).join("") : string.slice(0, end2); + if (separator === undefined2) { + return result2 + omission; + } + if (strSymbols) { + end2 += result2.length - end2; + } + if (isRegExp2(separator)) { + if (string.slice(end2).search(separator)) { + var match2, substring = result2; + if (!separator.global) { + separator = RegExp2(separator.source, toString4(reFlags.exec(separator)) + "g"); + } + separator.lastIndex = 0; + while (match2 = separator.exec(substring)) { + var newEnd = match2.index; + } + result2 = result2.slice(0, newEnd === undefined2 ? end2 : newEnd); + } + } else if (string.indexOf(baseToString(separator), end2) != end2) { + var index2 = result2.lastIndexOf(separator); + if (index2 > -1) { + result2 = result2.slice(0, index2); + } + } + return result2 + omission; + } + function unescape3(string) { + string = toString4(string); + return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string; + } + var upperCase = createCompounder(function(result2, word, index2) { + return result2 + (index2 ? " " : "") + word.toUpperCase(); + }); + var upperFirst = createCaseFirst("toUpperCase"); + function words(string, pattern, guard) { + string = toString4(string); + pattern = guard ? undefined2 : pattern; + if (pattern === undefined2) { + return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); + } + return string.match(pattern) || []; + } + var attempt = baseRest(function(func, args2) { + try { + return apply(func, undefined2, args2); + } catch (e) { + return isError(e) ? e : new Error2(e); + } + }); + var bindAll = flatRest(function(object, methodNames) { + arrayEach(methodNames, function(key) { + key = toKey(key); + baseAssignValue(object, key, bind2(object[key], object)); + }); + return object; + }); + function cond(pairs) { + var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee(); + pairs = !length ? [] : arrayMap(pairs, function(pair) { + if (typeof pair[1] != "function") { + throw new TypeError2(FUNC_ERROR_TEXT); + } + return [toIteratee(pair[0]), pair[1]]; + }); + return baseRest(function(args2) { + var index2 = -1; + while (++index2 < length) { + var pair = pairs[index2]; + if (apply(pair[0], this, args2)) { + return apply(pair[1], this, args2); + } + } + }); + } + function conforms(source) { + return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); + } + function constant(value) { + return function() { + return value; + }; + } + function defaultTo(value, defaultValue) { + return value == null || value !== value ? defaultValue : value; + } + var flow = createFlow(); + var flowRight = createFlow(true); + function identity(value) { + return value; + } + function iteratee(func) { + return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG)); + } + function matches(source) { + return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); + } + function matchesProperty(path2, srcValue) { + return baseMatchesProperty(path2, baseClone(srcValue, CLONE_DEEP_FLAG)); + } + var method = baseRest(function(path2, args2) { + return function(object) { + return baseInvoke(object, path2, args2); + }; + }); + var methodOf = baseRest(function(object, args2) { + return function(path2) { + return baseInvoke(object, path2, args2); + }; + }); + function mixin(object, source, options) { + var props = keys(source), methodNames = baseFunctions(source, props); + if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) { + options = source; + source = object; + object = this; + methodNames = baseFunctions(source, keys(source)); + } + var chain3 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction2(object); + arrayEach(methodNames, function(methodName) { + var func = source[methodName]; + object[methodName] = func; + if (isFunc) { + object.prototype[methodName] = function() { + var chainAll = this.__chain__; + if (chain3 || chainAll) { + var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__); + actions.push({ "func": func, "args": arguments, "thisArg": object }); + result2.__chain__ = chainAll; + return result2; + } + return func.apply(object, arrayPush([this.value()], arguments)); + }; + } + }); + return object; + } + function noConflict() { + if (root3._ === this) { + root3._ = oldDash; + } + return this; + } + function noop2() { + } + function nthArg(n2) { + n2 = toInteger(n2); + return baseRest(function(args2) { + return baseNth(args2, n2); + }); + } + var over = createOver(arrayMap); + var overEvery = createOver(arrayEvery); + var overSome = createOver(arraySome); + function property(path2) { + return isKey(path2) ? baseProperty(toKey(path2)) : basePropertyDeep(path2); + } + function propertyOf(object) { + return function(path2) { + return object == null ? undefined2 : baseGet(object, path2); + }; + } + var range = createRange(); + var rangeRight = createRange(true); + function stubArray() { + return []; + } + function stubFalse() { + return false; + } + function stubObject() { + return {}; + } + function stubString() { + return ""; + } + function stubTrue() { + return true; + } + function times(n2, iteratee2) { + n2 = toInteger(n2); + if (n2 < 1 || n2 > MAX_SAFE_INTEGER) { + return []; + } + var index2 = MAX_ARRAY_LENGTH, length = nativeMin(n2, MAX_ARRAY_LENGTH); + iteratee2 = getIteratee(iteratee2); + n2 -= MAX_ARRAY_LENGTH; + var result2 = baseTimes(length, iteratee2); + while (++index2 < n2) { + iteratee2(index2); + } + return result2; + } + function toPath(value) { + if (isArray2(value)) { + return arrayMap(value, toKey); + } + return isSymbol(value) ? [value] : copyArray(stringToPath(toString4(value))); + } + function uniqueId3(prefix) { + var id = ++idCounter; + return toString4(prefix) + id; + } + var add2 = createMathOperation(function(augend, addend) { + return augend + addend; + }, 0); + var ceil = createRound("ceil"); + var divide = createMathOperation(function(dividend, divisor) { + return dividend / divisor; + }, 1); + var floor = createRound("floor"); + function max(array) { + return array && array.length ? baseExtremum(array, identity, baseGt) : undefined2; + } + function maxBy(array, iteratee2) { + return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined2; + } + function mean(array) { + return baseMean(array, identity); + } + function meanBy(array, iteratee2) { + return baseMean(array, getIteratee(iteratee2, 2)); + } + function min(array) { + return array && array.length ? baseExtremum(array, identity, baseLt) : undefined2; + } + function minBy(array, iteratee2) { + return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined2; + } + var multiply = createMathOperation(function(multiplier, multiplicand) { + return multiplier * multiplicand; + }, 1); + var round = createRound("round"); + var subtract = createMathOperation(function(minuend, subtrahend) { + return minuend - subtrahend; + }, 0); + function sum(array) { + return array && array.length ? baseSum(array, identity) : 0; + } + function sumBy(array, iteratee2) { + return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0; + } + lodash16.after = after2; + lodash16.ary = ary; + lodash16.assign = assign; + lodash16.assignIn = assignIn; + lodash16.assignInWith = assignInWith; + lodash16.assignWith = assignWith; + lodash16.at = at; + lodash16.before = before2; + lodash16.bind = bind2; + lodash16.bindAll = bindAll; + lodash16.bindKey = bindKey; + lodash16.castArray = castArray; + lodash16.chain = chain2; + lodash16.chunk = chunk; + lodash16.compact = compact; + lodash16.concat = concat; + lodash16.cond = cond; + lodash16.conforms = conforms; + lodash16.constant = constant; + lodash16.countBy = countBy; + lodash16.create = create2; + lodash16.curry = curry; + lodash16.curryRight = curryRight; + lodash16.debounce = debounce; + lodash16.defaults = defaults3; + lodash16.defaultsDeep = defaultsDeep; + lodash16.defer = defer2; + lodash16.delay = delay; + lodash16.difference = difference; + lodash16.differenceBy = differenceBy; + lodash16.differenceWith = differenceWith; + lodash16.drop = drop; + lodash16.dropRight = dropRight; + lodash16.dropRightWhile = dropRightWhile; + lodash16.dropWhile = dropWhile; + lodash16.fill = fill; + lodash16.filter = filter6; + lodash16.flatMap = flatMap; + lodash16.flatMapDeep = flatMapDeep; + lodash16.flatMapDepth = flatMapDepth; + lodash16.flatten = flatten2; + lodash16.flattenDeep = flattenDeep; + lodash16.flattenDepth = flattenDepth; + lodash16.flip = flip; + lodash16.flow = flow; + lodash16.flowRight = flowRight; + lodash16.fromPairs = fromPairs; + lodash16.functions = functions; + lodash16.functionsIn = functionsIn; + lodash16.groupBy = groupBy; + lodash16.initial = initial; + lodash16.intersection = intersection; + lodash16.intersectionBy = intersectionBy; + lodash16.intersectionWith = intersectionWith; + lodash16.invert = invert; + lodash16.invertBy = invertBy; + lodash16.invokeMap = invokeMap; + lodash16.iteratee = iteratee; + lodash16.keyBy = keyBy; + lodash16.keys = keys; + lodash16.keysIn = keysIn; + lodash16.map = map2; + lodash16.mapKeys = mapKeys; + lodash16.mapValues = mapValues; + lodash16.matches = matches; + lodash16.matchesProperty = matchesProperty; + lodash16.memoize = memoize4; + lodash16.merge = merge4; + lodash16.mergeWith = mergeWith; + lodash16.method = method; + lodash16.methodOf = methodOf; + lodash16.mixin = mixin; + lodash16.negate = negate; + lodash16.nthArg = nthArg; + lodash16.omit = omit2; + lodash16.omitBy = omitBy; + lodash16.once = once8; + lodash16.orderBy = orderBy; + lodash16.over = over; + lodash16.overArgs = overArgs; + lodash16.overEvery = overEvery; + lodash16.overSome = overSome; + lodash16.partial = partial; + lodash16.partialRight = partialRight; + lodash16.partition = partition2; + lodash16.pick = pick2; + lodash16.pickBy = pickBy2; + lodash16.property = property; + lodash16.propertyOf = propertyOf; + lodash16.pull = pull; + lodash16.pullAll = pullAll; + lodash16.pullAllBy = pullAllBy; + lodash16.pullAllWith = pullAllWith; + lodash16.pullAt = pullAt; + lodash16.range = range; + lodash16.rangeRight = rangeRight; + lodash16.rearg = rearg; + lodash16.reject = reject; + lodash16.remove = remove2; + lodash16.rest = rest; + lodash16.reverse = reverse; + lodash16.sampleSize = sampleSize; + lodash16.set = set; + lodash16.setWith = setWith; + lodash16.shuffle = shuffle; + lodash16.slice = slice2; + lodash16.sortBy = sortBy; + lodash16.sortedUniq = sortedUniq; + lodash16.sortedUniqBy = sortedUniqBy; + lodash16.split = split; + lodash16.spread = spread3; + lodash16.tail = tail; + lodash16.take = take2; + lodash16.takeRight = takeRight; + lodash16.takeRightWhile = takeRightWhile; + lodash16.takeWhile = takeWhile; + lodash16.tap = tap; + lodash16.throttle = throttle2; + lodash16.thru = thru; + lodash16.toArray = toArray3; + lodash16.toPairs = toPairs; + lodash16.toPairsIn = toPairsIn; + lodash16.toPath = toPath; + lodash16.toPlainObject = toPlainObject; + lodash16.transform = transform3; + lodash16.unary = unary; + lodash16.union = union; + lodash16.unionBy = unionBy; + lodash16.unionWith = unionWith; + lodash16.uniq = uniq4; + lodash16.uniqBy = uniqBy; + lodash16.uniqWith = uniqWith; + lodash16.unset = unset; + lodash16.unzip = unzip; + lodash16.unzipWith = unzipWith; + lodash16.update = update2; + lodash16.updateWith = updateWith; + lodash16.values = values; + lodash16.valuesIn = valuesIn; + lodash16.without = without; + lodash16.words = words; + lodash16.wrap = wrap2; + lodash16.xor = xor; + lodash16.xorBy = xorBy; + lodash16.xorWith = xorWith; + lodash16.zip = zip; + lodash16.zipObject = zipObject; + lodash16.zipObjectDeep = zipObjectDeep; + lodash16.zipWith = zipWith; + lodash16.entries = toPairs; + lodash16.entriesIn = toPairsIn; + lodash16.extend = assignIn; + lodash16.extendWith = assignInWith; + mixin(lodash16, lodash16); + lodash16.add = add2; + lodash16.attempt = attempt; + lodash16.camelCase = camelCase2; + lodash16.capitalize = capitalize; + lodash16.ceil = ceil; + lodash16.clamp = clamp; + lodash16.clone = clone2; + lodash16.cloneDeep = cloneDeep; + lodash16.cloneDeepWith = cloneDeepWith; + lodash16.cloneWith = cloneWith; + lodash16.conformsTo = conformsTo; + lodash16.deburr = deburr; + lodash16.defaultTo = defaultTo; + lodash16.divide = divide; + lodash16.endsWith = endsWith2; + lodash16.eq = eq2; + lodash16.escape = escape3; + lodash16.escapeRegExp = escapeRegExp; + lodash16.every = every; + lodash16.find = find4; + lodash16.findIndex = findIndex; + lodash16.findKey = findKey2; + lodash16.findLast = findLast; + lodash16.findLastIndex = findLastIndex; + lodash16.findLastKey = findLastKey; + lodash16.floor = floor; + lodash16.forEach = forEach2; + lodash16.forEachRight = forEachRight; + lodash16.forIn = forIn; + lodash16.forInRight = forInRight; + lodash16.forOwn = forOwn; + lodash16.forOwnRight = forOwnRight; + lodash16.get = get2; + lodash16.gt = gt; + lodash16.gte = gte2; + lodash16.has = has2; + lodash16.hasIn = hasIn; + lodash16.head = head; + lodash16.identity = identity; + lodash16.includes = includes; + lodash16.indexOf = indexOf; + lodash16.inRange = inRange; + lodash16.invoke = invoke; + lodash16.isArguments = isArguments; + lodash16.isArray = isArray2; + lodash16.isArrayBuffer = isArrayBuffer2; + lodash16.isArrayLike = isArrayLike2; + lodash16.isArrayLikeObject = isArrayLikeObject; + lodash16.isBoolean = isBoolean2; + lodash16.isBuffer = isBuffer2; + lodash16.isDate = isDate2; + lodash16.isElement = isElement; + lodash16.isEmpty = isEmpty; + lodash16.isEqual = isEqual; + lodash16.isEqualWith = isEqualWith; + lodash16.isError = isError; + lodash16.isFinite = isFinite2; + lodash16.isFunction = isFunction2; + lodash16.isInteger = isInteger; + lodash16.isLength = isLength; + lodash16.isMap = isMap; + lodash16.isMatch = isMatch4; + lodash16.isMatchWith = isMatchWith; + lodash16.isNaN = isNaN2; + lodash16.isNative = isNative; + lodash16.isNil = isNil; + lodash16.isNull = isNull; + lodash16.isNumber = isNumber4; + lodash16.isObject = isObject2; + lodash16.isObjectLike = isObjectLike; + lodash16.isPlainObject = isPlainObject2; + lodash16.isRegExp = isRegExp2; + lodash16.isSafeInteger = isSafeInteger; + lodash16.isSet = isSet; + lodash16.isString = isString2; + lodash16.isSymbol = isSymbol; + lodash16.isTypedArray = isTypedArray2; + lodash16.isUndefined = isUndefined2; + lodash16.isWeakMap = isWeakMap; + lodash16.isWeakSet = isWeakSet; + lodash16.join = join17; + lodash16.kebabCase = kebabCase; + lodash16.last = last2; + lodash16.lastIndexOf = lastIndexOf; + lodash16.lowerCase = lowerCase; + lodash16.lowerFirst = lowerFirst; + lodash16.lt = lt; + lodash16.lte = lte; + lodash16.max = max; + lodash16.maxBy = maxBy; + lodash16.mean = mean; + lodash16.meanBy = meanBy; + lodash16.min = min; + lodash16.minBy = minBy; + lodash16.stubArray = stubArray; + lodash16.stubFalse = stubFalse; + lodash16.stubObject = stubObject; + lodash16.stubString = stubString; + lodash16.stubTrue = stubTrue; + lodash16.multiply = multiply; + lodash16.nth = nth; + lodash16.noConflict = noConflict; + lodash16.noop = noop2; + lodash16.now = now; + lodash16.pad = pad; + lodash16.padEnd = padEnd; + lodash16.padStart = padStart; + lodash16.parseInt = parseInt2; + lodash16.random = random; + lodash16.reduce = reduce; + lodash16.reduceRight = reduceRight; + lodash16.repeat = repeat; + lodash16.replace = replace; + lodash16.result = result; + lodash16.round = round; + lodash16.runInContext = runInContext2; + lodash16.sample = sample; + lodash16.size = size; + lodash16.snakeCase = snakeCase; + lodash16.some = some2; + lodash16.sortedIndex = sortedIndex; + lodash16.sortedIndexBy = sortedIndexBy; + lodash16.sortedIndexOf = sortedIndexOf; + lodash16.sortedLastIndex = sortedLastIndex; + lodash16.sortedLastIndexBy = sortedLastIndexBy; + lodash16.sortedLastIndexOf = sortedLastIndexOf; + lodash16.startCase = startCase; + lodash16.startsWith = startsWith; + lodash16.subtract = subtract; + lodash16.sum = sum; + lodash16.sumBy = sumBy; + lodash16.template = template; + lodash16.times = times; + lodash16.toFinite = toFinite; + lodash16.toInteger = toInteger; + lodash16.toLength = toLength; + lodash16.toLower = toLower; + lodash16.toNumber = toNumber; + lodash16.toSafeInteger = toSafeInteger; + lodash16.toString = toString4; + lodash16.toUpper = toUpper; + lodash16.trim = trim2; + lodash16.trimEnd = trimEnd; + lodash16.trimStart = trimStart; + lodash16.truncate = truncate; + lodash16.unescape = unescape3; + lodash16.uniqueId = uniqueId3; + lodash16.upperCase = upperCase; + lodash16.upperFirst = upperFirst; + lodash16.each = forEach2; + lodash16.eachRight = forEachRight; + lodash16.first = head; + mixin(lodash16, function() { + var source = {}; + baseForOwn(lodash16, function(func, methodName) { + if (!hasOwnProperty2.call(lodash16.prototype, methodName)) { + source[methodName] = func; + } + }); + return source; + }(), { "chain": false }); + lodash16.VERSION = VERSION3; + arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) { + lodash16[methodName].placeholder = lodash16; + }); + arrayEach(["drop", "take"], function(methodName, index2) { + LazyWrapper.prototype[methodName] = function(n2) { + n2 = n2 === undefined2 ? 1 : nativeMax(toInteger(n2), 0); + var result2 = this.__filtered__ && !index2 ? new LazyWrapper(this) : this.clone(); + if (result2.__filtered__) { + result2.__takeCount__ = nativeMin(n2, result2.__takeCount__); + } else { + result2.__views__.push({ + "size": nativeMin(n2, MAX_ARRAY_LENGTH), + "type": methodName + (result2.__dir__ < 0 ? "Right" : "") + }); + } + return result2; + }; + LazyWrapper.prototype[methodName + "Right"] = function(n2) { + return this.reverse()[methodName](n2).reverse(); + }; + }); + arrayEach(["filter", "map", "takeWhile"], function(methodName, index2) { + var type = index2 + 1, isFilter2 = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; + LazyWrapper.prototype[methodName] = function(iteratee2) { + var result2 = this.clone(); + result2.__iteratees__.push({ + "iteratee": getIteratee(iteratee2, 3), + "type": type + }); + result2.__filtered__ = result2.__filtered__ || isFilter2; + return result2; + }; + }); + arrayEach(["head", "last"], function(methodName, index2) { + var takeName = "take" + (index2 ? "Right" : ""); + LazyWrapper.prototype[methodName] = function() { + return this[takeName](1).value()[0]; + }; + }); + arrayEach(["initial", "tail"], function(methodName, index2) { + var dropName = "drop" + (index2 ? "" : "Right"); + LazyWrapper.prototype[methodName] = function() { + return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); + }; + }); + LazyWrapper.prototype.compact = function() { + return this.filter(identity); + }; + LazyWrapper.prototype.find = function(predicate) { + return this.filter(predicate).head(); + }; + LazyWrapper.prototype.findLast = function(predicate) { + return this.reverse().find(predicate); + }; + LazyWrapper.prototype.invokeMap = baseRest(function(path2, args2) { + if (typeof path2 == "function") { + return new LazyWrapper(this); + } + return this.map(function(value) { + return baseInvoke(value, path2, args2); + }); + }); + LazyWrapper.prototype.reject = function(predicate) { + return this.filter(negate(getIteratee(predicate))); + }; + LazyWrapper.prototype.slice = function(start, end2) { + start = toInteger(start); + var result2 = this; + if (result2.__filtered__ && (start > 0 || end2 < 0)) { + return new LazyWrapper(result2); + } + if (start < 0) { + result2 = result2.takeRight(-start); + } else if (start) { + result2 = result2.drop(start); + } + if (end2 !== undefined2) { + end2 = toInteger(end2); + result2 = end2 < 0 ? result2.dropRight(-end2) : result2.take(end2 - start); + } + return result2; + }; + LazyWrapper.prototype.takeRightWhile = function(predicate) { + return this.reverse().takeWhile(predicate).reverse(); + }; + LazyWrapper.prototype.toArray = function() { + return this.take(MAX_ARRAY_LENGTH); + }; + baseForOwn(LazyWrapper.prototype, function(func, methodName) { + var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash16[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName); + if (!lodashFunc) { + return; + } + lodash16.prototype[methodName] = function() { + var value = this.__wrapped__, args2 = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args2[0], useLazy = isLazy || isArray2(value); + var interceptor = function(value2) { + var result3 = lodashFunc.apply(lodash16, arrayPush([value2], args2)); + return isTaker && chainAll ? result3[0] : result3; + }; + if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) { + isLazy = useLazy = false; + } + var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid; + if (!retUnwrapped && useLazy) { + value = onlyLazy ? value : new LazyWrapper(this); + var result2 = func.apply(value, args2); + result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined2 }); + return new LodashWrapper(result2, chainAll); + } + if (isUnwrapped && onlyLazy) { + return func.apply(this, args2); + } + result2 = this.thru(interceptor); + return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2; + }; + }); + arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) { + var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName); + lodash16.prototype[methodName] = function() { + var args2 = arguments; + if (retUnwrapped && !this.__chain__) { + var value = this.value(); + return func.apply(isArray2(value) ? value : [], args2); + } + return this[chainName](function(value2) { + return func.apply(isArray2(value2) ? value2 : [], args2); + }); + }; + }); + baseForOwn(LazyWrapper.prototype, function(func, methodName) { + var lodashFunc = lodash16[methodName]; + if (lodashFunc) { + var key = lodashFunc.name + ""; + if (!hasOwnProperty2.call(realNames, key)) { + realNames[key] = []; + } + realNames[key].push({ "name": methodName, "func": lodashFunc }); + } + }); + realNames[createHybrid(undefined2, WRAP_BIND_KEY_FLAG).name] = [{ + "name": "wrapper", + "func": undefined2 + }]; + LazyWrapper.prototype.clone = lazyClone; + LazyWrapper.prototype.reverse = lazyReverse; + LazyWrapper.prototype.value = lazyValue; + lodash16.prototype.at = wrapperAt; + lodash16.prototype.chain = wrapperChain; + lodash16.prototype.commit = wrapperCommit; + lodash16.prototype.next = wrapperNext; + lodash16.prototype.plant = wrapperPlant; + lodash16.prototype.reverse = wrapperReverse; + lodash16.prototype.toJSON = lodash16.prototype.valueOf = lodash16.prototype.value = wrapperValue; + lodash16.prototype.first = lodash16.prototype.head; + if (symIterator) { + lodash16.prototype[symIterator] = wrapperToIterator; + } + return lodash16; + }; + var _ = runInContext(); + if (typeof define == "function" && typeof define.amd == "object" && define.amd) { + root3._ = _; + define(function() { + return _; + }); + } else if (freeModule) { + (freeModule.exports = _)._ = _; + freeExports._ = _; + } else { + root3._ = _; + } + }).call(exports2); + } +}); + +// ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js +var require_conversions2 = __commonJS({ + "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"(exports2, module2) { + var cssKeywords = require_color_name(); + var reverseKeywords = {}; + for (const key of Object.keys(cssKeywords)) { + reverseKeywords[cssKeywords[key]] = key; + } + var convert = { + rgb: { channels: 3, labels: "rgb" }, + hsl: { channels: 3, labels: "hsl" }, + hsv: { channels: 3, labels: "hsv" }, + hwb: { channels: 3, labels: "hwb" }, + cmyk: { channels: 4, labels: "cmyk" }, + xyz: { channels: 3, labels: "xyz" }, + lab: { channels: 3, labels: "lab" }, + lch: { channels: 3, labels: "lch" }, + hex: { channels: 1, labels: ["hex"] }, + keyword: { channels: 1, labels: ["keyword"] }, + ansi16: { channels: 1, labels: ["ansi16"] }, + ansi256: { channels: 1, labels: ["ansi256"] }, + hcg: { channels: 3, labels: ["h", "c", "g"] }, + apple: { channels: 3, labels: ["r16", "g16", "b16"] }, + gray: { channels: 1, labels: ["gray"] } + }; + module2.exports = convert; + for (const model of Object.keys(convert)) { + if (!("channels" in convert[model])) { + throw new Error("missing channels property: " + model); + } + if (!("labels" in convert[model])) { + throw new Error("missing channel labels property: " + model); + } + if (convert[model].labels.length !== convert[model].channels) { + throw new Error("channel and label counts mismatch: " + model); + } + const { channels, labels } = convert[model]; + delete convert[model].channels; + delete convert[model].labels; + Object.defineProperty(convert[model], "channels", { value: channels }); + Object.defineProperty(convert[model], "labels", { value: labels }); + } + convert.rgb.hsl = function(rgb) { + const r2 = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const min = Math.min(r2, g, b); + const max = Math.max(r2, g, b); + const delta = max - min; + let h; + let s4; + if (max === min) { + h = 0; + } else if (r2 === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r2) / delta; + } else if (b === max) { + h = 4 + (r2 - g) / delta; + } + h = Math.min(h * 60, 360); + if (h < 0) { + h += 360; + } + const l5 = (min + max) / 2; + if (max === min) { + s4 = 0; + } else if (l5 <= 0.5) { + s4 = delta / (max + min); + } else { + s4 = delta / (2 - max - min); + } + return [h, s4 * 100, l5 * 100]; + }; + convert.rgb.hsv = function(rgb) { + let rdif; + let gdif; + let bdif; + let h; + let s4; + const r2 = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const v = Math.max(r2, g, b); + const diff = v - Math.min(r2, g, b); + const diffc = function(c2) { + return (v - c2) / 6 / diff + 1 / 2; + }; + if (diff === 0) { + h = 0; + s4 = 0; + } else { + s4 = diff / v; + rdif = diffc(r2); + gdif = diffc(g); + bdif = diffc(b); + if (r2 === v) { + h = bdif - gdif; + } else if (g === v) { + h = 1 / 3 + rdif - bdif; + } else if (b === v) { + h = 2 / 3 + gdif - rdif; + } + if (h < 0) { + h += 1; + } else if (h > 1) { + h -= 1; + } + } + return [ + h * 360, + s4 * 100, + v * 100 + ]; + }; + convert.rgb.hwb = function(rgb) { + const r2 = rgb[0]; + const g = rgb[1]; + let b = rgb[2]; + const h = convert.rgb.hsl(rgb)[0]; + const w = 1 / 255 * Math.min(r2, Math.min(g, b)); + b = 1 - 1 / 255 * Math.max(r2, Math.max(g, b)); + return [h, w * 100, b * 100]; + }; + convert.rgb.cmyk = function(rgb) { + const r2 = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const k = Math.min(1 - r2, 1 - g, 1 - b); + const c2 = (1 - r2 - k) / (1 - k) || 0; + const m2 = (1 - g - k) / (1 - k) || 0; + const y6 = (1 - b - k) / (1 - k) || 0; + return [c2 * 100, m2 * 100, y6 * 100, k * 100]; + }; + function comparativeDistance(x3, y6) { + return (x3[0] - y6[0]) ** 2 + (x3[1] - y6[1]) ** 2 + (x3[2] - y6[2]) ** 2; + } + convert.rgb.keyword = function(rgb) { + const reversed = reverseKeywords[rgb]; + if (reversed) { + return reversed; + } + let currentClosestDistance = Infinity; + let currentClosestKeyword; + for (const keyword of Object.keys(cssKeywords)) { + const value = cssKeywords[keyword]; + const distance = comparativeDistance(rgb, value); + if (distance < currentClosestDistance) { + currentClosestDistance = distance; + currentClosestKeyword = keyword; + } + } + return currentClosestKeyword; + }; + convert.keyword.rgb = function(keyword) { + return cssKeywords[keyword]; + }; + convert.rgb.xyz = function(rgb) { + let r2 = rgb[0] / 255; + let g = rgb[1] / 255; + let b = rgb[2] / 255; + r2 = r2 > 0.04045 ? ((r2 + 0.055) / 1.055) ** 2.4 : r2 / 12.92; + g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92; + b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92; + const x3 = r2 * 0.4124 + g * 0.3576 + b * 0.1805; + const y6 = r2 * 0.2126 + g * 0.7152 + b * 0.0722; + const z = r2 * 0.0193 + g * 0.1192 + b * 0.9505; + return [x3 * 100, y6 * 100, z * 100]; + }; + convert.rgb.lab = function(rgb) { + const xyz = convert.rgb.xyz(rgb); + let x3 = xyz[0]; + let y6 = xyz[1]; + let z = xyz[2]; + x3 /= 95.047; + y6 /= 100; + z /= 108.883; + x3 = x3 > 8856e-6 ? x3 ** (1 / 3) : 7.787 * x3 + 16 / 116; + y6 = y6 > 8856e-6 ? y6 ** (1 / 3) : 7.787 * y6 + 16 / 116; + z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116; + const l5 = 116 * y6 - 16; + const a2 = 500 * (x3 - y6); + const b = 200 * (y6 - z); + return [l5, a2, b]; + }; + convert.hsl.rgb = function(hsl) { + const h = hsl[0] / 360; + const s4 = hsl[1] / 100; + const l5 = hsl[2] / 100; + let t22; + let t32; + let val2; + if (s4 === 0) { + val2 = l5 * 255; + return [val2, val2, val2]; + } + if (l5 < 0.5) { + t22 = l5 * (1 + s4); + } else { + t22 = l5 + s4 - l5 * s4; + } + const t1 = 2 * l5 - t22; + const rgb = [0, 0, 0]; + for (let i6 = 0; i6 < 3; i6++) { + t32 = h + 1 / 3 * -(i6 - 1); + if (t32 < 0) { + t32++; + } + if (t32 > 1) { + t32--; + } + if (6 * t32 < 1) { + val2 = t1 + (t22 - t1) * 6 * t32; + } else if (2 * t32 < 1) { + val2 = t22; + } else if (3 * t32 < 2) { + val2 = t1 + (t22 - t1) * (2 / 3 - t32) * 6; + } else { + val2 = t1; + } + rgb[i6] = val2 * 255; + } + return rgb; + }; + convert.hsl.hsv = function(hsl) { + const h = hsl[0]; + let s4 = hsl[1] / 100; + let l5 = hsl[2] / 100; + let smin = s4; + const lmin = Math.max(l5, 0.01); + l5 *= 2; + s4 *= l5 <= 1 ? l5 : 2 - l5; + smin *= lmin <= 1 ? lmin : 2 - lmin; + const v = (l5 + s4) / 2; + const sv = l5 === 0 ? 2 * smin / (lmin + smin) : 2 * s4 / (l5 + s4); + return [h, sv * 100, v * 100]; + }; + convert.hsv.rgb = function(hsv) { + const h = hsv[0] / 60; + const s4 = hsv[1] / 100; + let v = hsv[2] / 100; + const hi = Math.floor(h) % 6; + const f6 = h - Math.floor(h); + const p3 = 255 * v * (1 - s4); + const q = 255 * v * (1 - s4 * f6); + const t4 = 255 * v * (1 - s4 * (1 - f6)); + v *= 255; + switch (hi) { + case 0: + return [v, t4, p3]; + case 1: + return [q, v, p3]; + case 2: + return [p3, v, t4]; + case 3: + return [p3, q, v]; + case 4: + return [t4, p3, v]; + case 5: + return [v, p3, q]; + } + }; + convert.hsv.hsl = function(hsv) { + const h = hsv[0]; + const s4 = hsv[1] / 100; + const v = hsv[2] / 100; + const vmin = Math.max(v, 0.01); + let sl; + let l5; + l5 = (2 - s4) * v; + const lmin = (2 - s4) * vmin; + sl = s4 * vmin; + sl /= lmin <= 1 ? lmin : 2 - lmin; + sl = sl || 0; + l5 /= 2; + return [h, sl * 100, l5 * 100]; + }; + convert.hwb.rgb = function(hwb) { + const h = hwb[0] / 360; + let wh = hwb[1] / 100; + let bl = hwb[2] / 100; + const ratio = wh + bl; + let f6; + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } + const i6 = Math.floor(6 * h); + const v = 1 - bl; + f6 = 6 * h - i6; + if ((i6 & 1) !== 0) { + f6 = 1 - f6; + } + const n2 = wh + f6 * (v - wh); + let r2; + let g; + let b; + switch (i6) { + default: + case 6: + case 0: + r2 = v; + g = n2; + b = wh; + break; + case 1: + r2 = n2; + g = v; + b = wh; + break; + case 2: + r2 = wh; + g = v; + b = n2; + break; + case 3: + r2 = wh; + g = n2; + b = v; + break; + case 4: + r2 = n2; + g = wh; + b = v; + break; + case 5: + r2 = v; + g = wh; + b = n2; + break; + } + return [r2 * 255, g * 255, b * 255]; + }; + convert.cmyk.rgb = function(cmyk) { + const c2 = cmyk[0] / 100; + const m2 = cmyk[1] / 100; + const y6 = cmyk[2] / 100; + const k = cmyk[3] / 100; + const r2 = 1 - Math.min(1, c2 * (1 - k) + k); + const g = 1 - Math.min(1, m2 * (1 - k) + k); + const b = 1 - Math.min(1, y6 * (1 - k) + k); + return [r2 * 255, g * 255, b * 255]; + }; + convert.xyz.rgb = function(xyz) { + const x3 = xyz[0] / 100; + const y6 = xyz[1] / 100; + const z = xyz[2] / 100; + let r2; + let g; + let b; + r2 = x3 * 3.2406 + y6 * -1.5372 + z * -0.4986; + g = x3 * -0.9689 + y6 * 1.8758 + z * 0.0415; + b = x3 * 0.0557 + y6 * -0.204 + z * 1.057; + r2 = r2 > 31308e-7 ? 1.055 * r2 ** (1 / 2.4) - 0.055 : r2 * 12.92; + g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92; + b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92; + r2 = Math.min(Math.max(0, r2), 1); + g = Math.min(Math.max(0, g), 1); + b = Math.min(Math.max(0, b), 1); + return [r2 * 255, g * 255, b * 255]; + }; + convert.xyz.lab = function(xyz) { + let x3 = xyz[0]; + let y6 = xyz[1]; + let z = xyz[2]; + x3 /= 95.047; + y6 /= 100; + z /= 108.883; + x3 = x3 > 8856e-6 ? x3 ** (1 / 3) : 7.787 * x3 + 16 / 116; + y6 = y6 > 8856e-6 ? y6 ** (1 / 3) : 7.787 * y6 + 16 / 116; + z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116; + const l5 = 116 * y6 - 16; + const a2 = 500 * (x3 - y6); + const b = 200 * (y6 - z); + return [l5, a2, b]; + }; + convert.lab.xyz = function(lab) { + const l5 = lab[0]; + const a2 = lab[1]; + const b = lab[2]; + let x3; + let y6; + let z; + y6 = (l5 + 16) / 116; + x3 = a2 / 500 + y6; + z = y6 - b / 200; + const y22 = y6 ** 3; + const x22 = x3 ** 3; + const z2 = z ** 3; + y6 = y22 > 8856e-6 ? y22 : (y6 - 16 / 116) / 7.787; + x3 = x22 > 8856e-6 ? x22 : (x3 - 16 / 116) / 7.787; + z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787; + x3 *= 95.047; + y6 *= 100; + z *= 108.883; + return [x3, y6, z]; + }; + convert.lab.lch = function(lab) { + const l5 = lab[0]; + const a2 = lab[1]; + const b = lab[2]; + let h; + const hr = Math.atan2(b, a2); + h = hr * 360 / 2 / Math.PI; + if (h < 0) { + h += 360; + } + const c2 = Math.sqrt(a2 * a2 + b * b); + return [l5, c2, h]; + }; + convert.lch.lab = function(lch) { + const l5 = lch[0]; + const c2 = lch[1]; + const h = lch[2]; + const hr = h / 360 * 2 * Math.PI; + const a2 = c2 * Math.cos(hr); + const b = c2 * Math.sin(hr); + return [l5, a2, b]; + }; + convert.rgb.ansi16 = function(args2, saturation = null) { + const [r2, g, b] = args2; + let value = saturation === null ? convert.rgb.hsv(args2)[2] : saturation; + value = Math.round(value / 50); + if (value === 0) { + return 30; + } + let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r2 / 255)); + if (value === 2) { + ansi += 60; + } + return ansi; + }; + convert.hsv.ansi16 = function(args2) { + return convert.rgb.ansi16(convert.hsv.rgb(args2), args2[2]); + }; + convert.rgb.ansi256 = function(args2) { + const r2 = args2[0]; + const g = args2[1]; + const b = args2[2]; + if (r2 === g && g === b) { + if (r2 < 8) { + return 16; + } + if (r2 > 248) { + return 231; + } + return Math.round((r2 - 8) / 247 * 24) + 232; + } + const ansi = 16 + 36 * Math.round(r2 / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5); + return ansi; + }; + convert.ansi16.rgb = function(args2) { + let color = args2 % 10; + if (color === 0 || color === 7) { + if (args2 > 50) { + color += 3.5; + } + color = color / 10.5 * 255; + return [color, color, color]; + } + const mult = (~~(args2 > 50) + 1) * 0.5; + const r2 = (color & 1) * mult * 255; + const g = (color >> 1 & 1) * mult * 255; + const b = (color >> 2 & 1) * mult * 255; + return [r2, g, b]; + }; + convert.ansi256.rgb = function(args2) { + if (args2 >= 232) { + const c2 = (args2 - 232) * 10 + 8; + return [c2, c2, c2]; + } + args2 -= 16; + let rem; + const r2 = Math.floor(args2 / 36) / 5 * 255; + const g = Math.floor((rem = args2 % 36) / 6) / 5 * 255; + const b = rem % 6 / 5 * 255; + return [r2, g, b]; + }; + convert.rgb.hex = function(args2) { + const integer = ((Math.round(args2[0]) & 255) << 16) + ((Math.round(args2[1]) & 255) << 8) + (Math.round(args2[2]) & 255); + const string = integer.toString(16).toUpperCase(); + return "000000".substring(string.length) + string; + }; + convert.hex.rgb = function(args2) { + const match2 = args2.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i); + if (!match2) { + return [0, 0, 0]; + } + let colorString = match2[0]; + if (match2[0].length === 3) { + colorString = colorString.split("").map((char) => { + return char + char; + }).join(""); + } + const integer = parseInt(colorString, 16); + const r2 = integer >> 16 & 255; + const g = integer >> 8 & 255; + const b = integer & 255; + return [r2, g, b]; + }; + convert.rgb.hcg = function(rgb) { + const r2 = rgb[0] / 255; + const g = rgb[1] / 255; + const b = rgb[2] / 255; + const max = Math.max(Math.max(r2, g), b); + const min = Math.min(Math.min(r2, g), b); + const chroma = max - min; + let grayscale; + let hue; + if (chroma < 1) { + grayscale = min / (1 - chroma); + } else { + grayscale = 0; + } + if (chroma <= 0) { + hue = 0; + } else if (max === r2) { + hue = (g - b) / chroma % 6; + } else if (max === g) { + hue = 2 + (b - r2) / chroma; + } else { + hue = 4 + (r2 - g) / chroma; + } + hue /= 6; + hue %= 1; + return [hue * 360, chroma * 100, grayscale * 100]; + }; + convert.hsl.hcg = function(hsl) { + const s4 = hsl[1] / 100; + const l5 = hsl[2] / 100; + const c2 = l5 < 0.5 ? 2 * s4 * l5 : 2 * s4 * (1 - l5); + let f6 = 0; + if (c2 < 1) { + f6 = (l5 - 0.5 * c2) / (1 - c2); + } + return [hsl[0], c2 * 100, f6 * 100]; + }; + convert.hsv.hcg = function(hsv) { + const s4 = hsv[1] / 100; + const v = hsv[2] / 100; + const c2 = s4 * v; + let f6 = 0; + if (c2 < 1) { + f6 = (v - c2) / (1 - c2); + } + return [hsv[0], c2 * 100, f6 * 100]; + }; + convert.hcg.rgb = function(hcg) { + const h = hcg[0] / 360; + const c2 = hcg[1] / 100; + const g = hcg[2] / 100; + if (c2 === 0) { + return [g * 255, g * 255, g * 255]; + } + const pure = [0, 0, 0]; + const hi = h % 1 * 6; + const v = hi % 1; + const w = 1 - v; + let mg = 0; + switch (Math.floor(hi)) { + case 0: + pure[0] = 1; + pure[1] = v; + pure[2] = 0; + break; + case 1: + pure[0] = w; + pure[1] = 1; + pure[2] = 0; + break; + case 2: + pure[0] = 0; + pure[1] = 1; + pure[2] = v; + break; + case 3: + pure[0] = 0; + pure[1] = w; + pure[2] = 1; + break; + case 4: + pure[0] = v; + pure[1] = 0; + pure[2] = 1; + break; + default: + pure[0] = 1; + pure[1] = 0; + pure[2] = w; + } + mg = (1 - c2) * g; + return [ + (c2 * pure[0] + mg) * 255, + (c2 * pure[1] + mg) * 255, + (c2 * pure[2] + mg) * 255 + ]; + }; + convert.hcg.hsv = function(hcg) { + const c2 = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c2 + g * (1 - c2); + let f6 = 0; + if (v > 0) { + f6 = c2 / v; + } + return [hcg[0], f6 * 100, v * 100]; + }; + convert.hcg.hsl = function(hcg) { + const c2 = hcg[1] / 100; + const g = hcg[2] / 100; + const l5 = g * (1 - c2) + 0.5 * c2; + let s4 = 0; + if (l5 > 0 && l5 < 0.5) { + s4 = c2 / (2 * l5); + } else if (l5 >= 0.5 && l5 < 1) { + s4 = c2 / (2 * (1 - l5)); + } + return [hcg[0], s4 * 100, l5 * 100]; + }; + convert.hcg.hwb = function(hcg) { + const c2 = hcg[1] / 100; + const g = hcg[2] / 100; + const v = c2 + g * (1 - c2); + return [hcg[0], (v - c2) * 100, (1 - v) * 100]; + }; + convert.hwb.hcg = function(hwb) { + const w = hwb[1] / 100; + const b = hwb[2] / 100; + const v = 1 - b; + const c2 = v - w; + let g = 0; + if (c2 < 1) { + g = (v - c2) / (1 - c2); + } + return [hwb[0], c2 * 100, g * 100]; + }; + convert.apple.rgb = function(apple) { + return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255]; + }; + convert.rgb.apple = function(rgb) { + return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535]; + }; + convert.gray.rgb = function(args2) { + return [args2[0] / 100 * 255, args2[0] / 100 * 255, args2[0] / 100 * 255]; + }; + convert.gray.hsl = function(args2) { + return [0, 0, args2[0]]; + }; + convert.gray.hsv = convert.gray.hsl; + convert.gray.hwb = function(gray) { + return [0, 100, gray[0]]; + }; + convert.gray.cmyk = function(gray) { + return [0, 0, 0, gray[0]]; + }; + convert.gray.lab = function(gray) { + return [gray[0], 0, 0]; + }; + convert.gray.hex = function(gray) { + const val2 = Math.round(gray[0] / 100 * 255) & 255; + const integer = (val2 << 16) + (val2 << 8) + val2; + const string = integer.toString(16).toUpperCase(); + return "000000".substring(string.length) + string; + }; + convert.rgb.gray = function(rgb) { + const val2 = (rgb[0] + rgb[1] + rgb[2]) / 3; + return [val2 / 255 * 100]; + }; + } +}); + +// ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js +var require_route2 = __commonJS({ + "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"(exports2, module2) { + var conversions = require_conversions2(); + function buildGraph() { + const graph = {}; + const models = Object.keys(conversions); + for (let len = models.length, i6 = 0; i6 < len; i6++) { + graph[models[i6]] = { + // http://jsperf.com/1-vs-infinity + // micro-opt, but this is simple. + distance: -1, + parent: null + }; + } + return graph; + } + function deriveBFS(fromModel) { + const graph = buildGraph(); + const queue = [fromModel]; + graph[fromModel].distance = 0; + while (queue.length) { + const current = queue.pop(); + const adjacents = Object.keys(conversions[current]); + for (let len = adjacents.length, i6 = 0; i6 < len; i6++) { + const adjacent = adjacents[i6]; + const node = graph[adjacent]; + if (node.distance === -1) { + node.distance = graph[current].distance + 1; + node.parent = current; + queue.unshift(adjacent); + } + } + } + return graph; + } + function link(from, to) { + return function(args2) { + return to(from(args2)); + }; + } + function wrapConversion(toModel, graph) { + const path2 = [graph[toModel].parent, toModel]; + let fn2 = conversions[graph[toModel].parent][toModel]; + let cur = graph[toModel].parent; + while (graph[cur].parent) { + path2.unshift(graph[cur].parent); + fn2 = link(conversions[graph[cur].parent][cur], fn2); + cur = graph[cur].parent; + } + fn2.conversion = path2; + return fn2; + } + module2.exports = function(fromModel) { + const graph = deriveBFS(fromModel); + const conversion = {}; + const models = Object.keys(graph); + for (let len = models.length, i6 = 0; i6 < len; i6++) { + const toModel = models[i6]; + const node = graph[toModel]; + if (node.parent === null) { + continue; + } + conversion[toModel] = wrapConversion(toModel, graph); + } + return conversion; + }; + } +}); + +// ../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js +var require_color_convert2 = __commonJS({ + "../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"(exports2, module2) { + var conversions = require_conversions2(); + var route = require_route2(); + var convert = {}; + var models = Object.keys(conversions); + function wrapRaw(fn2) { + const wrappedFn = function(...args2) { + const arg0 = args2[0]; + if (arg0 === void 0 || arg0 === null) { + return arg0; + } + if (arg0.length > 1) { + args2 = arg0; + } + return fn2(args2); + }; + if ("conversion" in fn2) { + wrappedFn.conversion = fn2.conversion; + } + return wrappedFn; + } + function wrapRounded(fn2) { + const wrappedFn = function(...args2) { + const arg0 = args2[0]; + if (arg0 === void 0 || arg0 === null) { + return arg0; + } + if (arg0.length > 1) { + args2 = arg0; + } + const result = fn2(args2); + if (typeof result === "object") { + for (let len = result.length, i6 = 0; i6 < len; i6++) { + result[i6] = Math.round(result[i6]); + } + } + return result; + }; + if ("conversion" in fn2) { + wrappedFn.conversion = fn2.conversion; + } + return wrappedFn; + } + models.forEach((fromModel) => { + convert[fromModel] = {}; + Object.defineProperty(convert[fromModel], "channels", { value: conversions[fromModel].channels }); + Object.defineProperty(convert[fromModel], "labels", { value: conversions[fromModel].labels }); + const routes = route(fromModel); + const routeModels = Object.keys(routes); + routeModels.forEach((toModel) => { + const fn2 = routes[toModel]; + convert[fromModel][toModel] = wrapRounded(fn2); + convert[fromModel][toModel].raw = wrapRaw(fn2); + }); + }); + module2.exports = convert; + } +}); + +// ../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js +var require_ansi_styles = __commonJS({ + "../../node_modules/.pnpm/ansi-styles@4.3.0/node_modules/ansi-styles/index.js"(exports2, module2) { + "use strict"; + var wrapAnsi16 = (fn2, offset) => (...args2) => { + const code = fn2(...args2); + return `\x1B[${code + offset}m`; + }; + var wrapAnsi256 = (fn2, offset) => (...args2) => { + const code = fn2(...args2); + return `\x1B[${38 + offset};5;${code}m`; + }; + var wrapAnsi16m = (fn2, offset) => (...args2) => { + const rgb = fn2(...args2); + return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; + }; + var ansi2ansi = (n2) => n2; + var rgb2rgb = (r2, g, b) => [r2, g, b]; + var setLazyProperty = (object, property, get2) => { + Object.defineProperty(object, property, { + get: () => { + const value = get2(); + Object.defineProperty(object, property, { + value, + enumerable: true, + configurable: true + }); + return value; + }, + enumerable: true, + configurable: true + }); + }; + var colorConvert; + var makeDynamicStyles = (wrap2, targetSpace, identity, isBackground) => { + if (colorConvert === void 0) { + colorConvert = require_color_convert2(); + } + const offset = isBackground ? 10 : 0; + const styles = {}; + for (const [sourceSpace, suite] of Object.entries(colorConvert)) { + const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace; + if (sourceSpace === targetSpace) { + styles[name] = wrap2(identity, offset); + } else if (typeof suite === "object") { + styles[name] = wrap2(suite[targetSpace], offset); + } + } + return styles; + }; + function assembleStyles() { + const codes = /* @__PURE__ */ new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + // Bright color + blackBright: [90, 39], + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + styles.color.gray = styles.color.blackBright; + styles.bgColor.bgGray = styles.bgColor.bgBlackBright; + styles.color.grey = styles.color.blackBright; + styles.bgColor.bgGrey = styles.bgColor.bgBlackBright; + for (const [groupName, group] of Object.entries(styles)) { + for (const [styleName, style] of Object.entries(group)) { + styles[styleName] = { + open: `\x1B[${style[0]}m`, + close: `\x1B[${style[1]}m` + }; + group[styleName] = styles[styleName]; + codes.set(style[0], style[1]); + } + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + } + Object.defineProperty(styles, "codes", { + value: codes, + enumerable: false + }); + styles.color.close = "\x1B[39m"; + styles.bgColor.close = "\x1B[49m"; + setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false)); + setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false)); + setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false)); + setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true)); + setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true)); + setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true)); + return styles; + } + Object.defineProperty(module2, "exports", { + enumerable: true, + get: assembleStyles + }); + } +}); + +// ../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js +var require_has_flag2 = __commonJS({ + "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js"(exports2, module2) { + "use strict"; + module2.exports = (flag, argv = process.argv) => { + const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf("--"); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); + }; + } +}); + +// ../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js +var require_supports_color = __commonJS({ + "../../node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js"(exports2, module2) { + "use strict"; + var os2 = __require("os"); + var tty = __require("tty"); + var hasFlag = require_has_flag2(); + var { env } = process; + var forceColor; + if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { + forceColor = 0; + } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + forceColor = 1; + } + if ("FORCE_COLOR" in env) { + if (env.FORCE_COLOR === "true") { + forceColor = 1; + } else if (env.FORCE_COLOR === "false") { + forceColor = 0; + } else { + forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); + } + } + function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; + } + function supportsColor(haveStream, streamIsTTY) { + if (forceColor === 0) { + return 0; + } + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; + } + if (hasFlag("color=256")) { + return 2; + } + if (haveStream && !streamIsTTY && forceColor === void 0) { + return 0; + } + const min = forceColor || 0; + if (env.TERM === "dumb") { + return min; + } + if (process.platform === "win32") { + const osRelease = os2.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + return 1; + } + if ("CI" in env) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; + } + return min; + } + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + if (env.COLORTERM === "truecolor") { + return 3; + } + if ("TERM_PROGRAM" in env) { + const version3 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env.TERM_PROGRAM) { + case "iTerm.app": + return version3 >= 3 ? 3 : 2; + case "Apple_Terminal": + return 2; + } + } + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + if ("COLORTERM" in env) { + return 1; + } + return min; + } + function getSupportLevel(stream5) { + const level = supportsColor(stream5, stream5 && stream5.isTTY); + return translateLevel(level); + } + module2.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) + }; + } +}); + +// ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js +var require_util = __commonJS({ + "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"(exports2, module2) { + "use strict"; + var stringReplaceAll = (string, substring, replacer) => { + let index2 = string.indexOf(substring); + if (index2 === -1) { + return string; + } + const substringLength = substring.length; + let endIndex = 0; + let returnValue = ""; + do { + returnValue += string.substr(endIndex, index2 - endIndex) + substring + replacer; + endIndex = index2 + substringLength; + index2 = string.indexOf(substring, endIndex); + } while (index2 !== -1); + returnValue += string.substr(endIndex); + return returnValue; + }; + var stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index2) => { + let endIndex = 0; + let returnValue = ""; + do { + const gotCR = string[index2 - 1] === "\r"; + returnValue += string.substr(endIndex, (gotCR ? index2 - 1 : index2) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix; + endIndex = index2 + 1; + index2 = string.indexOf("\n", endIndex); + } while (index2 !== -1); + returnValue += string.substr(endIndex); + return returnValue; + }; + module2.exports = { + stringReplaceAll, + stringEncaseCRLFWithFirstIndex + }; + } +}); + +// ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js +var require_templates = __commonJS({ + "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"(exports2, module2) { + "use strict"; + var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi; + var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g; + var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/; + var ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi; + var ESCAPES = /* @__PURE__ */ new Map([ + ["n", "\n"], + ["r", "\r"], + ["t", " "], + ["b", "\b"], + ["f", "\f"], + ["v", "\v"], + ["0", "\0"], + ["\\", "\\"], + ["e", "\x1B"], + ["a", "\x07"] + ]); + function unescape3(c2) { + const u6 = c2[0] === "u"; + const bracket = c2[1] === "{"; + if (u6 && !bracket && c2.length === 5 || c2[0] === "x" && c2.length === 3) { + return String.fromCharCode(parseInt(c2.slice(1), 16)); + } + if (u6 && bracket) { + return String.fromCodePoint(parseInt(c2.slice(2, -1), 16)); + } + return ESCAPES.get(c2) || c2; + } + function parseArguments(name, arguments_) { + const results = []; + const chunks = arguments_.trim().split(/\s*,\s*/g); + let matches; + for (const chunk of chunks) { + const number = Number(chunk); + if (!Number.isNaN(number)) { + results.push(number); + } else if (matches = chunk.match(STRING_REGEX)) { + results.push(matches[2].replace(ESCAPE_REGEX, (m2, escape3, character) => escape3 ? unescape3(escape3) : character)); + } else { + throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`); + } + } + return results; + } + function parseStyle(style) { + STYLE_REGEX.lastIndex = 0; + const results = []; + let matches; + while ((matches = STYLE_REGEX.exec(style)) !== null) { + const name = matches[1]; + if (matches[2]) { + const args2 = parseArguments(name, matches[2]); + results.push([name].concat(args2)); + } else { + results.push([name]); + } + } + return results; + } + function buildStyle(chalk, styles) { + const enabled = {}; + for (const layer of styles) { + for (const style of layer.styles) { + enabled[style[0]] = layer.inverse ? null : style.slice(1); + } + } + let current = chalk; + for (const [styleName, styles2] of Object.entries(enabled)) { + if (!Array.isArray(styles2)) { + continue; + } + if (!(styleName in current)) { + throw new Error(`Unknown Chalk style: ${styleName}`); + } + current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName]; + } + return current; + } + module2.exports = (chalk, temporary) => { + const styles = []; + const chunks = []; + let chunk = []; + temporary.replace(TEMPLATE_REGEX, (m2, escapeCharacter, inverse, style, close, character) => { + if (escapeCharacter) { + chunk.push(unescape3(escapeCharacter)); + } else if (style) { + const string = chunk.join(""); + chunk = []; + chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string)); + styles.push({ inverse, styles: parseStyle(style) }); + } else if (close) { + if (styles.length === 0) { + throw new Error("Found extraneous } in Chalk template literal"); + } + chunks.push(buildStyle(chalk, styles)(chunk.join(""))); + chunk = []; + styles.pop(); + } else { + chunk.push(character); + } + }); + chunks.push(chunk.join("")); + if (styles.length > 0) { + const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`; + throw new Error(errMessage); + } + return chunks.join(""); + }; + } +}); + +// ../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js +var require_source = __commonJS({ + "../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"(exports2, module2) { + "use strict"; + var ansiStyles = require_ansi_styles(); + var { stdout: stdoutColor, stderr: stderrColor } = require_supports_color(); + var { + stringReplaceAll, + stringEncaseCRLFWithFirstIndex + } = require_util(); + var { isArray: isArray2 } = Array; + var levelMapping = [ + "ansi", + "ansi", + "ansi256", + "ansi16m" + ]; + var styles = /* @__PURE__ */ Object.create(null); + var applyOptions = (object, options = {}) => { + if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { + throw new Error("The `level` option should be an integer from 0 to 3"); + } + const colorLevel = stdoutColor ? stdoutColor.level : 0; + object.level = options.level === void 0 ? colorLevel : options.level; + }; + var ChalkClass = class { + constructor(options) { + return chalkFactory(options); + } + }; + var chalkFactory = (options) => { + const chalk2 = {}; + applyOptions(chalk2, options); + chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_); + Object.setPrototypeOf(chalk2, Chalk.prototype); + Object.setPrototypeOf(chalk2.template, chalk2); + chalk2.template.constructor = () => { + throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead."); + }; + chalk2.template.Instance = ChalkClass; + return chalk2.template; + }; + function Chalk(options) { + return chalkFactory(options); + } + for (const [styleName, style] of Object.entries(ansiStyles)) { + styles[styleName] = { + get() { + const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty); + Object.defineProperty(this, styleName, { value: builder }); + return builder; + } + }; + } + styles.visible = { + get() { + const builder = createBuilder(this, this._styler, true); + Object.defineProperty(this, "visible", { value: builder }); + return builder; + } + }; + var usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"]; + for (const model of usedModels) { + styles[model] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler); + return createBuilder(this, styler, this._isEmpty); + }; + } + }; + } + for (const model of usedModels) { + const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler); + return createBuilder(this, styler, this._isEmpty); + }; + } + }; + } + var proto = Object.defineProperties(() => { + }, { + ...styles, + level: { + enumerable: true, + get() { + return this._generator.level; + }, + set(level) { + this._generator.level = level; + } + } + }); + var createStyler = (open, close, parent2) => { + let openAll; + let closeAll; + if (parent2 === void 0) { + openAll = open; + closeAll = close; + } else { + openAll = parent2.openAll + open; + closeAll = close + parent2.closeAll; + } + return { + open, + close, + openAll, + closeAll, + parent: parent2 + }; + }; + var createBuilder = (self2, _styler, _isEmpty) => { + const builder = (...arguments_) => { + if (isArray2(arguments_[0]) && isArray2(arguments_[0].raw)) { + return applyStyle(builder, chalkTag(builder, ...arguments_)); + } + return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); + }; + Object.setPrototypeOf(builder, proto); + builder._generator = self2; + builder._styler = _styler; + builder._isEmpty = _isEmpty; + return builder; + }; + var applyStyle = (self2, string) => { + if (self2.level <= 0 || !string) { + return self2._isEmpty ? "" : string; + } + let styler = self2._styler; + if (styler === void 0) { + return string; + } + const { openAll, closeAll } = styler; + if (string.indexOf("\x1B") !== -1) { + while (styler !== void 0) { + string = stringReplaceAll(string, styler.close, styler.open); + styler = styler.parent; + } + } + const lfIndex = string.indexOf("\n"); + if (lfIndex !== -1) { + string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); + } + return openAll + string + closeAll; + }; + var template; + var chalkTag = (chalk2, ...strings) => { + const [firstString] = strings; + if (!isArray2(firstString) || !isArray2(firstString.raw)) { + return strings.join(" "); + } + const arguments_ = strings.slice(1); + const parts = [firstString.raw[0]]; + for (let i6 = 1; i6 < firstString.length; i6++) { + parts.push( + String(arguments_[i6 - 1]).replace(/[{}\\]/g, "\\$&"), + String(firstString.raw[i6]) + ); + } + if (template === void 0) { + template = require_templates(); + } + return template(chalk2, parts.join("")); + }; + Object.defineProperties(Chalk.prototype, styles); + var chalk = Chalk(); + chalk.supportsColor = stdoutColor; + chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 }); + chalk.stderr.supportsColor = stderrColor; + module2.exports = chalk; + } +}); + +// ../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js +var require_mimic_fn = __commonJS({ + "../../node_modules/.pnpm/mimic-fn@2.1.0/node_modules/mimic-fn/index.js"(exports2, module2) { + "use strict"; + var mimicFn = (to, from) => { + for (const prop2 of Reflect.ownKeys(from)) { + Object.defineProperty(to, prop2, Object.getOwnPropertyDescriptor(from, prop2)); + } + return to; + }; + module2.exports = mimicFn; + module2.exports.default = mimicFn; + } +}); + +// ../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js +var require_onetime = __commonJS({ + "../../node_modules/.pnpm/onetime@5.1.2/node_modules/onetime/index.js"(exports2, module2) { + "use strict"; + var mimicFn = require_mimic_fn(); + var calledFunctions = /* @__PURE__ */ new WeakMap(); + var onetime = (function_, options = {}) => { + if (typeof function_ !== "function") { + throw new TypeError("Expected a function"); + } + let returnValue; + let callCount = 0; + const functionName = function_.displayName || function_.name || ""; + const onetime2 = function(...arguments_) { + calledFunctions.set(onetime2, ++callCount); + if (callCount === 1) { + returnValue = function_.apply(this, arguments_); + function_ = null; + } else if (options.throw === true) { + throw new Error(`Function \`${functionName}\` can only be called once`); + } + return returnValue; + }; + mimicFn(onetime2, function_); + calledFunctions.set(onetime2, callCount); + return onetime2; + }; + module2.exports = onetime; + module2.exports.default = onetime; + module2.exports.callCount = (function_) => { + if (!calledFunctions.has(function_)) { + throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`); + } + return calledFunctions.get(function_); + }; + } +}); + +// ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +var require_signals = __commonJS({ + "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js"(exports2, module2) { + module2.exports = [ + "SIGABRT", + "SIGALRM", + "SIGHUP", + "SIGINT", + "SIGTERM" + ]; + if (process.platform !== "win32") { + module2.exports.push( + "SIGVTALRM", + "SIGXCPU", + "SIGXFSZ", + "SIGUSR2", + "SIGTRAP", + "SIGSYS", + "SIGQUIT", + "SIGIOT" + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ); + } + if (process.platform === "linux") { + module2.exports.push( + "SIGIO", + "SIGPOLL", + "SIGPWR", + "SIGSTKFLT", + "SIGUNUSED" + ); + } + } +}); + +// ../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +var require_signal_exit = __commonJS({ + "../../node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js"(exports2, module2) { + var process2 = global.process; + var processOk = function(process3) { + return process3 && typeof process3 === "object" && typeof process3.removeListener === "function" && typeof process3.emit === "function" && typeof process3.reallyExit === "function" && typeof process3.listeners === "function" && typeof process3.kill === "function" && typeof process3.pid === "number" && typeof process3.on === "function"; + }; + if (!processOk(process2)) { + module2.exports = function() { + return function() { + }; + }; + } else { + assert3 = __require("assert"); + signals = require_signals(); + isWin = /^win/i.test(process2.platform); + EE = __require("events"); + if (typeof EE !== "function") { + EE = EE.EventEmitter; + } + if (process2.__signal_exit_emitter__) { + emitter = process2.__signal_exit_emitter__; + } else { + emitter = process2.__signal_exit_emitter__ = new EE(); + emitter.count = 0; + emitter.emitted = {}; + } + if (!emitter.infinite) { + emitter.setMaxListeners(Infinity); + emitter.infinite = true; + } + module2.exports = function(cb, opts) { + if (!processOk(global.process)) { + return function() { + }; + } + assert3.equal(typeof cb, "function", "a callback must be provided for exit handler"); + if (loaded === false) { + load2(); + } + var ev = "exit"; + if (opts && opts.alwaysLast) { + ev = "afterexit"; + } + var remove2 = function() { + emitter.removeListener(ev, cb); + if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) { + unload(); + } + }; + emitter.on(ev, cb); + return remove2; + }; + unload = function unload2() { + if (!loaded || !processOk(global.process)) { + return; + } + loaded = false; + signals.forEach(function(sig) { + try { + process2.removeListener(sig, sigListeners[sig]); + } catch (er) { + } + }); + process2.emit = originalProcessEmit; + process2.reallyExit = originalProcessReallyExit; + emitter.count -= 1; + }; + module2.exports.unload = unload; + emit = function emit2(event, code, signal) { + if (emitter.emitted[event]) { + return; + } + emitter.emitted[event] = true; + emitter.emit(event, code, signal); + }; + sigListeners = {}; + signals.forEach(function(sig) { + sigListeners[sig] = function listener() { + if (!processOk(global.process)) { + return; + } + var listeners = process2.listeners(sig); + if (listeners.length === emitter.count) { + unload(); + emit("exit", null, sig); + emit("afterexit", null, sig); + if (isWin && sig === "SIGHUP") { + sig = "SIGINT"; + } + process2.kill(process2.pid, sig); + } + }; + }); + module2.exports.signals = function() { + return signals; + }; + loaded = false; + load2 = function load3() { + if (loaded || !processOk(global.process)) { + return; + } + loaded = true; + emitter.count += 1; + signals = signals.filter(function(sig) { + try { + process2.on(sig, sigListeners[sig]); + return true; + } catch (er) { + return false; + } + }); + process2.emit = processEmit; + process2.reallyExit = processReallyExit; + }; + module2.exports.load = load2; + originalProcessReallyExit = process2.reallyExit; + processReallyExit = function processReallyExit2(code) { + if (!processOk(global.process)) { + return; + } + process2.exitCode = code || /* istanbul ignore next */ + 0; + emit("exit", process2.exitCode, null); + emit("afterexit", process2.exitCode, null); + originalProcessReallyExit.call(process2, process2.exitCode); + }; + originalProcessEmit = process2.emit; + processEmit = function processEmit2(ev, arg) { + if (ev === "exit" && processOk(global.process)) { + if (arg !== void 0) { + process2.exitCode = arg; + } + var ret = originalProcessEmit.apply(this, arguments); + emit("exit", process2.exitCode, null); + emit("afterexit", process2.exitCode, null); + return ret; + } else { + return originalProcessEmit.apply(this, arguments); + } + }; + } + var assert3; + var signals; + var isWin; + var EE; + var emitter; + var unload; + var emit; + var sigListeners; + var loaded; + var load2; + var originalProcessReallyExit; + var processReallyExit; + var originalProcessEmit; + var processEmit; + } +}); + +// ../../node_modules/.pnpm/restore-cursor@3.1.0/node_modules/restore-cursor/index.js +var require_restore_cursor = __commonJS({ + "../../node_modules/.pnpm/restore-cursor@3.1.0/node_modules/restore-cursor/index.js"(exports2, module2) { + "use strict"; + var onetime = require_onetime(); + var signalExit = require_signal_exit(); + module2.exports = onetime(() => { + signalExit(() => { + process.stderr.write("\x1B[?25h"); + }, { alwaysLast: true }); + }); + } +}); + +// ../../node_modules/.pnpm/cli-cursor@3.1.0/node_modules/cli-cursor/index.js +var require_cli_cursor = __commonJS({ + "../../node_modules/.pnpm/cli-cursor@3.1.0/node_modules/cli-cursor/index.js"(exports2) { + "use strict"; + var restoreCursor = require_restore_cursor(); + var isHidden = false; + exports2.show = (writableStream = process.stderr) => { + if (!writableStream.isTTY) { + return; + } + isHidden = false; + writableStream.write("\x1B[?25h"); + }; + exports2.hide = (writableStream = process.stderr) => { + if (!writableStream.isTTY) { + return; + } + restoreCursor(); + isHidden = true; + writableStream.write("\x1B[?25l"); + }; + exports2.toggle = (force, writableStream) => { + if (force !== void 0) { + isHidden = force; + } + if (isHidden) { + exports2.show(writableStream); + } else { + exports2.hide(writableStream); + } + }; + } +}); + +// ../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json +var require_spinners = __commonJS({ + "../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/spinners.json"(exports2, module2) { + module2.exports = { + dots: { + interval: 80, + frames: [ + "\u280B", + "\u2819", + "\u2839", + "\u2838", + "\u283C", + "\u2834", + "\u2826", + "\u2827", + "\u2807", + "\u280F" + ] + }, + dots2: { + interval: 80, + frames: [ + "\u28FE", + "\u28FD", + "\u28FB", + "\u28BF", + "\u287F", + "\u28DF", + "\u28EF", + "\u28F7" + ] + }, + dots3: { + interval: 80, + frames: [ + "\u280B", + "\u2819", + "\u281A", + "\u281E", + "\u2816", + "\u2826", + "\u2834", + "\u2832", + "\u2833", + "\u2813" + ] + }, + dots4: { + interval: 80, + frames: [ + "\u2804", + "\u2806", + "\u2807", + "\u280B", + "\u2819", + "\u2838", + "\u2830", + "\u2820", + "\u2830", + "\u2838", + "\u2819", + "\u280B", + "\u2807", + "\u2806" + ] + }, + dots5: { + interval: 80, + frames: [ + "\u280B", + "\u2819", + "\u281A", + "\u2812", + "\u2802", + "\u2802", + "\u2812", + "\u2832", + "\u2834", + "\u2826", + "\u2816", + "\u2812", + "\u2810", + "\u2810", + "\u2812", + "\u2813", + "\u280B" + ] + }, + dots6: { + interval: 80, + frames: [ + "\u2801", + "\u2809", + "\u2819", + "\u281A", + "\u2812", + "\u2802", + "\u2802", + "\u2812", + "\u2832", + "\u2834", + "\u2824", + "\u2804", + "\u2804", + "\u2824", + "\u2834", + "\u2832", + "\u2812", + "\u2802", + "\u2802", + "\u2812", + "\u281A", + "\u2819", + "\u2809", + "\u2801" + ] + }, + dots7: { + interval: 80, + frames: [ + "\u2808", + "\u2809", + "\u280B", + "\u2813", + "\u2812", + "\u2810", + "\u2810", + "\u2812", + "\u2816", + "\u2826", + "\u2824", + "\u2820", + "\u2820", + "\u2824", + "\u2826", + "\u2816", + "\u2812", + "\u2810", + "\u2810", + "\u2812", + "\u2813", + "\u280B", + "\u2809", + "\u2808" + ] + }, + dots8: { + interval: 80, + frames: [ + "\u2801", + "\u2801", + "\u2809", + "\u2819", + "\u281A", + "\u2812", + "\u2802", + "\u2802", + "\u2812", + "\u2832", + "\u2834", + "\u2824", + "\u2804", + "\u2804", + "\u2824", + "\u2820", + "\u2820", + "\u2824", + "\u2826", + "\u2816", + "\u2812", + "\u2810", + "\u2810", + "\u2812", + "\u2813", + "\u280B", + "\u2809", + "\u2808", + "\u2808" + ] + }, + dots9: { + interval: 80, + frames: [ + "\u28B9", + "\u28BA", + "\u28BC", + "\u28F8", + "\u28C7", + "\u2867", + "\u2857", + "\u284F" + ] + }, + dots10: { + interval: 80, + frames: [ + "\u2884", + "\u2882", + "\u2881", + "\u2841", + "\u2848", + "\u2850", + "\u2860" + ] + }, + dots11: { + interval: 100, + frames: [ + "\u2801", + "\u2802", + "\u2804", + "\u2840", + "\u2880", + "\u2820", + "\u2810", + "\u2808" + ] + }, + dots12: { + interval: 80, + frames: [ + "\u2880\u2800", + "\u2840\u2800", + "\u2804\u2800", + "\u2882\u2800", + "\u2842\u2800", + "\u2805\u2800", + "\u2883\u2800", + "\u2843\u2800", + "\u280D\u2800", + "\u288B\u2800", + "\u284B\u2800", + "\u280D\u2801", + "\u288B\u2801", + "\u284B\u2801", + "\u280D\u2809", + "\u280B\u2809", + "\u280B\u2809", + "\u2809\u2819", + "\u2809\u2819", + "\u2809\u2829", + "\u2808\u2899", + "\u2808\u2859", + "\u2888\u2829", + "\u2840\u2899", + "\u2804\u2859", + "\u2882\u2829", + "\u2842\u2898", + "\u2805\u2858", + "\u2883\u2828", + "\u2843\u2890", + "\u280D\u2850", + "\u288B\u2820", + "\u284B\u2880", + "\u280D\u2841", + "\u288B\u2801", + "\u284B\u2801", + "\u280D\u2809", + "\u280B\u2809", + "\u280B\u2809", + "\u2809\u2819", + "\u2809\u2819", + "\u2809\u2829", + "\u2808\u2899", + "\u2808\u2859", + "\u2808\u2829", + "\u2800\u2899", + "\u2800\u2859", + "\u2800\u2829", + "\u2800\u2898", + "\u2800\u2858", + "\u2800\u2828", + "\u2800\u2890", + "\u2800\u2850", + "\u2800\u2820", + "\u2800\u2880", + "\u2800\u2840" + ] + }, + dots13: { + interval: 80, + frames: [ + "\u28FC", + "\u28F9", + "\u28BB", + "\u283F", + "\u285F", + "\u28CF", + "\u28E7", + "\u28F6" + ] + }, + dots8Bit: { + interval: 80, + frames: [ + "\u2800", + "\u2801", + "\u2802", + "\u2803", + "\u2804", + "\u2805", + "\u2806", + "\u2807", + "\u2840", + "\u2841", + "\u2842", + "\u2843", + "\u2844", + "\u2845", + "\u2846", + "\u2847", + "\u2808", + "\u2809", + "\u280A", + "\u280B", + "\u280C", + "\u280D", + "\u280E", + "\u280F", + "\u2848", + "\u2849", + "\u284A", + "\u284B", + "\u284C", + "\u284D", + "\u284E", + "\u284F", + "\u2810", + "\u2811", + "\u2812", + "\u2813", + "\u2814", + "\u2815", + "\u2816", + "\u2817", + "\u2850", + "\u2851", + "\u2852", + "\u2853", + "\u2854", + "\u2855", + "\u2856", + "\u2857", + "\u2818", + "\u2819", + "\u281A", + "\u281B", + "\u281C", + "\u281D", + "\u281E", + "\u281F", + "\u2858", + "\u2859", + "\u285A", + "\u285B", + "\u285C", + "\u285D", + "\u285E", + "\u285F", + "\u2820", + "\u2821", + "\u2822", + "\u2823", + "\u2824", + "\u2825", + "\u2826", + "\u2827", + "\u2860", + "\u2861", + "\u2862", + "\u2863", + "\u2864", + "\u2865", + "\u2866", + "\u2867", + "\u2828", + "\u2829", + "\u282A", + "\u282B", + "\u282C", + "\u282D", + "\u282E", + "\u282F", + "\u2868", + "\u2869", + "\u286A", + "\u286B", + "\u286C", + "\u286D", + "\u286E", + "\u286F", + "\u2830", + "\u2831", + "\u2832", + "\u2833", + "\u2834", + "\u2835", + "\u2836", + "\u2837", + "\u2870", + "\u2871", + "\u2872", + "\u2873", + "\u2874", + "\u2875", + "\u2876", + "\u2877", + "\u2838", + "\u2839", + "\u283A", + "\u283B", + "\u283C", + "\u283D", + "\u283E", + "\u283F", + "\u2878", + "\u2879", + "\u287A", + "\u287B", + "\u287C", + "\u287D", + "\u287E", + "\u287F", + "\u2880", + "\u2881", + "\u2882", + "\u2883", + "\u2884", + "\u2885", + "\u2886", + "\u2887", + "\u28C0", + "\u28C1", + "\u28C2", + "\u28C3", + "\u28C4", + "\u28C5", + "\u28C6", + "\u28C7", + "\u2888", + "\u2889", + "\u288A", + "\u288B", + "\u288C", + "\u288D", + "\u288E", + "\u288F", + "\u28C8", + "\u28C9", + "\u28CA", + "\u28CB", + "\u28CC", + "\u28CD", + "\u28CE", + "\u28CF", + "\u2890", + "\u2891", + "\u2892", + "\u2893", + "\u2894", + "\u2895", + "\u2896", + "\u2897", + "\u28D0", + "\u28D1", + "\u28D2", + "\u28D3", + "\u28D4", + "\u28D5", + "\u28D6", + "\u28D7", + "\u2898", + "\u2899", + "\u289A", + "\u289B", + "\u289C", + "\u289D", + "\u289E", + "\u289F", + "\u28D8", + "\u28D9", + "\u28DA", + "\u28DB", + "\u28DC", + "\u28DD", + "\u28DE", + "\u28DF", + "\u28A0", + "\u28A1", + "\u28A2", + "\u28A3", + "\u28A4", + "\u28A5", + "\u28A6", + "\u28A7", + "\u28E0", + "\u28E1", + "\u28E2", + "\u28E3", + "\u28E4", + "\u28E5", + "\u28E6", + "\u28E7", + "\u28A8", + "\u28A9", + "\u28AA", + "\u28AB", + "\u28AC", + "\u28AD", + "\u28AE", + "\u28AF", + "\u28E8", + "\u28E9", + "\u28EA", + "\u28EB", + "\u28EC", + "\u28ED", + "\u28EE", + "\u28EF", + "\u28B0", + "\u28B1", + "\u28B2", + "\u28B3", + "\u28B4", + "\u28B5", + "\u28B6", + "\u28B7", + "\u28F0", + "\u28F1", + "\u28F2", + "\u28F3", + "\u28F4", + "\u28F5", + "\u28F6", + "\u28F7", + "\u28B8", + "\u28B9", + "\u28BA", + "\u28BB", + "\u28BC", + "\u28BD", + "\u28BE", + "\u28BF", + "\u28F8", + "\u28F9", + "\u28FA", + "\u28FB", + "\u28FC", + "\u28FD", + "\u28FE", + "\u28FF" + ] + }, + sand: { + interval: 80, + frames: [ + "\u2801", + "\u2802", + "\u2804", + "\u2840", + "\u2848", + "\u2850", + "\u2860", + "\u28C0", + "\u28C1", + "\u28C2", + "\u28C4", + "\u28CC", + "\u28D4", + "\u28E4", + "\u28E5", + "\u28E6", + "\u28EE", + "\u28F6", + "\u28F7", + "\u28FF", + "\u287F", + "\u283F", + "\u289F", + "\u281F", + "\u285B", + "\u281B", + "\u282B", + "\u288B", + "\u280B", + "\u280D", + "\u2849", + "\u2809", + "\u2811", + "\u2821", + "\u2881" + ] + }, + line: { + interval: 130, + frames: [ + "-", + "\\", + "|", + "/" + ] + }, + line2: { + interval: 100, + frames: [ + "\u2802", + "-", + "\u2013", + "\u2014", + "\u2013", + "-" + ] + }, + pipe: { + interval: 100, + frames: [ + "\u2524", + "\u2518", + "\u2534", + "\u2514", + "\u251C", + "\u250C", + "\u252C", + "\u2510" + ] + }, + simpleDots: { + interval: 400, + frames: [ + ". ", + ".. ", + "...", + " " + ] + }, + simpleDotsScrolling: { + interval: 200, + frames: [ + ". ", + ".. ", + "...", + " ..", + " .", + " " + ] + }, + star: { + interval: 70, + frames: [ + "\u2736", + "\u2738", + "\u2739", + "\u273A", + "\u2739", + "\u2737" + ] + }, + star2: { + interval: 80, + frames: [ + "+", + "x", + "*" + ] + }, + flip: { + interval: 70, + frames: [ + "_", + "_", + "_", + "-", + "`", + "`", + "'", + "\xB4", + "-", + "_", + "_", + "_" + ] + }, + hamburger: { + interval: 100, + frames: [ + "\u2631", + "\u2632", + "\u2634" + ] + }, + growVertical: { + interval: 120, + frames: [ + "\u2581", + "\u2583", + "\u2584", + "\u2585", + "\u2586", + "\u2587", + "\u2586", + "\u2585", + "\u2584", + "\u2583" + ] + }, + growHorizontal: { + interval: 120, + frames: [ + "\u258F", + "\u258E", + "\u258D", + "\u258C", + "\u258B", + "\u258A", + "\u2589", + "\u258A", + "\u258B", + "\u258C", + "\u258D", + "\u258E" + ] + }, + balloon: { + interval: 140, + frames: [ + " ", + ".", + "o", + "O", + "@", + "*", + " " + ] + }, + balloon2: { + interval: 120, + frames: [ + ".", + "o", + "O", + "\xB0", + "O", + "o", + "." + ] + }, + noise: { + interval: 100, + frames: [ + "\u2593", + "\u2592", + "\u2591" + ] + }, + bounce: { + interval: 120, + frames: [ + "\u2801", + "\u2802", + "\u2804", + "\u2802" + ] + }, + boxBounce: { + interval: 120, + frames: [ + "\u2596", + "\u2598", + "\u259D", + "\u2597" + ] + }, + boxBounce2: { + interval: 100, + frames: [ + "\u258C", + "\u2580", + "\u2590", + "\u2584" + ] + }, + triangle: { + interval: 50, + frames: [ + "\u25E2", + "\u25E3", + "\u25E4", + "\u25E5" + ] + }, + binary: { + interval: 80, + frames: [ + "010010", + "001100", + "100101", + "111010", + "111101", + "010111", + "101011", + "111000", + "110011", + "110101" + ] + }, + arc: { + interval: 100, + frames: [ + "\u25DC", + "\u25E0", + "\u25DD", + "\u25DE", + "\u25E1", + "\u25DF" + ] + }, + circle: { + interval: 120, + frames: [ + "\u25E1", + "\u2299", + "\u25E0" + ] + }, + squareCorners: { + interval: 180, + frames: [ + "\u25F0", + "\u25F3", + "\u25F2", + "\u25F1" + ] + }, + circleQuarters: { + interval: 120, + frames: [ + "\u25F4", + "\u25F7", + "\u25F6", + "\u25F5" + ] + }, + circleHalves: { + interval: 50, + frames: [ + "\u25D0", + "\u25D3", + "\u25D1", + "\u25D2" + ] + }, + squish: { + interval: 100, + frames: [ + "\u256B", + "\u256A" + ] + }, + toggle: { + interval: 250, + frames: [ + "\u22B6", + "\u22B7" + ] + }, + toggle2: { + interval: 80, + frames: [ + "\u25AB", + "\u25AA" + ] + }, + toggle3: { + interval: 120, + frames: [ + "\u25A1", + "\u25A0" + ] + }, + toggle4: { + interval: 100, + frames: [ + "\u25A0", + "\u25A1", + "\u25AA", + "\u25AB" + ] + }, + toggle5: { + interval: 100, + frames: [ + "\u25AE", + "\u25AF" + ] + }, + toggle6: { + interval: 300, + frames: [ + "\u101D", + "\u1040" + ] + }, + toggle7: { + interval: 80, + frames: [ + "\u29BE", + "\u29BF" + ] + }, + toggle8: { + interval: 100, + frames: [ + "\u25CD", + "\u25CC" + ] + }, + toggle9: { + interval: 100, + frames: [ + "\u25C9", + "\u25CE" + ] + }, + toggle10: { + interval: 100, + frames: [ + "\u3282", + "\u3280", + "\u3281" + ] + }, + toggle11: { + interval: 50, + frames: [ + "\u29C7", + "\u29C6" + ] + }, + toggle12: { + interval: 120, + frames: [ + "\u2617", + "\u2616" + ] + }, + toggle13: { + interval: 80, + frames: [ + "=", + "*", + "-" + ] + }, + arrow: { + interval: 100, + frames: [ + "\u2190", + "\u2196", + "\u2191", + "\u2197", + "\u2192", + "\u2198", + "\u2193", + "\u2199" + ] + }, + arrow2: { + interval: 80, + frames: [ + "\u2B06\uFE0F ", + "\u2197\uFE0F ", + "\u27A1\uFE0F ", + "\u2198\uFE0F ", + "\u2B07\uFE0F ", + "\u2199\uFE0F ", + "\u2B05\uFE0F ", + "\u2196\uFE0F " + ] + }, + arrow3: { + interval: 120, + frames: [ + "\u25B9\u25B9\u25B9\u25B9\u25B9", + "\u25B8\u25B9\u25B9\u25B9\u25B9", + "\u25B9\u25B8\u25B9\u25B9\u25B9", + "\u25B9\u25B9\u25B8\u25B9\u25B9", + "\u25B9\u25B9\u25B9\u25B8\u25B9", + "\u25B9\u25B9\u25B9\u25B9\u25B8" + ] + }, + bouncingBar: { + interval: 80, + frames: [ + "[ ]", + "[= ]", + "[== ]", + "[=== ]", + "[====]", + "[ ===]", + "[ ==]", + "[ =]", + "[ ]", + "[ =]", + "[ ==]", + "[ ===]", + "[====]", + "[=== ]", + "[== ]", + "[= ]" + ] + }, + bouncingBall: { + interval: 80, + frames: [ + "( \u25CF )", + "( \u25CF )", + "( \u25CF )", + "( \u25CF )", + "( \u25CF)", + "( \u25CF )", + "( \u25CF )", + "( \u25CF )", + "( \u25CF )", + "(\u25CF )" + ] + }, + smiley: { + interval: 200, + frames: [ + "\u{1F604} ", + "\u{1F61D} " + ] + }, + monkey: { + interval: 300, + frames: [ + "\u{1F648} ", + "\u{1F648} ", + "\u{1F649} ", + "\u{1F64A} " + ] + }, + hearts: { + interval: 100, + frames: [ + "\u{1F49B} ", + "\u{1F499} ", + "\u{1F49C} ", + "\u{1F49A} ", + "\u2764\uFE0F " + ] + }, + clock: { + interval: 100, + frames: [ + "\u{1F55B} ", + "\u{1F550} ", + "\u{1F551} ", + "\u{1F552} ", + "\u{1F553} ", + "\u{1F554} ", + "\u{1F555} ", + "\u{1F556} ", + "\u{1F557} ", + "\u{1F558} ", + "\u{1F559} ", + "\u{1F55A} " + ] + }, + earth: { + interval: 180, + frames: [ + "\u{1F30D} ", + "\u{1F30E} ", + "\u{1F30F} " + ] + }, + material: { + interval: 17, + frames: [ + "\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581", + "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581", + "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581", + "\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588", + "\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588", + "\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588", + "\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588", + "\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588", + "\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588", + "\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588", + "\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581", + "\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581", + "\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581" + ] + }, + moon: { + interval: 80, + frames: [ + "\u{1F311} ", + "\u{1F312} ", + "\u{1F313} ", + "\u{1F314} ", + "\u{1F315} ", + "\u{1F316} ", + "\u{1F317} ", + "\u{1F318} " + ] + }, + runner: { + interval: 140, + frames: [ + "\u{1F6B6} ", + "\u{1F3C3} " + ] + }, + pong: { + interval: 80, + frames: [ + "\u2590\u2802 \u258C", + "\u2590\u2808 \u258C", + "\u2590 \u2802 \u258C", + "\u2590 \u2820 \u258C", + "\u2590 \u2840 \u258C", + "\u2590 \u2820 \u258C", + "\u2590 \u2802 \u258C", + "\u2590 \u2808 \u258C", + "\u2590 \u2802 \u258C", + "\u2590 \u2820 \u258C", + "\u2590 \u2840 \u258C", + "\u2590 \u2820 \u258C", + "\u2590 \u2802 \u258C", + "\u2590 \u2808 \u258C", + "\u2590 \u2802\u258C", + "\u2590 \u2820\u258C", + "\u2590 \u2840\u258C", + "\u2590 \u2820 \u258C", + "\u2590 \u2802 \u258C", + "\u2590 \u2808 \u258C", + "\u2590 \u2802 \u258C", + "\u2590 \u2820 \u258C", + "\u2590 \u2840 \u258C", + "\u2590 \u2820 \u258C", + "\u2590 \u2802 \u258C", + "\u2590 \u2808 \u258C", + "\u2590 \u2802 \u258C", + "\u2590 \u2820 \u258C", + "\u2590 \u2840 \u258C", + "\u2590\u2820 \u258C" + ] + }, + shark: { + interval: 120, + frames: [ + "\u2590|\\____________\u258C", + "\u2590_|\\___________\u258C", + "\u2590__|\\__________\u258C", + "\u2590___|\\_________\u258C", + "\u2590____|\\________\u258C", + "\u2590_____|\\_______\u258C", + "\u2590______|\\______\u258C", + "\u2590_______|\\_____\u258C", + "\u2590________|\\____\u258C", + "\u2590_________|\\___\u258C", + "\u2590__________|\\__\u258C", + "\u2590___________|\\_\u258C", + "\u2590____________|\\\u258C", + "\u2590____________/|\u258C", + "\u2590___________/|_\u258C", + "\u2590__________/|__\u258C", + "\u2590_________/|___\u258C", + "\u2590________/|____\u258C", + "\u2590_______/|_____\u258C", + "\u2590______/|______\u258C", + "\u2590_____/|_______\u258C", + "\u2590____/|________\u258C", + "\u2590___/|_________\u258C", + "\u2590__/|__________\u258C", + "\u2590_/|___________\u258C", + "\u2590/|____________\u258C" + ] + }, + dqpb: { + interval: 100, + frames: [ + "d", + "q", + "p", + "b" + ] + }, + weather: { + interval: 100, + frames: [ + "\u2600\uFE0F ", + "\u2600\uFE0F ", + "\u2600\uFE0F ", + "\u{1F324} ", + "\u26C5\uFE0F ", + "\u{1F325} ", + "\u2601\uFE0F ", + "\u{1F327} ", + "\u{1F328} ", + "\u{1F327} ", + "\u{1F328} ", + "\u{1F327} ", + "\u{1F328} ", + "\u26C8 ", + "\u{1F328} ", + "\u{1F327} ", + "\u{1F328} ", + "\u2601\uFE0F ", + "\u{1F325} ", + "\u26C5\uFE0F ", + "\u{1F324} ", + "\u2600\uFE0F ", + "\u2600\uFE0F " + ] + }, + christmas: { + interval: 400, + frames: [ + "\u{1F332}", + "\u{1F384}" + ] + }, + grenade: { + interval: 80, + frames: [ + "\u060C ", + "\u2032 ", + " \xB4 ", + " \u203E ", + " \u2E0C", + " \u2E0A", + " |", + " \u204E", + " \u2055", + " \u0DF4 ", + " \u2053", + " ", + " ", + " " + ] + }, + point: { + interval: 125, + frames: [ + "\u2219\u2219\u2219", + "\u25CF\u2219\u2219", + "\u2219\u25CF\u2219", + "\u2219\u2219\u25CF", + "\u2219\u2219\u2219" + ] + }, + layer: { + interval: 150, + frames: [ + "-", + "=", + "\u2261" + ] + }, + betaWave: { + interval: 80, + frames: [ + "\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2", + "\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2", + "\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2", + "\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2", + "\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2", + "\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2", + "\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1" + ] + }, + fingerDance: { + interval: 160, + frames: [ + "\u{1F918} ", + "\u{1F91F} ", + "\u{1F596} ", + "\u270B ", + "\u{1F91A} ", + "\u{1F446} " + ] + }, + fistBump: { + interval: 80, + frames: [ + "\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ", + "\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ", + "\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ", + "\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ", + "\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ", + "\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ", + "\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 " + ] + }, + soccerHeader: { + interval: 80, + frames: [ + " \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ", + "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", + "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", + "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", + "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", + "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", + "\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ", + "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", + "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", + "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", + "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ", + "\u{1F9D1} \u26BD\uFE0F \u{1F9D1} " + ] + }, + mindblown: { + interval: 160, + frames: [ + "\u{1F610} ", + "\u{1F610} ", + "\u{1F62E} ", + "\u{1F62E} ", + "\u{1F626} ", + "\u{1F626} ", + "\u{1F627} ", + "\u{1F627} ", + "\u{1F92F} ", + "\u{1F4A5} ", + "\u2728 ", + "\u3000 ", + "\u3000 ", + "\u3000 " + ] + }, + speaker: { + interval: 160, + frames: [ + "\u{1F508} ", + "\u{1F509} ", + "\u{1F50A} ", + "\u{1F509} " + ] + }, + orangePulse: { + interval: 100, + frames: [ + "\u{1F538} ", + "\u{1F536} ", + "\u{1F7E0} ", + "\u{1F7E0} ", + "\u{1F536} " + ] + }, + bluePulse: { + interval: 100, + frames: [ + "\u{1F539} ", + "\u{1F537} ", + "\u{1F535} ", + "\u{1F535} ", + "\u{1F537} " + ] + }, + orangeBluePulse: { + interval: 100, + frames: [ + "\u{1F538} ", + "\u{1F536} ", + "\u{1F7E0} ", + "\u{1F7E0} ", + "\u{1F536} ", + "\u{1F539} ", + "\u{1F537} ", + "\u{1F535} ", + "\u{1F535} ", + "\u{1F537} " + ] + }, + timeTravel: { + interval: 100, + frames: [ + "\u{1F55B} ", + "\u{1F55A} ", + "\u{1F559} ", + "\u{1F558} ", + "\u{1F557} ", + "\u{1F556} ", + "\u{1F555} ", + "\u{1F554} ", + "\u{1F553} ", + "\u{1F552} ", + "\u{1F551} ", + "\u{1F550} " + ] + }, + aesthetic: { + interval: 80, + frames: [ + "\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1", + "\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1", + "\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1", + "\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1", + "\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1", + "\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1", + "\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0", + "\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1" + ] + }, + dwarfFortress: { + interval: 80, + frames: [ + " \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + "\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + "\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + "\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + "\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + "\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + "\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + "\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + "\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + "\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A \u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2593\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2593\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2592\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2592\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2591\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2591\u2588\u2588\xA3\xA3\xA3 ", + " \u263A \u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2588\u2588\xA3\xA3\xA3 ", + " \u263A\u2593\u2588\xA3\xA3\xA3 ", + " \u263A\u2593\u2588\xA3\xA3\xA3 ", + " \u263A\u2592\u2588\xA3\xA3\xA3 ", + " \u263A\u2592\u2588\xA3\xA3\xA3 ", + " \u263A\u2591\u2588\xA3\xA3\xA3 ", + " \u263A\u2591\u2588\xA3\xA3\xA3 ", + " \u263A \u2588\xA3\xA3\xA3 ", + " \u263A\u2588\xA3\xA3\xA3 ", + " \u263A\u2588\xA3\xA3\xA3 ", + " \u263A\u2593\xA3\xA3\xA3 ", + " \u263A\u2593\xA3\xA3\xA3 ", + " \u263A\u2592\xA3\xA3\xA3 ", + " \u263A\u2592\xA3\xA3\xA3 ", + " \u263A\u2591\xA3\xA3\xA3 ", + " \u263A\u2591\xA3\xA3\xA3 ", + " \u263A \xA3\xA3\xA3 ", + " \u263A\xA3\xA3\xA3 ", + " \u263A\xA3\xA3\xA3 ", + " \u263A\u2593\xA3\xA3 ", + " \u263A\u2593\xA3\xA3 ", + " \u263A\u2592\xA3\xA3 ", + " \u263A\u2592\xA3\xA3 ", + " \u263A\u2591\xA3\xA3 ", + " \u263A\u2591\xA3\xA3 ", + " \u263A \xA3\xA3 ", + " \u263A\xA3\xA3 ", + " \u263A\xA3\xA3 ", + " \u263A\u2593\xA3 ", + " \u263A\u2593\xA3 ", + " \u263A\u2592\xA3 ", + " \u263A\u2592\xA3 ", + " \u263A\u2591\xA3 ", + " \u263A\u2591\xA3 ", + " \u263A \xA3 ", + " \u263A\xA3 ", + " \u263A\xA3 ", + " \u263A\u2593 ", + " \u263A\u2593 ", + " \u263A\u2592 ", + " \u263A\u2592 ", + " \u263A\u2591 ", + " \u263A\u2591 ", + " \u263A ", + " \u263A &", + " \u263A \u263C&", + " \u263A \u263C &", + " \u263A\u263C &", + " \u263A\u263C & ", + " \u203C & ", + " \u263A & ", + " \u203C & ", + " \u263A & ", + " \u203C & ", + " \u263A & ", + "\u203C & ", + " & ", + " & ", + " & \u2591 ", + " & \u2592 ", + " & \u2593 ", + " & \xA3 ", + " & \u2591\xA3 ", + " & \u2592\xA3 ", + " & \u2593\xA3 ", + " & \xA3\xA3 ", + " & \u2591\xA3\xA3 ", + " & \u2592\xA3\xA3 ", + "& \u2593\xA3\xA3 ", + "& \xA3\xA3\xA3 ", + " \u2591\xA3\xA3\xA3 ", + " \u2592\xA3\xA3\xA3 ", + " \u2593\xA3\xA3\xA3 ", + " \u2588\xA3\xA3\xA3 ", + " \u2591\u2588\xA3\xA3\xA3 ", + " \u2592\u2588\xA3\xA3\xA3 ", + " \u2593\u2588\xA3\xA3\xA3 ", + " \u2588\u2588\xA3\xA3\xA3 ", + " \u2591\u2588\u2588\xA3\xA3\xA3 ", + " \u2592\u2588\u2588\xA3\xA3\xA3 ", + " \u2593\u2588\u2588\xA3\xA3\xA3 ", + " \u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2591\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2592\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2593\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ", + " \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 " + ] + } + }; + } +}); + +// ../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/index.js +var require_cli_spinners = __commonJS({ + "../../node_modules/.pnpm/cli-spinners@2.9.2/node_modules/cli-spinners/index.js"(exports2, module2) { + "use strict"; + var spinners = Object.assign({}, require_spinners()); + var spinnersList = Object.keys(spinners); + Object.defineProperty(spinners, "random", { + get() { + const randomIndex = Math.floor(Math.random() * spinnersList.length); + const spinnerName = spinnersList[randomIndex]; + return spinners[spinnerName]; + } + }); + module2.exports = spinners; + } +}); + +// ../../node_modules/.pnpm/is-unicode-supported@0.1.0/node_modules/is-unicode-supported/index.js +var require_is_unicode_supported = __commonJS({ + "../../node_modules/.pnpm/is-unicode-supported@0.1.0/node_modules/is-unicode-supported/index.js"(exports2, module2) { + "use strict"; + module2.exports = () => { + if (process.platform !== "win32") { + return true; + } + return Boolean(process.env.CI) || Boolean(process.env.WT_SESSION) || // Windows Terminal + process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty"; + }; + } +}); + +// ../../node_modules/.pnpm/log-symbols@4.1.0/node_modules/log-symbols/index.js +var require_log_symbols = __commonJS({ + "../../node_modules/.pnpm/log-symbols@4.1.0/node_modules/log-symbols/index.js"(exports2, module2) { + "use strict"; + var chalk = require_source(); + var isUnicodeSupported = require_is_unicode_supported(); + var main = { + info: chalk.blue("\u2139"), + success: chalk.green("\u2714"), + warning: chalk.yellow("\u26A0"), + error: chalk.red("\u2716") + }; + var fallback = { + info: chalk.blue("i"), + success: chalk.green("\u221A"), + warning: chalk.yellow("\u203C"), + error: chalk.red("\xD7") + }; + module2.exports = isUnicodeSupported() ? main : fallback; + } +}); + +// ../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js +var require_ansi_regex = __commonJS({ + "../../node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js"(exports2, module2) { + "use strict"; + module2.exports = ({ onlyFirst = false } = {}) => { + const pattern = [ + "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", + "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))" + ].join("|"); + return new RegExp(pattern, onlyFirst ? void 0 : "g"); + }; + } +}); + +// ../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js +var require_strip_ansi = __commonJS({ + "../../node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js"(exports2, module2) { + "use strict"; + var ansiRegex = require_ansi_regex(); + module2.exports = (string) => typeof string === "string" ? string.replace(ansiRegex(), "") : string; + } +}); + +// ../../node_modules/.pnpm/clone@1.0.4/node_modules/clone/clone.js +var require_clone = __commonJS({ + "../../node_modules/.pnpm/clone@1.0.4/node_modules/clone/clone.js"(exports2, module2) { + var clone2 = function() { + "use strict"; + function clone3(parent2, circular, depth, prototype3) { + var filter6; + if (typeof circular === "object") { + depth = circular.depth; + prototype3 = circular.prototype; + filter6 = circular.filter; + circular = circular.circular; + } + var allParents = []; + var allChildren = []; + var useBuffer = typeof Buffer != "undefined"; + if (typeof circular == "undefined") + circular = true; + if (typeof depth == "undefined") + depth = Infinity; + function _clone(parent3, depth2) { + if (parent3 === null) + return null; + if (depth2 == 0) + return parent3; + var child; + var proto; + if (typeof parent3 != "object") { + return parent3; + } + if (clone3.__isArray(parent3)) { + child = []; + } else if (clone3.__isRegExp(parent3)) { + child = new RegExp(parent3.source, __getRegExpFlags(parent3)); + if (parent3.lastIndex) child.lastIndex = parent3.lastIndex; + } else if (clone3.__isDate(parent3)) { + child = new Date(parent3.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent3)) { + if (Buffer.allocUnsafe) { + child = Buffer.allocUnsafe(parent3.length); + } else { + child = new Buffer(parent3.length); + } + parent3.copy(child); + return child; + } else { + if (typeof prototype3 == "undefined") { + proto = Object.getPrototypeOf(parent3); + child = Object.create(proto); + } else { + child = Object.create(prototype3); + proto = prototype3; + } + } + if (circular) { + var index2 = allParents.indexOf(parent3); + if (index2 != -1) { + return allChildren[index2]; + } + allParents.push(parent3); + allChildren.push(child); + } + for (var i6 in parent3) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i6); + } + if (attrs && attrs.set == null) { + continue; + } + child[i6] = _clone(parent3[i6], depth2 - 1); + } + return child; + } + return _clone(parent2, depth); + } + clone3.clonePrototype = function clonePrototype(parent2) { + if (parent2 === null) + return null; + var c2 = function() { + }; + c2.prototype = parent2; + return new c2(); + }; + function __objToStr(o8) { + return Object.prototype.toString.call(o8); + } + ; + clone3.__objToStr = __objToStr; + function __isDate(o8) { + return typeof o8 === "object" && __objToStr(o8) === "[object Date]"; + } + ; + clone3.__isDate = __isDate; + function __isArray(o8) { + return typeof o8 === "object" && __objToStr(o8) === "[object Array]"; + } + ; + clone3.__isArray = __isArray; + function __isRegExp(o8) { + return typeof o8 === "object" && __objToStr(o8) === "[object RegExp]"; + } + ; + clone3.__isRegExp = __isRegExp; + function __getRegExpFlags(re) { + var flags = ""; + if (re.global) flags += "g"; + if (re.ignoreCase) flags += "i"; + if (re.multiline) flags += "m"; + return flags; + } + ; + clone3.__getRegExpFlags = __getRegExpFlags; + return clone3; + }(); + if (typeof module2 === "object" && module2.exports) { + module2.exports = clone2; + } + } +}); + +// ../../node_modules/.pnpm/defaults@1.0.4/node_modules/defaults/index.js +var require_defaults = __commonJS({ + "../../node_modules/.pnpm/defaults@1.0.4/node_modules/defaults/index.js"(exports2, module2) { + var clone2 = require_clone(); + module2.exports = function(options, defaults3) { + options = options || {}; + Object.keys(defaults3).forEach(function(key) { + if (typeof options[key] === "undefined") { + options[key] = clone2(defaults3[key]); + } + }); + return options; + }; + } +}); + +// ../../node_modules/.pnpm/wcwidth@1.0.1/node_modules/wcwidth/combining.js +var require_combining = __commonJS({ + "../../node_modules/.pnpm/wcwidth@1.0.1/node_modules/wcwidth/combining.js"(exports2, module2) { + module2.exports = [ + [768, 879], + [1155, 1158], + [1160, 1161], + [1425, 1469], + [1471, 1471], + [1473, 1474], + [1476, 1477], + [1479, 1479], + [1536, 1539], + [1552, 1557], + [1611, 1630], + [1648, 1648], + [1750, 1764], + [1767, 1768], + [1770, 1773], + [1807, 1807], + [1809, 1809], + [1840, 1866], + [1958, 1968], + [2027, 2035], + [2305, 2306], + [2364, 2364], + [2369, 2376], + [2381, 2381], + [2385, 2388], + [2402, 2403], + [2433, 2433], + [2492, 2492], + [2497, 2500], + [2509, 2509], + [2530, 2531], + [2561, 2562], + [2620, 2620], + [2625, 2626], + [2631, 2632], + [2635, 2637], + [2672, 2673], + [2689, 2690], + [2748, 2748], + [2753, 2757], + [2759, 2760], + [2765, 2765], + [2786, 2787], + [2817, 2817], + [2876, 2876], + [2879, 2879], + [2881, 2883], + [2893, 2893], + [2902, 2902], + [2946, 2946], + [3008, 3008], + [3021, 3021], + [3134, 3136], + [3142, 3144], + [3146, 3149], + [3157, 3158], + [3260, 3260], + [3263, 3263], + [3270, 3270], + [3276, 3277], + [3298, 3299], + [3393, 3395], + [3405, 3405], + [3530, 3530], + [3538, 3540], + [3542, 3542], + [3633, 3633], + [3636, 3642], + [3655, 3662], + [3761, 3761], + [3764, 3769], + [3771, 3772], + [3784, 3789], + [3864, 3865], + [3893, 3893], + [3895, 3895], + [3897, 3897], + [3953, 3966], + [3968, 3972], + [3974, 3975], + [3984, 3991], + [3993, 4028], + [4038, 4038], + [4141, 4144], + [4146, 4146], + [4150, 4151], + [4153, 4153], + [4184, 4185], + [4448, 4607], + [4959, 4959], + [5906, 5908], + [5938, 5940], + [5970, 5971], + [6002, 6003], + [6068, 6069], + [6071, 6077], + [6086, 6086], + [6089, 6099], + [6109, 6109], + [6155, 6157], + [6313, 6313], + [6432, 6434], + [6439, 6440], + [6450, 6450], + [6457, 6459], + [6679, 6680], + [6912, 6915], + [6964, 6964], + [6966, 6970], + [6972, 6972], + [6978, 6978], + [7019, 7027], + [7616, 7626], + [7678, 7679], + [8203, 8207], + [8234, 8238], + [8288, 8291], + [8298, 8303], + [8400, 8431], + [12330, 12335], + [12441, 12442], + [43014, 43014], + [43019, 43019], + [43045, 43046], + [64286, 64286], + [65024, 65039], + [65056, 65059], + [65279, 65279], + [65529, 65531], + [68097, 68099], + [68101, 68102], + [68108, 68111], + [68152, 68154], + [68159, 68159], + [119143, 119145], + [119155, 119170], + [119173, 119179], + [119210, 119213], + [119362, 119364], + [917505, 917505], + [917536, 917631], + [917760, 917999] + ]; + } +}); + +// ../../node_modules/.pnpm/wcwidth@1.0.1/node_modules/wcwidth/index.js +var require_wcwidth = __commonJS({ + "../../node_modules/.pnpm/wcwidth@1.0.1/node_modules/wcwidth/index.js"(exports2, module2) { + "use strict"; + var defaults3 = require_defaults(); + var combining = require_combining(); + var DEFAULTS = { + nul: 0, + control: 0 + }; + module2.exports = function wcwidth2(str) { + return wcswidth(str, DEFAULTS); + }; + module2.exports.config = function(opts) { + opts = defaults3(opts || {}, DEFAULTS); + return function wcwidth2(str) { + return wcswidth(str, opts); + }; + }; + function wcswidth(str, opts) { + if (typeof str !== "string") return wcwidth(str, opts); + var s4 = 0; + for (var i6 = 0; i6 < str.length; i6++) { + var n2 = wcwidth(str.charCodeAt(i6), opts); + if (n2 < 0) return -1; + s4 += n2; + } + return s4; + } + function wcwidth(ucs, opts) { + if (ucs === 0) return opts.nul; + if (ucs < 32 || ucs >= 127 && ucs < 160) return opts.control; + if (bisearch(ucs)) return 0; + return 1 + (ucs >= 4352 && (ucs <= 4447 || // Hangul Jamo init. consonants + ucs == 9001 || ucs == 9002 || ucs >= 11904 && ucs <= 42191 && ucs != 12351 || // CJK ... Yi + ucs >= 44032 && ucs <= 55203 || // Hangul Syllables + ucs >= 63744 && ucs <= 64255 || // CJK Compatibility Ideographs + ucs >= 65040 && ucs <= 65049 || // Vertical forms + ucs >= 65072 && ucs <= 65135 || // CJK Compatibility Forms + ucs >= 65280 && ucs <= 65376 || // Fullwidth Forms + ucs >= 65504 && ucs <= 65510 || ucs >= 131072 && ucs <= 196605 || ucs >= 196608 && ucs <= 262141)); + } + function bisearch(ucs) { + var min = 0; + var max = combining.length - 1; + var mid; + if (ucs < combining[0][0] || ucs > combining[max][1]) return false; + while (max >= min) { + mid = Math.floor((min + max) / 2); + if (ucs > combining[mid][1]) min = mid + 1; + else if (ucs < combining[mid][0]) max = mid - 1; + else return true; + } + return false; + } + } +}); + +// ../../node_modules/.pnpm/is-interactive@1.0.0/node_modules/is-interactive/index.js +var require_is_interactive = __commonJS({ + "../../node_modules/.pnpm/is-interactive@1.0.0/node_modules/is-interactive/index.js"(exports2, module2) { + "use strict"; + module2.exports = ({ stream: stream5 = process.stdout } = {}) => { + return Boolean( + stream5 && stream5.isTTY && process.env.TERM !== "dumb" && !("CI" in process.env) + ); + }; + } +}); + +// ../../node_modules/.pnpm/bl@4.1.0/node_modules/bl/BufferList.js +var require_BufferList = __commonJS({ + "../../node_modules/.pnpm/bl@4.1.0/node_modules/bl/BufferList.js"(exports2, module2) { + "use strict"; + var { Buffer: Buffer2 } = __require("buffer"); + var symbol = Symbol.for("BufferList"); + function BufferList(buf) { + if (!(this instanceof BufferList)) { + return new BufferList(buf); + } + BufferList._init.call(this, buf); + } + BufferList._init = function _init(buf) { + Object.defineProperty(this, symbol, { value: true }); + this._bufs = []; + this.length = 0; + if (buf) { + this.append(buf); + } + }; + BufferList.prototype._new = function _new(buf) { + return new BufferList(buf); + }; + BufferList.prototype._offset = function _offset(offset) { + if (offset === 0) { + return [0, 0]; + } + let tot = 0; + for (let i6 = 0; i6 < this._bufs.length; i6++) { + const _t = tot + this._bufs[i6].length; + if (offset < _t || i6 === this._bufs.length - 1) { + return [i6, offset - tot]; + } + tot = _t; + } + }; + BufferList.prototype._reverseOffset = function(blOffset) { + const bufferId = blOffset[0]; + let offset = blOffset[1]; + for (let i6 = 0; i6 < bufferId; i6++) { + offset += this._bufs[i6].length; + } + return offset; + }; + BufferList.prototype.get = function get2(index2) { + if (index2 > this.length || index2 < 0) { + return void 0; + } + const offset = this._offset(index2); + return this._bufs[offset[0]][offset[1]]; + }; + BufferList.prototype.slice = function slice2(start, end2) { + if (typeof start === "number" && start < 0) { + start += this.length; + } + if (typeof end2 === "number" && end2 < 0) { + end2 += this.length; + } + return this.copy(null, 0, start, end2); + }; + BufferList.prototype.copy = function copy(dst, dstStart, srcStart, srcEnd) { + if (typeof srcStart !== "number" || srcStart < 0) { + srcStart = 0; + } + if (typeof srcEnd !== "number" || srcEnd > this.length) { + srcEnd = this.length; + } + if (srcStart >= this.length) { + return dst || Buffer2.alloc(0); + } + if (srcEnd <= 0) { + return dst || Buffer2.alloc(0); + } + const copy2 = !!dst; + const off = this._offset(srcStart); + const len = srcEnd - srcStart; + let bytes = len; + let bufoff = copy2 && dstStart || 0; + let start = off[1]; + if (srcStart === 0 && srcEnd === this.length) { + if (!copy2) { + return this._bufs.length === 1 ? this._bufs[0] : Buffer2.concat(this._bufs, this.length); + } + for (let i6 = 0; i6 < this._bufs.length; i6++) { + this._bufs[i6].copy(dst, bufoff); + bufoff += this._bufs[i6].length; + } + return dst; + } + if (bytes <= this._bufs[off[0]].length - start) { + return copy2 ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) : this._bufs[off[0]].slice(start, start + bytes); + } + if (!copy2) { + dst = Buffer2.allocUnsafe(len); + } + for (let i6 = off[0]; i6 < this._bufs.length; i6++) { + const l5 = this._bufs[i6].length - start; + if (bytes > l5) { + this._bufs[i6].copy(dst, bufoff, start); + bufoff += l5; + } else { + this._bufs[i6].copy(dst, bufoff, start, start + bytes); + bufoff += l5; + break; + } + bytes -= l5; + if (start) { + start = 0; + } + } + if (dst.length > bufoff) return dst.slice(0, bufoff); + return dst; + }; + BufferList.prototype.shallowSlice = function shallowSlice(start, end2) { + start = start || 0; + end2 = typeof end2 !== "number" ? this.length : end2; + if (start < 0) { + start += this.length; + } + if (end2 < 0) { + end2 += this.length; + } + if (start === end2) { + return this._new(); + } + const startOffset = this._offset(start); + const endOffset = this._offset(end2); + const buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1); + if (endOffset[1] === 0) { + buffers.pop(); + } else { + buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1]); + } + if (startOffset[1] !== 0) { + buffers[0] = buffers[0].slice(startOffset[1]); + } + return this._new(buffers); + }; + BufferList.prototype.toString = function toString4(encoding, start, end2) { + return this.slice(start, end2).toString(encoding); + }; + BufferList.prototype.consume = function consume(bytes) { + bytes = Math.trunc(bytes); + if (Number.isNaN(bytes) || bytes <= 0) return this; + while (this._bufs.length) { + if (bytes >= this._bufs[0].length) { + bytes -= this._bufs[0].length; + this.length -= this._bufs[0].length; + this._bufs.shift(); + } else { + this._bufs[0] = this._bufs[0].slice(bytes); + this.length -= bytes; + break; + } + } + return this; + }; + BufferList.prototype.duplicate = function duplicate() { + const copy = this._new(); + for (let i6 = 0; i6 < this._bufs.length; i6++) { + copy.append(this._bufs[i6]); + } + return copy; + }; + BufferList.prototype.append = function append4(buf) { + if (buf == null) { + return this; + } + if (buf.buffer) { + this._appendBuffer(Buffer2.from(buf.buffer, buf.byteOffset, buf.byteLength)); + } else if (Array.isArray(buf)) { + for (let i6 = 0; i6 < buf.length; i6++) { + this.append(buf[i6]); + } + } else if (this._isBufferList(buf)) { + for (let i6 = 0; i6 < buf._bufs.length; i6++) { + this.append(buf._bufs[i6]); + } + } else { + if (typeof buf === "number") { + buf = buf.toString(); + } + this._appendBuffer(Buffer2.from(buf)); + } + return this; + }; + BufferList.prototype._appendBuffer = function appendBuffer(buf) { + this._bufs.push(buf); + this.length += buf.length; + }; + BufferList.prototype.indexOf = function(search, offset, encoding) { + if (encoding === void 0 && typeof offset === "string") { + encoding = offset; + offset = void 0; + } + if (typeof search === "function" || Array.isArray(search)) { + throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.'); + } else if (typeof search === "number") { + search = Buffer2.from([search]); + } else if (typeof search === "string") { + search = Buffer2.from(search, encoding); + } else if (this._isBufferList(search)) { + search = search.slice(); + } else if (Array.isArray(search.buffer)) { + search = Buffer2.from(search.buffer, search.byteOffset, search.byteLength); + } else if (!Buffer2.isBuffer(search)) { + search = Buffer2.from(search); + } + offset = Number(offset || 0); + if (isNaN(offset)) { + offset = 0; + } + if (offset < 0) { + offset = this.length + offset; + } + if (offset < 0) { + offset = 0; + } + if (search.length === 0) { + return offset > this.length ? this.length : offset; + } + const blOffset = this._offset(offset); + let blIndex = blOffset[0]; + let buffOffset = blOffset[1]; + for (; blIndex < this._bufs.length; blIndex++) { + const buff = this._bufs[blIndex]; + while (buffOffset < buff.length) { + const availableWindow = buff.length - buffOffset; + if (availableWindow >= search.length) { + const nativeSearchResult = buff.indexOf(search, buffOffset); + if (nativeSearchResult !== -1) { + return this._reverseOffset([blIndex, nativeSearchResult]); + } + buffOffset = buff.length - search.length + 1; + } else { + const revOffset = this._reverseOffset([blIndex, buffOffset]); + if (this._match(revOffset, search)) { + return revOffset; + } + buffOffset++; + } + } + buffOffset = 0; + } + return -1; + }; + BufferList.prototype._match = function(offset, search) { + if (this.length - offset < search.length) { + return false; + } + for (let searchOffset = 0; searchOffset < search.length; searchOffset++) { + if (this.get(offset + searchOffset) !== search[searchOffset]) { + return false; + } + } + return true; + }; + (function() { + const methods = { + readDoubleBE: 8, + readDoubleLE: 8, + readFloatBE: 4, + readFloatLE: 4, + readInt32BE: 4, + readInt32LE: 4, + readUInt32BE: 4, + readUInt32LE: 4, + readInt16BE: 2, + readInt16LE: 2, + readUInt16BE: 2, + readUInt16LE: 2, + readInt8: 1, + readUInt8: 1, + readIntBE: null, + readIntLE: null, + readUIntBE: null, + readUIntLE: null + }; + for (const m2 in methods) { + (function(m3) { + if (methods[m3] === null) { + BufferList.prototype[m3] = function(offset, byteLength) { + return this.slice(offset, offset + byteLength)[m3](0, byteLength); + }; + } else { + BufferList.prototype[m3] = function(offset = 0) { + return this.slice(offset, offset + methods[m3])[m3](0); + }; + } + })(m2); + } + })(); + BufferList.prototype._isBufferList = function _isBufferList(b) { + return b instanceof BufferList || BufferList.isBufferList(b); + }; + BufferList.isBufferList = function isBufferList(b) { + return b != null && b[symbol]; + }; + module2.exports = BufferList; + } +}); + +// ../../node_modules/.pnpm/bl@4.1.0/node_modules/bl/bl.js +var require_bl = __commonJS({ + "../../node_modules/.pnpm/bl@4.1.0/node_modules/bl/bl.js"(exports2, module2) { + "use strict"; + var DuplexStream = require_readable().Duplex; + var inherits2 = require_inherits(); + var BufferList = require_BufferList(); + function BufferListStream(callback) { + if (!(this instanceof BufferListStream)) { + return new BufferListStream(callback); + } + if (typeof callback === "function") { + this._callback = callback; + const piper = function piper2(err) { + if (this._callback) { + this._callback(err); + this._callback = null; + } + }.bind(this); + this.on("pipe", function onPipe(src) { + src.on("error", piper); + }); + this.on("unpipe", function onUnpipe(src) { + src.removeListener("error", piper); + }); + callback = null; + } + BufferList._init.call(this, callback); + DuplexStream.call(this); + } + inherits2(BufferListStream, DuplexStream); + Object.assign(BufferListStream.prototype, BufferList.prototype); + BufferListStream.prototype._new = function _new(callback) { + return new BufferListStream(callback); + }; + BufferListStream.prototype._write = function _write(buf, encoding, callback) { + this._appendBuffer(buf); + if (typeof callback === "function") { + callback(); + } + }; + BufferListStream.prototype._read = function _read(size) { + if (!this.length) { + return this.push(null); + } + size = Math.min(size, this.length); + this.push(this.slice(0, size)); + this.consume(size); + }; + BufferListStream.prototype.end = function end2(chunk) { + DuplexStream.prototype.end.call(this, chunk); + if (this._callback) { + this._callback(null, this.slice()); + this._callback = null; + } + }; + BufferListStream.prototype._destroy = function _destroy(err, cb) { + this._bufs.length = 0; + this.length = 0; + cb(err); + }; + BufferListStream.prototype._isBufferList = function _isBufferList(b) { + return b instanceof BufferListStream || b instanceof BufferList || BufferListStream.isBufferList(b); + }; + BufferListStream.isBufferList = BufferList.isBufferList; + module2.exports = BufferListStream; + module2.exports.BufferListStream = BufferListStream; + module2.exports.BufferList = BufferList; + } +}); + +// ../../node_modules/.pnpm/ora@5.4.1/node_modules/ora/index.js +var require_ora = __commonJS({ + "../../node_modules/.pnpm/ora@5.4.1/node_modules/ora/index.js"(exports2, module2) { + "use strict"; + var readline = __require("readline"); + var chalk = require_source(); + var cliCursor = require_cli_cursor(); + var cliSpinners = require_cli_spinners(); + var logSymbols = require_log_symbols(); + var stripAnsi = require_strip_ansi(); + var wcwidth = require_wcwidth(); + var isInteractive = require_is_interactive(); + var isUnicodeSupported = require_is_unicode_supported(); + var { BufferListStream } = require_bl(); + var TEXT = Symbol("text"); + var PREFIX_TEXT = Symbol("prefixText"); + var ASCII_ETX_CODE = 3; + var StdinDiscarder = class { + constructor() { + this.requests = 0; + this.mutedStream = new BufferListStream(); + this.mutedStream.pipe(process.stdout); + const self2 = this; + this.ourEmit = function(event, data2, ...args2) { + const { stdin } = process; + if (self2.requests > 0 || stdin.emit === self2.ourEmit) { + if (event === "keypress") { + return; + } + if (event === "data" && data2.includes(ASCII_ETX_CODE)) { + process.emit("SIGINT"); + } + Reflect.apply(self2.oldEmit, this, [event, data2, ...args2]); + } else { + Reflect.apply(process.stdin.emit, this, [event, data2, ...args2]); + } + }; + } + start() { + this.requests++; + if (this.requests === 1) { + this.realStart(); + } + } + stop() { + if (this.requests <= 0) { + throw new Error("`stop` called more times than `start`"); + } + this.requests--; + if (this.requests === 0) { + this.realStop(); + } + } + realStart() { + if (process.platform === "win32") { + return; + } + this.rl = readline.createInterface({ + input: process.stdin, + output: this.mutedStream + }); + this.rl.on("SIGINT", () => { + if (process.listenerCount("SIGINT") === 0) { + process.emit("SIGINT"); + } else { + this.rl.close(); + process.kill(process.pid, "SIGINT"); + } + }); + } + realStop() { + if (process.platform === "win32") { + return; + } + this.rl.close(); + this.rl = void 0; + } + }; + var stdinDiscarder; + var Ora2 = class { + constructor(options) { + if (!stdinDiscarder) { + stdinDiscarder = new StdinDiscarder(); + } + if (typeof options === "string") { + options = { + text: options + }; + } + this.options = { + text: "", + color: "cyan", + stream: process.stderr, + discardStdin: true, + ...options + }; + this.spinner = this.options.spinner; + this.color = this.options.color; + this.hideCursor = this.options.hideCursor !== false; + this.interval = this.options.interval || this.spinner.interval || 100; + this.stream = this.options.stream; + this.id = void 0; + this.isEnabled = typeof this.options.isEnabled === "boolean" ? this.options.isEnabled : isInteractive({ stream: this.stream }); + this.isSilent = typeof this.options.isSilent === "boolean" ? this.options.isSilent : false; + this.text = this.options.text; + this.prefixText = this.options.prefixText; + this.linesToClear = 0; + this.indent = this.options.indent; + this.discardStdin = this.options.discardStdin; + this.isDiscardingStdin = false; + } + get indent() { + return this._indent; + } + set indent(indent = 0) { + if (!(indent >= 0 && Number.isInteger(indent))) { + throw new Error("The `indent` option must be an integer from 0 and up"); + } + this._indent = indent; + } + _updateInterval(interval) { + if (interval !== void 0) { + this.interval = interval; + } + } + get spinner() { + return this._spinner; + } + set spinner(spinner) { + this.frameIndex = 0; + if (typeof spinner === "object") { + if (spinner.frames === void 0) { + throw new Error("The given spinner must have a `frames` property"); + } + this._spinner = spinner; + } else if (!isUnicodeSupported()) { + this._spinner = cliSpinners.line; + } else if (spinner === void 0) { + this._spinner = cliSpinners.dots; + } else if (spinner !== "default" && cliSpinners[spinner]) { + this._spinner = cliSpinners[spinner]; + } else { + throw new Error(`There is no built-in spinner named '${spinner}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`); + } + this._updateInterval(this._spinner.interval); + } + get text() { + return this[TEXT]; + } + set text(value) { + this[TEXT] = value; + this.updateLineCount(); + } + get prefixText() { + return this[PREFIX_TEXT]; + } + set prefixText(value) { + this[PREFIX_TEXT] = value; + this.updateLineCount(); + } + get isSpinning() { + return this.id !== void 0; + } + getFullPrefixText(prefixText = this[PREFIX_TEXT], postfix = " ") { + if (typeof prefixText === "string") { + return prefixText + postfix; + } + if (typeof prefixText === "function") { + return prefixText() + postfix; + } + return ""; + } + updateLineCount() { + const columns = this.stream.columns || 80; + const fullPrefixText = this.getFullPrefixText(this.prefixText, "-"); + this.lineCount = 0; + for (const line of stripAnsi(fullPrefixText + "--" + this[TEXT]).split("\n")) { + this.lineCount += Math.max(1, Math.ceil(wcwidth(line) / columns)); + } + } + get isEnabled() { + return this._isEnabled && !this.isSilent; + } + set isEnabled(value) { + if (typeof value !== "boolean") { + throw new TypeError("The `isEnabled` option must be a boolean"); + } + this._isEnabled = value; + } + get isSilent() { + return this._isSilent; + } + set isSilent(value) { + if (typeof value !== "boolean") { + throw new TypeError("The `isSilent` option must be a boolean"); + } + this._isSilent = value; + } + frame() { + const { frames } = this.spinner; + let frame = frames[this.frameIndex]; + if (this.color) { + frame = chalk[this.color](frame); + } + this.frameIndex = ++this.frameIndex % frames.length; + const fullPrefixText = typeof this.prefixText === "string" && this.prefixText !== "" ? this.prefixText + " " : ""; + const fullText = typeof this.text === "string" ? " " + this.text : ""; + return fullPrefixText + frame + fullText; + } + clear() { + if (!this.isEnabled || !this.stream.isTTY) { + return this; + } + for (let i6 = 0; i6 < this.linesToClear; i6++) { + if (i6 > 0) { + this.stream.moveCursor(0, -1); + } + this.stream.clearLine(); + this.stream.cursorTo(this.indent); + } + this.linesToClear = 0; + return this; + } + render() { + if (this.isSilent) { + return this; + } + this.clear(); + this.stream.write(this.frame()); + this.linesToClear = this.lineCount; + return this; + } + start(text3) { + if (text3) { + this.text = text3; + } + if (this.isSilent) { + return this; + } + if (!this.isEnabled) { + if (this.text) { + this.stream.write(`- ${this.text} +`); + } + return this; + } + if (this.isSpinning) { + return this; + } + if (this.hideCursor) { + cliCursor.hide(this.stream); + } + if (this.discardStdin && process.stdin.isTTY) { + this.isDiscardingStdin = true; + stdinDiscarder.start(); + } + this.render(); + this.id = setInterval(this.render.bind(this), this.interval); + return this; + } + stop() { + if (!this.isEnabled) { + return this; + } + clearInterval(this.id); + this.id = void 0; + this.frameIndex = 0; + this.clear(); + if (this.hideCursor) { + cliCursor.show(this.stream); + } + if (this.discardStdin && process.stdin.isTTY && this.isDiscardingStdin) { + stdinDiscarder.stop(); + this.isDiscardingStdin = false; + } + return this; + } + succeed(text3) { + return this.stopAndPersist({ symbol: logSymbols.success, text: text3 }); + } + fail(text3) { + return this.stopAndPersist({ symbol: logSymbols.error, text: text3 }); + } + warn(text3) { + return this.stopAndPersist({ symbol: logSymbols.warning, text: text3 }); + } + info(text3) { + return this.stopAndPersist({ symbol: logSymbols.info, text: text3 }); + } + stopAndPersist(options = {}) { + if (this.isSilent) { + return this; + } + const prefixText = options.prefixText || this.prefixText; + const text3 = options.text || this.text; + const fullText = typeof text3 === "string" ? " " + text3 : ""; + this.stop(); + this.stream.write(`${this.getFullPrefixText(prefixText, " ")}${options.symbol || " "}${fullText} +`); + return this; + } + }; + var oraFactory = function(options) { + return new Ora2(options); + }; + module2.exports = oraFactory; + module2.exports.promise = (action, options) => { + if (typeof action.then !== "function") { + throw new TypeError("Parameter `action` must be a Promise"); + } + const spinner = new Ora2(options); + spinner.start(); + (async () => { + try { + await action; + spinner.succeed(); + } catch { + spinner.fail(); + } + })(); + return spinner; + }; + } +}); + +// ../../node_modules/.pnpm/sax@1.2.4/node_modules/sax/lib/sax.js +var require_sax = __commonJS({ + "../../node_modules/.pnpm/sax@1.2.4/node_modules/sax/lib/sax.js"(exports2) { + (function(sax) { + sax.parser = function(strict, opt) { + return new SAXParser(strict, opt); + }; + sax.SAXParser = SAXParser; + sax.SAXStream = SAXStream; + sax.createStream = createStream; + sax.MAX_BUFFER_LENGTH = 64 * 1024; + var buffers = [ + "comment", + "sgmlDecl", + "textNode", + "tagName", + "doctype", + "procInstName", + "procInstBody", + "entity", + "attribName", + "attribValue", + "cdata", + "script" + ]; + sax.EVENTS = [ + "text", + "processinginstruction", + "sgmldeclaration", + "doctype", + "comment", + "opentagstart", + "attribute", + "opentag", + "closetag", + "opencdata", + "cdata", + "closecdata", + "error", + "end", + "ready", + "script", + "opennamespace", + "closenamespace" + ]; + function SAXParser(strict, opt) { + if (!(this instanceof SAXParser)) { + return new SAXParser(strict, opt); + } + var parser = this; + clearBuffers(parser); + parser.q = parser.c = ""; + parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH; + parser.opt = opt || {}; + parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags; + parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase"; + parser.tags = []; + parser.closed = parser.closedRoot = parser.sawRoot = false; + parser.tag = parser.error = null; + parser.strict = !!strict; + parser.noscript = !!(strict || parser.opt.noscript); + parser.state = S.BEGIN; + parser.strictEntities = parser.opt.strictEntities; + parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES); + parser.attribList = []; + if (parser.opt.xmlns) { + parser.ns = Object.create(rootNS); + } + parser.trackPosition = parser.opt.position !== false; + if (parser.trackPosition) { + parser.position = parser.line = parser.column = 0; + } + emit(parser, "onready"); + } + if (!Object.create) { + Object.create = function(o8) { + function F() { + } + F.prototype = o8; + var newf = new F(); + return newf; + }; + } + if (!Object.keys) { + Object.keys = function(o8) { + var a2 = []; + for (var i6 in o8) if (o8.hasOwnProperty(i6)) a2.push(i6); + return a2; + }; + } + function checkBufferLength(parser) { + var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10); + var maxActual = 0; + for (var i6 = 0, l5 = buffers.length; i6 < l5; i6++) { + var len = parser[buffers[i6]].length; + if (len > maxAllowed) { + switch (buffers[i6]) { + case "textNode": + closeText(parser); + break; + case "cdata": + emitNode(parser, "oncdata", parser.cdata); + parser.cdata = ""; + break; + case "script": + emitNode(parser, "onscript", parser.script); + parser.script = ""; + break; + default: + error(parser, "Max buffer length exceeded: " + buffers[i6]); + } + } + maxActual = Math.max(maxActual, len); + } + var m2 = sax.MAX_BUFFER_LENGTH - maxActual; + parser.bufferCheckPosition = m2 + parser.position; + } + function clearBuffers(parser) { + for (var i6 = 0, l5 = buffers.length; i6 < l5; i6++) { + parser[buffers[i6]] = ""; + } + } + function flushBuffers(parser) { + closeText(parser); + if (parser.cdata !== "") { + emitNode(parser, "oncdata", parser.cdata); + parser.cdata = ""; + } + if (parser.script !== "") { + emitNode(parser, "onscript", parser.script); + parser.script = ""; + } + } + SAXParser.prototype = { + end: function() { + end2(this); + }, + write, + resume: function() { + this.error = null; + return this; + }, + close: function() { + return this.write(null); + }, + flush: function() { + flushBuffers(this); + } + }; + var Stream2; + try { + Stream2 = __require("stream").Stream; + } catch (ex) { + Stream2 = function() { + }; + } + var streamWraps = sax.EVENTS.filter(function(ev) { + return ev !== "error" && ev !== "end"; + }); + function createStream(strict, opt) { + return new SAXStream(strict, opt); + } + function SAXStream(strict, opt) { + if (!(this instanceof SAXStream)) { + return new SAXStream(strict, opt); + } + Stream2.apply(this); + this._parser = new SAXParser(strict, opt); + this.writable = true; + this.readable = true; + var me = this; + this._parser.onend = function() { + me.emit("end"); + }; + this._parser.onerror = function(er) { + me.emit("error", er); + me._parser.error = null; + }; + this._decoder = null; + streamWraps.forEach(function(ev) { + Object.defineProperty(me, "on" + ev, { + get: function() { + return me._parser["on" + ev]; + }, + set: function(h) { + if (!h) { + me.removeAllListeners(ev); + me._parser["on" + ev] = h; + return h; + } + me.on(ev, h); + }, + enumerable: true, + configurable: false + }); + }); + } + SAXStream.prototype = Object.create(Stream2.prototype, { + constructor: { + value: SAXStream + } + }); + SAXStream.prototype.write = function(data2) { + if (typeof Buffer === "function" && typeof Buffer.isBuffer === "function" && Buffer.isBuffer(data2)) { + if (!this._decoder) { + var SD = __require("string_decoder").StringDecoder; + this._decoder = new SD("utf8"); + } + data2 = this._decoder.write(data2); + } + this._parser.write(data2.toString()); + this.emit("data", data2); + return true; + }; + SAXStream.prototype.end = function(chunk) { + if (chunk && chunk.length) { + this.write(chunk); + } + this._parser.end(); + return true; + }; + SAXStream.prototype.on = function(ev, handler) { + var me = this; + if (!me._parser["on" + ev] && streamWraps.indexOf(ev) !== -1) { + me._parser["on" + ev] = function() { + var args2 = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments); + args2.splice(0, 0, ev); + me.emit.apply(me, args2); + }; + } + return Stream2.prototype.on.call(me, ev, handler); + }; + var CDATA3 = "[CDATA["; + var DOCTYPE = "DOCTYPE"; + var XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"; + var XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/"; + var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }; + var nameStart = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/; + var nameBody = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/; + var entityStart = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/; + var entityBody = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/; + function isWhitespace3(c2) { + return c2 === " " || c2 === "\n" || c2 === "\r" || c2 === " "; + } + function isQuote(c2) { + return c2 === '"' || c2 === "'"; + } + function isAttribEnd(c2) { + return c2 === ">" || isWhitespace3(c2); + } + function isMatch4(regex, c2) { + return regex.test(c2); + } + function notMatch(regex, c2) { + return !isMatch4(regex, c2); + } + var S = 0; + sax.STATE = { + BEGIN: S++, + // leading byte order mark or whitespace + BEGIN_WHITESPACE: S++, + // leading whitespace + TEXT: S++, + // general stuff + TEXT_ENTITY: S++, + // & and such. + OPEN_WAKA: S++, + // < + SGML_DECL: S++, + // + SCRIPT: S++, + //