diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 818bef5a9..7de901613 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,3 +48,20 @@ jobs: with: github_token: ${{ secrets.RELEASE_GH_TOKEN }} branch: next + + # quick assertion to validate that rdme CLI can be installed and run on ubuntu + postrelease: + name: Post-release checks + needs: release + runs-on: ubuntu-latest + if: ${{ github.ref }} == 'refs/heads/next' + steps: + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + - name: Install `rdme` from npm + run: npm install -g rdme@next + - name: Print rdme CLI version + run: rdme --version + timeout-minutes: 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f45ff62f..5a499fa73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## [9.0.2-next.2](https://github.com/readmeio/rdme/compare/v9.0.2-next.1...v9.0.2-next.2) (2024-12-10) + + +### Bug Fixes + +* **autocomplete:** bad alias ([#1118](https://github.com/readmeio/rdme/issues/1118)) ([5b8d928](https://github.com/readmeio/rdme/commit/5b8d9286e891b1bc5cfbcfce1a1862cb8dbdf2b4)) + +## [9.0.2-next.1](https://github.com/readmeio/rdme/compare/v9.0.1...v9.0.2-next.1) (2024-12-10) + + +### Bug Fixes + +* remove import attributes ([#1117](https://github.com/readmeio/rdme/issues/1117)) ([e662654](https://github.com/readmeio/rdme/commit/e66265486cac80f79c79f8594b7c60862fadbe12)), closes [#1115](https://github.com/readmeio/rdme/issues/1115) [/github.com/readmeio/rdme/pull/1115#issuecomment-2532123627](https://github.com//github.com/readmeio/rdme/pull/1115/issues/issuecomment-2532123627) + ## [9.0.1](https://github.com/readmeio/rdme/compare/v9.0.0...v9.0.1) (2024-12-09) diff --git a/__tests__/commands/logout.test.ts b/__tests__/commands/logout.test.ts index b0fab24e6..901e7dea9 100644 --- a/__tests__/commands/logout.test.ts +++ b/__tests__/commands/logout.test.ts @@ -1,6 +1,6 @@ import { describe, afterEach, beforeAll, it, expect } from 'vitest'; -import pkg from '../../package.json'; +import pkg from '../../package.json' with { type: 'json' }; import Command from '../../src/commands/logout.js'; import configStore from '../../src/lib/configstore.js'; import { runCommandAndReturnResult } from '../helpers/oclif.js'; diff --git a/__tests__/commands/open.test.ts b/__tests__/commands/open.test.ts index 80b961dd3..3ab9829f0 100644 --- a/__tests__/commands/open.test.ts +++ b/__tests__/commands/open.test.ts @@ -3,7 +3,7 @@ import type { Version } from '../../src/commands/versions/index.js'; import chalk from 'chalk'; import { describe, afterEach, beforeAll, it, expect } from 'vitest'; -import pkg from '../../package.json'; +import pkg from '../../package.json' with { type: 'json' }; import Command from '../../src/commands/open.js'; import configStore from '../../src/lib/configstore.js'; import { getAPIv1Mock } from '../helpers/get-api-mock.js'; diff --git a/__tests__/commands/whoami.test.ts b/__tests__/commands/whoami.test.ts index 10c898255..aecd0bbee 100644 --- a/__tests__/commands/whoami.test.ts +++ b/__tests__/commands/whoami.test.ts @@ -1,6 +1,6 @@ import { describe, afterEach, it, expect, beforeAll } from 'vitest'; -import pkg from '../../package.json'; +import pkg from '../../package.json' with { type: 'json' }; import Command from '../../src/commands/whoami.js'; import configStore from '../../src/lib/configstore.js'; import { runCommandAndReturnResult } from '../helpers/oclif.js'; diff --git a/__tests__/helpers/get-gha-setup.ts b/__tests__/helpers/get-gha-setup.ts index 528f6ca80..cd382c773 100644 --- a/__tests__/helpers/get-gha-setup.ts +++ b/__tests__/helpers/get-gha-setup.ts @@ -6,7 +6,7 @@ import { vi } from 'vitest'; import configstore from '../../src/lib/configstore.js'; import { git } from '../../src/lib/createGHA/index.js'; -import * as getPkgVersion from '../../src/lib/getPkgVersion.js'; +import * as getPkgVersion from '../../src/lib/getPkg.js'; import getGitRemoteMock from './get-git-mock.js'; diff --git a/__tests__/lib/createGHA.test.ts b/__tests__/lib/createGHA.test.ts index a1cd3d9b8..943bb90f9 100644 --- a/__tests__/lib/createGHA.test.ts +++ b/__tests__/lib/createGHA.test.ts @@ -10,7 +10,7 @@ import { describe, beforeEach, afterEach, it, expect, vi, type MockInstance, bef import configstore from '../../src/lib/configstore.js'; import { getConfigStoreKey, getGHAFileName, git } from '../../src/lib/createGHA/index.js'; -import { getMajorPkgVersion } from '../../src/lib/getPkgVersion.js'; +import { getMajorPkgVersion } from '../../src/lib/getPkg.js'; import { after, before } from '../helpers/get-gha-setup.js'; import getGitRemoteMock from '../helpers/get-git-mock.js'; import ghaWorkflowSchema from '../helpers/github-workflow-schema.json' with { type: 'json' }; diff --git a/__tests__/lib/getPkgVersion.test.ts b/__tests__/lib/getPkgVersion.test.ts index 9bf6e7285..ac3f6aff9 100644 --- a/__tests__/lib/getPkgVersion.test.ts +++ b/__tests__/lib/getPkgVersion.test.ts @@ -3,7 +3,7 @@ import semver from 'semver'; import { describe, beforeEach, afterEach, it, expect, vi, type MockInstance } from 'vitest'; import pkg from '../../package.json' with { type: 'json' }; -import { getNodeVersion, getPkgVersion } from '../../src/lib/getPkgVersion.js'; +import { getNodeVersion, getPkgVersion, getPkgVersionFromNPM } from '../../src/lib/getPkg.js'; describe('#getNodeVersion()', () => { it('should extract version that matches range in package.json', () => { @@ -27,7 +27,7 @@ describe('#getPkgVersion()', () => { }); it('should grab version from package.json by default', () => { - return expect(getPkgVersion()).resolves.toBe(pkg.version); + return expect(getPkgVersion()).toBe(pkg.version); }); it('should fetch version from npm registry', async () => { @@ -35,7 +35,7 @@ describe('#getPkgVersion()', () => { .get('/rdme') .reply(200, { 'dist-tags': { latest: '1.0' } }); - await expect(getPkgVersion('latest')).resolves.toBe('1.0'); + await expect(getPkgVersionFromNPM('latest')).resolves.toBe('1.0'); mock.done(); }); @@ -43,7 +43,7 @@ describe('#getPkgVersion()', () => { it('should fallback if npm registry fails', async () => { const mock = nock('https://registry.npmjs.com', { encodedQueryParams: true }).get('/rdme').reply(500); - await expect(getPkgVersion('latest')).resolves.toBe(pkg.version); + await expect(getPkgVersionFromNPM('latest')).resolves.toBe(pkg.version); mock.done(); }); diff --git a/bin/dev.js b/bin/dev.js index 7122c2827..c87b65b4a 100755 --- a/bin/dev.js +++ b/bin/dev.js @@ -1,4 +1,4 @@ -#!/usr/bin/env -S npx tsx +#!/usr/bin/env npx tsx async function main() { const { execute } = await import('@oclif/core'); diff --git a/bin/run.js b/bin/run.js index 4a32f3b6b..0875bc524 100755 --- a/bin/run.js +++ b/bin/run.js @@ -1,6 +1,4 @@ -#!/usr/bin/env -S node --no-warnings=ExperimentalWarning -// ^ we need this env variable above to hide the ExperimentalWarnings -// source: https://github.com/nodejs/node/issues/10802#issuecomment-573376999 +#!/usr/bin/env node import stringArgv from 'string-argv'; diff --git a/bin/set-major-version-tag.js b/bin/set-major-version-tag.js index 2b42e331c..af9cdb367 100755 --- a/bin/set-major-version-tag.js +++ b/bin/set-major-version-tag.js @@ -37,18 +37,12 @@ async function runGitCmd(args) { */ async function setMajorVersionTag() { try { - console.log( - 'kanad test', - JSON.stringify({ - GITHUB_BASE_REF: process.env.GITHUB_BASE_REF, - GITHUB_HEAD_REF: process.env.GITHUB_HEAD_REF, - GITHUB_REF: process.env.GITHUB_REF, - GITHUB_REF_NAME: process.env.GITHUB_REF_NAME, - GITHUB_REF_PROTECTED: process.env.GITHUB_REF_PROTECTED, - GITHUB_REF_TYPE: process.env.GITHUB_REF_TYPE, - GITHUB_WORKFLOW_REF: process.env.GITHUB_WORKFLOW_REF, - }), - ); + // The major version tag should only be set when releasing on the `main` branch + if (process.env.GITHUB_REF !== 'refs/heads/main') { + // eslint-disable-next-line no-console + console.warn(`Running with the following ref: ${process.env.GITHUB_REF || 'n/a'}, not setting major version tag`); + return; + } const parsedVersion = parse(pkg.version); diff --git a/bin/set-version-output.js b/bin/set-version-output.js index 41de6484b..0aee75ce5 100755 --- a/bin/set-version-output.js +++ b/bin/set-version-output.js @@ -3,7 +3,7 @@ import * as core from '@actions/core'; // eslint-disable-next-line import/extensions -import { getNodeVersion, getMajorPkgVersion } from '../dist/lib/getPkgVersion.js'; +import { getNodeVersion, getMajorPkgVersion } from '../dist/lib/getPkg.js'; /** * Sets output parameters for GitHub Actions workflow so we can do diff --git a/dist-gha/commands.js b/dist-gha/commands.js index 53423b4a5..235fa7b51 100644 --- a/dist-gha/commands.js +++ b/dist-gha/commands.js @@ -1,4 +1,4 @@ -import require$$0$6,{fileURLToPath}from"node:url";import fs$6 from"node:fs";import fs$7,{constants as constants$9}from"node:fs/promises";import require$$1$2,{format as format$5,promisify}from"node:util";import path$1 from"node:path";import require$$0$7 from"fs";import require$$0$8 from"path";import require$$0$9 from"os";import os$1 from"node:os";import require$$1$1 from"tty";import*as require$$0$5 from"util";import require$$0__default from"util";import require$$6$1 from"inspector";import require$$0$a from"node:perf_hooks";import require$$0$b from"stream";import require$$0$c from"events";import require$$0$d from"node:readline";import process$2 from"node:process";import tty from"node:tty";import require$$0$e from"crypto";import require$$2$1 from"http";import require$$1$4 from"https";import require$$0$g from"net";import require$$1$3 from"tls";import require$$0$f from"assert";import require$$7$1 from"buffer";import require$$8 from"querystring";import require$$13 from"stream/web";import require$$0$i from"node:stream";import require$$0$h,{EventEmitter}from"node:events";import require$$0$j from"worker_threads";import require$$2$2 from"perf_hooks";import require$$5$1 from"util/types";import require$$4$2 from"async_hooks";import require$$1$5 from"console";import require$$0$k from"url";import zlib from"zlib";import require$$6$2 from"string_decoder";import require$$0$l from"diagnostics_channel";import require$$2$3,{spawn}from"child_process";import require$$6$3 from"timers";import require$$0$m from"readline";import require$$0$n from"constants";import crypto from"node:crypto";import{Buffer as Buffer$1}from"node:buffer";import childProcess,{execFile}from"node:child_process";import vm from"vm";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var lib$h={},util$f={},hasRequiredUtil$f;function requireUtil$f(){if(hasRequiredUtil$f)return util$f;function e(t,n){if(t=void 0===t?0:t,n=void 0===n?0:n,Array.isArray(t)&&Array.isArray(n)){if(0===t.length&&0===n.length)return 0;const r=e(t[0],n[0]);return 0!==r?r:e(t.slice(1),n.slice(1))}return tn?1:0}return hasRequiredUtil$f=1,Object.defineProperty(util$f,"__esModule",{value:!0}),util$f.pickBy=function(e,t){return Object.entries(e).reduce(((e,[n,r])=>(t(r)&&(e[n]=r),e)),{})},util$f.compact=function(e){return e.filter((e=>Boolean(e)))},util$f.uniqBy=function(e,t){return e.filter(((n,r)=>{const i=t(n);return!e.some(((e,n)=>n>r&&t(e)===i))}))},util$f.last=function(e){if(!e)return;return e.at(-1)},util$f.sortBy=function(t,n){return t.sort(((t,r)=>e(n(t),n(r))))},util$f.castArray=function(e){return void 0===e?[]:Array.isArray(e)?e:[e]},util$f.isProd=function(){return!["development","test"].includes(process.env.NODE_ENV??"")},util$f.maxBy=function(e,t){if(0===e.length)return;return e.reduce(((e,n)=>t(n)>t(e)?n:e))},util$f.sumBy=function(e,t){return e.reduce(((e,n)=>e+t(n)),0)},util$f.capitalize=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""},util$f.isTruthy=function(e){return["1","true","y","yes"].includes(e.toLowerCase())},util$f.isNotFalsy=function(e){return!["0","false","n","no"].includes(e.toLowerCase())},util$f.uniq=function(e){return[...new Set(e)].sort()},util$f.mapValues=function(e,t){return Object.entries(e).reduce(((e,[n,r])=>(e[n]=t(r,n),e)),{})},util$f.mergeNestedObjects=function(e,t){return Object.fromEntries(e.flatMap((e=>Object.entries(function(e,t){return t.split(".").reduce(((e,t)=>e?.[t]),e)}(e,t)??{}))).reverse())},util$f}var re={exports:{}},constants$8,hasRequiredConstants$8,debug_1,hasRequiredDebug,hasRequiredRe,parseOptions_1,hasRequiredParseOptions,identifiers,hasRequiredIdentifiers,semver$2,hasRequiredSemver$1,parse_1$2,hasRequiredParse$6,valid_1,hasRequiredValid$1,clean_1,hasRequiredClean,inc_1,hasRequiredInc,diff_1,hasRequiredDiff,major_1,hasRequiredMajor,minor_1,hasRequiredMinor,patch_1,hasRequiredPatch,prerelease_1,hasRequiredPrerelease,compare_1,hasRequiredCompare,rcompare_1,hasRequiredRcompare,compareLoose_1,hasRequiredCompareLoose,compareBuild_1,hasRequiredCompareBuild,sort_1,hasRequiredSort,rsort_1,hasRequiredRsort,gt_1,hasRequiredGt,lt_1,hasRequiredLt,eq_1$1,hasRequiredEq$1,neq_1,hasRequiredNeq,gte_1,hasRequiredGte,lte_1,hasRequiredLte,cmp_1,hasRequiredCmp,coerce_1,hasRequiredCoerce,lrucache,hasRequiredLrucache,range,hasRequiredRange,comparator,hasRequiredComparator,satisfies_1,hasRequiredSatisfies,toComparators_1,hasRequiredToComparators,maxSatisfying_1,hasRequiredMaxSatisfying,minSatisfying_1,hasRequiredMinSatisfying,minVersion_1,hasRequiredMinVersion,valid,hasRequiredValid,outside_1,hasRequiredOutside,gtr_1,hasRequiredGtr,ltr_1,hasRequiredLtr,intersects_1,hasRequiredIntersects,simplify,hasRequiredSimplify,subset_1,hasRequiredSubset,semver$1,hasRequiredSemver;function requireConstants$8(){if(hasRequiredConstants$8)return constants$8;hasRequiredConstants$8=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return constants$8={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function requireDebug(){if(hasRequiredDebug)return debug_1;hasRequiredDebug=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return debug_1=e}function requireRe(){return hasRequiredRe||(hasRequiredRe=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=requireConstants$8(),o=requireDebug(),s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],l=t.t={};let u=0;const d="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",i],[d,r]],f=(e,t,n)=>{const r=(e=>{for(const[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=u++;o(e,i,t),l[e]=i,c[i]=t,s[i]=new RegExp(t,n?"g":void 0),a[i]=new RegExp(r,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),f("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),f("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${d}+`),f("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),f("FULL",`^${c[l.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),f("LOOSE",`^${c[l.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),f("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),f("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?`+`(?:${c[l.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",c[l.COERCE],!0),f("COERCERTLFULL",c[l.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(re,re.exports)),re.exports}function requireParseOptions(){if(hasRequiredParseOptions)return parseOptions_1;hasRequiredParseOptions=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return parseOptions_1=n=>n?"object"!=typeof n?e:n:t,parseOptions_1}function requireIdentifiers(){if(hasRequiredIdentifiers)return identifiers;hasRequiredIdentifiers=1;const e=/^[0-9]+$/,t=(t,n)=>{const r=e.test(t),i=e.test(n);return r&&i&&(t=+t,n=+n),t===n?0:r&&!i?-1:i&&!r?1:tt(n,e)}}function requireSemver$1(){if(hasRequiredSemver$1)return semver$2;hasRequiredSemver$1=1;const e=requireDebug(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=requireConstants$8(),{safeRe:r,t:i}=requireRe(),o=requireParseOptions(),{compareIdentifiers:s}=requireIdentifiers();class a{constructor(s,c){if(c=o(c),s instanceof a){if(s.loose===!!c.loose&&s.includePrerelease===!!c.includePrerelease)return s;s=s.version}else if("string"!=typeof s)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",s,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const l=s.trim().match(c.loose?r[i.LOOSE]:r[i.FULL]);if(!l)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");l[4]?this.prerelease=l[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===s(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return semver$2=a}function requireParse$6(){if(hasRequiredParse$6)return parse_1$2;hasRequiredParse$6=1;const e=requireSemver$1();return parse_1$2=(t,n,r=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(e){if(!r)return null;throw e}},parse_1$2}function requireValid$1(){if(hasRequiredValid$1)return valid_1;hasRequiredValid$1=1;const e=requireParse$6();return valid_1=(t,n)=>{const r=e(t,n);return r?r.version:null},valid_1}function requireClean(){if(hasRequiredClean)return clean_1;hasRequiredClean=1;const e=requireParse$6();return clean_1=(t,n)=>{const r=e(t.trim().replace(/^[=v]+/,""),n);return r?r.version:null},clean_1}function requireInc(){if(hasRequiredInc)return inc_1;hasRequiredInc=1;const e=requireSemver$1();return inc_1=(t,n,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new e(t instanceof e?t.version:t,r).inc(n,i,o).version}catch(e){return null}},inc_1}function requireDiff(){if(hasRequiredDiff)return diff_1;hasRequiredDiff=1;const e=requireParse$6();return diff_1=(t,n)=>{const r=e(t,null,!0),i=e(n,null,!0),o=r.compare(i);if(0===o)return null;const s=o>0,a=s?r:i,c=s?i:r,l=!!a.prerelease.length;if(!!c.prerelease.length&&!l)return c.patch||c.minor?a.patch?"patch":a.minor?"minor":"major":"major";const u=l?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"}}function requireMajor(){if(hasRequiredMajor)return major_1;hasRequiredMajor=1;const e=requireSemver$1();return major_1=(t,n)=>new e(t,n).major}function requireMinor(){if(hasRequiredMinor)return minor_1;hasRequiredMinor=1;const e=requireSemver$1();return minor_1=(t,n)=>new e(t,n).minor}function requirePatch(){if(hasRequiredPatch)return patch_1;hasRequiredPatch=1;const e=requireSemver$1();return patch_1=(t,n)=>new e(t,n).patch}function requirePrerelease(){if(hasRequiredPrerelease)return prerelease_1;hasRequiredPrerelease=1;const e=requireParse$6();return prerelease_1=(t,n)=>{const r=e(t,n);return r&&r.prerelease.length?r.prerelease:null},prerelease_1}function requireCompare(){if(hasRequiredCompare)return compare_1;hasRequiredCompare=1;const e=requireSemver$1();return compare_1=(t,n,r)=>new e(t,r).compare(new e(n,r))}function requireRcompare(){if(hasRequiredRcompare)return rcompare_1;hasRequiredRcompare=1;const e=requireCompare();return rcompare_1=(t,n,r)=>e(n,t,r)}function requireCompareLoose(){if(hasRequiredCompareLoose)return compareLoose_1;hasRequiredCompareLoose=1;const e=requireCompare();return compareLoose_1=(t,n)=>e(t,n,!0)}function requireCompareBuild(){if(hasRequiredCompareBuild)return compareBuild_1;hasRequiredCompareBuild=1;const e=requireSemver$1();return compareBuild_1=(t,n,r)=>{const i=new e(t,r),o=new e(n,r);return i.compare(o)||i.compareBuild(o)}}function requireSort(){if(hasRequiredSort)return sort_1;hasRequiredSort=1;const e=requireCompareBuild();return sort_1=(t,n)=>t.sort(((t,r)=>e(t,r,n))),sort_1}function requireRsort(){if(hasRequiredRsort)return rsort_1;hasRequiredRsort=1;const e=requireCompareBuild();return rsort_1=(t,n)=>t.sort(((t,r)=>e(r,t,n))),rsort_1}function requireGt(){if(hasRequiredGt)return gt_1;hasRequiredGt=1;const e=requireCompare();return gt_1=(t,n,r)=>e(t,n,r)>0}function requireLt(){if(hasRequiredLt)return lt_1;hasRequiredLt=1;const e=requireCompare();return lt_1=(t,n,r)=>e(t,n,r)<0}function requireEq$1(){if(hasRequiredEq$1)return eq_1$1;hasRequiredEq$1=1;const e=requireCompare();return eq_1$1=(t,n,r)=>0===e(t,n,r)}function requireNeq(){if(hasRequiredNeq)return neq_1;hasRequiredNeq=1;const e=requireCompare();return neq_1=(t,n,r)=>0!==e(t,n,r)}function requireGte(){if(hasRequiredGte)return gte_1;hasRequiredGte=1;const e=requireCompare();return gte_1=(t,n,r)=>e(t,n,r)>=0}function requireLte(){if(hasRequiredLte)return lte_1;hasRequiredLte=1;const e=requireCompare();return lte_1=(t,n,r)=>e(t,n,r)<=0}function requireCmp(){if(hasRequiredCmp)return cmp_1;hasRequiredCmp=1;const e=requireEq$1(),t=requireNeq(),n=requireGt(),r=requireGte(),i=requireLt(),o=requireLte();return cmp_1=(s,a,c,l)=>{switch(a){case"===":return"object"==typeof s&&(s=s.version),"object"==typeof c&&(c=c.version),s===c;case"!==":return"object"==typeof s&&(s=s.version),"object"==typeof c&&(c=c.version),s!==c;case"":case"=":case"==":return e(s,c,l);case"!=":return t(s,c,l);case">":return n(s,c,l);case">=":return r(s,c,l);case"<":return i(s,c,l);case"<=":return o(s,c,l);default:throw new TypeError(`Invalid operator: ${a}`)}}}function requireCoerce(){if(hasRequiredCoerce)return coerce_1;hasRequiredCoerce=1;const e=requireSemver$1(),t=requireParse$6(),{safeRe:n,t:r}=requireRe();return coerce_1=(i,o)=>{if(i instanceof e)return i;if("number"==typeof i&&(i=String(i)),"string"!=typeof i)return null;let s=null;if((o=o||{}).rtl){const e=o.includePrerelease?n[r.COERCERTLFULL]:n[r.COERCERTL];let t;for(;(t=e.exec(i))&&(!s||s.index+s[0].length!==i.length);)s&&t.index+t[0].length===s.index+s[0].length||(s=t),e.lastIndex=t.index+t[1].length+t[2].length;e.lastIndex=-1}else s=i.match(o.includePrerelease?n[r.COERCEFULL]:n[r.COERCE]);if(null===s)return null;const a=s[2],c=s[3]||"0",l=s[4]||"0",u=o.includePrerelease&&s[5]?`-${s[5]}`:"",d=o.includePrerelease&&s[6]?`+${s[6]}`:"";return t(`${a}.${c}.${l}${u}${d}`,o)},coerce_1}function requireLrucache(){if(hasRequiredLrucache)return lrucache;hasRequiredLrucache=1;return lrucache=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}}function requireRange(){if(hasRequiredRange)return range;hasRequiredRange=1;const e=/\s+/g;class t{constructor(n,o){if(o=r(o),n instanceof t)return n.loose===!!o.loose&&n.includePrerelease===!!o.includePrerelease?n:new t(n.raw,o);if(n instanceof i)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=n.trim().replace(e," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!_(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&p)|(this.options.loose&&f))+":"+e,r=n.get(t);if(r)return r;const s=this.options.loose,m=s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(m,D(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],l),o("comparator trim",e),e=e.replace(a[c.TILDETRIM],u),o("tilde trim",e),e=e.replace(a[c.CARETTRIM],d),o("caret trim",e);let h=e.split(" ").map((e=>g(e,this.options))).join(" ").split(/\s+/).map((e=>k(e,this.options)));s&&(h=h.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE]))))),o("range list",h);const A=new Map,y=h.map((e=>new i(e,this.options)));for(const e of y){if(_(e))return[e];A.set(e.value,e)}A.size>1&&A.has("")&&A.delete("");const v=[...A.values()];return n.set(t,v),v}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>h(t,n)&&e.set.some((e=>h(e,n)&&t.every((t=>e.every((e=>t.intersects(e,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,m=e=>""===e.value,h=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},g=(e,t)=>(o("comp",e,t),e=b(e,t),o("caret",e),e=y(e,t),o("tildes",e),e=E(e,t),o("xrange",e),e=S(e,t),o("stars",e),e),A=e=>!e||"x"===e.toLowerCase()||"*"===e,y=(e,t)=>e.trim().split(/\s+/).map((e=>v(e,t))).join(" "),v=(e,t)=>{const n=t.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(n,((t,n,r,i,s)=>{let a;return o("tilde",e,t,n,r,i,s),A(n)?a="":A(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:A(i)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${n}.${r}.${i}-${s} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",a),a}))},b=(e,t)=>e.trim().split(/\s+/).map((e=>C(e,t))).join(" "),C=(e,t)=>{o("caret",e,t);const n=t.loose?a[c.CARETLOOSE]:a[c.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,s,a)=>{let c;return o("caret",e,t,n,i,s,a),A(n)?c="":A(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:A(s)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===n?"0"===i?`>=${n}.${i}.${s}-${a} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}-${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s}-${a} <${+n+1}.0.0-0`):(o("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${s}${r} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s} <${+n+1}.0.0-0`),o("caret return",c),c}))},E=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>x(e,t))).join(" ")),x=(e,t)=>{e=e.trim();const n=t.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(n,((n,r,i,s,a,c)=>{o("xRange",e,n,r,i,s,a,c);const l=A(i),u=l||A(s),d=u||A(a),p=d;return"="===r&&p&&(r=""),c=t.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&p?(u&&(s=0),a=0,">"===r?(r=">=",u?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===r&&(r="<",u?i=+i+1:s=+s+1),"<"===r&&(c="-0"),n=`${r+i}.${s}.${a}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o("xRange return",n),n}))},S=(e,t)=>(o("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),k=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),D=e=>(t,n,r,i,o,s,a,c,l,u,d,p)=>`${n=A(r)?"":A(i)?`>=${r}.0.0${e?"-0":""}`:A(o)?`>=${r}.${i}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=A(l)?"":A(u)?`<${+l+1}.0.0-0`:A(d)?`<${l}.${+u+1}.0-0`:p?`<=${l}.${u}.${d}-${p}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`}`.trim(),w=(e,t,n)=>{for(let n=0;n0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return range}function requireComparator(){if(hasRequiredComparator)return comparator;hasRequiredComparator=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),s("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,r).test(this.value):""===e.operator?""===e.value||new c(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}comparator=t;const n=requireParseOptions(),{safeRe:r,t:i}=requireRe(),o=requireCmp(),s=requireDebug(),a=requireSemver$1(),c=requireRange();return comparator}function requireSatisfies(){if(hasRequiredSatisfies)return satisfies_1;hasRequiredSatisfies=1;const e=requireRange();return satisfies_1=(t,n,r)=>{try{n=new e(n,r)}catch(e){return!1}return n.test(t)},satisfies_1}function requireToComparators(){if(hasRequiredToComparators)return toComparators_1;hasRequiredToComparators=1;const e=requireRange();return toComparators_1=(t,n)=>new e(t,n).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" "))),toComparators_1}function requireMaxSatisfying(){if(hasRequiredMaxSatisfying)return maxSatisfying_1;hasRequiredMaxSatisfying=1;const e=requireSemver$1(),t=requireRange();return maxSatisfying_1=(n,r,i)=>{let o=null,s=null,a=null;try{a=new t(r,i)}catch(e){return null}return n.forEach((t=>{a.test(t)&&(o&&-1!==s.compare(t)||(o=t,s=new e(o,i)))})),o},maxSatisfying_1}function requireMinSatisfying(){if(hasRequiredMinSatisfying)return minSatisfying_1;hasRequiredMinSatisfying=1;const e=requireSemver$1(),t=requireRange();return minSatisfying_1=(n,r,i)=>{let o=null,s=null,a=null;try{a=new t(r,i)}catch(e){return null}return n.forEach((t=>{a.test(t)&&(o&&1!==s.compare(t)||(o=t,s=new e(o,i)))})),o},minSatisfying_1}function requireMinVersion(){if(hasRequiredMinVersion)return minVersion_1;hasRequiredMinVersion=1;const e=requireSemver$1(),t=requireRange(),n=requireGt();return minVersion_1=(r,i)=>{r=new t(r,i);let o=new e("0.0.0");if(r.test(o))return o;if(o=new e("0.0.0-0"),r.test(o))return o;o=null;for(let t=0;t{const r=new e(t.semver.version);switch(t.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":s&&!n(r,s)||(s=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}})),!s||o&&!n(o,s)||(o=s)}return o&&r.test(o)?o:null},minVersion_1}function requireValid(){if(hasRequiredValid)return valid;hasRequiredValid=1;const e=requireRange();return valid=(t,n)=>{try{return new e(t,n).range||"*"}catch(e){return null}},valid}function requireOutside(){if(hasRequiredOutside)return outside_1;hasRequiredOutside=1;const e=requireSemver$1(),t=requireComparator(),{ANY:n}=t,r=requireRange(),i=requireSatisfies(),o=requireGt(),s=requireLt(),a=requireLte(),c=requireGte();return outside_1=(l,u,d,p)=>{let f,_,m,h,g;switch(l=new e(l,p),u=new r(u,p),d){case">":f=o,_=a,m=s,h=">",g=">=";break;case"<":f=s,_=c,m=o,h="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(l,u,p))return!1;for(let e=0;e{e.semver===n&&(e=new t(">=0.0.0")),i=i||e,o=o||e,f(e.semver,i.semver,p)?i=e:m(e.semver,o.semver,p)&&(o=e)})),i.operator===h||i.operator===g)return!1;if((!o.operator||o.operator===h)&&_(l,o.semver))return!1;if(o.operator===g&&m(l,o.semver))return!1}return!0},outside_1}function requireGtr(){if(hasRequiredGtr)return gtr_1;hasRequiredGtr=1;const e=requireOutside();return gtr_1=(t,n,r)=>e(t,n,">",r),gtr_1}function requireLtr(){if(hasRequiredLtr)return ltr_1;hasRequiredLtr=1;const e=requireOutside();return ltr_1=(t,n,r)=>e(t,n,"<",r),ltr_1}function requireIntersects(){if(hasRequiredIntersects)return intersects_1;hasRequiredIntersects=1;const e=requireRange();return intersects_1=(t,n,r)=>(t=new e(t,r),n=new e(n,r),t.intersects(n,r)),intersects_1}function requireSimplify(){if(hasRequiredSimplify)return simplify;hasRequiredSimplify=1;const e=requireSatisfies(),t=requireCompare();return simplify=(n,r,i)=>{const o=[];let s=null,a=null;const c=n.sort(((e,n)=>t(e,n,i)));for(const t of c){e(t,r,i)?(a=t,s||(s=t)):(a&&o.push([s,a]),a=null,s=null)}s&&o.push([s,null]);const l=[];for(const[e,t]of o)e===t?l.push(e):t||e!==c[0]?t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`):l.push("*");const u=l.join(" || "),d="string"==typeof r.raw?r.raw:String(r);return u.length=0.0.0-0")],s=[new t(">=0.0.0")],a=(e,t,a)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===n){if(1===t.length&&t[0].semver===n)return!0;e=a.includePrerelease?o:s}if(1===t.length&&t[0].semver===n){if(a.includePrerelease)return!0;t=s}const u=new Set;let d,p,f,_,m,h,g;for(const t of e)">"===t.operator||">="===t.operator?d=c(d,t,a):"<"===t.operator||"<="===t.operator?p=l(p,t,a):u.add(t.semver);if(u.size>1)return null;if(d&&p){if(f=i(d.semver,p.semver,a),f>0)return null;if(0===f&&(">="!==d.operator||"<="!==p.operator))return null}for(const e of u){if(d&&!r(e,String(d),a))return null;if(p&&!r(e,String(p),a))return null;for(const n of t)if(!r(e,String(n),a))return!1;return!0}let A=!(!p||a.includePrerelease||!p.semver.prerelease.length)&&p.semver,y=!(!d||a.includePrerelease||!d.semver.prerelease.length)&&d.semver;A&&1===A.prerelease.length&&"<"===p.operator&&0===A.prerelease[0]&&(A=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,h=h||"<"===e.operator||"<="===e.operator,d)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(_=c(d,e,a),_===e&&_!==d)return!1}else if(">="===d.operator&&!r(d.semver,String(e),a))return!1;if(p)if(A&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===A.major&&e.semver.minor===A.minor&&e.semver.patch===A.patch&&(A=!1),"<"===e.operator||"<="===e.operator){if(m=l(p,e,a),m===e&&m!==p)return!1}else if("<="===p.operator&&!r(p.semver,String(e),a))return!1;if(!e.operator&&(p||d)&&0!==f)return!1}return!(d&&h&&!p&&0!==f)&&(!(p&&g&&!d&&0!==f)&&(!y&&!A))},c=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},l=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};return subset_1=(t,n,r={})=>{if(t===n)return!0;t=new e(t,r),n=new e(n,r);let i=!1;e:for(const e of t.set){for(const t of n.set){const n=a(e,t,r);if(i=i||null!==n,n)continue e}if(i)return!1}return!0},subset_1}function requireSemver(){if(hasRequiredSemver)return semver$1;hasRequiredSemver=1;const e=requireRe(),t=requireConstants$8(),n=requireSemver$1(),r=requireIdentifiers(),i=requireParse$6(),o=requireValid$1(),s=requireClean(),a=requireInc(),c=requireDiff(),l=requireMajor(),u=requireMinor(),d=requirePatch(),p=requirePrerelease(),f=requireCompare(),_=requireRcompare(),m=requireCompareLoose(),h=requireCompareBuild(),g=requireSort(),A=requireRsort(),y=requireGt(),v=requireLt(),b=requireEq$1(),C=requireNeq(),E=requireGte(),x=requireLte(),S=requireCmp(),k=requireCoerce(),D=requireComparator(),w=requireRange(),I=requireSatisfies(),T=requireToComparators(),F=requireMaxSatisfying(),R=requireMinSatisfying(),P=requireMinVersion(),N=requireValid(),B=requireOutside(),O=requireGtr(),q=requireLtr(),$=requireIntersects(),Q=requireSimplify(),L=requireSubset();return semver$1={parse:i,valid:o,clean:s,inc:a,diff:c,major:l,minor:u,patch:d,prerelease:p,compare:f,rcompare:_,compareLoose:m,compareBuild:h,sort:g,rsort:A,gt:y,lt:v,eq:b,neq:C,gte:E,lte:x,cmp:S,coerce:k,Comparator:D,Range:w,satisfies:I,toComparators:T,maxSatisfying:F,minSatisfying:R,minVersion:P,validRange:N,outside:B,gtr:O,ltr:q,intersects:$,simplifyRange:Q,subset:L,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers}}var args={},fs$5={},hasRequiredFs$4,hasRequiredArgs;function requireFs$4(){if(hasRequiredFs$4)return fs$5;hasRequiredFs$4=1,Object.defineProperty(fs$5,"__esModule",{value:!0}),fs$5.fileExists=fs$5.dirExists=void 0,fs$5.readJson=o,fs$5.safeReadJson=async function(e,t=!0){try{return await o(e,t)}catch{}},fs$5.existsSync=function(t){return(0,e.existsSync)(t)};const e=fs$6,t=fs$7,n=requireUtil$f();fs$5.dirExists=async e=>{let n;try{n=await(0,t.stat)(e)}catch{throw new Error(`No directory found at ${e}`)}if(!n.isDirectory())throw new Error(`${e} exists but is not a directory`);return e};fs$5.fileExists=async e=>{let n;try{n=await(0,t.stat)(e)}catch{throw new Error(`No file found at ${e}`)}if(!n.isFile())throw new Error(`${e} exists but is not a file`);return e};class r extends Map{set(e,t){return(0,n.isProd)()&&super.set(e,t),this}}const i=new r;async function o(e,n=!0){if(n&&i.has(e))return JSON.parse(i.get(e));const r=await(0,t.readFile)(e,"utf8");return i.set(e,r),JSON.parse(r)}return fs$5}function requireArgs(){if(hasRequiredArgs)return args;hasRequiredArgs=1,Object.defineProperty(args,"__esModule",{value:!0}),args.string=args.url=args.file=args.directory=args.integer=args.boolean=void 0,args.custom=r;const e=require$$0$6,t=requireFs$4(),n=requireUtil$f();function r(e){return(t={})=>({parse:async(e,t,n)=>e,...e,...t,input:[],type:"option"})}args.boolean=r({parse:async e=>Boolean(e)&&(0,n.isNotFalsy)(e)}),args.integer=r({async parse(e,t,n){if(!/^-?\d+$/.test(e))throw new Error(`Expected an integer but received: ${e}`);const r=Number.parseInt(e,10);if(void 0!==n.min&&rn.max)throw new Error(`Expected an integer less than or equal to ${n.max} but received: ${e}`);return r}}),args.directory=r({parse:async(e,n,r)=>r.exists?(0,t.dirExists)(e):e}),args.file=r({parse:async(e,n,r)=>r.exists?(0,t.fileExists)(e):e}),args.url=r({async parse(t){try{return new e.URL(t)}catch{throw new Error(`Expected a valid url but received: ${t}`)}}});const i=r({});return args.string=i,args}var command$2={},cache$3={},hasRequiredCache$2;function requireCache$2(){if(hasRequiredCache$2)return cache$3;hasRequiredCache$2=1,Object.defineProperty(cache$3,"__esModule",{value:!0});const e=fs$6,t=path$1;class n extends Map{static instance;constructor(){super(),this.set("@oclif/core",this.getOclifCoreMeta())}static getInstance(){return n.instance||(n.instance=new n),n.instance}get(e){return super.get(e)}getOclifCoreMeta(){try{return{name:"@oclif/core",version:require("@oclif/core/package.json").version}}catch{try{return{name:"@oclif/core",version:JSON.parse((0,e.readFileSync)((0,t.join)(__dirname,"..","package.json"),"utf8")).version}}catch{return{name:"@oclif/core",version:"unknown"}}}}}return cache$3.default=n,cache$3}var config$3={},config$2={exports:{}},ejs={},utils$c={},hasRequiredUtils$c;function requireUtils$c(){return hasRequiredUtils$c||(hasRequiredUtils$c=1,function(e){var t=/[|\\{}()[\]^$+*?.]/g,n=Object.prototype.hasOwnProperty,r=function(e,t){return n.apply(e,[t])};e.escapeRegExpChars=function(e){return e?String(e).replace(t,"\\$&"):""};var i={"&":"&","<":"<",">":">",'"':""","'":"'"},o=/[&<>'"]/g;function s(e){return i[e]||e}function a(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'}e.escapeXML=function(e){return null==e?"":String(e).replace(o,s)};try{"function"==typeof Object.defineProperty?Object.defineProperty(e.escapeXML,"toString",{value:a}):e.escapeXML.toString=a}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}e.shallowCopy=function(e,t){if(t=t||{},null!=e)for(var n in t)r(t,n)&&"__proto__"!==n&&"constructor"!==n&&(e[n]=t[n]);return e},e.shallowCopyFromList=function(e,t,n){if(n=n||[],t=t||{},null!=e)for(var i=0;i (http://fleegix.org)",license$2="Apache-2.0",bin$2={ejs:"./bin/cli.js"},main$5="./lib/ejs.js",jsdelivr="ejs.min.js",unpkg="ejs.min.js",repository$2={type:"git",url:"git://github.com/mde/ejs.git"},bugs$2="https://github.com/mde/ejs/issues",homepage="https://github.com/mde/ejs",dependencies$4={jake:"^10.8.5"},devDependencies$1={browserify:"^16.5.1",eslint:"^6.8.0","git-directory-deploy":"^1.5.1",jsdoc:"^4.0.2","lru-cache":"^4.0.1",mocha:"^10.2.0","uglify-js":"^3.3.16"},engines$2={node:">=0.10.0"},scripts$2={test:"npx jake test"},require$$3$3={name:name$2,description:description$4,keywords:keywords$2,version:version$2,author:author$2,license:license$2,bin:bin$2,main:main$5,jsdelivr:jsdelivr,unpkg:unpkg,repository:repository$2,bugs:bugs$2,homepage:homepage,dependencies:dependencies$4,devDependencies:devDependencies$1,engines:engines$2,scripts:scripts$2},hasRequiredEjs;function requireEjs(){return hasRequiredEjs||(hasRequiredEjs=1,function(e){ +import require$$0$6,{fileURLToPath}from"node:url";import fs$6,{readFileSync}from"node:fs";import fs$7,{constants as constants$9}from"node:fs/promises";import require$$1$2,{format as format$5,promisify}from"node:util";import path$1 from"node:path";import require$$0$7 from"fs";import require$$0$8 from"path";import require$$0$9 from"os";import os$1 from"node:os";import require$$1$1 from"tty";import*as require$$0$5 from"util";import require$$0__default from"util";import require$$6$1 from"inspector";import require$$0$a from"node:perf_hooks";import require$$0$b from"stream";import require$$0$c from"events";import require$$0$d from"node:readline";import process$2 from"node:process";import tty from"node:tty";import require$$0$e from"crypto";import require$$2$1 from"http";import require$$1$4 from"https";import require$$0$g from"net";import require$$1$3 from"tls";import require$$0$f from"assert";import require$$7$1 from"buffer";import require$$8 from"querystring";import require$$13 from"stream/web";import require$$0$i from"node:stream";import require$$0$h,{EventEmitter}from"node:events";import require$$0$j from"worker_threads";import require$$2$2 from"perf_hooks";import require$$5$1 from"util/types";import require$$4$2 from"async_hooks";import require$$1$5 from"console";import require$$0$k from"url";import zlib from"zlib";import require$$6$2 from"string_decoder";import require$$0$l from"diagnostics_channel";import require$$2$3,{spawn}from"child_process";import require$$6$3 from"timers";import require$$0$m from"readline";import require$$0$n from"constants";import crypto from"node:crypto";import{Buffer as Buffer$1}from"node:buffer";import childProcess,{execFile}from"node:child_process";import vm from"vm";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}function commonjsRequire(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var lib$h={},util$f={},hasRequiredUtil$f;function requireUtil$f(){if(hasRequiredUtil$f)return util$f;function e(t,n){if(t=void 0===t?0:t,n=void 0===n?0:n,Array.isArray(t)&&Array.isArray(n)){if(0===t.length&&0===n.length)return 0;const r=e(t[0],n[0]);return 0!==r?r:e(t.slice(1),n.slice(1))}return tn?1:0}return hasRequiredUtil$f=1,Object.defineProperty(util$f,"__esModule",{value:!0}),util$f.pickBy=function(e,t){return Object.entries(e).reduce(((e,[n,r])=>(t(r)&&(e[n]=r),e)),{})},util$f.compact=function(e){return e.filter((e=>Boolean(e)))},util$f.uniqBy=function(e,t){return e.filter(((n,r)=>{const i=t(n);return!e.some(((e,n)=>n>r&&t(e)===i))}))},util$f.last=function(e){if(!e)return;return e.at(-1)},util$f.sortBy=function(t,n){return t.sort(((t,r)=>e(n(t),n(r))))},util$f.castArray=function(e){return void 0===e?[]:Array.isArray(e)?e:[e]},util$f.isProd=function(){return!["development","test"].includes(process.env.NODE_ENV??"")},util$f.maxBy=function(e,t){if(0===e.length)return;return e.reduce(((e,n)=>t(n)>t(e)?n:e))},util$f.sumBy=function(e,t){return e.reduce(((e,n)=>e+t(n)),0)},util$f.capitalize=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""},util$f.isTruthy=function(e){return["1","true","y","yes"].includes(e.toLowerCase())},util$f.isNotFalsy=function(e){return!["0","false","n","no"].includes(e.toLowerCase())},util$f.uniq=function(e){return[...new Set(e)].sort()},util$f.mapValues=function(e,t){return Object.entries(e).reduce(((e,[n,r])=>(e[n]=t(r,n),e)),{})},util$f.mergeNestedObjects=function(e,t){return Object.fromEntries(e.flatMap((e=>Object.entries(function(e,t){return t.split(".").reduce(((e,t)=>e?.[t]),e)}(e,t)??{}))).reverse())},util$f}var re={exports:{}},constants$8,hasRequiredConstants$8,debug_1,hasRequiredDebug,hasRequiredRe,parseOptions_1,hasRequiredParseOptions,identifiers,hasRequiredIdentifiers,semver$2,hasRequiredSemver$1,parse_1$2,hasRequiredParse$6,valid_1,hasRequiredValid$1,clean_1,hasRequiredClean,inc_1,hasRequiredInc,diff_1,hasRequiredDiff,major_1,hasRequiredMajor,minor_1,hasRequiredMinor,patch_1,hasRequiredPatch,prerelease_1,hasRequiredPrerelease,compare_1,hasRequiredCompare,rcompare_1,hasRequiredRcompare,compareLoose_1,hasRequiredCompareLoose,compareBuild_1,hasRequiredCompareBuild,sort_1,hasRequiredSort,rsort_1,hasRequiredRsort,gt_1,hasRequiredGt,lt_1,hasRequiredLt,eq_1$1,hasRequiredEq$1,neq_1,hasRequiredNeq,gte_1,hasRequiredGte,lte_1,hasRequiredLte,cmp_1,hasRequiredCmp,coerce_1,hasRequiredCoerce,lrucache,hasRequiredLrucache,range,hasRequiredRange,comparator,hasRequiredComparator,satisfies_1,hasRequiredSatisfies,toComparators_1,hasRequiredToComparators,maxSatisfying_1,hasRequiredMaxSatisfying,minSatisfying_1,hasRequiredMinSatisfying,minVersion_1,hasRequiredMinVersion,valid,hasRequiredValid,outside_1,hasRequiredOutside,gtr_1,hasRequiredGtr,ltr_1,hasRequiredLtr,intersects_1,hasRequiredIntersects,simplify,hasRequiredSimplify,subset_1,hasRequiredSubset,semver$1,hasRequiredSemver;function requireConstants$8(){if(hasRequiredConstants$8)return constants$8;hasRequiredConstants$8=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return constants$8={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function requireDebug(){if(hasRequiredDebug)return debug_1;hasRequiredDebug=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return debug_1=e}function requireRe(){return hasRequiredRe||(hasRequiredRe=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=requireConstants$8(),o=requireDebug(),s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],l=t.t={};let u=0;const d="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",i],[d,r]],f=(e,t,n)=>{const r=(e=>{for(const[t,n]of p)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=u++;o(e,i,t),l[e]=i,c[i]=t,s[i]=new RegExp(t,n?"g":void 0),a[i]=new RegExp(r,n?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),f("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),f("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${d}+`),f("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),f("FULL",`^${c[l.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),f("LOOSE",`^${c[l.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),f("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),f("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?`+`(?:${c[l.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",c[l.COERCE],!0),f("COERCERTLFULL",c[l.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(re,re.exports)),re.exports}function requireParseOptions(){if(hasRequiredParseOptions)return parseOptions_1;hasRequiredParseOptions=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return parseOptions_1=n=>n?"object"!=typeof n?e:n:t,parseOptions_1}function requireIdentifiers(){if(hasRequiredIdentifiers)return identifiers;hasRequiredIdentifiers=1;const e=/^[0-9]+$/,t=(t,n)=>{const r=e.test(t),i=e.test(n);return r&&i&&(t=+t,n=+n),t===n?0:r&&!i?-1:i&&!r?1:tt(n,e)}}function requireSemver$1(){if(hasRequiredSemver$1)return semver$2;hasRequiredSemver$1=1;const e=requireDebug(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=requireConstants$8(),{safeRe:r,t:i}=requireRe(),o=requireParseOptions(),{compareIdentifiers:s}=requireIdentifiers();class a{constructor(s,c){if(c=o(c),s instanceof a){if(s.loose===!!c.loose&&s.includePrerelease===!!c.includePrerelease)return s;s=s.version}else if("string"!=typeof s)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",s,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const l=s.trim().match(c.loose?r[i.LOOSE]:r[i.FULL]);if(!l)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");l[4]?this.prerelease=l[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===s(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return semver$2=a}function requireParse$6(){if(hasRequiredParse$6)return parse_1$2;hasRequiredParse$6=1;const e=requireSemver$1();return parse_1$2=(t,n,r=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(e){if(!r)return null;throw e}},parse_1$2}function requireValid$1(){if(hasRequiredValid$1)return valid_1;hasRequiredValid$1=1;const e=requireParse$6();return valid_1=(t,n)=>{const r=e(t,n);return r?r.version:null},valid_1}function requireClean(){if(hasRequiredClean)return clean_1;hasRequiredClean=1;const e=requireParse$6();return clean_1=(t,n)=>{const r=e(t.trim().replace(/^[=v]+/,""),n);return r?r.version:null},clean_1}function requireInc(){if(hasRequiredInc)return inc_1;hasRequiredInc=1;const e=requireSemver$1();return inc_1=(t,n,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new e(t instanceof e?t.version:t,r).inc(n,i,o).version}catch(e){return null}},inc_1}function requireDiff(){if(hasRequiredDiff)return diff_1;hasRequiredDiff=1;const e=requireParse$6();return diff_1=(t,n)=>{const r=e(t,null,!0),i=e(n,null,!0),o=r.compare(i);if(0===o)return null;const s=o>0,a=s?r:i,c=s?i:r,l=!!a.prerelease.length;if(!!c.prerelease.length&&!l)return c.patch||c.minor?a.patch?"patch":a.minor?"minor":"major":"major";const u=l?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"}}function requireMajor(){if(hasRequiredMajor)return major_1;hasRequiredMajor=1;const e=requireSemver$1();return major_1=(t,n)=>new e(t,n).major}function requireMinor(){if(hasRequiredMinor)return minor_1;hasRequiredMinor=1;const e=requireSemver$1();return minor_1=(t,n)=>new e(t,n).minor}function requirePatch(){if(hasRequiredPatch)return patch_1;hasRequiredPatch=1;const e=requireSemver$1();return patch_1=(t,n)=>new e(t,n).patch}function requirePrerelease(){if(hasRequiredPrerelease)return prerelease_1;hasRequiredPrerelease=1;const e=requireParse$6();return prerelease_1=(t,n)=>{const r=e(t,n);return r&&r.prerelease.length?r.prerelease:null},prerelease_1}function requireCompare(){if(hasRequiredCompare)return compare_1;hasRequiredCompare=1;const e=requireSemver$1();return compare_1=(t,n,r)=>new e(t,r).compare(new e(n,r))}function requireRcompare(){if(hasRequiredRcompare)return rcompare_1;hasRequiredRcompare=1;const e=requireCompare();return rcompare_1=(t,n,r)=>e(n,t,r)}function requireCompareLoose(){if(hasRequiredCompareLoose)return compareLoose_1;hasRequiredCompareLoose=1;const e=requireCompare();return compareLoose_1=(t,n)=>e(t,n,!0)}function requireCompareBuild(){if(hasRequiredCompareBuild)return compareBuild_1;hasRequiredCompareBuild=1;const e=requireSemver$1();return compareBuild_1=(t,n,r)=>{const i=new e(t,r),o=new e(n,r);return i.compare(o)||i.compareBuild(o)}}function requireSort(){if(hasRequiredSort)return sort_1;hasRequiredSort=1;const e=requireCompareBuild();return sort_1=(t,n)=>t.sort(((t,r)=>e(t,r,n))),sort_1}function requireRsort(){if(hasRequiredRsort)return rsort_1;hasRequiredRsort=1;const e=requireCompareBuild();return rsort_1=(t,n)=>t.sort(((t,r)=>e(r,t,n))),rsort_1}function requireGt(){if(hasRequiredGt)return gt_1;hasRequiredGt=1;const e=requireCompare();return gt_1=(t,n,r)=>e(t,n,r)>0}function requireLt(){if(hasRequiredLt)return lt_1;hasRequiredLt=1;const e=requireCompare();return lt_1=(t,n,r)=>e(t,n,r)<0}function requireEq$1(){if(hasRequiredEq$1)return eq_1$1;hasRequiredEq$1=1;const e=requireCompare();return eq_1$1=(t,n,r)=>0===e(t,n,r)}function requireNeq(){if(hasRequiredNeq)return neq_1;hasRequiredNeq=1;const e=requireCompare();return neq_1=(t,n,r)=>0!==e(t,n,r)}function requireGte(){if(hasRequiredGte)return gte_1;hasRequiredGte=1;const e=requireCompare();return gte_1=(t,n,r)=>e(t,n,r)>=0}function requireLte(){if(hasRequiredLte)return lte_1;hasRequiredLte=1;const e=requireCompare();return lte_1=(t,n,r)=>e(t,n,r)<=0}function requireCmp(){if(hasRequiredCmp)return cmp_1;hasRequiredCmp=1;const e=requireEq$1(),t=requireNeq(),n=requireGt(),r=requireGte(),i=requireLt(),o=requireLte();return cmp_1=(s,a,c,l)=>{switch(a){case"===":return"object"==typeof s&&(s=s.version),"object"==typeof c&&(c=c.version),s===c;case"!==":return"object"==typeof s&&(s=s.version),"object"==typeof c&&(c=c.version),s!==c;case"":case"=":case"==":return e(s,c,l);case"!=":return t(s,c,l);case">":return n(s,c,l);case">=":return r(s,c,l);case"<":return i(s,c,l);case"<=":return o(s,c,l);default:throw new TypeError(`Invalid operator: ${a}`)}}}function requireCoerce(){if(hasRequiredCoerce)return coerce_1;hasRequiredCoerce=1;const e=requireSemver$1(),t=requireParse$6(),{safeRe:n,t:r}=requireRe();return coerce_1=(i,o)=>{if(i instanceof e)return i;if("number"==typeof i&&(i=String(i)),"string"!=typeof i)return null;let s=null;if((o=o||{}).rtl){const e=o.includePrerelease?n[r.COERCERTLFULL]:n[r.COERCERTL];let t;for(;(t=e.exec(i))&&(!s||s.index+s[0].length!==i.length);)s&&t.index+t[0].length===s.index+s[0].length||(s=t),e.lastIndex=t.index+t[1].length+t[2].length;e.lastIndex=-1}else s=i.match(o.includePrerelease?n[r.COERCEFULL]:n[r.COERCE]);if(null===s)return null;const a=s[2],c=s[3]||"0",l=s[4]||"0",u=o.includePrerelease&&s[5]?`-${s[5]}`:"",d=o.includePrerelease&&s[6]?`+${s[6]}`:"";return t(`${a}.${c}.${l}${u}${d}`,o)},coerce_1}function requireLrucache(){if(hasRequiredLrucache)return lrucache;hasRequiredLrucache=1;return lrucache=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}}function requireRange(){if(hasRequiredRange)return range;hasRequiredRange=1;const e=/\s+/g;class t{constructor(n,o){if(o=r(o),n instanceof t)return n.loose===!!o.loose&&n.includePrerelease===!!o.includePrerelease?n:new t(n.raw,o);if(n instanceof i)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=n.trim().replace(e," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!_(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&p)|(this.options.loose&&f))+":"+e,r=n.get(t);if(r)return r;const s=this.options.loose,m=s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(m,D(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],l),o("comparator trim",e),e=e.replace(a[c.TILDETRIM],u),o("tilde trim",e),e=e.replace(a[c.CARETTRIM],d),o("caret trim",e);let h=e.split(" ").map((e=>g(e,this.options))).join(" ").split(/\s+/).map((e=>k(e,this.options)));s&&(h=h.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE]))))),o("range list",h);const A=new Map,y=h.map((e=>new i(e,this.options)));for(const e of y){if(_(e))return[e];A.set(e.value,e)}A.size>1&&A.has("")&&A.delete("");const v=[...A.values()];return n.set(t,v),v}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>h(t,n)&&e.set.some((e=>h(e,n)&&t.every((t=>e.every((e=>t.intersects(e,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,m=e=>""===e.value,h=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},g=(e,t)=>(o("comp",e,t),e=b(e,t),o("caret",e),e=y(e,t),o("tildes",e),e=E(e,t),o("xrange",e),e=S(e,t),o("stars",e),e),A=e=>!e||"x"===e.toLowerCase()||"*"===e,y=(e,t)=>e.trim().split(/\s+/).map((e=>v(e,t))).join(" "),v=(e,t)=>{const n=t.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(n,((t,n,r,i,s)=>{let a;return o("tilde",e,t,n,r,i,s),A(n)?a="":A(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:A(i)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${n}.${r}.${i}-${s} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",a),a}))},b=(e,t)=>e.trim().split(/\s+/).map((e=>C(e,t))).join(" "),C=(e,t)=>{o("caret",e,t);const n=t.loose?a[c.CARETLOOSE]:a[c.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,s,a)=>{let c;return o("caret",e,t,n,i,s,a),A(n)?c="":A(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:A(s)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===n?"0"===i?`>=${n}.${i}.${s}-${a} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}-${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s}-${a} <${+n+1}.0.0-0`):(o("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${s}${r} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s} <${+n+1}.0.0-0`),o("caret return",c),c}))},E=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>x(e,t))).join(" ")),x=(e,t)=>{e=e.trim();const n=t.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(n,((n,r,i,s,a,c)=>{o("xRange",e,n,r,i,s,a,c);const l=A(i),u=l||A(s),d=u||A(a),p=d;return"="===r&&p&&(r=""),c=t.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&p?(u&&(s=0),a=0,">"===r?(r=">=",u?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===r&&(r="<",u?i=+i+1:s=+s+1),"<"===r&&(c="-0"),n=`${r+i}.${s}.${a}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o("xRange return",n),n}))},S=(e,t)=>(o("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),k=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),D=e=>(t,n,r,i,o,s,a,c,l,u,d,p)=>`${n=A(r)?"":A(i)?`>=${r}.0.0${e?"-0":""}`:A(o)?`>=${r}.${i}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=A(l)?"":A(u)?`<${+l+1}.0.0-0`:A(d)?`<${l}.${+u+1}.0-0`:p?`<=${l}.${u}.${d}-${p}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`}`.trim(),w=(e,t,n)=>{for(let n=0;n0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return range}function requireComparator(){if(hasRequiredComparator)return comparator;hasRequiredComparator=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),s("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,r).test(this.value):""===e.operator?""===e.value||new c(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}comparator=t;const n=requireParseOptions(),{safeRe:r,t:i}=requireRe(),o=requireCmp(),s=requireDebug(),a=requireSemver$1(),c=requireRange();return comparator}function requireSatisfies(){if(hasRequiredSatisfies)return satisfies_1;hasRequiredSatisfies=1;const e=requireRange();return satisfies_1=(t,n,r)=>{try{n=new e(n,r)}catch(e){return!1}return n.test(t)},satisfies_1}function requireToComparators(){if(hasRequiredToComparators)return toComparators_1;hasRequiredToComparators=1;const e=requireRange();return toComparators_1=(t,n)=>new e(t,n).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" "))),toComparators_1}function requireMaxSatisfying(){if(hasRequiredMaxSatisfying)return maxSatisfying_1;hasRequiredMaxSatisfying=1;const e=requireSemver$1(),t=requireRange();return maxSatisfying_1=(n,r,i)=>{let o=null,s=null,a=null;try{a=new t(r,i)}catch(e){return null}return n.forEach((t=>{a.test(t)&&(o&&-1!==s.compare(t)||(o=t,s=new e(o,i)))})),o},maxSatisfying_1}function requireMinSatisfying(){if(hasRequiredMinSatisfying)return minSatisfying_1;hasRequiredMinSatisfying=1;const e=requireSemver$1(),t=requireRange();return minSatisfying_1=(n,r,i)=>{let o=null,s=null,a=null;try{a=new t(r,i)}catch(e){return null}return n.forEach((t=>{a.test(t)&&(o&&1!==s.compare(t)||(o=t,s=new e(o,i)))})),o},minSatisfying_1}function requireMinVersion(){if(hasRequiredMinVersion)return minVersion_1;hasRequiredMinVersion=1;const e=requireSemver$1(),t=requireRange(),n=requireGt();return minVersion_1=(r,i)=>{r=new t(r,i);let o=new e("0.0.0");if(r.test(o))return o;if(o=new e("0.0.0-0"),r.test(o))return o;o=null;for(let t=0;t{const r=new e(t.semver.version);switch(t.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":s&&!n(r,s)||(s=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}})),!s||o&&!n(o,s)||(o=s)}return o&&r.test(o)?o:null},minVersion_1}function requireValid(){if(hasRequiredValid)return valid;hasRequiredValid=1;const e=requireRange();return valid=(t,n)=>{try{return new e(t,n).range||"*"}catch(e){return null}},valid}function requireOutside(){if(hasRequiredOutside)return outside_1;hasRequiredOutside=1;const e=requireSemver$1(),t=requireComparator(),{ANY:n}=t,r=requireRange(),i=requireSatisfies(),o=requireGt(),s=requireLt(),a=requireLte(),c=requireGte();return outside_1=(l,u,d,p)=>{let f,_,m,h,g;switch(l=new e(l,p),u=new r(u,p),d){case">":f=o,_=a,m=s,h=">",g=">=";break;case"<":f=s,_=c,m=o,h="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(l,u,p))return!1;for(let e=0;e{e.semver===n&&(e=new t(">=0.0.0")),i=i||e,o=o||e,f(e.semver,i.semver,p)?i=e:m(e.semver,o.semver,p)&&(o=e)})),i.operator===h||i.operator===g)return!1;if((!o.operator||o.operator===h)&&_(l,o.semver))return!1;if(o.operator===g&&m(l,o.semver))return!1}return!0},outside_1}function requireGtr(){if(hasRequiredGtr)return gtr_1;hasRequiredGtr=1;const e=requireOutside();return gtr_1=(t,n,r)=>e(t,n,">",r),gtr_1}function requireLtr(){if(hasRequiredLtr)return ltr_1;hasRequiredLtr=1;const e=requireOutside();return ltr_1=(t,n,r)=>e(t,n,"<",r),ltr_1}function requireIntersects(){if(hasRequiredIntersects)return intersects_1;hasRequiredIntersects=1;const e=requireRange();return intersects_1=(t,n,r)=>(t=new e(t,r),n=new e(n,r),t.intersects(n,r)),intersects_1}function requireSimplify(){if(hasRequiredSimplify)return simplify;hasRequiredSimplify=1;const e=requireSatisfies(),t=requireCompare();return simplify=(n,r,i)=>{const o=[];let s=null,a=null;const c=n.sort(((e,n)=>t(e,n,i)));for(const t of c){e(t,r,i)?(a=t,s||(s=t)):(a&&o.push([s,a]),a=null,s=null)}s&&o.push([s,null]);const l=[];for(const[e,t]of o)e===t?l.push(e):t||e!==c[0]?t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`):l.push("*");const u=l.join(" || "),d="string"==typeof r.raw?r.raw:String(r);return u.length=0.0.0-0")],s=[new t(">=0.0.0")],a=(e,t,a)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===n){if(1===t.length&&t[0].semver===n)return!0;e=a.includePrerelease?o:s}if(1===t.length&&t[0].semver===n){if(a.includePrerelease)return!0;t=s}const u=new Set;let d,p,f,_,m,h,g;for(const t of e)">"===t.operator||">="===t.operator?d=c(d,t,a):"<"===t.operator||"<="===t.operator?p=l(p,t,a):u.add(t.semver);if(u.size>1)return null;if(d&&p){if(f=i(d.semver,p.semver,a),f>0)return null;if(0===f&&(">="!==d.operator||"<="!==p.operator))return null}for(const e of u){if(d&&!r(e,String(d),a))return null;if(p&&!r(e,String(p),a))return null;for(const n of t)if(!r(e,String(n),a))return!1;return!0}let A=!(!p||a.includePrerelease||!p.semver.prerelease.length)&&p.semver,y=!(!d||a.includePrerelease||!d.semver.prerelease.length)&&d.semver;A&&1===A.prerelease.length&&"<"===p.operator&&0===A.prerelease[0]&&(A=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,h=h||"<"===e.operator||"<="===e.operator,d)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(_=c(d,e,a),_===e&&_!==d)return!1}else if(">="===d.operator&&!r(d.semver,String(e),a))return!1;if(p)if(A&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===A.major&&e.semver.minor===A.minor&&e.semver.patch===A.patch&&(A=!1),"<"===e.operator||"<="===e.operator){if(m=l(p,e,a),m===e&&m!==p)return!1}else if("<="===p.operator&&!r(p.semver,String(e),a))return!1;if(!e.operator&&(p||d)&&0!==f)return!1}return!(d&&h&&!p&&0!==f)&&(!(p&&g&&!d&&0!==f)&&(!y&&!A))},c=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},l=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};return subset_1=(t,n,r={})=>{if(t===n)return!0;t=new e(t,r),n=new e(n,r);let i=!1;e:for(const e of t.set){for(const t of n.set){const n=a(e,t,r);if(i=i||null!==n,n)continue e}if(i)return!1}return!0},subset_1}function requireSemver(){if(hasRequiredSemver)return semver$1;hasRequiredSemver=1;const e=requireRe(),t=requireConstants$8(),n=requireSemver$1(),r=requireIdentifiers(),i=requireParse$6(),o=requireValid$1(),s=requireClean(),a=requireInc(),c=requireDiff(),l=requireMajor(),u=requireMinor(),d=requirePatch(),p=requirePrerelease(),f=requireCompare(),_=requireRcompare(),m=requireCompareLoose(),h=requireCompareBuild(),g=requireSort(),A=requireRsort(),y=requireGt(),v=requireLt(),b=requireEq$1(),C=requireNeq(),E=requireGte(),x=requireLte(),S=requireCmp(),k=requireCoerce(),D=requireComparator(),w=requireRange(),I=requireSatisfies(),T=requireToComparators(),F=requireMaxSatisfying(),R=requireMinSatisfying(),P=requireMinVersion(),N=requireValid(),B=requireOutside(),O=requireGtr(),q=requireLtr(),$=requireIntersects(),Q=requireSimplify(),L=requireSubset();return semver$1={parse:i,valid:o,clean:s,inc:a,diff:c,major:l,minor:u,patch:d,prerelease:p,compare:f,rcompare:_,compareLoose:m,compareBuild:h,sort:g,rsort:A,gt:y,lt:v,eq:b,neq:C,gte:E,lte:x,cmp:S,coerce:k,Comparator:D,Range:w,satisfies:I,toComparators:T,maxSatisfying:F,minSatisfying:R,minVersion:P,validRange:N,outside:B,gtr:O,ltr:q,intersects:$,simplifyRange:Q,subset:L,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers}}var args={},fs$5={},hasRequiredFs$4,hasRequiredArgs;function requireFs$4(){if(hasRequiredFs$4)return fs$5;hasRequiredFs$4=1,Object.defineProperty(fs$5,"__esModule",{value:!0}),fs$5.fileExists=fs$5.dirExists=void 0,fs$5.readJson=o,fs$5.safeReadJson=async function(e,t=!0){try{return await o(e,t)}catch{}},fs$5.existsSync=function(t){return(0,e.existsSync)(t)};const e=fs$6,t=fs$7,n=requireUtil$f();fs$5.dirExists=async e=>{let n;try{n=await(0,t.stat)(e)}catch{throw new Error(`No directory found at ${e}`)}if(!n.isDirectory())throw new Error(`${e} exists but is not a directory`);return e};fs$5.fileExists=async e=>{let n;try{n=await(0,t.stat)(e)}catch{throw new Error(`No file found at ${e}`)}if(!n.isFile())throw new Error(`${e} exists but is not a file`);return e};class r extends Map{set(e,t){return(0,n.isProd)()&&super.set(e,t),this}}const i=new r;async function o(e,n=!0){if(n&&i.has(e))return JSON.parse(i.get(e));const r=await(0,t.readFile)(e,"utf8");return i.set(e,r),JSON.parse(r)}return fs$5}function requireArgs(){if(hasRequiredArgs)return args;hasRequiredArgs=1,Object.defineProperty(args,"__esModule",{value:!0}),args.string=args.url=args.file=args.directory=args.integer=args.boolean=void 0,args.custom=r;const e=require$$0$6,t=requireFs$4(),n=requireUtil$f();function r(e){return(t={})=>({parse:async(e,t,n)=>e,...e,...t,input:[],type:"option"})}args.boolean=r({parse:async e=>Boolean(e)&&(0,n.isNotFalsy)(e)}),args.integer=r({async parse(e,t,n){if(!/^-?\d+$/.test(e))throw new Error(`Expected an integer but received: ${e}`);const r=Number.parseInt(e,10);if(void 0!==n.min&&rn.max)throw new Error(`Expected an integer less than or equal to ${n.max} but received: ${e}`);return r}}),args.directory=r({parse:async(e,n,r)=>r.exists?(0,t.dirExists)(e):e}),args.file=r({parse:async(e,n,r)=>r.exists?(0,t.fileExists)(e):e}),args.url=r({async parse(t){try{return new e.URL(t)}catch{throw new Error(`Expected a valid url but received: ${t}`)}}});const i=r({});return args.string=i,args}var command$2={},cache$3={},hasRequiredCache$2;function requireCache$2(){if(hasRequiredCache$2)return cache$3;hasRequiredCache$2=1,Object.defineProperty(cache$3,"__esModule",{value:!0});const e=fs$6,t=path$1;class n extends Map{static instance;constructor(){super(),this.set("@oclif/core",this.getOclifCoreMeta())}static getInstance(){return n.instance||(n.instance=new n),n.instance}get(e){return super.get(e)}getOclifCoreMeta(){try{return{name:"@oclif/core",version:require("@oclif/core/package.json").version}}catch{try{return{name:"@oclif/core",version:JSON.parse((0,e.readFileSync)((0,t.join)(__dirname,"..","package.json"),"utf8")).version}}catch{return{name:"@oclif/core",version:"unknown"}}}}}return cache$3.default=n,cache$3}var config$3={},config$2={exports:{}},ejs={},utils$c={},hasRequiredUtils$c;function requireUtils$c(){return hasRequiredUtils$c||(hasRequiredUtils$c=1,function(e){var t=/[|\\{}()[\]^$+*?.]/g,n=Object.prototype.hasOwnProperty,r=function(e,t){return n.apply(e,[t])};e.escapeRegExpChars=function(e){return e?String(e).replace(t,"\\$&"):""};var i={"&":"&","<":"<",">":">",'"':""","'":"'"},o=/[&<>'"]/g;function s(e){return i[e]||e}function a(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'}e.escapeXML=function(e){return null==e?"":String(e).replace(o,s)};try{"function"==typeof Object.defineProperty?Object.defineProperty(e.escapeXML,"toString",{value:a}):e.escapeXML.toString=a}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}e.shallowCopy=function(e,t){if(t=t||{},null!=e)for(var n in t)r(t,n)&&"__proto__"!==n&&"constructor"!==n&&(e[n]=t[n]);return e},e.shallowCopyFromList=function(e,t,n){if(n=n||[],t=t||{},null!=e)for(var i=0;i (http://fleegix.org)",license$1="Apache-2.0",bin$1={ejs:"./bin/cli.js"},main$5="./lib/ejs.js",jsdelivr="ejs.min.js",unpkg="ejs.min.js",repository$1={type:"git",url:"git://github.com/mde/ejs.git"},bugs$1="https://github.com/mde/ejs/issues",homepage="https://github.com/mde/ejs",dependencies$3={jake:"^10.8.5"},devDependencies={browserify:"^16.5.1",eslint:"^6.8.0","git-directory-deploy":"^1.5.1",jsdoc:"^4.0.2","lru-cache":"^4.0.1",mocha:"^10.2.0","uglify-js":"^3.3.16"},engines$1={node:">=0.10.0"},scripts$1={test:"npx jake test"},require$$3$3={name:name$1,description:description$3,keywords:keywords$1,version:version$1,author:author$1,license:license$1,bin:bin$1,main:main$5,jsdelivr:jsdelivr,unpkg:unpkg,repository:repository$1,bugs:bugs$1,homepage:homepage,dependencies:dependencies$3,devDependencies:devDependencies,engines:engines$1,scripts:scripts$1},hasRequiredEjs;function requireEjs(){return hasRequiredEjs||(hasRequiredEjs=1,function(e){ /** * @file Embedded JavaScript templating engine. {@link http://ejs.co} * @author Matthew Eernisse @@ -66,7 +66,7 @@ o[i-4]=this.maskKey[0],o[i-3]=this.maskKey[1],o[i-2]=this.maskKey[2],o[i-1]=this * Copyright(c) 2014 Jonathan Ong * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed - */function requireMimeTypes(){return hasRequiredMimeTypes||(hasRequiredMimeTypes=1,function(e){var t=requireMimeDb(),n=require$$0$8.extname,r=/^\s*([^;\s]*)(?:;|\s|$)/,i=/^text\//i;function o(e){if(!e||"string"!=typeof e)return!1;var n=r.exec(e),o=n&&t[n[1].toLowerCase()];return o&&o.charset?o.charset:!(!n||!i.test(n[1]))&&"UTF-8"}e.charset=o,e.charsets={lookup:o},e.contentType=function(t){if(!t||"string"!=typeof t)return!1;var n=-1===t.indexOf("/")?e.lookup(t):t;if(!n)return!1;if(-1===n.indexOf("charset")){var r=e.charset(n);r&&(n+="; charset="+r.toLowerCase())}return n},e.extension=function(t){if(!t||"string"!=typeof t)return!1;var n=r.exec(t),i=n&&e.extensions[n[1].toLowerCase()];if(!i||!i.length)return!1;return i[0]},e.extensions=Object.create(null),e.lookup=function(t){if(!t||"string"!=typeof t)return!1;var r=n("x."+t).toLowerCase().substr(1);if(!r)return!1;return e.types[r]||!1},e.types=Object.create(null),function(e,n){var r=["nginx","apache",void 0,"iana"];Object.keys(t).forEach((function(i){var o=t[i],s=o.extensions;if(s&&s.length){e[i]=s;for(var a=0;au||l===u&&"application/"===n[c].substr(0,12)))continue}n[c]=i}}}))}(e.extensions,e.types)}(mimeTypes)),mimeTypes}var mimeTypesExports=requireMimeTypes(),mime=getDefaultExportFromCjs(mimeTypesExports),undiciExports=requireUndici(),name$1="rdme",version$1="9.0.1",description$3="ReadMe's official CLI and GitHub Action.",license$1="MIT",author$1="ReadMe (https://readme.com)",engines$1={node:">=20.10.0"},bin$1={rdme:"bin/run.js"},files=["/bin/run*","/dist","/oclif.manifest.json"],keywords$1=["api","apidoc","apis","documentation","microservice","oai","oas","openapi","openapi document","openapi initiative","openapi spec","openapi specification","postman","readme","swagger"],repository$1={type:"git",url:"https://github.com/readmeio/rdme.git"},bugs$1={url:"https://github.com/readmeio/rdme/issues"},type$d="module",dependencies$3={"@actions/core":"^1.6.0","@oclif/core":"^4.0.29","@oclif/plugin-autocomplete":"^3.2.6","@oclif/plugin-help":"^6.2.15","@oclif/plugin-not-found":"^3.2.28","@oclif/plugin-warn-if-update-available":"^3.1.19",chalk:"^5.3.0","ci-info":"^4.0.0",configstore:"^7.0.0",debug:"^4.3.3","gray-matter":"^4.0.1",ignore:"^6.0.2","mime-types":"^2.1.35",oas:"^25.0.0","oas-normalize":"^11.1.2",open:"^10.0.2",ora:"^8.1.1","parse-link-header":"^2.0.0",pluralize:"^8.0.0",prompts:"^2.4.2",semver:"^7.5.3","simple-git":"^3.19.1","string-argv":"^0.3.2",table:"^6.8.1","tmp-promise":"^3.0.2",toposort:"^2.0.2",undici:"^5.28.4",validator:"^13.7.0"},devDependencies={"@commitlint/cli":"^19.0.3","@commitlint/config-conventional":"^19.0.3","@oclif/test":"^4.1.0","@readme/better-ajv-errors":"^1.5.0","@readme/eslint-config":"^14.0.0","@readme/oas-examples":"^5.10.0","@rollup/plugin-commonjs":"^28.0.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.2.1","@rollup/plugin-replace":"^6.0.1","@rollup/plugin-terser":"^0.4.4","@types/configstore":"^6.0.0","@types/debug":"^4.1.7","@types/js-yaml":"^4.0.5","@types/mime-types":"^2.1.1","@types/parse-link-header":"^2.0.0","@types/pluralize":"^0.0.33","@types/prompts":"^2.4.2","@types/semver":"^7.3.12","@types/toposort":"^2.0.7","@types/validator":"^13.7.6","@vitest/coverage-v8":"^2.0.5","@vitest/expect":"^2.0.5",ajv:"^8.11.0",alex:"^11.0.0",eslint:"^8.47.0",husky:"^9.0.10","js-yaml":"^4.1.0",knip:"^5.0.2",nock:"^14.0.0-beta.7",oclif:"^4.15.12","openapi-types":"^12.1.3",prettier:"^3.0.2",rollup:"^4.3.0",tsx:"^4.19.2","type-fest":"^4.3.1",typescript:"^5.1.6",vitest:"^2.0.5"},scripts$1={build:"tsc","build:docs":"oclif readme --multi --output-dir documentation/commands --no-aliases","build:gha":"npm run build && rollup --config","build:gha:prod":"npm run build:gha -- --environment PRODUCTION_BUILD",lint:"alex . && knip && npm run lint:ts && npm run prettier && npm run schemas:check","lint:ts":"eslint . --ext .js,.ts",prebuild:"rm -rf dist/ && rm -f src/package.json && ln package.json src/package.json",prepack:"npm run build",prepare:"husky",pretest:"npm run build",prettier:"prettier --check .","schemas:check":"./bin/json-schema-store.js","schemas:write":"./bin/json-schema-store.js --update",test:"vitest run --coverage",version:"npm run build:gha:prod && oclif manifest && npm run build:docs"},commitlint={extends:["@commitlint/config-conventional"],rules:{"body-max-line-length":[0,"always","Infinity"],"footer-max-line-length":[0,"always","Infinity"],"scope-case":[2,"never","upper-case"]}},oclif={bin:"rdme",dirname:"rdme",commands:{strategy:"explicit",target:"./dist/index.js",identifier:"COMMANDS"},topicSeparator:" ",helpClass:"./dist/lib/help",hooks:{prerun:{target:"./dist/index.js",identifier:"prerun"},createGHA:{target:"./dist/index.js",identifier:"createGHA"}},plugins:["@oclif/plugin-autocomplete","@oclif/plugin-help","@oclif/plugin-not-found","@oclif/plugin-warn-if-update-available"],topics:{categories:{description:"List or create categories in your ReadMe developer hub."},docs:{description:"Sync or prune Guides pages in your ReadMe developer hub."},openapi:{description:"Manage your API definition (e.g., syncing, validation, analysis, conversion, etc.). Supports OpenAPI, Swagger, and Postman collections, in either JSON or YAML formats."},versions:{description:"Manage your documentation versions."}}},prettier="@readme/eslint-config/prettier",pkg={name:name$1,version:version$1,description:description$3,license:license$1,author:author$1,engines:engines$1,bin:bin$1,files:files,keywords:keywords$1,repository:repository$1,bugs:bugs$1,type:type$d,dependencies:dependencies$3,devDependencies:devDependencies,scripts:scripts$1,commitlint:commitlint,oclif:oclif,prettier:prettier};class APIv1Error extends Error{code;constructor(e){let t;t="object"==typeof e&&"object"==typeof e?.error?e.error:e,super(t),this.name="APIv1Error","object"==typeof t?(this.code=t.error,this.message=t?.help?[t.message,"",t.help].join("\n"):t.message,this.name="APIv1Error"):(this.code=t,this.message=t)}}const config={host:"https://dash.readme.com",hub:"https://{project}.readme.io"};var prompts$3={},kleur,hasRequiredKleur,action$1,hasRequiredAction$1,strip$1,hasRequiredStrip$1,src$6,hasRequiredSrc$6,clear$1,hasRequiredClear$1,figures_1$1,hasRequiredFigures$1,style$1,hasRequiredStyle$1,lines$1,hasRequiredLines$1,wrap$1,hasRequiredWrap$1,entriesToDisplay$1,hasRequiredEntriesToDisplay$1,util$4,hasRequiredUtil$4,prompt$1,hasRequiredPrompt$1,text$2,hasRequiredText$2,select$1,hasRequiredSelect$1,toggle$1,hasRequiredToggle$1,datepart$1,hasRequiredDatepart$1,meridiem$1,hasRequiredMeridiem$1,day$1,hasRequiredDay$1,hours$1,hasRequiredHours$1,milliseconds$1,hasRequiredMilliseconds$1,minutes$1,hasRequiredMinutes$1,month$1,hasRequiredMonth$1,seconds$1,hasRequiredSeconds$1,year$1,hasRequiredYear$1,dateparts$1,hasRequiredDateparts$1,date$1,hasRequiredDate$1,number$1,hasRequiredNumber$1,multiselect$1,hasRequiredMultiselect$1,autocomplete$1,hasRequiredAutocomplete$1,autocompleteMultiselect$1,hasRequiredAutocompleteMultiselect$1,confirm$1,hasRequiredConfirm$1,elements$1,hasRequiredElements$1,hasRequiredPrompts$2,dist$6,hasRequiredDist$6;function requireKleur(){if(hasRequiredKleur)return kleur;hasRequiredKleur=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,TERM:n}=process.env,r={enabled:!t&&"dumb"!==n&&"0"!==e,reset:o(0,0),bold:o(1,22),dim:o(2,22),italic:o(3,23),underline:o(4,24),inverse:o(7,27),hidden:o(8,28),strikethrough:o(9,29),black:o(30,39),red:o(31,39),green:o(32,39),yellow:o(33,39),blue:o(34,39),magenta:o(35,39),cyan:o(36,39),white:o(37,39),gray:o(90,39),grey:o(90,39),bgBlack:o(40,49),bgRed:o(41,49),bgGreen:o(42,49),bgYellow:o(43,49),bgBlue:o(44,49),bgMagenta:o(45,49),bgCyan:o(46,49),bgWhite:o(47,49)};function i(e,t){let n,r=0,i="",o="";for(;r{if(!e.meta||"escape"===e.name){if(e.ctrl){if("a"===e.name)return"first";if("c"===e.name)return"abort";if("d"===e.name)return"abort";if("e"===e.name)return"last";if("g"===e.name)return"reset"}if(t){if("j"===e.name)return"down";if("k"===e.name)return"up"}return"return"===e.name||"enter"===e.name?"submit":"backspace"===e.name?"delete":"delete"===e.name?"deleteForward":"abort"===e.name?"abort":"escape"===e.name?"exit":"tab"===e.name?"next":"pagedown"===e.name?"nextPage":"pageup"===e.name?"prevPage":"home"===e.name?"home":"end"===e.name?"end":"up"===e.name?"up":"down"===e.name?"down":"right"===e.name?"right":"left"===e.name&&"left"}})}function requireStrip$1(){return hasRequiredStrip$1||(hasRequiredStrip$1=1,strip$1=e=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),n=new RegExp(t,"g");return"string"==typeof e?e.replace(n,""):e}),strip$1}function requireSrc$6(){if(hasRequiredSrc$6)return src$6;hasRequiredSrc$6=1;const e="[",t={to:(t,n)=>n?`${e}${n+1};${t+1}H`:`${e}${t+1}G`,move(t,n){let r="";return t<0?r+=`${e}${-t}D`:t>0&&(r+=`${e}${t}C`),n<0?r+=`${e}${-n}A`:n>0&&(r+=`${e}${n}B`),r},up:(t=1)=>`${e}${t}A`,down:(t=1)=>`${e}${t}B`,forward:(t=1)=>`${e}${t}C`,backward:(t=1)=>`${e}${t}D`,nextLine:(t=1)=>`${e}E`.repeat(t),prevLine:(t=1)=>`${e}F`.repeat(t),left:`${e}G`,hide:`${e}?25l`,show:`${e}?25h`,save:"7",restore:"8"},n={up:(t=1)=>`${e}S`.repeat(t),down:(t=1)=>`${e}T`.repeat(t)},r={screen:`${e}2J`,up:(t=1)=>`${e}1J`.repeat(t),down:(t=1)=>`${e}J`.repeat(t),line:`${e}2K`,lineEnd:`${e}K`,lineStart:`${e}1K`,lines(e){let n="";for(let r=0;r=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n[...n(e)].length;return clear$1=function(t,n){if(!n)return i.line+o.to(0);let r=0;var a,c=e(t.split(/\r?\n/));try{for(c.s();!(a=c.n()).done;){let e=a.value;r+=1+Math.floor(Math.max(s(e)-1,0)/n)}}catch(e){c.e(e)}finally{c.f()}return i.lines(r)},clear$1}function requireFigures$1(){if(hasRequiredFigures$1)return figures_1$1;hasRequiredFigures$1=1;const e={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},t={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},n="win32"===process.platform?t:e;return figures_1$1=n}function requireStyle$1(){if(hasRequiredStyle$1)return style$1;hasRequiredStyle$1=1;const e=requireKleur(),t=requireFigures$1(),n=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"😃".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}}),r=Object.freeze({aborted:e.red(t.cross),done:e.green(t.tick),exited:e.yellow(t.cross),default:e.cyan("?")});return style$1={styles:n,render:e=>n[e]||n.default,symbols:r,symbol:(e,t,n)=>t?r.aborted:n?r.exited:e?r.done:r.default,delimiter:n=>e.gray(n?t.ellipsis:t.pointerSmall),item:(n,r)=>e.gray(n?r?t.pointerSmall:"+":t.line)},style$1}function requireLines$1(){if(hasRequiredLines$1)return lines$1;hasRequiredLines$1=1;const e=requireStrip$1();return lines$1=function(t,n){let r=String(e(t)||"").split(/\r?\n/);return n?r.map((e=>Math.ceil(e.length/n))).reduce(((e,t)=>e+t)):r.length},lines$1}function requireWrap$1(){return hasRequiredWrap$1||(hasRequiredWrap$1=1,wrap$1=(e,t={})=>{const n=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",r=t.width;return(e||"").split(/\r?\n/g).map((e=>e.split(/\s+/g).reduce(((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1{n=n||t;let r=Math.min(t-n,e-Math.floor(n/2));return r<0&&(r=0),{startIndex:r,endIndex:Math.min(r+n,t)}})}function requireUtil$4(){return hasRequiredUtil$4?util$4:(hasRequiredUtil$4=1,util$4={action:requireAction$1(),clear:requireClear$1(),style:requireStyle$1(),strip:requireStrip$1(),figures:requireFigures$1(),lines:requireLines$1(),wrap:requireWrap$1(),entriesToDisplay:requireEntriesToDisplay$1()})}function requirePrompt$1(){if(hasRequiredPrompt$1)return prompt$1;hasRequiredPrompt$1=1;const e=require$$0$m,t=requireUtil$4().action,n=require$$0$c,r=requireSrc$6(),i=r.beep,o=r.cursor,s=requireKleur();return prompt$1=class extends n{constructor(n={}){super(),this.firstRender=!0,this.in=n.stdin||process.stdin,this.out=n.stdout||process.stdout,this.onRender=(n.onRender||(()=>{})).bind(this);const r=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(e,n)=>{let r=t(n,i);!1===r?this._&&this._(e,n):"function"==typeof this[r]?this[r](n):this.bell()};this.close=()=>{this.out.write(o.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(i)}render(){this.onRender(s),this.firstRender&&(this.firstRender=!1)}},prompt$1}function requireText$2(){if(hasRequiredText$2)return text$2;function e(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var s=t.apply(n,r);function a(t){e(s,i,o,a,c,"next",t)}function c(t){e(s,i,o,a,c,"throw",t)}a(void 0)}))}}hasRequiredText$2=1;const n=requireKleur(),r=requirePrompt$1(),i=requireSrc$6(),o=i.erase,s=i.cursor,a=requireUtil$4(),c=a.style,l=a.clear,u=a.lines,d=a.figures;return text$2=class extends r{constructor(e={}){super(e),this.transform=c.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=l("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var e=this;return t((function*(){let t=yield e.validator(e.value);"string"==typeof t&&(e.errorMsg=t,t=!1),e.error=!t}))()}submit(){var e=this;return t((function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error)return e.red=!0,e.fire(),void e.render();e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write("\n"),e.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${n}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return 0===this.cursor||this.placeholder&&1===this.cursor}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(s.down(u(this.outputError,this.out.columns)-1)+l(this.outputError,this.out.columns)),this.out.write(l(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[c.symbol(this.done,this.aborted),n.bold(this.msg),c.delimiter(this.done),this.red?n.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split("\n").reduce(((e,t,r)=>e+`\n${r?" ":d.pointerSmall} ${n.red().italic(t)}`),"")),this.out.write(o.line+s.to(0)+this.outputText+s.save+this.outputError+s.restore+s.move(this.cursorOffset,0)))}},text$2}function requireSelect$1(){if(hasRequiredSelect$1)return select$1;hasRequiredSelect$1=1;const e=requireKleur(),t=requirePrompt$1(),n=requireUtil$4(),r=n.style,i=n.clear,o=n.figures,s=n.wrap,a=n.entriesToDisplay,c=requireSrc$6().cursor;return select$1=class extends t{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map(((e,t)=>("string"==typeof e&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(void 0===e.value?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled}))),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=i("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){0===this.cursor?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(" "===e)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(c.hide):this.out.write(i(this.outputText,this.out.columns)),super.render();let t=a(this.cursor,this.choices.length,this.optionsPerPage),n=t.startIndex,l=t.endIndex;if(this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let t=n;t0?o.arrowUp:t===l-1&&l=this.out.columns||c.description.split(/\r?\n/).length>1)&&(a="\n"+s(c.description,{margin:3,width:this.out.columns})))),this.outputText+=`${i} ${r}${e.gray(a)}\n`}}this.out.write(this.outputText)}},select$1}function requireToggle$1(){if(hasRequiredToggle$1)return toggle$1;hasRequiredToggle$1=1;const e=requireKleur(),t=requirePrompt$1(),n=requireUtil$4(),r=n.style,i=n.clear,o=requireSrc$6(),s=o.cursor,a=o.erase;return toggle$1=class extends t{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}deactivate(){if(!1===this.value)return this.bell();this.value=!1,this.render()}activate(){if(!0===this.value)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(" "===e)this.value=!this.value;else if("1"===e)this.value=!0;else{if("0"!==e)return this.bell();this.value=!1}this.render()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(a.line+s.to(0)+this.outputText))}}}function requireDatepart$1(){if(hasRequiredDatepart$1)return datepart$1;hasRequiredDatepart$1=1;class e{constructor({token:e,date:t,parts:n,locales:r}){this.token=e,this.date=t||new Date,this.parts=n||[this],this.locales=r||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((n,r)=>r>t&&n instanceof e))}setTo(e){}prev(){let t=[].concat(this.parts).reverse();const n=t.indexOf(this);return t.find(((t,r)=>r>n&&t instanceof e))}toString(){return String(this.date)}}return datepart$1=e}function requireMeridiem$1(){if(hasRequiredMeridiem$1)return meridiem$1;hasRequiredMeridiem$1=1;const e=requireDatepart$1();return meridiem$1=class extends e{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}},meridiem$1}function requireDay$1(){if(hasRequiredDay$1)return day$1;hasRequiredDay$1=1;const e=requireDatepart$1();return day$1=class extends e{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return"DD"===this.token?String(e).padStart(2,"0"):"Do"===this.token?e+(n=e,1==(n%=10)?"st":2===n?"nd":3===n?"rd":"th"):"d"===this.token?t+1:"ddd"===this.token?this.locales.weekdaysShort[t]:"dddd"===this.token?this.locales.weekdays[t]:e;var n}},day$1}function requireHours$1(){if(hasRequiredHours$1)return hours$1;hasRequiredHours$1=1;const e=requireDatepart$1();return hours$1=class extends e{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}},hours$1}function requireMilliseconds$1(){if(hasRequiredMilliseconds$1)return milliseconds$1;hasRequiredMilliseconds$1=1;const e=requireDatepart$1();return milliseconds$1=class extends e{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}}function requireMinutes$1(){if(hasRequiredMinutes$1)return minutes$1;hasRequiredMinutes$1=1;const e=requireDatepart$1();return minutes$1=class extends e{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}}}function requireMonth$1(){if(hasRequiredMonth$1)return month$1;hasRequiredMonth$1=1;const e=requireDatepart$1();return month$1=class extends e{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return 2===t?String(e+1).padStart(2,"0"):3===t?this.locales.monthsShort[e]:4===t?this.locales.months[e]:String(e+1)}},month$1}function requireSeconds$1(){if(hasRequiredSeconds$1)return seconds$1;hasRequiredSeconds$1=1;const e=requireDatepart$1();return seconds$1=class extends e{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}}}function requireYear$1(){if(hasRequiredYear$1)return year$1;hasRequiredYear$1=1;const e=requireDatepart$1();return year$1=class extends e{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return 2===this.token.length?e.substr(-2):e}},year$1}function requireDateparts$1(){return hasRequiredDateparts$1?dateparts$1:(hasRequiredDateparts$1=1,dateparts$1={DatePart:requireDatepart$1(),Meridiem:requireMeridiem$1(),Day:requireDay$1(),Hours:requireHours$1(),Milliseconds:requireMilliseconds$1(),Minutes:requireMinutes$1(),Month:requireMonth$1(),Seconds:requireSeconds$1(),Year:requireYear$1()})}function requireDate$1(){if(hasRequiredDate$1)return date$1;function e(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var s=t.apply(n,r);function a(t){e(s,i,o,a,c,"next",t)}function c(t){e(s,i,o,a,c,"throw",t)}a(void 0)}))}}hasRequiredDate$1=1;const n=requireKleur(),r=requirePrompt$1(),i=requireUtil$4(),o=i.style,s=i.clear,a=i.figures,c=requireSrc$6(),l=c.erase,u=c.cursor,d=requireDateparts$1(),p=d.DatePart,f=d.Meridiem,_=d.Day,m=d.Hours,h=d.Milliseconds,g=d.Minutes,A=d.Month,y=d.Seconds,v=d.Year,b=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,C={1:({token:e})=>e.replace(/\\(.)/g,"$1"),2:e=>new _(e),3:e=>new A(e),4:e=>new v(e),5:e=>new f(e),6:e=>new m(e),7:e=>new g(e),8:e=>new y(e),9:e=>new h(e)},E={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};return date$1=class extends r{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(E,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=s("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=b.exec(e);){let e=t.shift(),n=t.findIndex((e=>null!=e));this.parts.push(n in C?C[n]({token:t[n]||e,date:this.date,parts:this.parts,locales:this.locales}):t[n]||e)}let n=this.parts.reduce(((e,t)=>("string"==typeof t&&"string"==typeof e[e.length-1]?e[e.length-1]+=t:e.push(t),e)),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex((e=>e instanceof p))),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var e=this;return t((function*(){let t=yield e.validator(e.value);"string"==typeof t&&(e.errorMsg=t,t=!1),e.error=!t}))()}submit(){var e=this;return t((function*(){if(yield e.validate(),e.error)return e.color="red",e.fire(),void e.render();e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write("\n"),e.close()}))()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(null==e)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(null==e)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex((e=>e instanceof p))),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(u.hide):this.out.write(s(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(!1),this.parts.reduce(((e,t,r)=>e.concat(r!==this.cursor||this.done?t:n.cyan().underline(t.toString()))),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split("\n").reduce(((e,t,r)=>e+`\n${r?" ":a.pointerSmall} ${n.red().italic(t)}`),"")),this.out.write(l.line+u.to(0)+this.outputText))}},date$1}function requireNumber$1(){if(hasRequiredNumber$1)return number$1;function e(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var s=t.apply(n,r);function a(t){e(s,i,o,a,c,"next",t)}function c(t){e(s,i,o,a,c,"throw",t)}a(void 0)}))}}hasRequiredNumber$1=1;const n=requireKleur(),r=requirePrompt$1(),i=requireSrc$6(),o=i.cursor,s=i.erase,a=requireUtil$4(),c=a.style,l=a.figures,u=a.clear,d=a.lines,p=/[0-9]/,f=e=>void 0!==e,_=(e,t)=>{let n=Math.pow(10,t);return Math.round(e*n)/n};return number$1=class extends r{constructor(e={}){super(e),this.transform=c.render(e.style),this.msg=e.message,this.initial=f(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=f(e.min)?e.min:-1/0,this.max=f(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){e||0===e?(this.placeholder=!1,this.rendered=this.transform.render(`${_(e,this.round)}`),this._value=_(e,this.round)):(this.placeholder=!0,this.rendered=n.gray(this.transform.render(`${this.initial}`)),this._value=""),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return"-"===e||"."===e&&this.float||p.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=""!==e?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var e=this;return t((function*(){let t=yield e.validator(e.value);"string"==typeof t&&(e.errorMsg=t,t=!1),e.error=!t}))()}submit(){var e=this;return t((function*(){if(yield e.validate(),e.error)return e.color="red",e.fire(),void e.render();let t=e.value;e.value=""!==t?t:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write("\n"),e.close()}))()}up(){if(this.typed="",""===this.value&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",""===this.value&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(0===e.length)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",""!==this.value&&this.value1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan","."===e)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.valuee+`\n${r?" ":l.pointerSmall} ${n.red().italic(t)}`),"")),this.out.write(s.line+o.to(0)+this.outputText+o.save+this.outputError+o.restore))}},number$1}function requireMultiselect$1(){if(hasRequiredMultiselect$1)return multiselect$1;hasRequiredMultiselect$1=1;const e=requireKleur(),t=requireSrc$6().cursor,n=requirePrompt$1(),r=requireUtil$4(),i=r.clear,o=r.figures,s=r.style,a=r.wrap,c=r.entriesToDisplay;return multiselect$1=class extends n{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map(((e,t)=>("string"==typeof e&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(void 0===e.value?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled}))),this.clear=i("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map((e=>!e.selected)),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((e=>e.selected))}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){const e=this.value.filter((e=>e.selected));this.minSelected&&e.lengthe.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(void 0!==this.maxChoices||this.value[this.cursor].disabled)return this.bell();const e=!this.value[this.cursor].selected;this.value.filter((e=>!e.disabled)).forEach((t=>t.selected=e)),this.render()}_(e,t){if(" "===e)this.handleSpaceToggle();else{if("a"!==e)return this.bell();this.toggleAll()}}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${o.arrowUp}/${o.arrowDown}: Highlight option\n ${o.arrowLeft}/${o.arrowRight}/[space]: Toggle selection\n`+(void 0===this.maxChoices?" a: Toggle all\n":"")+" enter/return: Complete answer":""}renderOption(t,n,r,i){const s=(n.selected?e.green(o.radioOn):o.radioOff)+" "+i+" ";let c,l;return n.disabled?c=t===r?e.gray().underline(n.title):e.strikethrough().gray(n.title):(c=t===r?e.cyan().underline(n.title):n.title,t===r&&n.description&&(l=` - ${n.description}`,(s.length+c.length+l.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(l="\n"+a(n.description,{margin:s.length,width:this.out.columns})))),s+c+e.gray(l||"")}paginateOptions(t){if(0===t.length)return e.red("No matches for this query.");let n,r=c(this.cursor,t.length,this.optionsPerPage),i=r.startIndex,s=r.endIndex,a=[];for(let e=i;e0?o.arrowUp:e===s-1&&se.selected)).map((e=>e.title)).join(", ");const t=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(e.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let n=[s.symbol(this.done,this.aborted),e.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.value),this.out.write(this.clear+n),this.clear=i(n,this.out.columns)}},multiselect$1}function requireAutocomplete$1(){if(hasRequiredAutocomplete$1)return autocomplete$1;function e(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}hasRequiredAutocomplete$1=1;const t=requireKleur(),n=requirePrompt$1(),r=requireSrc$6(),i=r.erase,o=r.cursor,s=requireUtil$4(),a=s.style,c=s.clear,l=s.figures,u=s.wrap,d=s.entriesToDisplay,p=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),f=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]);return autocomplete$1=class extends n{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial="number"==typeof e.initial?e.initial:((e,t)=>{const n=e.findIndex((e=>e.value===t||e.title===t));return n>-1?n:void 0})(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=a.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=c("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return"number"==typeof this._fb?e=this.choices[this._fb]:"string"==typeof this._fb&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=p(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(t){var n,r=this;return(n=function*(){const e=r.completing=r.suggest(r.input,r.choices),n=yield e;if(r.completing!==e)return;r.suggestions=n.map(((e,t,n)=>({title:f(n,t),value:p(n,t),description:e.description}))),r.completing=!1;const i=Math.max(n.length-1,0);r.moveSelect(Math.min(i,r.select)),t&&t()},function(){var t=this,r=arguments;return new Promise((function(i,o){var s=n.apply(t,r);function a(t){e(s,i,o,a,c,"next",t)}function c(t){e(s,i,o,a,c,"throw",t)}a(void 0)}))})()}reset(){this.input="",this.complete((()=>{this.moveSelect(void 0!==this.initial?this.initial:0),this.render()})),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(e,t){let n=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${n}${e}${r}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(0===this.cursor)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){0===this.select?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,n,r,i){let o,s=r?l.arrowUp:i?l.arrowDown:" ",a=n?t.cyan().underline(e.title):e.title;return s=(n?t.cyan(l.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o="\n"+u(e.description,{margin:3,width:this.out.columns}))),s+" "+a+t.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(o.hide):this.out.write(c(this.outputText,this.out.columns)),super.render();let e=d(this.select,this.choices.length,this.limit),n=e.startIndex,r=e.endIndex;if(this.outputText=[a.symbol(this.done,this.aborted,this.exited),t.bold(this.msg),a.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const e=this.suggestions.slice(n,r).map(((e,t)=>this.renderOption(e,this.select===t+n,0===t&&n>0,t+n===r-1&&re.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((e=>!this.inputValue||(!("string"!=typeof e.title||!e.title.toLowerCase().includes(this.inputValue.toLowerCase()))||!("string"!=typeof e.value||!e.value.toLowerCase().includes(this.inputValue.toLowerCase())))));const t=this.filteredOptions.findIndex((t=>t===e));this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){const e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){" "===e?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${s.arrowUp}/${s.arrowDown}: Highlight option\n ${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`:""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}\n`}renderOption(t,n,r){let i;return i=n.disabled?t===r?e.gray().underline(n.title):e.strikethrough().gray(n.title):t===r?e.cyan().underline(n.title):n.title,(n.selected?e.green(s.radioOn):s.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter((e=>e.selected)).map((e=>e.title)).join(", ");const t=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(e.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let n=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+n),this.clear=i(n,this.out.columns)}},autocompleteMultiselect$1}function requireConfirm$1(){if(hasRequiredConfirm$1)return confirm$1;hasRequiredConfirm$1=1;const e=requireKleur(),t=requirePrompt$1(),n=requireUtil$4(),r=n.style,i=n.clear,o=requireSrc$6(),s=o.erase,a=o.cursor;return confirm$1=class extends t{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(e,t){return"y"===e.toLowerCase()?(this.value=!0,this.submit()):"n"===e.toLowerCase()?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(a.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(s.line+a.to(0)+this.outputText))}}}function requireElements$1(){return hasRequiredElements$1?elements$1:(hasRequiredElements$1=1,elements$1={TextPrompt:requireText$2(),SelectPrompt:requireSelect$1(),TogglePrompt:requireToggle$1(),DatePrompt:requireDate$1(),NumberPrompt:requireNumber$1(),MultiselectPrompt:requireMultiselect$1(),AutocompletePrompt:requireAutocomplete$1(),AutocompleteMultiselectPrompt:requireAutocompleteMultiselect$1(),ConfirmPrompt:requireConfirm$1()})}function requirePrompts$2(){return hasRequiredPrompts$2||(hasRequiredPrompts$2=1,function(){const e=prompts$3,t=requireElements$1(),n=e=>e;function r(e,r,i={}){return new Promise(((o,s)=>{const a=new t[e](r),c=i.onAbort||n,l=i.onSubmit||n,u=i.onExit||n;a.on("state",r.onState||n),a.on("submit",(e=>o(l(e)))),a.on("exit",(e=>o(u(e)))),a.on("abort",(e=>s(c(e))))}))}e.text=e=>r("TextPrompt",e),e.password=t=>(t.style="password",e.text(t)),e.invisible=t=>(t.style="invisible",e.text(t)),e.number=e=>r("NumberPrompt",e),e.date=e=>r("DatePrompt",e),e.confirm=e=>r("ConfirmPrompt",e),e.list=e=>{const t=e.separator||",";return r("TextPrompt",e,{onSubmit:e=>e.split(t).map((e=>e.trim()))})},e.toggle=e=>r("TogglePrompt",e),e.select=e=>r("SelectPrompt",e),e.multiselect=e=>{e.choices=[].concat(e.choices||[]);const t=e=>e.filter((e=>e.selected)).map((e=>e.value));return r("MultiselectPrompt",e,{onAbort:t,onSubmit:t})},e.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);const t=e=>e.filter((e=>e.selected)).map((e=>e.value));return r("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};const i=(e,t)=>Promise.resolve(t.filter((t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase())));e.autocomplete=e=>(e.suggest=e.suggest||i,e.choices=[].concat(e.choices||[]),r("AutocompletePrompt",e))}()),prompts$3}function requireDist$6(){if(hasRequiredDist$6)return dist$6;function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var r=1;r=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw s}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{};function u(){return d.apply(this,arguments)}function d(){return d=s((function*(e=[],{onSubmit:n=l,onCancel:i=l}={}){const o={},d=u._override||{};let f,_,m,h,g,A;e=[].concat(e);const y=function(){var e=s((function*(e,t,n=!1){if(n||!e.validate||!0===e.validate(t))return e.format?yield e.format(t,o):t}));return function(t,n){return e.apply(this,arguments)}}();var v,b=r(e);try{for(b.s();!(v=b.n()).done;){_=v.value;var C=_;if(h=C.name,g=C.type,"function"==typeof g&&(g=yield g(f,t({},o),_),_.type=g),g){for(let e in _){if(c.includes(e))continue;let n=_[e];_[e]="function"==typeof n?yield n(f,t({},o),A):n}if(A=_,"string"!=typeof _.message)throw new Error("prompt message is required");var E=_;if(h=E.name,g=E.type,void 0===a[g])throw new Error(`prompt type (${g}) is not defined`);if(void 0===d[_.name]||(f=yield y(_,d[_.name]),void 0===f)){try{f=u._injected?p(u._injected,_.initial):yield a[g](_),o[h]=f=yield y(_,f,!0),m=yield n(_,f,o)}catch(e){m=!(yield i(_,o))}if(m)return o}else o[h]=f}}}catch(e){b.e(e)}finally{b.f()}return o})),d.apply(this,arguments)}function p(e,t){const n=e.shift();if(n instanceof Error)throw n;return void 0===n?t:n}return dist$6=Object.assign(u,{prompt:u,prompts:a,inject:function(e){u._injected=(u._injected||[]).concat(e)},override:function(e){u._override=Object.assign({},e)}})}var prompts$2={},action,hasRequiredAction,strip,hasRequiredStrip,clear,hasRequiredClear,figures_1,hasRequiredFigures,style,hasRequiredStyle,lines,hasRequiredLines,wrap,hasRequiredWrap,entriesToDisplay,hasRequiredEntriesToDisplay,util$3,hasRequiredUtil$3,prompt,hasRequiredPrompt,text$1,hasRequiredText$1,select,hasRequiredSelect,toggle,hasRequiredToggle,datepart,hasRequiredDatepart,meridiem,hasRequiredMeridiem,day,hasRequiredDay,hours,hasRequiredHours,milliseconds,hasRequiredMilliseconds,minutes,hasRequiredMinutes,month,hasRequiredMonth,seconds,hasRequiredSeconds,year,hasRequiredYear,dateparts,hasRequiredDateparts,date,hasRequiredDate,number,hasRequiredNumber,multiselect,hasRequiredMultiselect,autocomplete,hasRequiredAutocomplete,autocompleteMultiselect,hasRequiredAutocompleteMultiselect,confirm,hasRequiredConfirm,elements,hasRequiredElements,hasRequiredPrompts$1,lib$f,hasRequiredLib$e,prompts$1,hasRequiredPrompts;function requireAction(){return hasRequiredAction?action:(hasRequiredAction=1,action=(e,t)=>{if(!e.meta||"escape"===e.name){if(e.ctrl){if("a"===e.name)return"first";if("c"===e.name)return"abort";if("d"===e.name)return"abort";if("e"===e.name)return"last";if("g"===e.name)return"reset"}if(t){if("j"===e.name)return"down";if("k"===e.name)return"up"}return"return"===e.name||"enter"===e.name?"submit":"backspace"===e.name?"delete":"delete"===e.name?"deleteForward":"abort"===e.name?"abort":"escape"===e.name?"exit":"tab"===e.name?"next":"pagedown"===e.name?"nextPage":"pageup"===e.name?"prevPage":"home"===e.name?"home":"end"===e.name?"end":"up"===e.name?"up":"down"===e.name?"down":"right"===e.name?"right":"left"===e.name&&"left"}})}function requireStrip(){return hasRequiredStrip||(hasRequiredStrip=1,strip=e=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),n=new RegExp(t,"g");return"string"==typeof e?e.replace(n,""):e}),strip}function requireClear(){if(hasRequiredClear)return clear;hasRequiredClear=1;const e=requireStrip(),{erase:t,cursor:n}=requireSrc$6(),r=t=>[...e(t)].length;return clear=function(e,i){if(!i)return t.line+n.to(0);let o=0;const s=e.split(/\r?\n/);for(let e of s)o+=1+Math.floor(Math.max(r(e)-1,0)/i);return t.lines(o)},clear}function requireFigures(){if(hasRequiredFigures)return figures_1;hasRequiredFigures=1;const e={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},t={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},n="win32"===process.platform?t:e;return figures_1=n}function requireStyle(){if(hasRequiredStyle)return style;hasRequiredStyle=1;const e=requireKleur(),t=requireFigures(),n=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"😃".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}}),r=Object.freeze({aborted:e.red(t.cross),done:e.green(t.tick),exited:e.yellow(t.cross),default:e.cyan("?")});return style={styles:n,render:e=>n[e]||n.default,symbols:r,symbol:(e,t,n)=>t?r.aborted:n?r.exited:e?r.done:r.default,delimiter:n=>e.gray(n?t.ellipsis:t.pointerSmall),item:(n,r)=>e.gray(n?r?t.pointerSmall:"+":t.line)},style}function requireLines(){if(hasRequiredLines)return lines;hasRequiredLines=1;const e=requireStrip();return lines=function(t,n){let r=String(e(t)||"").split(/\r?\n/);return n?r.map((e=>Math.ceil(e.length/n))).reduce(((e,t)=>e+t)):r.length}}function requireWrap(){return hasRequiredWrap||(hasRequiredWrap=1,wrap=(e,t={})=>{const n=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",r=t.width;return(e||"").split(/\r?\n/g).map((e=>e.split(/\s+/g).reduce(((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1{n=n||t;let r=Math.min(t-n,e-Math.floor(n/2));return r<0&&(r=0),{startIndex:r,endIndex:Math.min(r+n,t)}})}function requireUtil$3(){return hasRequiredUtil$3?util$3:(hasRequiredUtil$3=1,util$3={action:requireAction(),clear:requireClear(),style:requireStyle(),strip:requireStrip(),figures:requireFigures(),lines:requireLines(),wrap:requireWrap(),entriesToDisplay:requireEntriesToDisplay()})}function requirePrompt(){if(hasRequiredPrompt)return prompt;hasRequiredPrompt=1;const e=require$$0$m,{action:t}=requireUtil$3(),n=require$$0$c,{beep:r,cursor:i}=requireSrc$6(),o=requireKleur();return prompt=class extends n{constructor(n={}){super(),this.firstRender=!0,this.in=n.stdin||process.stdin,this.out=n.stdout||process.stdout,this.onRender=(n.onRender||(()=>{})).bind(this);const r=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);const o=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(e,n)=>{let r=t(n,o);!1===r?this._&&this._(e,n):"function"==typeof this[r]?this[r](n):this.bell()};this.close=()=>{this.out.write(i.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(r)}render(){this.onRender(o),this.firstRender&&(this.firstRender=!1)}},prompt}function requireText$1(){if(hasRequiredText$1)return text$1;hasRequiredText$1=1;const e=requireKleur(),t=requirePrompt(),{erase:n,cursor:r}=requireSrc$6(),{style:i,clear:o,lines:s,figures:a}=requireUtil$3();return text$1=class extends t{constructor(e={}){super(e),this.transform=i.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=o("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let e=await this.validator(this.value);"string"==typeof e&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error)return this.red=!0,this.fire(),void this.render();this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${n}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return 0===this.cursor||this.placeholder&&1===this.cursor}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(r.down(s(this.outputError,this.out.columns)-1)+o(this.outputError,this.out.columns)),this.out.write(o(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(this.done),this.red?e.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split("\n").reduce(((t,n,r)=>t+`\n${r?" ":a.pointerSmall} ${e.red().italic(n)}`),"")),this.out.write(n.line+r.to(0)+this.outputText+r.save+this.outputError+r.restore+r.move(this.cursorOffset,0)))}},text$1}function requireSelect(){if(hasRequiredSelect)return select;hasRequiredSelect=1;const e=requireKleur(),t=requirePrompt(),{style:n,clear:r,figures:i,wrap:o,entriesToDisplay:s}=requireUtil$3(),{cursor:a}=requireSrc$6();return select=class extends t{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map(((e,t)=>("string"==typeof e&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(void 0===e.value?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled}))),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=r("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){0===this.cursor?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(" "===e)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(a.hide):this.out.write(r(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:c}=s(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let n=t;n0?i.arrowUp:n===c-1&&c=this.out.columns||l.description.split(/\r?\n/).length>1)&&(a="\n"+o(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${r}${e.gray(a)}\n`}}this.out.write(this.outputText)}},select}function requireToggle(){if(hasRequiredToggle)return toggle;hasRequiredToggle=1;const e=requireKleur(),t=requirePrompt(),{style:n,clear:r}=requireUtil$3(),{cursor:i,erase:o}=requireSrc$6();return toggle=class extends t{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}deactivate(){if(!1===this.value)return this.bell();this.value=!1,this.render()}activate(){if(!0===this.value)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(" "===e)this.value=!this.value;else if("1"===e)this.value=!0;else{if("0"!==e)return this.bell();this.value=!1}this.render()}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(o.line+i.to(0)+this.outputText))}}}function requireDatepart(){if(hasRequiredDatepart)return datepart;hasRequiredDatepart=1;class e{constructor({token:e,date:t,parts:n,locales:r}){this.token=e,this.date=t||new Date,this.parts=n||[this],this.locales=r||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((n,r)=>r>t&&n instanceof e))}setTo(e){}prev(){let t=[].concat(this.parts).reverse();const n=t.indexOf(this);return t.find(((t,r)=>r>n&&t instanceof e))}toString(){return String(this.date)}}return datepart=e}function requireMeridiem(){if(hasRequiredMeridiem)return meridiem;hasRequiredMeridiem=1;const e=requireDatepart();return meridiem=class extends e{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}}}function requireDay(){if(hasRequiredDay)return day;hasRequiredDay=1;const e=requireDatepart();return day=class extends e{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return"DD"===this.token?String(e).padStart(2,"0"):"Do"===this.token?e+(n=e,1==(n%=10)?"st":2===n?"nd":3===n?"rd":"th"):"d"===this.token?t+1:"ddd"===this.token?this.locales.weekdaysShort[t]:"dddd"===this.token?this.locales.weekdays[t]:e;var n}},day}function requireHours(){if(hasRequiredHours)return hours;hasRequiredHours=1;const e=requireDatepart();return hours=class extends e{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}}}function requireMilliseconds(){if(hasRequiredMilliseconds)return milliseconds;hasRequiredMilliseconds=1;const e=requireDatepart();return milliseconds=class extends e{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}}function requireMinutes(){if(hasRequiredMinutes)return minutes;hasRequiredMinutes=1;const e=requireDatepart();return minutes=class extends e{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}}}function requireMonth(){if(hasRequiredMonth)return month;hasRequiredMonth=1;const e=requireDatepart();return month=class extends e{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return 2===t?String(e+1).padStart(2,"0"):3===t?this.locales.monthsShort[e]:4===t?this.locales.months[e]:String(e+1)}}}function requireSeconds(){if(hasRequiredSeconds)return seconds;hasRequiredSeconds=1;const e=requireDatepart();return seconds=class extends e{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}}}function requireYear(){if(hasRequiredYear)return year;hasRequiredYear=1;const e=requireDatepart();return year=class extends e{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return 2===this.token.length?e.substr(-2):e}}}function requireDateparts(){return hasRequiredDateparts?dateparts:(hasRequiredDateparts=1,dateparts={DatePart:requireDatepart(),Meridiem:requireMeridiem(),Day:requireDay(),Hours:requireHours(),Milliseconds:requireMilliseconds(),Minutes:requireMinutes(),Month:requireMonth(),Seconds:requireSeconds(),Year:requireYear()})}function requireDate(){if(hasRequiredDate)return date;hasRequiredDate=1;const e=requireKleur(),t=requirePrompt(),{style:n,clear:r,figures:i}=requireUtil$3(),{erase:o,cursor:s}=requireSrc$6(),{DatePart:a,Meridiem:c,Day:l,Hours:u,Milliseconds:d,Minutes:p,Month:f,Seconds:_,Year:m}=requireDateparts(),h=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,g={1:({token:e})=>e.replace(/\\(.)/g,"$1"),2:e=>new l(e),3:e=>new f(e),4:e=>new m(e),5:e=>new c(e),6:e=>new u(e),7:e=>new p(e),8:e=>new _(e),9:e=>new d(e)},A={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};return date=class extends t{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(A,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=r("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=h.exec(e);){let e=t.shift(),n=t.findIndex((e=>null!=e));this.parts.push(n in g?g[n]({token:t[n]||e,date:this.date,parts:this.parts,locales:this.locales}):t[n]||e)}let n=this.parts.reduce(((e,t)=>("string"==typeof t&&"string"==typeof e[e.length-1]?e[e.length-1]+=t:e.push(t),e)),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex((e=>e instanceof a))),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let e=await this.validator(this.value);"string"==typeof e&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error)return this.color="red",this.fire(),void this.render();this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(null==e)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(null==e)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex((e=>e instanceof a))),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(!1),this.parts.reduce(((t,n,r)=>t.concat(r!==this.cursor||this.done?n:e.cyan().underline(n.toString()))),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split("\n").reduce(((t,n,r)=>t+`\n${r?" ":i.pointerSmall} ${e.red().italic(n)}`),"")),this.out.write(o.line+s.to(0)+this.outputText))}},date}function requireNumber(){if(hasRequiredNumber)return number;hasRequiredNumber=1;const e=requireKleur(),t=requirePrompt(),{cursor:n,erase:r}=requireSrc$6(),{style:i,figures:o,clear:s,lines:a}=requireUtil$3(),c=/[0-9]/,l=e=>void 0!==e,u=(e,t)=>{let n=Math.pow(10,t);return Math.round(e*n)/n};return number=class extends t{constructor(e={}){super(e),this.transform=i.render(e.style),this.msg=e.message,this.initial=l(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=l(e.min)?e.min:-1/0,this.max=l(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){t||0===t?(this.placeholder=!1,this.rendered=this.transform.render(`${u(t,this.round)}`),this._value=u(t,this.round)):(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return"-"===e||"."===e&&this.float||c.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=""!==e?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let e=await this.validator(this.value);"string"==typeof e&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error)return this.color="red",this.fire(),void this.render();let e=this.value;this.value=""!==e?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}up(){if(this.typed="",""===this.value&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",""===this.value&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(0===e.length)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",""!==this.value&&this.value1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan","."===e)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.valuet+`\n${r?" ":o.pointerSmall} ${e.red().italic(n)}`),"")),this.out.write(r.line+n.to(0)+this.outputText+n.save+this.outputError+n.restore))}},number}function requireMultiselect(){if(hasRequiredMultiselect)return multiselect;hasRequiredMultiselect=1;const e=requireKleur(),{cursor:t}=requireSrc$6(),n=requirePrompt(),{clear:r,figures:i,style:o,wrap:s,entriesToDisplay:a}=requireUtil$3();return multiselect=class extends n{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map(((e,t)=>("string"==typeof e&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(void 0===e.value?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled}))),this.clear=r("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map((e=>!e.selected)),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((e=>e.selected))}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){const e=this.value.filter((e=>e.selected));this.minSelected&&e.lengthe.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(void 0!==this.maxChoices||this.value[this.cursor].disabled)return this.bell();const e=!this.value[this.cursor].selected;this.value.filter((e=>!e.disabled)).forEach((t=>t.selected=e)),this.render()}_(e,t){if(" "===e)this.handleSpaceToggle();else{if("a"!==e)return this.bell();this.toggleAll()}}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${i.arrowUp}/${i.arrowDown}: Highlight option\n ${i.arrowLeft}/${i.arrowRight}/[space]: Toggle selection\n`+(void 0===this.maxChoices?" a: Toggle all\n":"")+" enter/return: Complete answer":""}renderOption(t,n,r,o){const a=(n.selected?e.green(i.radioOn):i.radioOff)+" "+o+" ";let c,l;return n.disabled?c=t===r?e.gray().underline(n.title):e.strikethrough().gray(n.title):(c=t===r?e.cyan().underline(n.title):n.title,t===r&&n.description&&(l=` - ${n.description}`,(a.length+c.length+l.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(l="\n"+s(n.description,{margin:a.length,width:this.out.columns})))),a+c+e.gray(l||"")}paginateOptions(t){if(0===t.length)return e.red("No matches for this query.");let n,{startIndex:r,endIndex:o}=a(this.cursor,t.length,this.optionsPerPage),s=[];for(let e=r;e0?i.arrowUp:e===o-1&&oe.selected)).map((e=>e.title)).join(", ");const t=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(e.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let n=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.value),this.out.write(this.clear+n),this.clear=r(n,this.out.columns)}},multiselect}function requireAutocomplete(){if(hasRequiredAutocomplete)return autocomplete;hasRequiredAutocomplete=1;const e=requireKleur(),t=requirePrompt(),{erase:n,cursor:r}=requireSrc$6(),{style:i,clear:o,figures:s,wrap:a,entriesToDisplay:c}=requireUtil$3(),l=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),u=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]);return autocomplete=class extends t{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial="number"==typeof e.initial?e.initial:((e,t)=>{const n=e.findIndex((e=>e.value===t||e.title===t));return n>-1?n:void 0})(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=i.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=o("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return"number"==typeof this._fb?e=this.choices[this._fb]:"string"==typeof this._fb&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=l(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){const t=this.completing=this.suggest(this.input,this.choices),n=await t;if(this.completing!==t)return;this.suggestions=n.map(((e,t,n)=>({title:u(n,t),value:l(n,t),description:e.description}))),this.completing=!1;const r=Math.max(n.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}reset(){this.input="",this.complete((()=>{this.moveSelect(void 0!==this.initial?this.initial:0),this.render()})),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(e,t){let n=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${n}${e}${r}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(0===this.cursor)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){0===this.select?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,n,r,i){let o,c=r?s.arrowUp:i?s.arrowDown:" ",l=n?e.cyan().underline(t.title):t.title;return c=(n?e.cyan(s.pointer)+" ":" ")+c,t.description&&(o=` - ${t.description}`,(c.length+l.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o="\n"+a(t.description,{margin:3,width:this.out.columns}))),c+" "+l+e.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(r.hide):this.out.write(o(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:s}=c(this.select,this.choices.length,this.limit);if(this.outputText=[i.symbol(this.done,this.aborted,this.exited),e.bold(this.msg),i.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const n=this.suggestions.slice(t,s).map(((e,n)=>this.renderOption(e,this.select===n+t,0===n&&t>0,n+t===s-1&&se.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((e=>!this.inputValue||(!("string"!=typeof e.title||!e.title.toLowerCase().includes(this.inputValue.toLowerCase()))||!("string"!=typeof e.value||!e.value.toLowerCase().includes(this.inputValue.toLowerCase())))));const t=this.filteredOptions.findIndex((t=>t===e));this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){const e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){" "===e?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${o.arrowUp}/${o.arrowDown}: Highlight option\n ${o.arrowLeft}/${o.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`:""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}\n`}renderOption(t,n,r){let i;return i=n.disabled?t===r?e.gray().underline(n.title):e.strikethrough().gray(n.title):t===r?e.cyan().underline(n.title):n.title,(n.selected?e.green(o.radioOn):o.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter((e=>e.selected)).map((e=>e.title)).join(", ");const t=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(e.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let n=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+n),this.clear=r(n,this.out.columns)}},autocompleteMultiselect}function requireConfirm(){if(hasRequiredConfirm)return confirm;hasRequiredConfirm=1;const e=requireKleur(),t=requirePrompt(),{style:n,clear:r}=requireUtil$3(),{erase:i,cursor:o}=requireSrc$6();return confirm=class extends t{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(e,t){return"y"===e.toLowerCase()?(this.value=!0,this.submit()):"n"===e.toLowerCase()?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(o.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(i.line+o.to(0)+this.outputText))}}}function requireElements(){return hasRequiredElements?elements:(hasRequiredElements=1,elements={TextPrompt:requireText$1(),SelectPrompt:requireSelect(),TogglePrompt:requireToggle(),DatePrompt:requireDate(),NumberPrompt:requireNumber(),MultiselectPrompt:requireMultiselect(),AutocompletePrompt:requireAutocomplete(),AutocompleteMultiselectPrompt:requireAutocompleteMultiselect(),ConfirmPrompt:requireConfirm()})}function requirePrompts$1(){return hasRequiredPrompts$1||(hasRequiredPrompts$1=1,function(){const e=prompts$2,t=requireElements(),n=e=>e;function r(e,r,i={}){return new Promise(((o,s)=>{const a=new t[e](r),c=i.onAbort||n,l=i.onSubmit||n,u=i.onExit||n;a.on("state",r.onState||n),a.on("submit",(e=>o(l(e)))),a.on("exit",(e=>o(u(e)))),a.on("abort",(e=>s(c(e))))}))}e.text=e=>r("TextPrompt",e),e.password=t=>(t.style="password",e.text(t)),e.invisible=t=>(t.style="invisible",e.text(t)),e.number=e=>r("NumberPrompt",e),e.date=e=>r("DatePrompt",e),e.confirm=e=>r("ConfirmPrompt",e),e.list=e=>{const t=e.separator||",";return r("TextPrompt",e,{onSubmit:e=>e.split(t).map((e=>e.trim()))})},e.toggle=e=>r("TogglePrompt",e),e.select=e=>r("SelectPrompt",e),e.multiselect=e=>{e.choices=[].concat(e.choices||[]);const t=e=>e.filter((e=>e.selected)).map((e=>e.value));return r("MultiselectPrompt",e,{onAbort:t,onSubmit:t})},e.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);const t=e=>e.filter((e=>e.selected)).map((e=>e.value));return r("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};const i=(e,t)=>Promise.resolve(t.filter((t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase())));e.autocomplete=e=>(e.suggest=e.suggest||i,e.choices=[].concat(e.choices||[]),r("AutocompletePrompt",e))}()),prompts$2}function requireLib$e(){if(hasRequiredLib$e)return lib$f;hasRequiredLib$e=1;const e=requirePrompts$1(),t=["suggest","format","onState","validate","onRender","type"],n=()=>{};async function r(o=[],{onSubmit:s=n,onCancel:a=n}={}){const c={},l=r._override||{};let u,d,p,f,_,m;o=[].concat(o);const h=async(e,t,n=!1)=>{if(n||!e.validate||!0===e.validate(t))return e.format?await e.format(t,c):t};for(d of o)if(({name:f,type:_}=d),"function"==typeof _&&(_=await _(u,{...c},d),d.type=_),_){for(let e in d){if(t.includes(e))continue;let n=d[e];d[e]="function"==typeof n?await n(u,{...c},m):n}if(m=d,"string"!=typeof d.message)throw new Error("prompt message is required");if(({name:f,type:_}=d),void 0===e[_])throw new Error(`prompt type (${_}) is not defined`);if(void 0===l[d.name]||(u=await h(d,l[d.name]),void 0===u)){try{u=r._injected?i(r._injected,d.initial):await e[_](d),c[f]=u=await h(d,u,!0),p=await s(d,u,c)}catch(e){p=!await a(d,c)}if(p)return c}else c[f]=u}return c}function i(e,t){const n=e.shift();if(n instanceof Error)throw n;return void 0===n?t:n}return lib$f=Object.assign(r,{prompt:r,prompts:e,inject:function(e){r._injected=(r._injected||[]).concat(e)},override:function(e){r._override=Object.assign({},e)}})}function requirePrompts(){if(hasRequiredPrompts)return prompts$1;return hasRequiredPrompts=1,prompts$1=function(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let t=0,n=process.versions.node.split(".").map(Number);for(;te[t])return!1;if(e[t]>n[t])return!0}return!1}("8.6.0")?requireDist$6():requireLib$e(),prompts$1}var promptsExports=requirePrompts(),prompts=getDefaultExportFromCjs(promptsExports),dist$5={},src$5={},hasRequiredSrc$5,hasRequiredDist$5;function requireSrc$5(){return hasRequiredSrc$5||(hasRequiredSrc$5=1,function(e){var t=src$5&&src$5.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});const n=require$$0$7,r=t(requireSrc$8()).default("@kwsites/file-exists");e.exists=function(t,i=e.READABLE){return function(e,t,i){r("checking %s",e);try{const o=n.statSync(e);return o.isFile()&&t?(r("[OK] path represents a file"),!0):o.isDirectory()&&i?(r("[OK] path represents a directory"),!0):(r("[FAIL] path represents something other than a file or directory"),!1)}catch(e){if("ENOENT"===e.code)return r("[FAIL] path is not accessible: %o",e),!1;throw r("[FATAL] %o",e),e}}(t,(i&e.FILE)>0,(i&e.FOLDER)>0)},e.FILE=1,e.FOLDER=2,e.READABLE=e.FILE+e.FOLDER}(src$5)),src$5}function requireDist$5(){return hasRequiredDist$5||(hasRequiredDist$5=1,e=dist$5,Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(requireSrc$5())),dist$5;var e}var distExports$2=requireDist$5(),dist$4={},hasRequiredDist$4;function requireDist$4(){if(hasRequiredDist$4)return dist$4;function e(){let e,t,n="pending";return{promise:new Promise(((n,r)=>{e=n,t=r})),done(t){"pending"===n&&(n="resolved",e(t))},fail(e){"pending"===n&&(n="rejected",t(e))},get fulfilled(){return"pending"!==n},get status(){return n}}}return hasRequiredDist$4=1,Object.defineProperty(dist$4,"__esModule",{value:!0}),dist$4.createDeferred=dist$4.deferred=void 0,dist$4.deferred=e,dist$4.createDeferred=e,dist$4.default=e,dist$4}var distExports$1=requireDist$4(),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__esm=(e,t)=>function(){return e&&(t=(0,e[__getOwnPropNames(e)[0]])(e=0)),t},__commonJS=(e,t)=>function(){return t||(0,e[__getOwnPropNames(e)[0]])((t={exports:{}}).exports,t),t.exports},__export=(e,t)=>{for(var n in t)__defProp(e,n,{get:t[n],enumerable:!0})},__copyProps=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of __getOwnPropNames(t))__hasOwnProp.call(e,i)||i===n||__defProp(e,i,{get:()=>t[i],enumerable:!(r=__getOwnPropDesc(t,i))||r.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())})),cache;function pathspec(...e){const t=new String(e);return cache.set(t,e),t}function isPathSpec(e){return e instanceof String&&cache.has(e)}function toPaths(e){return cache.get(e)||[]}var init_pathspec=__esm({"src/lib/args/pathspec.ts"(){cache=new WeakMap}}),GitError,init_git_error=__esm({"src/lib/errors/git-error.ts"(){GitError=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),GitResponseError,init_git_response_error=__esm({"src/lib/errors/git-response-error.ts"(){init_git_error(),GitResponseError=class extends GitError{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),TaskConfigurationError,init_task_configuration_error=__esm({"src/lib/errors/task-configuration-error.ts"(){init_git_error(),TaskConfigurationError=class extends GitError{constructor(e){super(void 0,e)}}}}),NULL,NOOP$1,objectToString;function asFunction(e){return"function"==typeof e?e:NOOP$1}function isUserFunction(e){return"function"==typeof e&&e!==NOOP$1}function splitOn(e,t){const n=e.indexOf(t);return n<=0?[e,""]:[e.substr(0,n),e.substr(n+1)]}function first(e,t=0){return isArrayLike(e)&&e.length>t?e[t]:void 0}function last(e,t=0){if(isArrayLike(e)&&e.length>t)return e[e.length-1-t]}function isArrayLike(e){return!(!e||"number"!=typeof e.length)}function toLinesWithContent(e="",t=!0,n="\n"){return e.split(n).reduce(((e,n)=>{const r=t?n.trim():n;return r&&e.push(r),e}),[])}function forEachLineWithContent(e,t){return toLinesWithContent(e,!0).map((e=>t(e)))}function folderExists(e){return distExports$2.exists(e,distExports$2.FOLDER)}function append(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function including(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function remove(e,t){if(Array.isArray(e)){const n=e.indexOf(t);n>=0&&e.splice(n,1)}else e.delete(t);return t}function asArray(e){return Array.isArray(e)?e:[e]}function asCamelCase(e){return e.replace(/[\s-]+(.)/g,((e,t)=>t.toUpperCase()))}function asStringArray(e){return asArray(e).map(String)}function asNumber(e,t=0){if(null==e)return t;const n=parseInt(e,10);return isNaN(n)?t:n}function prefixedArray(e,t){const n=[];for(let r=0,i=e.length;rt in e?{[t]:e[t]}:{})))}function delay(e=0){return new Promise((t=>setTimeout(t,e)))}function orVoid(e){if(!1!==e)return e}var init_util=__esm({"src/lib/utils/util.ts"(){NULL="\0",NOOP$1=()=>{},objectToString=Object.prototype.toString.call.bind(Object.prototype.toString)}}),filterArray,filterString,filterStringArray,filterStringOrStringArray,filterHasLength;function filterType(e,t,n){return t(e)?e:arguments.length>2?n:void 0}function filterPrimitives(e,t){const n=isPathSpec(e)?"string":typeof e;return/number|string|boolean/.test(n)&&(!t||!t.includes(n))}function filterPlainObject(e){return!!e&&"[object Object]"===objectToString(e)}function filterFunction(e){return"function"==typeof e}var init_argument_filters=__esm({"src/lib/utils/argument-filters.ts"(){init_util(),init_pathspec(),filterArray=e=>Array.isArray(e),filterString=e=>"string"==typeof e,filterStringArray=e=>Array.isArray(e)&&e.every(filterString),filterStringOrStringArray=e=>filterString(e)||Array.isArray(e)&&e.every(filterString),filterHasLength=e=>null!=e&&!"number|boolean|function".includes(typeof e)&&(Array.isArray(e)||"string"==typeof e||"number"==typeof e.length)}}),ExitCodes,init_exit_codes=__esm({"src/lib/utils/exit-codes.ts"(){ExitCodes=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(ExitCodes||{})}}),GitOutputStreams,init_git_output_streams=__esm({"src/lib/utils/git-output-streams.ts"(){GitOutputStreams=class{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new GitOutputStreams(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),LineParser,RemoteLineParser,init_line_parser=__esm({"src/lib/utils/line-parser.ts"(){LineParser=class{constructor(e,t){this.matches=[],this.parse=(e,t)=>(this.resetMatches(),!!this._regExp.every(((t,n)=>this.addMatch(t,n,e(n))))&&!1!==this.useMatches(t,this.prepareMatches())),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,n){const r=n&&e.exec(n);return r&&this.pushMatch(t,r),!!r}pushMatch(e,t){this.matches.push(...t.slice(1))}},RemoteLineParser=class extends LineParser{addMatch(e,t,n){return/^remote:\s/.test(String(n))&&super.addMatch(e,t,n)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}}),defaultOptions;function createInstanceConfig(...e){const t=process.cwd(),n=Object.assign(__spreadValues({baseDir:t},defaultOptions),...e.filter((e=>"object"==typeof e&&e)));return n.baseDir=n.baseDir||t,n.trimmed=!0===n.trimmed,n}var init_simple_git_options=__esm({"src/lib/utils/simple-git-options.ts"(){defaultOptions={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function appendTaskOptions(e,t=[]){return filterPlainObject(e)?Object.keys(e).reduce(((t,n)=>{const r=e[n];return isPathSpec(r)?t.push(r):filterPrimitives(r,["boolean"])?t.push(n+"="+r):t.push(n),t}),t):t}function getTrailingOptions(e,t=0,n=!1){const r=[];for(let n=0,i=t<0?e.length:t;n{for(let i=toLinesWithContent(n,r),o=0,s=i.length;o{if(!(o+e>=s))return i[o+e]};t.some((({parse:t})=>t(n,e)))}})),e}var init_task_parser=__esm({"src/lib/utils/task-parser.ts"(){init_util()}}),utils_exports={};__export(utils_exports,{ExitCodes:()=>ExitCodes,GitOutputStreams:()=>GitOutputStreams,LineParser:()=>LineParser,NOOP:()=>NOOP$1,NULL:()=>NULL,RemoteLineParser:()=>RemoteLineParser,append:()=>append,appendTaskOptions:()=>appendTaskOptions,asArray:()=>asArray,asCamelCase:()=>asCamelCase,asFunction:()=>asFunction,asNumber:()=>asNumber,asStringArray:()=>asStringArray,bufferToString:()=>bufferToString,callTaskParser:()=>callTaskParser,createInstanceConfig:()=>createInstanceConfig,delay:()=>delay,filterArray:()=>filterArray,filterFunction:()=>filterFunction,filterHasLength:()=>filterHasLength,filterPlainObject:()=>filterPlainObject,filterPrimitives:()=>filterPrimitives,filterString:()=>filterString,filterStringArray:()=>filterStringArray,filterStringOrStringArray:()=>filterStringOrStringArray,filterType:()=>filterType,first:()=>first,folderExists:()=>folderExists,forEachLineWithContent:()=>forEachLineWithContent,getTrailingOptions:()=>getTrailingOptions,including:()=>including,isUserFunction:()=>isUserFunction,last:()=>last,objectToString:()=>objectToString,orVoid:()=>orVoid,parseStringResponse:()=>parseStringResponse,pick:()=>pick,prefixedArray:()=>prefixedArray,remove:()=>remove,splitOn:()=>splitOn,toLinesWithContent:()=>toLinesWithContent,trailingFunctionArgument:()=>trailingFunctionArgument,trailingOptionsArgument:()=>trailingOptionsArgument});var init_utils=__esm({"src/lib/utils/index.ts"(){init_argument_filters(),init_exit_codes(),init_git_output_streams(),init_line_parser(),init_simple_git_options(),init_task_options(),init_task_parser(),init_util()}}),check_is_repo_exports={},CheckRepoActions,onError,parser;function checkIsRepoTask(e){switch(e){case"bare":return checkIsBareRepoTask();case"root":return checkIsRepoRootTask()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:onError,parser:parser}}function checkIsRepoRootTask(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:onError,parser:e=>/^\.(git)?$/.test(e.trim())}}function checkIsBareRepoTask(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:onError,parser:parser}}function isNotRepoMessage(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}__export(check_is_repo_exports,{CheckRepoActions:()=>CheckRepoActions,checkIsBareRepoTask:()=>checkIsBareRepoTask,checkIsRepoRootTask:()=>checkIsRepoRootTask,checkIsRepoTask:()=>checkIsRepoTask});var init_check_is_repo=__esm({"src/lib/tasks/check-is-repo.ts"(){init_utils(),CheckRepoActions=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(CheckRepoActions||{}),onError=({exitCode:e},t,n,r)=>{if(128===e&&isNotRepoMessage(t))return n(Buffer.from("false"));r(t)},parser=e=>"true"===e.trim()}}),CleanResponse,removalRegexp,dryRunRemovalRegexp,isFolderRegexp;function cleanSummaryParser(e,t){const n=new CleanResponse(e),r=e?dryRunRemovalRegexp:removalRegexp;return toLinesWithContent(t).forEach((e=>{const t=e.replace(r,"");n.paths.push(t),(isFolderRegexp.test(t)?n.folders:n.files).push(t)})),n}var init_CleanSummary=__esm({"src/lib/responses/CleanSummary.ts"(){init_utils(),CleanResponse=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},removalRegexp=/^[a-z]+\s*/i,dryRunRemovalRegexp=/^[a-z]+\s+[a-z]+\s*/i,isFolderRegexp=/\/$/}}),task_exports={},EMPTY_COMMANDS;function adhocExecTask(e){return{commands:EMPTY_COMMANDS,format:"empty",parser:e}}function configurationErrorTask(e){return{commands:EMPTY_COMMANDS,format:"empty",parser(){throw"string"==typeof e?new TaskConfigurationError(e):e}}}function straightThroughStringTask(e,t=!1){return{commands:e,format:"utf-8",parser:e=>t?String(e).trim():e}}function straightThroughBufferTask(e){return{commands:e,format:"buffer",parser:e=>e}}function isBufferTask(e){return"buffer"===e.format}function isEmptyTask(e){return"empty"===e.format||!e.commands.length}__export(task_exports,{EMPTY_COMMANDS:()=>EMPTY_COMMANDS,adhocExecTask:()=>adhocExecTask,configurationErrorTask:()=>configurationErrorTask,isBufferTask:()=>isBufferTask,isEmptyTask:()=>isEmptyTask,straightThroughBufferTask:()=>straightThroughBufferTask,straightThroughStringTask:()=>straightThroughStringTask});var init_task=__esm({"src/lib/tasks/task.ts"(){init_task_configuration_error(),EMPTY_COMMANDS=[]}}),clean_exports={},CONFIG_ERROR_INTERACTIVE_MODE,CONFIG_ERROR_MODE_REQUIRED,CONFIG_ERROR_UNKNOWN_OPTION,CleanOptions,CleanOptionValues;function cleanWithOptionsTask(e,t){const{cleanMode:n,options:r,valid:i}=getCleanOptions(e);return n?i.options?(r.push(...t),r.some(isInteractiveMode)?configurationErrorTask(CONFIG_ERROR_INTERACTIVE_MODE):cleanTask(n,r)):configurationErrorTask(CONFIG_ERROR_UNKNOWN_OPTION+JSON.stringify(e)):configurationErrorTask(CONFIG_ERROR_MODE_REQUIRED)}function cleanTask(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser:t=>cleanSummaryParser("n"===e,t)}}function isCleanOptionsArray(e){return Array.isArray(e)&&e.every((e=>CleanOptionValues.has(e)))}function getCleanOptions(e){let t,n=[],r={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach((e=>{isCleanMode(e)?(t=e,r.cleanMode=!0):r.options=r.options&&isKnownOption(n[n.length]=`-${e}`)})),{cleanMode:t,options:n,valid:r}}function isCleanMode(e){return"f"===e||"n"===e}function isKnownOption(e){return/^-[a-z]$/i.test(e)&&CleanOptionValues.has(e.charAt(1))}function isInteractiveMode(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:"--interactive"===e}__export(clean_exports,{CONFIG_ERROR_INTERACTIVE_MODE:()=>CONFIG_ERROR_INTERACTIVE_MODE,CONFIG_ERROR_MODE_REQUIRED:()=>CONFIG_ERROR_MODE_REQUIRED,CONFIG_ERROR_UNKNOWN_OPTION:()=>CONFIG_ERROR_UNKNOWN_OPTION,CleanOptions:()=>CleanOptions,cleanTask:()=>cleanTask,cleanWithOptionsTask:()=>cleanWithOptionsTask,isCleanOptionsArray:()=>isCleanOptionsArray});var init_clean=__esm({"src/lib/tasks/clean.ts"(){init_CleanSummary(),init_utils(),init_task(),CONFIG_ERROR_INTERACTIVE_MODE="Git clean interactive mode is not supported",CONFIG_ERROR_MODE_REQUIRED='Git clean mode parameter ("n" or "f") is required',CONFIG_ERROR_UNKNOWN_OPTION="Git clean unknown option found in: ",CleanOptions=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(CleanOptions||{}),CleanOptionValues=new Set(["i",...asStringArray(Object.values(CleanOptions))])}}),ConfigList;function configListParser(e){const t=new ConfigList;for(const n of configParser(e))t.addValue(n.file,String(n.key),n.value);return t}function configGetParser(e,t){let n=null;const r=[],i=new Map;for(const o of configParser(e,t))o.key===t&&(r.push(n=o.value),i.has(o.file)||i.set(o.file,[]),i.get(o.file).push(n));return{key:t,paths:Array.from(i.keys()),scopes:i,value:n,values:r}}function configFilePath(e){return e.replace(/^(file):/,"")}function*configParser(e,t=null){const n=e.split("\0");for(let e=0,r=n.length-1;eObject.assign(e,this.values[t])),{})),this._all}addFile(e){if(!(e in this.values)){const t=last(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,n){const r=this.addFile(e);r.hasOwnProperty(t)?Array.isArray(r[t])?r[t].push(n):r[t]=[r[t],n]:r[t]=n,this._all=void 0}}}}),GitConfigScope;function asConfigScope(e,t){return"string"==typeof e&&GitConfigScope.hasOwnProperty(e)?e:t}function addConfigTask(e,t,n,r){const i=["config",`--${r}`];return n&&i.push("--add"),i.push(e,t),{commands:i,format:"utf-8",parser:e=>e}}function getConfigTask(e,t){const n=["config","--null","--show-origin","--get-all",e];return t&&n.splice(1,0,`--${t}`),{commands:n,format:"utf-8",parser:t=>configGetParser(t,e)}}function listConfigTask(e){const t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser:e=>configListParser(e)}}function config_default(){return{addConfig(e,t,...n){return this._runTask(addConfigTask(e,t,!0===n[0],asConfigScope(n[1],"local")),trailingFunctionArgument(arguments))},getConfig(e,t){return this._runTask(getConfigTask(e,asConfigScope(t,void 0)),trailingFunctionArgument(arguments))},listConfig(...e){return this._runTask(listConfigTask(asConfigScope(e[0],void 0)),trailingFunctionArgument(arguments))}}}var init_config=__esm({"src/lib/tasks/config.ts"(){init_ConfigList(),init_utils(),GitConfigScope=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(GitConfigScope||{})}}),DiffNameStatus,diffNameStatus;function isDiffNameStatus(e){return diffNameStatus.has(e)}var init_diff_name_status=__esm({"src/lib/tasks/diff-name-status.ts"(){DiffNameStatus=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(DiffNameStatus||{}),diffNameStatus=new Set(Object.values(DiffNameStatus))}}),disallowedOptions,Query,_a,GrepQuery;function grepQueryBuilder(...e){return(new GrepQuery).param(...e)}function parseGrep(e){const t=new Set,n={};return forEachLineWithContent(e,(e=>{const[r,i,o]=e.split(NULL);t.add(r),(n[r]=n[r]||[]).push({line:asNumber(i),path:r,preview:o})})),{paths:t,results:n}}function grep_default(){return{grep(e){const t=trailingFunctionArgument(arguments),n=getTrailingOptions(arguments);for(const e of disallowedOptions)if(n.includes(e))return this._runTask(configurationErrorTask(`git.grep: use of "${e}" is not supported.`),t);"string"==typeof e&&(e=grepQueryBuilder().param(e));const r=["grep","--null","-n","--full-name",...n,...e];return this._runTask({commands:r,format:"utf-8",parser:e=>parseGrep(e)},t)}}}var init_grep=__esm({"src/lib/tasks/grep.ts"(){init_utils(),init_task(),disallowedOptions=["-h"],Query=Symbol("grepQuery"),GrepQuery=class{constructor(){this[_a]=[]}*[(_a=Query,Symbol.iterator)](){for(const e of this[Query])yield e}and(...e){return e.length&&this[Query].push("--and","(",...prefixedArray(e,"-e"),")"),this}param(...e){return this[Query].push(...prefixedArray(e,"-e")),this}}}}),reset_exports={},ResetMode,ResetModes;function resetTask(e,t){const n=["reset"];return isValidResetMode(e)&&n.push(`--${e}`),n.push(...t),straightThroughStringTask(n)}function getResetMode(e){if(isValidResetMode(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function isValidResetMode(e){return ResetModes.includes(e)}__export(reset_exports,{ResetMode:()=>ResetMode,getResetMode:()=>getResetMode,resetTask:()=>resetTask});var init_reset=__esm({"src/lib/tasks/reset.ts"(){init_task(),ResetMode=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(ResetMode||{}),ResetModes=Array.from(Object.values(ResetMode))}});function createLog(){return debugModule("simple-git")}function prefixedLogger(e,t,n){return t&&String(t).replace(/\s*/,"")?(r,...i)=>{e(`%s ${r}`,t,...i),n&&n(r,...i)}:n?(t,...r)=>{e(t,...r),n(t,...r)}:e}function childLoggerName(e,t,{namespace:n}){if("string"==typeof e)return e;const r=t&&t.namespace||"";return r.startsWith(n)?r.substr(n.length+1):r||n}function createLogger(e,t,n,r=createLog()){const i=e&&`[${e}]`||"",o=[],s="string"==typeof t?r.extend(t):t,a=childLoggerName(filterType(t,filterString),s,r);return function t(n){const o=n&&`[${n}]`||"",a=s&&prefixedLogger(s,o)||NOOP$1,l=prefixedLogger(r,`${i} ${o}`,a);return Object.assign(s?a:l,{label:e,sibling:c,info:l,step:t})}(n);function c(t,n){return append(o,createLogger(e,a.replace(/^[^:]+/,t),n,r))}}var init_git_logger=__esm({"src/lib/git-logger.ts"(){init_utils(),debugModule.formatters.L=e=>String(filterHasLength(e)?e.length:"-"),debugModule.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):objectToString(e)}}),_TasksPendingQueue,TasksPendingQueue,init_tasks_pending_queue=__esm({"src/lib/runners/tasks-pending-queue.ts"(){init_git_error(),init_git_logger(),_TasksPendingQueue=class{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){const t=_TasksPendingQueue.getName(e.commands[0]);return{task:e,logger:createLogger(this.logLabel,t),name:t}}push(e){const t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(const[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info("Failed %o",e),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(t);if(0!==this._queue.size)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){const t=this.withProgress(e);if(!t)throw new GitError(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(e="empty"){return`task:${e}:${++_TasksPendingQueue.counter}`}},(TasksPendingQueue=_TasksPendingQueue).counter=0}}),GitExecutorChain;function pluginContext(e,t){return{method:first(e.commands)||"",commands:t}}function onErrorReceived(e,t){return n=>{t("[ERROR] child process exception %o",n),e.push(Buffer.from(String(n.stack),"ascii"))}}function onDataReceived(e,t,n,r){return i=>{n("%s received %L bytes",t,i),r("%B",i),e.push(i)}}var init_git_executor_chain=__esm({"src/lib/runners/git-executor-chain.ts"(){init_git_error(),init_task(),init_utils(),init_tasks_pending_queue(),GitExecutorChain=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new TasksPendingQueue}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then((()=>this.attemptTask(e)))}attemptTask(e){return __async(this,null,(function*(){const t=yield this._scheduler.next(),n=()=>this._queue.complete(e);try{const{logger:t}=this._queue.attempt(e);return yield isEmptyTask(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t)}catch(t){throw this.onFatalException(e,t)}finally{n(),t()}}))}onFatalException(e,t){const n=t instanceof GitError?Object.assign(t,{task:e}):new GitError(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}attemptRemoteTask(e,t){return __async(this,null,(function*(){const n=this._plugins.exec("spawn.binary","",pluginContext(e,e.commands)),r=this._plugins.exec("spawn.args",[...e.commands],pluginContext(e,e.commands)),i=yield this.gitResponse(e,n,r,this.outputHandler,t.step("SPAWN")),o=yield this.handleTaskData(e,r,i,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),isBufferTask(e)?callTaskParser(e.parser,o):callTaskParser(e.parser,o.asStrings())}))}attemptEmptyTask(e,t){return __async(this,null,(function*(){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}))}handleTaskData(e,t,n,r){const{exitCode:i,rejection:o,stdOut:s,stdErr:a}=n;return new Promise(((c,l)=>{r("Preparing to handle process response exitCode=%d stdOut=",i);const{error:u}=this._plugins.exec("task.error",{error:o},__spreadValues(__spreadValues({},pluginContext(e,t)),n));return u&&e.onError?(r.info("exitCode=%s handling with custom error handler"),e.onError(n,u,(e=>{r.info("custom error handler treated as success"),r("custom error returned a %s",objectToString(e)),c(new GitOutputStreams(Array.isArray(e)?Buffer.concat(e):e,Buffer.concat(a)))}),l)):u?(r.info("handling as error: exitCode=%s stdErr=%s rejection=%o",i,a.length,o),l(u)):(r.info("retrieving task output complete"),void c(new GitOutputStreams(Buffer.concat(s),Buffer.concat(a))))}))}gitResponse(e,t,n,r,i){return __async(this,null,(function*(){const o=i.sibling("output"),s=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},pluginContext(e,e.commands));return new Promise((a=>{const c=[],l=[];i.info("%s %o",t,n),i("%O",s);let u=this._beforeSpawn(e,n);if(u)return a({stdOut:c,stdErr:l,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,__spreadProps(__spreadValues({},pluginContext(e,n)),{kill(e){u=e||u}}));const d=spawn(t,n,s);d.stdout.on("data",onDataReceived(c,"stdOut",i,o.step("stdOut"))),d.stderr.on("data",onDataReceived(l,"stdErr",i,o.step("stdErr"))),d.on("error",onErrorReceived(l,i)),r&&(i("Passing child process stdOut/stdErr to custom outputHandler"),r(t,d.stdout,d.stderr,[...n])),this._plugins.exec("spawn.after",void 0,__spreadProps(__spreadValues({},pluginContext(e,n)),{spawned:d,close(e,t){a({stdOut:c,stdErr:l,exitCode:e,rejection:u||t})},kill(e){d.killed||(u=e,d.kill("SIGINT"))}}))}))}))}_beforeSpawn(e,t){let n;return this._plugins.exec("spawn.before",void 0,__spreadProps(__spreadValues({},pluginContext(e,t)),{kill(e){n=e||n}})),n}}}}),git_executor_exports={},GitExecutor;__export(git_executor_exports,{GitExecutor:()=>GitExecutor});var init_git_executor=__esm({"src/lib/runners/git-executor.ts"(){init_git_executor_chain(),GitExecutor=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new GitExecutorChain(this,this._scheduler,this._plugins)}chain(){return new GitExecutorChain(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function taskCallback(e,t,n=NOOP$1){t.then((e=>{n(null,e)}),(t=>{(null==t?void 0:t.task)===e&&n(t instanceof GitResponseError?addDeprecationNoticeToError(t):t,void 0)}))}function addDeprecationNoticeToError(e){let t=e=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${e} should be GitResponseError.git.${e}, this will no longer be available in version 3`),t=NOOP$1};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce((function(n,r){if(r in e)return n;return n[r]={enumerable:!1,configurable:!1,get:()=>(t(r),e.git[r])},n}),{}))}var init_task_callback=__esm({"src/lib/task-callback.ts"(){init_git_response_error(),init_utils()}});function changeWorkingDirectoryTask(e,t){return adhocExecTask((n=>{if(!folderExists(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e}))}var init_change_working_directory=__esm({"src/lib/tasks/change-working-directory.ts"(){init_utils(),init_task()}});function checkoutTask(e){const t=["checkout",...e];return"-b"===t[1]&&t.includes("-B")&&(t[1]=remove(t,"-B")),straightThroughStringTask(t)}function checkout_default(){return{checkout(){return this._runTask(checkoutTask(getTrailingOptions(arguments,1)),trailingFunctionArgument(arguments))},checkoutBranch(e,t){return this._runTask(checkoutTask(["-b",e,t,...getTrailingOptions(arguments)]),trailingFunctionArgument(arguments))},checkoutLocalBranch(e){return this._runTask(checkoutTask(["-b",e,...getTrailingOptions(arguments)]),trailingFunctionArgument(arguments))}}}var init_checkout=__esm({"src/lib/tasks/checkout.ts"(){init_utils(),init_task()}}),parser2;function countObjectsResponse(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function count_objects_default(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser:e=>parseStringResponse(countObjectsResponse(),[parser2],e)})}}}var init_count_objects=__esm({"src/lib/tasks/count-objects.ts"(){init_utils(),parser2=new LineParser(/([a-z-]+): (\d+)$/,((e,[t,n])=>{const r=asCamelCase(t);e.hasOwnProperty(r)&&(e[r]=asNumber(n))}))}}),parsers;function parseCommitResult(e){return parseStringResponse({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},parsers,e)}var init_parse_commit=__esm({"src/lib/parsers/parse-commit.ts"(){init_utils(),parsers=[new LineParser(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,((e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n})),new LineParser(/\s*Author:\s(.+)/i,((e,[t])=>{const n=t.split("<"),r=n.pop();r&&r.includes("@")&&(e.author={email:r.substr(0,r.length-1),name:n.join("<").trim()})})),new LineParser(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,((e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(r,10)||0})),new LineParser(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,((e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0;const i=parseInt(n,10)||0;"-"===r?e.summary.deletions=i:"+"===r&&(e.summary.insertions=i)}))]}});function commitTask(e,t,n){return{commands:["-c","core.abbrev=40","commit",...prefixedArray(e,"-m"),...t,...n],format:"utf-8",parser:parseCommitResult}}function commit_default(){return{commit(e,...t){const n=trailingFunctionArgument(arguments),r=function(e){return!filterStringOrStringArray(e)&&configurationErrorTask("git.commit: requires the commit message to be supplied as a string/string[]")}(e)||commitTask(asArray(e),asArray(filterType(t[0],filterStringOrStringArray,[])),[...filterType(t[1],filterArray,[]),...getTrailingOptions(arguments,0,!0)]);return this._runTask(r,n)}}}var init_commit=__esm({"src/lib/tasks/commit.ts"(){init_parse_commit(),init_utils(),init_task()}});function first_commit_default(){return{firstCommit(){return this._runTask(straightThroughStringTask(["rev-list","--max-parents=0","HEAD"],!0),trailingFunctionArgument(arguments))}}}var init_first_commit=__esm({"src/lib/tasks/first-commit.ts"(){init_utils(),init_task()}});function hashObjectTask(e,t){const n=["hash-object",e];return t&&n.push("-w"),straightThroughStringTask(n,!0)}var init_hash_object=__esm({"src/lib/tasks/hash-object.ts"(){init_task()}}),InitSummary,initResponseRegex,reInitResponseRegex;function parseInit(e,t,n){const r=String(n).trim();let i;if(i=initResponseRegex.exec(r))return new InitSummary(e,t,!1,i[1]);if(i=reInitResponseRegex.exec(r))return new InitSummary(e,t,!0,i[1]);let o="";const s=r.split(" ");for(;s.length;){if("in"===s.shift()){o=s.join(" ");break}}return new InitSummary(e,t,/^re/i.test(r),o)}var init_InitSummary=__esm({"src/lib/responses/InitSummary.ts"(){InitSummary=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},initResponseRegex=/^Init.+ repository in (.+)$/,reInitResponseRegex=/^Rein.+ in (.+)$/}}),bareCommand;function hasBareCommand(e){return e.includes(bareCommand)}function initTask(e=!1,t,n){const r=["init",...n];return e&&!hasBareCommand(r)&&r.splice(1,0,bareCommand),{commands:r,format:"utf-8",parser:e=>parseInit(r.includes("--bare"),t,e)}}var init_init=__esm({"src/lib/tasks/init.ts"(){init_InitSummary(),bareCommand="--bare"}}),logFormatRegex;function logFormatFromCommand(e){for(let t=0;tparseStringResponse(new DiffSummary,t,e,!1)}var init_parse_diff_summary=__esm({"src/lib/parsers/parse-diff-summary.ts"(){init_log_format(),init_DiffSummary(),init_diff_name_status(),init_utils(),statParser=[new LineParser(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,((e,[t,n,r=""])=>{e.files.push({file:t.trim(),changes:asNumber(n),insertions:r.replace(/[^+]/g,"").length,deletions:r.replace(/[^-]/g,"").length,binary:!1})})),new LineParser(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,((e,[t,n,r])=>{e.files.push({file:t.trim(),before:asNumber(n),after:asNumber(r),binary:!0})})),new LineParser(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,((e,[t,n])=>{const r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);e.changed=asNumber(t),e.insertions=asNumber(null==r?void 0:r[1]),e.deletions=asNumber(null==i?void 0:i[1])}))],numStatParser=[new LineParser(/(\d+)\t(\d+)\t(.+)$/,((e,[t,n,r])=>{const i=asNumber(t),o=asNumber(n);e.changed++,e.insertions+=i,e.deletions+=o,e.files.push({file:r,changes:i+o,insertions:i,deletions:o,binary:!1})})),new LineParser(/-\t-\t(.+)$/,((e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})}))],nameOnlyParser=[new LineParser(/(.+)$/,((e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})}))],nameStatusParser=[new LineParser(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,((e,[t,n,r,i,o])=>{e.changed++,e.files.push({file:null!=o?o:r,changes:0,insertions:0,deletions:0,binary:!1,status:orVoid(isDiffNameStatus(t)&&t),from:orVoid(!!o&&r!==o&&r),similarity:asNumber(n)})}))],diffSummaryParsers={"":statParser,"--stat":statParser,"--numstat":numStatParser,"--name-status":nameStatusParser,"--name-only":nameOnlyParser}}}),START_BOUNDARY,COMMIT_BOUNDARY,SPLITTER,defaultFieldNames;function lineBuilder(e,t){return t.reduce(((t,n,r)=>(t[n]=e[r]||"",t)),Object.create({diff:null}))}function createListLogSummaryParser(e=SPLITTER,t=defaultFieldNames,n=""){const r=getDiffParser(n);return function(n){const i=toLinesWithContent(n.trim(),!1,START_BOUNDARY).map((function(n){const i=n.split(COMMIT_BOUNDARY),o=lineBuilder(i[0].split(e),t);return i.length>1&&i[1].trim()&&(o.diff=r(i[1])),o}));return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var init_parse_list_log_summary=__esm({"src/lib/parsers/parse-list-log-summary.ts"(){init_utils(),init_parse_diff_summary(),init_log_format(),START_BOUNDARY="òòòòòò ",COMMIT_BOUNDARY=" òò",SPLITTER=" ò ",defaultFieldNames=["hash","date","message","refs","author_name","author_email"]}}),diff_exports={};function diffSummaryTask(e){let t=logFormatFromCommand(e);const n=["diff"];return""===t&&(t="--stat",n.push("--stat=4096")),n.push(...e),validateLogFormatConfig(n)||{commands:n,format:"utf-8",parser:getDiffParser(t)}}function validateLogFormatConfig(e){const t=e.filter(isLogFormat);return t.length>1?configurationErrorTask(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`):t.length&&e.includes("-z")?configurationErrorTask(`Summary flag ${t} parsing is not compatible with null termination option '-z'`):void 0}__export(diff_exports,{diffSummaryTask:()=>diffSummaryTask,validateLogFormatConfig:()=>validateLogFormatConfig});var init_diff=__esm({"src/lib/tasks/diff.ts"(){init_log_format(),init_parse_diff_summary(),init_task()}}),excludeOptions;function prettyFormat(e,t){const n=[],r=[];return Object.keys(e).forEach((t=>{n.push(t),r.push(String(e[t]))})),[n,r.join(t)]}function userOptions(e){return Object.keys(e).reduce(((t,n)=>(n in excludeOptions||(t[n]=e[n]),t)),{})}function parseLogOptions(e={},t=[]){const n=filterType(e.splitter,filterString,SPLITTER),r=!filterPrimitives(e.format)&&e.format?e.format:{hash:"%H",date:!1===e.strictDate?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:!1!==e.mailMap?"%aN":"%an",author_email:!1!==e.mailMap?"%aE":"%ae"},[i,o]=prettyFormat(r,n),s=[],a=[`--pretty=format:${START_BOUNDARY}${o}${COMMIT_BOUNDARY}`,...t],c=e.n||e["max-count"]||e.maxCount;if(c&&a.push(`--max-count=${c}`),e.from||e.to){const t=!1!==e.symmetric?"...":"..";s.push(`${e.from||""}${t}${e.to||""}`)}return filterString(e.file)&&a.push("--follow",pathspec(e.file)),appendTaskOptions(userOptions(e),a),{fields:i,splitter:n,commands:[...a,...s]}}function logTask(e,t,n){const r=createListLogSummaryParser(e,t,logFormatFromCommand(n));return{commands:["log",...n],format:"utf-8",parser:r}}function log_default(){return{log(...e){const t=trailingFunctionArgument(arguments),n=parseLogOptions(trailingOptionsArgument(arguments),filterType(arguments[0],filterArray)),r=function(e,t){return filterString(e)&&filterString(t)&&configurationErrorTask("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}(...e)||validateLogFormatConfig(n.commands)||function(e){return logTask(e.splitter,e.fields,e.commands)}(n);return this._runTask(r,t)}}}var init_log=__esm({"src/lib/tasks/log.ts"(){init_log_format(),init_pathspec(),init_parse_list_log_summary(),init_utils(),init_task(),init_diff(),excludeOptions=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(excludeOptions||{})}}),MergeSummaryConflict,MergeSummaryDetail,init_MergeSummary=__esm({"src/lib/responses/MergeSummary.ts"(){MergeSummaryConflict=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},MergeSummaryDetail=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),PullSummary,PullFailedSummary,init_PullSummary=__esm({"src/lib/responses/PullSummary.ts"(){PullSummary=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},PullFailedSummary=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}}),remoteMessagesObjectParsers;function objectEnumerationResult(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function asObjectCount(e){const t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:asNumber(t&&t[1]||"0"),delta:asNumber(n&&n[1]||"0")}}var init_parse_remote_objects=__esm({"src/lib/parsers/parse-remote-objects.ts"(){init_utils(),remoteMessagesObjectParsers=[new RemoteLineParser(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,((e,[t,n])=>{const r=t.toLowerCase(),i=objectEnumerationResult(e.remoteMessages);Object.assign(i,{[r]:asNumber(n)})})),new RemoteLineParser(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,((e,[t,n])=>{const r=t.toLowerCase(),i=objectEnumerationResult(e.remoteMessages);Object.assign(i,{[r]:asNumber(n)})})),new RemoteLineParser(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,((e,[t,n,r])=>{const i=objectEnumerationResult(e.remoteMessages);i.total=asObjectCount(t),i.reused=asObjectCount(n),i.packReused=asNumber(r)}))]}}),parsers2,RemoteMessageSummary;function parseRemoteMessages(e,t){return parseStringResponse({remoteMessages:new RemoteMessageSummary},parsers2,t)}var init_parse_remote_messages=__esm({"src/lib/parsers/parse-remote-messages.ts"(){init_utils(),init_parse_remote_objects(),parsers2=[new RemoteLineParser(/^remote:\s*(.+)$/,((e,[t])=>(e.remoteMessages.all.push(t.trim()),!1))),...remoteMessagesObjectParsers,new RemoteLineParser([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],((e,[t])=>{e.remoteMessages.pullRequestUrl=t})),new RemoteLineParser([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],((e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:asNumber(t),summary:n,url:r}}))],RemoteMessageSummary=class{constructor(){this.all=[]}}}}),FILE_UPDATE_REGEX,SUMMARY_REGEX,ACTION_REGEX,parsers3,errorParsers,parsePullDetail,parsePullResult;function parsePullErrorResult(e,t){const n=parseStringResponse(new PullFailedSummary,errorParsers,[e,t]);return n.message&&n}var init_parse_pull=__esm({"src/lib/parsers/parse-pull.ts"(){init_PullSummary(),init_utils(),init_parse_remote_messages(),SUMMARY_REGEX=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,ACTION_REGEX=/^(create|delete) mode \d+ (.+)/,parsers3=[new LineParser(FILE_UPDATE_REGEX=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,((e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)})),new LineParser(SUMMARY_REGEX,((e,[t,,n,,r])=>(void 0!==n||void 0!==r)&&(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+r||0,!0))),new LineParser(ACTION_REGEX,((e,[t,n])=>{append(e.files,n),append("create"===t?e.created:e.deleted,n)}))],errorParsers=[new LineParser(/^from\s(.+)$/i,((e,[t])=>{e.remote=t})),new LineParser(/^fatal:\s(.+)$/,((e,[t])=>{e.message=t})),new LineParser(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,((e,[t,n,r,i])=>{e.branch.local=r,e.hash.local=t,e.branch.remote=i,e.hash.remote=n}))],parsePullDetail=(e,t)=>parseStringResponse(new PullSummary,parsers3,[e,t]),parsePullResult=(e,t)=>Object.assign(new PullSummary,parsePullDetail(e,t),parseRemoteMessages(e,t))}}),parsers4,parseMergeResult,parseMergeDetail,init_parse_merge=__esm({"src/lib/parsers/parse-merge.ts"(){init_MergeSummary(),init_utils(),init_parse_pull(),parsers4=[new LineParser(/^Auto-merging\s+(.+)$/,((e,[t])=>{e.merges.push(t)})),new LineParser(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,((e,[t,n])=>{e.conflicts.push(new MergeSummaryConflict(t,n))})),new LineParser(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,((e,[t,n,r])=>{e.conflicts.push(new MergeSummaryConflict(t,n,{deleteRef:r}))})),new LineParser(/^CONFLICT\s+\((.+)\):/,((e,[t])=>{e.conflicts.push(new MergeSummaryConflict(t,null))})),new LineParser(/^Automatic merge failed;\s+(.+)$/,((e,[t])=>{e.result=t}))],parseMergeResult=(e,t)=>Object.assign(parseMergeDetail(e,t),parsePullResult(e,t)),parseMergeDetail=e=>parseStringResponse(new MergeSummaryDetail,parsers4,e)}});function mergeTask(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(e,t){const n=parseMergeResult(e,t);if(n.failed)throw new GitResponseError(n);return n}}:configurationErrorTask("Git.merge requires at least one option")}var init_merge=__esm({"src/lib/tasks/merge.ts"(){init_git_response_error(),init_parse_merge(),init_task()}}),parsers5,parsePushResult,parsePushDetail;function pushResultPushedItem(e,t,n){const r=n.includes("deleted"),i=n.includes("tag")||/^refs\/tags/.test(e),o=!n.includes("new");return{deleted:r,tag:i,branch:!i,new:!o,alreadyUpdated:o,local:e,remote:t}}var init_parse_push=__esm({"src/lib/parsers/parse-push.ts"(){init_utils(),init_parse_remote_messages(),parsers5=[new LineParser(/^Pushing to (.+)$/,((e,[t])=>{e.repo=t})),new LineParser(/^updating local tracking ref '(.+)'/,((e,[t])=>{e.ref=__spreadProps(__spreadValues({},e.ref||{}),{local:t})})),new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,((e,[t,n,r])=>{e.pushed.push(pushResultPushedItem(t,n,r))})),new LineParser(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,((e,[t,n,r])=>{e.branch=__spreadProps(__spreadValues({},e.branch||{}),{local:t,remote:n,remoteName:r})})),new LineParser(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,((e,[t,n,r,i])=>{e.update={head:{local:t,remote:n},hash:{from:r,to:i}}}))],parsePushResult=(e,t)=>{const n=parsePushDetail(e,t),r=parseRemoteMessages(e,t);return __spreadValues(__spreadValues({},n),r)},parsePushDetail=(e,t)=>parseStringResponse({pushed:[]},parsers5,[e,t])}}),push_exports={};function pushTagsTask(e={},t){return append(t,"--tags"),pushTask(e,t)}function pushTask(e={},t){const n=["push",...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),remove(n,"-v"),append(n,"--verbose"),append(n,"--porcelain"),{commands:n,format:"utf-8",parser:parsePushResult}}__export(push_exports,{pushTagsTask:()=>pushTagsTask,pushTask:()=>pushTask});var init_push=__esm({"src/lib/tasks/push.ts"(){init_parse_push(),init_utils()}});function show_default(){return{showBuffer(){const e=["show",...getTrailingOptions(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(straightThroughBufferTask(e),trailingFunctionArgument(arguments))},show(){const e=["show",...getTrailingOptions(arguments,1)];return this._runTask(straightThroughStringTask(e),trailingFunctionArgument(arguments))}}}var init_show=__esm({"src/lib/tasks/show.ts"(){init_utils(),init_task()}}),fromPathRegex,FileStatusSummary,init_FileStatusSummary=__esm({"src/lib/responses/FileStatusSummary.ts"(){fromPathRegex=/^(.+)\0(.+)$/,FileStatusSummary=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,"R"===t||"R"===n){const t=fromPathRegex.exec(e)||[null,e,e];this.from=t[2]||"",this.path=t[1]||""}}}}}),StatusSummary,parsers6,parseStatusSummary;function renamedFile(e){const[t,n]=e.split(NULL);return{from:n||t,to:t}}function parser3(e,t,n){return[`${e}${t}`,n]}function conflicts(e,...t){return t.map((t=>parser3(e,t,((e,t)=>append(e.conflicted,t)))))}function splitLine(e,t){const n=t.trim();switch(" "){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.substr(3));case n.charAt(1):return r(" ",n.charAt(0),n.substr(2));default:return}function r(t,n,r){const i=`${t}${n}`,o=parsers6.get(i);o&&o(e,r),"##"!==i&&"!!"!==i&&e.files.push(new FileStatusSummary(r,t,n))}}var init_StatusSummary=__esm({"src/lib/responses/StatusSummary.ts"(){init_utils(),init_FileStatusSummary(),StatusSummary=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},parsers6=new Map([parser3(" ","A",((e,t)=>append(e.created,t))),parser3(" ","D",((e,t)=>append(e.deleted,t))),parser3(" ","M",((e,t)=>append(e.modified,t))),parser3("A"," ",((e,t)=>append(e.created,t)&&append(e.staged,t))),parser3("A","M",((e,t)=>append(e.created,t)&&append(e.staged,t)&&append(e.modified,t))),parser3("D"," ",((e,t)=>append(e.deleted,t)&&append(e.staged,t))),parser3("M"," ",((e,t)=>append(e.modified,t)&&append(e.staged,t))),parser3("M","M",((e,t)=>append(e.modified,t)&&append(e.staged,t))),parser3("R"," ",((e,t)=>{append(e.renamed,renamedFile(t))})),parser3("R","M",((e,t)=>{const n=renamedFile(t);append(e.renamed,n),append(e.modified,n.to)})),parser3("!","!",((e,t)=>{append(e.ignored=e.ignored||[],t)})),parser3("?","?",((e,t)=>append(e.not_added,t))),...conflicts("A","A","U"),...conflicts("D","D","U"),...conflicts("U","A","D","U"),["##",(e,t)=>{let n;n=/ahead (\d+)/.exec(t),e.ahead=n&&+n[1]||0,n=/behind (\d+)/.exec(t),e.behind=n&&+n[1]||0,n=/^(.+?(?=(?:\.{3}|\s|$)))/.exec(t),e.current=n&&n[1],n=/\.{3}(\S*)/.exec(t),e.tracking=n&&n[1],n=/\son\s([\S]+)$/.exec(t),e.current=n&&n[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),parseStatusSummary=function(e){const t=e.split(NULL),n=new StatusSummary;for(let e=0,r=t.length;e!ignoredOptions.includes(e)))],parser:e=>parseStatusSummary(e)}}var init_status=__esm({"src/lib/tasks/status.ts"(){init_StatusSummary(),ignoredOptions=["--null","-z"]}}),NOT_INSTALLED,parsers7;function versionResponse(e=0,t=0,n=0,r="",i=!0){return Object.defineProperty({major:e,minor:t,patch:n,agent:r,installed:i},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function notInstalledResponse(){return versionResponse(0,0,0,"",!1)}function version_default(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:versionParser,onError(e,t,n,r){if(-2===e.exitCode)return n(Buffer.from(NOT_INSTALLED));r(t)}})}}}function versionParser(e){return e===NOT_INSTALLED?notInstalledResponse():parseStringResponse(versionResponse(0,0,0,e),parsers7,e)}var init_version=__esm({"src/lib/tasks/version.ts"(){init_utils(),NOT_INSTALLED="installed=false",parsers7=[new LineParser(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,((e,[t,n,r,i=""])=>{Object.assign(e,versionResponse(asNumber(t),asNumber(n),asNumber(r),i))})),new LineParser(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,((e,[t,n,r,i=""])=>{Object.assign(e,versionResponse(asNumber(t),asNumber(n),r,i))}))]}}),simple_git_api_exports={},SimpleGitApi;__export(simple_git_api_exports,{SimpleGitApi:()=>SimpleGitApi});var init_simple_git_api=__esm({"src/lib/simple-git-api.ts"(){init_task_callback(),init_change_working_directory(),init_checkout(),init_count_objects(),init_commit(),init_config(),init_first_commit(),init_grep(),init_hash_object(),init_init(),init_log(),init_merge(),init_push(),init_show(),init_status(),init_task(),init_version(),init_utils(),SimpleGitApi=class{constructor(e){this._executor=e}_runTask(e,t){const n=this._executor.chain(),r=n.push(e);return t&&taskCallback(e,r,t),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(e){return this._runTask(straightThroughStringTask(["add",...asArray(e)]),trailingFunctionArgument(arguments))}cwd(e){const t=trailingFunctionArgument(arguments);return"string"==typeof e?this._runTask(changeWorkingDirectoryTask(e,this._executor),t):"string"==typeof(null==e?void 0:e.path)?this._runTask(changeWorkingDirectoryTask(e.path,e.root&&this._executor||void 0),t):this._runTask(configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(hashObjectTask(e,!0===t),trailingFunctionArgument(arguments))}init(e){return this._runTask(initTask(!0===e,this._executor.cwd,getTrailingOptions(arguments)),trailingFunctionArgument(arguments))}merge(){return this._runTask(mergeTask(getTrailingOptions(arguments)),trailingFunctionArgument(arguments))}mergeFromTo(e,t){return filterString(e)&&filterString(t)?this._runTask(mergeTask([e,t,...getTrailingOptions(arguments)]),trailingFunctionArgument(arguments,!1)):this._runTask(configurationErrorTask("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){const e=pushTask({remote:filterType(arguments[0],filterString),branch:filterType(arguments[1],filterString)},getTrailingOptions(arguments));return this._runTask(e,trailingFunctionArgument(arguments))}stash(){return this._runTask(straightThroughStringTask(["stash",...getTrailingOptions(arguments)]),trailingFunctionArgument(arguments))}status(){return this._runTask(statusTask(getTrailingOptions(arguments)),trailingFunctionArgument(arguments))}},Object.assign(SimpleGitApi.prototype,checkout_default(),commit_default(),config_default(),count_objects_default(),first_commit_default(),grep_default(),log_default(),show_default(),version_default())}}),scheduler_exports={},createScheduledTask,Scheduler;__export(scheduler_exports,{Scheduler:()=>Scheduler});var init_scheduler=__esm({"src/lib/runners/scheduler.ts"(){init_utils(),init_git_logger(),createScheduledTask=(()=>{let e=0;return()=>{e++;const{promise:t,done:n}=distExports$1.createDeferred();return{promise:t,done:n,id:e}}})(),Scheduler=class{constructor(e=2){this.concurrency=e,this.logger=createLogger("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency)return void this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);const e=append(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done((()=>{this.logger("Completing id=",e.id),remove(this.running,e),this.schedule()}))}next(){const{promise:e,id:t}=append(this.pending,createScheduledTask());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),apply_patch_exports={};function applyPatchTask(e,t){return straightThroughStringTask(["apply",...t,...e])}__export(apply_patch_exports,{applyPatchTask:()=>applyPatchTask});var init_apply_patch=__esm({"src/lib/tasks/apply-patch.ts"(){init_task()}}),BranchDeletionBatch;function branchDeletionSuccess(e,t){return{branch:e,hash:t,success:!0}}function branchDeletionFailure(e){return{branch:e,hash:null,success:!1}}var init_BranchDeleteSummary=__esm({"src/lib/responses/BranchDeleteSummary.ts"(){BranchDeletionBatch=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}}),deleteSuccessRegex,deleteErrorRegex,parsers8,parseBranchDeletions;function hasBranchDeletionError(e,t){return 1===t&&deleteErrorRegex.test(e)}var init_parse_branch_delete=__esm({"src/lib/parsers/parse-branch-delete.ts"(){init_BranchDeleteSummary(),init_utils(),deleteErrorRegex=/^error[^']+'([^']+)'/m,parsers8=[new LineParser(deleteSuccessRegex=/(\S+)\s+\(\S+\s([^)]+)\)/,((e,[t,n])=>{const r=branchDeletionSuccess(t,n);e.all.push(r),e.branches[t]=r})),new LineParser(deleteErrorRegex,((e,[t])=>{const n=branchDeletionFailure(t);e.errors.push(n),e.all.push(n),e.branches[t]=n}))],parseBranchDeletions=(e,t)=>parseStringResponse(new BranchDeletionBatch,parsers8,[e,t])}}),BranchSummaryResult,init_BranchSummary=__esm({"src/lib/responses/BranchSummary.ts"(){BranchSummaryResult=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,n,r,i){"*"===e&&(this.detached=t,this.current=n),this.all.push(n),this.branches[n]={current:"*"===e,linkedWorkTree:"+"===e,name:n,commit:r,label:i}}}}}),parsers9;function branchStatus(e){return e?e.charAt(0):""}function parseBranchSummary(e){return parseStringResponse(new BranchSummaryResult,parsers9,e)}var init_parse_branch=__esm({"src/lib/parsers/parse-branch.ts"(){init_BranchSummary(),init_utils(),parsers9=[new LineParser(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,((e,[t,n,r,i])=>{e.push(branchStatus(t),!0,n,r,i)})),new LineParser(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),((e,[t,n,r,i])=>{e.push(branchStatus(t),!1,n,r,i)}))]}}),branch_exports={};function containsDeleteBranchCommand(e){const t=["-d","-D","--delete"];return e.some((e=>t.includes(e)))}function branchTask(e){const t=containsDeleteBranchCommand(e),n=["branch",...e];return 1===n.length&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser:(e,n)=>t?parseBranchDeletions(e,n).all[0]:parseBranchSummary(e)}}function branchLocalTask(){return{format:"utf-8",commands:["branch","-v"],parser:parseBranchSummary}}function deleteBranchesTask(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser:(e,t)=>parseBranchDeletions(e,t),onError({exitCode:e,stdOut:t},n,r,i){if(!hasBranchDeletionError(String(n),e))return i(n);r(t)}}}function deleteBranchTask(e,t=!1){const n={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser:(t,n)=>parseBranchDeletions(t,n).branches[e],onError({exitCode:e,stdErr:t,stdOut:r},i,o,s){if(!hasBranchDeletionError(String(i),e))return s(i);throw new GitResponseError(n.parser(bufferToString(r),bufferToString(t)),String(i))}};return n}__export(branch_exports,{branchLocalTask:()=>branchLocalTask,branchTask:()=>branchTask,containsDeleteBranchCommand:()=>containsDeleteBranchCommand,deleteBranchTask:()=>deleteBranchTask,deleteBranchesTask:()=>deleteBranchesTask});var init_branch=__esm({"src/lib/tasks/branch.ts"(){init_git_response_error(),init_parse_branch_delete(),init_parse_branch(),init_utils()}}),parseCheckIgnore,init_CheckIgnore=__esm({"src/lib/responses/CheckIgnore.ts"(){parseCheckIgnore=e=>e.split(/\n/g).map((e=>e.trim())).filter((e=>!!e))}}),check_ignore_exports={};function checkIgnoreTask(e){return{commands:["check-ignore",...e],format:"utf-8",parser:parseCheckIgnore}}__export(check_ignore_exports,{checkIgnoreTask:()=>checkIgnoreTask});var init_check_ignore=__esm({"src/lib/tasks/check-ignore.ts"(){init_CheckIgnore()}}),clone_exports={};function disallowedCommand(e){return/^--upload-pack(=|$)/.test(e)}function cloneTask(e,t,n){const r=["clone",...n];filterString(e)&&r.push(e),filterString(t)&&r.push(t);return r.find(disallowedCommand)?configurationErrorTask("git.fetch: potential exploit argument blocked."):straightThroughStringTask(r)}function cloneMirrorTask(e,t,n){return append(n,"--mirror"),cloneTask(e,t,n)}__export(clone_exports,{cloneMirrorTask:()=>cloneMirrorTask,cloneTask:()=>cloneTask});var init_clone=__esm({"src/lib/tasks/clone.ts"(){init_task(),init_utils()}}),parsers10;function parseFetchResult(e,t){return parseStringResponse({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},parsers10,[e,t])}var init_parse_fetch=__esm({"src/lib/parsers/parse-fetch.ts"(){init_utils(),parsers10=[new LineParser(/From (.+)$/,((e,[t])=>{e.remote=t})),new LineParser(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,((e,[t,n])=>{e.branches.push({name:t,tracking:n})})),new LineParser(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,((e,[t,n])=>{e.tags.push({name:t,tracking:n})})),new LineParser(/- \[deleted]\s+\S+\s*-> (.+)$/,((e,[t])=>{e.deleted.push({tracking:t})})),new LineParser(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,((e,[t,n,r,i])=>{e.updated.push({name:r,tracking:i,to:n,from:t})}))]}}),fetch_exports={};function disallowedCommand2(e){return/^--upload-pack(=|$)/.test(e)}function fetchTask(e,t,n){const r=["fetch",...n];e&&t&&r.push(e,t);return r.find(disallowedCommand2)?configurationErrorTask("git.fetch: potential exploit argument blocked."):{commands:r,format:"utf-8",parser:parseFetchResult}}__export(fetch_exports,{fetchTask:()=>fetchTask});var init_fetch=__esm({"src/lib/tasks/fetch.ts"(){init_parse_fetch(),init_task()}}),parsers11;function parseMoveResult(e){return parseStringResponse({moves:[]},parsers11,e)}var init_parse_move=__esm({"src/lib/parsers/parse-move.ts"(){init_utils(),parsers11=[new LineParser(/^Renaming (.+) to (.+)$/,((e,[t,n])=>{e.moves.push({from:t,to:n})}))]}}),move_exports={};function moveTask(e,t){return{commands:["mv","-v",...asArray(e),t],format:"utf-8",parser:parseMoveResult}}__export(move_exports,{moveTask:()=>moveTask});var init_move=__esm({"src/lib/tasks/move.ts"(){init_parse_move(),init_utils()}}),pull_exports={};function pullTask(e,t,n){const r=["pull",...n];return e&&t&&r.splice(1,0,e,t),{commands:r,format:"utf-8",parser:(e,t)=>parsePullResult(e,t),onError(e,t,n,r){const i=parsePullErrorResult(bufferToString(e.stdOut),bufferToString(e.stdErr));if(i)return r(new GitResponseError(i));r(t)}}}__export(pull_exports,{pullTask:()=>pullTask});var init_pull=__esm({"src/lib/tasks/pull.ts"(){init_git_response_error(),init_parse_pull(),init_utils()}});function parseGetRemotes(e){const t={};return forEach$1(e,(([e])=>t[e]={name:e})),Object.values(t)}function parseGetRemotesVerbose(e){const t={};return forEach$1(e,(([e,n,r])=>{t.hasOwnProperty(e)||(t[e]={name:e,refs:{fetch:"",push:""}}),r&&n&&(t[e].refs[r.replace(/[^a-z]/g,"")]=n)})),Object.values(t)}function forEach$1(e,t){forEachLineWithContent(e,(e=>t(e.split(/\s+/))))}var init_GetRemoteSummary=__esm({"src/lib/responses/GetRemoteSummary.ts"(){init_utils()}}),remote_exports={};function addRemoteTask(e,t,n){return straightThroughStringTask(["remote","add",...n,e,t])}function getRemotesTask(e){const t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?parseGetRemotesVerbose:parseGetRemotes}}function listRemotesTask(e){const t=[...e];return"ls-remote"!==t[0]&&t.unshift("ls-remote"),straightThroughStringTask(t)}function remoteTask(e){const t=[...e];return"remote"!==t[0]&&t.unshift("remote"),straightThroughStringTask(t)}function removeRemoteTask(e){return straightThroughStringTask(["remote","remove",e])}__export(remote_exports,{addRemoteTask:()=>addRemoteTask,getRemotesTask:()=>getRemotesTask,listRemotesTask:()=>listRemotesTask,remoteTask:()=>remoteTask,removeRemoteTask:()=>removeRemoteTask});var init_remote=__esm({"src/lib/tasks/remote.ts"(){init_GetRemoteSummary(),init_task()}}),stash_list_exports={};function stashListTask(e={},t){const n=parseLogOptions(e),r=["stash","list",...n.commands,...t],i=createListLogSummaryParser(n.splitter,n.fields,logFormatFromCommand(r));return validateLogFormatConfig(r)||{commands:r,format:"utf-8",parser:i}}__export(stash_list_exports,{stashListTask:()=>stashListTask});var init_stash_list=__esm({"src/lib/tasks/stash-list.ts"(){init_log_format(),init_parse_list_log_summary(),init_diff(),init_log()}}),sub_module_exports={};function addSubModuleTask(e,t){return subModuleTask(["add",e,t])}function initSubModuleTask(e){return subModuleTask(["init",...e])}function subModuleTask(e){const t=[...e];return"submodule"!==t[0]&&t.unshift("submodule"),straightThroughStringTask(t)}function updateSubModuleTask(e){return subModuleTask(["update",...e])}__export(sub_module_exports,{addSubModuleTask:()=>addSubModuleTask,initSubModuleTask:()=>initSubModuleTask,subModuleTask:()=>subModuleTask,updateSubModuleTask:()=>updateSubModuleTask});var init_sub_module=__esm({"src/lib/tasks/sub-module.ts"(){init_task()}}),TagList,parseTagList;function singleSorted(e,t){const n=isNaN(e);return n!==isNaN(t)?n?1:-1:n?sorted(e,t):0}function sorted(e,t){return e===t?0:e>t?1:-1}function trimmed(e){return e.trim()}function toNumber(e){return"string"==typeof e&&parseInt(e.replace(/^\D+/g,""),10)||0}var init_TagList=__esm({"src/lib/responses/TagList.ts"(){TagList=class{constructor(e,t){this.all=e,this.latest=t}},parseTagList=function(e,t=!1){const n=e.split("\n").map(trimmed).filter(Boolean);t||n.sort((function(e,t){const n=e.split("."),r=t.split(".");if(1===n.length||1===r.length)return singleSorted(toNumber(n[0]),toNumber(r[0]));for(let e=0,t=Math.max(n.length,r.length);ee.indexOf(".")>=0));return new TagList(n,r)}}}),tag_exports={};function tagListTask(e=[]){const t=e.some((e=>/^--sort=/.test(e)));return{format:"utf-8",commands:["tag","-l",...e],parser:e=>parseTagList(e,t)}}function addTagTask(e){return{format:"utf-8",commands:["tag",e],parser:()=>({name:e})}}function addAnnotatedTagTask(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser:()=>({name:e})}}__export(tag_exports,{addAnnotatedTagTask:()=>addAnnotatedTagTask,addTagTask:()=>addTagTask,tagListTask:()=>tagListTask});var init_tag=__esm({"src/lib/tasks/tag.ts"(){init_TagList()}}),require_git=__commonJS({"src/git.js"(e,t){var{GitExecutor:n}=(init_git_executor(),__toCommonJS(git_executor_exports)),{SimpleGitApi:r}=(init_simple_git_api(),__toCommonJS(simple_git_api_exports)),{Scheduler:i}=(init_scheduler(),__toCommonJS(scheduler_exports)),{configurationErrorTask:o}=(init_task(),__toCommonJS(task_exports)),{asArray:s,filterArray:a,filterPrimitives:c,filterString:l,filterStringOrStringArray:u,filterType:d,getTrailingOptions:p,trailingFunctionArgument:f,trailingOptionsArgument:_}=(init_utils(),__toCommonJS(utils_exports)),{applyPatchTask:m}=(init_apply_patch(),__toCommonJS(apply_patch_exports)),{branchTask:h,branchLocalTask:g,deleteBranchesTask:A,deleteBranchTask:y}=(init_branch(),__toCommonJS(branch_exports)),{checkIgnoreTask:v}=(init_check_ignore(),__toCommonJS(check_ignore_exports)),{checkIsRepoTask:b}=(init_check_is_repo(),__toCommonJS(check_is_repo_exports)),{cloneTask:C,cloneMirrorTask:E}=(init_clone(),__toCommonJS(clone_exports)),{cleanWithOptionsTask:x,isCleanOptionsArray:S}=(init_clean(),__toCommonJS(clean_exports)),{diffSummaryTask:k}=(init_diff(),__toCommonJS(diff_exports)),{fetchTask:D}=(init_fetch(),__toCommonJS(fetch_exports)),{moveTask:w}=(init_move(),__toCommonJS(move_exports)),{pullTask:I}=(init_pull(),__toCommonJS(pull_exports)),{pushTagsTask:T}=(init_push(),__toCommonJS(push_exports)),{addRemoteTask:F,getRemotesTask:R,listRemotesTask:P,remoteTask:N,removeRemoteTask:B}=(init_remote(),__toCommonJS(remote_exports)),{getResetMode:O,resetTask:q}=(init_reset(),__toCommonJS(reset_exports)),{stashListTask:$}=(init_stash_list(),__toCommonJS(stash_list_exports)),{addSubModuleTask:Q,initSubModuleTask:L,subModuleTask:M,updateSubModuleTask:j}=(init_sub_module(),__toCommonJS(sub_module_exports)),{addAnnotatedTagTask:U,addTagTask:J,tagListTask:V}=(init_tag(),__toCommonJS(tag_exports)),{straightThroughBufferTask:H,straightThroughStringTask:G}=(init_task(),__toCommonJS(task_exports));function W(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}function z(e,t,n,r){return"string"!=typeof n?o(`git.${e}() requires a string 'repoPath'`):t(n,d(r,l),p(arguments))}(W.prototype=Object.create(r.prototype)).constructor=W,W.prototype.customBinary=function(e){return this._plugins.reconfigure("binary",e),this},W.prototype.env=function(e,t){return 1===arguments.length&&"object"==typeof e?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},W.prototype.stashList=function(e){return this._runTask($(_(arguments)||{},a(e)&&e||[]),f(arguments))},W.prototype.clone=function(){return this._runTask(z("clone",C,...arguments),f(arguments))},W.prototype.mirror=function(){return this._runTask(z("mirror",E,...arguments),f(arguments))},W.prototype.mv=function(e,t){return this._runTask(w(e,t),f(arguments))},W.prototype.checkoutLatestTag=function(e){var t=this;return this.pull((function(){t.tags((function(n,r){t.checkout(r.latest,e)}))}))},W.prototype.pull=function(e,t,n,r){return this._runTask(I(d(e,l),d(t,l),p(arguments)),f(arguments))},W.prototype.fetch=function(e,t){return this._runTask(D(d(e,l),d(t,l),p(arguments)),f(arguments))},W.prototype.silent=function(e){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},W.prototype.tags=function(e,t){return this._runTask(V(p(arguments)),f(arguments))},W.prototype.rebase=function(){return this._runTask(G(["rebase",...p(arguments)]),f(arguments))},W.prototype.reset=function(e){return this._runTask(q(O(e),p(arguments)),f(arguments))},W.prototype.revert=function(e){const t=f(arguments);return"string"!=typeof e?this._runTask(o("Commit must be a string"),t):this._runTask(G(["revert",...p(arguments,0,!0),e]),t)},W.prototype.addTag=function(e){const t="string"==typeof e?J(e):o("Git.addTag requires a tag name");return this._runTask(t,f(arguments))},W.prototype.addAnnotatedTag=function(e,t){return this._runTask(U(e,t),f(arguments))},W.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(y(e,"boolean"==typeof t&&t),f(arguments))},W.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(A(e,"boolean"==typeof t&&t),f(arguments))},W.prototype.branch=function(e,t){return this._runTask(h(p(arguments)),f(arguments))},W.prototype.branchLocal=function(e){return this._runTask(g(),f(arguments))},W.prototype.raw=function(e){const t=!Array.isArray(e),n=[].slice.call(t?arguments:e,0);for(let e=0;ee.removeEventListener("abort",r)))}};return[{type:"spawn.before",action(t,n){e.aborted&&n.kill(new GitPluginError(void 0,"abort","Abort already signaled"))}},t]}function isConfigSwitch(e){return"string"==typeof e&&"-c"===e.trim().toLowerCase()}function preventProtocolOverride(e,t){if(isConfigSwitch(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new GitPluginError(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function preventUploadPack(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new GitPluginError(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if("clone"===t&&/^\s*-u\b/.test(e))throw new GitPluginError(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if("push"===t&&/^\s*--exec\b/.test(e))throw new GitPluginError(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function blockUnsafeOperationsPlugin({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action:(n,r)=>(n.forEach(((i,o)=>{const s=o[...t,...e]}}init_git_response_error(),init_task_configuration_error(),init_check_is_repo(),init_clean(),init_config(),init_diff_name_status(),init_grep(),init_reset(),init_utils(),init_utils();var never=distExports$1.deferred().promise;function completionDetectionPlugin({onClose:e=!0,onExit:t=50}={}){function n(e,t,n){!1!==e&&(!0===e?t.promise:t.promise.then((()=>delay(e)))).then(n.done)}return{type:"spawn.after",action(r,i){return __async(this,arguments,(function*(r,{spawned:i,close:o}){var s,a;const c=function(){let r=-1;const i={close:distExports$1.deferred(),closeTimeout:distExports$1.deferred(),exit:distExports$1.deferred(),exitTimeout:distExports$1.deferred()},o=Promise.race([!1===e?never:i.closeTimeout.promise,!1===t?never:i.exitTimeout.promise]);return n(e,i.close,i.closeTimeout),n(t,i.exit,i.exitTimeout),{close(e){r=e,i.close.done()},exit(e){r=e,i.exit.done()},get exitCode(){return r},result:o}}();let l=!0,u=()=>{l=!1};null==(s=i.stdout)||s.on("data",u),null==(a=i.stderr)||a.on("data",u),i.on("error",u),i.on("close",(e=>c.close(e))),i.on("exit",(e=>c.exit(e)));try{yield c.result,l&&(yield delay(50)),o(c.exitCode)}catch(e){o(c.exitCode,e)}}))}}}init_utils();var WRONG_NUMBER_ERR="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",WRONG_CHARS_ERR="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function isBadArgument(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function toBinaryConfig(e,t){if(e.length<1||e.length>2)throw new GitPluginError(void 0,"binary",WRONG_NUMBER_ERR);if(e.some(isBadArgument)){if(!t)throw new GitPluginError(void 0,"binary",WRONG_CHARS_ERR);console.warn(WRONG_CHARS_ERR)}const[n,r]=e;return{binary:n,prefix:r}}function customBinaryPlugin(e,t=["git"],n=!1){let r=toBinaryConfig(asArray(t),n);e.on("binary",(e=>{r=toBinaryConfig(asArray(e),n)})),e.append("spawn.binary",(()=>r.binary)),e.append("spawn.args",(e=>r.prefix?[r.prefix,...e]:e))}function isTaskError(e){return!(!e.exitCode||!e.stdErr.length)}function getErrorMessage(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function errorDetectionHandler(e=!1,t=isTaskError,n=getErrorMessage){return(r,i)=>!e&&r||!t(i)?r:n(i)}function errorDetectionPlugin(e){return{type:"task.error",action(t,n){const r=e(t.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new GitError(void 0,r.toString("utf-8"))}:{error:r}}}}init_git_error(),init_utils();var PluginStore=class{constructor(){this.plugins=new Set,this.events=new EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){const n=append(this.plugins,{type:e,action:t});return()=>this.plugins.delete(n)}add(e){const t=[];return asArray(e).forEach((e=>e&&this.plugins.add(append(t,e)))),()=>{t.forEach((e=>this.plugins.delete(e)))}}exec(e,t,n){let r=t;const i=Object.freeze(Object.create(n));for(const t of this.plugins)t.type===e&&(r=t.action(r,i));return r}};function progressMonitorPlugin(e){const t="--progress",n=["checkout","clone","fetch","pull","push"],r={type:"spawn.args",action:(e,r)=>n.includes(r.method)?including(e,t):e};return[r,{type:"spawn.after",action(n,r){var i;r.commands.includes(t)&&(null==(i=r.spawned.stderr)||i.on("data",(t=>{const n=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString("utf8"));n&&e({method:r.method,stage:progressEventStage(n[1]),progress:asNumber(n[2]),processed:asNumber(n[3]),total:asNumber(n[4])})})))}}]}function progressEventStage(e){return String(e.toLowerCase().split(" ",1))||"unknown"}function spawnOptionsPlugin(e){const t=pick(e,["uid","gid"]);return{type:"spawn.options",action:e=>__spreadValues(__spreadValues({},t),e)}}function timeoutPlugin({block:e,stdErr:t=!0,stdOut:n=!0}){if(e>0)return{type:"spawn.after",action(r,i){var o,s;let a;function c(){a&&clearTimeout(a),a=setTimeout(u,e)}function l(){var e,t;null==(e=i.spawned.stdout)||e.off("data",c),null==(t=i.spawned.stderr)||t.off("data",c),i.spawned.off("exit",l),i.spawned.off("close",l),a&&clearTimeout(a)}function u(){l(),i.kill(new GitPluginError(void 0,"timeout","block timeout reached"))}n&&(null==(o=i.spawned.stdout)||o.on("data",c)),t&&(null==(s=i.spawned.stderr)||s.on("data",c)),i.spawned.on("exit",l),i.spawned.on("close",l),c()}}}function suffixPathsPlugin(){return{type:"spawn.args",action(e){const t=[];let n;function r(e){(n=n||[]).push(...e)}for(let n=0;nisPathSpec(e)&&toPaths(e)||e)));break}t.push(i)}}return n?[...t,"--",...n.map(String)]:t}}}init_utils(),init_utils(),init_pathspec(),init_utils();var Git=require_git();function gitInstanceFactory(e,t){var n;const r=new PluginStore,i=createInstanceConfig(e&&("string"==typeof e?{baseDir:e}:e)||{},t);if(!folderExists(i.baseDir))throw new GitConstructError(i,"Cannot use simple-git on a directory that does not exist");return Array.isArray(i.config)&&r.add(commandConfigPrefixingPlugin(i.config)),r.add(blockUnsafeOperationsPlugin(i.unsafe)),r.add(suffixPathsPlugin()),r.add(completionDetectionPlugin(i.completion)),i.abort&&r.add(abortPlugin(i.abort)),i.progress&&r.add(progressMonitorPlugin(i.progress)),i.timeout&&r.add(timeoutPlugin(i.timeout)),i.spawnOptions&&r.add(spawnOptionsPlugin(i.spawnOptions)),r.add(errorDetectionPlugin(errorDetectionHandler(!0))),i.errors&&r.add(errorDetectionPlugin(i.errors)),customBinaryPlugin(r,i.binary,null==(n=i.unsafe)?void 0:n.allowUnsafeCustomBinary),new Git(i,r)}init_git_response_error();var simpleGit=gitInstanceFactory,polyfills,hasRequiredPolyfills,legacyStreams,hasRequiredLegacyStreams,clone_1$1,hasRequiredClone$1,gracefulFs,hasRequiredGracefulFs;function requirePolyfills(){if(hasRequiredPolyfills)return polyfills;hasRequiredPolyfills=1;var e=require$$0$n,t=process.cwd,n=null,r=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return n||(n=t.call(process)),n};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var i=process.chdir;process.chdir=function(e){n=null,i.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,i)}return polyfills=function(t){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(t){t.lchmod=function(n,r,i){t.open(n,e.O_WRONLY|e.O_SYMLINK,r,(function(e,n){e?i&&i(e):t.fchmod(n,r,(function(e){t.close(n,(function(t){i&&i(e||t)}))}))}))},t.lchmodSync=function(n,r){var i,o=t.openSync(n,e.O_WRONLY|e.O_SYMLINK,r),s=!0;try{i=t.fchmodSync(o,r),s=!1}finally{if(s)try{t.closeSync(o)}catch(e){}else t.closeSync(o)}return i}}(t);t.lutimes||function(t){e.hasOwnProperty("O_SYMLINK")&&t.futimes?(t.lutimes=function(n,r,i,o){t.open(n,e.O_SYMLINK,(function(e,n){e?o&&o(e):t.futimes(n,r,i,(function(e){t.close(n,(function(t){o&&o(e||t)}))}))}))},t.lutimesSync=function(n,r,i){var o,s=t.openSync(n,e.O_SYMLINK),a=!0;try{o=t.futimesSync(s,r,i),a=!1}finally{if(a)try{t.closeSync(s)}catch(e){}else t.closeSync(s)}return o}):t.futimes&&(t.lutimes=function(e,t,n,r){r&&process.nextTick(r)},t.lutimesSync=function(){})}(t);t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(e,t,n){n&&process.nextTick(n)},t.lchmodSync=function(){});t.chown&&!t.lchown&&(t.lchown=function(e,t,n,r){r&&process.nextTick(r)},t.lchownSync=function(){});"win32"===r&&(t.rename="function"!=typeof t.rename?t.rename:function(e){function n(n,r,i){var o=Date.now(),s=0;e(n,r,(function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){t.stat(r,(function(t,o){t&&"ENOENT"===t.code?e(n,r,a):i(c)}))}),s),void(s<100&&(s+=10));i&&i(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,e),n}(t.rename));function n(e){return e?function(n,r,i){return e.call(t,n,r,(function(e){l(e)&&(e=null),i&&i.apply(this,arguments)}))}:e}function i(e){return e?function(n,r){try{return e.call(t,n,r)}catch(e){if(!l(e))throw e}}:e}function o(e){return e?function(n,r,i,o){return e.call(t,n,r,i,(function(e){l(e)&&(e=null),o&&o.apply(this,arguments)}))}:e}function s(e){return e?function(n,r,i){try{return e.call(t,n,r,i)}catch(e){if(!l(e))throw e}}:e}function a(e){return e?function(n,r,i){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof r&&(i=r,r=null),r?e.call(t,n,r,o):e.call(t,n,o)}:e}function c(e){return e?function(n,r){var i=r?e.call(t,n,r):e.call(t,n);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}:e}function l(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}t.read="function"!=typeof t.read?t.read:function(e){function n(n,r,i,o,s,a){var c;if(a&&"function"==typeof a){var l=0;c=function(u,d,p){if(u&&"EAGAIN"===u.code&&l<10)return l++,e.call(t,n,r,i,o,s,c);a.apply(this,arguments)}}return e.call(t,n,r,i,o,s,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,e),n}(t.read),t.readSync="function"!=typeof t.readSync?t.readSync:(u=t.readSync,function(e,n,r,i,o){for(var s=0;;)try{return u.call(t,e,n,r,i,o)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}});var u},polyfills}function requireLegacyStreams(){if(hasRequiredLegacyStreams)return legacyStreams;hasRequiredLegacyStreams=1;var e=require$$0$b.Stream;return legacyStreams=function(t){return{ReadStream:function n(r,i){if(!(this instanceof n))return new n(r,i);e.call(this);var o=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,i=i||{};for(var s=Object.keys(i),a=0,c=s.length;athis.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){o._read()}));t.open(this.path,this.flags,this.mode,(function(e,t){if(e)return o.emit("error",e),void(o.readable=!1);o.fd=t,o.emit("open",t),o._read()}))},WriteStream:function n(r,i){if(!(this instanceof n))return new n(r,i);e.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}},legacyStreams}function requireClone$1(){if(hasRequiredClone$1)return clone_1$1;hasRequiredClone$1=1,clone_1$1=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var n={__proto__:e(t)};else n=Object.create(null);return Object.getOwnPropertyNames(t).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})),n};var e=Object.getPrototypeOf||function(e){return e.__proto__};return clone_1$1}function requireGracefulFs(){if(hasRequiredGracefulFs)return gracefulFs;hasRequiredGracefulFs=1;var e,t,n=require$$0$7,r=requirePolyfills(),i=requireLegacyStreams(),o=requireClone$1(),s=require$$0__default;function a(t,n){Object.defineProperty(t,e,{get:function(){return n}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(e=Symbol.for("graceful-fs.queue"),t=Symbol.for("graceful-fs.previous")):(e="___graceful-fs.queue",t="___graceful-fs.previous");var c,l=function(){};if(s.debuglog?l=s.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(l=function(){var e=s.format.apply(s,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!n[e]){var u=commonjsGlobal[e]||[];a(n,u),n.close=function(e){function r(t,r){return e.call(n,t,(function(e){e||f(),"function"==typeof r&&r.apply(this,arguments)}))}return Object.defineProperty(r,t,{value:e}),r}(n.close),n.closeSync=function(e){function r(t){e.apply(n,arguments),f()}return Object.defineProperty(r,t,{value:e}),r}(n.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){l(n[e]),require$$0$f.equal(n[e].length,0)}))}function d(e){r(e),e.gracefulify=d,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,i,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):p([e,[n,r,i],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,o,s){return n(t,r,i,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):p([e,[t,r,i,o],n,s||Date.now(),Date.now()])}))}(e,t,r,i)};var o=e.appendFile;o&&(e.appendFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=null);return function e(t,n,r,i,s){return o(t,n,r,(function(o){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof i&&i.apply(this,arguments):p([e,[t,n,r,i],o,s||Date.now(),Date.now()])}))}(e,t,n,r)});var s=e.copyFile;s&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,i,o){return s(t,n,r,(function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):p([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)});var a=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=c.test(process.version)?function(e,t,n,r){return a(e,i(e,t,n,r))}:function(e,t,n,r){return a(e,t,i(e,t,n,r))};return r(e,t,n);function i(e,t,n,i){return function(o,s){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(s&&s.sort&&s.sort(),"function"==typeof n&&n.call(this,o,s)):p([r,[e,t,n],o,i||Date.now(),Date.now()])}}};var c=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var l=i(e);h=l.ReadStream,g=l.WriteStream}var u=e.ReadStream;u&&(h.prototype=Object.create(u.prototype),h.prototype.open=function(){var e=this;y(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var f=e.WriteStream;f&&(g.prototype=Object.create(f.prototype),g.prototype.open=function(){var e=this;y(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return h},set:function(e){h=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return g},set:function(e){g=e},enumerable:!0,configurable:!0});var _=h;Object.defineProperty(e,"FileReadStream",{get:function(){return _},set:function(e){_=e},enumerable:!0,configurable:!0});var m=g;function h(e,t){return this instanceof h?(u.apply(this,arguments),this):h.apply(Object.create(h.prototype),arguments)}function g(e,t){return this instanceof g?(f.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return m},set:function(e){m=e},enumerable:!0,configurable:!0});var A=e.open;function y(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i,o){return A(t,n,r,(function(s,a){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):p([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=y,e}function p(t){l("ENQUEUE",t[0].name,t[1]),n[e].push(t),_()}function f(){for(var t=Date.now(),r=0;r2&&(n[e][r][3]=t,n[e][r][4]=t);_()}function _(){if(clearTimeout(c),c=void 0,0!==n[e].length){var t=n[e].shift(),r=t[0],i=t[1],o=t[2],s=t[3],a=t[4];if(void 0===s)l("RETRY",r.name,i),r.apply(null,i);else if(Date.now()-s>=6e4){l("TIMEOUT",r.name,i);var u=i.pop();"function"==typeof u&&u.call(null,o)}else{var d=Date.now()-a,p=Math.max(a-s,1);d>=Math.min(1.2*p,100)?(l("RETRY",r.name,i),r.apply(null,i.concat([s]))):n[e].push(t)}void 0===c&&(c=setTimeout(_,0))}}return commonjsGlobal[e]||a(commonjsGlobal,n[e]),gracefulFs=d(o(n)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched&&(gracefulFs=d(n),n.__patched=!0),gracefulFs}var gracefulFsExports=requireGracefulFs(),fs=getDefaultExportFromCjs(gracefulFsExports);const homeDirectory=require$$0$9.homedir(),{env:env}=process,xdgData=env.XDG_DATA_HOME||(homeDirectory?require$$0$8.join(homeDirectory,".local","share"):void 0),xdgConfig=env.XDG_CONFIG_HOME||(homeDirectory?require$$0$8.join(homeDirectory,".config"):void 0);env.XDG_STATE_HOME||homeDirectory&&require$$0$8.join(homeDirectory,".local","state"),env.XDG_CACHE_HOME||homeDirectory&&require$$0$8.join(homeDirectory,".cache"),env.XDG_RUNTIME_DIR;const xdgDataDirectories=(env.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");xdgData&&xdgDataDirectories.unshift(xdgData);const xdgConfigDirectories=(env.XDG_CONFIG_DIRS||"/etc/xdg").split(":");xdgConfig&&xdgConfigDirectories.unshift(xdgConfig);const attemptifyAsync=(e,t)=>function(...n){return e.apply(void 0,n).catch(t)},attemptifySync=(e,t)=>function(...n){try{return e.apply(void 0,n)}catch(e){return t(e)}},IS_USER_ROOT=!!process$2.getuid&&!process$2.getuid(),LIMIT_FILES_DESCRIPTORS=1e4,NOOP=()=>{},Handlers={isChangeErrorOk:e=>{if(!Handlers.isNodeError(e))return!1;const{code:t}=e;return"ENOSYS"===t||!(IS_USER_ROOT||"EINVAL"!==t&&"EPERM"!==t)},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!Handlers.isNodeError(e))return!1;const{code:t}=e;return"EMFILE"===t||"ENFILE"===t||"EAGAIN"===t||"EBUSY"===t||"EACCESS"===t||"EACCES"===t||"EACCS"===t||"EPERM"===t},onChangeError:e=>{if(!Handlers.isNodeError(e))throw e;if(!Handlers.isChangeErrorOk(e))throw e}};class RetryfyQueue{constructor(){this.interval=25,this.intervalId=void 0,this.limit=LIMIT_FILES_DESCRIPTORS,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=e=>{this.queueWaiting.add(e),this.queueActive.size{this.queueWaiting.delete(e),this.queueActive.delete(e)},this.schedule=()=>new Promise((e=>{const t=()=>this.remove(n),n=()=>e(t);this.add(n)})),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const e of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(e),this.queueActive.add(e),e()}}}}}var RetryfyQueue$1=new RetryfyQueue;const retryifyAsync=(e,t)=>function(n){return function r(...i){return RetryfyQueue$1.schedule().then((o=>e.apply(void 0,i).then((e=>(o(),e)),(e=>{if(o(),Date.now()>=n)throw e;if(t(e)){const e=Math.round(100*Math.random()),t=new Promise((t=>setTimeout(t,e)));return t.then((()=>r.apply(void 0,i)))}throw e}))))}},retryifySync=(e,t)=>function(n){return function r(...i){try{return e.apply(void 0,i)}catch(e){if(Date.now()>n)throw e;if(t(e))return r.apply(void 0,i);throw e}}},FS={attempt:{chmod:attemptifyAsync(promisify(fs$6.chmod),Handlers.onChangeError),chown:attemptifyAsync(promisify(fs$6.chown),Handlers.onChangeError),close:attemptifyAsync(promisify(fs$6.close),NOOP),fsync:attemptifyAsync(promisify(fs$6.fsync),NOOP),mkdir:attemptifyAsync(promisify(fs$6.mkdir),NOOP),realpath:attemptifyAsync(promisify(fs$6.realpath),NOOP),stat:attemptifyAsync(promisify(fs$6.stat),NOOP),unlink:attemptifyAsync(promisify(fs$6.unlink),NOOP),chmodSync:attemptifySync(fs$6.chmodSync,Handlers.onChangeError),chownSync:attemptifySync(fs$6.chownSync,Handlers.onChangeError),closeSync:attemptifySync(fs$6.closeSync,NOOP),existsSync:attemptifySync(fs$6.existsSync,NOOP),fsyncSync:attemptifySync(fs$6.fsync,NOOP),mkdirSync:attemptifySync(fs$6.mkdirSync,NOOP),realpathSync:attemptifySync(fs$6.realpathSync,NOOP),statSync:attemptifySync(fs$6.statSync,NOOP),unlinkSync:attemptifySync(fs$6.unlinkSync,NOOP)},retry:{close:retryifyAsync(promisify(fs$6.close),Handlers.isRetriableError),fsync:retryifyAsync(promisify(fs$6.fsync),Handlers.isRetriableError),open:retryifyAsync(promisify(fs$6.open),Handlers.isRetriableError),readFile:retryifyAsync(promisify(fs$6.readFile),Handlers.isRetriableError),rename:retryifyAsync(promisify(fs$6.rename),Handlers.isRetriableError),stat:retryifyAsync(promisify(fs$6.stat),Handlers.isRetriableError),write:retryifyAsync(promisify(fs$6.write),Handlers.isRetriableError),writeFile:retryifyAsync(promisify(fs$6.writeFile),Handlers.isRetriableError),closeSync:retryifySync(fs$6.closeSync,Handlers.isRetriableError),fsyncSync:retryifySync(fs$6.fsyncSync,Handlers.isRetriableError),openSync:retryifySync(fs$6.openSync,Handlers.isRetriableError),readFileSync:retryifySync(fs$6.readFileSync,Handlers.isRetriableError),renameSync:retryifySync(fs$6.renameSync,Handlers.isRetriableError),statSync:retryifySync(fs$6.statSync,Handlers.isRetriableError),writeSync:retryifySync(fs$6.writeSync,Handlers.isRetriableError),writeFileSync:retryifySync(fs$6.writeFileSync,Handlers.isRetriableError)}},DEFAULT_ENCODING="utf8",DEFAULT_FILE_MODE=438,DEFAULT_FOLDER_MODE=511,DEFAULT_WRITE_OPTIONS={},DEFAULT_USER_UID=os$1.userInfo().uid,DEFAULT_USER_GID=os$1.userInfo().gid,DEFAULT_TIMEOUT_SYNC=1e3,IS_POSIX=!!process$2.getuid;process$2.getuid&&process$2.getuid();const LIMIT_BASENAME_LENGTH=128,isException=e=>e instanceof Error&&"code"in e,isString$1=e=>"string"==typeof e,isUndefined=e=>void 0===e,IS_LINUX="linux"===process$2.platform,IS_WINDOWS="win32"===process$2.platform,Signals=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];IS_WINDOWS||Signals.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),IS_LINUX&&Signals.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class Interceptor{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(const e of this.callbacks)e();e&&(IS_WINDOWS&&"SIGINT"!==e&&"SIGTERM"!==e&&"SIGKILL"!==e?process$2.kill(process$2.pid,"SIGTERM"):process$2.kill(process$2.pid,e))}},this.hook=()=>{process$2.once("exit",(()=>this.exit()));for(const e of Signals)try{process$2.once(e,(()=>this.exit(e)))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Interceptor$1=new Interceptor;const whenExit=Interceptor$1.register,Temp={store:{},create:e=>{const t=`000000${Math.floor(16777215*Math.random()).toString(16)}`.slice(-6);return`${e}${`.tmp-${Date.now().toString().slice(-10)}${t}`}`},get:(e,t,n=!0)=>{const r=Temp.truncate(t(e));if(r in Temp.store)return Temp.get(e,t,n);Temp.store[r]=n;return[r,()=>delete Temp.store[r]]},purge:e=>{Temp.store[e]&&(delete Temp.store[e],FS.attempt.unlink(e))},purgeSync:e=>{Temp.store[e]&&(delete Temp.store[e],FS.attempt.unlinkSync(e))},purgeSyncAll:()=>{for(const e in Temp.store)Temp.purgeSync(e)},truncate:e=>{const t=path$1.basename(e);if(t.length<=LIMIT_BASENAME_LENGTH)return e;const n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;const r=t.length-LIMIT_BASENAME_LENGTH;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};function writeFileSync(e,t,n=DEFAULT_WRITE_OPTIONS){if(isString$1(n))return writeFileSync(e,t,{encoding:n});const r=Date.now()+((n.timeout??DEFAULT_TIMEOUT_SYNC)||-1);let i=null,o=null,s=null;try{const a=FS.attempt.realpathSync(e),c=!!a;e=a||e,[o,i]=Temp.get(e,n.tmpCreate||Temp.create,!(!1===n.tmpPurge));const l=IS_POSIX&&isUndefined(n.chown),u=isUndefined(n.mode);if(c&&(l||u)){const t=FS.attempt.statSync(e);t&&(n={...n},l&&(n.chown={uid:t.uid,gid:t.gid}),u&&(n.mode=t.mode))}if(!c){const t=path$1.dirname(e);FS.attempt.mkdirSync(t,{mode:DEFAULT_FOLDER_MODE,recursive:!0})}s=FS.retry.openSync(r)(o,"w",n.mode||DEFAULT_FILE_MODE),n.tmpCreated&&n.tmpCreated(o),isString$1(t)?FS.retry.writeSync(r)(s,t,0,n.encoding||DEFAULT_ENCODING):isUndefined(t)||FS.retry.writeSync(r)(s,t,0,t.length,0),!1!==n.fsync&&(!1!==n.fsyncWait?FS.retry.fsyncSync(r)(s):FS.attempt.fsync(s)),FS.retry.closeSync(r)(s),s=null,!n.chown||n.chown.uid===DEFAULT_USER_UID&&n.chown.gid===DEFAULT_USER_GID||FS.attempt.chownSync(o,n.chown.uid,n.chown.gid),n.mode&&n.mode!==DEFAULT_FILE_MODE&&FS.attempt.chmodSync(o,n.mode);try{FS.retry.renameSync(r)(o,e)}catch(t){if(!isException(t))throw t;if("ENAMETOOLONG"!==t.code)throw t;FS.retry.renameSync(r)(o,Temp.truncate(e))}i(),o=null}finally{s&&FS.attempt.closeSync(s),o&&Temp.purge(o)}}whenExit(Temp.purgeSyncAll);const isObject$4=e=>{const t=typeof e;return null!==e&&("object"===t||"function"===t)},disallowedKeys=new Set(["__proto__","prototype","constructor"]),digits=new Set("0123456789");function getPathSegments(e){const t=[];let n="",r="start",i=!1;for(const o of e)switch(o){case"\\":if("index"===r)throw new Error("Invalid character in an index");if("indexEnd"===r)throw new Error("Invalid character after an index");i&&(n+=o),r="property",i=!i;break;case".":if("index"===r)throw new Error("Invalid character in an index");if("indexEnd"===r){r="property";break}if(i){i=!1,n+=o;break}if(disallowedKeys.has(n))return[];t.push(n),n="",r="property";break;case"[":if("index"===r)throw new Error("Invalid character in an index");if("indexEnd"===r){r="index";break}if(i){i=!1,n+=o;break}if("property"===r){if(disallowedKeys.has(n))return[];t.push(n),n=""}r="index";break;case"]":if("index"===r){t.push(Number.parseInt(n,10)),n="",r="indexEnd";break}if("indexEnd"===r)throw new Error("Invalid character after an index");default:if("index"===r&&!digits.has(o))throw new Error("Invalid character in an index");if("indexEnd"===r)throw new Error("Invalid character after an index");"start"===r&&(r="property"),i&&(i=!1,n+="\\"),n+=o}switch(i&&(n+="\\"),r){case"property":if(disallowedKeys.has(n))return[];t.push(n);break;case"index":throw new Error("Index was not closed");case"start":t.push("")}return t}function isStringIndex(e,t){if("number"!=typeof t&&Array.isArray(e)){const n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}function assertNotStringIndex(e,t){if(isStringIndex(e,t))throw new Error("Cannot use string index")}function getProperty(e,t,n){if(!isObject$4(e)||"string"!=typeof t)return void 0===n?e:n;const r=getPathSegments(t);if(0===r.length)return n;for(let t=0;te.json())).then((t=>t["dist-tags"][e])).catch((e=>(error(`error fetching version from npm registry: ${e.message}`),pkg.version))):this?.config?.version||pkg.version}async function getMajorPkgVersion(e){return semver.major(await getPkgVersion.call(this,e))}async function promptTerminal(e,t){function n(){isCI()&&(process.stdout.write("\n"),process.stdout.write("Yikes! Looks like we were about to prompt you for something in a CI environment. Are you missing an argument?"),process.stdout.write("\n\n"),process.stdout.write("Try running `rdme --help` or get in touch at support@readme.io."),process.stdout.write("\n\n"),process.exit(1))}return Array.isArray(e)?e=e.map((e=>({onRender:n,...e}))):e.onRender=n,prompts(e,{onCancel:()=>{process.stdout.write("\n"),process.stdout.write("Thanks for using rdme! See you soon ✌️"),process.stdout.write("\n\n"),process.exit(1)},...t})}const cleanFileName=e=>e.replace(/[^a-z0-9]/gi,"-");function validateFilePath(e,t=e=>e){if(e.length){const n=t(e);return!fs$6.existsSync(n)||"Specified output path already exists."}return"An output path must be supplied."}function validateSubdomain(e){return/^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/.test(e)||"Project subdomain must contain only letters, numbers and dashes."}const yamlBase="# This GitHub Actions workflow was auto-generated by the `rdme` cli on {{timestamp}}\n# You can view our full documentation here: https://docs.readme.com/docs/rdme\nname: ReadMe GitHub Action 🦉\n\non:\n push:\n branches:\n # This workflow will run every time you push code to the following branch: `{{branch}}`\n # Check out GitHub's docs for more info on configuring this:\n # https://docs.github.com/actions/using-workflows/events-that-trigger-workflows\n - {{branch}}\n\njobs:\n rdme-{{cleanCommand}}:\n runs-on: ubuntu-latest\n steps:\n - name: Check out repo 📚\n uses: actions/checkout@v4\n\n - name: Run `{{command}}` command 🚀\n uses: readmeio/rdme@{{rdmeVersion}}\n with:\n rdme: {{commandString}}\n",getConfigStoreKey=e=>`createGHA.${e}`,GITHUB_WORKFLOW_DIR=".github/workflows",GITHUB_SECRET_NAME="README_API_KEY",git=simpleGit(),getGHAFileName=e=>path$1.join(GITHUB_WORKFLOW_DIR,`${cleanFileName(e).toLowerCase()}.yml`);function getKey$1(e,t){return!!Object.keys(e).some((e=>"key"===e))&&`••••••••••••${t.key?.slice(-5)||""}`}function constructCommandString(e,t,n,r){return`${e} ${Object.keys(t).map((e=>r[e])).filter(Boolean).join(" ")} ${Object.keys(n).map((e=>{const t=r[e];return"key"===e?`--key=\${{ secrets.${GITHUB_SECRET_NAME} }}`:"github"!==e&&("boolean"===n[e].type&&t?`--${e}`:!!t&&`--${e}=${t}`)})).filter(Boolean).join(" ")}`.trim()}async function getGitData(){const e=/^ {2}HEAD branch: /g,t=/^ {2}HEAD branch:.*/gm,n=await git.checkIsRepo().catch((e=>(this.debug(`[getGitData] error running git repo check: ${e.message}`),!1)));let r,i;this.debug(`[getGitData] isRepo result: ${n}`);const o=await git.remote([]).catch((e=>(this.debug(`[getGitData] error grabbing git remotes: ${e.message}`),"")));if(this.debug(`[getGitData] rawRemotes result: ${o}`),o){const n=o.split("\n")[0];this.debug(`[getGitData] remote result: ${n}`);const s=await git.remote(["show",n]).catch((e=>(this.debug(`[getGitData] error accessing remote: ${e.message}`),"")));this.debug(`[getGitData] rawRemote result: ${s}`);const a=t.exec(s)?.[0];this.debug(`[getGitData] rawHead result: ${a}`),a&&(i=a.replace(e,""));const c=await git.remote(["-v"]);this.debug(`[getGitData] remotesList result: ${c}`),r=/github/.test(c)}this.debug(`[getGitData] containsGitHubRemote result: ${r}`),this.debug(`[getGitData] defaultBranch result: ${i}`);const s=await git.revparse(["--show-toplevel"]).catch((e=>(this.debug(`[getGitData] error grabbing git root: ${e.message}`),"")));return this.debug(`[getGitData] repoRoot result: ${s}`),{containsGitHubRemote:r,defaultBranch:i,isRepo:n,repoRoot:s}}async function createGHA(e,t,n){const{args:r,flags:i,id:o}=t;if(!o)throw new Error("unable to determine command ID yikes");if(this.debug(`running GHA onboarding for ${o} command`),this.debug(`opts used in createGHA: ${JSON.stringify(n)}`),!n.github&&(isCI()||isNpmScript()||isTest()&&!process.env.TEST_RDME_CREATEGHA))return this.debug("not running GHA onboarding workflow in CI, npm script, or default test env, exiting 👋"),e;const{containsGitHubRemote:s,defaultBranch:a,isRepo:c,repoRoot:l}=await getGitData.call(this),u=configstore.get(getConfigStoreKey(l));this.debug(`repo value in config: ${u}`);const d=await getMajorPkgVersion.call(this);if(this.debug(`major pkg version: ${d}`),!n.github&&(!c||u===d||c&&!s))return this.debug("not running GHA onboarding workflow, exiting"),e;e&&info(e,{includeEmojiPrefix:!1}),n.github?info(chalk.bold("\n🚀 Let's get you set up with GitHub Actions! 🚀\n"),{includeEmojiPrefix:!1}):info(["",chalk.bold("🐙 Looks like you're running this command in a GitHub Repository! 🐙"),"",`🚀 With a few quick clicks, you can run this \`${o}\` command via GitHub Actions (${chalk.underline("https://github.com/features/actions")})`,"",`✨ This means it will run ${chalk.italic("automagically")} with every push to a branch of your choice!`,""].join("\n"),{includeEmojiPrefix:!1});const p=process.cwd();l&&l!==p&&(process.chdir(l),this.debug(`switching working directory from ${p} to ${process.cwd()}`)),prompts.override({shouldCreateGHA:n.github});const{branch:f,filePath:_,shouldCreateGHA:m}=await promptTerminal([{message:"Would you like to add a GitHub Actions workflow?",name:"shouldCreateGHA",type:"confirm",initial:!0},{message:"What GitHub branch should this workflow run on?",name:"branch",type:"text",initial:a||"main"},{message:"What would you like to name the GitHub Actions workflow file?",name:"filePath",type:"text",initial:cleanFileName(`rdme-${o}`),format:e=>getGHAFileName(e),validate:e=>validateFilePath(e,getGHAFileName)}],{onSubmit:(e,t,n)=>!n.shouldCreateGHA});if(!m)throw configstore.set(getConfigStoreKey(l),d),new Error("GitHub Actions workflow creation cancelled. If you ever change your mind, you can run this command again with the `--github` flag.");const h={branch:f,cleanCommand:cleanFileName(o),command:o,commandString:constructCommandString(o,r,i,n),rdmeVersion:`v${d}`,timestamp:(new Date).toISOString()};this.debug(`data for resolver: ${JSON.stringify(h)}`);let g=yamlBase;Object.keys(h).forEach((e=>{g=g.replace(new RegExp(`{{${e}}}`,"g"),h[e])})),fs$6.existsSync(GITHUB_WORKFLOW_DIR)||(this.debug("GHA workflow directory does not exist, creating"),fs$6.mkdirSync(GITHUB_WORKFLOW_DIR,{recursive:!0})),fs$6.writeFileSync(_,g);const A=[chalk.green("\nYour GitHub Actions workflow file has been created! ✨\n")],y=getKey$1(i,n);return y?A.push(chalk.bold("Almost done! Just a couple more steps:"),`1. Push your newly created file (${chalk.underline(_)}) to GitHub 🚀`,`2. Create a GitHub secret called ${chalk.bold(GITHUB_SECRET_NAME)} and populate the value with your ReadMe API key (${y}) 🔑`,"",`🔐 Check out GitHub's docs for more info on creating encrypted secrets (${chalk.underline("https://docs.github.com/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository")})`):A.push(`${chalk.bold("Almost done!")} Push your newly created file (${chalk.underline(_)}) to GitHub and you're all set 🚀`),A.push("",`🦉 If you have any more questions, feel free to drop us a line! ${chalk.underline("support@readme.io")}`,""),Promise.resolve(A.join("\n"))}const SUCCESS_NO_CONTENT=204;function getProxy(){return process.env.HTTPS_PROXY||process.env.https_proxy}function stripQuotes(e){return e?e.replace(/(^"|[",]*$)/g,""):""}function parseWarningHeader(e){try{let t;return e.split(/([0-9]{3} [a-z0-9.@\-/]*) /g).reduce(((e,n)=>{const r=(n=n.trim()).match(/^([0-9]{3}) (.*)/);if(r)t={code:r[1],agent:r[2],message:""};else if(n){const r=n.split(/" "/);r&&(t.message=stripQuotes(r[0]),t.date=stripQuotes(r[1]),e.push(t))}return e}),[])}catch(t){return debug(`error parsing warning header: ${t.message}`),[{code:"199",agent:"-",message:e}]}}function getUserAgent(){return`rdme${isGHA()?"-github":""}/${pkg.version}`}async function normalizeFilePath(e){if("path"===e.fileType){const t=await git.revparse(["--show-toplevel"]).catch((e=>(debug(`[fetch] error grabbing git root: ${e.message}`),"")));return path$1.relative(t,e.filePath)}return e.filePath}function sanitizeHeaders(e){const t=Array.from(e.entries()).reduce(((e,t)=>(e[t[0]]="authorization"===t[0].toLowerCase()?"redacted":t[1],e)),{});return JSON.stringify(t)}async function readmeAPIv1Fetch(e,t={headers:new Headers},n={filePath:"",fileType:!1}){let r="cli",i=t.headers;if(t.headers instanceof Headers||(i=new Headers(t.headers)),i.set("User-Agent",getUserAgent()),isGHA()){r="cli-gh",process.env.GITHUB_REPOSITORY&&i.set("x-github-repository",process.env.GITHUB_REPOSITORY),process.env.GITHUB_RUN_ATTEMPT&&i.set("x-github-run-attempt",process.env.GITHUB_RUN_ATTEMPT),process.env.GITHUB_RUN_ID&&i.set("x-github-run-id",process.env.GITHUB_RUN_ID),process.env.GITHUB_RUN_NUMBER&&i.set("x-github-run-number",process.env.GITHUB_RUN_NUMBER),process.env.GITHUB_SHA&&i.set("x-github-sha",process.env.GITHUB_SHA);const e=await normalizeFilePath(n);if(e)try{const t=new URL(`${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/blob/${process.env.GITHUB_SHA}/${e}`).href;i.set("x-readme-source-url",t)}catch(e){debug(`error constructing github source url: ${e.message}`)}}isCI()&&i.set("x-rdme-ci",ciName()),i.set("x-readme-source",r),n.filePath&&"url"===n.fileType&&i.set("x-readme-source-url",n.filePath);const o=`${config.host}${e}`,s=getProxy();return debug(`making ${(t.method||"get").toUpperCase()} request to ${o} ${s?`with proxy ${s} and `:""}with headers: ${sanitizeHeaders(i)}`),fetch(o,{...t,headers:i,dispatcher:s?new undiciExports.ProxyAgent(s):void 0}).then((e=>{const t=e.headers.get("Warning");if(t){debug(`received warning header: ${t}`);parseWarningHeader(t).forEach((e=>{warn(e.message,"ReadMe API Warning:")}))}return e})).catch((e=>{throw debug(`error making fetch request: ${e}`),e}))}async function handleAPIv1Res(e,t=!0){const n=e.headers.get("content-type")||"";if("json"===mime.extension(n)){const n=await e.json();return debug(`received status code ${e.status} from ${e.url} with JSON response: ${JSON.stringify(n)}`),n.error&&t?Promise.reject(new APIv1Error(n)):n}if(e.status===SUCCESS_NO_CONTENT)return debug(`received status code ${e.status} from ${e.url} with no content`),{};const r=await e.text();return debug(`received status code ${e.status} from ${e.url} with non-JSON response: ${r}`),Promise.reject(r)}function cleanAPIv1Headers(e,t,n=new Headers){const r=Buffer.from(`${e}:`).toString("base64"),i=new Headers({Authorization:`Basic ${r}`});t&&i.set("x-readme-version",t);for(const e of n.entries())"null"!==e[1]&&"undefined"!==e[1]&&e[1].length>0&&i.set(e[0],e[1]);return i}async function getCategories(e,t){const{firstPage:n,totalCount:r}=await async function(){let n=0;return readmeAPIv1Fetch("/api/v1/categories?perPage=20&page=1",{method:"get",headers:cleanAPIv1Headers(e,t,new Headers({Accept:"application/json"}))}).then((e=>(n=Math.ceil(parseInt(e.headers.get("x-total-count")||"0",10)/20),handleAPIv1Res(e)))).then((e=>({firstPage:e,totalCount:n})))}();return n.concat(...await Promise.all([...new Array(r+1).keys()].slice(2).map((async n=>readmeAPIv1Fetch(`/api/v1/categories?perPage=20&page=${n}`,{method:"get",headers:cleanAPIv1Headers(e,t,new Headers({Accept:"application/json"}))}).then(handleAPIv1Res)))))}async function getProjectVersion(e,t,n=!1){try{if(e)return await readmeAPIv1Fetch(`/api/v1/version/${e}`,{method:"get",headers:cleanAPIv1Headers(t)}).then(handleAPIv1Res).then((e=>e.version));if(isCI())return void warn("No `--version` parameter detected in current CI environment. Defaulting to main version.");const r=await readmeAPIv1Fetch("/api/v1/version",{method:"get",headers:cleanAPIv1Headers(t)}).then(handleAPIv1Res);if(1===r.length)return r[0].version;if(n){const e=r.find((e=>!0===e.is_stable));if(!e)throw new Error("Unexpected version response from the ReadMe API. Get in touch with us at support@readme.io!");return e.version}const{versionSelection:i}=await promptTerminal({type:"select",name:"versionSelection",message:"Select your desired version",choices:r.map((e=>({title:e.version,value:e.version})))});return i}catch(e){return Promise.reject(new APIv1Error(e))}}class CategoriesCreateCommand extends BaseCommand{static id="categories create";static state="deprecated";static deprecationOptions={message:`\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`};static description="Create a category with the specified title and guide in your ReadMe project.";static args={title:libExports$3.Args.string({description:"Title of the category",required:!0})};static flags={categoryType:libExports$3.Flags.option({description:"Category type",options:["guide","reference"],required:!0})(),key:keyFlag,preventDuplicates:libExports$3.Flags.boolean({description:"Prevents the creation of a new category if there is an existing category with a matching `categoryType` and `title`"}),version:versionFlag};static examples=[{description:"Create a new category for your project version:",command:"<%= config.bin %> <%= command.id %> --categoryType={guide|reference} --version={project-version}"},{description:"If you want to prevent the creation of a duplicate category with a matching `title` and `categoryType`, supply the `--preventDuplicates` flag:",command:"<%= config.bin %> <%= command.id %> <title> --categoryType={guide|reference} --version={project-version} --preventDuplicates"}];async run(){const{title:e}=this.args,{categoryType:t,key:n,version:r,preventDuplicates:i}=this.flags,o=await getProjectVersion(r,n);if(this.debug(`selectedVersion: ${o}`),i){const r=(await getCategories(n,o)).find((n=>n.title.trim().toLowerCase()===e.trim().toLowerCase()&&n.type===t));if(void 0!==r)return Promise.reject(new Error(`The '${r.title}' category with a type of '${r.type}' already exists with an id of '${r.id}'. A new category was not created.`))}const s=await readmeAPIv1Fetch("/api/v1/categories",{method:"post",headers:cleanAPIv1Headers(n,o,new Headers({"Content-Type":"application/json"})),body:JSON.stringify({title:e,type:t})}).then(handleAPIv1Res).then((e=>`🌱 successfully created '${e.title}' with a type of '${e.type}' and an id of '${e.id}'`));return Promise.resolve(chalk.green(s))}}class CategoriesCommand extends BaseCommand{static id="categories";static state="deprecated";static deprecationOptions={message:`\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`};static description="Get all categories in your ReadMe project.";static flags={key:keyFlag,version:versionFlag};static examples=[{description:"Get all categories associated to your project version:",command:"<%= config.bin %> <%= command.id %> --version={project-version}"}];async run(){const{key:e,version:t}=this.flags,n=await getProjectVersion(t,e);this.debug(`selectedVersion: ${n}`);const r=await getCategories(e,n);return Promise.resolve(JSON.stringify(r,null,2))}}var toposort$1={exports:{}},hasRequiredToposort;function requireToposort(){if(hasRequiredToposort)return toposort$1.exports;function e(e,t){var n=e.length,r=new Array(n),i={},o=n,s=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}(t),a=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach((function(e){if(!a.has(e[0])||!a.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")}));o--;)i[o]||c(e[o],o,new Set);return r;function c(e,t,o){if(o.has(e)){var l;try{l=", node was:"+JSON.stringify(e)}catch(e){l=""}throw new Error("Cyclic dependency"+l)}if(!a.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!i[t]){i[t]=!0;var u=s.get(e)||new Set;if(t=(u=Array.from(u)).length){o.add(e);do{var d=u[--t];c(d,a.get(d),o)}while(t);o.delete(e)}r[--n]=e}}}return hasRequiredToposort=1,toposort$1.exports=function(t){return e(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}(t),t)},toposort$1.exports.array=e,toposort$1.exports}var toposortExports=requireToposort(),toposort=getDefaultExportFromCjs(toposortExports),ignore$1,hasRequiredIgnore;function requireIgnore(){if(hasRequiredIgnore)return ignore$1;function e(e){return Array.isArray(e)?e:[e]}hasRequiredIgnore=1;const t=/^\s+$/,n=/(?:[^\\]|^)\\$/,r=/^\\!/,i=/^\\#/,o=/\r?\n/g,s=/^\.*\/|^\.+$/;let a="node-ignore";"undefined"!=typeof Symbol&&(a=Symbol.for("node-ignore"));const c=a,l=/([0-z])-([0-z])/g,u=()=>!1,d=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(0===n.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+" "}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>"\\"===t?`\\[${n}${(e=>{const{length:t}=e;return e.slice(0,t-t%2)})(r)}${i}`:"]"===i&&r.length%2==0?`[${(e=>e.replace(l,((e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:"")))(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],p=Object.create(null),f=e=>"string"==typeof e;class _{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}}const m=(e,t)=>{const n=e;let o=!1;0===e.indexOf("!")&&(o=!0,e=e.substr(1));const s=((e,t)=>{let n=p[e];return n||(n=d.reduce(((t,[n,r])=>t.replace(n,r.bind(e))),e),p[e]=n),t?new RegExp(n,"i"):new RegExp(n)})(e=e.replace(r,"!").replace(i,"#"),t);return new _(n,e,o,s)},h=(e,t)=>{throw new t(e)},g=(e,t,n)=>{if(!f(e))return n(`path must be a string, but got \`${t}\``,TypeError);if(!e)return n("path must not be empty",TypeError);if(g.isNotRelative(e)){return n(`path should be a ${"`path.relative()`d"} string, but got "${t}"`,RangeError)}return!0},A=e=>s.test(e);g.isNotRelative=A,g.convert=e=>e;class y{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){var r,i,o;r=this,i=c,o=!0,Object.defineProperty(r,i,{value:o}),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[c])return this._rules=this._rules.concat(e._rules),void(this._added=!0);if((e=>e&&f(e)&&!t.test(e)&&!n.test(e)&&0!==e.indexOf("#"))(e)){const t=m(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(t){return this._added=!1,e(f(t)?(e=>e.split(o))(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach((i=>{const{negative:o}=i;if(r===o&&n!==r||o&&!n&&!r&&!t)return;i.regex.test(e)&&(n=!o,r=o)})),{ignored:n,unignored:r}}_test(e,t,n,r){const i=e&&g.convert(e);return g(i,e,this._allowRelativePaths?u:h),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||(r=e.split("/")),r.pop(),!r.length)return t[e]=this._testOne(e,n);const i=this._t(r.join("/")+"/",t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(t){return e(t).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}}const v=e=>new y(e);if(v.isPathValid=e=>g(e&&g.convert(e),e,u),v.default=v,ignore$1=v,"undefined"!=typeof process&&(process.env&&process.env.IGNORE_TEST_WIN32||"win32"===process.platform)){const e=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,"/");g.convert=e;const t=/^[a-z]:\//i;g.isNotRelative=e=>t.test(e)||A(e)}return ignore$1}var ignoreExports=requireIgnore(),ignore=getDefaultExportFromCjs(ignoreExports),kindOf,hasRequiredKindOf,isExtendable,hasRequiredIsExtendable,extendShallow,hasRequiredExtendShallow,sectionMatter,hasRequiredSectionMatter;function readdirRecursive(e,t=!1){let n;debug(`current readdirRecursive folder: ${e}`),t&&(n=ignore.default().add(path$1.join(e,".git/")),fs$6.existsSync(path$1.join(e,".gitignore"))&&(debug(".gitignore file found, adding to ignore filter"),n.add(fs$6.readFileSync(path$1.join(e,".gitignore")).toString())));const r=fs$6.readdirSync(e,{withFileTypes:!0}).filter((r=>{if(!t)return!0;let i=path$1.join(e,r.name);return r.isDirectory()&&(i=`${i}/`),!n.ignores(i)})),i=r.filter((e=>e.isFile())).map((t=>path$1.join(e,t.name))),o=r.filter((e=>e.isDirectory()));return[...i,...[].concat(...o.map((n=>readdirRecursive(path$1.join(e,n.name),t))))]}function requireKindOf(){if(hasRequiredKindOf)return kindOf;hasRequiredKindOf=1;var e=Object.prototype.toString;function t(e){return"function"==typeof e.constructor?e.constructor.name:null}return kindOf=function(n){if(void 0===n)return"undefined";if(null===n)return"null";var r=typeof n;if("boolean"===r)return"boolean";if("string"===r)return"string";if("number"===r)return"number";if("symbol"===r)return"symbol";if("function"===r)return function(e){return"GeneratorFunction"===t(e)}(n)?"generatorfunction":"function";if(function(e){return Array.isArray?Array.isArray(e):e instanceof Array}(n))return"array";if(function(e){if(e.constructor&&"function"==typeof e.constructor.isBuffer)return e.constructor.isBuffer(e);return!1}(n))return"buffer";if(function(e){try{if("number"==typeof e.length&&"function"==typeof e.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(n))return"arguments";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(n))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(n))return"error";if(function(e){return e instanceof RegExp||"string"==typeof e.flags&&"boolean"==typeof e.ignoreCase&&"boolean"==typeof e.multiline&&"boolean"==typeof e.global}(n))return"regexp";switch(t(n)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(e){return"function"==typeof e.throw&&"function"==typeof e.return&&"function"==typeof e.next}(n))return"generator";switch(r=e.call(n)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return r.slice(8,-1).toLowerCase().replace(/\s/g,"")},kindOf} + */function requireMimeTypes(){return hasRequiredMimeTypes||(hasRequiredMimeTypes=1,function(e){var t=requireMimeDb(),n=require$$0$8.extname,r=/^\s*([^;\s]*)(?:;|\s|$)/,i=/^text\//i;function o(e){if(!e||"string"!=typeof e)return!1;var n=r.exec(e),o=n&&t[n[1].toLowerCase()];return o&&o.charset?o.charset:!(!n||!i.test(n[1]))&&"UTF-8"}e.charset=o,e.charsets={lookup:o},e.contentType=function(t){if(!t||"string"!=typeof t)return!1;var n=-1===t.indexOf("/")?e.lookup(t):t;if(!n)return!1;if(-1===n.indexOf("charset")){var r=e.charset(n);r&&(n+="; charset="+r.toLowerCase())}return n},e.extension=function(t){if(!t||"string"!=typeof t)return!1;var n=r.exec(t),i=n&&e.extensions[n[1].toLowerCase()];if(!i||!i.length)return!1;return i[0]},e.extensions=Object.create(null),e.lookup=function(t){if(!t||"string"!=typeof t)return!1;var r=n("x."+t).toLowerCase().substr(1);if(!r)return!1;return e.types[r]||!1},e.types=Object.create(null),function(e,n){var r=["nginx","apache",void 0,"iana"];Object.keys(t).forEach((function(i){var o=t[i],s=o.extensions;if(s&&s.length){e[i]=s;for(var a=0;a<s.length;a++){var c=s[a];if(n[c]){var l=r.indexOf(t[n[c]].source),u=r.indexOf(o.source);if("application/octet-stream"!==n[c]&&(l>u||l===u&&"application/"===n[c].substr(0,12)))continue}n[c]=i}}}))}(e.extensions,e.types)}(mimeTypes)),mimeTypes}var mimeTypesExports=requireMimeTypes(),mime=getDefaultExportFromCjs(mimeTypesExports),undiciExports=requireUndici();class APIv1Error extends Error{code;constructor(e){let t;t="object"==typeof e&&"object"==typeof e?.error?e.error:e,super(t),this.name="APIv1Error","object"==typeof t?(this.code=t.error,this.message=t?.help?[t.message,"",t.help].join("\n"):t.message,this.name="APIv1Error"):(this.code=t,this.message=t)}}const config={host:"https://dash.readme.com",hub:"https://{project}.readme.io"};var prompts$3={},kleur,hasRequiredKleur,action$1,hasRequiredAction$1,strip$1,hasRequiredStrip$1,src$6,hasRequiredSrc$6,clear$1,hasRequiredClear$1,figures_1$1,hasRequiredFigures$1,style$1,hasRequiredStyle$1,lines$1,hasRequiredLines$1,wrap$1,hasRequiredWrap$1,entriesToDisplay$1,hasRequiredEntriesToDisplay$1,util$4,hasRequiredUtil$4,prompt$1,hasRequiredPrompt$1,text$2,hasRequiredText$2,select$1,hasRequiredSelect$1,toggle$1,hasRequiredToggle$1,datepart$1,hasRequiredDatepart$1,meridiem$1,hasRequiredMeridiem$1,day$1,hasRequiredDay$1,hours$1,hasRequiredHours$1,milliseconds$1,hasRequiredMilliseconds$1,minutes$1,hasRequiredMinutes$1,month$1,hasRequiredMonth$1,seconds$1,hasRequiredSeconds$1,year$1,hasRequiredYear$1,dateparts$1,hasRequiredDateparts$1,date$1,hasRequiredDate$1,number$1,hasRequiredNumber$1,multiselect$1,hasRequiredMultiselect$1,autocomplete$1,hasRequiredAutocomplete$1,autocompleteMultiselect$1,hasRequiredAutocompleteMultiselect$1,confirm$1,hasRequiredConfirm$1,elements$1,hasRequiredElements$1,hasRequiredPrompts$2,dist$6,hasRequiredDist$6;function requireKleur(){if(hasRequiredKleur)return kleur;hasRequiredKleur=1;const{FORCE_COLOR:e,NODE_DISABLE_COLORS:t,TERM:n}=process.env,r={enabled:!t&&"dumb"!==n&&"0"!==e,reset:o(0,0),bold:o(1,22),dim:o(2,22),italic:o(3,23),underline:o(4,24),inverse:o(7,27),hidden:o(8,28),strikethrough:o(9,29),black:o(30,39),red:o(31,39),green:o(32,39),yellow:o(33,39),blue:o(34,39),magenta:o(35,39),cyan:o(36,39),white:o(37,39),gray:o(90,39),grey:o(90,39),bgBlack:o(40,49),bgRed:o(41,49),bgGreen:o(42,49),bgYellow:o(43,49),bgBlue:o(44,49),bgMagenta:o(45,49),bgCyan:o(46,49),bgWhite:o(47,49)};function i(e,t){let n,r=0,i="",o="";for(;r<e.length;r++)n=e[r],i+=n.open,o+=n.close,t.includes(n.close)&&(t=t.replace(n.rgx,n.close+n.open));return i+t+o}function o(e,t){let n={open:`[${e}m`,close:`[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(t){return void 0!==this&&void 0!==this.has?(this.has.includes(e)||(this.has.push(e),this.keys.push(n)),void 0===t?this:r.enabled?i(this.keys,t+""):t+""):void 0===t?function(e,t){let n={has:e,keys:t};return n.reset=r.reset.bind(n),n.bold=r.bold.bind(n),n.dim=r.dim.bind(n),n.italic=r.italic.bind(n),n.underline=r.underline.bind(n),n.inverse=r.inverse.bind(n),n.hidden=r.hidden.bind(n),n.strikethrough=r.strikethrough.bind(n),n.black=r.black.bind(n),n.red=r.red.bind(n),n.green=r.green.bind(n),n.yellow=r.yellow.bind(n),n.blue=r.blue.bind(n),n.magenta=r.magenta.bind(n),n.cyan=r.cyan.bind(n),n.white=r.white.bind(n),n.gray=r.gray.bind(n),n.grey=r.grey.bind(n),n.bgBlack=r.bgBlack.bind(n),n.bgRed=r.bgRed.bind(n),n.bgGreen=r.bgGreen.bind(n),n.bgYellow=r.bgYellow.bind(n),n.bgBlue=r.bgBlue.bind(n),n.bgMagenta=r.bgMagenta.bind(n),n.bgCyan=r.bgCyan.bind(n),n.bgWhite=r.bgWhite.bind(n),n}([e],[n]):r.enabled?i([n],t+""):t+""}}return kleur=r}function requireAction$1(){return hasRequiredAction$1?action$1:(hasRequiredAction$1=1,action$1=(e,t)=>{if(!e.meta||"escape"===e.name){if(e.ctrl){if("a"===e.name)return"first";if("c"===e.name)return"abort";if("d"===e.name)return"abort";if("e"===e.name)return"last";if("g"===e.name)return"reset"}if(t){if("j"===e.name)return"down";if("k"===e.name)return"up"}return"return"===e.name||"enter"===e.name?"submit":"backspace"===e.name?"delete":"delete"===e.name?"deleteForward":"abort"===e.name?"abort":"escape"===e.name?"exit":"tab"===e.name?"next":"pagedown"===e.name?"nextPage":"pageup"===e.name?"prevPage":"home"===e.name?"home":"end"===e.name?"end":"up"===e.name?"up":"down"===e.name?"down":"right"===e.name?"right":"left"===e.name&&"left"}})}function requireStrip$1(){return hasRequiredStrip$1||(hasRequiredStrip$1=1,strip$1=e=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),n=new RegExp(t,"g");return"string"==typeof e?e.replace(n,""):e}),strip$1}function requireSrc$6(){if(hasRequiredSrc$6)return src$6;hasRequiredSrc$6=1;const e="[",t={to:(t,n)=>n?`${e}${n+1};${t+1}H`:`${e}${t+1}G`,move(t,n){let r="";return t<0?r+=`${e}${-t}D`:t>0&&(r+=`${e}${t}C`),n<0?r+=`${e}${-n}A`:n>0&&(r+=`${e}${n}B`),r},up:(t=1)=>`${e}${t}A`,down:(t=1)=>`${e}${t}B`,forward:(t=1)=>`${e}${t}C`,backward:(t=1)=>`${e}${t}D`,nextLine:(t=1)=>`${e}E`.repeat(t),prevLine:(t=1)=>`${e}F`.repeat(t),left:`${e}G`,hide:`${e}?25l`,show:`${e}?25h`,save:"7",restore:"8"},n={up:(t=1)=>`${e}S`.repeat(t),down:(t=1)=>`${e}T`.repeat(t)},r={screen:`${e}2J`,up:(t=1)=>`${e}1J`.repeat(t),down:(t=1)=>`${e}J`.repeat(t),line:`${e}2K`,lineEnd:`${e}K`,lineStart:`${e}1K`,lines(e){let n="";for(let r=0;r<e;r++)n+=this.line+(r<e-1?t.up():"");return e&&(n+=t.left),n}};return src$6={cursor:t,scroll:n,erase:r,beep:""}}function requireClear$1(){if(hasRequiredClear$1)return clear$1;function e(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}(e))||n){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}hasRequiredClear$1=1;const n=requireStrip$1(),r=requireSrc$6(),i=r.erase,o=r.cursor,s=e=>[...n(e)].length;return clear$1=function(t,n){if(!n)return i.line+o.to(0);let r=0;var a,c=e(t.split(/\r?\n/));try{for(c.s();!(a=c.n()).done;){let e=a.value;r+=1+Math.floor(Math.max(s(e)-1,0)/n)}}catch(e){c.e(e)}finally{c.f()}return i.lines(r)},clear$1}function requireFigures$1(){if(hasRequiredFigures$1)return figures_1$1;hasRequiredFigures$1=1;const e={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},t={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},n="win32"===process.platform?t:e;return figures_1$1=n}function requireStyle$1(){if(hasRequiredStyle$1)return style$1;hasRequiredStyle$1=1;const e=requireKleur(),t=requireFigures$1(),n=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"😃".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}}),r=Object.freeze({aborted:e.red(t.cross),done:e.green(t.tick),exited:e.yellow(t.cross),default:e.cyan("?")});return style$1={styles:n,render:e=>n[e]||n.default,symbols:r,symbol:(e,t,n)=>t?r.aborted:n?r.exited:e?r.done:r.default,delimiter:n=>e.gray(n?t.ellipsis:t.pointerSmall),item:(n,r)=>e.gray(n?r?t.pointerSmall:"+":t.line)},style$1}function requireLines$1(){if(hasRequiredLines$1)return lines$1;hasRequiredLines$1=1;const e=requireStrip$1();return lines$1=function(t,n){let r=String(e(t)||"").split(/\r?\n/);return n?r.map((e=>Math.ceil(e.length/n))).reduce(((e,t)=>e+t)):r.length},lines$1}function requireWrap$1(){return hasRequiredWrap$1||(hasRequiredWrap$1=1,wrap$1=(e,t={})=>{const n=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",r=t.width;return(e||"").split(/\r?\n/g).map((e=>e.split(/\s+/g).reduce(((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1<r?e[e.length-1]+=` ${t}`:e.push(`${n}${t}`),e)),[n]).join("\n"))).join("\n")}),wrap$1}function requireEntriesToDisplay$1(){return hasRequiredEntriesToDisplay$1?entriesToDisplay$1:(hasRequiredEntriesToDisplay$1=1,entriesToDisplay$1=(e,t,n)=>{n=n||t;let r=Math.min(t-n,e-Math.floor(n/2));return r<0&&(r=0),{startIndex:r,endIndex:Math.min(r+n,t)}})}function requireUtil$4(){return hasRequiredUtil$4?util$4:(hasRequiredUtil$4=1,util$4={action:requireAction$1(),clear:requireClear$1(),style:requireStyle$1(),strip:requireStrip$1(),figures:requireFigures$1(),lines:requireLines$1(),wrap:requireWrap$1(),entriesToDisplay:requireEntriesToDisplay$1()})}function requirePrompt$1(){if(hasRequiredPrompt$1)return prompt$1;hasRequiredPrompt$1=1;const e=require$$0$m,t=requireUtil$4().action,n=require$$0$c,r=requireSrc$6(),i=r.beep,o=r.cursor,s=requireKleur();return prompt$1=class extends n{constructor(n={}){super(),this.firstRender=!0,this.in=n.stdin||process.stdin,this.out=n.stdout||process.stdout,this.onRender=(n.onRender||(()=>{})).bind(this);const r=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(e,n)=>{let r=t(n,i);!1===r?this._&&this._(e,n):"function"==typeof this[r]?this[r](n):this.bell()};this.close=()=>{this.out.write(o.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(i)}render(){this.onRender(s),this.firstRender&&(this.firstRender=!1)}},prompt$1}function requireText$2(){if(hasRequiredText$2)return text$2;function e(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var s=t.apply(n,r);function a(t){e(s,i,o,a,c,"next",t)}function c(t){e(s,i,o,a,c,"throw",t)}a(void 0)}))}}hasRequiredText$2=1;const n=requireKleur(),r=requirePrompt$1(),i=requireSrc$6(),o=i.erase,s=i.cursor,a=requireUtil$4(),c=a.style,l=a.clear,u=a.lines,d=a.figures;return text$2=class extends r{constructor(e={}){super(e),this.transform=c.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=l("",this.out.columns),this.render()}set value(e){!e&&this.initial?(this.placeholder=!0,this.rendered=n.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(e)),this._value=e,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var e=this;return t((function*(){let t=yield e.validator(e.value);"string"==typeof t&&(e.errorMsg=t,t=!1),e.error=!t}))()}submit(){var e=this;return t((function*(){if(e.value=e.value||e.initial,e.cursorOffset=0,e.cursor=e.rendered.length,yield e.validate(),e.error)return e.red=!0,e.fire(),void e.render();e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write("\n"),e.close()}))()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${n}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return 0===this.cursor||this.placeholder&&1===this.cursor}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(s.down(u(this.outputError,this.out.columns)-1)+l(this.outputError,this.out.columns)),this.out.write(l(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[c.symbol(this.done,this.aborted),n.bold(this.msg),c.delimiter(this.done),this.red?n.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split("\n").reduce(((e,t,r)=>e+`\n${r?" ":d.pointerSmall} ${n.red().italic(t)}`),"")),this.out.write(o.line+s.to(0)+this.outputText+s.save+this.outputError+s.restore+s.move(this.cursorOffset,0)))}},text$2}function requireSelect$1(){if(hasRequiredSelect$1)return select$1;hasRequiredSelect$1=1;const e=requireKleur(),t=requirePrompt$1(),n=requireUtil$4(),r=n.style,i=n.clear,o=n.figures,s=n.wrap,a=n.entriesToDisplay,c=requireSrc$6().cursor;return select$1=class extends t{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map(((e,t)=>("string"==typeof e&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(void 0===e.value?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled}))),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=i("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){0===this.cursor?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(" "===e)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(c.hide):this.out.write(i(this.outputText,this.out.columns)),super.render();let t=a(this.cursor,this.choices.length,this.optionsPerPage),n=t.startIndex,l=t.endIndex;if(this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let t=n;t<l;t++){let r,i,a="",c=this.choices[t];i=t===n&&n>0?o.arrowUp:t===l-1&&l<this.choices.length?o.arrowDown:" ",c.disabled?(r=this.cursor===t?e.gray().underline(c.title):e.strikethrough().gray(c.title),i=(this.cursor===t?e.bold().gray(o.pointer)+" ":" ")+i):(r=this.cursor===t?e.cyan().underline(c.title):c.title,i=(this.cursor===t?e.cyan(o.pointer)+" ":" ")+i,c.description&&this.cursor===t&&(a=` - ${c.description}`,(i.length+r.length+a.length>=this.out.columns||c.description.split(/\r?\n/).length>1)&&(a="\n"+s(c.description,{margin:3,width:this.out.columns})))),this.outputText+=`${i} ${r}${e.gray(a)}\n`}}this.out.write(this.outputText)}},select$1}function requireToggle$1(){if(hasRequiredToggle$1)return toggle$1;hasRequiredToggle$1=1;const e=requireKleur(),t=requirePrompt$1(),n=requireUtil$4(),r=n.style,i=n.clear,o=requireSrc$6(),s=o.cursor,a=o.erase;return toggle$1=class extends t{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}deactivate(){if(!1===this.value)return this.bell();this.value=!1,this.render()}activate(){if(!0===this.value)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(" "===e)this.value=!this.value;else if("1"===e)this.value=!0;else{if("0"!==e)return this.bell();this.value=!1}this.render()}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(a.line+s.to(0)+this.outputText))}}}function requireDatepart$1(){if(hasRequiredDatepart$1)return datepart$1;hasRequiredDatepart$1=1;class e{constructor({token:e,date:t,parts:n,locales:r}){this.token=e,this.date=t||new Date,this.parts=n||[this],this.locales=r||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((n,r)=>r>t&&n instanceof e))}setTo(e){}prev(){let t=[].concat(this.parts).reverse();const n=t.indexOf(this);return t.find(((t,r)=>r>n&&t instanceof e))}toString(){return String(this.date)}}return datepart$1=e}function requireMeridiem$1(){if(hasRequiredMeridiem$1)return meridiem$1;hasRequiredMeridiem$1=1;const e=requireDatepart$1();return meridiem$1=class extends e{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}},meridiem$1}function requireDay$1(){if(hasRequiredDay$1)return day$1;hasRequiredDay$1=1;const e=requireDatepart$1();return day$1=class extends e{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return"DD"===this.token?String(e).padStart(2,"0"):"Do"===this.token?e+(n=e,1==(n%=10)?"st":2===n?"nd":3===n?"rd":"th"):"d"===this.token?t+1:"ddd"===this.token?this.locales.weekdaysShort[t]:"dddd"===this.token?this.locales.weekdays[t]:e;var n}},day$1}function requireHours$1(){if(hasRequiredHours$1)return hours$1;hasRequiredHours$1=1;const e=requireDatepart$1();return hours$1=class extends e{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}},hours$1}function requireMilliseconds$1(){if(hasRequiredMilliseconds$1)return milliseconds$1;hasRequiredMilliseconds$1=1;const e=requireDatepart$1();return milliseconds$1=class extends e{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}}function requireMinutes$1(){if(hasRequiredMinutes$1)return minutes$1;hasRequiredMinutes$1=1;const e=requireDatepart$1();return minutes$1=class extends e{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}}}function requireMonth$1(){if(hasRequiredMonth$1)return month$1;hasRequiredMonth$1=1;const e=requireDatepart$1();return month$1=class extends e{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return 2===t?String(e+1).padStart(2,"0"):3===t?this.locales.monthsShort[e]:4===t?this.locales.months[e]:String(e+1)}},month$1}function requireSeconds$1(){if(hasRequiredSeconds$1)return seconds$1;hasRequiredSeconds$1=1;const e=requireDatepart$1();return seconds$1=class extends e{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}}}function requireYear$1(){if(hasRequiredYear$1)return year$1;hasRequiredYear$1=1;const e=requireDatepart$1();return year$1=class extends e{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return 2===this.token.length?e.substr(-2):e}},year$1}function requireDateparts$1(){return hasRequiredDateparts$1?dateparts$1:(hasRequiredDateparts$1=1,dateparts$1={DatePart:requireDatepart$1(),Meridiem:requireMeridiem$1(),Day:requireDay$1(),Hours:requireHours$1(),Milliseconds:requireMilliseconds$1(),Minutes:requireMinutes$1(),Month:requireMonth$1(),Seconds:requireSeconds$1(),Year:requireYear$1()})}function requireDate$1(){if(hasRequiredDate$1)return date$1;function e(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var s=t.apply(n,r);function a(t){e(s,i,o,a,c,"next",t)}function c(t){e(s,i,o,a,c,"throw",t)}a(void 0)}))}}hasRequiredDate$1=1;const n=requireKleur(),r=requirePrompt$1(),i=requireUtil$4(),o=i.style,s=i.clear,a=i.figures,c=requireSrc$6(),l=c.erase,u=c.cursor,d=requireDateparts$1(),p=d.DatePart,f=d.Meridiem,_=d.Day,m=d.Hours,h=d.Milliseconds,g=d.Minutes,A=d.Month,y=d.Seconds,v=d.Year,b=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,C={1:({token:e})=>e.replace(/\\(.)/g,"$1"),2:e=>new _(e),3:e=>new A(e),4:e=>new v(e),5:e=>new f(e),6:e=>new m(e),7:e=>new g(e),8:e=>new y(e),9:e=>new h(e)},E={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};return date$1=class extends r{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(E,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=s("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=b.exec(e);){let e=t.shift(),n=t.findIndex((e=>null!=e));this.parts.push(n in C?C[n]({token:t[n]||e,date:this.date,parts:this.parts,locales:this.locales}):t[n]||e)}let n=this.parts.reduce(((e,t)=>("string"==typeof t&&"string"==typeof e[e.length-1]?e[e.length-1]+=t:e.push(t),e)),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex((e=>e instanceof p))),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var e=this;return t((function*(){let t=yield e.validator(e.value);"string"==typeof t&&(e.errorMsg=t,t=!1),e.error=!t}))()}submit(){var e=this;return t((function*(){if(yield e.validate(),e.error)return e.color="red",e.fire(),void e.render();e.done=!0,e.aborted=!1,e.fire(),e.render(),e.out.write("\n"),e.close()}))()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(null==e)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(null==e)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex((e=>e instanceof p))),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(u.hide):this.out.write(s(this.outputText,this.out.columns)),super.render(),this.outputText=[o.symbol(this.done,this.aborted),n.bold(this.msg),o.delimiter(!1),this.parts.reduce(((e,t,r)=>e.concat(r!==this.cursor||this.done?t:n.cyan().underline(t.toString()))),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split("\n").reduce(((e,t,r)=>e+`\n${r?" ":a.pointerSmall} ${n.red().italic(t)}`),"")),this.out.write(l.line+u.to(0)+this.outputText))}},date$1}function requireNumber$1(){if(hasRequiredNumber$1)return number$1;function e(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function t(t){return function(){var n=this,r=arguments;return new Promise((function(i,o){var s=t.apply(n,r);function a(t){e(s,i,o,a,c,"next",t)}function c(t){e(s,i,o,a,c,"throw",t)}a(void 0)}))}}hasRequiredNumber$1=1;const n=requireKleur(),r=requirePrompt$1(),i=requireSrc$6(),o=i.cursor,s=i.erase,a=requireUtil$4(),c=a.style,l=a.figures,u=a.clear,d=a.lines,p=/[0-9]/,f=e=>void 0!==e,_=(e,t)=>{let n=Math.pow(10,t);return Math.round(e*n)/n};return number$1=class extends r{constructor(e={}){super(e),this.transform=c.render(e.style),this.msg=e.message,this.initial=f(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=f(e.min)?e.min:-1/0,this.max=f(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(e){e||0===e?(this.placeholder=!1,this.rendered=this.transform.render(`${_(e,this.round)}`),this._value=_(e,this.round)):(this.placeholder=!0,this.rendered=n.gray(this.transform.render(`${this.initial}`)),this._value=""),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return"-"===e||"."===e&&this.float||p.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=""!==e?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var e=this;return t((function*(){let t=yield e.validator(e.value);"string"==typeof t&&(e.errorMsg=t,t=!1),e.error=!t}))()}submit(){var e=this;return t((function*(){if(yield e.validate(),e.error)return e.color="red",e.fire(),void e.render();let t=e.value;e.value=""!==t?t:e.initial,e.done=!0,e.aborted=!1,e.error=!1,e.fire(),e.render(),e.out.write("\n"),e.close()}))()}up(){if(this.typed="",""===this.value&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",""===this.value&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(0===e.length)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",""!==this.value&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();const n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan","."===e)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(o.down(d(this.outputError,this.out.columns)-1)+u(this.outputError,this.out.columns)),this.out.write(u(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[c.symbol(this.done,this.aborted),n.bold(this.msg),c.delimiter(this.done),this.done&&(this.done||this.placeholder)?this.rendered:n[this.color]().underline(this.rendered)].join(" "),this.error&&(this.outputError+=this.errorMsg.split("\n").reduce(((e,t,r)=>e+`\n${r?" ":l.pointerSmall} ${n.red().italic(t)}`),"")),this.out.write(s.line+o.to(0)+this.outputText+o.save+this.outputError+o.restore))}},number$1}function requireMultiselect$1(){if(hasRequiredMultiselect$1)return multiselect$1;hasRequiredMultiselect$1=1;const e=requireKleur(),t=requireSrc$6().cursor,n=requirePrompt$1(),r=requireUtil$4(),i=r.clear,o=r.figures,s=r.style,a=r.wrap,c=r.entriesToDisplay;return multiselect$1=class extends n{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map(((e,t)=>("string"==typeof e&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(void 0===e.value?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled}))),this.clear=i("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map((e=>!e.selected)),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((e=>e.selected))}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){const e=this.value.filter((e=>e.selected));this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){0===this.cursor?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(void 0!==this.maxChoices||this.value[this.cursor].disabled)return this.bell();const e=!this.value[this.cursor].selected;this.value.filter((e=>!e.disabled)).forEach((t=>t.selected=e)),this.render()}_(e,t){if(" "===e)this.handleSpaceToggle();else{if("a"!==e)return this.bell();this.toggleAll()}}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${o.arrowUp}/${o.arrowDown}: Highlight option\n ${o.arrowLeft}/${o.arrowRight}/[space]: Toggle selection\n`+(void 0===this.maxChoices?" a: Toggle all\n":"")+" enter/return: Complete answer":""}renderOption(t,n,r,i){const s=(n.selected?e.green(o.radioOn):o.radioOff)+" "+i+" ";let c,l;return n.disabled?c=t===r?e.gray().underline(n.title):e.strikethrough().gray(n.title):(c=t===r?e.cyan().underline(n.title):n.title,t===r&&n.description&&(l=` - ${n.description}`,(s.length+c.length+l.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(l="\n"+a(n.description,{margin:s.length,width:this.out.columns})))),s+c+e.gray(l||"")}paginateOptions(t){if(0===t.length)return e.red("No matches for this query.");let n,r=c(this.cursor,t.length,this.optionsPerPage),i=r.startIndex,s=r.endIndex,a=[];for(let e=i;e<s;e++)n=e===i&&i>0?o.arrowUp:e===s-1&&s<t.length?o.arrowDown:" ",a.push(this.renderOption(this.cursor,t[e],e,n));return"\n"+a.join("\n")}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter((e=>e.selected)).map((e=>e.title)).join(", ");const t=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(e.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let n=[s.symbol(this.done,this.aborted),e.bold(this.msg),s.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.value),this.out.write(this.clear+n),this.clear=i(n,this.out.columns)}},multiselect$1}function requireAutocomplete$1(){if(hasRequiredAutocomplete$1)return autocomplete$1;function e(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}hasRequiredAutocomplete$1=1;const t=requireKleur(),n=requirePrompt$1(),r=requireSrc$6(),i=r.erase,o=r.cursor,s=requireUtil$4(),a=s.style,c=s.clear,l=s.figures,u=s.wrap,d=s.entriesToDisplay,p=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),f=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]);return autocomplete$1=class extends n{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial="number"==typeof e.initial?e.initial:((e,t)=>{const n=e.findIndex((e=>e.value===t||e.title===t));return n>-1?n:void 0})(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=a.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=c("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return"number"==typeof this._fb?e=this.choices[this._fb]:"string"==typeof this._fb&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=p(this.suggestions,e):this.value=this.fallback.value,this.fire()}complete(t){var n,r=this;return(n=function*(){const e=r.completing=r.suggest(r.input,r.choices),n=yield e;if(r.completing!==e)return;r.suggestions=n.map(((e,t,n)=>({title:f(n,t),value:p(n,t),description:e.description}))),r.completing=!1;const i=Math.max(n.length-1,0);r.moveSelect(Math.min(i,r.select)),t&&t()},function(){var t=this,r=arguments;return new Promise((function(i,o){var s=n.apply(t,r);function a(t){e(s,i,o,a,c,"next",t)}function c(t){e(s,i,o,a,c,"throw",t)}a(void 0)}))})()}reset(){this.input="",this.complete((()=>{this.moveSelect(void 0!==this.initial?this.initial:0),this.render()})),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(e,t){let n=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${n}${e}${r}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(0===this.cursor)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){0===this.select?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(e,n,r,i){let o,s=r?l.arrowUp:i?l.arrowDown:" ",a=n?t.cyan().underline(e.title):e.title;return s=(n?t.cyan(l.pointer)+" ":" ")+s,e.description&&(o=` - ${e.description}`,(s.length+a.length+o.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(o="\n"+u(e.description,{margin:3,width:this.out.columns}))),s+" "+a+t.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(o.hide):this.out.write(c(this.outputText,this.out.columns)),super.render();let e=d(this.select,this.choices.length,this.limit),n=e.startIndex,r=e.endIndex;if(this.outputText=[a.symbol(this.done,this.aborted,this.exited),t.bold(this.msg),a.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const e=this.suggestions.slice(n,r).map(((e,t)=>this.renderOption(e,this.select===t+n,0===t&&n>0,t+n===r-1&&r<this.choices.length))).join("\n");this.outputText+="\n"+(e||t.gray(this.fallback.title))}this.out.write(i.line+o.to(0)+this.outputText)}},autocomplete$1}function requireAutocompleteMultiselect$1(){if(hasRequiredAutocompleteMultiselect$1)return autocompleteMultiselect$1;hasRequiredAutocompleteMultiselect$1=1;const e=requireKleur(),t=requireSrc$6().cursor,n=requireMultiselect$1(),r=requireUtil$4(),i=r.clear,o=r.style,s=r.figures;return autocompleteMultiselect$1=class extends n{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=i("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){0===this.cursor?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((e=>!this.inputValue||(!("string"!=typeof e.title||!e.title.toLowerCase().includes(this.inputValue.toLowerCase()))||!("string"!=typeof e.value||!e.value.toLowerCase().includes(this.inputValue.toLowerCase())))));const t=this.filteredOptions.findIndex((t=>t===e));this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){const e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){" "===e?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${s.arrowUp}/${s.arrowDown}: Highlight option\n ${s.arrowLeft}/${s.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`:""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}\n`}renderOption(t,n,r){let i;return i=n.disabled?t===r?e.gray().underline(n.title):e.strikethrough().gray(n.title):t===r?e.cyan().underline(n.title):n.title,(n.selected?e.green(s.radioOn):s.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter((e=>e.selected)).map((e=>e.title)).join(", ");const t=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(e.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let n=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+n),this.clear=i(n,this.out.columns)}},autocompleteMultiselect$1}function requireConfirm$1(){if(hasRequiredConfirm$1)return confirm$1;hasRequiredConfirm$1=1;const e=requireKleur(),t=requirePrompt$1(),n=requireUtil$4(),r=n.style,i=n.clear,o=requireSrc$6(),s=o.erase,a=o.cursor;return confirm$1=class extends t{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(e,t){return"y"===e.toLowerCase()?(this.value=!0,this.submit()):"n"===e.toLowerCase()?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(a.hide):this.out.write(i(this.outputText,this.out.columns)),super.render(),this.outputText=[r.symbol(this.done,this.aborted),e.bold(this.msg),r.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(s.line+a.to(0)+this.outputText))}}}function requireElements$1(){return hasRequiredElements$1?elements$1:(hasRequiredElements$1=1,elements$1={TextPrompt:requireText$2(),SelectPrompt:requireSelect$1(),TogglePrompt:requireToggle$1(),DatePrompt:requireDate$1(),NumberPrompt:requireNumber$1(),MultiselectPrompt:requireMultiselect$1(),AutocompletePrompt:requireAutocomplete$1(),AutocompleteMultiselectPrompt:requireAutocompleteMultiselect$1(),ConfirmPrompt:requireConfirm$1()})}function requirePrompts$2(){return hasRequiredPrompts$2||(hasRequiredPrompts$2=1,function(){const e=prompts$3,t=requireElements$1(),n=e=>e;function r(e,r,i={}){return new Promise(((o,s)=>{const a=new t[e](r),c=i.onAbort||n,l=i.onSubmit||n,u=i.onExit||n;a.on("state",r.onState||n),a.on("submit",(e=>o(l(e)))),a.on("exit",(e=>o(u(e)))),a.on("abort",(e=>s(c(e))))}))}e.text=e=>r("TextPrompt",e),e.password=t=>(t.style="password",e.text(t)),e.invisible=t=>(t.style="invisible",e.text(t)),e.number=e=>r("NumberPrompt",e),e.date=e=>r("DatePrompt",e),e.confirm=e=>r("ConfirmPrompt",e),e.list=e=>{const t=e.separator||",";return r("TextPrompt",e,{onSubmit:e=>e.split(t).map((e=>e.trim()))})},e.toggle=e=>r("TogglePrompt",e),e.select=e=>r("SelectPrompt",e),e.multiselect=e=>{e.choices=[].concat(e.choices||[]);const t=e=>e.filter((e=>e.selected)).map((e=>e.value));return r("MultiselectPrompt",e,{onAbort:t,onSubmit:t})},e.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);const t=e=>e.filter((e=>e.selected)).map((e=>e.value));return r("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};const i=(e,t)=>Promise.resolve(t.filter((t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase())));e.autocomplete=e=>(e.suggest=e.suggest||i,e.choices=[].concat(e.choices||[]),r("AutocompletePrompt",e))}()),prompts$3}function requireDist$6(){if(hasRequiredDist$6)return dist$6;function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw s}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t,n,r,i,o,s){try{var a=e[o](s),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var s=e.apply(t,n);function a(e){o(s,r,i,a,c,"next",e)}function c(e){o(s,r,i,a,c,"throw",e)}a(void 0)}))}}hasRequiredDist$6=1;const a=requirePrompts$2(),c=["suggest","format","onState","validate","onRender","type"],l=()=>{};function u(){return d.apply(this,arguments)}function d(){return d=s((function*(e=[],{onSubmit:n=l,onCancel:i=l}={}){const o={},d=u._override||{};let f,_,m,h,g,A;e=[].concat(e);const y=function(){var e=s((function*(e,t,n=!1){if(n||!e.validate||!0===e.validate(t))return e.format?yield e.format(t,o):t}));return function(t,n){return e.apply(this,arguments)}}();var v,b=r(e);try{for(b.s();!(v=b.n()).done;){_=v.value;var C=_;if(h=C.name,g=C.type,"function"==typeof g&&(g=yield g(f,t({},o),_),_.type=g),g){for(let e in _){if(c.includes(e))continue;let n=_[e];_[e]="function"==typeof n?yield n(f,t({},o),A):n}if(A=_,"string"!=typeof _.message)throw new Error("prompt message is required");var E=_;if(h=E.name,g=E.type,void 0===a[g])throw new Error(`prompt type (${g}) is not defined`);if(void 0===d[_.name]||(f=yield y(_,d[_.name]),void 0===f)){try{f=u._injected?p(u._injected,_.initial):yield a[g](_),o[h]=f=yield y(_,f,!0),m=yield n(_,f,o)}catch(e){m=!(yield i(_,o))}if(m)return o}else o[h]=f}}}catch(e){b.e(e)}finally{b.f()}return o})),d.apply(this,arguments)}function p(e,t){const n=e.shift();if(n instanceof Error)throw n;return void 0===n?t:n}return dist$6=Object.assign(u,{prompt:u,prompts:a,inject:function(e){u._injected=(u._injected||[]).concat(e)},override:function(e){u._override=Object.assign({},e)}})}var prompts$2={},action,hasRequiredAction,strip,hasRequiredStrip,clear,hasRequiredClear,figures_1,hasRequiredFigures,style,hasRequiredStyle,lines,hasRequiredLines,wrap,hasRequiredWrap,entriesToDisplay,hasRequiredEntriesToDisplay,util$3,hasRequiredUtil$3,prompt,hasRequiredPrompt,text$1,hasRequiredText$1,select,hasRequiredSelect,toggle,hasRequiredToggle,datepart,hasRequiredDatepart,meridiem,hasRequiredMeridiem,day,hasRequiredDay,hours,hasRequiredHours,milliseconds,hasRequiredMilliseconds,minutes,hasRequiredMinutes,month,hasRequiredMonth,seconds,hasRequiredSeconds,year,hasRequiredYear,dateparts,hasRequiredDateparts,date,hasRequiredDate,number,hasRequiredNumber,multiselect,hasRequiredMultiselect,autocomplete,hasRequiredAutocomplete,autocompleteMultiselect,hasRequiredAutocompleteMultiselect,confirm,hasRequiredConfirm,elements,hasRequiredElements,hasRequiredPrompts$1,lib$f,hasRequiredLib$e,prompts$1,hasRequiredPrompts;function requireAction(){return hasRequiredAction?action:(hasRequiredAction=1,action=(e,t)=>{if(!e.meta||"escape"===e.name){if(e.ctrl){if("a"===e.name)return"first";if("c"===e.name)return"abort";if("d"===e.name)return"abort";if("e"===e.name)return"last";if("g"===e.name)return"reset"}if(t){if("j"===e.name)return"down";if("k"===e.name)return"up"}return"return"===e.name||"enter"===e.name?"submit":"backspace"===e.name?"delete":"delete"===e.name?"deleteForward":"abort"===e.name?"abort":"escape"===e.name?"exit":"tab"===e.name?"next":"pagedown"===e.name?"nextPage":"pageup"===e.name?"prevPage":"home"===e.name?"home":"end"===e.name?"end":"up"===e.name?"up":"down"===e.name?"down":"right"===e.name?"right":"left"===e.name&&"left"}})}function requireStrip(){return hasRequiredStrip||(hasRequiredStrip=1,strip=e=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),n=new RegExp(t,"g");return"string"==typeof e?e.replace(n,""):e}),strip}function requireClear(){if(hasRequiredClear)return clear;hasRequiredClear=1;const e=requireStrip(),{erase:t,cursor:n}=requireSrc$6(),r=t=>[...e(t)].length;return clear=function(e,i){if(!i)return t.line+n.to(0);let o=0;const s=e.split(/\r?\n/);for(let e of s)o+=1+Math.floor(Math.max(r(e)-1,0)/i);return t.lines(o)},clear}function requireFigures(){if(hasRequiredFigures)return figures_1;hasRequiredFigures=1;const e={arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",radioOn:"◉",radioOff:"◯",tick:"✔",cross:"✖",ellipsis:"…",pointerSmall:"›",line:"─",pointer:"❯"},t={arrowUp:e.arrowUp,arrowDown:e.arrowDown,arrowLeft:e.arrowLeft,arrowRight:e.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"√",cross:"×",ellipsis:"...",pointerSmall:"»",line:"─",pointer:">"},n="win32"===process.platform?t:e;return figures_1=n}function requireStyle(){if(hasRequiredStyle)return style;hasRequiredStyle=1;const e=requireKleur(),t=requireFigures(),n=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"😃".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}}),r=Object.freeze({aborted:e.red(t.cross),done:e.green(t.tick),exited:e.yellow(t.cross),default:e.cyan("?")});return style={styles:n,render:e=>n[e]||n.default,symbols:r,symbol:(e,t,n)=>t?r.aborted:n?r.exited:e?r.done:r.default,delimiter:n=>e.gray(n?t.ellipsis:t.pointerSmall),item:(n,r)=>e.gray(n?r?t.pointerSmall:"+":t.line)},style}function requireLines(){if(hasRequiredLines)return lines;hasRequiredLines=1;const e=requireStrip();return lines=function(t,n){let r=String(e(t)||"").split(/\r?\n/);return n?r.map((e=>Math.ceil(e.length/n))).reduce(((e,t)=>e+t)):r.length}}function requireWrap(){return hasRequiredWrap||(hasRequiredWrap=1,wrap=(e,t={})=>{const n=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",r=t.width;return(e||"").split(/\r?\n/g).map((e=>e.split(/\s+/g).reduce(((e,t)=>(t.length+n.length>=r||e[e.length-1].length+t.length+1<r?e[e.length-1]+=` ${t}`:e.push(`${n}${t}`),e)),[n]).join("\n"))).join("\n")}),wrap}function requireEntriesToDisplay(){return hasRequiredEntriesToDisplay?entriesToDisplay:(hasRequiredEntriesToDisplay=1,entriesToDisplay=(e,t,n)=>{n=n||t;let r=Math.min(t-n,e-Math.floor(n/2));return r<0&&(r=0),{startIndex:r,endIndex:Math.min(r+n,t)}})}function requireUtil$3(){return hasRequiredUtil$3?util$3:(hasRequiredUtil$3=1,util$3={action:requireAction(),clear:requireClear(),style:requireStyle(),strip:requireStrip(),figures:requireFigures(),lines:requireLines(),wrap:requireWrap(),entriesToDisplay:requireEntriesToDisplay()})}function requirePrompt(){if(hasRequiredPrompt)return prompt;hasRequiredPrompt=1;const e=require$$0$m,{action:t}=requireUtil$3(),n=require$$0$c,{beep:r,cursor:i}=requireSrc$6(),o=requireKleur();return prompt=class extends n{constructor(n={}){super(),this.firstRender=!0,this.in=n.stdin||process.stdin,this.out=n.stdout||process.stdout,this.onRender=(n.onRender||(()=>{})).bind(this);const r=e.createInterface({input:this.in,escapeCodeTimeout:50});e.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);const o=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,s=(e,n)=>{let r=t(n,o);!1===r?this._&&this._(e,n):"function"==typeof this[r]?this[r](n):this.bell()};this.close=()=>{this.out.write(i.show),this.in.removeListener("keypress",s),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",s)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(r)}render(){this.onRender(o),this.firstRender&&(this.firstRender=!1)}},prompt}function requireText$1(){if(hasRequiredText$1)return text$1;hasRequiredText$1=1;const e=requireKleur(),t=requirePrompt(),{erase:n,cursor:r}=requireSrc$6(),{style:i,clear:o,lines:s,figures:a}=requireUtil$3();return text$1=class extends t{constructor(e={}){super(e),this.transform=i.render(e.style),this.scale=this.transform.scale,this.msg=e.message,this.initial=e.initial||"",this.validator=e.validate||(()=>!0),this.value="",this.errorMsg=e.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=o("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=e.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let e=await this.validator(this.value);"string"==typeof e&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error)return this.red=!0,this.fire(),void this.render();this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(e){this.placeholder||(this.cursor=this.cursor+e,this.cursorOffset+=e)}_(e,t){let n=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor);this.value=`${n}${e}${r}`,this.red=!1,this.cursor=this.placeholder?0:n.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let e=this.value.slice(0,this.cursor-1),t=this.value.slice(this.cursor);this.value=`${e}${t}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let e=this.value.slice(0,this.cursor),t=this.value.slice(this.cursor+1);this.value=`${e}${t}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return 0===this.cursor||this.placeholder&&1===this.cursor}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(r.down(s(this.outputError,this.out.columns)-1)+o(this.outputError,this.out.columns)),this.out.write(o(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(this.done),this.red?e.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split("\n").reduce(((t,n,r)=>t+`\n${r?" ":a.pointerSmall} ${e.red().italic(n)}`),"")),this.out.write(n.line+r.to(0)+this.outputText+r.save+this.outputError+r.restore+r.move(this.cursorOffset,0)))}},text$1}function requireSelect(){if(hasRequiredSelect)return select;hasRequiredSelect=1;const e=requireKleur(),t=requirePrompt(),{style:n,clear:r,figures:i,wrap:o,entriesToDisplay:s}=requireUtil$3(),{cursor:a}=requireSrc$6();return select=class extends t{constructor(e={}){super(e),this.msg=e.message,this.hint=e.hint||"- Use arrow-keys. Return to submit.",this.warn=e.warn||"- This option is disabled",this.cursor=e.initial||0,this.choices=e.choices.map(((e,t)=>("string"==typeof e&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),value:e&&(void 0===e.value?t:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled}))),this.optionsPerPage=e.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=r("",this.out.columns),this.render()}moveCursor(e){this.cursor=e,this.value=this.choices[e].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){0===this.cursor?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(e,t){if(" "===e)return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(a.hide):this.out.write(r(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:c}=s(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(!1),this.done?this.selection.title:this.selection.disabled?e.yellow(this.warn):e.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let n=t;n<c;n++){let r,s,a="",l=this.choices[n];s=n===t&&t>0?i.arrowUp:n===c-1&&c<this.choices.length?i.arrowDown:" ",l.disabled?(r=this.cursor===n?e.gray().underline(l.title):e.strikethrough().gray(l.title),s=(this.cursor===n?e.bold().gray(i.pointer)+" ":" ")+s):(r=this.cursor===n?e.cyan().underline(l.title):l.title,s=(this.cursor===n?e.cyan(i.pointer)+" ":" ")+s,l.description&&this.cursor===n&&(a=` - ${l.description}`,(s.length+r.length+a.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(a="\n"+o(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${s} ${r}${e.gray(a)}\n`}}this.out.write(this.outputText)}},select}function requireToggle(){if(hasRequiredToggle)return toggle;hasRequiredToggle=1;const e=requireKleur(),t=requirePrompt(),{style:n,clear:r}=requireUtil$3(),{cursor:i,erase:o}=requireSrc$6();return toggle=class extends t{constructor(e={}){super(e),this.msg=e.message,this.value=!!e.initial,this.active=e.active||"on",this.inactive=e.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}deactivate(){if(!1===this.value)return this.bell();this.value=!1,this.render()}activate(){if(!0===this.value)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(e,t){if(" "===e)this.value=!this.value;else if("1"===e)this.value=!0;else{if("0"!==e)return this.bell();this.value=!1}this.render()}render(){this.closed||(this.firstRender?this.out.write(i.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(this.done),this.value?this.inactive:e.cyan().underline(this.inactive),e.gray("/"),this.value?e.cyan().underline(this.active):this.active].join(" "),this.out.write(o.line+i.to(0)+this.outputText))}}}function requireDatepart(){if(hasRequiredDatepart)return datepart;hasRequiredDatepart=1;class e{constructor({token:e,date:t,parts:n,locales:r}){this.token=e,this.date=t||new Date,this.parts=n||[this],this.locales=r||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find(((n,r)=>r>t&&n instanceof e))}setTo(e){}prev(){let t=[].concat(this.parts).reverse();const n=t.indexOf(this);return t.find(((t,r)=>r>n&&t instanceof e))}toString(){return String(this.date)}}return datepart=e}function requireMeridiem(){if(hasRequiredMeridiem)return meridiem;hasRequiredMeridiem=1;const e=requireDatepart();return meridiem=class extends e{constructor(e={}){super(e)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let e=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?e.toUpperCase():e}}}function requireDay(){if(hasRequiredDay)return day;hasRequiredDay=1;const e=requireDatepart();return day=class extends e{constructor(e={}){super(e)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(e){this.date.setDate(parseInt(e.substr(-2)))}toString(){let e=this.date.getDate(),t=this.date.getDay();return"DD"===this.token?String(e).padStart(2,"0"):"Do"===this.token?e+(n=e,1==(n%=10)?"st":2===n?"nd":3===n?"rd":"th"):"d"===this.token?t+1:"ddd"===this.token?this.locales.weekdaysShort[t]:"dddd"===this.token?this.locales.weekdays[t]:e;var n}},day}function requireHours(){if(hasRequiredHours)return hours;hasRequiredHours=1;const e=requireDatepart();return hours=class extends e{constructor(e={}){super(e)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(e){this.date.setHours(parseInt(e.substr(-2)))}toString(){let e=this.date.getHours();return/h/.test(this.token)&&(e=e%12||12),this.token.length>1?String(e).padStart(2,"0"):e}}}function requireMilliseconds(){if(hasRequiredMilliseconds)return milliseconds;hasRequiredMilliseconds=1;const e=requireDatepart();return milliseconds=class extends e{constructor(e={}){super(e)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(e){this.date.setMilliseconds(parseInt(e.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}}function requireMinutes(){if(hasRequiredMinutes)return minutes;hasRequiredMinutes=1;const e=requireDatepart();return minutes=class extends e{constructor(e={}){super(e)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(e){this.date.setMinutes(parseInt(e.substr(-2)))}toString(){let e=this.date.getMinutes();return this.token.length>1?String(e).padStart(2,"0"):e}}}function requireMonth(){if(hasRequiredMonth)return month;hasRequiredMonth=1;const e=requireDatepart();return month=class extends e{constructor(e={}){super(e)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(e){e=parseInt(e.substr(-2))-1,this.date.setMonth(e<0?0:e)}toString(){let e=this.date.getMonth(),t=this.token.length;return 2===t?String(e+1).padStart(2,"0"):3===t?this.locales.monthsShort[e]:4===t?this.locales.months[e]:String(e+1)}}}function requireSeconds(){if(hasRequiredSeconds)return seconds;hasRequiredSeconds=1;const e=requireDatepart();return seconds=class extends e{constructor(e={}){super(e)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(e){this.date.setSeconds(parseInt(e.substr(-2)))}toString(){let e=this.date.getSeconds();return this.token.length>1?String(e).padStart(2,"0"):e}}}function requireYear(){if(hasRequiredYear)return year;hasRequiredYear=1;const e=requireDatepart();return year=class extends e{constructor(e={}){super(e)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(e){this.date.setFullYear(e.substr(-4))}toString(){let e=String(this.date.getFullYear()).padStart(4,"0");return 2===this.token.length?e.substr(-2):e}}}function requireDateparts(){return hasRequiredDateparts?dateparts:(hasRequiredDateparts=1,dateparts={DatePart:requireDatepart(),Meridiem:requireMeridiem(),Day:requireDay(),Hours:requireHours(),Milliseconds:requireMilliseconds(),Minutes:requireMinutes(),Month:requireMonth(),Seconds:requireSeconds(),Year:requireYear()})}function requireDate(){if(hasRequiredDate)return date;hasRequiredDate=1;const e=requireKleur(),t=requirePrompt(),{style:n,clear:r,figures:i}=requireUtil$3(),{erase:o,cursor:s}=requireSrc$6(),{DatePart:a,Meridiem:c,Day:l,Hours:u,Milliseconds:d,Minutes:p,Month:f,Seconds:_,Year:m}=requireDateparts(),h=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,g={1:({token:e})=>e.replace(/\\(.)/g,"$1"),2:e=>new l(e),3:e=>new f(e),4:e=>new m(e),5:e=>new c(e),6:e=>new u(e),7:e=>new p(e),8:e=>new _(e),9:e=>new d(e)},A={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};return date=class extends t{constructor(e={}){super(e),this.msg=e.message,this.cursor=0,this.typed="",this.locales=Object.assign(A,e.locales),this._date=e.initial||new Date,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.mask=e.mask||"YYYY-MM-DD HH:mm:ss",this.clear=r("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(e){e&&this._date.setTime(e.getTime())}set mask(e){let t;for(this.parts=[];t=h.exec(e);){let e=t.shift(),n=t.findIndex((e=>null!=e));this.parts.push(n in g?g[n]({token:t[n]||e,date:this.date,parts:this.parts,locales:this.locales}):t[n]||e)}let n=this.parts.reduce(((e,t)=>("string"==typeof t&&"string"==typeof e[e.length-1]?e[e.length-1]+=t:e.push(t),e)),[]);this.parts.splice(0),this.parts.push(...n),this.reset()}moveCursor(e){this.typed="",this.cursor=e,this.fire()}reset(){this.moveCursor(this.parts.findIndex((e=>e instanceof a))),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let e=await this.validator(this.value);"string"==typeof e&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error)return this.color="red",this.fire(),void this.render();this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let e=this.parts[this.cursor].prev();if(null==e)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}right(){let e=this.parts[this.cursor].next();if(null==e)return this.bell();this.moveCursor(this.parts.indexOf(e)),this.render()}next(){let e=this.parts[this.cursor].next();this.moveCursor(e?this.parts.indexOf(e):this.parts.findIndex((e=>e instanceof a))),this.render()}_(e){/\d/.test(e)&&(this.typed+=e,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(s.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(!1),this.parts.reduce(((t,n,r)=>t.concat(r!==this.cursor||this.done?n:e.cyan().underline(n.toString()))),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split("\n").reduce(((t,n,r)=>t+`\n${r?" ":i.pointerSmall} ${e.red().italic(n)}`),"")),this.out.write(o.line+s.to(0)+this.outputText))}},date}function requireNumber(){if(hasRequiredNumber)return number;hasRequiredNumber=1;const e=requireKleur(),t=requirePrompt(),{cursor:n,erase:r}=requireSrc$6(),{style:i,figures:o,clear:s,lines:a}=requireUtil$3(),c=/[0-9]/,l=e=>void 0!==e,u=(e,t)=>{let n=Math.pow(10,t);return Math.round(e*n)/n};return number=class extends t{constructor(e={}){super(e),this.transform=i.render(e.style),this.msg=e.message,this.initial=l(e.initial)?e.initial:"",this.float=!!e.float,this.round=e.round||2,this.inc=e.increment||1,this.min=l(e.min)?e.min:-1/0,this.max=l(e.max)?e.max:1/0,this.errorMsg=e.error||"Please Enter A Valid Value",this.validator=e.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){t||0===t?(this.placeholder=!1,this.rendered=this.transform.render(`${u(t,this.round)}`),this._value=u(t,this.round)):(this.placeholder=!0,this.rendered=e.gray(this.transform.render(`${this.initial}`)),this._value=""),this.fire()}get value(){return this._value}parse(e){return this.float?parseFloat(e):parseInt(e)}valid(e){return"-"===e||"."===e&&this.float||c.test(e)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let e=this.value;this.value=""!==e?e:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let e=await this.validator(this.value);"string"==typeof e&&(this.errorMsg=e,e=!1),this.error=!e}async submit(){if(await this.validate(),this.error)return this.color="red",this.fire(),void this.render();let e=this.value;this.value=""!==e?e:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}up(){if(this.typed="",""===this.value&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",""===this.value&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let e=this.value.toString();if(0===e.length)return this.bell();this.value=this.parse(e=e.slice(0,-1))||"",""!==this.value&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(e,t){if(!this.valid(e))return this.bell();const n=Date.now();if(n-this.lastHit>1e3&&(this.typed=""),this.typed+=e,this.lastHit=n,this.color="cyan","."===e)return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(n.down(a(this.outputError,this.out.columns)-1)+s(this.outputError,this.out.columns)),this.out.write(s(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(this.done),this.done&&(this.done||this.placeholder)?this.rendered:e[this.color]().underline(this.rendered)].join(" "),this.error&&(this.outputError+=this.errorMsg.split("\n").reduce(((t,n,r)=>t+`\n${r?" ":o.pointerSmall} ${e.red().italic(n)}`),"")),this.out.write(r.line+n.to(0)+this.outputText+n.save+this.outputError+n.restore))}},number}function requireMultiselect(){if(hasRequiredMultiselect)return multiselect;hasRequiredMultiselect=1;const e=requireKleur(),{cursor:t}=requireSrc$6(),n=requirePrompt(),{clear:r,figures:i,style:o,wrap:s,entriesToDisplay:a}=requireUtil$3();return multiselect=class extends n{constructor(e={}){super(e),this.msg=e.message,this.cursor=e.cursor||0,this.scrollIndex=e.cursor||0,this.hint=e.hint||"",this.warn=e.warn||"- This option is disabled -",this.minSelected=e.min,this.showMinError=!1,this.maxChoices=e.max,this.instructions=e.instructions,this.optionsPerPage=e.optionsPerPage||10,this.value=e.choices.map(((e,t)=>("string"==typeof e&&(e={title:e,value:t}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(void 0===e.value?t:e.value),selected:e&&e.selected,disabled:e&&e.disabled}))),this.clear=r("",this.out.columns),e.overrideRender||this.render()}reset(){this.value.map((e=>!e.selected)),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((e=>e.selected))}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){const e=this.value.filter((e=>e.selected));this.minSelected&&e.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){0===this.cursor?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const e=this.value[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}toggleAll(){if(void 0!==this.maxChoices||this.value[this.cursor].disabled)return this.bell();const e=!this.value[this.cursor].selected;this.value.filter((e=>!e.disabled)).forEach((t=>t.selected=e)),this.render()}_(e,t){if(" "===e)this.handleSpaceToggle();else{if("a"!==e)return this.bell();this.toggleAll()}}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${i.arrowUp}/${i.arrowDown}: Highlight option\n ${i.arrowLeft}/${i.arrowRight}/[space]: Toggle selection\n`+(void 0===this.maxChoices?" a: Toggle all\n":"")+" enter/return: Complete answer":""}renderOption(t,n,r,o){const a=(n.selected?e.green(i.radioOn):i.radioOff)+" "+o+" ";let c,l;return n.disabled?c=t===r?e.gray().underline(n.title):e.strikethrough().gray(n.title):(c=t===r?e.cyan().underline(n.title):n.title,t===r&&n.description&&(l=` - ${n.description}`,(a.length+c.length+l.length>=this.out.columns||n.description.split(/\r?\n/).length>1)&&(l="\n"+s(n.description,{margin:a.length,width:this.out.columns})))),a+c+e.gray(l||"")}paginateOptions(t){if(0===t.length)return e.red("No matches for this query.");let n,{startIndex:r,endIndex:o}=a(this.cursor,t.length,this.optionsPerPage),s=[];for(let e=r;e<o;e++)n=e===r&&r>0?i.arrowUp:e===o-1&&o<t.length?i.arrowDown:" ",s.push(this.renderOption(this.cursor,t[e],e,n));return"\n"+s.join("\n")}renderOptions(e){return this.done?"":this.paginateOptions(e)}renderDoneOrInstructions(){if(this.done)return this.value.filter((e=>e.selected)).map((e=>e.title)).join(", ");const t=[e.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(e.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let n=[o.symbol(this.done,this.aborted),e.bold(this.msg),o.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.value),this.out.write(this.clear+n),this.clear=r(n,this.out.columns)}},multiselect}function requireAutocomplete(){if(hasRequiredAutocomplete)return autocomplete;hasRequiredAutocomplete=1;const e=requireKleur(),t=requirePrompt(),{erase:n,cursor:r}=requireSrc$6(),{style:i,clear:o,figures:s,wrap:a,entriesToDisplay:c}=requireUtil$3(),l=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),u=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]);return autocomplete=class extends t{constructor(e={}){super(e),this.msg=e.message,this.suggest=e.suggest,this.choices=e.choices,this.initial="number"==typeof e.initial?e.initial:((e,t)=>{const n=e.findIndex((e=>e.value===t||e.title===t));return n>-1?n:void 0})(e.choices,e.initial),this.select=this.initial||e.cursor||0,this.i18n={noMatches:e.noMatches||"no matches found"},this.fallback=e.fallback||this.initial,this.clearFirst=e.clearFirst||!1,this.suggestions=[],this.input="",this.limit=e.limit||10,this.cursor=0,this.transform=i.render(e.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=o("",this.out.columns),this.complete(this.render),this.render()}set fallback(e){this._fb=Number.isSafeInteger(parseInt(e))?parseInt(e):e}get fallback(){let e;return"number"==typeof this._fb?e=this.choices[this._fb]:"string"==typeof this._fb&&(e={title:this._fb}),e||this._fb||{title:this.i18n.noMatches}}moveSelect(e){this.select=e,this.suggestions.length>0?this.value=l(this.suggestions,e):this.value=this.fallback.value,this.fire()}async complete(e){const t=this.completing=this.suggest(this.input,this.choices),n=await t;if(this.completing!==t)return;this.suggestions=n.map(((e,t,n)=>({title:u(n,t),value:l(n,t),description:e.description}))),this.completing=!1;const r=Math.max(n.length-1,0);this.moveSelect(Math.min(r,this.select)),e&&e()}reset(){this.input="",this.complete((()=>{this.moveSelect(void 0!==this.initial?this.initial:0),this.render()})),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(e,t){let n=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor);this.input=`${n}${e}${r}`,this.cursor=n.length+1,this.complete(this.render),this.render()}delete(){if(0===this.cursor)return this.bell();let e=this.input.slice(0,this.cursor-1),t=this.input.slice(this.cursor);this.input=`${e}${t}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let e=this.input.slice(0,this.cursor),t=this.input.slice(this.cursor+1);this.input=`${e}${t}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){0===this.select?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,n,r,i){let o,c=r?s.arrowUp:i?s.arrowDown:" ",l=n?e.cyan().underline(t.title):t.title;return c=(n?e.cyan(s.pointer)+" ":" ")+c,t.description&&(o=` - ${t.description}`,(c.length+l.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o="\n"+a(t.description,{margin:3,width:this.out.columns}))),c+" "+l+e.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(r.hide):this.out.write(o(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:s}=c(this.select,this.choices.length,this.limit);if(this.outputText=[i.symbol(this.done,this.aborted,this.exited),e.bold(this.msg),i.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const n=this.suggestions.slice(t,s).map(((e,n)=>this.renderOption(e,this.select===n+t,0===n&&t>0,n+t===s-1&&s<this.choices.length))).join("\n");this.outputText+="\n"+(n||e.gray(this.fallback.title))}this.out.write(n.line+r.to(0)+this.outputText)}},autocomplete}function requireAutocompleteMultiselect(){if(hasRequiredAutocompleteMultiselect)return autocompleteMultiselect;hasRequiredAutocompleteMultiselect=1;const e=requireKleur(),{cursor:t}=requireSrc$6(),n=requireMultiselect(),{clear:r,style:i,figures:o}=requireUtil$3();return autocompleteMultiselect=class extends n{constructor(e={}){e.overrideRender=!0,super(e),this.inputValue="",this.clear=r("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){0===this.cursor?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const e=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((e=>!this.inputValue||(!("string"!=typeof e.title||!e.title.toLowerCase().includes(this.inputValue.toLowerCase()))||!("string"!=typeof e.value||!e.value.toLowerCase().includes(this.inputValue.toLowerCase())))));const t=this.filteredOptions.findIndex((t=>t===e));this.cursor=t<0?0:t,this.render()}handleSpaceToggle(){const e=this.filteredOptions[this.cursor];if(e.selected)e.selected=!1,this.render();else{if(e.disabled||this.value.filter((e=>e.selected)).length>=this.maxChoices)return this.bell();e.selected=!0,this.render()}}handleInputChange(e){this.inputValue=this.inputValue+e,this.updateFilteredOptions()}_(e,t){" "===e?this.handleSpaceToggle():this.handleInputChange(e)}renderInstructions(){return void 0===this.instructions||this.instructions?"string"==typeof this.instructions?this.instructions:`\nInstructions:\n ${o.arrowUp}/${o.arrowDown}: Highlight option\n ${o.arrowLeft}/${o.arrowRight}/[space]: Toggle selection\n [a,b,c]/delete: Filter choices\n enter/return: Complete answer\n`:""}renderCurrentInput(){return`\nFiltered results for: ${this.inputValue?this.inputValue:e.gray("Enter something to filter")}\n`}renderOption(t,n,r){let i;return i=n.disabled?t===r?e.gray().underline(n.title):e.strikethrough().gray(n.title):t===r?e.cyan().underline(n.title):n.title,(n.selected?e.green(o.radioOn):o.radioOff)+" "+i}renderDoneOrInstructions(){if(this.done)return this.value.filter((e=>e.selected)).map((e=>e.title)).join(", ");const t=[e.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(e.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(t.hide),super.render();let n=[i.symbol(this.done,this.aborted),e.bold(this.msg),i.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(n+=e.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),n+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+n),this.clear=r(n,this.out.columns)}},autocompleteMultiselect}function requireConfirm(){if(hasRequiredConfirm)return confirm;hasRequiredConfirm=1;const e=requireKleur(),t=requirePrompt(),{style:n,clear:r}=requireUtil$3(),{erase:i,cursor:o}=requireSrc$6();return confirm=class extends t{constructor(e={}){super(e),this.msg=e.message,this.value=e.initial,this.initialValue=!!e.initial,this.yesMsg=e.yes||"yes",this.yesOption=e.yesOption||"(Y/n)",this.noMsg=e.no||"no",this.noOption=e.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(e,t){return"y"===e.toLowerCase()?(this.value=!0,this.submit()):"n"===e.toLowerCase()?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(o.hide):this.out.write(r(this.outputText,this.out.columns)),super.render(),this.outputText=[n.symbol(this.done,this.aborted),e.bold(this.msg),n.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:e.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(i.line+o.to(0)+this.outputText))}}}function requireElements(){return hasRequiredElements?elements:(hasRequiredElements=1,elements={TextPrompt:requireText$1(),SelectPrompt:requireSelect(),TogglePrompt:requireToggle(),DatePrompt:requireDate(),NumberPrompt:requireNumber(),MultiselectPrompt:requireMultiselect(),AutocompletePrompt:requireAutocomplete(),AutocompleteMultiselectPrompt:requireAutocompleteMultiselect(),ConfirmPrompt:requireConfirm()})}function requirePrompts$1(){return hasRequiredPrompts$1||(hasRequiredPrompts$1=1,function(){const e=prompts$2,t=requireElements(),n=e=>e;function r(e,r,i={}){return new Promise(((o,s)=>{const a=new t[e](r),c=i.onAbort||n,l=i.onSubmit||n,u=i.onExit||n;a.on("state",r.onState||n),a.on("submit",(e=>o(l(e)))),a.on("exit",(e=>o(u(e)))),a.on("abort",(e=>s(c(e))))}))}e.text=e=>r("TextPrompt",e),e.password=t=>(t.style="password",e.text(t)),e.invisible=t=>(t.style="invisible",e.text(t)),e.number=e=>r("NumberPrompt",e),e.date=e=>r("DatePrompt",e),e.confirm=e=>r("ConfirmPrompt",e),e.list=e=>{const t=e.separator||",";return r("TextPrompt",e,{onSubmit:e=>e.split(t).map((e=>e.trim()))})},e.toggle=e=>r("TogglePrompt",e),e.select=e=>r("SelectPrompt",e),e.multiselect=e=>{e.choices=[].concat(e.choices||[]);const t=e=>e.filter((e=>e.selected)).map((e=>e.value));return r("MultiselectPrompt",e,{onAbort:t,onSubmit:t})},e.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);const t=e=>e.filter((e=>e.selected)).map((e=>e.value));return r("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};const i=(e,t)=>Promise.resolve(t.filter((t=>t.title.slice(0,e.length).toLowerCase()===e.toLowerCase())));e.autocomplete=e=>(e.suggest=e.suggest||i,e.choices=[].concat(e.choices||[]),r("AutocompletePrompt",e))}()),prompts$2}function requireLib$e(){if(hasRequiredLib$e)return lib$f;hasRequiredLib$e=1;const e=requirePrompts$1(),t=["suggest","format","onState","validate","onRender","type"],n=()=>{};async function r(o=[],{onSubmit:s=n,onCancel:a=n}={}){const c={},l=r._override||{};let u,d,p,f,_,m;o=[].concat(o);const h=async(e,t,n=!1)=>{if(n||!e.validate||!0===e.validate(t))return e.format?await e.format(t,c):t};for(d of o)if(({name:f,type:_}=d),"function"==typeof _&&(_=await _(u,{...c},d),d.type=_),_){for(let e in d){if(t.includes(e))continue;let n=d[e];d[e]="function"==typeof n?await n(u,{...c},m):n}if(m=d,"string"!=typeof d.message)throw new Error("prompt message is required");if(({name:f,type:_}=d),void 0===e[_])throw new Error(`prompt type (${_}) is not defined`);if(void 0===l[d.name]||(u=await h(d,l[d.name]),void 0===u)){try{u=r._injected?i(r._injected,d.initial):await e[_](d),c[f]=u=await h(d,u,!0),p=await s(d,u,c)}catch(e){p=!await a(d,c)}if(p)return c}else c[f]=u}return c}function i(e,t){const n=e.shift();if(n instanceof Error)throw n;return void 0===n?t:n}return lib$f=Object.assign(r,{prompt:r,prompts:e,inject:function(e){r._injected=(r._injected||[]).concat(e)},override:function(e){r._override=Object.assign({},e)}})}function requirePrompts(){if(hasRequiredPrompts)return prompts$1;return hasRequiredPrompts=1,prompts$1=function(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let t=0,n=process.versions.node.split(".").map(Number);for(;t<e.length;t++){if(n[t]>e[t])return!1;if(e[t]>n[t])return!0}return!1}("8.6.0")?requireDist$6():requireLib$e(),prompts$1}var promptsExports=requirePrompts(),prompts=getDefaultExportFromCjs(promptsExports),dist$5={},src$5={},hasRequiredSrc$5,hasRequiredDist$5;function requireSrc$5(){return hasRequiredSrc$5||(hasRequiredSrc$5=1,function(e){var t=src$5&&src$5.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});const n=require$$0$7,r=t(requireSrc$8()).default("@kwsites/file-exists");e.exists=function(t,i=e.READABLE){return function(e,t,i){r("checking %s",e);try{const o=n.statSync(e);return o.isFile()&&t?(r("[OK] path represents a file"),!0):o.isDirectory()&&i?(r("[OK] path represents a directory"),!0):(r("[FAIL] path represents something other than a file or directory"),!1)}catch(e){if("ENOENT"===e.code)return r("[FAIL] path is not accessible: %o",e),!1;throw r("[FATAL] %o",e),e}}(t,(i&e.FILE)>0,(i&e.FOLDER)>0)},e.FILE=1,e.FOLDER=2,e.READABLE=e.FILE+e.FOLDER}(src$5)),src$5}function requireDist$5(){return hasRequiredDist$5||(hasRequiredDist$5=1,e=dist$5,Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(requireSrc$5())),dist$5;var e}var distExports$2=requireDist$5(),dist$4={},hasRequiredDist$4;function requireDist$4(){if(hasRequiredDist$4)return dist$4;function e(){let e,t,n="pending";return{promise:new Promise(((n,r)=>{e=n,t=r})),done(t){"pending"===n&&(n="resolved",e(t))},fail(e){"pending"===n&&(n="rejected",t(e))},get fulfilled(){return"pending"!==n},get status(){return n}}}return hasRequiredDist$4=1,Object.defineProperty(dist$4,"__esModule",{value:!0}),dist$4.createDeferred=dist$4.deferred=void 0,dist$4.deferred=e,dist$4.createDeferred=e,dist$4.default=e,dist$4}var distExports$1=requireDist$4(),__defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__esm=(e,t)=>function(){return e&&(t=(0,e[__getOwnPropNames(e)[0]])(e=0)),t},__commonJS=(e,t)=>function(){return t||(0,e[__getOwnPropNames(e)[0]])((t={exports:{}}).exports,t),t.exports},__export=(e,t)=>{for(var n in t)__defProp(e,n,{get:t[n],enumerable:!0})},__copyProps=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of __getOwnPropNames(t))__hasOwnProp.call(e,i)||i===n||__defProp(e,i,{get:()=>t[i],enumerable:!(r=__getOwnPropDesc(t,i))||r.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__async=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())})),cache;function pathspec(...e){const t=new String(e);return cache.set(t,e),t}function isPathSpec(e){return e instanceof String&&cache.has(e)}function toPaths(e){return cache.get(e)||[]}var init_pathspec=__esm({"src/lib/args/pathspec.ts"(){cache=new WeakMap}}),GitError,init_git_error=__esm({"src/lib/errors/git-error.ts"(){GitError=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),GitResponseError,init_git_response_error=__esm({"src/lib/errors/git-response-error.ts"(){init_git_error(),GitResponseError=class extends GitError{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),TaskConfigurationError,init_task_configuration_error=__esm({"src/lib/errors/task-configuration-error.ts"(){init_git_error(),TaskConfigurationError=class extends GitError{constructor(e){super(void 0,e)}}}}),NULL,NOOP$1,objectToString;function asFunction(e){return"function"==typeof e?e:NOOP$1}function isUserFunction(e){return"function"==typeof e&&e!==NOOP$1}function splitOn(e,t){const n=e.indexOf(t);return n<=0?[e,""]:[e.substr(0,n),e.substr(n+1)]}function first(e,t=0){return isArrayLike(e)&&e.length>t?e[t]:void 0}function last(e,t=0){if(isArrayLike(e)&&e.length>t)return e[e.length-1-t]}function isArrayLike(e){return!(!e||"number"!=typeof e.length)}function toLinesWithContent(e="",t=!0,n="\n"){return e.split(n).reduce(((e,n)=>{const r=t?n.trim():n;return r&&e.push(r),e}),[])}function forEachLineWithContent(e,t){return toLinesWithContent(e,!0).map((e=>t(e)))}function folderExists(e){return distExports$2.exists(e,distExports$2.FOLDER)}function append(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function including(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function remove(e,t){if(Array.isArray(e)){const n=e.indexOf(t);n>=0&&e.splice(n,1)}else e.delete(t);return t}function asArray(e){return Array.isArray(e)?e:[e]}function asCamelCase(e){return e.replace(/[\s-]+(.)/g,((e,t)=>t.toUpperCase()))}function asStringArray(e){return asArray(e).map(String)}function asNumber(e,t=0){if(null==e)return t;const n=parseInt(e,10);return isNaN(n)?t:n}function prefixedArray(e,t){const n=[];for(let r=0,i=e.length;r<i;r++)n.push(t,e[r]);return n}function bufferToString(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function pick(e,t){return Object.assign({},...t.map((t=>t in e?{[t]:e[t]}:{})))}function delay(e=0){return new Promise((t=>setTimeout(t,e)))}function orVoid(e){if(!1!==e)return e}var init_util=__esm({"src/lib/utils/util.ts"(){NULL="\0",NOOP$1=()=>{},objectToString=Object.prototype.toString.call.bind(Object.prototype.toString)}}),filterArray,filterString,filterStringArray,filterStringOrStringArray,filterHasLength;function filterType(e,t,n){return t(e)?e:arguments.length>2?n:void 0}function filterPrimitives(e,t){const n=isPathSpec(e)?"string":typeof e;return/number|string|boolean/.test(n)&&(!t||!t.includes(n))}function filterPlainObject(e){return!!e&&"[object Object]"===objectToString(e)}function filterFunction(e){return"function"==typeof e}var init_argument_filters=__esm({"src/lib/utils/argument-filters.ts"(){init_util(),init_pathspec(),filterArray=e=>Array.isArray(e),filterString=e=>"string"==typeof e,filterStringArray=e=>Array.isArray(e)&&e.every(filterString),filterStringOrStringArray=e=>filterString(e)||Array.isArray(e)&&e.every(filterString),filterHasLength=e=>null!=e&&!"number|boolean|function".includes(typeof e)&&(Array.isArray(e)||"string"==typeof e||"number"==typeof e.length)}}),ExitCodes,init_exit_codes=__esm({"src/lib/utils/exit-codes.ts"(){ExitCodes=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(ExitCodes||{})}}),GitOutputStreams,init_git_output_streams=__esm({"src/lib/utils/git-output-streams.ts"(){GitOutputStreams=class{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new GitOutputStreams(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),LineParser,RemoteLineParser,init_line_parser=__esm({"src/lib/utils/line-parser.ts"(){LineParser=class{constructor(e,t){this.matches=[],this.parse=(e,t)=>(this.resetMatches(),!!this._regExp.every(((t,n)=>this.addMatch(t,n,e(n))))&&!1!==this.useMatches(t,this.prepareMatches())),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,n){const r=n&&e.exec(n);return r&&this.pushMatch(t,r),!!r}pushMatch(e,t){this.matches.push(...t.slice(1))}},RemoteLineParser=class extends LineParser{addMatch(e,t,n){return/^remote:\s/.test(String(n))&&super.addMatch(e,t,n)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}}),defaultOptions;function createInstanceConfig(...e){const t=process.cwd(),n=Object.assign(__spreadValues({baseDir:t},defaultOptions),...e.filter((e=>"object"==typeof e&&e)));return n.baseDir=n.baseDir||t,n.trimmed=!0===n.trimmed,n}var init_simple_git_options=__esm({"src/lib/utils/simple-git-options.ts"(){defaultOptions={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function appendTaskOptions(e,t=[]){return filterPlainObject(e)?Object.keys(e).reduce(((t,n)=>{const r=e[n];return isPathSpec(r)?t.push(r):filterPrimitives(r,["boolean"])?t.push(n+"="+r):t.push(n),t}),t):t}function getTrailingOptions(e,t=0,n=!1){const r=[];for(let n=0,i=t<0?e.length:t;n<i;n++)"string|number".includes(typeof e[n])&&r.push(String(e[n]));return appendTaskOptions(trailingOptionsArgument(e),r),n||r.push(...trailingArrayArgument(e)),r}function trailingArrayArgument(e){const t="function"==typeof last(e);return filterType(last(e,t?1:0),filterArray,[])}function trailingOptionsArgument(e){const t=filterFunction(last(e));return filterType(last(e,t?1:0),filterPlainObject)}function trailingFunctionArgument(e,t=!0){const n=asFunction(last(e));return t||isUserFunction(n)?n:void 0}var init_task_options=__esm({"src/lib/utils/task-options.ts"(){init_argument_filters(),init_util(),init_pathspec()}});function callTaskParser(e,t){return e(t.stdOut,t.stdErr)}function parseStringResponse(e,t,n,r=!0){return asArray(n).forEach((n=>{for(let i=toLinesWithContent(n,r),o=0,s=i.length;o<s;o++){const n=(e=0)=>{if(!(o+e>=s))return i[o+e]};t.some((({parse:t})=>t(n,e)))}})),e}var init_task_parser=__esm({"src/lib/utils/task-parser.ts"(){init_util()}}),utils_exports={};__export(utils_exports,{ExitCodes:()=>ExitCodes,GitOutputStreams:()=>GitOutputStreams,LineParser:()=>LineParser,NOOP:()=>NOOP$1,NULL:()=>NULL,RemoteLineParser:()=>RemoteLineParser,append:()=>append,appendTaskOptions:()=>appendTaskOptions,asArray:()=>asArray,asCamelCase:()=>asCamelCase,asFunction:()=>asFunction,asNumber:()=>asNumber,asStringArray:()=>asStringArray,bufferToString:()=>bufferToString,callTaskParser:()=>callTaskParser,createInstanceConfig:()=>createInstanceConfig,delay:()=>delay,filterArray:()=>filterArray,filterFunction:()=>filterFunction,filterHasLength:()=>filterHasLength,filterPlainObject:()=>filterPlainObject,filterPrimitives:()=>filterPrimitives,filterString:()=>filterString,filterStringArray:()=>filterStringArray,filterStringOrStringArray:()=>filterStringOrStringArray,filterType:()=>filterType,first:()=>first,folderExists:()=>folderExists,forEachLineWithContent:()=>forEachLineWithContent,getTrailingOptions:()=>getTrailingOptions,including:()=>including,isUserFunction:()=>isUserFunction,last:()=>last,objectToString:()=>objectToString,orVoid:()=>orVoid,parseStringResponse:()=>parseStringResponse,pick:()=>pick,prefixedArray:()=>prefixedArray,remove:()=>remove,splitOn:()=>splitOn,toLinesWithContent:()=>toLinesWithContent,trailingFunctionArgument:()=>trailingFunctionArgument,trailingOptionsArgument:()=>trailingOptionsArgument});var init_utils=__esm({"src/lib/utils/index.ts"(){init_argument_filters(),init_exit_codes(),init_git_output_streams(),init_line_parser(),init_simple_git_options(),init_task_options(),init_task_parser(),init_util()}}),check_is_repo_exports={},CheckRepoActions,onError,parser;function checkIsRepoTask(e){switch(e){case"bare":return checkIsBareRepoTask();case"root":return checkIsRepoRootTask()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:onError,parser:parser}}function checkIsRepoRootTask(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:onError,parser:e=>/^\.(git)?$/.test(e.trim())}}function checkIsBareRepoTask(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:onError,parser:parser}}function isNotRepoMessage(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}__export(check_is_repo_exports,{CheckRepoActions:()=>CheckRepoActions,checkIsBareRepoTask:()=>checkIsBareRepoTask,checkIsRepoRootTask:()=>checkIsRepoRootTask,checkIsRepoTask:()=>checkIsRepoTask});var init_check_is_repo=__esm({"src/lib/tasks/check-is-repo.ts"(){init_utils(),CheckRepoActions=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(CheckRepoActions||{}),onError=({exitCode:e},t,n,r)=>{if(128===e&&isNotRepoMessage(t))return n(Buffer.from("false"));r(t)},parser=e=>"true"===e.trim()}}),CleanResponse,removalRegexp,dryRunRemovalRegexp,isFolderRegexp;function cleanSummaryParser(e,t){const n=new CleanResponse(e),r=e?dryRunRemovalRegexp:removalRegexp;return toLinesWithContent(t).forEach((e=>{const t=e.replace(r,"");n.paths.push(t),(isFolderRegexp.test(t)?n.folders:n.files).push(t)})),n}var init_CleanSummary=__esm({"src/lib/responses/CleanSummary.ts"(){init_utils(),CleanResponse=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},removalRegexp=/^[a-z]+\s*/i,dryRunRemovalRegexp=/^[a-z]+\s+[a-z]+\s*/i,isFolderRegexp=/\/$/}}),task_exports={},EMPTY_COMMANDS;function adhocExecTask(e){return{commands:EMPTY_COMMANDS,format:"empty",parser:e}}function configurationErrorTask(e){return{commands:EMPTY_COMMANDS,format:"empty",parser(){throw"string"==typeof e?new TaskConfigurationError(e):e}}}function straightThroughStringTask(e,t=!1){return{commands:e,format:"utf-8",parser:e=>t?String(e).trim():e}}function straightThroughBufferTask(e){return{commands:e,format:"buffer",parser:e=>e}}function isBufferTask(e){return"buffer"===e.format}function isEmptyTask(e){return"empty"===e.format||!e.commands.length}__export(task_exports,{EMPTY_COMMANDS:()=>EMPTY_COMMANDS,adhocExecTask:()=>adhocExecTask,configurationErrorTask:()=>configurationErrorTask,isBufferTask:()=>isBufferTask,isEmptyTask:()=>isEmptyTask,straightThroughBufferTask:()=>straightThroughBufferTask,straightThroughStringTask:()=>straightThroughStringTask});var init_task=__esm({"src/lib/tasks/task.ts"(){init_task_configuration_error(),EMPTY_COMMANDS=[]}}),clean_exports={},CONFIG_ERROR_INTERACTIVE_MODE,CONFIG_ERROR_MODE_REQUIRED,CONFIG_ERROR_UNKNOWN_OPTION,CleanOptions,CleanOptionValues;function cleanWithOptionsTask(e,t){const{cleanMode:n,options:r,valid:i}=getCleanOptions(e);return n?i.options?(r.push(...t),r.some(isInteractiveMode)?configurationErrorTask(CONFIG_ERROR_INTERACTIVE_MODE):cleanTask(n,r)):configurationErrorTask(CONFIG_ERROR_UNKNOWN_OPTION+JSON.stringify(e)):configurationErrorTask(CONFIG_ERROR_MODE_REQUIRED)}function cleanTask(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser:t=>cleanSummaryParser("n"===e,t)}}function isCleanOptionsArray(e){return Array.isArray(e)&&e.every((e=>CleanOptionValues.has(e)))}function getCleanOptions(e){let t,n=[],r={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach((e=>{isCleanMode(e)?(t=e,r.cleanMode=!0):r.options=r.options&&isKnownOption(n[n.length]=`-${e}`)})),{cleanMode:t,options:n,valid:r}}function isCleanMode(e){return"f"===e||"n"===e}function isKnownOption(e){return/^-[a-z]$/i.test(e)&&CleanOptionValues.has(e.charAt(1))}function isInteractiveMode(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:"--interactive"===e}__export(clean_exports,{CONFIG_ERROR_INTERACTIVE_MODE:()=>CONFIG_ERROR_INTERACTIVE_MODE,CONFIG_ERROR_MODE_REQUIRED:()=>CONFIG_ERROR_MODE_REQUIRED,CONFIG_ERROR_UNKNOWN_OPTION:()=>CONFIG_ERROR_UNKNOWN_OPTION,CleanOptions:()=>CleanOptions,cleanTask:()=>cleanTask,cleanWithOptionsTask:()=>cleanWithOptionsTask,isCleanOptionsArray:()=>isCleanOptionsArray});var init_clean=__esm({"src/lib/tasks/clean.ts"(){init_CleanSummary(),init_utils(),init_task(),CONFIG_ERROR_INTERACTIVE_MODE="Git clean interactive mode is not supported",CONFIG_ERROR_MODE_REQUIRED='Git clean mode parameter ("n" or "f") is required',CONFIG_ERROR_UNKNOWN_OPTION="Git clean unknown option found in: ",CleanOptions=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(CleanOptions||{}),CleanOptionValues=new Set(["i",...asStringArray(Object.values(CleanOptions))])}}),ConfigList;function configListParser(e){const t=new ConfigList;for(const n of configParser(e))t.addValue(n.file,String(n.key),n.value);return t}function configGetParser(e,t){let n=null;const r=[],i=new Map;for(const o of configParser(e,t))o.key===t&&(r.push(n=o.value),i.has(o.file)||i.set(o.file,[]),i.get(o.file).push(n));return{key:t,paths:Array.from(i.keys()),scopes:i,value:n,values:r}}function configFilePath(e){return e.replace(/^(file):/,"")}function*configParser(e,t=null){const n=e.split("\0");for(let e=0,r=n.length-1;e<r;){const r=configFilePath(n[e++]);let i=n[e++],o=t;if(i.includes("\n")){const e=splitOn(i,"\n");o=e[0],i=e[1]}yield{file:r,key:o,value:i}}}var init_ConfigList=__esm({"src/lib/responses/ConfigList.ts"(){init_utils(),ConfigList=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce(((e,t)=>Object.assign(e,this.values[t])),{})),this._all}addFile(e){if(!(e in this.values)){const t=last(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,n){const r=this.addFile(e);r.hasOwnProperty(t)?Array.isArray(r[t])?r[t].push(n):r[t]=[r[t],n]:r[t]=n,this._all=void 0}}}}),GitConfigScope;function asConfigScope(e,t){return"string"==typeof e&&GitConfigScope.hasOwnProperty(e)?e:t}function addConfigTask(e,t,n,r){const i=["config",`--${r}`];return n&&i.push("--add"),i.push(e,t),{commands:i,format:"utf-8",parser:e=>e}}function getConfigTask(e,t){const n=["config","--null","--show-origin","--get-all",e];return t&&n.splice(1,0,`--${t}`),{commands:n,format:"utf-8",parser:t=>configGetParser(t,e)}}function listConfigTask(e){const t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser:e=>configListParser(e)}}function config_default(){return{addConfig(e,t,...n){return this._runTask(addConfigTask(e,t,!0===n[0],asConfigScope(n[1],"local")),trailingFunctionArgument(arguments))},getConfig(e,t){return this._runTask(getConfigTask(e,asConfigScope(t,void 0)),trailingFunctionArgument(arguments))},listConfig(...e){return this._runTask(listConfigTask(asConfigScope(e[0],void 0)),trailingFunctionArgument(arguments))}}}var init_config=__esm({"src/lib/tasks/config.ts"(){init_ConfigList(),init_utils(),GitConfigScope=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(GitConfigScope||{})}}),DiffNameStatus,diffNameStatus;function isDiffNameStatus(e){return diffNameStatus.has(e)}var init_diff_name_status=__esm({"src/lib/tasks/diff-name-status.ts"(){DiffNameStatus=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(DiffNameStatus||{}),diffNameStatus=new Set(Object.values(DiffNameStatus))}}),disallowedOptions,Query,_a,GrepQuery;function grepQueryBuilder(...e){return(new GrepQuery).param(...e)}function parseGrep(e){const t=new Set,n={};return forEachLineWithContent(e,(e=>{const[r,i,o]=e.split(NULL);t.add(r),(n[r]=n[r]||[]).push({line:asNumber(i),path:r,preview:o})})),{paths:t,results:n}}function grep_default(){return{grep(e){const t=trailingFunctionArgument(arguments),n=getTrailingOptions(arguments);for(const e of disallowedOptions)if(n.includes(e))return this._runTask(configurationErrorTask(`git.grep: use of "${e}" is not supported.`),t);"string"==typeof e&&(e=grepQueryBuilder().param(e));const r=["grep","--null","-n","--full-name",...n,...e];return this._runTask({commands:r,format:"utf-8",parser:e=>parseGrep(e)},t)}}}var init_grep=__esm({"src/lib/tasks/grep.ts"(){init_utils(),init_task(),disallowedOptions=["-h"],Query=Symbol("grepQuery"),GrepQuery=class{constructor(){this[_a]=[]}*[(_a=Query,Symbol.iterator)](){for(const e of this[Query])yield e}and(...e){return e.length&&this[Query].push("--and","(",...prefixedArray(e,"-e"),")"),this}param(...e){return this[Query].push(...prefixedArray(e,"-e")),this}}}}),reset_exports={},ResetMode,ResetModes;function resetTask(e,t){const n=["reset"];return isValidResetMode(e)&&n.push(`--${e}`),n.push(...t),straightThroughStringTask(n)}function getResetMode(e){if(isValidResetMode(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function isValidResetMode(e){return ResetModes.includes(e)}__export(reset_exports,{ResetMode:()=>ResetMode,getResetMode:()=>getResetMode,resetTask:()=>resetTask});var init_reset=__esm({"src/lib/tasks/reset.ts"(){init_task(),ResetMode=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(ResetMode||{}),ResetModes=Array.from(Object.values(ResetMode))}});function createLog(){return debugModule("simple-git")}function prefixedLogger(e,t,n){return t&&String(t).replace(/\s*/,"")?(r,...i)=>{e(`%s ${r}`,t,...i),n&&n(r,...i)}:n?(t,...r)=>{e(t,...r),n(t,...r)}:e}function childLoggerName(e,t,{namespace:n}){if("string"==typeof e)return e;const r=t&&t.namespace||"";return r.startsWith(n)?r.substr(n.length+1):r||n}function createLogger(e,t,n,r=createLog()){const i=e&&`[${e}]`||"",o=[],s="string"==typeof t?r.extend(t):t,a=childLoggerName(filterType(t,filterString),s,r);return function t(n){const o=n&&`[${n}]`||"",a=s&&prefixedLogger(s,o)||NOOP$1,l=prefixedLogger(r,`${i} ${o}`,a);return Object.assign(s?a:l,{label:e,sibling:c,info:l,step:t})}(n);function c(t,n){return append(o,createLogger(e,a.replace(/^[^:]+/,t),n,r))}}var init_git_logger=__esm({"src/lib/git-logger.ts"(){init_utils(),debugModule.formatters.L=e=>String(filterHasLength(e)?e.length:"-"),debugModule.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):objectToString(e)}}),_TasksPendingQueue,TasksPendingQueue,init_tasks_pending_queue=__esm({"src/lib/runners/tasks-pending-queue.ts"(){init_git_error(),init_git_logger(),_TasksPendingQueue=class{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){const t=_TasksPendingQueue.getName(e.commands[0]);return{task:e,logger:createLogger(this.logLabel,t),name:t}}push(e){const t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(const[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info("Failed %o",e),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(t);if(0!==this._queue.size)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){const t=this.withProgress(e);if(!t)throw new GitError(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(e="empty"){return`task:${e}:${++_TasksPendingQueue.counter}`}},(TasksPendingQueue=_TasksPendingQueue).counter=0}}),GitExecutorChain;function pluginContext(e,t){return{method:first(e.commands)||"",commands:t}}function onErrorReceived(e,t){return n=>{t("[ERROR] child process exception %o",n),e.push(Buffer.from(String(n.stack),"ascii"))}}function onDataReceived(e,t,n,r){return i=>{n("%s received %L bytes",t,i),r("%B",i),e.push(i)}}var init_git_executor_chain=__esm({"src/lib/runners/git-executor-chain.ts"(){init_git_error(),init_task(),init_utils(),init_tasks_pending_queue(),GitExecutorChain=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new TasksPendingQueue}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then((()=>this.attemptTask(e)))}attemptTask(e){return __async(this,null,(function*(){const t=yield this._scheduler.next(),n=()=>this._queue.complete(e);try{const{logger:t}=this._queue.attempt(e);return yield isEmptyTask(e)?this.attemptEmptyTask(e,t):this.attemptRemoteTask(e,t)}catch(t){throw this.onFatalException(e,t)}finally{n(),t()}}))}onFatalException(e,t){const n=t instanceof GitError?Object.assign(t,{task:e}):new GitError(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}attemptRemoteTask(e,t){return __async(this,null,(function*(){const n=this._plugins.exec("spawn.binary","",pluginContext(e,e.commands)),r=this._plugins.exec("spawn.args",[...e.commands],pluginContext(e,e.commands)),i=yield this.gitResponse(e,n,r,this.outputHandler,t.step("SPAWN")),o=yield this.handleTaskData(e,r,i,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),isBufferTask(e)?callTaskParser(e.parser,o):callTaskParser(e.parser,o.asStrings())}))}attemptEmptyTask(e,t){return __async(this,null,(function*(){return t("empty task bypassing child process to call to task's parser"),e.parser(this)}))}handleTaskData(e,t,n,r){const{exitCode:i,rejection:o,stdOut:s,stdErr:a}=n;return new Promise(((c,l)=>{r("Preparing to handle process response exitCode=%d stdOut=",i);const{error:u}=this._plugins.exec("task.error",{error:o},__spreadValues(__spreadValues({},pluginContext(e,t)),n));return u&&e.onError?(r.info("exitCode=%s handling with custom error handler"),e.onError(n,u,(e=>{r.info("custom error handler treated as success"),r("custom error returned a %s",objectToString(e)),c(new GitOutputStreams(Array.isArray(e)?Buffer.concat(e):e,Buffer.concat(a)))}),l)):u?(r.info("handling as error: exitCode=%s stdErr=%s rejection=%o",i,a.length,o),l(u)):(r.info("retrieving task output complete"),void c(new GitOutputStreams(Buffer.concat(s),Buffer.concat(a))))}))}gitResponse(e,t,n,r,i){return __async(this,null,(function*(){const o=i.sibling("output"),s=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},pluginContext(e,e.commands));return new Promise((a=>{const c=[],l=[];i.info("%s %o",t,n),i("%O",s);let u=this._beforeSpawn(e,n);if(u)return a({stdOut:c,stdErr:l,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,__spreadProps(__spreadValues({},pluginContext(e,n)),{kill(e){u=e||u}}));const d=spawn(t,n,s);d.stdout.on("data",onDataReceived(c,"stdOut",i,o.step("stdOut"))),d.stderr.on("data",onDataReceived(l,"stdErr",i,o.step("stdErr"))),d.on("error",onErrorReceived(l,i)),r&&(i("Passing child process stdOut/stdErr to custom outputHandler"),r(t,d.stdout,d.stderr,[...n])),this._plugins.exec("spawn.after",void 0,__spreadProps(__spreadValues({},pluginContext(e,n)),{spawned:d,close(e,t){a({stdOut:c,stdErr:l,exitCode:e,rejection:u||t})},kill(e){d.killed||(u=e,d.kill("SIGINT"))}}))}))}))}_beforeSpawn(e,t){let n;return this._plugins.exec("spawn.before",void 0,__spreadProps(__spreadValues({},pluginContext(e,t)),{kill(e){n=e||n}})),n}}}}),git_executor_exports={},GitExecutor;__export(git_executor_exports,{GitExecutor:()=>GitExecutor});var init_git_executor=__esm({"src/lib/runners/git-executor.ts"(){init_git_executor_chain(),GitExecutor=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new GitExecutorChain(this,this._scheduler,this._plugins)}chain(){return new GitExecutorChain(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function taskCallback(e,t,n=NOOP$1){t.then((e=>{n(null,e)}),(t=>{(null==t?void 0:t.task)===e&&n(t instanceof GitResponseError?addDeprecationNoticeToError(t):t,void 0)}))}function addDeprecationNoticeToError(e){let t=e=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${e} should be GitResponseError.git.${e}, this will no longer be available in version 3`),t=NOOP$1};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce((function(n,r){if(r in e)return n;return n[r]={enumerable:!1,configurable:!1,get:()=>(t(r),e.git[r])},n}),{}))}var init_task_callback=__esm({"src/lib/task-callback.ts"(){init_git_response_error(),init_utils()}});function changeWorkingDirectoryTask(e,t){return adhocExecTask((n=>{if(!folderExists(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e}))}var init_change_working_directory=__esm({"src/lib/tasks/change-working-directory.ts"(){init_utils(),init_task()}});function checkoutTask(e){const t=["checkout",...e];return"-b"===t[1]&&t.includes("-B")&&(t[1]=remove(t,"-B")),straightThroughStringTask(t)}function checkout_default(){return{checkout(){return this._runTask(checkoutTask(getTrailingOptions(arguments,1)),trailingFunctionArgument(arguments))},checkoutBranch(e,t){return this._runTask(checkoutTask(["-b",e,t,...getTrailingOptions(arguments)]),trailingFunctionArgument(arguments))},checkoutLocalBranch(e){return this._runTask(checkoutTask(["-b",e,...getTrailingOptions(arguments)]),trailingFunctionArgument(arguments))}}}var init_checkout=__esm({"src/lib/tasks/checkout.ts"(){init_utils(),init_task()}}),parser2;function countObjectsResponse(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function count_objects_default(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser:e=>parseStringResponse(countObjectsResponse(),[parser2],e)})}}}var init_count_objects=__esm({"src/lib/tasks/count-objects.ts"(){init_utils(),parser2=new LineParser(/([a-z-]+): (\d+)$/,((e,[t,n])=>{const r=asCamelCase(t);e.hasOwnProperty(r)&&(e[r]=asNumber(n))}))}}),parsers;function parseCommitResult(e){return parseStringResponse({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},parsers,e)}var init_parse_commit=__esm({"src/lib/parsers/parse-commit.ts"(){init_utils(),parsers=[new LineParser(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,((e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n})),new LineParser(/\s*Author:\s(.+)/i,((e,[t])=>{const n=t.split("<"),r=n.pop();r&&r.includes("@")&&(e.author={email:r.substr(0,r.length-1),name:n.join("<").trim()})})),new LineParser(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,((e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(r,10)||0})),new LineParser(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,((e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0;const i=parseInt(n,10)||0;"-"===r?e.summary.deletions=i:"+"===r&&(e.summary.insertions=i)}))]}});function commitTask(e,t,n){return{commands:["-c","core.abbrev=40","commit",...prefixedArray(e,"-m"),...t,...n],format:"utf-8",parser:parseCommitResult}}function commit_default(){return{commit(e,...t){const n=trailingFunctionArgument(arguments),r=function(e){return!filterStringOrStringArray(e)&&configurationErrorTask("git.commit: requires the commit message to be supplied as a string/string[]")}(e)||commitTask(asArray(e),asArray(filterType(t[0],filterStringOrStringArray,[])),[...filterType(t[1],filterArray,[]),...getTrailingOptions(arguments,0,!0)]);return this._runTask(r,n)}}}var init_commit=__esm({"src/lib/tasks/commit.ts"(){init_parse_commit(),init_utils(),init_task()}});function first_commit_default(){return{firstCommit(){return this._runTask(straightThroughStringTask(["rev-list","--max-parents=0","HEAD"],!0),trailingFunctionArgument(arguments))}}}var init_first_commit=__esm({"src/lib/tasks/first-commit.ts"(){init_utils(),init_task()}});function hashObjectTask(e,t){const n=["hash-object",e];return t&&n.push("-w"),straightThroughStringTask(n,!0)}var init_hash_object=__esm({"src/lib/tasks/hash-object.ts"(){init_task()}}),InitSummary,initResponseRegex,reInitResponseRegex;function parseInit(e,t,n){const r=String(n).trim();let i;if(i=initResponseRegex.exec(r))return new InitSummary(e,t,!1,i[1]);if(i=reInitResponseRegex.exec(r))return new InitSummary(e,t,!0,i[1]);let o="";const s=r.split(" ");for(;s.length;){if("in"===s.shift()){o=s.join(" ");break}}return new InitSummary(e,t,/^re/i.test(r),o)}var init_InitSummary=__esm({"src/lib/responses/InitSummary.ts"(){InitSummary=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},initResponseRegex=/^Init.+ repository in (.+)$/,reInitResponseRegex=/^Rein.+ in (.+)$/}}),bareCommand;function hasBareCommand(e){return e.includes(bareCommand)}function initTask(e=!1,t,n){const r=["init",...n];return e&&!hasBareCommand(r)&&r.splice(1,0,bareCommand),{commands:r,format:"utf-8",parser:e=>parseInit(r.includes("--bare"),t,e)}}var init_init=__esm({"src/lib/tasks/init.ts"(){init_InitSummary(),bareCommand="--bare"}}),logFormatRegex;function logFormatFromCommand(e){for(let t=0;t<e.length;t++){const n=logFormatRegex.exec(e[t]);if(n)return`--${n[1]}`}return""}function isLogFormat(e){return logFormatRegex.test(e)}var init_log_format=__esm({"src/lib/args/log-format.ts"(){logFormatRegex=/^--(stat|numstat|name-only|name-status)(=|$)/}}),DiffSummary,init_DiffSummary=__esm({"src/lib/responses/DiffSummary.ts"(){DiffSummary=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}}),statParser,numStatParser,nameOnlyParser,nameStatusParser,diffSummaryParsers;function getDiffParser(e=""){const t=diffSummaryParsers[e];return e=>parseStringResponse(new DiffSummary,t,e,!1)}var init_parse_diff_summary=__esm({"src/lib/parsers/parse-diff-summary.ts"(){init_log_format(),init_DiffSummary(),init_diff_name_status(),init_utils(),statParser=[new LineParser(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,((e,[t,n,r=""])=>{e.files.push({file:t.trim(),changes:asNumber(n),insertions:r.replace(/[^+]/g,"").length,deletions:r.replace(/[^-]/g,"").length,binary:!1})})),new LineParser(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,((e,[t,n,r])=>{e.files.push({file:t.trim(),before:asNumber(n),after:asNumber(r),binary:!0})})),new LineParser(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,((e,[t,n])=>{const r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);e.changed=asNumber(t),e.insertions=asNumber(null==r?void 0:r[1]),e.deletions=asNumber(null==i?void 0:i[1])}))],numStatParser=[new LineParser(/(\d+)\t(\d+)\t(.+)$/,((e,[t,n,r])=>{const i=asNumber(t),o=asNumber(n);e.changed++,e.insertions+=i,e.deletions+=o,e.files.push({file:r,changes:i+o,insertions:i,deletions:o,binary:!1})})),new LineParser(/-\t-\t(.+)$/,((e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})}))],nameOnlyParser=[new LineParser(/(.+)$/,((e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})}))],nameStatusParser=[new LineParser(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,((e,[t,n,r,i,o])=>{e.changed++,e.files.push({file:null!=o?o:r,changes:0,insertions:0,deletions:0,binary:!1,status:orVoid(isDiffNameStatus(t)&&t),from:orVoid(!!o&&r!==o&&r),similarity:asNumber(n)})}))],diffSummaryParsers={"":statParser,"--stat":statParser,"--numstat":numStatParser,"--name-status":nameStatusParser,"--name-only":nameOnlyParser}}}),START_BOUNDARY,COMMIT_BOUNDARY,SPLITTER,defaultFieldNames;function lineBuilder(e,t){return t.reduce(((t,n,r)=>(t[n]=e[r]||"",t)),Object.create({diff:null}))}function createListLogSummaryParser(e=SPLITTER,t=defaultFieldNames,n=""){const r=getDiffParser(n);return function(n){const i=toLinesWithContent(n.trim(),!1,START_BOUNDARY).map((function(n){const i=n.split(COMMIT_BOUNDARY),o=lineBuilder(i[0].split(e),t);return i.length>1&&i[1].trim()&&(o.diff=r(i[1])),o}));return{all:i,latest:i.length&&i[0]||null,total:i.length}}}var init_parse_list_log_summary=__esm({"src/lib/parsers/parse-list-log-summary.ts"(){init_utils(),init_parse_diff_summary(),init_log_format(),START_BOUNDARY="òòòòòò ",COMMIT_BOUNDARY=" òò",SPLITTER=" ò ",defaultFieldNames=["hash","date","message","refs","author_name","author_email"]}}),diff_exports={};function diffSummaryTask(e){let t=logFormatFromCommand(e);const n=["diff"];return""===t&&(t="--stat",n.push("--stat=4096")),n.push(...e),validateLogFormatConfig(n)||{commands:n,format:"utf-8",parser:getDiffParser(t)}}function validateLogFormatConfig(e){const t=e.filter(isLogFormat);return t.length>1?configurationErrorTask(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`):t.length&&e.includes("-z")?configurationErrorTask(`Summary flag ${t} parsing is not compatible with null termination option '-z'`):void 0}__export(diff_exports,{diffSummaryTask:()=>diffSummaryTask,validateLogFormatConfig:()=>validateLogFormatConfig});var init_diff=__esm({"src/lib/tasks/diff.ts"(){init_log_format(),init_parse_diff_summary(),init_task()}}),excludeOptions;function prettyFormat(e,t){const n=[],r=[];return Object.keys(e).forEach((t=>{n.push(t),r.push(String(e[t]))})),[n,r.join(t)]}function userOptions(e){return Object.keys(e).reduce(((t,n)=>(n in excludeOptions||(t[n]=e[n]),t)),{})}function parseLogOptions(e={},t=[]){const n=filterType(e.splitter,filterString,SPLITTER),r=!filterPrimitives(e.format)&&e.format?e.format:{hash:"%H",date:!1===e.strictDate?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:!1!==e.mailMap?"%aN":"%an",author_email:!1!==e.mailMap?"%aE":"%ae"},[i,o]=prettyFormat(r,n),s=[],a=[`--pretty=format:${START_BOUNDARY}${o}${COMMIT_BOUNDARY}`,...t],c=e.n||e["max-count"]||e.maxCount;if(c&&a.push(`--max-count=${c}`),e.from||e.to){const t=!1!==e.symmetric?"...":"..";s.push(`${e.from||""}${t}${e.to||""}`)}return filterString(e.file)&&a.push("--follow",pathspec(e.file)),appendTaskOptions(userOptions(e),a),{fields:i,splitter:n,commands:[...a,...s]}}function logTask(e,t,n){const r=createListLogSummaryParser(e,t,logFormatFromCommand(n));return{commands:["log",...n],format:"utf-8",parser:r}}function log_default(){return{log(...e){const t=trailingFunctionArgument(arguments),n=parseLogOptions(trailingOptionsArgument(arguments),filterType(arguments[0],filterArray)),r=function(e,t){return filterString(e)&&filterString(t)&&configurationErrorTask("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}(...e)||validateLogFormatConfig(n.commands)||function(e){return logTask(e.splitter,e.fields,e.commands)}(n);return this._runTask(r,t)}}}var init_log=__esm({"src/lib/tasks/log.ts"(){init_log_format(),init_pathspec(),init_parse_list_log_summary(),init_utils(),init_task(),init_diff(),excludeOptions=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(excludeOptions||{})}}),MergeSummaryConflict,MergeSummaryDetail,init_MergeSummary=__esm({"src/lib/responses/MergeSummary.ts"(){MergeSummaryConflict=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},MergeSummaryDetail=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),PullSummary,PullFailedSummary,init_PullSummary=__esm({"src/lib/responses/PullSummary.ts"(){PullSummary=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},PullFailedSummary=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}}),remoteMessagesObjectParsers;function objectEnumerationResult(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function asObjectCount(e){const t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:asNumber(t&&t[1]||"0"),delta:asNumber(n&&n[1]||"0")}}var init_parse_remote_objects=__esm({"src/lib/parsers/parse-remote-objects.ts"(){init_utils(),remoteMessagesObjectParsers=[new RemoteLineParser(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,((e,[t,n])=>{const r=t.toLowerCase(),i=objectEnumerationResult(e.remoteMessages);Object.assign(i,{[r]:asNumber(n)})})),new RemoteLineParser(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,((e,[t,n])=>{const r=t.toLowerCase(),i=objectEnumerationResult(e.remoteMessages);Object.assign(i,{[r]:asNumber(n)})})),new RemoteLineParser(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,((e,[t,n,r])=>{const i=objectEnumerationResult(e.remoteMessages);i.total=asObjectCount(t),i.reused=asObjectCount(n),i.packReused=asNumber(r)}))]}}),parsers2,RemoteMessageSummary;function parseRemoteMessages(e,t){return parseStringResponse({remoteMessages:new RemoteMessageSummary},parsers2,t)}var init_parse_remote_messages=__esm({"src/lib/parsers/parse-remote-messages.ts"(){init_utils(),init_parse_remote_objects(),parsers2=[new RemoteLineParser(/^remote:\s*(.+)$/,((e,[t])=>(e.remoteMessages.all.push(t.trim()),!1))),...remoteMessagesObjectParsers,new RemoteLineParser([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],((e,[t])=>{e.remoteMessages.pullRequestUrl=t})),new RemoteLineParser([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],((e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:asNumber(t),summary:n,url:r}}))],RemoteMessageSummary=class{constructor(){this.all=[]}}}}),FILE_UPDATE_REGEX,SUMMARY_REGEX,ACTION_REGEX,parsers3,errorParsers,parsePullDetail,parsePullResult;function parsePullErrorResult(e,t){const n=parseStringResponse(new PullFailedSummary,errorParsers,[e,t]);return n.message&&n}var init_parse_pull=__esm({"src/lib/parsers/parse-pull.ts"(){init_PullSummary(),init_utils(),init_parse_remote_messages(),SUMMARY_REGEX=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,ACTION_REGEX=/^(create|delete) mode \d+ (.+)/,parsers3=[new LineParser(FILE_UPDATE_REGEX=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,((e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)})),new LineParser(SUMMARY_REGEX,((e,[t,,n,,r])=>(void 0!==n||void 0!==r)&&(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+r||0,!0))),new LineParser(ACTION_REGEX,((e,[t,n])=>{append(e.files,n),append("create"===t?e.created:e.deleted,n)}))],errorParsers=[new LineParser(/^from\s(.+)$/i,((e,[t])=>{e.remote=t})),new LineParser(/^fatal:\s(.+)$/,((e,[t])=>{e.message=t})),new LineParser(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,((e,[t,n,r,i])=>{e.branch.local=r,e.hash.local=t,e.branch.remote=i,e.hash.remote=n}))],parsePullDetail=(e,t)=>parseStringResponse(new PullSummary,parsers3,[e,t]),parsePullResult=(e,t)=>Object.assign(new PullSummary,parsePullDetail(e,t),parseRemoteMessages(e,t))}}),parsers4,parseMergeResult,parseMergeDetail,init_parse_merge=__esm({"src/lib/parsers/parse-merge.ts"(){init_MergeSummary(),init_utils(),init_parse_pull(),parsers4=[new LineParser(/^Auto-merging\s+(.+)$/,((e,[t])=>{e.merges.push(t)})),new LineParser(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,((e,[t,n])=>{e.conflicts.push(new MergeSummaryConflict(t,n))})),new LineParser(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,((e,[t,n,r])=>{e.conflicts.push(new MergeSummaryConflict(t,n,{deleteRef:r}))})),new LineParser(/^CONFLICT\s+\((.+)\):/,((e,[t])=>{e.conflicts.push(new MergeSummaryConflict(t,null))})),new LineParser(/^Automatic merge failed;\s+(.+)$/,((e,[t])=>{e.result=t}))],parseMergeResult=(e,t)=>Object.assign(parseMergeDetail(e,t),parsePullResult(e,t)),parseMergeDetail=e=>parseStringResponse(new MergeSummaryDetail,parsers4,e)}});function mergeTask(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(e,t){const n=parseMergeResult(e,t);if(n.failed)throw new GitResponseError(n);return n}}:configurationErrorTask("Git.merge requires at least one option")}var init_merge=__esm({"src/lib/tasks/merge.ts"(){init_git_response_error(),init_parse_merge(),init_task()}}),parsers5,parsePushResult,parsePushDetail;function pushResultPushedItem(e,t,n){const r=n.includes("deleted"),i=n.includes("tag")||/^refs\/tags/.test(e),o=!n.includes("new");return{deleted:r,tag:i,branch:!i,new:!o,alreadyUpdated:o,local:e,remote:t}}var init_parse_push=__esm({"src/lib/parsers/parse-push.ts"(){init_utils(),init_parse_remote_messages(),parsers5=[new LineParser(/^Pushing to (.+)$/,((e,[t])=>{e.repo=t})),new LineParser(/^updating local tracking ref '(.+)'/,((e,[t])=>{e.ref=__spreadProps(__spreadValues({},e.ref||{}),{local:t})})),new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,((e,[t,n,r])=>{e.pushed.push(pushResultPushedItem(t,n,r))})),new LineParser(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,((e,[t,n,r])=>{e.branch=__spreadProps(__spreadValues({},e.branch||{}),{local:t,remote:n,remoteName:r})})),new LineParser(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,((e,[t,n,r,i])=>{e.update={head:{local:t,remote:n},hash:{from:r,to:i}}}))],parsePushResult=(e,t)=>{const n=parsePushDetail(e,t),r=parseRemoteMessages(e,t);return __spreadValues(__spreadValues({},n),r)},parsePushDetail=(e,t)=>parseStringResponse({pushed:[]},parsers5,[e,t])}}),push_exports={};function pushTagsTask(e={},t){return append(t,"--tags"),pushTask(e,t)}function pushTask(e={},t){const n=["push",...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),remove(n,"-v"),append(n,"--verbose"),append(n,"--porcelain"),{commands:n,format:"utf-8",parser:parsePushResult}}__export(push_exports,{pushTagsTask:()=>pushTagsTask,pushTask:()=>pushTask});var init_push=__esm({"src/lib/tasks/push.ts"(){init_parse_push(),init_utils()}});function show_default(){return{showBuffer(){const e=["show",...getTrailingOptions(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(straightThroughBufferTask(e),trailingFunctionArgument(arguments))},show(){const e=["show",...getTrailingOptions(arguments,1)];return this._runTask(straightThroughStringTask(e),trailingFunctionArgument(arguments))}}}var init_show=__esm({"src/lib/tasks/show.ts"(){init_utils(),init_task()}}),fromPathRegex,FileStatusSummary,init_FileStatusSummary=__esm({"src/lib/responses/FileStatusSummary.ts"(){fromPathRegex=/^(.+)\0(.+)$/,FileStatusSummary=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,"R"===t||"R"===n){const t=fromPathRegex.exec(e)||[null,e,e];this.from=t[2]||"",this.path=t[1]||""}}}}}),StatusSummary,parsers6,parseStatusSummary;function renamedFile(e){const[t,n]=e.split(NULL);return{from:n||t,to:t}}function parser3(e,t,n){return[`${e}${t}`,n]}function conflicts(e,...t){return t.map((t=>parser3(e,t,((e,t)=>append(e.conflicted,t)))))}function splitLine(e,t){const n=t.trim();switch(" "){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.substr(3));case n.charAt(1):return r(" ",n.charAt(0),n.substr(2));default:return}function r(t,n,r){const i=`${t}${n}`,o=parsers6.get(i);o&&o(e,r),"##"!==i&&"!!"!==i&&e.files.push(new FileStatusSummary(r,t,n))}}var init_StatusSummary=__esm({"src/lib/responses/StatusSummary.ts"(){init_utils(),init_FileStatusSummary(),StatusSummary=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},parsers6=new Map([parser3(" ","A",((e,t)=>append(e.created,t))),parser3(" ","D",((e,t)=>append(e.deleted,t))),parser3(" ","M",((e,t)=>append(e.modified,t))),parser3("A"," ",((e,t)=>append(e.created,t)&&append(e.staged,t))),parser3("A","M",((e,t)=>append(e.created,t)&&append(e.staged,t)&&append(e.modified,t))),parser3("D"," ",((e,t)=>append(e.deleted,t)&&append(e.staged,t))),parser3("M"," ",((e,t)=>append(e.modified,t)&&append(e.staged,t))),parser3("M","M",((e,t)=>append(e.modified,t)&&append(e.staged,t))),parser3("R"," ",((e,t)=>{append(e.renamed,renamedFile(t))})),parser3("R","M",((e,t)=>{const n=renamedFile(t);append(e.renamed,n),append(e.modified,n.to)})),parser3("!","!",((e,t)=>{append(e.ignored=e.ignored||[],t)})),parser3("?","?",((e,t)=>append(e.not_added,t))),...conflicts("A","A","U"),...conflicts("D","D","U"),...conflicts("U","A","D","U"),["##",(e,t)=>{let n;n=/ahead (\d+)/.exec(t),e.ahead=n&&+n[1]||0,n=/behind (\d+)/.exec(t),e.behind=n&&+n[1]||0,n=/^(.+?(?=(?:\.{3}|\s|$)))/.exec(t),e.current=n&&n[1],n=/\.{3}(\S*)/.exec(t),e.tracking=n&&n[1],n=/\son\s([\S]+)$/.exec(t),e.current=n&&n[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),parseStatusSummary=function(e){const t=e.split(NULL),n=new StatusSummary;for(let e=0,r=t.length;e<r;){let r=t[e++].trim();r&&("R"===r.charAt(0)&&(r+=NULL+(t[e++]||"")),splitLine(n,r))}return n}}}),ignoredOptions;function statusTask(e){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...e.filter((e=>!ignoredOptions.includes(e)))],parser:e=>parseStatusSummary(e)}}var init_status=__esm({"src/lib/tasks/status.ts"(){init_StatusSummary(),ignoredOptions=["--null","-z"]}}),NOT_INSTALLED,parsers7;function versionResponse(e=0,t=0,n=0,r="",i=!0){return Object.defineProperty({major:e,minor:t,patch:n,agent:r,installed:i},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function notInstalledResponse(){return versionResponse(0,0,0,"",!1)}function version_default(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:versionParser,onError(e,t,n,r){if(-2===e.exitCode)return n(Buffer.from(NOT_INSTALLED));r(t)}})}}}function versionParser(e){return e===NOT_INSTALLED?notInstalledResponse():parseStringResponse(versionResponse(0,0,0,e),parsers7,e)}var init_version=__esm({"src/lib/tasks/version.ts"(){init_utils(),NOT_INSTALLED="installed=false",parsers7=[new LineParser(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,((e,[t,n,r,i=""])=>{Object.assign(e,versionResponse(asNumber(t),asNumber(n),asNumber(r),i))})),new LineParser(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,((e,[t,n,r,i=""])=>{Object.assign(e,versionResponse(asNumber(t),asNumber(n),r,i))}))]}}),simple_git_api_exports={},SimpleGitApi;__export(simple_git_api_exports,{SimpleGitApi:()=>SimpleGitApi});var init_simple_git_api=__esm({"src/lib/simple-git-api.ts"(){init_task_callback(),init_change_working_directory(),init_checkout(),init_count_objects(),init_commit(),init_config(),init_first_commit(),init_grep(),init_hash_object(),init_init(),init_log(),init_merge(),init_push(),init_show(),init_status(),init_task(),init_version(),init_utils(),SimpleGitApi=class{constructor(e){this._executor=e}_runTask(e,t){const n=this._executor.chain(),r=n.push(e);return t&&taskCallback(e,r,t),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(e){return this._runTask(straightThroughStringTask(["add",...asArray(e)]),trailingFunctionArgument(arguments))}cwd(e){const t=trailingFunctionArgument(arguments);return"string"==typeof e?this._runTask(changeWorkingDirectoryTask(e,this._executor),t):"string"==typeof(null==e?void 0:e.path)?this._runTask(changeWorkingDirectoryTask(e.path,e.root&&this._executor||void 0),t):this._runTask(configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(hashObjectTask(e,!0===t),trailingFunctionArgument(arguments))}init(e){return this._runTask(initTask(!0===e,this._executor.cwd,getTrailingOptions(arguments)),trailingFunctionArgument(arguments))}merge(){return this._runTask(mergeTask(getTrailingOptions(arguments)),trailingFunctionArgument(arguments))}mergeFromTo(e,t){return filterString(e)&&filterString(t)?this._runTask(mergeTask([e,t,...getTrailingOptions(arguments)]),trailingFunctionArgument(arguments,!1)):this._runTask(configurationErrorTask("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){const e=pushTask({remote:filterType(arguments[0],filterString),branch:filterType(arguments[1],filterString)},getTrailingOptions(arguments));return this._runTask(e,trailingFunctionArgument(arguments))}stash(){return this._runTask(straightThroughStringTask(["stash",...getTrailingOptions(arguments)]),trailingFunctionArgument(arguments))}status(){return this._runTask(statusTask(getTrailingOptions(arguments)),trailingFunctionArgument(arguments))}},Object.assign(SimpleGitApi.prototype,checkout_default(),commit_default(),config_default(),count_objects_default(),first_commit_default(),grep_default(),log_default(),show_default(),version_default())}}),scheduler_exports={},createScheduledTask,Scheduler;__export(scheduler_exports,{Scheduler:()=>Scheduler});var init_scheduler=__esm({"src/lib/runners/scheduler.ts"(){init_utils(),init_git_logger(),createScheduledTask=(()=>{let e=0;return()=>{e++;const{promise:t,done:n}=distExports$1.createDeferred();return{promise:t,done:n,id:e}}})(),Scheduler=class{constructor(e=2){this.concurrency=e,this.logger=createLogger("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency)return void this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);const e=append(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done((()=>{this.logger("Completing id=",e.id),remove(this.running,e),this.schedule()}))}next(){const{promise:e,id:t}=append(this.pending,createScheduledTask());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),apply_patch_exports={};function applyPatchTask(e,t){return straightThroughStringTask(["apply",...t,...e])}__export(apply_patch_exports,{applyPatchTask:()=>applyPatchTask});var init_apply_patch=__esm({"src/lib/tasks/apply-patch.ts"(){init_task()}}),BranchDeletionBatch;function branchDeletionSuccess(e,t){return{branch:e,hash:t,success:!0}}function branchDeletionFailure(e){return{branch:e,hash:null,success:!1}}var init_BranchDeleteSummary=__esm({"src/lib/responses/BranchDeleteSummary.ts"(){BranchDeletionBatch=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}}),deleteSuccessRegex,deleteErrorRegex,parsers8,parseBranchDeletions;function hasBranchDeletionError(e,t){return 1===t&&deleteErrorRegex.test(e)}var init_parse_branch_delete=__esm({"src/lib/parsers/parse-branch-delete.ts"(){init_BranchDeleteSummary(),init_utils(),deleteErrorRegex=/^error[^']+'([^']+)'/m,parsers8=[new LineParser(deleteSuccessRegex=/(\S+)\s+\(\S+\s([^)]+)\)/,((e,[t,n])=>{const r=branchDeletionSuccess(t,n);e.all.push(r),e.branches[t]=r})),new LineParser(deleteErrorRegex,((e,[t])=>{const n=branchDeletionFailure(t);e.errors.push(n),e.all.push(n),e.branches[t]=n}))],parseBranchDeletions=(e,t)=>parseStringResponse(new BranchDeletionBatch,parsers8,[e,t])}}),BranchSummaryResult,init_BranchSummary=__esm({"src/lib/responses/BranchSummary.ts"(){BranchSummaryResult=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,n,r,i){"*"===e&&(this.detached=t,this.current=n),this.all.push(n),this.branches[n]={current:"*"===e,linkedWorkTree:"+"===e,name:n,commit:r,label:i}}}}}),parsers9;function branchStatus(e){return e?e.charAt(0):""}function parseBranchSummary(e){return parseStringResponse(new BranchSummaryResult,parsers9,e)}var init_parse_branch=__esm({"src/lib/parsers/parse-branch.ts"(){init_BranchSummary(),init_utils(),parsers9=[new LineParser(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,((e,[t,n,r,i])=>{e.push(branchStatus(t),!0,n,r,i)})),new LineParser(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),((e,[t,n,r,i])=>{e.push(branchStatus(t),!1,n,r,i)}))]}}),branch_exports={};function containsDeleteBranchCommand(e){const t=["-d","-D","--delete"];return e.some((e=>t.includes(e)))}function branchTask(e){const t=containsDeleteBranchCommand(e),n=["branch",...e];return 1===n.length&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser:(e,n)=>t?parseBranchDeletions(e,n).all[0]:parseBranchSummary(e)}}function branchLocalTask(){return{format:"utf-8",commands:["branch","-v"],parser:parseBranchSummary}}function deleteBranchesTask(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser:(e,t)=>parseBranchDeletions(e,t),onError({exitCode:e,stdOut:t},n,r,i){if(!hasBranchDeletionError(String(n),e))return i(n);r(t)}}}function deleteBranchTask(e,t=!1){const n={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser:(t,n)=>parseBranchDeletions(t,n).branches[e],onError({exitCode:e,stdErr:t,stdOut:r},i,o,s){if(!hasBranchDeletionError(String(i),e))return s(i);throw new GitResponseError(n.parser(bufferToString(r),bufferToString(t)),String(i))}};return n}__export(branch_exports,{branchLocalTask:()=>branchLocalTask,branchTask:()=>branchTask,containsDeleteBranchCommand:()=>containsDeleteBranchCommand,deleteBranchTask:()=>deleteBranchTask,deleteBranchesTask:()=>deleteBranchesTask});var init_branch=__esm({"src/lib/tasks/branch.ts"(){init_git_response_error(),init_parse_branch_delete(),init_parse_branch(),init_utils()}}),parseCheckIgnore,init_CheckIgnore=__esm({"src/lib/responses/CheckIgnore.ts"(){parseCheckIgnore=e=>e.split(/\n/g).map((e=>e.trim())).filter((e=>!!e))}}),check_ignore_exports={};function checkIgnoreTask(e){return{commands:["check-ignore",...e],format:"utf-8",parser:parseCheckIgnore}}__export(check_ignore_exports,{checkIgnoreTask:()=>checkIgnoreTask});var init_check_ignore=__esm({"src/lib/tasks/check-ignore.ts"(){init_CheckIgnore()}}),clone_exports={};function disallowedCommand(e){return/^--upload-pack(=|$)/.test(e)}function cloneTask(e,t,n){const r=["clone",...n];filterString(e)&&r.push(e),filterString(t)&&r.push(t);return r.find(disallowedCommand)?configurationErrorTask("git.fetch: potential exploit argument blocked."):straightThroughStringTask(r)}function cloneMirrorTask(e,t,n){return append(n,"--mirror"),cloneTask(e,t,n)}__export(clone_exports,{cloneMirrorTask:()=>cloneMirrorTask,cloneTask:()=>cloneTask});var init_clone=__esm({"src/lib/tasks/clone.ts"(){init_task(),init_utils()}}),parsers10;function parseFetchResult(e,t){return parseStringResponse({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},parsers10,[e,t])}var init_parse_fetch=__esm({"src/lib/parsers/parse-fetch.ts"(){init_utils(),parsers10=[new LineParser(/From (.+)$/,((e,[t])=>{e.remote=t})),new LineParser(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,((e,[t,n])=>{e.branches.push({name:t,tracking:n})})),new LineParser(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,((e,[t,n])=>{e.tags.push({name:t,tracking:n})})),new LineParser(/- \[deleted]\s+\S+\s*-> (.+)$/,((e,[t])=>{e.deleted.push({tracking:t})})),new LineParser(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,((e,[t,n,r,i])=>{e.updated.push({name:r,tracking:i,to:n,from:t})}))]}}),fetch_exports={};function disallowedCommand2(e){return/^--upload-pack(=|$)/.test(e)}function fetchTask(e,t,n){const r=["fetch",...n];e&&t&&r.push(e,t);return r.find(disallowedCommand2)?configurationErrorTask("git.fetch: potential exploit argument blocked."):{commands:r,format:"utf-8",parser:parseFetchResult}}__export(fetch_exports,{fetchTask:()=>fetchTask});var init_fetch=__esm({"src/lib/tasks/fetch.ts"(){init_parse_fetch(),init_task()}}),parsers11;function parseMoveResult(e){return parseStringResponse({moves:[]},parsers11,e)}var init_parse_move=__esm({"src/lib/parsers/parse-move.ts"(){init_utils(),parsers11=[new LineParser(/^Renaming (.+) to (.+)$/,((e,[t,n])=>{e.moves.push({from:t,to:n})}))]}}),move_exports={};function moveTask(e,t){return{commands:["mv","-v",...asArray(e),t],format:"utf-8",parser:parseMoveResult}}__export(move_exports,{moveTask:()=>moveTask});var init_move=__esm({"src/lib/tasks/move.ts"(){init_parse_move(),init_utils()}}),pull_exports={};function pullTask(e,t,n){const r=["pull",...n];return e&&t&&r.splice(1,0,e,t),{commands:r,format:"utf-8",parser:(e,t)=>parsePullResult(e,t),onError(e,t,n,r){const i=parsePullErrorResult(bufferToString(e.stdOut),bufferToString(e.stdErr));if(i)return r(new GitResponseError(i));r(t)}}}__export(pull_exports,{pullTask:()=>pullTask});var init_pull=__esm({"src/lib/tasks/pull.ts"(){init_git_response_error(),init_parse_pull(),init_utils()}});function parseGetRemotes(e){const t={};return forEach$1(e,(([e])=>t[e]={name:e})),Object.values(t)}function parseGetRemotesVerbose(e){const t={};return forEach$1(e,(([e,n,r])=>{t.hasOwnProperty(e)||(t[e]={name:e,refs:{fetch:"",push:""}}),r&&n&&(t[e].refs[r.replace(/[^a-z]/g,"")]=n)})),Object.values(t)}function forEach$1(e,t){forEachLineWithContent(e,(e=>t(e.split(/\s+/))))}var init_GetRemoteSummary=__esm({"src/lib/responses/GetRemoteSummary.ts"(){init_utils()}}),remote_exports={};function addRemoteTask(e,t,n){return straightThroughStringTask(["remote","add",...n,e,t])}function getRemotesTask(e){const t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?parseGetRemotesVerbose:parseGetRemotes}}function listRemotesTask(e){const t=[...e];return"ls-remote"!==t[0]&&t.unshift("ls-remote"),straightThroughStringTask(t)}function remoteTask(e){const t=[...e];return"remote"!==t[0]&&t.unshift("remote"),straightThroughStringTask(t)}function removeRemoteTask(e){return straightThroughStringTask(["remote","remove",e])}__export(remote_exports,{addRemoteTask:()=>addRemoteTask,getRemotesTask:()=>getRemotesTask,listRemotesTask:()=>listRemotesTask,remoteTask:()=>remoteTask,removeRemoteTask:()=>removeRemoteTask});var init_remote=__esm({"src/lib/tasks/remote.ts"(){init_GetRemoteSummary(),init_task()}}),stash_list_exports={};function stashListTask(e={},t){const n=parseLogOptions(e),r=["stash","list",...n.commands,...t],i=createListLogSummaryParser(n.splitter,n.fields,logFormatFromCommand(r));return validateLogFormatConfig(r)||{commands:r,format:"utf-8",parser:i}}__export(stash_list_exports,{stashListTask:()=>stashListTask});var init_stash_list=__esm({"src/lib/tasks/stash-list.ts"(){init_log_format(),init_parse_list_log_summary(),init_diff(),init_log()}}),sub_module_exports={};function addSubModuleTask(e,t){return subModuleTask(["add",e,t])}function initSubModuleTask(e){return subModuleTask(["init",...e])}function subModuleTask(e){const t=[...e];return"submodule"!==t[0]&&t.unshift("submodule"),straightThroughStringTask(t)}function updateSubModuleTask(e){return subModuleTask(["update",...e])}__export(sub_module_exports,{addSubModuleTask:()=>addSubModuleTask,initSubModuleTask:()=>initSubModuleTask,subModuleTask:()=>subModuleTask,updateSubModuleTask:()=>updateSubModuleTask});var init_sub_module=__esm({"src/lib/tasks/sub-module.ts"(){init_task()}}),TagList,parseTagList;function singleSorted(e,t){const n=isNaN(e);return n!==isNaN(t)?n?1:-1:n?sorted(e,t):0}function sorted(e,t){return e===t?0:e>t?1:-1}function trimmed(e){return e.trim()}function toNumber(e){return"string"==typeof e&&parseInt(e.replace(/^\D+/g,""),10)||0}var init_TagList=__esm({"src/lib/responses/TagList.ts"(){TagList=class{constructor(e,t){this.all=e,this.latest=t}},parseTagList=function(e,t=!1){const n=e.split("\n").map(trimmed).filter(Boolean);t||n.sort((function(e,t){const n=e.split("."),r=t.split(".");if(1===n.length||1===r.length)return singleSorted(toNumber(n[0]),toNumber(r[0]));for(let e=0,t=Math.max(n.length,r.length);e<t;e++){const t=sorted(toNumber(n[e]),toNumber(r[e]));if(t)return t}return 0}));const r=t?n[0]:[...n].reverse().find((e=>e.indexOf(".")>=0));return new TagList(n,r)}}}),tag_exports={};function tagListTask(e=[]){const t=e.some((e=>/^--sort=/.test(e)));return{format:"utf-8",commands:["tag","-l",...e],parser:e=>parseTagList(e,t)}}function addTagTask(e){return{format:"utf-8",commands:["tag",e],parser:()=>({name:e})}}function addAnnotatedTagTask(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser:()=>({name:e})}}__export(tag_exports,{addAnnotatedTagTask:()=>addAnnotatedTagTask,addTagTask:()=>addTagTask,tagListTask:()=>tagListTask});var init_tag=__esm({"src/lib/tasks/tag.ts"(){init_TagList()}}),require_git=__commonJS({"src/git.js"(e,t){var{GitExecutor:n}=(init_git_executor(),__toCommonJS(git_executor_exports)),{SimpleGitApi:r}=(init_simple_git_api(),__toCommonJS(simple_git_api_exports)),{Scheduler:i}=(init_scheduler(),__toCommonJS(scheduler_exports)),{configurationErrorTask:o}=(init_task(),__toCommonJS(task_exports)),{asArray:s,filterArray:a,filterPrimitives:c,filterString:l,filterStringOrStringArray:u,filterType:d,getTrailingOptions:p,trailingFunctionArgument:f,trailingOptionsArgument:_}=(init_utils(),__toCommonJS(utils_exports)),{applyPatchTask:m}=(init_apply_patch(),__toCommonJS(apply_patch_exports)),{branchTask:h,branchLocalTask:g,deleteBranchesTask:A,deleteBranchTask:y}=(init_branch(),__toCommonJS(branch_exports)),{checkIgnoreTask:v}=(init_check_ignore(),__toCommonJS(check_ignore_exports)),{checkIsRepoTask:b}=(init_check_is_repo(),__toCommonJS(check_is_repo_exports)),{cloneTask:C,cloneMirrorTask:E}=(init_clone(),__toCommonJS(clone_exports)),{cleanWithOptionsTask:x,isCleanOptionsArray:S}=(init_clean(),__toCommonJS(clean_exports)),{diffSummaryTask:k}=(init_diff(),__toCommonJS(diff_exports)),{fetchTask:D}=(init_fetch(),__toCommonJS(fetch_exports)),{moveTask:w}=(init_move(),__toCommonJS(move_exports)),{pullTask:I}=(init_pull(),__toCommonJS(pull_exports)),{pushTagsTask:T}=(init_push(),__toCommonJS(push_exports)),{addRemoteTask:F,getRemotesTask:R,listRemotesTask:P,remoteTask:N,removeRemoteTask:B}=(init_remote(),__toCommonJS(remote_exports)),{getResetMode:O,resetTask:q}=(init_reset(),__toCommonJS(reset_exports)),{stashListTask:$}=(init_stash_list(),__toCommonJS(stash_list_exports)),{addSubModuleTask:Q,initSubModuleTask:L,subModuleTask:M,updateSubModuleTask:j}=(init_sub_module(),__toCommonJS(sub_module_exports)),{addAnnotatedTagTask:U,addTagTask:J,tagListTask:V}=(init_tag(),__toCommonJS(tag_exports)),{straightThroughBufferTask:H,straightThroughStringTask:G}=(init_task(),__toCommonJS(task_exports));function W(e,t){this._plugins=t,this._executor=new n(e.baseDir,new i(e.maxConcurrentProcesses),t),this._trimmed=e.trimmed}function z(e,t,n,r){return"string"!=typeof n?o(`git.${e}() requires a string 'repoPath'`):t(n,d(r,l),p(arguments))}(W.prototype=Object.create(r.prototype)).constructor=W,W.prototype.customBinary=function(e){return this._plugins.reconfigure("binary",e),this},W.prototype.env=function(e,t){return 1===arguments.length&&"object"==typeof e?this._executor.env=e:(this._executor.env=this._executor.env||{})[e]=t,this},W.prototype.stashList=function(e){return this._runTask($(_(arguments)||{},a(e)&&e||[]),f(arguments))},W.prototype.clone=function(){return this._runTask(z("clone",C,...arguments),f(arguments))},W.prototype.mirror=function(){return this._runTask(z("mirror",E,...arguments),f(arguments))},W.prototype.mv=function(e,t){return this._runTask(w(e,t),f(arguments))},W.prototype.checkoutLatestTag=function(e){var t=this;return this.pull((function(){t.tags((function(n,r){t.checkout(r.latest,e)}))}))},W.prototype.pull=function(e,t,n,r){return this._runTask(I(d(e,l),d(t,l),p(arguments)),f(arguments))},W.prototype.fetch=function(e,t){return this._runTask(D(d(e,l),d(t,l),p(arguments)),f(arguments))},W.prototype.silent=function(e){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},W.prototype.tags=function(e,t){return this._runTask(V(p(arguments)),f(arguments))},W.prototype.rebase=function(){return this._runTask(G(["rebase",...p(arguments)]),f(arguments))},W.prototype.reset=function(e){return this._runTask(q(O(e),p(arguments)),f(arguments))},W.prototype.revert=function(e){const t=f(arguments);return"string"!=typeof e?this._runTask(o("Commit must be a string"),t):this._runTask(G(["revert",...p(arguments,0,!0),e]),t)},W.prototype.addTag=function(e){const t="string"==typeof e?J(e):o("Git.addTag requires a tag name");return this._runTask(t,f(arguments))},W.prototype.addAnnotatedTag=function(e,t){return this._runTask(U(e,t),f(arguments))},W.prototype.deleteLocalBranch=function(e,t,n){return this._runTask(y(e,"boolean"==typeof t&&t),f(arguments))},W.prototype.deleteLocalBranches=function(e,t,n){return this._runTask(A(e,"boolean"==typeof t&&t),f(arguments))},W.prototype.branch=function(e,t){return this._runTask(h(p(arguments)),f(arguments))},W.prototype.branchLocal=function(e){return this._runTask(g(),f(arguments))},W.prototype.raw=function(e){const t=!Array.isArray(e),n=[].slice.call(t?arguments:e,0);for(let e=0;e<n.length&&t;e++)if(!c(n[e])){n.splice(e,n.length-e);break}n.push(...p(arguments,0,!0));var r=f(arguments);return n.length?this._runTask(G(n,this._trimmed),r):this._runTask(o("Raw: must supply one or more command to execute"),r)},W.prototype.submoduleAdd=function(e,t,n){return this._runTask(Q(e,t),f(arguments))},W.prototype.submoduleUpdate=function(e,t){return this._runTask(j(p(arguments,!0)),f(arguments))},W.prototype.submoduleInit=function(e,t){return this._runTask(L(p(arguments,!0)),f(arguments))},W.prototype.subModule=function(e,t){return this._runTask(M(p(arguments)),f(arguments))},W.prototype.listRemote=function(){return this._runTask(P(p(arguments)),f(arguments))},W.prototype.addRemote=function(e,t,n){return this._runTask(F(e,t,p(arguments)),f(arguments))},W.prototype.removeRemote=function(e,t){return this._runTask(B(e),f(arguments))},W.prototype.getRemotes=function(e,t){return this._runTask(R(!0===e),f(arguments))},W.prototype.remote=function(e,t){return this._runTask(N(p(arguments)),f(arguments))},W.prototype.tag=function(e,t){const n=p(arguments);return"tag"!==n[0]&&n.unshift("tag"),this._runTask(G(n),f(arguments))},W.prototype.updateServerInfo=function(e){return this._runTask(G(["update-server-info"]),f(arguments))},W.prototype.pushTags=function(e,t){const n=T({remote:d(e,l)},p(arguments));return this._runTask(n,f(arguments))},W.prototype.rm=function(e){return this._runTask(G(["rm","-f",...s(e)]),f(arguments))},W.prototype.rmKeepLocal=function(e){return this._runTask(G(["rm","--cached",...s(e)]),f(arguments))},W.prototype.catFile=function(e,t){return this._catFile("utf-8",arguments)},W.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},W.prototype._catFile=function(e,t){var n=f(t),r=["cat-file"],i=t[0];if("string"==typeof i)return this._runTask(o("Git.catFile: options must be supplied as an array of strings"),n);Array.isArray(i)&&r.push.apply(r,i);const s="buffer"===e?H(r):G(r);return this._runTask(s,n)},W.prototype.diff=function(e,t){const n=l(e)?o("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):G(["diff",...p(arguments)]);return this._runTask(n,f(arguments))},W.prototype.diffSummary=function(){return this._runTask(k(p(arguments,1)),f(arguments))},W.prototype.applyPatch=function(e){const t=u(e)?m(s(e),p([].slice.call(arguments,1))):o("git.applyPatch requires one or more string patches as the first argument");return this._runTask(t,f(arguments))},W.prototype.revparse=function(){const e=["rev-parse",...p(arguments,!0)];return this._runTask(G(e,!0),f(arguments))},W.prototype.clean=function(e,t,n){const r=S(e),i=r&&e.join("")||d(e,l)||"",o=p([].slice.call(arguments,r?1:0));return this._runTask(x(i,o),f(arguments))},W.prototype.exec=function(e){const t={commands:[],format:"utf-8",parser(){"function"==typeof e&&e()}};return this._runTask(t)},W.prototype.clearQueue=function(){return this},W.prototype.checkIgnore=function(e,t){return this._runTask(v(s(d(e,u,[]))),f(arguments))},W.prototype.checkIsRepo=function(e,t){return this._runTask(b(d(e,l)),f(arguments))},t.exports=W}});init_pathspec(),init_git_error();var GitConstructError=class extends GitError{constructor(e,t){super(void 0,t),this.config=e}};init_git_error(),init_git_error();var GitPluginError=class extends GitError{constructor(e,t,n){super(e,n),this.task=e,this.plugin=t,Object.setPrototypeOf(this,new.target.prototype)}};function abortPlugin(e){if(!e)return;const t={type:"spawn.after",action(t,n){function r(){n.kill(new GitPluginError(void 0,"abort","Abort signal received"))}e.addEventListener("abort",r),n.spawned.on("close",(()=>e.removeEventListener("abort",r)))}};return[{type:"spawn.before",action(t,n){e.aborted&&n.kill(new GitPluginError(void 0,"abort","Abort already signaled"))}},t]}function isConfigSwitch(e){return"string"==typeof e&&"-c"===e.trim().toLowerCase()}function preventProtocolOverride(e,t){if(isConfigSwitch(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new GitPluginError(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function preventUploadPack(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new GitPluginError(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if("clone"===t&&/^\s*-u\b/.test(e))throw new GitPluginError(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if("push"===t&&/^\s*--exec\b/.test(e))throw new GitPluginError(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function blockUnsafeOperationsPlugin({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action:(n,r)=>(n.forEach(((i,o)=>{const s=o<n.length?n[o+1]:"";e||preventProtocolOverride(i,s),t||preventUploadPack(i,r.method)})),n)}}function commandConfigPrefixingPlugin(e){const t=prefixedArray(e,"-c");return{type:"spawn.args",action:e=>[...t,...e]}}init_git_response_error(),init_task_configuration_error(),init_check_is_repo(),init_clean(),init_config(),init_diff_name_status(),init_grep(),init_reset(),init_utils(),init_utils();var never=distExports$1.deferred().promise;function completionDetectionPlugin({onClose:e=!0,onExit:t=50}={}){function n(e,t,n){!1!==e&&(!0===e?t.promise:t.promise.then((()=>delay(e)))).then(n.done)}return{type:"spawn.after",action(r,i){return __async(this,arguments,(function*(r,{spawned:i,close:o}){var s,a;const c=function(){let r=-1;const i={close:distExports$1.deferred(),closeTimeout:distExports$1.deferred(),exit:distExports$1.deferred(),exitTimeout:distExports$1.deferred()},o=Promise.race([!1===e?never:i.closeTimeout.promise,!1===t?never:i.exitTimeout.promise]);return n(e,i.close,i.closeTimeout),n(t,i.exit,i.exitTimeout),{close(e){r=e,i.close.done()},exit(e){r=e,i.exit.done()},get exitCode(){return r},result:o}}();let l=!0,u=()=>{l=!1};null==(s=i.stdout)||s.on("data",u),null==(a=i.stderr)||a.on("data",u),i.on("error",u),i.on("close",(e=>c.close(e))),i.on("exit",(e=>c.exit(e)));try{yield c.result,l&&(yield delay(50)),o(c.exitCode)}catch(e){o(c.exitCode,e)}}))}}}init_utils();var WRONG_NUMBER_ERR="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",WRONG_CHARS_ERR="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function isBadArgument(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function toBinaryConfig(e,t){if(e.length<1||e.length>2)throw new GitPluginError(void 0,"binary",WRONG_NUMBER_ERR);if(e.some(isBadArgument)){if(!t)throw new GitPluginError(void 0,"binary",WRONG_CHARS_ERR);console.warn(WRONG_CHARS_ERR)}const[n,r]=e;return{binary:n,prefix:r}}function customBinaryPlugin(e,t=["git"],n=!1){let r=toBinaryConfig(asArray(t),n);e.on("binary",(e=>{r=toBinaryConfig(asArray(e),n)})),e.append("spawn.binary",(()=>r.binary)),e.append("spawn.args",(e=>r.prefix?[r.prefix,...e]:e))}function isTaskError(e){return!(!e.exitCode||!e.stdErr.length)}function getErrorMessage(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function errorDetectionHandler(e=!1,t=isTaskError,n=getErrorMessage){return(r,i)=>!e&&r||!t(i)?r:n(i)}function errorDetectionPlugin(e){return{type:"task.error",action(t,n){const r=e(t.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new GitError(void 0,r.toString("utf-8"))}:{error:r}}}}init_git_error(),init_utils();var PluginStore=class{constructor(){this.plugins=new Set,this.events=new EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){const n=append(this.plugins,{type:e,action:t});return()=>this.plugins.delete(n)}add(e){const t=[];return asArray(e).forEach((e=>e&&this.plugins.add(append(t,e)))),()=>{t.forEach((e=>this.plugins.delete(e)))}}exec(e,t,n){let r=t;const i=Object.freeze(Object.create(n));for(const t of this.plugins)t.type===e&&(r=t.action(r,i));return r}};function progressMonitorPlugin(e){const t="--progress",n=["checkout","clone","fetch","pull","push"],r={type:"spawn.args",action:(e,r)=>n.includes(r.method)?including(e,t):e};return[r,{type:"spawn.after",action(n,r){var i;r.commands.includes(t)&&(null==(i=r.spawned.stderr)||i.on("data",(t=>{const n=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(t.toString("utf8"));n&&e({method:r.method,stage:progressEventStage(n[1]),progress:asNumber(n[2]),processed:asNumber(n[3]),total:asNumber(n[4])})})))}}]}function progressEventStage(e){return String(e.toLowerCase().split(" ",1))||"unknown"}function spawnOptionsPlugin(e){const t=pick(e,["uid","gid"]);return{type:"spawn.options",action:e=>__spreadValues(__spreadValues({},t),e)}}function timeoutPlugin({block:e,stdErr:t=!0,stdOut:n=!0}){if(e>0)return{type:"spawn.after",action(r,i){var o,s;let a;function c(){a&&clearTimeout(a),a=setTimeout(u,e)}function l(){var e,t;null==(e=i.spawned.stdout)||e.off("data",c),null==(t=i.spawned.stderr)||t.off("data",c),i.spawned.off("exit",l),i.spawned.off("close",l),a&&clearTimeout(a)}function u(){l(),i.kill(new GitPluginError(void 0,"timeout","block timeout reached"))}n&&(null==(o=i.spawned.stdout)||o.on("data",c)),t&&(null==(s=i.spawned.stderr)||s.on("data",c)),i.spawned.on("exit",l),i.spawned.on("close",l),c()}}}function suffixPathsPlugin(){return{type:"spawn.args",action(e){const t=[];let n;function r(e){(n=n||[]).push(...e)}for(let n=0;n<e.length;n++){const i=e[n];if(isPathSpec(i))r(toPaths(i));else{if("--"===i){r(e.slice(n+1).flatMap((e=>isPathSpec(e)&&toPaths(e)||e)));break}t.push(i)}}return n?[...t,"--",...n.map(String)]:t}}}init_utils(),init_utils(),init_pathspec(),init_utils();var Git=require_git();function gitInstanceFactory(e,t){var n;const r=new PluginStore,i=createInstanceConfig(e&&("string"==typeof e?{baseDir:e}:e)||{},t);if(!folderExists(i.baseDir))throw new GitConstructError(i,"Cannot use simple-git on a directory that does not exist");return Array.isArray(i.config)&&r.add(commandConfigPrefixingPlugin(i.config)),r.add(blockUnsafeOperationsPlugin(i.unsafe)),r.add(suffixPathsPlugin()),r.add(completionDetectionPlugin(i.completion)),i.abort&&r.add(abortPlugin(i.abort)),i.progress&&r.add(progressMonitorPlugin(i.progress)),i.timeout&&r.add(timeoutPlugin(i.timeout)),i.spawnOptions&&r.add(spawnOptionsPlugin(i.spawnOptions)),r.add(errorDetectionPlugin(errorDetectionHandler(!0))),i.errors&&r.add(errorDetectionPlugin(i.errors)),customBinaryPlugin(r,i.binary,null==(n=i.unsafe)?void 0:n.allowUnsafeCustomBinary),new Git(i,r)}init_git_response_error();var simpleGit=gitInstanceFactory,polyfills,hasRequiredPolyfills,legacyStreams,hasRequiredLegacyStreams,clone_1$1,hasRequiredClone$1,gracefulFs,hasRequiredGracefulFs;function requirePolyfills(){if(hasRequiredPolyfills)return polyfills;hasRequiredPolyfills=1;var e=require$$0$n,t=process.cwd,n=null,r=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return n||(n=t.call(process)),n};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var i=process.chdir;process.chdir=function(e){n=null,i.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,i)}return polyfills=function(t){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(t){t.lchmod=function(n,r,i){t.open(n,e.O_WRONLY|e.O_SYMLINK,r,(function(e,n){e?i&&i(e):t.fchmod(n,r,(function(e){t.close(n,(function(t){i&&i(e||t)}))}))}))},t.lchmodSync=function(n,r){var i,o=t.openSync(n,e.O_WRONLY|e.O_SYMLINK,r),s=!0;try{i=t.fchmodSync(o,r),s=!1}finally{if(s)try{t.closeSync(o)}catch(e){}else t.closeSync(o)}return i}}(t);t.lutimes||function(t){e.hasOwnProperty("O_SYMLINK")&&t.futimes?(t.lutimes=function(n,r,i,o){t.open(n,e.O_SYMLINK,(function(e,n){e?o&&o(e):t.futimes(n,r,i,(function(e){t.close(n,(function(t){o&&o(e||t)}))}))}))},t.lutimesSync=function(n,r,i){var o,s=t.openSync(n,e.O_SYMLINK),a=!0;try{o=t.futimesSync(s,r,i),a=!1}finally{if(a)try{t.closeSync(s)}catch(e){}else t.closeSync(s)}return o}):t.futimes&&(t.lutimes=function(e,t,n,r){r&&process.nextTick(r)},t.lutimesSync=function(){})}(t);t.chown=o(t.chown),t.fchown=o(t.fchown),t.lchown=o(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=s(t.chownSync),t.fchownSync=s(t.fchownSync),t.lchownSync=s(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=c(t.statSync),t.fstatSync=c(t.fstatSync),t.lstatSync=c(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(e,t,n){n&&process.nextTick(n)},t.lchmodSync=function(){});t.chown&&!t.lchown&&(t.lchown=function(e,t,n,r){r&&process.nextTick(r)},t.lchownSync=function(){});"win32"===r&&(t.rename="function"!=typeof t.rename?t.rename:function(e){function n(n,r,i){var o=Date.now(),s=0;e(n,r,(function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){t.stat(r,(function(t,o){t&&"ENOENT"===t.code?e(n,r,a):i(c)}))}),s),void(s<100&&(s+=10));i&&i(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,e),n}(t.rename));function n(e){return e?function(n,r,i){return e.call(t,n,r,(function(e){l(e)&&(e=null),i&&i.apply(this,arguments)}))}:e}function i(e){return e?function(n,r){try{return e.call(t,n,r)}catch(e){if(!l(e))throw e}}:e}function o(e){return e?function(n,r,i,o){return e.call(t,n,r,i,(function(e){l(e)&&(e=null),o&&o.apply(this,arguments)}))}:e}function s(e){return e?function(n,r,i){try{return e.call(t,n,r,i)}catch(e){if(!l(e))throw e}}:e}function a(e){return e?function(n,r,i){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof r&&(i=r,r=null),r?e.call(t,n,r,o):e.call(t,n,o)}:e}function c(e){return e?function(n,r){var i=r?e.call(t,n,r):e.call(t,n);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}:e}function l(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}t.read="function"!=typeof t.read?t.read:function(e){function n(n,r,i,o,s,a){var c;if(a&&"function"==typeof a){var l=0;c=function(u,d,p){if(u&&"EAGAIN"===u.code&&l<10)return l++,e.call(t,n,r,i,o,s,c);a.apply(this,arguments)}}return e.call(t,n,r,i,o,s,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,e),n}(t.read),t.readSync="function"!=typeof t.readSync?t.readSync:(u=t.readSync,function(e,n,r,i,o){for(var s=0;;)try{return u.call(t,e,n,r,i,o)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}});var u},polyfills}function requireLegacyStreams(){if(hasRequiredLegacyStreams)return legacyStreams;hasRequiredLegacyStreams=1;var e=require$$0$b.Stream;return legacyStreams=function(t){return{ReadStream:function n(r,i){if(!(this instanceof n))return new n(r,i);e.call(this);var o=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,i=i||{};for(var s=Object.keys(i),a=0,c=s.length;a<c;a++){var l=s[a];this[l]=i[l]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){o._read()}));t.open(this.path,this.flags,this.mode,(function(e,t){if(e)return o.emit("error",e),void(o.readable=!1);o.fd=t,o.emit("open",t),o._read()}))},WriteStream:function n(r,i){if(!(this instanceof n))return new n(r,i);e.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=i[c]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}},legacyStreams}function requireClone$1(){if(hasRequiredClone$1)return clone_1$1;hasRequiredClone$1=1,clone_1$1=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var n={__proto__:e(t)};else n=Object.create(null);return Object.getOwnPropertyNames(t).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})),n};var e=Object.getPrototypeOf||function(e){return e.__proto__};return clone_1$1}function requireGracefulFs(){if(hasRequiredGracefulFs)return gracefulFs;hasRequiredGracefulFs=1;var e,t,n=require$$0$7,r=requirePolyfills(),i=requireLegacyStreams(),o=requireClone$1(),s=require$$0__default;function a(t,n){Object.defineProperty(t,e,{get:function(){return n}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(e=Symbol.for("graceful-fs.queue"),t=Symbol.for("graceful-fs.previous")):(e="___graceful-fs.queue",t="___graceful-fs.previous");var c,l=function(){};if(s.debuglog?l=s.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(l=function(){var e=s.format.apply(s,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!n[e]){var u=commonjsGlobal[e]||[];a(n,u),n.close=function(e){function r(t,r){return e.call(n,t,(function(e){e||f(),"function"==typeof r&&r.apply(this,arguments)}))}return Object.defineProperty(r,t,{value:e}),r}(n.close),n.closeSync=function(e){function r(t){e.apply(n,arguments),f()}return Object.defineProperty(r,t,{value:e}),r}(n.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){l(n[e]),require$$0$f.equal(n[e].length,0)}))}function d(e){r(e),e.gracefulify=d,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,i,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):p([e,[n,r,i],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,o,s){return n(t,r,i,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):p([e,[t,r,i,o],n,s||Date.now(),Date.now()])}))}(e,t,r,i)};var o=e.appendFile;o&&(e.appendFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=null);return function e(t,n,r,i,s){return o(t,n,r,(function(o){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof i&&i.apply(this,arguments):p([e,[t,n,r,i],o,s||Date.now(),Date.now()])}))}(e,t,n,r)});var s=e.copyFile;s&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,i,o){return s(t,n,r,(function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):p([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)});var a=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=c.test(process.version)?function(e,t,n,r){return a(e,i(e,t,n,r))}:function(e,t,n,r){return a(e,t,i(e,t,n,r))};return r(e,t,n);function i(e,t,n,i){return function(o,s){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(s&&s.sort&&s.sort(),"function"==typeof n&&n.call(this,o,s)):p([r,[e,t,n],o,i||Date.now(),Date.now()])}}};var c=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var l=i(e);h=l.ReadStream,g=l.WriteStream}var u=e.ReadStream;u&&(h.prototype=Object.create(u.prototype),h.prototype.open=function(){var e=this;y(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var f=e.WriteStream;f&&(g.prototype=Object.create(f.prototype),g.prototype.open=function(){var e=this;y(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return h},set:function(e){h=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return g},set:function(e){g=e},enumerable:!0,configurable:!0});var _=h;Object.defineProperty(e,"FileReadStream",{get:function(){return _},set:function(e){_=e},enumerable:!0,configurable:!0});var m=g;function h(e,t){return this instanceof h?(u.apply(this,arguments),this):h.apply(Object.create(h.prototype),arguments)}function g(e,t){return this instanceof g?(f.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return m},set:function(e){m=e},enumerable:!0,configurable:!0});var A=e.open;function y(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i,o){return A(t,n,r,(function(s,a){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):p([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=y,e}function p(t){l("ENQUEUE",t[0].name,t[1]),n[e].push(t),_()}function f(){for(var t=Date.now(),r=0;r<n[e].length;++r)n[e][r].length>2&&(n[e][r][3]=t,n[e][r][4]=t);_()}function _(){if(clearTimeout(c),c=void 0,0!==n[e].length){var t=n[e].shift(),r=t[0],i=t[1],o=t[2],s=t[3],a=t[4];if(void 0===s)l("RETRY",r.name,i),r.apply(null,i);else if(Date.now()-s>=6e4){l("TIMEOUT",r.name,i);var u=i.pop();"function"==typeof u&&u.call(null,o)}else{var d=Date.now()-a,p=Math.max(a-s,1);d>=Math.min(1.2*p,100)?(l("RETRY",r.name,i),r.apply(null,i.concat([s]))):n[e].push(t)}void 0===c&&(c=setTimeout(_,0))}}return commonjsGlobal[e]||a(commonjsGlobal,n[e]),gracefulFs=d(o(n)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched&&(gracefulFs=d(n),n.__patched=!0),gracefulFs}var gracefulFsExports=requireGracefulFs(),fs=getDefaultExportFromCjs(gracefulFsExports);const homeDirectory=require$$0$9.homedir(),{env:env}=process,xdgData=env.XDG_DATA_HOME||(homeDirectory?require$$0$8.join(homeDirectory,".local","share"):void 0),xdgConfig=env.XDG_CONFIG_HOME||(homeDirectory?require$$0$8.join(homeDirectory,".config"):void 0);env.XDG_STATE_HOME||homeDirectory&&require$$0$8.join(homeDirectory,".local","state"),env.XDG_CACHE_HOME||homeDirectory&&require$$0$8.join(homeDirectory,".cache"),env.XDG_RUNTIME_DIR;const xdgDataDirectories=(env.XDG_DATA_DIRS||"/usr/local/share/:/usr/share/").split(":");xdgData&&xdgDataDirectories.unshift(xdgData);const xdgConfigDirectories=(env.XDG_CONFIG_DIRS||"/etc/xdg").split(":");xdgConfig&&xdgConfigDirectories.unshift(xdgConfig);const attemptifyAsync=(e,t)=>function(...n){return e.apply(void 0,n).catch(t)},attemptifySync=(e,t)=>function(...n){try{return e.apply(void 0,n)}catch(e){return t(e)}},IS_USER_ROOT=!!process$2.getuid&&!process$2.getuid(),LIMIT_FILES_DESCRIPTORS=1e4,NOOP=()=>{},Handlers={isChangeErrorOk:e=>{if(!Handlers.isNodeError(e))return!1;const{code:t}=e;return"ENOSYS"===t||!(IS_USER_ROOT||"EINVAL"!==t&&"EPERM"!==t)},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!Handlers.isNodeError(e))return!1;const{code:t}=e;return"EMFILE"===t||"ENFILE"===t||"EAGAIN"===t||"EBUSY"===t||"EACCESS"===t||"EACCES"===t||"EACCS"===t||"EPERM"===t},onChangeError:e=>{if(!Handlers.isNodeError(e))throw e;if(!Handlers.isChangeErrorOk(e))throw e}};class RetryfyQueue{constructor(){this.interval=25,this.intervalId=void 0,this.limit=LIMIT_FILES_DESCRIPTORS,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=e=>{this.queueWaiting.add(e),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=e=>{this.queueWaiting.delete(e),this.queueActive.delete(e)},this.schedule=()=>new Promise((e=>{const t=()=>this.remove(n),n=()=>e(t);this.add(n)})),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const e of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(e),this.queueActive.add(e),e()}}}}}var RetryfyQueue$1=new RetryfyQueue;const retryifyAsync=(e,t)=>function(n){return function r(...i){return RetryfyQueue$1.schedule().then((o=>e.apply(void 0,i).then((e=>(o(),e)),(e=>{if(o(),Date.now()>=n)throw e;if(t(e)){const e=Math.round(100*Math.random()),t=new Promise((t=>setTimeout(t,e)));return t.then((()=>r.apply(void 0,i)))}throw e}))))}},retryifySync=(e,t)=>function(n){return function r(...i){try{return e.apply(void 0,i)}catch(e){if(Date.now()>n)throw e;if(t(e))return r.apply(void 0,i);throw e}}},FS={attempt:{chmod:attemptifyAsync(promisify(fs$6.chmod),Handlers.onChangeError),chown:attemptifyAsync(promisify(fs$6.chown),Handlers.onChangeError),close:attemptifyAsync(promisify(fs$6.close),NOOP),fsync:attemptifyAsync(promisify(fs$6.fsync),NOOP),mkdir:attemptifyAsync(promisify(fs$6.mkdir),NOOP),realpath:attemptifyAsync(promisify(fs$6.realpath),NOOP),stat:attemptifyAsync(promisify(fs$6.stat),NOOP),unlink:attemptifyAsync(promisify(fs$6.unlink),NOOP),chmodSync:attemptifySync(fs$6.chmodSync,Handlers.onChangeError),chownSync:attemptifySync(fs$6.chownSync,Handlers.onChangeError),closeSync:attemptifySync(fs$6.closeSync,NOOP),existsSync:attemptifySync(fs$6.existsSync,NOOP),fsyncSync:attemptifySync(fs$6.fsync,NOOP),mkdirSync:attemptifySync(fs$6.mkdirSync,NOOP),realpathSync:attemptifySync(fs$6.realpathSync,NOOP),statSync:attemptifySync(fs$6.statSync,NOOP),unlinkSync:attemptifySync(fs$6.unlinkSync,NOOP)},retry:{close:retryifyAsync(promisify(fs$6.close),Handlers.isRetriableError),fsync:retryifyAsync(promisify(fs$6.fsync),Handlers.isRetriableError),open:retryifyAsync(promisify(fs$6.open),Handlers.isRetriableError),readFile:retryifyAsync(promisify(fs$6.readFile),Handlers.isRetriableError),rename:retryifyAsync(promisify(fs$6.rename),Handlers.isRetriableError),stat:retryifyAsync(promisify(fs$6.stat),Handlers.isRetriableError),write:retryifyAsync(promisify(fs$6.write),Handlers.isRetriableError),writeFile:retryifyAsync(promisify(fs$6.writeFile),Handlers.isRetriableError),closeSync:retryifySync(fs$6.closeSync,Handlers.isRetriableError),fsyncSync:retryifySync(fs$6.fsyncSync,Handlers.isRetriableError),openSync:retryifySync(fs$6.openSync,Handlers.isRetriableError),readFileSync:retryifySync(fs$6.readFileSync,Handlers.isRetriableError),renameSync:retryifySync(fs$6.renameSync,Handlers.isRetriableError),statSync:retryifySync(fs$6.statSync,Handlers.isRetriableError),writeSync:retryifySync(fs$6.writeSync,Handlers.isRetriableError),writeFileSync:retryifySync(fs$6.writeFileSync,Handlers.isRetriableError)}},DEFAULT_ENCODING="utf8",DEFAULT_FILE_MODE=438,DEFAULT_FOLDER_MODE=511,DEFAULT_WRITE_OPTIONS={},DEFAULT_USER_UID=os$1.userInfo().uid,DEFAULT_USER_GID=os$1.userInfo().gid,DEFAULT_TIMEOUT_SYNC=1e3,IS_POSIX=!!process$2.getuid;process$2.getuid&&process$2.getuid();const LIMIT_BASENAME_LENGTH=128,isException=e=>e instanceof Error&&"code"in e,isString$1=e=>"string"==typeof e,isUndefined=e=>void 0===e,IS_LINUX="linux"===process$2.platform,IS_WINDOWS="win32"===process$2.platform,Signals=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];IS_WINDOWS||Signals.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),IS_LINUX&&Signals.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class Interceptor{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(const e of this.callbacks)e();e&&(IS_WINDOWS&&"SIGINT"!==e&&"SIGTERM"!==e&&"SIGKILL"!==e?process$2.kill(process$2.pid,"SIGTERM"):process$2.kill(process$2.pid,e))}},this.hook=()=>{process$2.once("exit",(()=>this.exit()));for(const e of Signals)try{process$2.once(e,(()=>this.exit(e)))}catch{}},this.register=e=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Interceptor$1=new Interceptor;const whenExit=Interceptor$1.register,Temp={store:{},create:e=>{const t=`000000${Math.floor(16777215*Math.random()).toString(16)}`.slice(-6);return`${e}${`.tmp-${Date.now().toString().slice(-10)}${t}`}`},get:(e,t,n=!0)=>{const r=Temp.truncate(t(e));if(r in Temp.store)return Temp.get(e,t,n);Temp.store[r]=n;return[r,()=>delete Temp.store[r]]},purge:e=>{Temp.store[e]&&(delete Temp.store[e],FS.attempt.unlink(e))},purgeSync:e=>{Temp.store[e]&&(delete Temp.store[e],FS.attempt.unlinkSync(e))},purgeSyncAll:()=>{for(const e in Temp.store)Temp.purgeSync(e)},truncate:e=>{const t=path$1.basename(e);if(t.length<=LIMIT_BASENAME_LENGTH)return e;const n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;const r=t.length-LIMIT_BASENAME_LENGTH;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};function writeFileSync(e,t,n=DEFAULT_WRITE_OPTIONS){if(isString$1(n))return writeFileSync(e,t,{encoding:n});const r=Date.now()+((n.timeout??DEFAULT_TIMEOUT_SYNC)||-1);let i=null,o=null,s=null;try{const a=FS.attempt.realpathSync(e),c=!!a;e=a||e,[o,i]=Temp.get(e,n.tmpCreate||Temp.create,!(!1===n.tmpPurge));const l=IS_POSIX&&isUndefined(n.chown),u=isUndefined(n.mode);if(c&&(l||u)){const t=FS.attempt.statSync(e);t&&(n={...n},l&&(n.chown={uid:t.uid,gid:t.gid}),u&&(n.mode=t.mode))}if(!c){const t=path$1.dirname(e);FS.attempt.mkdirSync(t,{mode:DEFAULT_FOLDER_MODE,recursive:!0})}s=FS.retry.openSync(r)(o,"w",n.mode||DEFAULT_FILE_MODE),n.tmpCreated&&n.tmpCreated(o),isString$1(t)?FS.retry.writeSync(r)(s,t,0,n.encoding||DEFAULT_ENCODING):isUndefined(t)||FS.retry.writeSync(r)(s,t,0,t.length,0),!1!==n.fsync&&(!1!==n.fsyncWait?FS.retry.fsyncSync(r)(s):FS.attempt.fsync(s)),FS.retry.closeSync(r)(s),s=null,!n.chown||n.chown.uid===DEFAULT_USER_UID&&n.chown.gid===DEFAULT_USER_GID||FS.attempt.chownSync(o,n.chown.uid,n.chown.gid),n.mode&&n.mode!==DEFAULT_FILE_MODE&&FS.attempt.chmodSync(o,n.mode);try{FS.retry.renameSync(r)(o,e)}catch(t){if(!isException(t))throw t;if("ENAMETOOLONG"!==t.code)throw t;FS.retry.renameSync(r)(o,Temp.truncate(e))}i(),o=null}finally{s&&FS.attempt.closeSync(s),o&&Temp.purge(o)}}whenExit(Temp.purgeSyncAll);const isObject$4=e=>{const t=typeof e;return null!==e&&("object"===t||"function"===t)},disallowedKeys=new Set(["__proto__","prototype","constructor"]),digits=new Set("0123456789");function getPathSegments(e){const t=[];let n="",r="start",i=!1;for(const o of e)switch(o){case"\\":if("index"===r)throw new Error("Invalid character in an index");if("indexEnd"===r)throw new Error("Invalid character after an index");i&&(n+=o),r="property",i=!i;break;case".":if("index"===r)throw new Error("Invalid character in an index");if("indexEnd"===r){r="property";break}if(i){i=!1,n+=o;break}if(disallowedKeys.has(n))return[];t.push(n),n="",r="property";break;case"[":if("index"===r)throw new Error("Invalid character in an index");if("indexEnd"===r){r="index";break}if(i){i=!1,n+=o;break}if("property"===r){if(disallowedKeys.has(n))return[];t.push(n),n=""}r="index";break;case"]":if("index"===r){t.push(Number.parseInt(n,10)),n="",r="indexEnd";break}if("indexEnd"===r)throw new Error("Invalid character after an index");default:if("index"===r&&!digits.has(o))throw new Error("Invalid character in an index");if("indexEnd"===r)throw new Error("Invalid character after an index");"start"===r&&(r="property"),i&&(i=!1,n+="\\"),n+=o}switch(i&&(n+="\\"),r){case"property":if(disallowedKeys.has(n))return[];t.push(n);break;case"index":throw new Error("Index was not closed");case"start":t.push("")}return t}function isStringIndex(e,t){if("number"!=typeof t&&Array.isArray(e)){const n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}function assertNotStringIndex(e,t){if(isStringIndex(e,t))throw new Error("Cannot use string index")}function getProperty(e,t,n){if(!isObject$4(e)||"string"!=typeof t)return void 0===n?e:n;const r=getPathSegments(t);if(0===r.length)return n;for(let t=0;t<r.length;t++){const i=r[t];if(null==(e=isStringIndex(e,i)?t===r.length-1?void 0:null:e[i])){if(t!==r.length-1)return n;break}}return void 0===e?n:e}function setProperty$1(e,t,n){if(!isObject$4(e)||"string"!=typeof t)return e;const r=e,i=getPathSegments(t);for(let t=0;t<i.length;t++){const r=i[t];assertNotStringIndex(e,r),t===i.length-1?e[r]=n:isObject$4(e[r])||(e[r]="number"==typeof i[t+1]?[]:{}),e=e[r]}return r}function deleteProperty(e,t){if(!isObject$4(e)||"string"!=typeof t)return!1;const n=getPathSegments(t);for(let t=0;t<n.length;t++){const r=n[t];if(assertNotStringIndex(e,r),t===n.length-1)return delete e[r],!0;if(e=e[r],!isObject$4(e))return!1}}function hasProperty(e,t){if(!isObject$4(e)||"string"!=typeof t)return!1;const n=getPathSegments(t);if(0===n.length)return!1;for(const t of n){if(!isObject$4(e)||!(t in e)||isStringIndex(e,t))return!1;e=e[t]}return!0}function getConfigDirectory(e,t){const n=t?path$1.join(e,"config.json"):path$1.join("configstore",`${e}.json`),r=xdgConfig??fs.mkdtempSync(fs.realpathSync(os$1.tmpdir())+path$1.sep);return path$1.join(r,n)}const permissionError="You don't have access to this file.",mkdirOptions={mode:448,recursive:!0},writeFileOptions={mode:384};class Configstore{constructor(e,t,n={}){this._path=n.configPath??getConfigDirectory(e,n.globalConfigPath),t&&(this.all={...t,...this.all})}get all(){try{return JSON.parse(fs.readFileSync(this._path,"utf8"))}catch(e){if("ENOENT"===e.code)return{};if("EACCES"===e.code&&(e.message=`${e.message}\n${permissionError}\n`),"SyntaxError"===e.name)return writeFileSync(this._path,"",writeFileOptions),{};throw e}}set all(e){try{fs.mkdirSync(path$1.dirname(this._path),mkdirOptions),writeFileSync(this._path,JSON.stringify(e,void 0,"\t"),writeFileOptions)}catch(e){throw"EACCES"===e.code&&(e.message=`${e.message}\n${permissionError}\n`),e}}get size(){return Object.keys(this.all||{}).length}get(e){return getProperty(this.all,e)}set(e,t){const n=this.all;if(1===arguments.length)for(const t of Object.keys(e))setProperty$1(n,t,e[t]);else setProperty$1(n,e,t);this.all=n}has(e){return hasProperty(this.all,e)}delete(e){const t=this.all;deleteProperty(t,e),this.all=t}clear(){this.all={}}get path(){return this._path}}var semverExports=requireSemver(),semver=getDefaultExportFromCjs(semverExports);const debugPackage=debugModule("rdme");function debug(e){return isGHA()&&!isTest()&&("object"==typeof e?coreExports.debug(`rdme: ${JSON.stringify(e)}`):coreExports.debug(`rdme: ${e}`)),debugPackage(e)}function error(e){return isGHA()&&!isTest()?coreExports.error(e):console.error(chalk.red(e))}function info(e,t={includeEmojiPrefix:!0}){return isGHA()&&!isTest()?coreExports.notice(e):t.includeEmojiPrefix?console.info(`ℹ️ ${e}`):console.info(e)}function oraOptions(){const e={isSilent:isTest()};return debugPackage.enabled&&(e.isEnabled=!1),e}function warn(e,t="Warning!"){return isGHA()&&!isTest()?coreExports.warning(e):console.warn(chalk.yellow(`⚠️ ${t} ${e}`))}const registryUrl="https://registry.npmjs.com/rdme",pkg=JSON.parse(readFileSync(new URL("../../package.json",import.meta.url),{encoding:"utf-8"}));function getPkgVersion(){return this?.config?.version||pkg.version}async function getPkgVersionFromNPM(e){return e?fetch(registryUrl).then((e=>e.json())).then((t=>t["dist-tags"][e])).catch((e=>(error(`error fetching version from npm registry: ${e.message}`),getPkgVersion.call(this)))):getPkgVersion.call(this)}async function getMajorPkgVersion(e){return semver.major(await getPkgVersionFromNPM.call(this,e))}const configstore=new Configstore(`${pkg.name}-${process.env.NODE_ENV||"production"}${process.env.VITEST_POOL_ID||""}${process.env.VITEST_WORKER_ID||""}`);async function promptTerminal(e,t){function n(){isCI()&&(process.stdout.write("\n"),process.stdout.write("Yikes! Looks like we were about to prompt you for something in a CI environment. Are you missing an argument?"),process.stdout.write("\n\n"),process.stdout.write("Try running `rdme <command> --help` or get in touch at support@readme.io."),process.stdout.write("\n\n"),process.exit(1))}return Array.isArray(e)?e=e.map((e=>({onRender:n,...e}))):e.onRender=n,prompts(e,{onCancel:()=>{process.stdout.write("\n"),process.stdout.write("Thanks for using rdme! See you soon ✌️"),process.stdout.write("\n\n"),process.exit(1)},...t})}const cleanFileName=e=>e.replace(/[^a-z0-9]/gi,"-");function validateFilePath(e,t=e=>e){if(e.length){const n=t(e);return!fs$6.existsSync(n)||"Specified output path already exists."}return"An output path must be supplied."}function validateSubdomain(e){return/^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/.test(e)||"Project subdomain must contain only letters, numbers and dashes."}const yamlBase="# This GitHub Actions workflow was auto-generated by the `rdme` cli on {{timestamp}}\n# You can view our full documentation here: https://docs.readme.com/docs/rdme\nname: ReadMe GitHub Action 🦉\n\non:\n push:\n branches:\n # This workflow will run every time you push code to the following branch: `{{branch}}`\n # Check out GitHub's docs for more info on configuring this:\n # https://docs.github.com/actions/using-workflows/events-that-trigger-workflows\n - {{branch}}\n\njobs:\n rdme-{{cleanCommand}}:\n runs-on: ubuntu-latest\n steps:\n - name: Check out repo 📚\n uses: actions/checkout@v4\n\n - name: Run `{{command}}` command 🚀\n uses: readmeio/rdme@{{rdmeVersion}}\n with:\n rdme: {{commandString}}\n",getConfigStoreKey=e=>`createGHA.${e}`,GITHUB_WORKFLOW_DIR=".github/workflows",GITHUB_SECRET_NAME="README_API_KEY",git=simpleGit(),getGHAFileName=e=>path$1.join(GITHUB_WORKFLOW_DIR,`${cleanFileName(e).toLowerCase()}.yml`);function getKey$1(e,t){return!!Object.keys(e).some((e=>"key"===e))&&`••••••••••••${t.key?.slice(-5)||""}`}function constructCommandString(e,t,n,r){return`${e} ${Object.keys(t).map((e=>r[e])).filter(Boolean).join(" ")} ${Object.keys(n).map((e=>{const t=r[e];return"key"===e?`--key=\${{ secrets.${GITHUB_SECRET_NAME} }}`:"github"!==e&&("boolean"===n[e].type&&t?`--${e}`:!!t&&`--${e}=${t}`)})).filter(Boolean).join(" ")}`.trim()}async function getGitData(){const e=/^ {2}HEAD branch: /g,t=/^ {2}HEAD branch:.*/gm,n=await git.checkIsRepo().catch((e=>(this.debug(`[getGitData] error running git repo check: ${e.message}`),!1)));let r,i;this.debug(`[getGitData] isRepo result: ${n}`);const o=await git.remote([]).catch((e=>(this.debug(`[getGitData] error grabbing git remotes: ${e.message}`),"")));if(this.debug(`[getGitData] rawRemotes result: ${o}`),o){const n=o.split("\n")[0];this.debug(`[getGitData] remote result: ${n}`);const s=await git.remote(["show",n]).catch((e=>(this.debug(`[getGitData] error accessing remote: ${e.message}`),"")));this.debug(`[getGitData] rawRemote result: ${s}`);const a=t.exec(s)?.[0];this.debug(`[getGitData] rawHead result: ${a}`),a&&(i=a.replace(e,""));const c=await git.remote(["-v"]);this.debug(`[getGitData] remotesList result: ${c}`),r=/github/.test(c)}this.debug(`[getGitData] containsGitHubRemote result: ${r}`),this.debug(`[getGitData] defaultBranch result: ${i}`);const s=await git.revparse(["--show-toplevel"]).catch((e=>(this.debug(`[getGitData] error grabbing git root: ${e.message}`),"")));return this.debug(`[getGitData] repoRoot result: ${s}`),{containsGitHubRemote:r,defaultBranch:i,isRepo:n,repoRoot:s}}async function createGHA(e,t,n){const{args:r,flags:i,id:o}=t;if(!o)throw new Error("unable to determine command ID yikes");if(this.debug(`running GHA onboarding for ${o} command`),this.debug(`opts used in createGHA: ${JSON.stringify(n)}`),!n.github&&(isCI()||isNpmScript()||isTest()&&!process.env.TEST_RDME_CREATEGHA))return this.debug("not running GHA onboarding workflow in CI, npm script, or default test env, exiting 👋"),e;const{containsGitHubRemote:s,defaultBranch:a,isRepo:c,repoRoot:l}=await getGitData.call(this),u=configstore.get(getConfigStoreKey(l));this.debug(`repo value in config: ${u}`);const d=await getMajorPkgVersion.call(this);if(this.debug(`major pkg version: ${d}`),!n.github&&(!c||u===d||c&&!s))return this.debug("not running GHA onboarding workflow, exiting"),e;e&&info(e,{includeEmojiPrefix:!1}),n.github?info(chalk.bold("\n🚀 Let's get you set up with GitHub Actions! 🚀\n"),{includeEmojiPrefix:!1}):info(["",chalk.bold("🐙 Looks like you're running this command in a GitHub Repository! 🐙"),"",`🚀 With a few quick clicks, you can run this \`${o}\` command via GitHub Actions (${chalk.underline("https://github.com/features/actions")})`,"",`✨ This means it will run ${chalk.italic("automagically")} with every push to a branch of your choice!`,""].join("\n"),{includeEmojiPrefix:!1});const p=process.cwd();l&&l!==p&&(process.chdir(l),this.debug(`switching working directory from ${p} to ${process.cwd()}`)),prompts.override({shouldCreateGHA:n.github});const{branch:f,filePath:_,shouldCreateGHA:m}=await promptTerminal([{message:"Would you like to add a GitHub Actions workflow?",name:"shouldCreateGHA",type:"confirm",initial:!0},{message:"What GitHub branch should this workflow run on?",name:"branch",type:"text",initial:a||"main"},{message:"What would you like to name the GitHub Actions workflow file?",name:"filePath",type:"text",initial:cleanFileName(`rdme-${o}`),format:e=>getGHAFileName(e),validate:e=>validateFilePath(e,getGHAFileName)}],{onSubmit:(e,t,n)=>!n.shouldCreateGHA});if(!m)throw configstore.set(getConfigStoreKey(l),d),new Error("GitHub Actions workflow creation cancelled. If you ever change your mind, you can run this command again with the `--github` flag.");const h={branch:f,cleanCommand:cleanFileName(o),command:o,commandString:constructCommandString(o,r,i,n),rdmeVersion:`v${d}`,timestamp:(new Date).toISOString()};this.debug(`data for resolver: ${JSON.stringify(h)}`);let g=yamlBase;Object.keys(h).forEach((e=>{g=g.replace(new RegExp(`{{${e}}}`,"g"),h[e])})),fs$6.existsSync(GITHUB_WORKFLOW_DIR)||(this.debug("GHA workflow directory does not exist, creating"),fs$6.mkdirSync(GITHUB_WORKFLOW_DIR,{recursive:!0})),fs$6.writeFileSync(_,g);const A=[chalk.green("\nYour GitHub Actions workflow file has been created! ✨\n")],y=getKey$1(i,n);return y?A.push(chalk.bold("Almost done! Just a couple more steps:"),`1. Push your newly created file (${chalk.underline(_)}) to GitHub 🚀`,`2. Create a GitHub secret called ${chalk.bold(GITHUB_SECRET_NAME)} and populate the value with your ReadMe API key (${y}) 🔑`,"",`🔐 Check out GitHub's docs for more info on creating encrypted secrets (${chalk.underline("https://docs.github.com/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository")})`):A.push(`${chalk.bold("Almost done!")} Push your newly created file (${chalk.underline(_)}) to GitHub and you're all set 🚀`),A.push("",`🦉 If you have any more questions, feel free to drop us a line! ${chalk.underline("support@readme.io")}`,""),Promise.resolve(A.join("\n"))}const SUCCESS_NO_CONTENT=204;function getProxy(){return process.env.HTTPS_PROXY||process.env.https_proxy}function stripQuotes(e){return e?e.replace(/(^"|[",]*$)/g,""):""}function parseWarningHeader(e){try{let t;return e.split(/([0-9]{3} [a-z0-9.@\-/]*) /g).reduce(((e,n)=>{const r=(n=n.trim()).match(/^([0-9]{3}) (.*)/);if(r)t={code:r[1],agent:r[2],message:""};else if(n){const r=n.split(/" "/);r&&(t.message=stripQuotes(r[0]),t.date=stripQuotes(r[1]),e.push(t))}return e}),[])}catch(t){return debug(`error parsing warning header: ${t.message}`),[{code:"199",agent:"-",message:e}]}}function getUserAgent(){return`rdme${isGHA()?"-github":""}/${getPkgVersion()}`}async function normalizeFilePath(e){if("path"===e.fileType){const t=await git.revparse(["--show-toplevel"]).catch((e=>(debug(`[fetch] error grabbing git root: ${e.message}`),"")));return path$1.relative(t,e.filePath)}return e.filePath}function sanitizeHeaders(e){const t=Array.from(e.entries()).reduce(((e,t)=>(e[t[0]]="authorization"===t[0].toLowerCase()?"redacted":t[1],e)),{});return JSON.stringify(t)}async function readmeAPIv1Fetch(e,t={headers:new Headers},n={filePath:"",fileType:!1}){let r="cli",i=t.headers;if(t.headers instanceof Headers||(i=new Headers(t.headers)),i.set("User-Agent",getUserAgent()),isGHA()){r="cli-gh",process.env.GITHUB_REPOSITORY&&i.set("x-github-repository",process.env.GITHUB_REPOSITORY),process.env.GITHUB_RUN_ATTEMPT&&i.set("x-github-run-attempt",process.env.GITHUB_RUN_ATTEMPT),process.env.GITHUB_RUN_ID&&i.set("x-github-run-id",process.env.GITHUB_RUN_ID),process.env.GITHUB_RUN_NUMBER&&i.set("x-github-run-number",process.env.GITHUB_RUN_NUMBER),process.env.GITHUB_SHA&&i.set("x-github-sha",process.env.GITHUB_SHA);const e=await normalizeFilePath(n);if(e)try{const t=new URL(`${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/blob/${process.env.GITHUB_SHA}/${e}`).href;i.set("x-readme-source-url",t)}catch(e){debug(`error constructing github source url: ${e.message}`)}}isCI()&&i.set("x-rdme-ci",ciName()),i.set("x-readme-source",r),n.filePath&&"url"===n.fileType&&i.set("x-readme-source-url",n.filePath);const o=`${config.host}${e}`,s=getProxy();return debug(`making ${(t.method||"get").toUpperCase()} request to ${o} ${s?`with proxy ${s} and `:""}with headers: ${sanitizeHeaders(i)}`),fetch(o,{...t,headers:i,dispatcher:s?new undiciExports.ProxyAgent(s):void 0}).then((e=>{const t=e.headers.get("Warning");if(t){debug(`received warning header: ${t}`);parseWarningHeader(t).forEach((e=>{warn(e.message,"ReadMe API Warning:")}))}return e})).catch((e=>{throw debug(`error making fetch request: ${e}`),e}))}async function handleAPIv1Res(e,t=!0){const n=e.headers.get("content-type")||"";if("json"===mime.extension(n)){const n=await e.json();return debug(`received status code ${e.status} from ${e.url} with JSON response: ${JSON.stringify(n)}`),n.error&&t?Promise.reject(new APIv1Error(n)):n}if(e.status===SUCCESS_NO_CONTENT)return debug(`received status code ${e.status} from ${e.url} with no content`),{};const r=await e.text();return debug(`received status code ${e.status} from ${e.url} with non-JSON response: ${r}`),Promise.reject(r)}function cleanAPIv1Headers(e,t,n=new Headers){const r=Buffer.from(`${e}:`).toString("base64"),i=new Headers({Authorization:`Basic ${r}`});t&&i.set("x-readme-version",t);for(const e of n.entries())"null"!==e[1]&&"undefined"!==e[1]&&e[1].length>0&&i.set(e[0],e[1]);return i}async function getCategories(e,t){const{firstPage:n,totalCount:r}=await async function(){let n=0;return readmeAPIv1Fetch("/api/v1/categories?perPage=20&page=1",{method:"get",headers:cleanAPIv1Headers(e,t,new Headers({Accept:"application/json"}))}).then((e=>(n=Math.ceil(parseInt(e.headers.get("x-total-count")||"0",10)/20),handleAPIv1Res(e)))).then((e=>({firstPage:e,totalCount:n})))}();return n.concat(...await Promise.all([...new Array(r+1).keys()].slice(2).map((async n=>readmeAPIv1Fetch(`/api/v1/categories?perPage=20&page=${n}`,{method:"get",headers:cleanAPIv1Headers(e,t,new Headers({Accept:"application/json"}))}).then(handleAPIv1Res)))))}async function getProjectVersion(e,t,n=!1){try{if(e)return await readmeAPIv1Fetch(`/api/v1/version/${e}`,{method:"get",headers:cleanAPIv1Headers(t)}).then(handleAPIv1Res).then((e=>e.version));if(isCI())return void warn("No `--version` parameter detected in current CI environment. Defaulting to main version.");const r=await readmeAPIv1Fetch("/api/v1/version",{method:"get",headers:cleanAPIv1Headers(t)}).then(handleAPIv1Res);if(1===r.length)return r[0].version;if(n){const e=r.find((e=>!0===e.is_stable));if(!e)throw new Error("Unexpected version response from the ReadMe API. Get in touch with us at support@readme.io!");return e.version}const{versionSelection:i}=await promptTerminal({type:"select",name:"versionSelection",message:"Select your desired version",choices:r.map((e=>({title:e.version,value:e.version})))});return i}catch(e){return Promise.reject(new APIv1Error(e))}}class CategoriesCreateCommand extends BaseCommand{static id="categories create";static state="deprecated";static deprecationOptions={message:`\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`};static description="Create a category with the specified title and guide in your ReadMe project.";static args={title:libExports$3.Args.string({description:"Title of the category",required:!0})};static flags={categoryType:libExports$3.Flags.option({description:"Category type",options:["guide","reference"],required:!0})(),key:keyFlag,preventDuplicates:libExports$3.Flags.boolean({description:"Prevents the creation of a new category if there is an existing category with a matching `categoryType` and `title`"}),version:versionFlag};static examples=[{description:"Create a new category for your project version:",command:"<%= config.bin %> <%= command.id %> <title> --categoryType={guide|reference} --version={project-version}"},{description:"If you want to prevent the creation of a duplicate category with a matching `title` and `categoryType`, supply the `--preventDuplicates` flag:",command:"<%= config.bin %> <%= command.id %> <title> --categoryType={guide|reference} --version={project-version} --preventDuplicates"}];async run(){const{title:e}=this.args,{categoryType:t,key:n,version:r,preventDuplicates:i}=this.flags,o=await getProjectVersion(r,n);if(this.debug(`selectedVersion: ${o}`),i){const r=(await getCategories(n,o)).find((n=>n.title.trim().toLowerCase()===e.trim().toLowerCase()&&n.type===t));if(void 0!==r)return Promise.reject(new Error(`The '${r.title}' category with a type of '${r.type}' already exists with an id of '${r.id}'. A new category was not created.`))}const s=await readmeAPIv1Fetch("/api/v1/categories",{method:"post",headers:cleanAPIv1Headers(n,o,new Headers({"Content-Type":"application/json"})),body:JSON.stringify({title:e,type:t})}).then(handleAPIv1Res).then((e=>`🌱 successfully created '${e.title}' with a type of '${e.type}' and an id of '${e.id}'`));return Promise.resolve(chalk.green(s))}}class CategoriesCommand extends BaseCommand{static id="categories";static state="deprecated";static deprecationOptions={message:`\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`};static description="Get all categories in your ReadMe project.";static flags={key:keyFlag,version:versionFlag};static examples=[{description:"Get all categories associated to your project version:",command:"<%= config.bin %> <%= command.id %> --version={project-version}"}];async run(){const{key:e,version:t}=this.flags,n=await getProjectVersion(t,e);this.debug(`selectedVersion: ${n}`);const r=await getCategories(e,n);return Promise.resolve(JSON.stringify(r,null,2))}}var toposort$1={exports:{}},hasRequiredToposort;function requireToposort(){if(hasRequiredToposort)return toposort$1.exports;function e(e,t){var n=e.length,r=new Array(n),i={},o=n,s=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}(t),a=function(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}(e);for(t.forEach((function(e){if(!a.has(e[0])||!a.has(e[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")}));o--;)i[o]||c(e[o],o,new Set);return r;function c(e,t,o){if(o.has(e)){var l;try{l=", node was:"+JSON.stringify(e)}catch(e){l=""}throw new Error("Cyclic dependency"+l)}if(!a.has(e))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(e));if(!i[t]){i[t]=!0;var u=s.get(e)||new Set;if(t=(u=Array.from(u)).length){o.add(e);do{var d=u[--t];c(d,a.get(d),o)}while(t);o.delete(e)}r[--n]=e}}}return hasRequiredToposort=1,toposort$1.exports=function(t){return e(function(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}(t),t)},toposort$1.exports.array=e,toposort$1.exports}var toposortExports=requireToposort(),toposort=getDefaultExportFromCjs(toposortExports),ignore$1,hasRequiredIgnore;function requireIgnore(){if(hasRequiredIgnore)return ignore$1;function e(e){return Array.isArray(e)?e:[e]}hasRequiredIgnore=1;const t=/^\s+$/,n=/(?:[^\\]|^)\\$/,r=/^\\!/,i=/^\\#/,o=/\r?\n/g,s=/^\.*\/|^\.+$/;let a="node-ignore";"undefined"!=typeof Symbol&&(a=Symbol.for("node-ignore"));const c=a,l=/([0-z])-([0-z])/g,u=()=>!1,d=[[/^\uFEFF/,()=>""],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(0===n.indexOf("\\")?" ":"")],[/(\\+?)\s/g,(e,t)=>{const{length:n}=t;return t.slice(0,n-n%2)+" "}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,"[^\\/]*")],[/\\\\\\(?=[$.|*+(){^])/g,()=>"\\"],[/\\\\/g,()=>"\\"],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>"\\"===t?`\\[${n}${(e=>{const{length:t}=e;return e.slice(0,t-t%2)})(r)}${i}`:"]"===i&&r.length%2==0?`[${(e=>e.replace(l,((e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:"")))(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],p=Object.create(null),f=e=>"string"==typeof e;class _{constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}}const m=(e,t)=>{const n=e;let o=!1;0===e.indexOf("!")&&(o=!0,e=e.substr(1));const s=((e,t)=>{let n=p[e];return n||(n=d.reduce(((t,[n,r])=>t.replace(n,r.bind(e))),e),p[e]=n),t?new RegExp(n,"i"):new RegExp(n)})(e=e.replace(r,"!").replace(i,"#"),t);return new _(n,e,o,s)},h=(e,t)=>{throw new t(e)},g=(e,t,n)=>{if(!f(e))return n(`path must be a string, but got \`${t}\``,TypeError);if(!e)return n("path must not be empty",TypeError);if(g.isNotRelative(e)){return n(`path should be a ${"`path.relative()`d"} string, but got "${t}"`,RangeError)}return!0},A=e=>s.test(e);g.isNotRelative=A,g.convert=e=>e;class y{constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){var r,i,o;r=this,i=c,o=!0,Object.defineProperty(r,i,{value:o}),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[c])return this._rules=this._rules.concat(e._rules),void(this._added=!0);if((e=>e&&f(e)&&!t.test(e)&&!n.test(e)&&0!==e.indexOf("#"))(e)){const t=m(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(t){return this._added=!1,e(f(t)?(e=>e.split(o))(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach((i=>{const{negative:o}=i;if(r===o&&n!==r||o&&!n&&!r&&!t)return;i.regex.test(e)&&(n=!o,r=o)})),{ignored:n,unignored:r}}_test(e,t,n,r){const i=e&&g.convert(e);return g(i,e,this._allowRelativePaths?u:h),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||(r=e.split("/")),r.pop(),!r.length)return t[e]=this._testOne(e,n);const i=this._t(r.join("/")+"/",t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(t){return e(t).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}}const v=e=>new y(e);if(v.isPathValid=e=>g(e&&g.convert(e),e,u),v.default=v,ignore$1=v,"undefined"!=typeof process&&(process.env&&process.env.IGNORE_TEST_WIN32||"win32"===process.platform)){const e=e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,"/");g.convert=e;const t=/^[a-z]:\//i;g.isNotRelative=e=>t.test(e)||A(e)}return ignore$1}var ignoreExports=requireIgnore(),ignore=getDefaultExportFromCjs(ignoreExports),kindOf,hasRequiredKindOf,isExtendable,hasRequiredIsExtendable,extendShallow,hasRequiredExtendShallow,sectionMatter,hasRequiredSectionMatter;function readdirRecursive(e,t=!1){let n;debug(`current readdirRecursive folder: ${e}`),t&&(n=ignore.default().add(path$1.join(e,".git/")),fs$6.existsSync(path$1.join(e,".gitignore"))&&(debug(".gitignore file found, adding to ignore filter"),n.add(fs$6.readFileSync(path$1.join(e,".gitignore")).toString())));const r=fs$6.readdirSync(e,{withFileTypes:!0}).filter((r=>{if(!t)return!0;let i=path$1.join(e,r.name);return r.isDirectory()&&(i=`${i}/`),!n.ignores(i)})),i=r.filter((e=>e.isFile())).map((t=>path$1.join(e,t.name))),o=r.filter((e=>e.isDirectory()));return[...i,...[].concat(...o.map((n=>readdirRecursive(path$1.join(e,n.name),t))))]}function requireKindOf(){if(hasRequiredKindOf)return kindOf;hasRequiredKindOf=1;var e=Object.prototype.toString;function t(e){return"function"==typeof e.constructor?e.constructor.name:null}return kindOf=function(n){if(void 0===n)return"undefined";if(null===n)return"null";var r=typeof n;if("boolean"===r)return"boolean";if("string"===r)return"string";if("number"===r)return"number";if("symbol"===r)return"symbol";if("function"===r)return function(e){return"GeneratorFunction"===t(e)}(n)?"generatorfunction":"function";if(function(e){return Array.isArray?Array.isArray(e):e instanceof Array}(n))return"array";if(function(e){if(e.constructor&&"function"==typeof e.constructor.isBuffer)return e.constructor.isBuffer(e);return!1}(n))return"buffer";if(function(e){try{if("number"==typeof e.length&&"function"==typeof e.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(n))return"arguments";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(n))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(n))return"error";if(function(e){return e instanceof RegExp||"string"==typeof e.flags&&"boolean"==typeof e.ignoreCase&&"boolean"==typeof e.multiline&&"boolean"==typeof e.global}(n))return"regexp";switch(t(n)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(e){return"function"==typeof e.throw&&"function"==typeof e.return&&"function"==typeof e.next}(n))return"generator";switch(r=e.call(n)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return r.slice(8,-1).toLowerCase().replace(/\s/g,"")},kindOf} /*! * is-extendable <https://github.com/jonschlinkert/is-extendable> * @@ -78,7 +78,7 @@ o[i-4]=this.maskKey[0],o[i-3]=this.maskKey[1],o[i-2]=this.maskKey[2],o[i-1]=this * * Copyright (c) 2015, 2017, Jon Schlinkert. * Released under the MIT License. - */function requireStripBomString(){return hasRequiredStripBomString||(hasRequiredStripBomString=1,stripBomString=function(e){return"string"==typeof e&&"\ufeff"===e.charAt(0)?e.slice(1):e}),stripBomString}function requireUtils$5(){return hasRequiredUtils$5||(hasRequiredUtils$5=1,function(e){const t=requireStripBomString(),n=requireKindOf();e.define=function(e,t,n){Reflect.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:n})},e.isBuffer=function(e){return"buffer"===n(e)},e.isObject=function(e){return"object"===n(e)},e.toBuffer=function(e){return"string"==typeof e?Buffer.from(e):e},e.toString=function(n){if(e.isBuffer(n))return t(String(n));if("string"!=typeof n)throw new TypeError("expected input to be a string or buffer");return t(n)},e.arrayify=function(e){return e?Array.isArray(e)?e:[e]:[]},e.startsWith=function(e,t,n){return"number"!=typeof n&&(n=t.length),e.slice(0,n)===t}}(utils$5)),utils$5}function requireDefaults$2(){if(hasRequiredDefaults$2)return defaults$1;hasRequiredDefaults$2=1;const e=requireEngines(),t=requireUtils$5();return defaults$1=function(n){const r=Object.assign({},n);return r.delimiters=t.arrayify(r.delims||r.delimiters||"---"),1===r.delimiters.length&&r.delimiters.push(r.delimiters[0]),r.language=(r.language||r.lang||"yaml").toLowerCase(),r.engines=Object.assign({},e,r.parsers,r.engines),r},defaults$1}function requireEngine(){if(hasRequiredEngine)return engine;return hasRequiredEngine=1,engine=function(e,t){let n=t.engines[e]||t.engines[function(e){switch(e.toLowerCase()){case"js":case"javascript":return"javascript";case"coffee":case"coffeescript":case"cson":return"coffee";case"yaml":case"yml":return"yaml";default:return e}}(e)];if(void 0===n)throw new Error('gray-matter engine "'+e+'" is not registered');return"function"==typeof n&&(n={parse:n}),n},engine}function requireStringify(){if(hasRequiredStringify)return stringify;hasRequiredStringify=1;const e=requireKindOf(),t=requireEngine(),n=requireDefaults$2();function r(e){return"\n"!==e.slice(-1)?e+"\n":e}return stringify=function(i,o,s){if(null==o&&null==s)switch(e(i)){case"object":o=i.data,s={};break;case"string":return i;default:throw new TypeError("expected file to be a string or object")}const a=i.content,c=n(s);if(null==o){if(!c.data)return i;o=c.data}const l=i.language||c.language,u=t(l,c);if("function"!=typeof u.stringify)throw new TypeError('expected "'+l+'.stringify" to be a function');o=Object.assign({},i.data,o);const d=c.delimiters[0],p=c.delimiters[1],f=u.stringify(o,s).trim();let _="";return"{}"!==f&&(_=r(d)+r(f)+r(p)),"string"==typeof i.excerpt&&""!==i.excerpt&&-1===a.indexOf(i.excerpt.trim())&&(_+=r(i.excerpt)+r(p)),_+r(a)},stringify}function requireExcerpt(){if(hasRequiredExcerpt)return excerpt;hasRequiredExcerpt=1;const e=requireDefaults$2();return excerpt=function(t,n){const r=e(n);if(null==t.data&&(t.data={}),"function"==typeof r.excerpt)return r.excerpt(t,r);const i=t.data.excerpt_separator||r.excerpt_separator;if(null==i&&(!1===r.excerpt||null==r.excerpt))return t;const o="string"==typeof r.excerpt?r.excerpt:i||r.delimiters[0],s=t.content.indexOf(o);return-1!==s&&(t.excerpt=t.content.slice(0,s)),t},excerpt}function requireToFile(){if(hasRequiredToFile)return toFile;hasRequiredToFile=1;const e=requireKindOf(),t=requireStringify(),n=requireUtils$5();return toFile=function(r){return"object"!==e(r)&&(r={content:r}),"object"!==e(r.data)&&(r.data={}),r.contents&&null==r.content&&(r.content=r.contents),n.define(r,"orig",n.toBuffer(r.content)),n.define(r,"language",r.language||""),n.define(r,"matter",r.matter||""),n.define(r,"stringify",(function(e,n){return n&&n.language&&(r.language=n.language),t(r,e,n)})),r.content=n.toString(r.content),r.isEmpty=!1,r.excerpt="",r},toFile}function requireParse$1(){if(hasRequiredParse$1)return parse$4;hasRequiredParse$1=1;const e=requireEngine(),t=requireDefaults$2();return parse$4=function(n,r,i){const o=t(i),s=e(n,o);if("function"!=typeof s.parse)throw new TypeError('expected "'+n+'.parse" to be a function');return s.parse(r,o)},parse$4}function requireGrayMatter(){if(hasRequiredGrayMatter)return grayMatter$1;hasRequiredGrayMatter=1;const e=require$$0$7,t=requireSectionMatter(),n=requireDefaults$2(),r=requireStringify(),i=requireExcerpt(),o=requireEngines(),s=requireToFile(),a=requireParse$1(),c=requireUtils$5();function l(e,r){if(""===e)return{data:{},content:e,excerpt:"",orig:e};let o=s(e);const u=l.cache[o.content];if(!r){if(u)return o=Object.assign({},u),o.orig=u.orig,o;l.cache[o.content]=o}return function(e,r){const o=n(r),s=o.delimiters[0],u="\n"+o.delimiters[1];let d=e.content;o.language&&(e.language=o.language);const p=s.length;if(!c.startsWith(d,s,p))return i(e,o),e;if(d.charAt(p)===s.slice(-1))return e;d=d.slice(p);const f=d.length,_=l.language(d,o);_.name&&(e.language=_.name,d=d.slice(_.raw.length));let m=d.indexOf(u);-1===m&&(m=f);e.matter=d.slice(0,m);const h=e.matter.replace(/^\s*#[^\n]+/gm,"").trim();""===h?(e.isEmpty=!0,e.empty=e.content,e.data={}):e.data=a(e.language,e.matter,o);m===f?e.content="":(e.content=d.slice(m+u.length),"\r"===e.content[0]&&(e.content=e.content.slice(1)),"\n"===e.content[0]&&(e.content=e.content.slice(1)));i(e,o),(!0===o.sections||"function"==typeof o.section)&&t(e,o.section);return e}(o,r)}return l.engines=o,l.stringify=function(e,t,n){return"string"==typeof e&&(e=l(e,n)),r(e,t,n)},l.read=function(t,n){const r=l(e.readFileSync(t,"utf8"),n);return r.path=t,r},l.test=function(e,t){return c.startsWith(e,n(t).delimiters[0])},l.language=function(e,t){const r=n(t).delimiters[0];l.test(e)&&(e=e.slice(r.length));const i=e.slice(0,e.search(/\r?\n/));return{raw:i,name:i?i.trim():""}},l.cache={},l.clearCache=function(){l.cache={}},grayMatter$1=l}var grayMatterExports=requireGrayMatter(),grayMatter=getDefaultExportFromCjs(grayMatterExports);function readDoc(e){debug(`reading file ${e}`);const t=fs$6.readFileSync(e,"utf8"),n=grayMatter(t),{content:r,data:i}=n;debug(`front matter for ${e}: ${JSON.stringify(n)}`);const o=n.data.slug||path$1.basename(e).replace(path$1.extname(e),"").toLowerCase();return{content:r,data:i,filePath:e,hash:crypto.createHash("sha1").update(t).digest("hex"),slug:o}}async function pushDoc(e,t){const n=this.id,{key:r,dryRun:i}=this.flags,{content:o,data:s,filePath:a,hash:c,slug:l}=t;if(!Object.keys(s).length)return this.debug(`No front matter attributes found for ${a}, not syncing`),`⏭️ no front matter attributes found for ${a}, skipping`;let u={body:o,...s,lastUpdatedHash:c};return"custompages"===n&&(u=a.endsWith(".html")?{html:o,htmlmode:!0,...s,lastUpdatedHash:c}:{body:o,htmlmode:!1,...s,lastUpdatedHash:c}),readmeAPIv1Fetch(`/api/v1/${n}/${l}`,{method:"get",headers:cleanAPIv1Headers(r,e,new Headers({Accept:"application/json"}))}).then((async t=>{const o=await handleAPIv1Res(t,!1);return t.ok?(this.debug(`data received for ${l}, updating doc`),c===o.lastUpdatedHash?`${i?"🎭 dry run! ":""}\`${l}\` ${i?"will not be":"was not"} updated because there were no changes.`:i?`🎭 dry run! This will update '${l}' with contents from ${a} with the following metadata: ${JSON.stringify(s)}`:readmeAPIv1Fetch(`/api/v1/${n}/${l}`,{method:"put",headers:cleanAPIv1Headers(r,e,new Headers({"Content-Type":"application/json"})),body:JSON.stringify(u)},{filePath:a,fileType:"path"}).then(handleAPIv1Res).then((e=>`✏️ successfully updated '${e.slug}' with contents from ${a}`))):404!==t.status?Promise.reject(new APIv1Error(o)):(this.debug(`error retrieving data for ${l}, creating doc`),i?`🎭 dry run! This will create '${l}' with contents from ${a} with the following metadata: ${JSON.stringify(s)}`:readmeAPIv1Fetch(`/api/v1/${n}`,{method:"post",headers:cleanAPIv1Headers(r,e,new Headers({"Content-Type":"application/json"})),body:JSON.stringify({slug:l,...u})},{filePath:a,fileType:"path"}).then(handleAPIv1Res).then((e=>`🌱 successfully created '${e.slug}' (ID: ${e._id}) with contents from ${a}`)))})).catch((e=>{throw e.message=`Error uploading ${chalk.underline(a)}:\n\n${e.message}`,e}))}const byParentDoc=(e,t)=>(t.data.parentDoc?1:0)-(e.data.parentDoc?1:0);function sortFiles(e){const t=e.map(readDoc).sort(byParentDoc),n=t.reduce(((e,t)=>(e[t.slug]=t,e)),{}),r=Object.values(n).reduce(((e,t)=>(t.data.parentDocSlug&&n[t.data.parentDocSlug]&&e.push([n[t.data.parentDocSlug],n[t.slug]]),e)),[]);return toposort.array(t,r)}async function syncDocsPath(e){const{path:t}=this.args,n=[".markdown",".md"];"custompages"===this.id&&n.unshift(".html");let r;if((await fs$7.stat(t).catch((e=>{if("ENOENT"===e.code)throw new Error("Oops! We couldn't locate a file or directory at the path you provided.");throw e}))).isDirectory()){const i=readdirRecursive(t).filter((e=>n.includes(path$1.extname(e).toLowerCase())));if(this.debug(`number of files: ${i.length}`),!i.length)return Promise.reject(new Error(`The directory you provided (${t}) doesn't contain any of the following required files: ${n.join(", ")}.`));let o;try{o=sortFiles(i)}catch(e){return Promise.reject(e)}r=(await Promise.all(o.map((async t=>pushDoc.call(this,e,t))))).join("\n")}else{const i=path$1.extname(t).toLowerCase();if(!n.includes(i))return Promise.reject(new Error(`Invalid file extension (${i}). Must be one of the following: ${n.join(", ")}`));const o=readDoc(t);r=await pushDoc.call(this,e,o)}return Promise.resolve(chalk.green(r))}class DocsCommand extends BaseCommand{id="docs";static id="docs";static state="deprecated";static deprecationOptions={message:`\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`};static aliases=["guides"];static summary="Sync Markdown files to your ReadMe project as Guides.";static description="Syncs Markdown files to the Guides section of your ReadMe project. The path can either be a directory or a single Markdown file. The Markdown files will require YAML front matter with certain ReadMe documentation attributes. Check out our docs for more info on setting up your front matter: https://docs.readme.com/main/docs/rdme#markdown-file-setup";static args={path:libExports$3.Args.string({description:"Path to a local Markdown file or folder of Markdown files.",required:!0})};static flags={key:keyFlag,version:versionFlag,github:githubFlag,dryRun:libExports$3.Flags.boolean({description:"Runs the command without creating/updating any docs in ReadMe. Useful for debugging."})};static examples=[{description:"Passing in a path to a directory will also sync any Markdown files that are located in subdirectories. The path input can also be individual Markdown files:",command:"<%= config.bin %> <%= command.id %> [path] --version={project-version}"},{description:"This command also has a dry run mode, which can be useful for initial setup and debugging. You can read more about dry run mode in our docs: https://docs.readme.com/main/docs/rdme#dry-run-mode",command:"<%= config.bin %> <%= command.id %> [path] --version={project-version} --dryRun"}];async run(){const{key:e,version:t}=this.flags,n=await getProjectVersion(t,e);return this.runCreateGHAHook({result:await syncDocsPath.call(this,n),parsedOpts:{...this.args,...this.flags,version:n}})}}class ChangelogsCommand extends BaseCommand{id="changelogs";static id="changelogs";static summary="Sync Markdown files to your ReadMe project as Changelog posts.";static description="Syncs Markdown files to the Changelog section of your ReadMe project. The path can either be a directory or a single Markdown file. The Markdown files will require YAML front matter with certain ReadMe documentation attributes. Check out our docs for more info on setting up your front matter: https://docs.readme.com/main/docs/rdme#markdown-file-setup";static args={path:libExports$3.Args.string({description:"Path to a local Markdown file or folder of Markdown files.",required:!0})};static examples=DocsCommand.examples;static flags={github:githubFlag,key:keyFlag,dryRun:libExports$3.Flags.boolean({description:"Runs the command without creating/updating any changelogs in ReadMe. Useful for debugging."})};async run(){return this.runCreateGHAHook({result:await syncDocsPath.call(this)})}}class CustomPagesCommand extends BaseCommand{id="custompages";static id="custompages";static state="deprecated";static deprecationOptions={message:`\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`};static summary="Sync Markdown/HTML files to your ReadMe project as Custom Pages.";static description="Syncs Markdown files as Custom Pages in your ReadMe project. The path can either be a directory or a single Markdown file. The Markdown files will require YAML front matter with certain ReadMe documentation attributes. Check out our docs for more info on setting up your front matter: https://docs.readme.com/main/docs/rdme#markdown-file-setup";static args={path:libExports$3.Args.string({description:"Path to a local Markdown file or folder of Markdown files.",required:!0})};static examples=DocsCommand.examples;static flags={github:githubFlag,key:keyFlag,dryRun:libExports$3.Flags.boolean({description:"Runs the command without creating/updating any custom pages in ReadMe. Useful for debugging."})};async run(){return this.runCreateGHAHook({result:await syncDocsPath.call(this)})}}async function deleteDoc(e,t,n,r){return n?Promise.resolve(`🎭 dry run! This will delete \`${r}\`.`):readmeAPIv1Fetch(`/api/v1/docs/${r}`,{method:"delete",headers:cleanAPIv1Headers(e,t,new Headers({"Content-Type":"application/json"}))}).then(handleAPIv1Res).then((()=>`🗑️ successfully deleted \`${r}\`.`))}function flatten(e){const t=[];return[].concat(...e).forEach((e=>{t.push(e),e.children&&e.children.forEach((e=>{t.push(e)}))})),t.sort((e=>e.children?.length?1:-1)),t}async function getCategoryDocs(e,t,n){return readmeAPIv1Fetch(`/api/v1/categories/${n}/docs`,{method:"get",headers:cleanAPIv1Headers(e,t,new Headers({"Content-Type":"application/json"}))}).then(handleAPIv1Res)}async function getDocs(e,t){return getCategories(e,t).then((e=>e.filter((({type:e})=>"guide"===e)))).then((n=>n.map((({slug:n})=>getCategoryDocs(e,t,n))))).then((e=>Promise.all(e))).then(flatten)}function getSlug(e){const{slug:t}=readDoc(e);return t}class DocsPruneCommand extends BaseCommand{static id="docs prune";static state="deprecated";static deprecationOptions={message:`\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`};static aliases=["guides prune"];static description="Delete any docs from ReadMe if their slugs are not found in the target folder.";static args={folder:libExports$3.Args.string({description:"A local folder containing the files you wish to prune.",required:!0})};static flags={key:keyFlag,version:versionFlag,github:githubFlag,confirm:libExports$3.Flags.boolean({description:"Bypass the confirmation prompt. Useful for CI environments."}),dryRun:libExports$3.Flags.boolean({description:"Runs the command without deleting any docs in ReadMe. Useful for debugging."})};static examples=[{description:"If you wish to delete documents from ReadMe that are no longer present in your local directory:",command:"<%= config.bin %> <%= command.id %> [path-to-directory-of-markdown]"},{description:"Run with `--confirm` to bypass the confirmation prompt (useful for CI environments):",command:"<%= config.bin %> <%= command.id %> [path-to-directory-of-markdown] --confirm"}];async run(){const{folder:e}=this.args,{dryRun:t,key:n,version:r}=this.flags,i=await getProjectVersion(r,n);this.debug(`selectedVersion: ${i}`);const o=readdirRecursive(e).filter((e=>e.toLowerCase().endsWith(".md")||e.toLowerCase().endsWith(".markdown")));this.debug(`number of files: ${o.length}`),prompts.override({confirm:this.flags.confirm});const{confirm:s}=await promptTerminal({type:"confirm",name:"confirm",message:`This command will delete all guides page from your ReadMe project (version ${i}) that are not also in ${e}, would you like to confirm?`});if(!s)return Promise.reject(new Error("Aborting, no changes were made."));const a=(await getDocs(n,i)).map((({slug:e})=>e)),c=new Set(o.map(getSlug)),l=a.filter((e=>!c.has(e))),u=await Promise.all(l.map((e=>deleteDoc(n,i,t,e))));return this.runCreateGHAHook({result:chalk.green(u.join("\n")),parsedOpts:{...this.args,...this.flags,version:i,confirm:!0}})}}var isEmail$1={exports:{}},assertString={exports:{}},hasRequiredAssertString;function requireAssertString(){return hasRequiredAssertString||(hasRequiredAssertString=1,function(e,t){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="string"==typeof e||e instanceof String;if(!t){var r=n(e);throw null===e?r="null":"object"===r&&(r=e.constructor.name),new TypeError("Expected a string but received a ".concat(r))}},e.exports=t.default,e.exports.default=t.default}(assertString,assertString.exports)),assertString.exports}var isByteLength={exports:{}},hasRequiredIsByteLength;function requireIsByteLength(){return hasRequiredIsByteLength||(hasRequiredIsByteLength=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n,o;(0,r.default)(e),"object"===i(t)?(n=t.min||0,o=t.max):(n=arguments[1],o=arguments[2]);var s=encodeURI(e).split(/%..|./).length-1;return s>=n&&(void 0===o||s<=o)};var n,r=(n=requireAssertString())&&n.__esModule?n:{default:n};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}e.exports=t.default,e.exports.default=t.default}(isByteLength,isByteLength.exports)),isByteLength.exports}var isFQDN={exports:{}},merge$2={exports:{}},hasRequiredMerge$1,hasRequiredIsFQDN;function requireMerge$1(){return hasRequiredMerge$1||(hasRequiredMerge$1=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e},e.exports=t.default,e.exports.default=t.default}(merge$2,merge$2.exports)),merge$2.exports}function requireIsFQDN(){return hasRequiredIsFQDN||(hasRequiredIsFQDN=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(e),t=(0,r.default)(t,o),t.allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var i=e.split("."),s=i[i.length-1];if(t.require_tld){if(i.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(s))return!1;if(/\s/.test(s))return!1}if(!t.allow_numeric_tld&&/^\d+$/.test(s))return!1;return i.every((function(e){return!(e.length>63&&!t.ignore_max_length)&&(!!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)&&(!/[\uff01-\uff5e]/.test(e)&&(!/^-|-$/.test(e)&&!(!t.allow_underscores&&/_/.test(e)))))}))};var n=i(requireAssertString()),r=i(requireMerge$1());function i(e){return e&&e.__esModule?e:{default:e}}var o={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default}(isFQDN,isFQDN.exports)),isFQDN.exports}var isIP={exports:{}},hasRequiredIsIP,hasRequiredIsEmail;function requireIsIP(){return hasRequiredIsIP||(hasRequiredIsIP=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,r.default)(t),n=String(n),!n)return e(t,4)||e(t,6);if("4"===n)return s.test(t);if("6"===n)return c.test(t);return!1};var n,r=(n=requireAssertString())&&n.__esModule?n:{default:n};var i="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",o="(".concat(i,"[.]){3}").concat(i),s=new RegExp("^".concat(o,"$")),a="(?:[0-9a-fA-F]{1,4})",c=new RegExp("^("+"(?:".concat(a,":){7}(?:").concat(a,"|:)|")+"(?:".concat(a,":){6}(?:").concat(o,"|:").concat(a,"|:)|")+"(?:".concat(a,":){5}(?::").concat(o,"|(:").concat(a,"){1,2}|:)|")+"(?:".concat(a,":){4}(?:(:").concat(a,"){0,1}:").concat(o,"|(:").concat(a,"){1,3}|:)|")+"(?:".concat(a,":){3}(?:(:").concat(a,"){0,2}:").concat(o,"|(:").concat(a,"){1,4}|:)|")+"(?:".concat(a,":){2}(?:(:").concat(a,"){0,3}:").concat(o,"|(:").concat(a,"){1,5}|:)|")+"(?:".concat(a,":){1}(?:(:").concat(a,"){0,4}:").concat(o,"|(:").concat(a,"){1,6}|:)|")+"(?::((?::".concat(a,"){0,5}:").concat(o,"|(?::").concat(a,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default}(isIP,isIP.exports)),isIP.exports}function requireIsEmail(){return hasRequiredIsEmail||(hasRequiredIsEmail=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,n.default)(e),t=(0,s.default)(t,c),t.require_display_name||t.allow_display_name){var a=e.match(l);if(a){var h=a[1];if(e=e.replace(h,"").replace(/(^<|>$)/g,""),h.endsWith(" ")&&(h=h.slice(0,-1)),!function(e){var t=e.replace(/^"(.+)"$/,"$1");if(!t.trim())return!1;if(/[\.";<>]/.test(t)){if(t===e)return!1;if(!(t.split('"').length===t.split('\\"').length))return!1}return!0}(h))return!1}else if(t.require_display_name)return!1}if(!t.ignore_max_length&&e.length>m)return!1;var g=e.split("@"),A=g.pop(),y=A.toLowerCase();if(t.host_blacklist.includes(y))return!1;if(t.host_whitelist.length>0&&!t.host_whitelist.includes(y))return!1;var v=g.join("@");if(t.domain_specific_validation&&("gmail.com"===y||"googlemail.com"===y)){var b=(v=v.toLowerCase()).split("+")[0];if(!(0,r.default)(b.replace(/\./g,""),{min:6,max:30}))return!1;for(var C=b.split("."),E=0;E<C.length;E++)if(!d.test(C[E]))return!1}if(!(!1!==t.ignore_max_length||(0,r.default)(v,{max:64})&&(0,r.default)(A,{max:254})))return!1;if(!(0,i.default)(A,{require_tld:t.require_tld,ignore_max_length:t.ignore_max_length,allow_underscores:t.allow_underscores})){if(!t.allow_ip_domain)return!1;if(!(0,o.default)(A)){if(!A.startsWith("[")||!A.endsWith("]"))return!1;var x=A.slice(1,-1);if(0===x.length||!(0,o.default)(x))return!1}}if('"'===v[0])return v=v.slice(1,v.length-1),t.allow_utf8_local_part?_.test(v):p.test(v);for(var S=t.allow_utf8_local_part?f:u,k=v.split("."),D=0;D<k.length;D++)if(!S.test(k[D]))return!1;if(t.blacklisted_chars&&-1!==v.search(new RegExp("[".concat(t.blacklisted_chars,"]+"),"g")))return!1;return!0};var n=a(requireAssertString()),r=a(requireIsByteLength()),i=a(requireIsFQDN()),o=a(requireIsIP()),s=a(requireMerge$1());function a(e){return e&&e.__esModule?e:{default:e}}var c={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},l=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,u=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,d=/^[a-z\d]+$/,p=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,f=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,_=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,m=254;e.exports=t.default,e.exports.default=t.default}(isEmail$1,isEmail$1.exports)),isEmail$1.exports}var isEmailExports=requireIsEmail(),isEmail=getDefaultExportFromCjs(isEmailExports);function getCurrentConfig(){let e=(...e)=>{};this?.debug&&"function"==typeof this.debug&&(e=this.debug);return{apiKey:(()=>{switch(!0){case!!process.env.RDME_API_KEY:return e("using RDME_API_KEY env var for api key"),process.env.RDME_API_KEY;case!!process.env.README_API_KEY:return e("using README_API_KEY env var for api key"),process.env.README_API_KEY;default:return e("falling back to configstore value for api key"),configstore.get("apiKey")}})(),email:1==!!process.env.RDME_EMAIL?(e("using RDME_EMAIL env var for email"),process.env.RDME_EMAIL):(e("falling back to configstore value for email"),configstore.get("email")),project:1==!!process.env.RDME_PROJECT?(e("using RDME_PROJECT env var for project"),process.env.RDME_PROJECT):(e("falling back to configstore value for project"),configstore.get("project"))}}function loginFetch(e){return readmeAPIv1Fetch("/api/v1/login",{method:"post",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)})}async function loginFlow(e){const t=getCurrentConfig(),{email:n,password:r,project:i}=await promptTerminal([{type:"text",name:"email",message:"What is your email address?",initial:t.email,validate:e=>!!isEmail.default(e)||"Please provide a valid email address."},{type:"invisible",name:"password",message:"What is your password?"},{type:"text",name:"project",message:"What project subdomain are you logging into?",initial:t.project,validate:validateSubdomain}]);if(!i)return Promise.reject(new Error("No project subdomain provided. Please use `--project`."));if(!isEmail.default(n))return Promise.reject(new Error("You must provide a valid email address."));const o={email:n,password:r,project:i};return e&&(o.token=e),loginFetch(o).then(handleAPIv1Res).catch((async e=>{if("LOGIN_TWOFACTOR"===e.code){debug("2FA error response, prompting for 2FA code");const e=await promptTerminal({type:"text",name:"otp",message:"What is your 2FA token?"});return loginFetch({email:n,password:r,project:i,token:e.otp}).then(handleAPIv1Res)}throw e})).then((e=>(configstore.set("apiKey",e.apiKey),configstore.set("email",n),configstore.set("project",i),`Successfully logged in as ${chalk.green(n)} to the ${chalk.blue(i)} project.`)))}class LoginCommand extends BaseCommand{static description="Login to a ReadMe project.";static flags={email:libExports$3.Flags.string({description:"Your email address"}),password:libExports$3.Flags.string({description:"Your password"}),otp:libExports$3.Flags.string({description:"Your one-time password (if you have two-factor authentication enabled)"}),project:libExports$3.Flags.string({description:"The subdomain of the project you wish to log into"})};async run(){return prompts.override(this.flags),loginFlow(this.flags.otp)}}class LogoutCommand extends BaseCommand{static description="Logs the currently authenticated user out of ReadMe.";async run(){return configstore.has("email")&&configstore.has("project")&&configstore.clear(),Promise.resolve(`You have logged out of ReadMe. Please use \`${this.config.bin} login\` to login again.`)}}let isDockerCached,cachedResult;function hasDockerEnv(){try{return fs$6.statSync("/.dockerenv"),!0}catch{return!1}}function hasDockerCGroup(){try{return fs$6.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function isDocker(){return void 0===isDockerCached&&(isDockerCached=hasDockerEnv()||hasDockerCGroup()),isDockerCached}const hasContainerEnv=()=>{try{return fs$6.statSync("/run/.containerenv"),!0}catch{return!1}};function isInsideContainer(){return void 0===cachedResult&&(cachedResult=hasContainerEnv()||isDocker()),cachedResult}const isWsl=()=>{if("linux"!==process$2.platform)return!1;if(os$1.release().toLowerCase().includes("microsoft"))return!isInsideContainer();try{return!!fs$6.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")&&!isInsideContainer()}catch{return!1}};var isWsl$1=process$2.env.__IS_WSL_TEST__?isWsl:isWsl();function defineLazyProperty(e,t,n){const r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=n();return r(e),e},set(e){r(e)}}),e}const execFileAsync$3=promisify(execFile);async function defaultBrowserId(){if("darwin"!==process$2.platform)throw new Error("macOS only");const{stdout:e}=await execFileAsync$3("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),t=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e);return t?.groups.id??"com.apple.Safari"}const execFileAsync$2=promisify(execFile);async function runAppleScript(e,{humanReadableOutput:t=!0}={}){if("darwin"!==process$2.platform)throw new Error("macOS only");const n=t?[]:["-ss"],{stdout:r}=await execFileAsync$2("osascript",["-e",e,n]);return r.trim()}async function bundleName(e){return runAppleScript(`tell application "Finder" to set app_path to application file id "${e}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}const execFileAsync$1=promisify(execFile),windowsBrowserProgIds={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}};class UnknownBrowserError extends Error{}async function defaultBrowser$1(e=execFileAsync$1){const{stdout:t}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!n)throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);const{id:r}=n.groups,i=windowsBrowserProgIds[r];if(!i)throw new UnknownBrowserError(`Unknown browser ID: ${r}`);return i}const execFileAsync=promisify(execFile),titleize=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(e=>e.toUpperCase()));async function defaultBrowser(){if("darwin"===process$2.platform){const e=await defaultBrowserId();return{name:await bundleName(e),id:e}}if("linux"===process$2.platform){const{stdout:e}=await execFileAsync("xdg-mime",["query","default","x-scheme-handler/http"]),t=e.trim();return{name:titleize(t.replace(/.desktop$/,"").replace("-"," ")),id:t}}if("win32"===process$2.platform)return defaultBrowser$1();throw new Error("Only macOS, Linux, and Windows are supported")}const __dirname$1=path$1.dirname(fileURLToPath(import.meta.url)),localXdgOpenPath=path$1.join(__dirname$1,"xdg-open"),{platform:platform,arch:arch}=process$2,getWslDrivesMountPoint=(()=>{const e="/mnt/";let t;return async function(){if(t)return t;const n="/etc/wsl.conf";let r=!1;try{await fs$7.access(n,constants$9.F_OK),r=!0}catch{}if(!r)return e;const i=await fs$7.readFile(n,{encoding:"utf8"}),o=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return o?(t=o.groups.mountPoint.trim(),t=t.endsWith("/")?t:`${t}/`,t):e}})(),pTryEach=async(e,t)=>{let n;for(const r of e)try{return await t(r)}catch(e){n=e}throw n},baseOpen=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return pTryEach(e.app,(t=>baseOpen({...e,app:t})));let t,{name:n,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(n))return pTryEach(n,(t=>baseOpen({...e,app:{name:t,arguments:r}})));if("browser"===n||"browserPrivate"===n){const t={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},i={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},o=await defaultBrowser();if(o.id in t){const s=t[o.id];return"browserPrivate"===n&&r.push(i[s]),baseOpen({...e,app:{name:apps[s],arguments:r}})}throw new Error(`${o.name} is not supported as a default browser`)}const i=[],o={};if("darwin"===platform)t="open",e.wait&&i.push("--wait-apps"),e.background&&i.push("--background"),e.newInstance&&i.push("--new"),n&&i.push("-a",n);else if("win32"===platform||isWsl$1&&!isInsideContainer()&&!n){const s=await getWslDrivesMountPoint();t=isWsl$1?`${s}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process$2.env.SYSTEMROOT||process$2.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),isWsl$1||(o.windowsVerbatimArguments=!0);const a=["Start"];e.wait&&a.push("-Wait"),n?(a.push(`"\`"${n}\`""`),e.target&&r.push(e.target)):e.target&&a.push(`"${e.target}"`),r.length>0&&(r=r.map((e=>`"\`"${e}\`""`)),a.push("-ArgumentList",r.join(","))),e.target=Buffer$1.from(a.join(" "),"utf16le").toString("base64")}else{if(n)t=n;else{const e=!__dirname$1||"/"===__dirname$1;let n=!1;try{await fs$7.access(localXdgOpenPath,constants$9.X_OK),n=!0}catch{}t=process$2.versions.electron??("android"===platform||e||!n)?"xdg-open":localXdgOpenPath}r.length>0&&i.push(...r),e.wait||(o.stdio="ignore",o.detached=!0)}"darwin"===platform&&r.length>0&&i.push("--args",...r),e.target&&i.push(e.target);const s=childProcess.spawn(t,i,o);return e.wait?new Promise(((t,n)=>{s.once("error",n),s.once("close",(r=>{!e.allowNonzeroExitCode&&r>0?n(new Error(`Exited with code ${r}`)):t(s)}))})):(s.unref(),s)},open=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `target`");return baseOpen({...t,target:e})};function detectArchBinary(e){if("string"==typeof e||Array.isArray(e))return e;const{[arch]:t}=e;if(!t)throw new Error(`${arch} is not supported`);return t}function detectPlatformBinary({[platform]:e},{wsl:t}){if(t&&isWsl$1)return detectArchBinary(t);if(!e)throw new Error(`${platform} is not supported`);return detectArchBinary(e)}const apps={};defineLazyProperty(apps,"chrome",(()=>detectPlatformBinary({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}))),defineLazyProperty(apps,"firefox",(()=>detectPlatformBinary({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}))),defineLazyProperty(apps,"edge",(()=>detectPlatformBinary({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}))),defineLazyProperty(apps,"browser",(()=>"browser")),defineLazyProperty(apps,"browserPrivate",(()=>"browserPrivate"));class OpenCommand extends BaseCommand{static description="Open your current ReadMe project in the browser.";static flags={dash:libExports$3.Flags.boolean({description:"Opens your current ReadMe project dashboard."}),mock:libExports$3.Flags.boolean({description:"[hidden] used for mocking.",hidden:!0})};static hidden=!0;static id="open";static state="deprecated";static deprecationOptions={message:`\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`};async run(){const{dash:e,mock:t}=this.flags,{apiKey:n,project:r}=getCurrentConfig();if(this.debug(`project: ${r}`),!r)return Promise.reject(new Error(`Please login using \`${this.config.bin} login\`.`));let i;if(e){if(!n)return Promise.reject(new Error(`Please login using \`${this.config.bin} login\`.`));const e=await getProjectVersion(void 0,n,!0);i=`${config.host}/project/${r}/v${e}/overview`}else{i=config.hub.replace("{project}",r)}const o=`Opening ${chalk.green(i)} in your browser...`;return t?Promise.resolve(o):open(i,{wait:!1}).then((()=>Promise.resolve(o)))}} + */function requireStripBomString(){return hasRequiredStripBomString||(hasRequiredStripBomString=1,stripBomString=function(e){return"string"==typeof e&&"\ufeff"===e.charAt(0)?e.slice(1):e}),stripBomString}function requireUtils$5(){return hasRequiredUtils$5||(hasRequiredUtils$5=1,function(e){const t=requireStripBomString(),n=requireKindOf();e.define=function(e,t,n){Reflect.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:n})},e.isBuffer=function(e){return"buffer"===n(e)},e.isObject=function(e){return"object"===n(e)},e.toBuffer=function(e){return"string"==typeof e?Buffer.from(e):e},e.toString=function(n){if(e.isBuffer(n))return t(String(n));if("string"!=typeof n)throw new TypeError("expected input to be a string or buffer");return t(n)},e.arrayify=function(e){return e?Array.isArray(e)?e:[e]:[]},e.startsWith=function(e,t,n){return"number"!=typeof n&&(n=t.length),e.slice(0,n)===t}}(utils$5)),utils$5}function requireDefaults$2(){if(hasRequiredDefaults$2)return defaults$1;hasRequiredDefaults$2=1;const e=requireEngines(),t=requireUtils$5();return defaults$1=function(n){const r=Object.assign({},n);return r.delimiters=t.arrayify(r.delims||r.delimiters||"---"),1===r.delimiters.length&&r.delimiters.push(r.delimiters[0]),r.language=(r.language||r.lang||"yaml").toLowerCase(),r.engines=Object.assign({},e,r.parsers,r.engines),r},defaults$1}function requireEngine(){if(hasRequiredEngine)return engine;return hasRequiredEngine=1,engine=function(e,t){let n=t.engines[e]||t.engines[function(e){switch(e.toLowerCase()){case"js":case"javascript":return"javascript";case"coffee":case"coffeescript":case"cson":return"coffee";case"yaml":case"yml":return"yaml";default:return e}}(e)];if(void 0===n)throw new Error('gray-matter engine "'+e+'" is not registered');return"function"==typeof n&&(n={parse:n}),n},engine}function requireStringify(){if(hasRequiredStringify)return stringify;hasRequiredStringify=1;const e=requireKindOf(),t=requireEngine(),n=requireDefaults$2();function r(e){return"\n"!==e.slice(-1)?e+"\n":e}return stringify=function(i,o,s){if(null==o&&null==s)switch(e(i)){case"object":o=i.data,s={};break;case"string":return i;default:throw new TypeError("expected file to be a string or object")}const a=i.content,c=n(s);if(null==o){if(!c.data)return i;o=c.data}const l=i.language||c.language,u=t(l,c);if("function"!=typeof u.stringify)throw new TypeError('expected "'+l+'.stringify" to be a function');o=Object.assign({},i.data,o);const d=c.delimiters[0],p=c.delimiters[1],f=u.stringify(o,s).trim();let _="";return"{}"!==f&&(_=r(d)+r(f)+r(p)),"string"==typeof i.excerpt&&""!==i.excerpt&&-1===a.indexOf(i.excerpt.trim())&&(_+=r(i.excerpt)+r(p)),_+r(a)},stringify}function requireExcerpt(){if(hasRequiredExcerpt)return excerpt;hasRequiredExcerpt=1;const e=requireDefaults$2();return excerpt=function(t,n){const r=e(n);if(null==t.data&&(t.data={}),"function"==typeof r.excerpt)return r.excerpt(t,r);const i=t.data.excerpt_separator||r.excerpt_separator;if(null==i&&(!1===r.excerpt||null==r.excerpt))return t;const o="string"==typeof r.excerpt?r.excerpt:i||r.delimiters[0],s=t.content.indexOf(o);return-1!==s&&(t.excerpt=t.content.slice(0,s)),t},excerpt}function requireToFile(){if(hasRequiredToFile)return toFile;hasRequiredToFile=1;const e=requireKindOf(),t=requireStringify(),n=requireUtils$5();return toFile=function(r){return"object"!==e(r)&&(r={content:r}),"object"!==e(r.data)&&(r.data={}),r.contents&&null==r.content&&(r.content=r.contents),n.define(r,"orig",n.toBuffer(r.content)),n.define(r,"language",r.language||""),n.define(r,"matter",r.matter||""),n.define(r,"stringify",(function(e,n){return n&&n.language&&(r.language=n.language),t(r,e,n)})),r.content=n.toString(r.content),r.isEmpty=!1,r.excerpt="",r},toFile}function requireParse$1(){if(hasRequiredParse$1)return parse$4;hasRequiredParse$1=1;const e=requireEngine(),t=requireDefaults$2();return parse$4=function(n,r,i){const o=t(i),s=e(n,o);if("function"!=typeof s.parse)throw new TypeError('expected "'+n+'.parse" to be a function');return s.parse(r,o)},parse$4}function requireGrayMatter(){if(hasRequiredGrayMatter)return grayMatter$1;hasRequiredGrayMatter=1;const e=require$$0$7,t=requireSectionMatter(),n=requireDefaults$2(),r=requireStringify(),i=requireExcerpt(),o=requireEngines(),s=requireToFile(),a=requireParse$1(),c=requireUtils$5();function l(e,r){if(""===e)return{data:{},content:e,excerpt:"",orig:e};let o=s(e);const u=l.cache[o.content];if(!r){if(u)return o=Object.assign({},u),o.orig=u.orig,o;l.cache[o.content]=o}return function(e,r){const o=n(r),s=o.delimiters[0],u="\n"+o.delimiters[1];let d=e.content;o.language&&(e.language=o.language);const p=s.length;if(!c.startsWith(d,s,p))return i(e,o),e;if(d.charAt(p)===s.slice(-1))return e;d=d.slice(p);const f=d.length,_=l.language(d,o);_.name&&(e.language=_.name,d=d.slice(_.raw.length));let m=d.indexOf(u);-1===m&&(m=f);e.matter=d.slice(0,m);const h=e.matter.replace(/^\s*#[^\n]+/gm,"").trim();""===h?(e.isEmpty=!0,e.empty=e.content,e.data={}):e.data=a(e.language,e.matter,o);m===f?e.content="":(e.content=d.slice(m+u.length),"\r"===e.content[0]&&(e.content=e.content.slice(1)),"\n"===e.content[0]&&(e.content=e.content.slice(1)));i(e,o),(!0===o.sections||"function"==typeof o.section)&&t(e,o.section);return e}(o,r)}return l.engines=o,l.stringify=function(e,t,n){return"string"==typeof e&&(e=l(e,n)),r(e,t,n)},l.read=function(t,n){const r=l(e.readFileSync(t,"utf8"),n);return r.path=t,r},l.test=function(e,t){return c.startsWith(e,n(t).delimiters[0])},l.language=function(e,t){const r=n(t).delimiters[0];l.test(e)&&(e=e.slice(r.length));const i=e.slice(0,e.search(/\r?\n/));return{raw:i,name:i?i.trim():""}},l.cache={},l.clearCache=function(){l.cache={}},grayMatter$1=l}var grayMatterExports=requireGrayMatter(),grayMatter=getDefaultExportFromCjs(grayMatterExports);function readDoc(e){debug(`reading file ${e}`);const t=fs$6.readFileSync(e,"utf8"),n=grayMatter(t),{content:r,data:i}=n;debug(`front matter for ${e}: ${JSON.stringify(n)}`);const o=n.data.slug||path$1.basename(e).replace(path$1.extname(e),"").toLowerCase();return{content:r,data:i,filePath:e,hash:crypto.createHash("sha1").update(t).digest("hex"),slug:o}}async function pushDoc(e,t){const n=this.id,{key:r,dryRun:i}=this.flags,{content:o,data:s,filePath:a,hash:c,slug:l}=t;if(!Object.keys(s).length)return this.debug(`No front matter attributes found for ${a}, not syncing`),`⏭️ no front matter attributes found for ${a}, skipping`;let u={body:o,...s,lastUpdatedHash:c};return"custompages"===n&&(u=a.endsWith(".html")?{html:o,htmlmode:!0,...s,lastUpdatedHash:c}:{body:o,htmlmode:!1,...s,lastUpdatedHash:c}),readmeAPIv1Fetch(`/api/v1/${n}/${l}`,{method:"get",headers:cleanAPIv1Headers(r,e,new Headers({Accept:"application/json"}))}).then((async t=>{const o=await handleAPIv1Res(t,!1);return t.ok?(this.debug(`data received for ${l}, updating doc`),c===o.lastUpdatedHash?`${i?"🎭 dry run! ":""}\`${l}\` ${i?"will not be":"was not"} updated because there were no changes.`:i?`🎭 dry run! This will update '${l}' with contents from ${a} with the following metadata: ${JSON.stringify(s)}`:readmeAPIv1Fetch(`/api/v1/${n}/${l}`,{method:"put",headers:cleanAPIv1Headers(r,e,new Headers({"Content-Type":"application/json"})),body:JSON.stringify(u)},{filePath:a,fileType:"path"}).then(handleAPIv1Res).then((e=>`✏️ successfully updated '${e.slug}' with contents from ${a}`))):404!==t.status?Promise.reject(new APIv1Error(o)):(this.debug(`error retrieving data for ${l}, creating doc`),i?`🎭 dry run! This will create '${l}' with contents from ${a} with the following metadata: ${JSON.stringify(s)}`:readmeAPIv1Fetch(`/api/v1/${n}`,{method:"post",headers:cleanAPIv1Headers(r,e,new Headers({"Content-Type":"application/json"})),body:JSON.stringify({slug:l,...u})},{filePath:a,fileType:"path"}).then(handleAPIv1Res).then((e=>`🌱 successfully created '${e.slug}' (ID: ${e._id}) with contents from ${a}`)))})).catch((e=>{throw e.message=`Error uploading ${chalk.underline(a)}:\n\n${e.message}`,e}))}const byParentDoc=(e,t)=>(t.data.parentDoc?1:0)-(e.data.parentDoc?1:0);function sortFiles(e){const t=e.map(readDoc).sort(byParentDoc),n=t.reduce(((e,t)=>(e[t.slug]=t,e)),{}),r=Object.values(n).reduce(((e,t)=>(t.data.parentDocSlug&&n[t.data.parentDocSlug]&&e.push([n[t.data.parentDocSlug],n[t.slug]]),e)),[]);return toposort.array(t,r)}async function syncDocsPath(e){const{path:t}=this.args,n=[".markdown",".md"];"custompages"===this.id&&n.unshift(".html");let r;if((await fs$7.stat(t).catch((e=>{if("ENOENT"===e.code)throw new Error("Oops! We couldn't locate a file or directory at the path you provided.");throw e}))).isDirectory()){const i=readdirRecursive(t).filter((e=>n.includes(path$1.extname(e).toLowerCase())));if(this.debug(`number of files: ${i.length}`),!i.length)return Promise.reject(new Error(`The directory you provided (${t}) doesn't contain any of the following required files: ${n.join(", ")}.`));let o;try{o=sortFiles(i)}catch(e){return Promise.reject(e)}r=(await Promise.all(o.map((async t=>pushDoc.call(this,e,t))))).join("\n")}else{const i=path$1.extname(t).toLowerCase();if(!n.includes(i))return Promise.reject(new Error(`Invalid file extension (${i}). Must be one of the following: ${n.join(", ")}`));const o=readDoc(t);r=await pushDoc.call(this,e,o)}return Promise.resolve(chalk.green(r))}class DocsCommand extends BaseCommand{id="docs";static id="docs";static state="deprecated";static deprecationOptions={message:`\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`};static aliases=["guides"];static summary="Sync Markdown files to your ReadMe project as Guides.";static description="Syncs Markdown files to the Guides section of your ReadMe project. The path can either be a directory or a single Markdown file. The Markdown files will require YAML front matter with certain ReadMe documentation attributes. Check out our docs for more info on setting up your front matter: https://docs.readme.com/main/docs/rdme#markdown-file-setup";static args={path:libExports$3.Args.string({description:"Path to a local Markdown file or folder of Markdown files.",required:!0})};static flags={key:keyFlag,version:versionFlag,github:githubFlag,dryRun:libExports$3.Flags.boolean({description:"Runs the command without creating/updating any docs in ReadMe. Useful for debugging."})};static examples=[{description:"Passing in a path to a directory will also sync any Markdown files that are located in subdirectories. The path input can also be individual Markdown files:",command:"<%= config.bin %> <%= command.id %> [path] --version={project-version}"},{description:"This command also has a dry run mode, which can be useful for initial setup and debugging. You can read more about dry run mode in our docs: https://docs.readme.com/main/docs/rdme#dry-run-mode",command:"<%= config.bin %> <%= command.id %> [path] --version={project-version} --dryRun"}];async run(){const{key:e,version:t}=this.flags,n=await getProjectVersion(t,e);return this.runCreateGHAHook({result:await syncDocsPath.call(this,n),parsedOpts:{...this.args,...this.flags,version:n}})}}class ChangelogsCommand extends BaseCommand{id="changelogs";static id="changelogs";static summary="Sync Markdown files to your ReadMe project as Changelog posts.";static description="Syncs Markdown files to the Changelog section of your ReadMe project. The path can either be a directory or a single Markdown file. The Markdown files will require YAML front matter with certain ReadMe documentation attributes. Check out our docs for more info on setting up your front matter: https://docs.readme.com/main/docs/rdme#markdown-file-setup";static args={path:libExports$3.Args.string({description:"Path to a local Markdown file or folder of Markdown files.",required:!0})};static examples=DocsCommand.examples;static flags={github:githubFlag,key:keyFlag,dryRun:libExports$3.Flags.boolean({description:"Runs the command without creating/updating any changelogs in ReadMe. Useful for debugging."})};async run(){return this.runCreateGHAHook({result:await syncDocsPath.call(this)})}}class CustomPagesCommand extends BaseCommand{id="custompages";static id="custompages";static state="deprecated";static deprecationOptions={message:`\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`};static summary="Sync Markdown/HTML files to your ReadMe project as Custom Pages.";static description="Syncs Markdown files as Custom Pages in your ReadMe project. The path can either be a directory or a single Markdown file. The Markdown files will require YAML front matter with certain ReadMe documentation attributes. Check out our docs for more info on setting up your front matter: https://docs.readme.com/main/docs/rdme#markdown-file-setup";static args={path:libExports$3.Args.string({description:"Path to a local Markdown file or folder of Markdown files.",required:!0})};static examples=DocsCommand.examples;static flags={github:githubFlag,key:keyFlag,dryRun:libExports$3.Flags.boolean({description:"Runs the command without creating/updating any custom pages in ReadMe. Useful for debugging."})};async run(){return this.runCreateGHAHook({result:await syncDocsPath.call(this)})}}async function deleteDoc(e,t,n,r){return n?Promise.resolve(`🎭 dry run! This will delete \`${r}\`.`):readmeAPIv1Fetch(`/api/v1/docs/${r}`,{method:"delete",headers:cleanAPIv1Headers(e,t,new Headers({"Content-Type":"application/json"}))}).then(handleAPIv1Res).then((()=>`🗑️ successfully deleted \`${r}\`.`))}function flatten(e){const t=[];return[].concat(...e).forEach((e=>{t.push(e),e.children&&e.children.forEach((e=>{t.push(e)}))})),t.sort((e=>e.children?.length?1:-1)),t}async function getCategoryDocs(e,t,n){return readmeAPIv1Fetch(`/api/v1/categories/${n}/docs`,{method:"get",headers:cleanAPIv1Headers(e,t,new Headers({"Content-Type":"application/json"}))}).then(handleAPIv1Res)}async function getDocs(e,t){return getCategories(e,t).then((e=>e.filter((({type:e})=>"guide"===e)))).then((n=>n.map((({slug:n})=>getCategoryDocs(e,t,n))))).then((e=>Promise.all(e))).then(flatten)}function getSlug(e){const{slug:t}=readDoc(e);return t}class DocsPruneCommand extends BaseCommand{static id="docs prune";static state="deprecated";static deprecationOptions={message:`\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`};static aliases=["guides:prune"];static description="Delete any docs from ReadMe if their slugs are not found in the target folder.";static args={folder:libExports$3.Args.string({description:"A local folder containing the files you wish to prune.",required:!0})};static flags={key:keyFlag,version:versionFlag,github:githubFlag,confirm:libExports$3.Flags.boolean({description:"Bypass the confirmation prompt. Useful for CI environments."}),dryRun:libExports$3.Flags.boolean({description:"Runs the command without deleting any docs in ReadMe. Useful for debugging."})};static examples=[{description:"If you wish to delete documents from ReadMe that are no longer present in your local directory:",command:"<%= config.bin %> <%= command.id %> [path-to-directory-of-markdown]"},{description:"Run with `--confirm` to bypass the confirmation prompt (useful for CI environments):",command:"<%= config.bin %> <%= command.id %> [path-to-directory-of-markdown] --confirm"}];async run(){const{folder:e}=this.args,{dryRun:t,key:n,version:r}=this.flags,i=await getProjectVersion(r,n);this.debug(`selectedVersion: ${i}`);const o=readdirRecursive(e).filter((e=>e.toLowerCase().endsWith(".md")||e.toLowerCase().endsWith(".markdown")));this.debug(`number of files: ${o.length}`),prompts.override({confirm:this.flags.confirm});const{confirm:s}=await promptTerminal({type:"confirm",name:"confirm",message:`This command will delete all guides page from your ReadMe project (version ${i}) that are not also in ${e}, would you like to confirm?`});if(!s)return Promise.reject(new Error("Aborting, no changes were made."));const a=(await getDocs(n,i)).map((({slug:e})=>e)),c=new Set(o.map(getSlug)),l=a.filter((e=>!c.has(e))),u=await Promise.all(l.map((e=>deleteDoc(n,i,t,e))));return this.runCreateGHAHook({result:chalk.green(u.join("\n")),parsedOpts:{...this.args,...this.flags,version:i,confirm:!0}})}}var isEmail$1={exports:{}},assertString={exports:{}},hasRequiredAssertString;function requireAssertString(){return hasRequiredAssertString||(hasRequiredAssertString=1,function(e,t){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="string"==typeof e||e instanceof String;if(!t){var r=n(e);throw null===e?r="null":"object"===r&&(r=e.constructor.name),new TypeError("Expected a string but received a ".concat(r))}},e.exports=t.default,e.exports.default=t.default}(assertString,assertString.exports)),assertString.exports}var isByteLength={exports:{}},hasRequiredIsByteLength;function requireIsByteLength(){return hasRequiredIsByteLength||(hasRequiredIsByteLength=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n,o;(0,r.default)(e),"object"===i(t)?(n=t.min||0,o=t.max):(n=arguments[1],o=arguments[2]);var s=encodeURI(e).split(/%..|./).length-1;return s>=n&&(void 0===o||s<=o)};var n,r=(n=requireAssertString())&&n.__esModule?n:{default:n};function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}e.exports=t.default,e.exports.default=t.default}(isByteLength,isByteLength.exports)),isByteLength.exports}var isFQDN={exports:{}},merge$2={exports:{}},hasRequiredMerge$1,hasRequiredIsFQDN;function requireMerge$1(){return hasRequiredMerge$1||(hasRequiredMerge$1=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;for(var n in t)void 0===e[n]&&(e[n]=t[n]);return e},e.exports=t.default,e.exports.default=t.default}(merge$2,merge$2.exports)),merge$2.exports}function requireIsFQDN(){return hasRequiredIsFQDN||(hasRequiredIsFQDN=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){(0,n.default)(e),t=(0,r.default)(t,o),t.allow_trailing_dot&&"."===e[e.length-1]&&(e=e.substring(0,e.length-1));!0===t.allow_wildcard&&0===e.indexOf("*.")&&(e=e.substring(2));var i=e.split("."),s=i[i.length-1];if(t.require_tld){if(i.length<2)return!1;if(!t.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(s))return!1;if(/\s/.test(s))return!1}if(!t.allow_numeric_tld&&/^\d+$/.test(s))return!1;return i.every((function(e){return!(e.length>63&&!t.ignore_max_length)&&(!!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(e)&&(!/[\uff01-\uff5e]/.test(e)&&(!/^-|-$/.test(e)&&!(!t.allow_underscores&&/_/.test(e)))))}))};var n=i(requireAssertString()),r=i(requireMerge$1());function i(e){return e&&e.__esModule?e:{default:e}}var o={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};e.exports=t.default,e.exports.default=t.default}(isFQDN,isFQDN.exports)),isFQDN.exports}var isIP={exports:{}},hasRequiredIsIP,hasRequiredIsEmail;function requireIsIP(){return hasRequiredIsIP||(hasRequiredIsIP=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if((0,r.default)(t),n=String(n),!n)return e(t,4)||e(t,6);if("4"===n)return s.test(t);if("6"===n)return c.test(t);return!1};var n,r=(n=requireAssertString())&&n.__esModule?n:{default:n};var i="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",o="(".concat(i,"[.]){3}").concat(i),s=new RegExp("^".concat(o,"$")),a="(?:[0-9a-fA-F]{1,4})",c=new RegExp("^("+"(?:".concat(a,":){7}(?:").concat(a,"|:)|")+"(?:".concat(a,":){6}(?:").concat(o,"|:").concat(a,"|:)|")+"(?:".concat(a,":){5}(?::").concat(o,"|(:").concat(a,"){1,2}|:)|")+"(?:".concat(a,":){4}(?:(:").concat(a,"){0,1}:").concat(o,"|(:").concat(a,"){1,3}|:)|")+"(?:".concat(a,":){3}(?:(:").concat(a,"){0,2}:").concat(o,"|(:").concat(a,"){1,4}|:)|")+"(?:".concat(a,":){2}(?:(:").concat(a,"){0,3}:").concat(o,"|(:").concat(a,"){1,5}|:)|")+"(?:".concat(a,":){1}(?:(:").concat(a,"){0,4}:").concat(o,"|(:").concat(a,"){1,6}|:)|")+"(?::((?::".concat(a,"){0,5}:").concat(o,"|(?::").concat(a,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");e.exports=t.default,e.exports.default=t.default}(isIP,isIP.exports)),isIP.exports}function requireIsEmail(){return hasRequiredIsEmail||(hasRequiredIsEmail=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){if((0,n.default)(e),t=(0,s.default)(t,c),t.require_display_name||t.allow_display_name){var a=e.match(l);if(a){var h=a[1];if(e=e.replace(h,"").replace(/(^<|>$)/g,""),h.endsWith(" ")&&(h=h.slice(0,-1)),!function(e){var t=e.replace(/^"(.+)"$/,"$1");if(!t.trim())return!1;if(/[\.";<>]/.test(t)){if(t===e)return!1;if(!(t.split('"').length===t.split('\\"').length))return!1}return!0}(h))return!1}else if(t.require_display_name)return!1}if(!t.ignore_max_length&&e.length>m)return!1;var g=e.split("@"),A=g.pop(),y=A.toLowerCase();if(t.host_blacklist.includes(y))return!1;if(t.host_whitelist.length>0&&!t.host_whitelist.includes(y))return!1;var v=g.join("@");if(t.domain_specific_validation&&("gmail.com"===y||"googlemail.com"===y)){var b=(v=v.toLowerCase()).split("+")[0];if(!(0,r.default)(b.replace(/\./g,""),{min:6,max:30}))return!1;for(var C=b.split("."),E=0;E<C.length;E++)if(!d.test(C[E]))return!1}if(!(!1!==t.ignore_max_length||(0,r.default)(v,{max:64})&&(0,r.default)(A,{max:254})))return!1;if(!(0,i.default)(A,{require_tld:t.require_tld,ignore_max_length:t.ignore_max_length,allow_underscores:t.allow_underscores})){if(!t.allow_ip_domain)return!1;if(!(0,o.default)(A)){if(!A.startsWith("[")||!A.endsWith("]"))return!1;var x=A.slice(1,-1);if(0===x.length||!(0,o.default)(x))return!1}}if('"'===v[0])return v=v.slice(1,v.length-1),t.allow_utf8_local_part?_.test(v):p.test(v);for(var S=t.allow_utf8_local_part?f:u,k=v.split("."),D=0;D<k.length;D++)if(!S.test(k[D]))return!1;if(t.blacklisted_chars&&-1!==v.search(new RegExp("[".concat(t.blacklisted_chars,"]+"),"g")))return!1;return!0};var n=a(requireAssertString()),r=a(requireIsByteLength()),i=a(requireIsFQDN()),o=a(requireIsIP()),s=a(requireMerge$1());function a(e){return e&&e.__esModule?e:{default:e}}var c={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},l=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,u=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,d=/^[a-z\d]+$/,p=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,f=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,_=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,m=254;e.exports=t.default,e.exports.default=t.default}(isEmail$1,isEmail$1.exports)),isEmail$1.exports}var isEmailExports=requireIsEmail(),isEmail=getDefaultExportFromCjs(isEmailExports);function getCurrentConfig(){let e=(...e)=>{};this?.debug&&"function"==typeof this.debug&&(e=this.debug);return{apiKey:(()=>{switch(!0){case!!process.env.RDME_API_KEY:return e("using RDME_API_KEY env var for api key"),process.env.RDME_API_KEY;case!!process.env.README_API_KEY:return e("using README_API_KEY env var for api key"),process.env.README_API_KEY;default:return e("falling back to configstore value for api key"),configstore.get("apiKey")}})(),email:1==!!process.env.RDME_EMAIL?(e("using RDME_EMAIL env var for email"),process.env.RDME_EMAIL):(e("falling back to configstore value for email"),configstore.get("email")),project:1==!!process.env.RDME_PROJECT?(e("using RDME_PROJECT env var for project"),process.env.RDME_PROJECT):(e("falling back to configstore value for project"),configstore.get("project"))}}function loginFetch(e){return readmeAPIv1Fetch("/api/v1/login",{method:"post",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(e)})}async function loginFlow(e){const t=getCurrentConfig(),{email:n,password:r,project:i}=await promptTerminal([{type:"text",name:"email",message:"What is your email address?",initial:t.email,validate:e=>!!isEmail.default(e)||"Please provide a valid email address."},{type:"invisible",name:"password",message:"What is your password?"},{type:"text",name:"project",message:"What project subdomain are you logging into?",initial:t.project,validate:validateSubdomain}]);if(!i)return Promise.reject(new Error("No project subdomain provided. Please use `--project`."));if(!isEmail.default(n))return Promise.reject(new Error("You must provide a valid email address."));const o={email:n,password:r,project:i};return e&&(o.token=e),loginFetch(o).then(handleAPIv1Res).catch((async e=>{if("LOGIN_TWOFACTOR"===e.code){debug("2FA error response, prompting for 2FA code");const e=await promptTerminal({type:"text",name:"otp",message:"What is your 2FA token?"});return loginFetch({email:n,password:r,project:i,token:e.otp}).then(handleAPIv1Res)}throw e})).then((e=>(configstore.set("apiKey",e.apiKey),configstore.set("email",n),configstore.set("project",i),`Successfully logged in as ${chalk.green(n)} to the ${chalk.blue(i)} project.`)))}class LoginCommand extends BaseCommand{static description="Login to a ReadMe project.";static flags={email:libExports$3.Flags.string({description:"Your email address"}),password:libExports$3.Flags.string({description:"Your password"}),otp:libExports$3.Flags.string({description:"Your one-time password (if you have two-factor authentication enabled)"}),project:libExports$3.Flags.string({description:"The subdomain of the project you wish to log into"})};async run(){return prompts.override(this.flags),loginFlow(this.flags.otp)}}class LogoutCommand extends BaseCommand{static description="Logs the currently authenticated user out of ReadMe.";async run(){return configstore.has("email")&&configstore.has("project")&&configstore.clear(),Promise.resolve(`You have logged out of ReadMe. Please use \`${this.config.bin} login\` to login again.`)}}let isDockerCached,cachedResult;function hasDockerEnv(){try{return fs$6.statSync("/.dockerenv"),!0}catch{return!1}}function hasDockerCGroup(){try{return fs$6.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function isDocker(){return void 0===isDockerCached&&(isDockerCached=hasDockerEnv()||hasDockerCGroup()),isDockerCached}const hasContainerEnv=()=>{try{return fs$6.statSync("/run/.containerenv"),!0}catch{return!1}};function isInsideContainer(){return void 0===cachedResult&&(cachedResult=hasContainerEnv()||isDocker()),cachedResult}const isWsl=()=>{if("linux"!==process$2.platform)return!1;if(os$1.release().toLowerCase().includes("microsoft"))return!isInsideContainer();try{return!!fs$6.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")&&!isInsideContainer()}catch{return!1}};var isWsl$1=process$2.env.__IS_WSL_TEST__?isWsl:isWsl();function defineLazyProperty(e,t,n){const r=n=>Object.defineProperty(e,t,{value:n,enumerable:!0,writable:!0});return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=n();return r(e),e},set(e){r(e)}}),e}const execFileAsync$3=promisify(execFile);async function defaultBrowserId(){if("darwin"!==process$2.platform)throw new Error("macOS only");const{stdout:e}=await execFileAsync$3("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),t=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(e);return t?.groups.id??"com.apple.Safari"}const execFileAsync$2=promisify(execFile);async function runAppleScript(e,{humanReadableOutput:t=!0}={}){if("darwin"!==process$2.platform)throw new Error("macOS only");const n=t?[]:["-ss"],{stdout:r}=await execFileAsync$2("osascript",["-e",e,n]);return r.trim()}async function bundleName(e){return runAppleScript(`tell application "Finder" to set app_path to application file id "${e}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}const execFileAsync$1=promisify(execFile),windowsBrowserProgIds={AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},MSEdgeDHTML:{name:"Edge",id:"com.microsoft.edge"},MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"}};class UnknownBrowserError extends Error{}async function defaultBrowser$1(e=execFileAsync$1){const{stdout:t}=await e("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),n=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(t);if(!n)throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(t)}`);const{id:r}=n.groups,i=windowsBrowserProgIds[r];if(!i)throw new UnknownBrowserError(`Unknown browser ID: ${r}`);return i}const execFileAsync=promisify(execFile),titleize=e=>e.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(e=>e.toUpperCase()));async function defaultBrowser(){if("darwin"===process$2.platform){const e=await defaultBrowserId();return{name:await bundleName(e),id:e}}if("linux"===process$2.platform){const{stdout:e}=await execFileAsync("xdg-mime",["query","default","x-scheme-handler/http"]),t=e.trim();return{name:titleize(t.replace(/.desktop$/,"").replace("-"," ")),id:t}}if("win32"===process$2.platform)return defaultBrowser$1();throw new Error("Only macOS, Linux, and Windows are supported")}const __dirname$1=path$1.dirname(fileURLToPath(import.meta.url)),localXdgOpenPath=path$1.join(__dirname$1,"xdg-open"),{platform:platform,arch:arch}=process$2,getWslDrivesMountPoint=(()=>{const e="/mnt/";let t;return async function(){if(t)return t;const n="/etc/wsl.conf";let r=!1;try{await fs$7.access(n,constants$9.F_OK),r=!0}catch{}if(!r)return e;const i=await fs$7.readFile(n,{encoding:"utf8"}),o=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(i);return o?(t=o.groups.mountPoint.trim(),t=t.endsWith("/")?t:`${t}/`,t):e}})(),pTryEach=async(e,t)=>{let n;for(const r of e)try{return await t(r)}catch(e){n=e}throw n},baseOpen=async e=>{if(e={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...e},Array.isArray(e.app))return pTryEach(e.app,(t=>baseOpen({...e,app:t})));let t,{name:n,arguments:r=[]}=e.app??{};if(r=[...r],Array.isArray(n))return pTryEach(n,(t=>baseOpen({...e,app:{name:t,arguments:r}})));if("browser"===n||"browserPrivate"===n){const t={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","microsoft-edge.desktop":"edge"},i={chrome:"--incognito",firefox:"--private-window",edge:"--inPrivate"},o=await defaultBrowser();if(o.id in t){const s=t[o.id];return"browserPrivate"===n&&r.push(i[s]),baseOpen({...e,app:{name:apps[s],arguments:r}})}throw new Error(`${o.name} is not supported as a default browser`)}const i=[],o={};if("darwin"===platform)t="open",e.wait&&i.push("--wait-apps"),e.background&&i.push("--background"),e.newInstance&&i.push("--new"),n&&i.push("-a",n);else if("win32"===platform||isWsl$1&&!isInsideContainer()&&!n){const s=await getWslDrivesMountPoint();t=isWsl$1?`${s}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`:`${process$2.env.SYSTEMROOT||process$2.env.windir||"C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`,i.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),isWsl$1||(o.windowsVerbatimArguments=!0);const a=["Start"];e.wait&&a.push("-Wait"),n?(a.push(`"\`"${n}\`""`),e.target&&r.push(e.target)):e.target&&a.push(`"${e.target}"`),r.length>0&&(r=r.map((e=>`"\`"${e}\`""`)),a.push("-ArgumentList",r.join(","))),e.target=Buffer$1.from(a.join(" "),"utf16le").toString("base64")}else{if(n)t=n;else{const e=!__dirname$1||"/"===__dirname$1;let n=!1;try{await fs$7.access(localXdgOpenPath,constants$9.X_OK),n=!0}catch{}t=process$2.versions.electron??("android"===platform||e||!n)?"xdg-open":localXdgOpenPath}r.length>0&&i.push(...r),e.wait||(o.stdio="ignore",o.detached=!0)}"darwin"===platform&&r.length>0&&i.push("--args",...r),e.target&&i.push(e.target);const s=childProcess.spawn(t,i,o);return e.wait?new Promise(((t,n)=>{s.once("error",n),s.once("close",(r=>{!e.allowNonzeroExitCode&&r>0?n(new Error(`Exited with code ${r}`)):t(s)}))})):(s.unref(),s)},open=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a `target`");return baseOpen({...t,target:e})};function detectArchBinary(e){if("string"==typeof e||Array.isArray(e))return e;const{[arch]:t}=e;if(!t)throw new Error(`${arch} is not supported`);return t}function detectPlatformBinary({[platform]:e},{wsl:t}){if(t&&isWsl$1)return detectArchBinary(t);if(!e)throw new Error(`${platform} is not supported`);return detectArchBinary(e)}const apps={};defineLazyProperty(apps,"chrome",(()=>detectPlatformBinary({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}))),defineLazyProperty(apps,"firefox",(()=>detectPlatformBinary({darwin:"firefox",win32:"C:\\Program Files\\Mozilla Firefox\\firefox.exe",linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}))),defineLazyProperty(apps,"edge",(()=>detectPlatformBinary({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}))),defineLazyProperty(apps,"browser",(()=>"browser")),defineLazyProperty(apps,"browserPrivate",(()=>"browserPrivate"));class OpenCommand extends BaseCommand{static description="Open your current ReadMe project in the browser.";static flags={dash:libExports$3.Flags.boolean({description:"Opens your current ReadMe project dashboard."}),mock:libExports$3.Flags.boolean({description:"[hidden] used for mocking.",hidden:!0})};static hidden=!0;static id="open";static state="deprecated";static deprecationOptions={message:`\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`};async run(){const{dash:e,mock:t}=this.flags,{apiKey:n,project:r}=getCurrentConfig();if(this.debug(`project: ${r}`),!r)return Promise.reject(new Error(`Please login using \`${this.config.bin} login\`.`));let i;if(e){if(!n)return Promise.reject(new Error(`Please login using \`${this.config.bin} login\`.`));const e=await getProjectVersion(void 0,n,!0);i=`${config.host}/project/${r}/v${e}/overview`}else{i=config.hub.replace("{project}",r)}const o=`Opening ${chalk.green(i)} in your browser...`;return t?Promise.resolve(o):open(i,{wait:!1}).then((()=>Promise.resolve(o)))}} /*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function isNothing(e){return null==e}function isObject$3(e){return"object"==typeof e&&null!==e}function toArray$1(e){return Array.isArray(e)?e:isNothing(e)?[]:[e]}function extend(e,t){var n,r,i,o;if(t)for(n=0,r=(o=Object.keys(t)).length;n<r;n+=1)e[i=o[n]]=t[i];return e}function repeat$1(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r}function isNegativeZero(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e}var isNothing_1=isNothing,isObject_1$1=isObject$3,toArray_1=toArray$1,repeat_1=repeat$1,isNegativeZero_1=isNegativeZero,extend_1=extend,common$2={isNothing:isNothing_1,isObject:isObject_1$1,toArray:toArray_1,repeat:repeat_1,isNegativeZero:isNegativeZero_1,extend:extend_1};function formatError(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),r+" "+n):r}function YAMLException$1(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=formatError(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}YAMLException$1.prototype=Object.create(Error.prototype),YAMLException$1.prototype.constructor=YAMLException$1,YAMLException$1.prototype.toString=function(e){return this.name+": "+formatError(this,e)};var exception$1=YAMLException$1;function getLine(e,t,n,r,i){var o="",s="",a=Math.floor(i/2)-1;return r-t>a&&(t=r-a+(o=" ... ").length),n-r>a&&(n=r+a-(s=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+s,pos:r-t+o.length}}function padStart(e,t){return common$2.repeat(" ",t-e.length)+e}function makeSnippet(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),"number"!=typeof t.indent&&(t.indent=1),"number"!=typeof t.linesBefore&&(t.linesBefore=3),"number"!=typeof t.linesAfter&&(t.linesAfter=2);for(var n,r=/\r?\n|\r|\0/g,i=[0],o=[],s=-1;n=r.exec(e.buffer);)o.push(n.index),i.push(n.index+n[0].length),e.position<=n.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);var a,c,l="",u=Math.min(e.line+t.linesAfter,o.length).toString().length,d=t.maxLength-(t.indent+u+3);for(a=1;a<=t.linesBefore&&!(s-a<0);a++)c=getLine(e.buffer,i[s-a],o[s-a],e.position-(i[s]-i[s-a]),d),l=common$2.repeat(" ",t.indent)+padStart((e.line-a+1).toString(),u)+" | "+c.str+"\n"+l;for(c=getLine(e.buffer,i[s],o[s],e.position,d),l+=common$2.repeat(" ",t.indent)+padStart((e.line+1).toString(),u)+" | "+c.str+"\n",l+=common$2.repeat("-",t.indent+u+3+c.pos)+"^\n",a=1;a<=t.linesAfter&&!(s+a>=o.length);a++)c=getLine(e.buffer,i[s+a],o[s+a],e.position-(i[s]-i[s+a]),d),l+=common$2.repeat(" ",t.indent)+padStart((e.line+a+1).toString(),u)+" | "+c.str+"\n";return l.replace(/\n$/,"")}var snippet$1=makeSnippet,TYPE_CONSTRUCTOR_OPTIONS=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],YAML_NODE_KINDS=["scalar","sequence","mapping"];function compileStyleAliases(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}function Type$1(e,t){if(t=t||{},Object.keys(t).forEach((function(t){if(-1===TYPE_CONSTRUCTOR_OPTIONS.indexOf(t))throw new exception$1('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')})),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=compileStyleAliases(t.styleAliases||null),-1===YAML_NODE_KINDS.indexOf(this.kind))throw new exception$1('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var type$b=Type$1;function compileList(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)})),n[t]=e})),n}function compileMap(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}function Schema$1(e){return this.extend(e)}Schema$1.prototype.extend=function(e){var t=[],n=[];if(e instanceof type$b)n.push(e);else if(Array.isArray(e))n=n.concat(e);else{if(!e||!Array.isArray(e.implicit)&&!Array.isArray(e.explicit))throw new exception$1("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit))}t.forEach((function(e){if(!(e instanceof type$b))throw new exception$1("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(e.loadKind&&"scalar"!==e.loadKind)throw new exception$1("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(e.multi)throw new exception$1("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),n.forEach((function(e){if(!(e instanceof type$b))throw new exception$1("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var r=Object.create(Schema$1.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=compileList(r,"implicit"),r.compiledExplicit=compileList(r,"explicit"),r.compiledTypeMap=compileMap(r.compiledImplicit,r.compiledExplicit),r};var schema$2=Schema$1,str$1=new type$b("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}}),seq$1=new type$b("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}}),map$2=new type$b("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}}),failsafe$1=new schema$2({explicit:[str$1,seq$1,map$2]});function resolveYamlNull(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)}function constructYamlNull(){return null}function isNull(e){return null===e}var _null$1=new type$b("tag:yaml.org,2002:null",{kind:"scalar",resolve:resolveYamlNull,construct:constructYamlNull,predicate:isNull,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function resolveYamlBoolean(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)}function constructYamlBoolean(e){return"true"===e||"True"===e||"TRUE"===e}function isBoolean(e){return"[object Boolean]"===Object.prototype.toString.call(e)}var bool$1=new type$b("tag:yaml.org,2002:bool",{kind:"scalar",resolve:resolveYamlBoolean,construct:constructYamlBoolean,predicate:isBoolean,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function isHexCode(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function isOctCode(e){return 48<=e&&e<=55}function isDecCode(e){return 48<=e&&e<=57}function resolveYamlInteger(e){if(null===e)return!1;var t,n=e.length,r=0,i=!1;if(!n)return!1;if("-"!==(t=e[r])&&"+"!==t||(t=e[++r]),"0"===t){if(r+1===n)return!0;if("b"===(t=e[++r])){for(r++;r<n;r++)if("_"!==(t=e[r])){if("0"!==t&&"1"!==t)return!1;i=!0}return i&&"_"!==t}if("x"===t){for(r++;r<n;r++)if("_"!==(t=e[r])){if(!isHexCode(e.charCodeAt(r)))return!1;i=!0}return i&&"_"!==t}if("o"===t){for(r++;r<n;r++)if("_"!==(t=e[r])){if(!isOctCode(e.charCodeAt(r)))return!1;i=!0}return i&&"_"!==t}}if("_"===t)return!1;for(;r<n;r++)if("_"!==(t=e[r])){if(!isDecCode(e.charCodeAt(r)))return!1;i=!0}return!(!i||"_"===t)}function constructYamlInteger(e){var t,n=e,r=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(r=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return r*parseInt(n.slice(2),2);if("x"===n[1])return r*parseInt(n.slice(2),16);if("o"===n[1])return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)}function isInteger(e){return"[object Number]"===Object.prototype.toString.call(e)&&e%1==0&&!common$2.isNegativeZero(e)}var int$1=new type$b("tag:yaml.org,2002:int",{kind:"scalar",resolve:resolveYamlInteger,construct:constructYamlInteger,predicate:isInteger,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),YAML_FLOAT_PATTERN=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function resolveYamlFloat(e){return null!==e&&!(!YAML_FLOAT_PATTERN.test(e)||"_"===e[e.length-1])}function constructYamlFloat(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)}var SCIENTIFIC_WITHOUT_DOT=/^[-+]?[0-9]+e/;function representYamlFloat(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(common$2.isNegativeZero(e))return"-0.0";return n=e.toString(10),SCIENTIFIC_WITHOUT_DOT.test(n)?n.replace("e",".e"):n}function isFloat(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||common$2.isNegativeZero(e))}var float$1=new type$b("tag:yaml.org,2002:float",{kind:"scalar",resolve:resolveYamlFloat,construct:constructYamlFloat,predicate:isFloat,represent:representYamlFloat,defaultStyle:"lowercase"}),json$3=failsafe$1.extend({implicit:[_null$1,bool$1,int$1,float$1]}),core$4=json$3,YAML_DATE_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),YAML_TIMESTAMP_REGEXP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function resolveYamlTimestamp(e){return null!==e&&(null!==YAML_DATE_REGEXP.exec(e)||null!==YAML_TIMESTAMP_REGEXP.exec(e))}function constructYamlTimestamp(e){var t,n,r,i,o,s,a,c,l=0,u=null;if(null===(t=YAML_DATE_REGEXP.exec(e))&&(t=YAML_TIMESTAMP_REGEXP.exec(e)),null===t)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],s=+t[5],a=+t[6],t[7]){for(l=t[7].slice(0,3);l.length<3;)l+="0";l=+l}return t[9]&&(u=6e4*(60*+t[10]+ +(t[11]||0)),"-"===t[9]&&(u=-u)),c=new Date(Date.UTC(n,r,i,o,s,a,l)),u&&c.setTime(c.getTime()-u),c}function representYamlTimestamp(e){return e.toISOString()}var timestamp$1=new type$b("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:resolveYamlTimestamp,construct:constructYamlTimestamp,instanceOf:Date,represent:representYamlTimestamp});function resolveYamlMerge(e){return"<<"===e||null===e}var merge$1=new type$b("tag:yaml.org,2002:merge",{kind:"scalar",resolve:resolveYamlMerge}),BASE64_MAP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";function resolveYamlBinary(e){if(null===e)return!1;var t,n,r=0,i=e.length,o=BASE64_MAP;for(n=0;n<i;n++)if(!((t=o.indexOf(e.charAt(n)))>64)){if(t<0)return!1;r+=6}return r%8==0}function constructYamlBinary(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=BASE64_MAP,s=0,a=[];for(t=0;t<i;t++)t%4==0&&t&&(a.push(s>>16&255),a.push(s>>8&255),a.push(255&s)),s=s<<6|o.indexOf(r.charAt(t));return 0===(n=i%4*6)?(a.push(s>>16&255),a.push(s>>8&255),a.push(255&s)):18===n?(a.push(s>>10&255),a.push(s>>2&255)):12===n&&a.push(s>>4&255),new Uint8Array(a)}function representYamlBinary(e){var t,n,r="",i=0,o=e.length,s=BASE64_MAP;for(t=0;t<o;t++)t%3==0&&t&&(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]),i=(i<<8)+e[t];return 0===(n=o%3)?(r+=s[i>>18&63],r+=s[i>>12&63],r+=s[i>>6&63],r+=s[63&i]):2===n?(r+=s[i>>10&63],r+=s[i>>4&63],r+=s[i<<2&63],r+=s[64]):1===n&&(r+=s[i>>2&63],r+=s[i<<4&63],r+=s[64],r+=s[64]),r}function isBinary(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)}var binary$2=new type$b("tag:yaml.org,2002:binary",{kind:"scalar",resolve:resolveYamlBinary,construct:constructYamlBinary,predicate:isBinary,represent:representYamlBinary}),_hasOwnProperty$3=Object.prototype.hasOwnProperty,_toString$2=Object.prototype.toString;function resolveYamlOmap(e){if(null===e)return!0;var t,n,r,i,o,s=[],a=e;for(t=0,n=a.length;t<n;t+=1){if(r=a[t],o=!1,"[object Object]"!==_toString$2.call(r))return!1;for(i in r)if(_hasOwnProperty$3.call(r,i)){if(o)return!1;o=!0}if(!o)return!1;if(-1!==s.indexOf(i))return!1;s.push(i)}return!0}function constructYamlOmap(e){return null!==e?e:[]}var omap$1=new type$b("tag:yaml.org,2002:omap",{kind:"sequence",resolve:resolveYamlOmap,construct:constructYamlOmap}),_toString$1=Object.prototype.toString;function resolveYamlPairs(e){if(null===e)return!0;var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1){if(r=s[t],"[object Object]"!==_toString$1.call(r))return!1;if(1!==(i=Object.keys(r)).length)return!1;o[t]=[i[0],r[i[0]]]}return!0}function constructYamlPairs(e){if(null===e)return[];var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)r=s[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}var pairs$1=new type$b("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:resolveYamlPairs,construct:constructYamlPairs}),_hasOwnProperty$2=Object.prototype.hasOwnProperty;function resolveYamlSet(e){if(null===e)return!0;var t,n=e;for(t in n)if(_hasOwnProperty$2.call(n,t)&&null!==n[t])return!1;return!0}function constructYamlSet(e){return null!==e?e:{}}var set$1=new type$b("tag:yaml.org,2002:set",{kind:"mapping",resolve:resolveYamlSet,construct:constructYamlSet}),_default$2=core$4.extend({implicit:[timestamp$1,merge$1],explicit:[binary$2,omap$1,pairs$1,set$1]}),_hasOwnProperty$1=Object.prototype.hasOwnProperty,CONTEXT_FLOW_IN=1,CONTEXT_FLOW_OUT=2,CONTEXT_BLOCK_IN=3,CONTEXT_BLOCK_OUT=4,CHOMPING_CLIP=1,CHOMPING_STRIP=2,CHOMPING_KEEP=3,PATTERN_NON_PRINTABLE=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,PATTERN_NON_ASCII_LINE_BREAKS=/[\x85\u2028\u2029]/,PATTERN_FLOW_INDICATORS=/[,\[\]\{\}]/,PATTERN_TAG_HANDLE=/^(?:!|!!|![a-z\-]+!)$/i,PATTERN_TAG_URI=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _class(e){return Object.prototype.toString.call(e)}function is_EOL(e){return 10===e||13===e}function is_WHITE_SPACE(e){return 9===e||32===e}function is_WS_OR_EOL(e){return 9===e||32===e||10===e||13===e}function is_FLOW_INDICATOR(e){return 44===e||91===e||93===e||123===e||125===e}function fromHexCode(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function escapedHexLen(e){return 120===e?2:117===e?4:85===e?8:0}function fromDecimalCode(e){return 48<=e&&e<=57?e-48:-1}function simpleEscapeSequence(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function charFromCodepoint(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var simpleEscapeCheck=new Array(256),simpleEscapeMap=new Array(256),i=0;i<256;i++)simpleEscapeCheck[i]=simpleEscapeSequence(i)?1:0,simpleEscapeMap[i]=simpleEscapeSequence(i);function State$1(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||_default$2,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function generateError(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=snippet$1(n),new exception$1(t,n)}function throwError(e,t){throw generateError(e,t)}function throwWarning(e,t){e.onWarning&&e.onWarning.call(null,generateError(e,t))}var directiveHandlers={YAML:function(e,t,n){var r,i,o;null!==e.version&&throwError(e,"duplication of %YAML directive"),1!==n.length&&throwError(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&throwError(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&throwError(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&throwWarning(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,i;2!==n.length&&throwError(e,"TAG directive accepts exactly two arguments"),r=n[0],i=n[1],PATTERN_TAG_HANDLE.test(r)||throwError(e,"ill-formed tag handle (first argument) of the TAG directive"),_hasOwnProperty$1.call(e.tagMap,r)&&throwError(e,'there is a previously declared suffix for "'+r+'" tag handle'),PATTERN_TAG_URI.test(i)||throwError(e,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(t){throwError(e,"tag prefix is malformed: "+i)}e.tagMap[r]=i}};function captureSegment(e,t,n,r){var i,o,s,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,o=a.length;i<o;i+=1)9===(s=a.charCodeAt(i))||32<=s&&s<=1114111||throwError(e,"expected valid JSON character");else PATTERN_NON_PRINTABLE.test(a)&&throwError(e,"the stream contains non-printable characters");e.result+=a}}function mergeMappings(e,t,n,r){var i,o,s,a;for(common$2.isObject(n)||throwError(e,"cannot merge mappings; the provided source object is unacceptable"),s=0,a=(i=Object.keys(n)).length;s<a;s+=1)o=i[s],_hasOwnProperty$1.call(t,o)||(t[o]=n[o],r[o]=!0)}function storeMappingPair(e,t,n,r,i,o,s,a,c){var l,u;if(Array.isArray(i))for(l=0,u=(i=Array.prototype.slice.call(i)).length;l<u;l+=1)Array.isArray(i[l])&&throwError(e,"nested arrays are not supported inside keys"),"object"==typeof i&&"[object Object]"===_class(i[l])&&(i[l]="[object Object]");if("object"==typeof i&&"[object Object]"===_class(i)&&(i="[object Object]"),i=String(i),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(o))for(l=0,u=o.length;l<u;l+=1)mergeMappings(e,t,o[l],n);else mergeMappings(e,t,o,n);else e.json||_hasOwnProperty$1.call(n,i)||!_hasOwnProperty$1.call(t,i)||(e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,throwError(e,"duplicated mapping key")),"__proto__"===i?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:o}):t[i]=o,delete n[i];return t}function readLineBreak(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):throwError(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function skipSeparationSpace(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);0!==i;){for(;is_WHITE_SPACE(i);)9===i&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!is_EOL(i))break;for(readLineBreak(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&throwWarning(e,"deficient indentation"),r}function testDocumentSeparator(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!is_WS_OR_EOL(t)))}function writeFoldedLines(e,t){1===t?e.result+=" ":t>1&&(e.result+=common$2.repeat("\n",t-1))}function readPlainScalar(e,t,n){var r,i,o,s,a,c,l,u,d=e.kind,p=e.result;if(is_WS_OR_EOL(u=e.input.charCodeAt(e.position))||is_FLOW_INDICATOR(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(is_WS_OR_EOL(r=e.input.charCodeAt(e.position+1))||n&&is_FLOW_INDICATOR(r)))return!1;for(e.kind="scalar",e.result="",i=o=e.position,s=!1;0!==u;){if(58===u){if(is_WS_OR_EOL(r=e.input.charCodeAt(e.position+1))||n&&is_FLOW_INDICATOR(r))break}else if(35===u){if(is_WS_OR_EOL(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&testDocumentSeparator(e)||n&&is_FLOW_INDICATOR(u))break;if(is_EOL(u)){if(a=e.line,c=e.lineStart,l=e.lineIndent,skipSeparationSpace(e,!1,-1),e.lineIndent>=t){s=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=a,e.lineStart=c,e.lineIndent=l;break}}s&&(captureSegment(e,i,o,!1),writeFoldedLines(e,e.line-a),i=o=e.position,s=!1),is_WHITE_SPACE(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return captureSegment(e,i,o,!1),!!e.result||(e.kind=d,e.result=p,!1)}function readSingleQuotedScalar(e,t){var n,r,i;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(captureSegment(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,i=e.position}else is_EOL(n)?(captureSegment(e,r,i,!0),writeFoldedLines(e,skipSeparationSpace(e,!1,t)),r=i=e.position):e.position===e.lineStart&&testDocumentSeparator(e)?throwError(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);throwError(e,"unexpected end of the stream within a single quoted scalar")}function readDoubleQuotedScalar(e,t){var n,r,i,o,s,a;if(34!==(a=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(a=e.input.charCodeAt(e.position));){if(34===a)return captureSegment(e,n,e.position,!0),e.position++,!0;if(92===a){if(captureSegment(e,n,e.position,!0),is_EOL(a=e.input.charCodeAt(++e.position)))skipSeparationSpace(e,!1,t);else if(a<256&&simpleEscapeCheck[a])e.result+=simpleEscapeMap[a],e.position++;else if((s=escapedHexLen(a))>0){for(i=s,o=0;i>0;i--)(s=fromHexCode(a=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+s:throwError(e,"expected hexadecimal character");e.result+=charFromCodepoint(o),e.position++}else throwError(e,"unknown escape sequence");n=r=e.position}else is_EOL(a)?(captureSegment(e,n,r,!0),writeFoldedLines(e,skipSeparationSpace(e,!1,t)),n=r=e.position):e.position===e.lineStart&&testDocumentSeparator(e)?throwError(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}throwError(e,"unexpected end of the stream within a double quoted scalar")}function readFlowCollection(e,t){var n,r,i,o,s,a,c,l,u,d,p,f,_=!0,m=e.tag,h=e.anchor,g=Object.create(null);if(91===(f=e.input.charCodeAt(e.position)))s=93,l=!1,o=[];else{if(123!==f)return!1;s=125,l=!0,o={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),f=e.input.charCodeAt(++e.position);0!==f;){if(skipSeparationSpace(e,!0,t),(f=e.input.charCodeAt(e.position))===s)return e.position++,e.tag=m,e.anchor=h,e.kind=l?"mapping":"sequence",e.result=o,!0;_?44===f&&throwError(e,"expected the node content, but found ','"):throwError(e,"missed comma between flow collection entries"),p=null,a=c=!1,63===f&&is_WS_OR_EOL(e.input.charCodeAt(e.position+1))&&(a=c=!0,e.position++,skipSeparationSpace(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,composeNode(e,t,CONTEXT_FLOW_IN,!1,!0),d=e.tag,u=e.result,skipSeparationSpace(e,!0,t),f=e.input.charCodeAt(e.position),!c&&e.line!==n||58!==f||(a=!0,f=e.input.charCodeAt(++e.position),skipSeparationSpace(e,!0,t),composeNode(e,t,CONTEXT_FLOW_IN,!1,!0),p=e.result),l?storeMappingPair(e,o,g,d,u,p,n,r,i):a?o.push(storeMappingPair(e,null,g,d,u,p,n,r,i)):o.push(u),skipSeparationSpace(e,!0,t),44===(f=e.input.charCodeAt(e.position))?(_=!0,f=e.input.charCodeAt(++e.position)):_=!1}throwError(e,"unexpected end of the stream within a flow collection")}function readBlockScalar(e,t){var n,r,i,o,s=CHOMPING_CLIP,a=!1,c=!1,l=t,u=0,d=!1;if(124===(o=e.input.charCodeAt(e.position)))r=!1;else{if(62!==o)return!1;r=!0}for(e.kind="scalar",e.result="";0!==o;)if(43===(o=e.input.charCodeAt(++e.position))||45===o)CHOMPING_CLIP===s?s=43===o?CHOMPING_KEEP:CHOMPING_STRIP:throwError(e,"repeat of a chomping mode identifier");else{if(!((i=fromDecimalCode(o))>=0))break;0===i?throwError(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):c?throwError(e,"repeat of an indentation width identifier"):(l=t+i-1,c=!0)}if(is_WHITE_SPACE(o)){do{o=e.input.charCodeAt(++e.position)}while(is_WHITE_SPACE(o));if(35===o)do{o=e.input.charCodeAt(++e.position)}while(!is_EOL(o)&&0!==o)}for(;0!==o;){for(readLineBreak(e),e.lineIndent=0,o=e.input.charCodeAt(e.position);(!c||e.lineIndent<l)&&32===o;)e.lineIndent++,o=e.input.charCodeAt(++e.position);if(!c&&e.lineIndent>l&&(l=e.lineIndent),is_EOL(o))u++;else{if(e.lineIndent<l){s===CHOMPING_KEEP?e.result+=common$2.repeat("\n",a?1+u:u):s===CHOMPING_CLIP&&a&&(e.result+="\n");break}for(r?is_WHITE_SPACE(o)?(d=!0,e.result+=common$2.repeat("\n",a?1+u:u)):d?(d=!1,e.result+=common$2.repeat("\n",u+1)):0===u?a&&(e.result+=" "):e.result+=common$2.repeat("\n",u):e.result+=common$2.repeat("\n",a?1+u:u),a=!0,c=!0,u=0,n=e.position;!is_EOL(o)&&0!==o;)o=e.input.charCodeAt(++e.position);captureSegment(e,n,e.position,!1)}}return!0}function readBlockSequence(e,t){var n,r,i=e.tag,o=e.anchor,s=[],a=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=s),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,throwError(e,"tab characters must not be used in indentation")),45===r)&&is_WS_OR_EOL(e.input.charCodeAt(e.position+1));)if(a=!0,e.position++,skipSeparationSpace(e,!0,-1)&&e.lineIndent<=t)s.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,composeNode(e,t,CONTEXT_BLOCK_IN,!1,!0),s.push(e.result),skipSeparationSpace(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)throwError(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!a&&(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0)}function readBlockMapping(e,t,n){var r,i,o,s,a,c,l,u=e.tag,d=e.anchor,p={},f=Object.create(null),_=null,m=null,h=null,g=!1,A=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=p),l=e.input.charCodeAt(e.position);0!==l;){if(g||-1===e.firstTabInLine||(e.position=e.firstTabInLine,throwError(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,63!==l&&58!==l||!is_WS_OR_EOL(r)){if(s=e.line,a=e.lineStart,c=e.position,!composeNode(e,n,CONTEXT_FLOW_OUT,!1,!0))break;if(e.line===o){for(l=e.input.charCodeAt(e.position);is_WHITE_SPACE(l);)l=e.input.charCodeAt(++e.position);if(58===l)is_WS_OR_EOL(l=e.input.charCodeAt(++e.position))||throwError(e,"a whitespace character is expected after the key-value separator within a block mapping"),g&&(storeMappingPair(e,p,f,_,m,null,s,a,c),_=m=h=null),A=!0,g=!1,i=!1,_=e.tag,m=e.result;else{if(!A)return e.tag=u,e.anchor=d,!0;throwError(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!A)return e.tag=u,e.anchor=d,!0;throwError(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(g&&(storeMappingPair(e,p,f,_,m,null,s,a,c),_=m=h=null),A=!0,g=!0,i=!0):g?(g=!1,i=!0):throwError(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,l=r;if((e.line===o||e.lineIndent>t)&&(g&&(s=e.line,a=e.lineStart,c=e.position),composeNode(e,t,CONTEXT_BLOCK_OUT,!0,i)&&(g?m=e.result:h=e.result),g||(storeMappingPair(e,p,f,_,m,h,s,a,c),_=m=h=null),skipSeparationSpace(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==l)throwError(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return g&&storeMappingPair(e,p,f,_,m,null,s,a,c),A&&(e.tag=u,e.anchor=d,e.kind="mapping",e.result=p),A}function readTagProperty(e){var t,n,r,i,o=!1,s=!1;if(33!==(i=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&throwError(e,"duplication of a tag property"),60===(i=e.input.charCodeAt(++e.position))?(o=!0,i=e.input.charCodeAt(++e.position)):33===i?(s=!0,n="!!",i=e.input.charCodeAt(++e.position)):n="!",t=e.position,o){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&62!==i);e.position<e.length?(r=e.input.slice(t,e.position),i=e.input.charCodeAt(++e.position)):throwError(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==i&&!is_WS_OR_EOL(i);)33===i&&(s?throwError(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),PATTERN_TAG_HANDLE.test(n)||throwError(e,"named tag handle cannot contain such characters"),s=!0,t=e.position+1)),i=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),PATTERN_FLOW_INDICATORS.test(r)&&throwError(e,"tag suffix cannot contain flow indicator characters")}r&&!PATTERN_TAG_URI.test(r)&&throwError(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(t){throwError(e,"tag name is malformed: "+r)}return o?e.tag=r:_hasOwnProperty$1.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:throwError(e,'undeclared tag handle "'+n+'"'),!0}function readAnchorProperty(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&throwError(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!is_WS_OR_EOL(n)&&!is_FLOW_INDICATOR(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&throwError(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function readAlias(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!is_WS_OR_EOL(r)&&!is_FLOW_INDICATOR(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&throwError(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),_hasOwnProperty$1.call(e.anchorMap,n)||throwError(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],skipSeparationSpace(e,!0,-1),!0}function composeNode(e,t,n,r,i){var o,s,a,c,l,u,d,p,f,_=1,m=!1,h=!1;if(null!==e.listener&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=s=a=CONTEXT_BLOCK_OUT===n||CONTEXT_BLOCK_IN===n,r&&skipSeparationSpace(e,!0,-1)&&(m=!0,e.lineIndent>t?_=1:e.lineIndent===t?_=0:e.lineIndent<t&&(_=-1)),1===_)for(;readTagProperty(e)||readAnchorProperty(e);)skipSeparationSpace(e,!0,-1)?(m=!0,a=o,e.lineIndent>t?_=1:e.lineIndent===t?_=0:e.lineIndent<t&&(_=-1)):a=!1;if(a&&(a=m||i),1!==_&&CONTEXT_BLOCK_OUT!==n||(p=CONTEXT_FLOW_IN===n||CONTEXT_FLOW_OUT===n?t:t+1,f=e.position-e.lineStart,1===_?a&&(readBlockSequence(e,f)||readBlockMapping(e,f,p))||readFlowCollection(e,p)?h=!0:(s&&readBlockScalar(e,p)||readSingleQuotedScalar(e,p)||readDoubleQuotedScalar(e,p)?h=!0:readAlias(e)?(h=!0,null===e.tag&&null===e.anchor||throwError(e,"alias node should not have any properties")):readPlainScalar(e,p,CONTEXT_FLOW_IN===n)&&(h=!0,null===e.tag&&(e.tag="?")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===_&&(h=a&&readBlockSequence(e,f))),null===e.tag)null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);else if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&throwError(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),c=0,l=e.implicitTypes.length;c<l;c+=1)if((d=e.implicitTypes[c]).resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,null!==e.anchor&&(e.anchorMap[e.anchor]=e.result);break}}else if("!"!==e.tag){if(_hasOwnProperty$1.call(e.typeMap[e.kind||"fallback"],e.tag))d=e.typeMap[e.kind||"fallback"][e.tag];else for(d=null,c=0,l=(u=e.typeMap.multi[e.kind||"fallback"]).length;c<l;c+=1)if(e.tag.slice(0,u[c].tag.length)===u[c].tag){d=u[c];break}d||throwError(e,"unknown tag !<"+e.tag+">"),null!==e.result&&d.kind!==e.kind&&throwError(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result,e.tag)?(e.result=d.construct(e.result,e.tag),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):throwError(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||h}function readDocument(e){var t,n,r,i,o=e.position,s=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(i=e.input.charCodeAt(e.position))&&(skipSeparationSpace(e,!0,-1),i=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==i));){for(s=!0,i=e.input.charCodeAt(++e.position),t=e.position;0!==i&&!is_WS_OR_EOL(i);)i=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&throwError(e,"directive name must not be less than one character in length");0!==i;){for(;is_WHITE_SPACE(i);)i=e.input.charCodeAt(++e.position);if(35===i){do{i=e.input.charCodeAt(++e.position)}while(0!==i&&!is_EOL(i));break}if(is_EOL(i))break;for(t=e.position;0!==i&&!is_WS_OR_EOL(i);)i=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==i&&readLineBreak(e),_hasOwnProperty$1.call(directiveHandlers,n)?directiveHandlers[n](e,n,r):throwWarning(e,'unknown document directive "'+n+'"')}skipSeparationSpace(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,skipSeparationSpace(e,!0,-1)):s&&throwError(e,"directives end mark is expected"),composeNode(e,e.lineIndent-1,CONTEXT_BLOCK_OUT,!1,!0),skipSeparationSpace(e,!0,-1),e.checkLineBreaks&&PATTERN_NON_ASCII_LINE_BREAKS.test(e.input.slice(o,e.position))&&throwWarning(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&testDocumentSeparator(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,skipSeparationSpace(e,!0,-1)):e.position<e.length-1&&throwError(e,"end of the stream or a document separator is expected")}function loadDocuments(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new State$1(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,throwError(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)readDocument(n);return n.documents}function loadAll$1(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var r=loadDocuments(e,n);if("function"!=typeof t)return r;for(var i=0,o=r.length;i<o;i+=1)t(r[i])}function load$1(e,t){var n=loadDocuments(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new exception$1("expected a single document in the stream, but found more")}}var loadAll_1=loadAll$1,load_1=load$1,loader$1={loadAll:loadAll_1,load:load_1},_toString=Object.prototype.toString,_hasOwnProperty=Object.prototype.hasOwnProperty,CHAR_BOM=65279,CHAR_TAB=9,CHAR_LINE_FEED=10,CHAR_CARRIAGE_RETURN=13,CHAR_SPACE=32,CHAR_EXCLAMATION=33,CHAR_DOUBLE_QUOTE=34,CHAR_SHARP=35,CHAR_PERCENT=37,CHAR_AMPERSAND=38,CHAR_SINGLE_QUOTE=39,CHAR_ASTERISK=42,CHAR_COMMA=44,CHAR_MINUS=45,CHAR_COLON=58,CHAR_EQUALS=61,CHAR_GREATER_THAN=62,CHAR_QUESTION=63,CHAR_COMMERCIAL_AT=64,CHAR_LEFT_SQUARE_BRACKET=91,CHAR_RIGHT_SQUARE_BRACKET=93,CHAR_GRAVE_ACCENT=96,CHAR_LEFT_CURLY_BRACKET=123,CHAR_VERTICAL_LINE=124,CHAR_RIGHT_CURLY_BRACKET=125,ESCAPE_SEQUENCES={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},DEPRECATED_BOOLEANS_SYNTAX=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],DEPRECATED_BASE60_SYNTAX=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function compileStyleMap(e,t){var n,r,i,o,s,a,c;if(null===t)return{};for(n={},i=0,o=(r=Object.keys(t)).length;i<o;i+=1)s=r[i],a=String(t[s]),"!!"===s.slice(0,2)&&(s="tag:yaml.org,2002:"+s.slice(2)),(c=e.compiledTypeMap.fallback[s])&&_hasOwnProperty.call(c.styleAliases,a)&&(a=c.styleAliases[a]),n[s]=a;return n}function encodeHex(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else{if(!(e<=4294967295))throw new exception$1("code point within a string may not be greater than 0xFFFFFFFF");n="U",r=8}return"\\"+n+common$2.repeat("0",r-t.length)+t}var QUOTING_TYPE_SINGLE=1,QUOTING_TYPE_DOUBLE=2;function State(e){this.schema=e.schema||_default$2,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=common$2.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=compileStyleMap(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType='"'===e.quotingType?QUOTING_TYPE_DOUBLE:QUOTING_TYPE_SINGLE,this.forceQuotes=e.forceQuotes||!1,this.replacer="function"==typeof e.replacer?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function indentString(e,t){for(var n,r=common$2.repeat(" ",t),i=0,o=-1,s="",a=e.length;i<a;)-1===(o=e.indexOf("\n",i))?(n=e.slice(i),i=a):(n=e.slice(i,o+1),i=o+1),n.length&&"\n"!==n&&(s+=r),s+=n;return s}function generateNextLine(e,t){return"\n"+common$2.repeat(" ",e.indent*t)}function testImplicitResolving(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}function isWhitespace(e){return e===CHAR_SPACE||e===CHAR_TAB}function isPrintable(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==CHAR_BOM||65536<=e&&e<=1114111}function isNsCharOrWhitespace(e){return isPrintable(e)&&e!==CHAR_BOM&&e!==CHAR_CARRIAGE_RETURN&&e!==CHAR_LINE_FEED}function isPlainSafe(e,t,n){var r=isNsCharOrWhitespace(e),i=r&&!isWhitespace(e);return(n?r:r&&e!==CHAR_COMMA&&e!==CHAR_LEFT_SQUARE_BRACKET&&e!==CHAR_RIGHT_SQUARE_BRACKET&&e!==CHAR_LEFT_CURLY_BRACKET&&e!==CHAR_RIGHT_CURLY_BRACKET)&&e!==CHAR_SHARP&&!(t===CHAR_COLON&&!i)||isNsCharOrWhitespace(t)&&!isWhitespace(t)&&e===CHAR_SHARP||t===CHAR_COLON&&i}function isPlainSafeFirst(e){return isPrintable(e)&&e!==CHAR_BOM&&!isWhitespace(e)&&e!==CHAR_MINUS&&e!==CHAR_QUESTION&&e!==CHAR_COLON&&e!==CHAR_COMMA&&e!==CHAR_LEFT_SQUARE_BRACKET&&e!==CHAR_RIGHT_SQUARE_BRACKET&&e!==CHAR_LEFT_CURLY_BRACKET&&e!==CHAR_RIGHT_CURLY_BRACKET&&e!==CHAR_SHARP&&e!==CHAR_AMPERSAND&&e!==CHAR_ASTERISK&&e!==CHAR_EXCLAMATION&&e!==CHAR_VERTICAL_LINE&&e!==CHAR_EQUALS&&e!==CHAR_GREATER_THAN&&e!==CHAR_SINGLE_QUOTE&&e!==CHAR_DOUBLE_QUOTE&&e!==CHAR_PERCENT&&e!==CHAR_COMMERCIAL_AT&&e!==CHAR_GRAVE_ACCENT}function isPlainSafeLast(e){return!isWhitespace(e)&&e!==CHAR_COLON}function codePointAt(e,t){var n,r=e.charCodeAt(t);return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function needIndentIndicator(e){return/^\n* /.test(e)}var STYLE_PLAIN=1,STYLE_SINGLE=2,STYLE_LITERAL=3,STYLE_FOLDED=4,STYLE_DOUBLE=5;function chooseScalarStyle(e,t,n,r,i,o,s,a){var c,l=0,u=null,d=!1,p=!1,f=-1!==r,_=-1,m=isPlainSafeFirst(codePointAt(e,0))&&isPlainSafeLast(codePointAt(e,e.length-1));if(t||s)for(c=0;c<e.length;l>=65536?c+=2:c++){if(!isPrintable(l=codePointAt(e,c)))return STYLE_DOUBLE;m=m&&isPlainSafe(l,u,a),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if((l=codePointAt(e,c))===CHAR_LINE_FEED)d=!0,f&&(p=p||c-_-1>r&&" "!==e[_+1],_=c);else if(!isPrintable(l))return STYLE_DOUBLE;m=m&&isPlainSafe(l,u,a),u=l}p=p||f&&c-_-1>r&&" "!==e[_+1]}return d||p?n>9&&needIndentIndicator(e)?STYLE_DOUBLE:s?o===QUOTING_TYPE_DOUBLE?STYLE_DOUBLE:STYLE_SINGLE:p?STYLE_FOLDED:STYLE_LITERAL:!m||s||i(e)?o===QUOTING_TYPE_DOUBLE?STYLE_DOUBLE:STYLE_SINGLE:STYLE_PLAIN}function writeScalar(e,t,n,r,i){e.dump=function(){if(0===t.length)return e.quotingType===QUOTING_TYPE_DOUBLE?'""':"''";if(!e.noCompatMode&&(-1!==DEPRECATED_BOOLEANS_SYNTAX.indexOf(t)||DEPRECATED_BASE60_SYNTAX.test(t)))return e.quotingType===QUOTING_TYPE_DOUBLE?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),s=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=r||e.flowLevel>-1&&n>=e.flowLevel;switch(chooseScalarStyle(t,a,e.indent,s,(function(t){return testImplicitResolving(e,t)}),e.quotingType,e.forceQuotes&&!r,i)){case STYLE_PLAIN:return t;case STYLE_SINGLE:return"'"+t.replace(/'/g,"''")+"'";case STYLE_LITERAL:return"|"+blockHeader(t,e.indent)+dropEndingNewline(indentString(t,o));case STYLE_FOLDED:return">"+blockHeader(t,e.indent)+dropEndingNewline(indentString(foldString(t,s),o));case STYLE_DOUBLE:return'"'+escapeString(t)+'"';default:throw new exception$1("impossible error: invalid scalar style")}}()}function blockHeader(e,t){var n=needIndentIndicator(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function dropEndingNewline(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function foldString(e,t){for(var n,r,i,o=/(\n+)([^\n]*)/g,s=(n=-1!==(n=e.indexOf("\n"))?n:e.length,o.lastIndex=n,foldLine(e.slice(0,n),t)),a="\n"===e[0]||" "===e[0];i=o.exec(e);){var c=i[1],l=i[2];r=" "===l[0],s+=c+(a||r||""===l?"":"\n")+foldLine(l,t),a=r}return s}function foldLine(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,o=0,s=0,a=0,c="";n=i.exec(e);)(a=n.index)-o>t&&(r=s>o?s:a,c+="\n"+e.slice(o,r),o=r+1),s=a;return c+="\n",e.length-o>t&&s>o?c+=e.slice(o,s)+"\n"+e.slice(s+1):c+=e.slice(o),c.slice(1)}function escapeString(e){for(var t,n="",r=0,i=0;i<e.length;r>=65536?i+=2:i++)r=codePointAt(e,i),!(t=ESCAPE_SEQUENCES[r])&&isPrintable(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||encodeHex(r);return n}function writeFlowSequence(e,t,n){var r,i,o,s="",a=e.tag;for(r=0,i=n.length;r<i;r+=1)o=n[r],e.replacer&&(o=e.replacer.call(n,String(r),o)),(writeNode(e,t,o,!1,!1)||void 0===o&&writeNode(e,t,null,!1,!1))&&(""!==s&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=a,e.dump="["+s+"]"}function writeBlockSequence(e,t,n,r){var i,o,s,a="",c=e.tag;for(i=0,o=n.length;i<o;i+=1)s=n[i],e.replacer&&(s=e.replacer.call(n,String(i),s)),(writeNode(e,t+1,s,!0,!0,!1,!0)||void 0===s&&writeNode(e,t+1,null,!0,!0,!1,!0))&&(r&&""===a||(a+=generateNextLine(e,t)),e.dump&&CHAR_LINE_FEED===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=c,e.dump=a||"[]"}function writeFlowMapping(e,t,n){var r,i,o,s,a,c="",l=e.tag,u=Object.keys(n);for(r=0,i=u.length;r<i;r+=1)a="",""!==c&&(a+=", "),e.condenseFlow&&(a+='"'),s=n[o=u[r]],e.replacer&&(s=e.replacer.call(n,o,s)),writeNode(e,t,o,!1,!1)&&(e.dump.length>1024&&(a+="? "),a+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),writeNode(e,t,s,!1,!1)&&(c+=a+=e.dump));e.tag=l,e.dump="{"+c+"}"}function writeBlockMapping(e,t,n,r){var i,o,s,a,c,l,u="",d=e.tag,p=Object.keys(n);if(!0===e.sortKeys)p.sort();else if("function"==typeof e.sortKeys)p.sort(e.sortKeys);else if(e.sortKeys)throw new exception$1("sortKeys must be a boolean or a function");for(i=0,o=p.length;i<o;i+=1)l="",r&&""===u||(l+=generateNextLine(e,t)),a=n[s=p[i]],e.replacer&&(a=e.replacer.call(n,s,a)),writeNode(e,t+1,s,!0,!0,!0)&&((c=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&CHAR_LINE_FEED===e.dump.charCodeAt(0)?l+="?":l+="? "),l+=e.dump,c&&(l+=generateNextLine(e,t)),writeNode(e,t+1,a,!0,c)&&(e.dump&&CHAR_LINE_FEED===e.dump.charCodeAt(0)?l+=":":l+=": ",u+=l+=e.dump));e.tag=d,e.dump=u||"{}"}function detectType(e,t,n){var r,i,o,s,a,c;for(o=0,s=(i=n?e.explicitTypes:e.implicitTypes).length;o<s;o+=1)if(((a=i[o]).instanceOf||a.predicate)&&(!a.instanceOf||"object"==typeof t&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(c=e.styleMap[a.tag]||a.defaultStyle,"[object Function]"===_toString.call(a.represent))r=a.represent(t,c);else{if(!_hasOwnProperty.call(a.represent,c))throw new exception$1("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');r=a.represent[c](t,c)}e.dump=r}return!0}return!1}function writeNode(e,t,n,r,i,o,s){e.tag=null,e.dump=n,detectType(e,n,!1)||detectType(e,n,!0);var a,c=_toString.call(e.dump),l=r;r&&(r=e.flowLevel<0||e.flowLevel>t);var u,d,p="[object Object]"===c||"[object Array]"===c;if(p&&(d=-1!==(u=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||d||2!==e.indent&&t>0)&&(i=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(p&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),"[object Object]"===c)r&&0!==Object.keys(e.dump).length?(writeBlockMapping(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(writeFlowMapping(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if("[object Array]"===c)r&&0!==e.dump.length?(e.noArrayIndent&&!s&&t>0?writeBlockSequence(e,t-1,e.dump,i):writeBlockSequence(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(writeFlowSequence(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else{if("[object String]"!==c){if("[object Undefined]"===c)return!1;if(e.skipInvalid)return!1;throw new exception$1("unacceptable kind of an object to dump "+c)}"?"!==e.tag&&writeScalar(e,e.dump,t,o,l)}null!==e.tag&&"?"!==e.tag&&(a=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),a="!"===e.tag[0]?"!"+a:"tag:yaml.org,2002:"===a.slice(0,18)?"!!"+a.slice(18):"!<"+a+">",e.dump=a+" "+e.dump)}return!0}function getDuplicateReferences(e,t){var n,r,i=[],o=[];for(inspectNode(e,i,o),n=0,r=o.length;n<r;n+=1)t.duplicates.push(i[o[n]]);t.usedDuplicates=new Array(r)}function inspectNode(e,t,n){var r,i,o;if(null!==e&&"object"==typeof e)if(-1!==(i=t.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)inspectNode(e[i],t,n);else for(i=0,o=(r=Object.keys(e)).length;i<o;i+=1)inspectNode(e[r[i]],t,n)}function dump$1(e,t){var n=new State(t=t||{});n.noRefs||getDuplicateReferences(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),writeNode(n,0,r,!0,!0)?n.dump+"\n":""}var dump_1=dump$1,dumper$1={dump:dump_1};function renamed(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var Type=type$b,Schema=schema$2,FAILSAFE_SCHEMA=failsafe$1,JSON_SCHEMA=json$3,CORE_SCHEMA=core$4,DEFAULT_SCHEMA=_default$2,load$2=loader$1.load,loadAll=loader$1.loadAll,dump=dumper$1.dump,YAMLException=exception$1,types$2={binary:binary$2,float:float$1,map:map$2,null:_null$1,pairs:pairs$1,set:set$1,timestamp:timestamp$1,bool:bool$1,int:int$1,merge:merge$1,omap:omap$1,seq:seq$1,str:str$1},safeLoad=renamed("safeLoad","load"),safeLoadAll=renamed("safeLoadAll","loadAll"),safeDump=renamed("safeDump","dump"),jsYaml$1={Type:Type,Schema:Schema,FAILSAFE_SCHEMA:FAILSAFE_SCHEMA,JSON_SCHEMA:JSON_SCHEMA,CORE_SCHEMA:CORE_SCHEMA,DEFAULT_SCHEMA:DEFAULT_SCHEMA,load:load$2,loadAll:loadAll,dump:dump,YAMLException:YAMLException,types:types$2,safeLoad:safeLoad,safeLoadAll:safeLoadAll,safeDump:safeDump};function isBuffer$1(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&!!e.constructor.isBuffer(e)}function normalizeURL(e){return e.startsWith("https://github.com/")&&e.includes("/blob/")?e.replace("github.com","raw.githubusercontent.com").replace("/blob/","/"):e}function getType(e){return isBuffer$1(e)?"buffer":"object"==typeof e?"json":"string"==typeof e&&(e.match(/\s*{/)?"string-json":e.match(/\n/)?"string-yaml":"http"===e.substring(0,4)?"url":"path")}function isOpenAPI(e){return!!e.openapi}function isPostman(e){return!!e.info&&!!e.item}function isSwagger(e){return!!e.swagger}function stringToJSON(e){return"object"==typeof e?e:e.match(/^\s*{/)?JSON.parse(e):jsYaml$1.load(e,{schema:JSON_SCHEMA})}function getAPIDefinitionType(e){return isOpenAPI(e)?"openapi":isPostman(e)?"postman":isSwagger(e)?"swagger":"unknown"}const nonJsonTypes=["function","symbol","undefined"],protectedProps$1=["constructor","prototype","__proto__"],objectPrototype=Object.getPrototypeOf({});function toJSON(){let e={},t=this;for(let n of getDeepKeys(t))if("string"==typeof n){let r=t[n],i=typeof r;nonJsonTypes.includes(i)||(e[n]=r)}return e}function getDeepKeys(e,t=[]){let n=[];for(;e&&e!==objectPrototype;)n=n.concat(Object.getOwnPropertyNames(e),Object.getOwnPropertySymbols(e)),e=Object.getPrototypeOf(e);let r=new Set(n);for(let e of t.concat(protectedProps$1))r.delete(e);return r}const inspectMethod=require$$0$5.inspect.custom||Symbol.for("nodejs.util.inspect.custom"),format$4=require$$0$5.format;function addInspectMethod(e){e[inspectMethod]=inspect}function inspect(){let e={},t=this;for(let n of getDeepKeys(t)){let r=t[n];e[n]=r}return delete e[inspectMethod],e}const newline=/\r?\n/,onoCall=/\bono[ @]/;function isLazyStack(e){return Boolean(e&&e.configurable&&"function"==typeof e.get)}function isWritableStack(e){return Boolean(!e||e.writable||"function"==typeof e.set)}function joinStacks(e,t){let n=popStack(e.stack),r=t?t.stack:void 0;return n&&r?n+"\n\n"+r:n||r}function lazyJoinStacks(e,t,n){n?Object.defineProperty(t,"stack",{get:()=>joinStacks({stack:e.get.apply(t)},n),enumerable:!1,configurable:!0}):lazyPopStack(t,e)}function popStack(e){if(e){let t,n=e.split(newline);for(let e=0;e<n.length;e++){let r=n[e];if(onoCall.test(r))void 0===t&&(t=e);else if(void 0!==t){n.splice(t,e-t);break}}if(n.length>0)return n.join("\n")}return e}function lazyPopStack(e,t){Object.defineProperty(e,"stack",{get:()=>popStack(t.get.apply(e)),enumerable:!1,configurable:!0})}const protectedProps=["name","message","stack"];function extendError(e,t,n){let r=e;return extendStack(r,t),t&&"object"==typeof t&&mergeErrors(r,t),r.toJSON=toJSON,addInspectMethod&&addInspectMethod(r),n&&"object"==typeof n&&Object.assign(r,n),r}function extendStack(e,t){let n=Object.getOwnPropertyDescriptor(e,"stack");isLazyStack(n)?lazyJoinStacks(n,e,t):isWritableStack(n)&&(e.stack=joinStacks(e,t))}function mergeErrors(e,t){let n=getDeepKeys(t,protectedProps),r=e,i=t;for(let e of n)if(void 0===r[e])try{r[e]=i[e]}catch(e){}}function normalizeOptions$1(e){return{concatMessages:void 0===(e=e||{}).concatMessages||Boolean(e.concatMessages),format:void 0===e.format?format$4:"function"==typeof e.format&&e.format}}function normalizeArgs$1(e,t){let n,r,i,o="";return"string"==typeof e[0]?i=e:"string"==typeof e[1]?(e[0]instanceof Error?n=e[0]:r=e[0],i=e.slice(1)):(n=e[0],r=e[1],i=e.slice(2)),i.length>0&&(o=t.format?t.format.apply(void 0,i):i.join(" ")),t.concatMessages&&n&&n.message&&(o+=(o?" \n":"")+n.message),{originalError:n,props:r,message:o}}const constructor=Ono;function Ono(e,t){function n(...n){let{originalError:r,props:i,message:o}=normalizeArgs$1(n,t);return extendError(new e(o),r,i)}return t=normalizeOptions$1(t),n[Symbol.species]=e,n}Ono.toJSON=function(e){return toJSON.call(e)},Ono.extend=function(e,t,n){return n||t instanceof Error?extendError(e,t,n):t?extendError(e,void 0,t):extendError(e)};const singleton=ono;ono.error=new constructor(Error),ono.eval=new constructor(EvalError),ono.range=new constructor(RangeError),ono.reference=new constructor(ReferenceError),ono.syntax=new constructor(SyntaxError),ono.type=new constructor(TypeError),ono.uri=new constructor(URIError);const onoMap=ono;function ono(...e){let t=e[0];if("object"==typeof t&&"string"==typeof t.name)for(let n of Object.values(onoMap))if("function"==typeof n&&"ono"===n.name){let r=n[Symbol.species];if(r&&r!==Error&&(t instanceof r||t.name===r.name))return n.apply(void 0,e)}return ono.error.apply(void 0,e)}"object"==typeof module&&"object"==typeof module.exports&&"object"==typeof module.exports.default&&(module.exports=Object.assign(module.exports.default,module.exports));var esm=Object.freeze({__proto__:null,Ono:constructor,default:singleton,ono:singleton}),require$$0$1=getAugmentedNamespace(esm),lib$e={exports:{}},next$1,hasRequiredNext$1,maybe,hasRequiredMaybe;function requireNext$1(){if(hasRequiredNext$1)return next$1;return hasRequiredNext$1=1,next$1="object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:"function"==typeof setImmediate?setImmediate:function(e){setTimeout(e,0)}}function requireMaybe(){if(hasRequiredMaybe)return maybe;hasRequiredMaybe=1;var e=requireNext$1();return maybe=function(t,n){return t?void n.then((function(n){e((function(){t(null,n)}))}),(function(n){e((function(){t(n)}))})):n},maybe}var errors$1={},url={exports:{}},hasRequiredUrl,hasRequiredErrors$1,pointer,hasRequiredPointer,ref$1,hasRequiredRef$1,bundle,hasRequiredBundle,dereference,hasRequiredDereference$1,binary$1,hasRequiredBinary$1,json$2,hasRequiredJson$2,text,hasRequiredText;function requireUrl(){return hasRequiredUrl||(hasRequiredUrl=1,function(e,t){const n=/^win/.test(process.platform),r=/\//g,i=/^(\w{2,}):\/\//i,o=e.exports,s=/~1/g,a=/~0/g,c=[/\?/g,"%3F",/#/g,"%23"],l=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"];t.parse=require$$0$k.parse,t.resolve=require$$0$k.resolve,t.cwd=function(){if(process.browser)return location.href;const e=process.cwd(),t=e.slice(-1);return"/"===t||"\\"===t?e:`${e}/`},t.getProtocol=function(e){const t=i.exec(e);if(t)return t[1].toLowerCase()},t.getExtension=function(e){const t=e.lastIndexOf(".");return t>=0?o.stripQuery(e.substr(t).toLowerCase()):""},t.stripQuery=function(e){const t=e.indexOf("?");return t>=0&&(e=e.substr(0,t)),e},t.getHash=function(e){const t=e.indexOf("#");return t>=0?e.substr(t):"#"},t.stripHash=function(e){const t=e.indexOf("#");return t>=0?e.substr(0,t):e},t.isHttp=function(e){const t=o.getProtocol(e);return"http"===t||"https"===t||void 0===t&&process.browser},t.isFileSystemPath=function(e){if(process.browser)return!1;const t=o.getProtocol(e);return void 0===t||"file"===t},t.fromFileSystemPath=function(e){n&&(e=e.replace(/\\/g,"/")),e=encodeURI(e);for(let t=0;t<c.length;t+=2)e=e.replace(c[t],c[t+1]);return e},t.toFileSystemPath=function(e,t){e=decodeURI(e);for(let t=0;t<l.length;t+=2)e=e.replace(l[t],l[t+1]);let i="file://"===e.substr(0,7).toLowerCase();return i&&(e="/"===e[7]?e.substr(8):e.substr(7),n&&"/"===e[1]&&(e=`${e[0]}:${e.substr(1)}`),t?e=`file:///${e}`:(i=!1,e=n?e:`/${e}`)),n&&!i&&":\\"===(e=e.replace(r,"\\")).substr(1,2)&&(e=e[0].toUpperCase()+e.substr(1)),e},t.safePointerToPath=function(e){return e.length<=1||"#"!==e[0]||"/"!==e[1]?[]:e.slice(2).split("/").map((e=>decodeURIComponent(e).replace(s,"/").replace(a,"~")))}}(url,url.exports)),url.exports}function requireErrors$1(){if(hasRequiredErrors$1)return errors$1;hasRequiredErrors$1=1;const{Ono:e}=require$$0$1,{stripHash:t,toFileSystemPath:n}=requireUrl();function r(e){Object.defineProperty(e.prototype,"name",{value:e.name,enumerable:!0})}const i=class extends Error{constructor(t,n){super(),this.code="EUNKNOWN",this.message=t,this.source=n,this.path=null,e.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};errors$1.JSONParserError=i,r(i);const o=class t extends Error{constructor(t){super(),this.files=t,this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${n(t.$refs._root$Ref.path)}'`,e.extend(this)}static getParserErrors(e){const t=[];for(const n of Object.values(e.$refs._$refs))n.errors&&t.push(...n.errors);return t}get errors(){return t.getParserErrors(this.files)}};errors$1.JSONParserErrorGroup=o,r(o);const s=class extends i{constructor(e,t){super(`Error parsing ${t}: ${e}`,t),this.code="EPARSER"}};errors$1.ParserError=s,r(s);const a=class extends i{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER"}};errors$1.UnmatchedParserError=a,r(a);const c=class extends i{constructor(e,t){super(e.message||`Error reading file "${t}"`,t),this.code="ERESOLVER","code"in e&&(this.ioErrorCode=String(e.code))}};errors$1.ResolverError=c,r(c);const l=class extends i{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER"}};errors$1.UnmatchedResolverError=l,r(l);const u=class extends i{constructor(e,n){super(`Token "${e}" does not exist.`,t(n)),this.code="EMISSINGPOINTER"}};errors$1.MissingPointerError=u,r(u);const d=class extends i{constructor(e,n){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,t(n)),this.code="EINVALIDPOINTER"}};return errors$1.InvalidPointerError=d,r(d),errors$1.isHandledError=function(e){return e instanceof i||e instanceof o},errors$1.normalizeError=function(e){return null===e.path&&(e.path=[]),e},errors$1}function requirePointer(){if(hasRequiredPointer)return pointer;hasRequiredPointer=1;const e=requireRef$1(),{JSONParserError:t,InvalidPointerError:n,MissingPointerError:r,isHandledError:i}=requireErrors$1(),o=requireUrl(),s=/\//g,a=/~/g,c=/~1/g,l=/~0/g;function u(e,t,n){this.$ref=e,this.path=t,this.originalPath=n||t,this.value=void 0,this.circular=!1,this.indirections=0}function d(t,n){if(e.isAllowed$Ref(t.value,n)){const r=o.resolve(t.path,t.value.$ref);if(r!==t.path){const i=t.$ref.$refs._resolve(r,t.path,n);return null!==i&&(t.indirections+=i.indirections+1,e.isExtended$Ref(t.value)?(t.value=e.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}t.circular=!0}}function p(e,n,r){if(!e.value||"object"!=typeof e.value)throw new t(`Error assigning $ref pointer "${e.path}". \nCannot set "${n}" of a non-object.`);return"-"===n&&Array.isArray(e.value)?e.value.push(r):e.value[n]=r,r}function f(e){if(i(e))throw e;return e}return pointer=u,u.prototype.resolve=function(e,t,n){const i=u.parse(this.path,this.originalPath);this.value=f(e);for(let e=0;e<i.length;e++){if(d(this,t)&&(this.path=u.join(this.path,i.slice(e))),"object"==typeof this.value&&null!==this.value&&"$ref"in this.value)return this;const n=i[e];if(void 0===this.value[n]||null===this.value[n])throw this.value=null,new r(n,this.originalPath);this.value=this.value[n]}return(!this.value||this.value.$ref&&o.resolve(this.path,this.value.$ref)!==n)&&d(this,t),this},u.prototype.set=function(e,t,n){const r=u.parse(this.path);let i;if(0===r.length)return this.value=t,t;this.value=f(e);for(let e=0;e<r.length-1;e++)d(this,n),i=r[e],this.value&&void 0!==this.value[i]?this.value=this.value[i]:this.value=p(this,i,{});return d(this,n),i=r[r.length-1],p(this,i,t),e},u.parse=function(e,t){let r=o.getHash(e).substr(1);if(!r)return[];r=r.split("/");for(let e=0;e<r.length;e++)r[e]=decodeURIComponent(r[e].replace(c,"/").replace(l,"~"));if(""!==r[0])throw new n(r,void 0===t?e:t);return r.slice(1)},u.join=function(e,t){-1===e.indexOf("#")&&(e+="#"),t=Array.isArray(t)?t:[t];for(let n=0;n<t.length;n++){const r=t[n];e+=`/${encodeURIComponent(r.replace(a,"~0").replace(s,"~1"))}`}return e},pointer}function requireRef$1(){if(hasRequiredRef$1)return ref$1;hasRequiredRef$1=1,ref$1=a;const e=requirePointer(),{InvalidPointerError:t,isHandledError:n,normalizeError:r}=requireErrors$1(),{safePointerToPath:i,stripHash:o,getHash:s}=requireUrl();function a(){this.path=void 0,this.value=void 0,this.$refs=void 0,this.pathType=void 0,this.errors=void 0}return a.prototype.addError=function(e){void 0===this.errors&&(this.errors=[]);const t=this.errors.map((({footprint:e})=>e));Array.isArray(e.errors)?this.errors.push(...e.errors.map(r).filter((({footprint:e})=>!t.includes(e)))):t.includes(e.footprint)||this.errors.push(r(e))},a.prototype.exists=function(e,t){try{return this.resolve(e,t),!0}catch(e){return!1}},a.prototype.get=function(e,t){return this.resolve(e,t).value},a.prototype.resolve=function(r,a,c,l){const u=new e(this,r,c);try{return u.resolve(this.value,a,l)}catch(e){if(!a||!a.continueOnError||!n(e))throw e;return null===e.path&&(e.path=i(s(l))),e instanceof t&&(e.source=o(l)),this.addError(e),null}},a.prototype.set=function(t,n){const r=new e(this,t);this.value=r.set(this.value,n)},a.is$Ref=function(e){return e&&"object"==typeof e&&"string"==typeof e.$ref&&e.$ref.length>0},a.isExternal$Ref=function(e){return a.is$Ref(e)&&"#"!==e.$ref[0]},a.isAllowed$Ref=function(e,t){if(a.is$Ref(e)){if("#/"===e.$ref.substr(0,2)||"#"===e.$ref)return!0;if("#"!==e.$ref[0]&&(!t||t.resolve.external))return!0}},a.isExtended$Ref=function(e){return a.is$Ref(e)&&Object.keys(e).length>1},a.dereference=function(e,t){if(t&&"object"==typeof t&&a.isExtended$Ref(e)){const n={};for(const t of Object.keys(e))"$ref"!==t&&(n[t]=e[t]);for(const e of Object.keys(t))e in n||(n[e]=t[e]);return n}return t},ref$1}function requireBundle(){if(hasRequiredBundle)return bundle;hasRequiredBundle=1;const e=requireRef$1(),t=requirePointer(),n=requireUrl();function r(n,o,s,a,c,l,u,d){const p=null===o?n:n[o];if(p&&"object"==typeof p&&!ArrayBuffer.isView(p))if(e.isAllowed$Ref(p))i(n,o,s,a,c,l,u,d);else{const n=Object.keys(p).sort(((e,t)=>"definitions"===e?-1:"definitions"===t?1:e.length-t.length));for(const o of n){const n=t.join(s,o),f=t.join(a,o),_=p[o];e.isAllowed$Ref(_)?i(p,o,s,f,c,l,u,d):r(p,o,n,f,c,l,u,d)}}}function i(i,o,s,a,c,l,u,d){const p=null===o?i:i[o],f=n.resolve(s,p.$ref),_=u._resolve(f,a,d);if(null===_)return;const m=t.parse(a).length,h=n.stripHash(_.path),g=n.getHash(_.path),A=h!==u._root$Ref.path,y=e.isExtended$Ref(p);c+=_.indirections;const v=function(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];if(i.parent===t&&i.key===n)return i}}(l,i,o);if(v){if(!(m<v.depth||c<v.indirections))return;!function(e,t){const n=e.indexOf(t);e.splice(n,1)}(l,v)}l.push({$ref:p,parent:i,key:o,pathFromRoot:a,depth:m,file:h,hash:g,value:_.value,circular:_.circular,extended:y,external:A,indirections:c}),v||r(_.value,null,_.path,a,c+1,l,u,d)}return bundle=function(n,i){const o=[];r(n,"schema",`${n.$refs._root$Ref.path}#`,"#",0,o,n.$refs,i),function(n){let r,i,o;n.sort(((e,t)=>{if(e.file!==t.file)return e.file<t.file?-1:1;if(e.hash!==t.hash)return e.hash<t.hash?-1:1;if(e.circular!==t.circular)return e.circular?-1:1;if(e.extended!==t.extended)return e.extended?1:-1;if(e.indirections!==t.indirections)return e.indirections-t.indirections;if(e.depth!==t.depth)return e.depth-t.depth;const n=e.pathFromRoot.lastIndexOf("/definitions"),r=t.pathFromRoot.lastIndexOf("/definitions");return n!==r?r-n:e.pathFromRoot.length-t.pathFromRoot.length}));for(const s of n)s.external?s.file===r&&s.hash===i?s.$ref.$ref=o:s.file===r&&0===s.hash.indexOf(`${i}/`)?s.$ref.$ref=t.join(o,t.parse(s.hash.replace(i,"#"))):(r=s.file,i=s.hash,o=s.pathFromRoot,s.parent[s.key]=e.dereference(s.$ref,s.value),s.$ref=s.parent[s.key],s.circular&&(s.$ref.$ref=s.pathFromRoot)):s.$ref.$ref=s.hash}(o)},bundle}function requireDereference$1(){if(hasRequiredDereference$1)return dereference;hasRequiredDereference$1=1;const{ono:e}=require$$0$1,t=requirePointer(),n=requireRef$1(),r=requireUrl();function i(e,r,a,c,l,u,d,p){let f;const _={value:e,circular:!1};if(("ignore"===p.dereference.circular||!l.has(e))&&e&&"object"==typeof e&&!ArrayBuffer.isView(e)){if(c.add(e),l.add(e),n.isAllowed$Ref(e,p))f=o(e,r,a,c,l,u,d,p),_.circular=f.circular,_.value=f.value,e.description&&(_.value.description=e.description),e.summary&&(_.value.summary=e.summary);else for(const m of Object.keys(e)){const h=t.join(r,m),g=t.join(a,m),A=e[m];let y=!1;n.isAllowed$Ref(A,p)?(f=o(A,h,g,c,l,u,d,p),y=f.circular,e[m]!==f.value&&(e[m]=f.value,A.description&&(e[m].description=A.description),A.summary&&(e[m].summary=A.summary))):c.has(A)?y=s(h,d,p):(f=i(A,h,g,c,l,u,d,p),y=f.circular,e[m]!==f.value&&(e[m]=f.value)),_.circular=_.circular||y}c.delete(e)}return _}function o(e,t,o,a,c,l,u,d){const p=r.resolve(t,e.$ref),f=l.get(p);if(f){const t=Object.keys(e);if(t.length>1){const n={};for(const r of t)"$ref"===r||r in f.value||(n[r]=e[r]);return{circular:f.circular,value:{...f.value,...n}}}return f}const _=u._resolve(p,t,d);if(null===_)return{circular:!1,value:null};const m=_.circular;let h=m||a.has(_.value);h&&s(t,u,d);let g=n.dereference(e,_.value);if(!h){const e=i(g,_.path,o,a,c,l,u,d);h=e.circular,g=e.value}h&&!m&&"ignore"===d.dereference.circular&&(g=e),m&&(g.$ref=o);const A={circular:h,value:g};return 1===Object.keys(e).length&&l.set(p,A),A}function s(t,n,r){if(n.circular=!0,n.circularRefs.push(t),!r.dereference.circular)throw e.reference(`Circular $ref pointer found at ${t}`);return!0}return dereference=function(e,t){const n=i(e.schema,e.$refs._root$Ref.path,"#",new Set,new Set,new Map,e.$refs,t);e.$refs.circular=n.circular,e.schema=n.value},dereference}function requireBinary$1(){if(hasRequiredBinary$1)return binary$1;hasRequiredBinary$1=1;const e=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;return binary$1={order:400,allowEmpty:!0,canParse:t=>Buffer.isBuffer(t.data)&&e.test(t.url),parse:e=>Buffer.isBuffer(e.data)?e.data:Buffer.from(e.data)},binary$1}function requireJson$2(){if(hasRequiredJson$2)return json$2;hasRequiredJson$2=1;const{ParserError:e}=requireErrors$1();return json$2={order:100,allowEmpty:!0,canParse:".json",async parse(t){let n=t.data;if(Buffer.isBuffer(n)&&(n=n.toString()),"string"==typeof n){if(0===n.trim().length)return;try{return JSON.parse(n)}catch(n){throw new e(n.message,t.url)}}return n}},json$2}function requireText(){if(hasRequiredText)return text;hasRequiredText=1;const{ParserError:e}=requireErrors$1(),t=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;return text={order:300,allowEmpty:!0,encoding:"utf8",canParse:e=>("string"==typeof e.data||Buffer.isBuffer(e.data))&&t.test(e.url),parse(t){if("string"==typeof t.data)return t.data;if(Buffer.isBuffer(t.data))return t.data.toString(this.encoding);throw new e("data is not text",t.url)}},text}var jsYaml={},loader={},common$1={},hasRequiredCommon$1,exception,hasRequiredException,snippet,hasRequiredSnippet,type$a,hasRequiredType,schema$1,hasRequiredSchema$1,str,hasRequiredStr,seq,hasRequiredSeq,map$1,hasRequiredMap$1,failsafe,hasRequiredFailsafe,_null,hasRequired_null,bool,hasRequiredBool,int,hasRequiredInt,float,hasRequiredFloat,json$1,hasRequiredJson$1,core$3,hasRequiredCore$3,timestamp,hasRequiredTimestamp,merge,hasRequiredMerge,binary,hasRequiredBinary,omap,hasRequiredOmap,pairs,hasRequiredPairs,set,hasRequiredSet,_default$1,hasRequired_default$1,hasRequiredLoader;function requireCommon$1(){if(hasRequiredCommon$1)return common$1;function e(e){return null==e}return hasRequiredCommon$1=1,common$1.isNothing=e,common$1.isObject=function(e){return"object"==typeof e&&null!==e},common$1.toArray=function(t){return Array.isArray(t)?t:e(t)?[]:[t]},common$1.repeat=function(e,t){var n,r="";for(n=0;n<t;n+=1)r+=e;return r},common$1.isNegativeZero=function(e){return 0===e&&Number.NEGATIVE_INFINITY===1/e},common$1.extend=function(e,t){var n,r,i,o;if(t)for(n=0,r=(o=Object.keys(t)).length;n<r;n+=1)e[i=o[n]]=t[i];return e},common$1}function requireException(){if(hasRequiredException)return exception;function e(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+="\n\n"+e.mark.snippet),r+" "+n):r}function t(t,n){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=n,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}return hasRequiredException=1,t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(t){return this.name+": "+e(this,t)},exception=t}function requireSnippet(){if(hasRequiredSnippet)return snippet;hasRequiredSnippet=1;var e=requireCommon$1();function t(e,t,n,r,i){var o="",s="",a=Math.floor(i/2)-1;return r-t>a&&(t=r-a+(o=" ... ").length),n-r>a&&(n=r+a-(s=" ...").length),{str:o+e.slice(t,n).replace(/\t/g,"→")+s,pos:r-t+o.length}}function n(t,n){return e.repeat(" ",n-t.length)+t}return snippet=function(r,i){if(i=Object.create(i||null),!r.buffer)return null;i.maxLength||(i.maxLength=79),"number"!=typeof i.indent&&(i.indent=1),"number"!=typeof i.linesBefore&&(i.linesBefore=3),"number"!=typeof i.linesAfter&&(i.linesAfter=2);for(var o,s=/\r?\n|\r|\0/g,a=[0],c=[],l=-1;o=s.exec(r.buffer);)c.push(o.index),a.push(o.index+o[0].length),r.position<=o.index&&l<0&&(l=a.length-2);l<0&&(l=a.length-1);var u,d,p="",f=Math.min(r.line+i.linesAfter,c.length).toString().length,_=i.maxLength-(i.indent+f+3);for(u=1;u<=i.linesBefore&&!(l-u<0);u++)d=t(r.buffer,a[l-u],c[l-u],r.position-(a[l]-a[l-u]),_),p=e.repeat(" ",i.indent)+n((r.line-u+1).toString(),f)+" | "+d.str+"\n"+p;for(d=t(r.buffer,a[l],c[l],r.position,_),p+=e.repeat(" ",i.indent)+n((r.line+1).toString(),f)+" | "+d.str+"\n",p+=e.repeat("-",i.indent+f+3+d.pos)+"^\n",u=1;u<=i.linesAfter&&!(l+u>=c.length);u++)d=t(r.buffer,a[l+u],c[l+u],r.position-(a[l]-a[l+u]),_),p+=e.repeat(" ",i.indent)+n((r.line+u+1).toString(),f)+" | "+d.str+"\n";return p.replace(/\n$/,"")},snippet}function requireType(){if(hasRequiredType)return type$a;hasRequiredType=1;var e=requireException(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],n=["scalar","sequence","mapping"];return type$a=function(r,i){if(i=i||{},Object.keys(i).forEach((function(n){if(-1===t.indexOf(n))throw new e('Unknown option "'+n+'" is met in definition of "'+r+'" YAML type.')})),this.options=i,this.tag=r,this.kind=i.kind||null,this.resolve=i.resolve||function(){return!0},this.construct=i.construct||function(e){return e},this.instanceOf=i.instanceOf||null,this.predicate=i.predicate||null,this.represent=i.represent||null,this.representName=i.representName||null,this.defaultStyle=i.defaultStyle||null,this.multi=i.multi||!1,this.styleAliases=function(e){var t={};return null!==e&&Object.keys(e).forEach((function(n){e[n].forEach((function(e){t[String(e)]=n}))})),t}(i.styleAliases||null),-1===n.indexOf(this.kind))throw new e('Unknown kind "'+this.kind+'" is specified for "'+r+'" YAML type.')},type$a}function requireSchema$1(){if(hasRequiredSchema$1)return schema$1;hasRequiredSchema$1=1;var e=requireException(),t=requireType();function n(e,t){var n=[];return e[t].forEach((function(e){var t=n.length;n.forEach((function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)})),n[t]=e})),n}function r(e){return this.extend(e)}return r.prototype.extend=function(i){var o=[],s=[];if(i instanceof t)s.push(i);else if(Array.isArray(i))s=s.concat(i);else{if(!i||!Array.isArray(i.implicit)&&!Array.isArray(i.explicit))throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.implicit&&(o=o.concat(i.implicit)),i.explicit&&(s=s.concat(i.explicit))}o.forEach((function(n){if(!(n instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(n.loadKind&&"scalar"!==n.loadKind)throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(n.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")})),s.forEach((function(n){if(!(n instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")}));var a=Object.create(r.prototype);return a.implicit=(this.implicit||[]).concat(o),a.explicit=(this.explicit||[]).concat(s),a.compiledImplicit=n(a,"implicit"),a.compiledExplicit=n(a,"explicit"),a.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function r(e){e.multi?(n.multi[e.kind].push(e),n.multi.fallback.push(e)):n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}(a.compiledImplicit,a.compiledExplicit),a},schema$1=r}function requireStr(){if(hasRequiredStr)return str;hasRequiredStr=1;var e=requireType();return str=new e("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return null!==e?e:""}})}function requireSeq(){if(hasRequiredSeq)return seq;hasRequiredSeq=1;var e=requireType();return seq=new e("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return null!==e?e:[]}})}function requireMap$1(){if(hasRequiredMap$1)return map$1;hasRequiredMap$1=1;var e=requireType();return map$1=new e("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return null!==e?e:{}}})}function requireFailsafe(){if(hasRequiredFailsafe)return failsafe;hasRequiredFailsafe=1;var e=requireSchema$1();return failsafe=new e({explicit:[requireStr(),requireSeq(),requireMap$1()]})}function require_null(){if(hasRequired_null)return _null;hasRequired_null=1;var e=requireType();return _null=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:function(e){if(null===e)return!0;var t=e.length;return 1===t&&"~"===e||4===t&&("null"===e||"Null"===e||"NULL"===e)},construct:function(){return null},predicate:function(e){return null===e},represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),_null}function requireBool(){if(hasRequiredBool)return bool;hasRequiredBool=1;var e=requireType();return bool=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"}),bool}function requireInt(){if(hasRequiredInt)return int;hasRequiredInt=1;var e=requireCommon$1(),t=requireType();function n(e){return 48<=e&&e<=55}function r(e){return 48<=e&&e<=57}return int=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,i,o=e.length,s=0,a=!1;if(!o)return!1;if("-"!==(t=e[s])&&"+"!==t||(t=e[++s]),"0"===t){if(s+1===o)return!0;if("b"===(t=e[++s])){for(s++;s<o;s++)if("_"!==(t=e[s])){if("0"!==t&&"1"!==t)return!1;a=!0}return a&&"_"!==t}if("x"===t){for(s++;s<o;s++)if("_"!==(t=e[s])){if(!(48<=(i=e.charCodeAt(s))&&i<=57||65<=i&&i<=70||97<=i&&i<=102))return!1;a=!0}return a&&"_"!==t}if("o"===t){for(s++;s<o;s++)if("_"!==(t=e[s])){if(!n(e.charCodeAt(s)))return!1;a=!0}return a&&"_"!==t}}if("_"===t)return!1;for(;s<o;s++)if("_"!==(t=e[s])){if(!r(e.charCodeAt(s)))return!1;a=!0}return!(!a||"_"===t)},construct:function(e){var t,n=e,r=1;if(-1!==n.indexOf("_")&&(n=n.replace(/_/g,"")),"-"!==(t=n[0])&&"+"!==t||("-"===t&&(r=-1),t=(n=n.slice(1))[0]),"0"===n)return 0;if("0"===t){if("b"===n[1])return r*parseInt(n.slice(2),2);if("x"===n[1])return r*parseInt(n.slice(2),16);if("o"===n[1])return r*parseInt(n.slice(2),8)}return r*parseInt(n,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&t%1==0&&!e.isNegativeZero(t)},represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),int}function requireFloat(){if(hasRequiredFloat)return float;hasRequiredFloat=1;var e=requireCommon$1(),t=requireType(),n=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var r=/^[-+]?[0-9]+e/;return float=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!n.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n;return n="-"===(t=e.replace(/_/g,"").toLowerCase())[0]?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),".inf"===t?1===n?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===t?NaN:n*parseFloat(t,10)},predicate:function(t){return"[object Number]"===Object.prototype.toString.call(t)&&(t%1!=0||e.isNegativeZero(t))},represent:function(t,n){var i;if(isNaN(t))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(t))return"-0.0";return i=t.toString(10),r.test(i)?i.replace("e",".e"):i},defaultStyle:"lowercase"}),float}function requireJson$1(){return hasRequiredJson$1?json$1:(hasRequiredJson$1=1,json$1=requireFailsafe().extend({implicit:[require_null(),requireBool(),requireInt(),requireFloat()]}))}function requireCore$3(){return hasRequiredCore$3?core$3:(hasRequiredCore$3=1,core$3=requireJson$1())}function requireTimestamp(){if(hasRequiredTimestamp)return timestamp;hasRequiredTimestamp=1;var e=requireType(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),n=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");return timestamp=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:function(e){return null!==e&&(null!==t.exec(e)||null!==n.exec(e))},construct:function(e){var r,i,o,s,a,c,l,u,d=0,p=null;if(null===(r=t.exec(e))&&(r=n.exec(e)),null===r)throw new Error("Date resolve error");if(i=+r[1],o=+r[2]-1,s=+r[3],!r[4])return new Date(Date.UTC(i,o,s));if(a=+r[4],c=+r[5],l=+r[6],r[7]){for(d=r[7].slice(0,3);d.length<3;)d+="0";d=+d}return r[9]&&(p=6e4*(60*+r[10]+ +(r[11]||0)),"-"===r[9]&&(p=-p)),u=new Date(Date.UTC(i,o,s,a,c,l,d)),p&&u.setTime(u.getTime()-p),u},instanceOf:Date,represent:function(e){return e.toISOString()}}),timestamp}function requireMerge(){if(hasRequiredMerge)return merge;hasRequiredMerge=1;var e=requireType();return merge=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:function(e){return"<<"===e||null===e}})}function requireBinary(){if(hasRequiredBinary)return binary;hasRequiredBinary=1;var e=requireType(),t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r";return binary=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:function(e){if(null===e)return!1;var n,r,i=0,o=e.length,s=t;for(r=0;r<o;r++)if(!((n=s.indexOf(e.charAt(r)))>64)){if(n<0)return!1;i+=6}return i%8==0},construct:function(e){var n,r,i=e.replace(/[\r\n=]/g,""),o=i.length,s=t,a=0,c=[];for(n=0;n<o;n++)n%4==0&&n&&(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)),a=a<<6|s.indexOf(i.charAt(n));return 0===(r=o%4*6)?(c.push(a>>16&255),c.push(a>>8&255),c.push(255&a)):18===r?(c.push(a>>10&255),c.push(a>>2&255)):12===r&&c.push(a>>4&255),new Uint8Array(c)},predicate:function(e){return"[object Uint8Array]"===Object.prototype.toString.call(e)},represent:function(e){var n,r,i="",o=0,s=e.length,a=t;for(n=0;n<s;n++)n%3==0&&n&&(i+=a[o>>18&63],i+=a[o>>12&63],i+=a[o>>6&63],i+=a[63&o]),o=(o<<8)+e[n];return 0===(r=s%3)?(i+=a[o>>18&63],i+=a[o>>12&63],i+=a[o>>6&63],i+=a[63&o]):2===r?(i+=a[o>>10&63],i+=a[o>>4&63],i+=a[o<<2&63],i+=a[64]):1===r&&(i+=a[o>>2&63],i+=a[o<<4&63],i+=a[64],i+=a[64]),i}}),binary}function requireOmap(){if(hasRequiredOmap)return omap;hasRequiredOmap=1;var e=requireType(),t=Object.prototype.hasOwnProperty,n=Object.prototype.toString;return omap=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:function(e){if(null===e)return!0;var r,i,o,s,a,c=[],l=e;for(r=0,i=l.length;r<i;r+=1){if(o=l[r],a=!1,"[object Object]"!==n.call(o))return!1;for(s in o)if(t.call(o,s)){if(a)return!1;a=!0}if(!a)return!1;if(-1!==c.indexOf(s))return!1;c.push(s)}return!0},construct:function(e){return null!==e?e:[]}}),omap}function requirePairs(){if(hasRequiredPairs)return pairs;hasRequiredPairs=1;var e=requireType(),t=Object.prototype.toString;return pairs=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:function(e){if(null===e)return!0;var n,r,i,o,s,a=e;for(s=new Array(a.length),n=0,r=a.length;n<r;n+=1){if(i=a[n],"[object Object]"!==t.call(i))return!1;if(1!==(o=Object.keys(i)).length)return!1;s[n]=[o[0],i[o[0]]]}return!0},construct:function(e){if(null===e)return[];var t,n,r,i,o,s=e;for(o=new Array(s.length),t=0,n=s.length;t<n;t+=1)r=s[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}}),pairs}function requireSet(){if(hasRequiredSet)return set;hasRequiredSet=1;var e=requireType(),t=Object.prototype.hasOwnProperty;return set=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:function(e){if(null===e)return!0;var n,r=e;for(n in r)if(t.call(r,n)&&null!==r[n])return!1;return!0},construct:function(e){return null!==e?e:{}}})}function require_default$1(){return hasRequired_default$1?_default$1:(hasRequired_default$1=1,_default$1=requireCore$3().extend({implicit:[requireTimestamp(),requireMerge()],explicit:[requireBinary(),requireOmap(),requirePairs(),requireSet()]}))}function requireLoader(){if(hasRequiredLoader)return loader;hasRequiredLoader=1;var e=requireCommon$1(),t=requireException(),n=requireSnippet(),r=require_default$1(),i=Object.prototype.hasOwnProperty,o=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,s=/[\x85\u2028\u2029]/,a=/[,\[\]\{\}]/,c=/^(?:!|!!|![a-z\-]+!)$/i,l=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function u(e){return Object.prototype.toString.call(e)}function d(e){return 10===e||13===e}function p(e){return 9===e||32===e}function f(e){return 9===e||32===e||10===e||13===e}function _(e){return 44===e||91===e||93===e||123===e||125===e}function m(e){var t;return 48<=e&&e<=57?e-48:97<=(t=32|e)&&t<=102?t-97+10:-1}function h(e){return 48===e?"\0":97===e?"":98===e?"\b":116===e||9===e?"\t":110===e?"\n":118===e?"\v":102===e?"\f":114===e?"\r":101===e?"":32===e?" ":34===e?'"':47===e?"/":92===e?"\\":78===e?"…":95===e?" ":76===e?"\u2028":80===e?"\u2029":""}function g(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(55296+(e-65536>>10),56320+(e-65536&1023))}for(var A=new Array(256),y=new Array(256),v=0;v<256;v++)A[v]=h(v)?1:0,y[v]=h(v);function b(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||r,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function C(e,r){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=n(i),new t(r,i)}function E(e,t){throw C(e,t)}function x(e,t){e.onWarning&&e.onWarning.call(null,C(e,t))}var S={YAML:function(e,t,n){var r,i,o;null!==e.version&&E(e,"duplication of %YAML directive"),1!==n.length&&E(e,"YAML directive accepts exactly one argument"),null===(r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]))&&E(e,"ill-formed argument of the YAML directive"),i=parseInt(r[1],10),o=parseInt(r[2],10),1!==i&&E(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=o<2,1!==o&&2!==o&&x(e,"unsupported YAML version of the document")},TAG:function(e,t,n){var r,o;2!==n.length&&E(e,"TAG directive accepts exactly two arguments"),r=n[0],o=n[1],c.test(r)||E(e,"ill-formed tag handle (first argument) of the TAG directive"),i.call(e.tagMap,r)&&E(e,'there is a previously declared suffix for "'+r+'" tag handle'),l.test(o)||E(e,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch(t){E(e,"tag prefix is malformed: "+o)}e.tagMap[r]=o}};function k(e,t,n,r){var i,s,a,c;if(t<n){if(c=e.input.slice(t,n),r)for(i=0,s=c.length;i<s;i+=1)9===(a=c.charCodeAt(i))||32<=a&&a<=1114111||E(e,"expected valid JSON character");else o.test(c)&&E(e,"the stream contains non-printable characters");e.result+=c}}function D(t,n,r,o){var s,a,c,l;for(e.isObject(r)||E(t,"cannot merge mappings; the provided source object is unacceptable"),c=0,l=(s=Object.keys(r)).length;c<l;c+=1)a=s[c],i.call(n,a)||(n[a]=r[a],o[a]=!0)}function w(e,t,n,r,o,s,a,c,l){var d,p;if(Array.isArray(o))for(d=0,p=(o=Array.prototype.slice.call(o)).length;d<p;d+=1)Array.isArray(o[d])&&E(e,"nested arrays are not supported inside keys"),"object"==typeof o&&"[object Object]"===u(o[d])&&(o[d]="[object Object]");if("object"==typeof o&&"[object Object]"===u(o)&&(o="[object Object]"),o=String(o),null===t&&(t={}),"tag:yaml.org,2002:merge"===r)if(Array.isArray(s))for(d=0,p=s.length;d<p;d+=1)D(e,t,s[d],n);else D(e,t,s,n);else e.json||i.call(n,o)||!i.call(t,o)||(e.line=a||e.line,e.lineStart=c||e.lineStart,e.position=l||e.position,E(e,"duplicated mapping key")),"__proto__"===o?Object.defineProperty(t,o,{configurable:!0,enumerable:!0,writable:!0,value:s}):t[o]=s,delete n[o];return t}function I(e){var t;10===(t=e.input.charCodeAt(e.position))?e.position++:13===t?(e.position++,10===e.input.charCodeAt(e.position)&&e.position++):E(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function T(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);0!==i;){for(;p(i);)9===i&&-1===e.firstTabInLine&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&35===i)do{i=e.input.charCodeAt(++e.position)}while(10!==i&&13!==i&&0!==i);if(!d(i))break;for(I(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;32===i;)e.lineIndent++,i=e.input.charCodeAt(++e.position)}return-1!==n&&0!==r&&e.lineIndent<n&&x(e,"deficient indentation"),r}function F(e){var t,n=e.position;return!(45!==(t=e.input.charCodeAt(n))&&46!==t||t!==e.input.charCodeAt(n+1)||t!==e.input.charCodeAt(n+2)||(n+=3,0!==(t=e.input.charCodeAt(n))&&!f(t)))}function R(t,n){1===n?t.result+=" ":n>1&&(t.result+=e.repeat("\n",n-1))}function P(e,t){var n,r,i=e.tag,o=e.anchor,s=[],a=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=s),r=e.input.charCodeAt(e.position);0!==r&&(-1!==e.firstTabInLine&&(e.position=e.firstTabInLine,E(e,"tab characters must not be used in indentation")),45===r)&&f(e.input.charCodeAt(e.position+1));)if(a=!0,e.position++,T(e,!0,-1)&&e.lineIndent<=t)s.push(null),r=e.input.charCodeAt(e.position);else if(n=e.line,O(e,t,3,!1,!0),s.push(e.result),T(e,!0,-1),r=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==r)E(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break;return!!a&&(e.tag=i,e.anchor=o,e.kind="sequence",e.result=s,!0)}function N(e){var t,n,r,o,s=!1,u=!1;if(33!==(o=e.input.charCodeAt(e.position)))return!1;if(null!==e.tag&&E(e,"duplication of a tag property"),60===(o=e.input.charCodeAt(++e.position))?(s=!0,o=e.input.charCodeAt(++e.position)):33===o?(u=!0,n="!!",o=e.input.charCodeAt(++e.position)):n="!",t=e.position,s){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&62!==o);e.position<e.length?(r=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):E(e,"unexpected end of the stream within a verbatim tag")}else{for(;0!==o&&!f(o);)33===o&&(u?E(e,"tag suffix cannot contain exclamation marks"):(n=e.input.slice(t-1,e.position+1),c.test(n)||E(e,"named tag handle cannot contain such characters"),u=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);r=e.input.slice(t,e.position),a.test(r)&&E(e,"tag suffix cannot contain flow indicator characters")}r&&!l.test(r)&&E(e,"tag name cannot contain such characters: "+r);try{r=decodeURIComponent(r)}catch(t){E(e,"tag name is malformed: "+r)}return s?e.tag=r:i.call(e.tagMap,n)?e.tag=e.tagMap[n]+r:"!"===n?e.tag="!"+r:"!!"===n?e.tag="tag:yaml.org,2002:"+r:E(e,'undeclared tag handle "'+n+'"'),!0}function B(e){var t,n;if(38!==(n=e.input.charCodeAt(e.position)))return!1;for(null!==e.anchor&&E(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;0!==n&&!f(n)&&!_(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&E(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function O(t,n,r,o,s){var a,c,l,u,h,v,b,C,x,S=1,D=!1,q=!1;if(null!==t.listener&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,a=c=l=4===r||3===r,o&&T(t,!0,-1)&&(D=!0,t.lineIndent>n?S=1:t.lineIndent===n?S=0:t.lineIndent<n&&(S=-1)),1===S)for(;N(t)||B(t);)T(t,!0,-1)?(D=!0,l=a,t.lineIndent>n?S=1:t.lineIndent===n?S=0:t.lineIndent<n&&(S=-1)):l=!1;if(l&&(l=D||s),1!==S&&4!==r||(C=1===r||2===r?n:n+1,x=t.position-t.lineStart,1===S?l&&(P(t,x)||function(e,t,n){var r,i,o,s,a,c,l,u=e.tag,d=e.anchor,_={},m=Object.create(null),h=null,g=null,A=null,y=!1,v=!1;if(-1!==e.firstTabInLine)return!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=_),l=e.input.charCodeAt(e.position);0!==l;){if(y||-1===e.firstTabInLine||(e.position=e.firstTabInLine,E(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,63!==l&&58!==l||!f(r)){if(s=e.line,a=e.lineStart,c=e.position,!O(e,n,2,!1,!0))break;if(e.line===o){for(l=e.input.charCodeAt(e.position);p(l);)l=e.input.charCodeAt(++e.position);if(58===l)f(l=e.input.charCodeAt(++e.position))||E(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(w(e,_,m,h,g,null,s,a,c),h=g=A=null),v=!0,y=!1,i=!1,h=e.tag,g=e.result;else{if(!v)return e.tag=u,e.anchor=d,!0;E(e,"can not read an implicit mapping pair; a colon is missed")}}else{if(!v)return e.tag=u,e.anchor=d,!0;E(e,"can not read a block mapping entry; a multiline key may not be an implicit key")}}else 63===l?(y&&(w(e,_,m,h,g,null,s,a,c),h=g=A=null),v=!0,y=!0,i=!0):y?(y=!1,i=!0):E(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,l=r;if((e.line===o||e.lineIndent>t)&&(y&&(s=e.line,a=e.lineStart,c=e.position),O(e,t,4,!0,i)&&(y?g=e.result:A=e.result),y||(w(e,_,m,h,g,A,s,a,c),h=g=A=null),T(e,!0,-1),l=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&0!==l)E(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return y&&w(e,_,m,h,g,null,s,a,c),v&&(e.tag=u,e.anchor=d,e.kind="mapping",e.result=_),v}(t,x,C))||function(e,t){var n,r,i,o,s,a,c,l,u,d,p,_,m=!0,h=e.tag,g=e.anchor,A=Object.create(null);if(91===(_=e.input.charCodeAt(e.position)))s=93,l=!1,o=[];else{if(123!==_)return!1;s=125,l=!0,o={}}for(null!==e.anchor&&(e.anchorMap[e.anchor]=o),_=e.input.charCodeAt(++e.position);0!==_;){if(T(e,!0,t),(_=e.input.charCodeAt(e.position))===s)return e.position++,e.tag=h,e.anchor=g,e.kind=l?"mapping":"sequence",e.result=o,!0;m?44===_&&E(e,"expected the node content, but found ','"):E(e,"missed comma between flow collection entries"),p=null,a=c=!1,63===_&&f(e.input.charCodeAt(e.position+1))&&(a=c=!0,e.position++,T(e,!0,t)),n=e.line,r=e.lineStart,i=e.position,O(e,t,1,!1,!0),d=e.tag,u=e.result,T(e,!0,t),_=e.input.charCodeAt(e.position),!c&&e.line!==n||58!==_||(a=!0,_=e.input.charCodeAt(++e.position),T(e,!0,t),O(e,t,1,!1,!0),p=e.result),l?w(e,o,A,d,u,p,n,r,i):a?o.push(w(e,null,A,d,u,p,n,r,i)):o.push(u),T(e,!0,t),44===(_=e.input.charCodeAt(e.position))?(m=!0,_=e.input.charCodeAt(++e.position)):m=!1}E(e,"unexpected end of the stream within a flow collection")}(t,C)?q=!0:(c&&function(t,n){var r,i,o,s,a,c=1,l=!1,u=!1,f=n,_=0,m=!1;if(124===(s=t.input.charCodeAt(t.position)))i=!1;else{if(62!==s)return!1;i=!0}for(t.kind="scalar",t.result="";0!==s;)if(43===(s=t.input.charCodeAt(++t.position))||45===s)1===c?c=43===s?3:2:E(t,"repeat of a chomping mode identifier");else{if(!((o=48<=(a=s)&&a<=57?a-48:-1)>=0))break;0===o?E(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):u?E(t,"repeat of an indentation width identifier"):(f=n+o-1,u=!0)}if(p(s)){do{s=t.input.charCodeAt(++t.position)}while(p(s));if(35===s)do{s=t.input.charCodeAt(++t.position)}while(!d(s)&&0!==s)}for(;0!==s;){for(I(t),t.lineIndent=0,s=t.input.charCodeAt(t.position);(!u||t.lineIndent<f)&&32===s;)t.lineIndent++,s=t.input.charCodeAt(++t.position);if(!u&&t.lineIndent>f&&(f=t.lineIndent),d(s))_++;else{if(t.lineIndent<f){3===c?t.result+=e.repeat("\n",l?1+_:_):1===c&&l&&(t.result+="\n");break}for(i?p(s)?(m=!0,t.result+=e.repeat("\n",l?1+_:_)):m?(m=!1,t.result+=e.repeat("\n",_+1)):0===_?l&&(t.result+=" "):t.result+=e.repeat("\n",_):t.result+=e.repeat("\n",l?1+_:_),l=!0,u=!0,_=0,r=t.position;!d(s)&&0!==s;)s=t.input.charCodeAt(++t.position);k(t,r,t.position,!1)}}return!0}(t,C)||function(e,t){var n,r,i;if(39!==(n=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;0!==(n=e.input.charCodeAt(e.position));)if(39===n){if(k(e,r,e.position,!0),39!==(n=e.input.charCodeAt(++e.position)))return!0;r=e.position,e.position++,i=e.position}else d(n)?(k(e,r,i,!0),R(e,T(e,!1,t)),r=i=e.position):e.position===e.lineStart&&F(e)?E(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);E(e,"unexpected end of the stream within a single quoted scalar")}(t,C)||function(e,t){var n,r,i,o,s,a,c;if(34!==(a=e.input.charCodeAt(e.position)))return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;0!==(a=e.input.charCodeAt(e.position));){if(34===a)return k(e,n,e.position,!0),e.position++,!0;if(92===a){if(k(e,n,e.position,!0),d(a=e.input.charCodeAt(++e.position)))T(e,!1,t);else if(a<256&&A[a])e.result+=y[a],e.position++;else if((s=120===(c=a)?2:117===c?4:85===c?8:0)>0){for(i=s,o=0;i>0;i--)(s=m(a=e.input.charCodeAt(++e.position)))>=0?o=(o<<4)+s:E(e,"expected hexadecimal character");e.result+=g(o),e.position++}else E(e,"unknown escape sequence");n=r=e.position}else d(a)?(k(e,n,r,!0),R(e,T(e,!1,t)),n=r=e.position):e.position===e.lineStart&&F(e)?E(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}E(e,"unexpected end of the stream within a double quoted scalar")}(t,C)?q=!0:!function(e){var t,n,r;if(42!==(r=e.input.charCodeAt(e.position)))return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;0!==r&&!f(r)&&!_(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&E(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),i.call(e.anchorMap,n)||E(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],T(e,!0,-1),!0}(t)?function(e,t,n){var r,i,o,s,a,c,l,u,m=e.kind,h=e.result;if(f(u=e.input.charCodeAt(e.position))||_(u)||35===u||38===u||42===u||33===u||124===u||62===u||39===u||34===u||37===u||64===u||96===u)return!1;if((63===u||45===u)&&(f(r=e.input.charCodeAt(e.position+1))||n&&_(r)))return!1;for(e.kind="scalar",e.result="",i=o=e.position,s=!1;0!==u;){if(58===u){if(f(r=e.input.charCodeAt(e.position+1))||n&&_(r))break}else if(35===u){if(f(e.input.charCodeAt(e.position-1)))break}else{if(e.position===e.lineStart&&F(e)||n&&_(u))break;if(d(u)){if(a=e.line,c=e.lineStart,l=e.lineIndent,T(e,!1,-1),e.lineIndent>=t){s=!0,u=e.input.charCodeAt(e.position);continue}e.position=o,e.line=a,e.lineStart=c,e.lineIndent=l;break}}s&&(k(e,i,o,!1),R(e,e.line-a),i=o=e.position,s=!1),p(u)||(o=e.position+1),u=e.input.charCodeAt(++e.position)}return k(e,i,o,!1),!!e.result||(e.kind=m,e.result=h,!1)}(t,C,1===r)&&(q=!0,null===t.tag&&(t.tag="?")):(q=!0,null===t.tag&&null===t.anchor||E(t,"alias node should not have any properties")),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):0===S&&(q=l&&P(t,x))),null===t.tag)null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);else if("?"===t.tag){for(null!==t.result&&"scalar"!==t.kind&&E(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),u=0,h=t.implicitTypes.length;u<h;u+=1)if((b=t.implicitTypes[u]).resolve(t.result)){t.result=b.construct(t.result),t.tag=b.tag,null!==t.anchor&&(t.anchorMap[t.anchor]=t.result);break}}else if("!"!==t.tag){if(i.call(t.typeMap[t.kind||"fallback"],t.tag))b=t.typeMap[t.kind||"fallback"][t.tag];else for(b=null,u=0,h=(v=t.typeMap.multi[t.kind||"fallback"]).length;u<h;u+=1)if(t.tag.slice(0,v[u].tag.length)===v[u].tag){b=v[u];break}b||E(t,"unknown tag !<"+t.tag+">"),null!==t.result&&b.kind!==t.kind&&E(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+b.kind+'", not "'+t.kind+'"'),b.resolve(t.result,t.tag)?(t.result=b.construct(t.result,t.tag),null!==t.anchor&&(t.anchorMap[t.anchor]=t.result)):E(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return null!==t.listener&&t.listener("close",t),null!==t.tag||null!==t.anchor||q}function q(e){var t,n,r,o,a=e.position,c=!1;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);0!==(o=e.input.charCodeAt(e.position))&&(T(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||37!==o));){for(c=!0,o=e.input.charCodeAt(++e.position),t=e.position;0!==o&&!f(o);)o=e.input.charCodeAt(++e.position);for(r=[],(n=e.input.slice(t,e.position)).length<1&&E(e,"directive name must not be less than one character in length");0!==o;){for(;p(o);)o=e.input.charCodeAt(++e.position);if(35===o){do{o=e.input.charCodeAt(++e.position)}while(0!==o&&!d(o));break}if(d(o))break;for(t=e.position;0!==o&&!f(o);)o=e.input.charCodeAt(++e.position);r.push(e.input.slice(t,e.position))}0!==o&&I(e),i.call(S,n)?S[n](e,n,r):x(e,'unknown document directive "'+n+'"')}T(e,!0,-1),0===e.lineIndent&&45===e.input.charCodeAt(e.position)&&45===e.input.charCodeAt(e.position+1)&&45===e.input.charCodeAt(e.position+2)?(e.position+=3,T(e,!0,-1)):c&&E(e,"directives end mark is expected"),O(e,e.lineIndent-1,4,!1,!0),T(e,!0,-1),e.checkLineBreaks&&s.test(e.input.slice(a,e.position))&&x(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&F(e)?46===e.input.charCodeAt(e.position)&&(e.position+=3,T(e,!0,-1)):e.position<e.length-1&&E(e,"end of the stream or a document separator is expected")}function $(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new b(e,t),r=e.indexOf("\0");for(-1!==r&&(n.position=r,E(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)q(n);return n.documents}return loader.loadAll=function(e,t,n){null!==t&&"object"==typeof t&&void 0===n&&(n=t,t=null);var r=$(e,n);if("function"!=typeof t)return r;for(var i=0,o=r.length;i<o;i+=1)t(r[i])},loader.load=function(e,n){var r=$(e,n);if(0!==r.length){if(1===r.length)return r[0];throw new t("expected a single document in the stream, but found more")}},loader}var dumper={},hasRequiredDumper,hasRequiredJsYaml,yaml_1,hasRequiredYaml$1,file,hasRequiredFile,http_1$1,hasRequiredHttp$1,options$1,hasRequiredOptions$1,normalizeArgs,hasRequiredNormalizeArgs;function requireDumper(){if(hasRequiredDumper)return dumper;hasRequiredDumper=1;var e=requireCommon$1(),t=requireException(),n=require_default$1(),r=Object.prototype.toString,i=Object.prototype.hasOwnProperty,o=65279,s={0:"\\0",7:"\\a",8:"\\b",9:"\\t",10:"\\n",11:"\\v",12:"\\f",13:"\\r",27:"\\e",34:'\\"',92:"\\\\",133:"\\N",160:"\\_",8232:"\\L",8233:"\\P"},a=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],c=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function l(n){var r,i,o;if(r=n.toString(16).toUpperCase(),n<=255)i="x",o=2;else if(n<=65535)i="u",o=4;else{if(!(n<=4294967295))throw new t("code point within a string may not be greater than 0xFFFFFFFF");i="U",o=8}return"\\"+i+e.repeat("0",o-r.length)+r}function u(t){this.schema=t.schema||n,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=e.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=function(e,t){var n,r,o,s,a,c,l;if(null===t)return{};for(n={},o=0,s=(r=Object.keys(t)).length;o<s;o+=1)a=r[o],c=String(t[a]),"!!"===a.slice(0,2)&&(a="tag:yaml.org,2002:"+a.slice(2)),(l=e.compiledTypeMap.fallback[a])&&i.call(l.styleAliases,c)&&(c=l.styleAliases[c]),n[a]=c;return n}(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType='"'===t.quotingType?2:1,this.forceQuotes=t.forceQuotes||!1,this.replacer="function"==typeof t.replacer?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function d(t,n){for(var r,i=e.repeat(" ",n),o=0,s=-1,a="",c=t.length;o<c;)-1===(s=t.indexOf("\n",o))?(r=t.slice(o),o=c):(r=t.slice(o,s+1),o=s+1),r.length&&"\n"!==r&&(a+=i),a+=r;return a}function p(t,n){return"\n"+e.repeat(" ",t.indent*n)}function f(e){return 32===e||9===e}function _(e){return 32<=e&&e<=126||161<=e&&e<=55295&&8232!==e&&8233!==e||57344<=e&&e<=65533&&e!==o||65536<=e&&e<=1114111}function m(e){return _(e)&&e!==o&&13!==e&&10!==e}function h(e,t,n){var r=m(e),i=r&&!f(e);return(n?r:r&&44!==e&&91!==e&&93!==e&&123!==e&&125!==e)&&35!==e&&!(58===t&&!i)||m(t)&&!f(t)&&35===e||58===t&&i}function g(e,t){var n,r=e.charCodeAt(t);return r>=55296&&r<=56319&&t+1<e.length&&(n=e.charCodeAt(t+1))>=56320&&n<=57343?1024*(r-55296)+n-56320+65536:r}function A(e){return/^\n* /.test(e)}function y(e,t,n,r,i,s,a,c){var l,u,d=0,p=null,m=!1,y=!1,v=-1!==r,b=-1,C=_(u=g(e,0))&&u!==o&&!f(u)&&45!==u&&63!==u&&58!==u&&44!==u&&91!==u&&93!==u&&123!==u&&125!==u&&35!==u&&38!==u&&42!==u&&33!==u&&124!==u&&61!==u&&62!==u&&39!==u&&34!==u&&37!==u&&64!==u&&96!==u&&function(e){return!f(e)&&58!==e}(g(e,e.length-1));if(t||a)for(l=0;l<e.length;d>=65536?l+=2:l++){if(!_(d=g(e,l)))return 5;C=C&&h(d,p,c),p=d}else{for(l=0;l<e.length;d>=65536?l+=2:l++){if(10===(d=g(e,l)))m=!0,v&&(y=y||l-b-1>r&&" "!==e[b+1],b=l);else if(!_(d))return 5;C=C&&h(d,p,c),p=d}y=y||v&&l-b-1>r&&" "!==e[b+1]}return m||y?n>9&&A(e)?5:a?2===s?5:2:y?4:3:!C||a||i(e)?2===s?5:2:1}function v(e,n,r,i,o){e.dump=function(){if(0===n.length)return 2===e.quotingType?'""':"''";if(!e.noCompatMode&&(-1!==a.indexOf(n)||c.test(n)))return 2===e.quotingType?'"'+n+'"':"'"+n+"'";var u=e.indent*Math.max(1,r),p=-1===e.lineWidth?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-u),f=i||e.flowLevel>-1&&r>=e.flowLevel;switch(y(n,f,e.indent,p,(function(t){return function(e,t){var n,r;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(e.implicitTypes[n].resolve(t))return!0;return!1}(e,t)}),e.quotingType,e.forceQuotes&&!i,o)){case 1:return n;case 2:return"'"+n.replace(/'/g,"''")+"'";case 3:return"|"+b(n,e.indent)+C(d(n,u));case 4:return">"+b(n,e.indent)+C(d(function(e,t){var n,r,i=/(\n+)([^\n]*)/g,o=(a=e.indexOf("\n"),a=-1!==a?a:e.length,i.lastIndex=a,E(e.slice(0,a),t)),s="\n"===e[0]||" "===e[0];var a;for(;r=i.exec(e);){var c=r[1],l=r[2];n=" "===l[0],o+=c+(s||n||""===l?"":"\n")+E(l,t),s=n}return o}(n,p),u));case 5:return'"'+function(e){for(var t,n="",r=0,i=0;i<e.length;r>=65536?i+=2:i++)r=g(e,i),!(t=s[r])&&_(r)?(n+=e[i],r>=65536&&(n+=e[i+1])):n+=t||l(r);return n}(n)+'"';default:throw new t("impossible error: invalid scalar style")}}()}function b(e,t){var n=A(e)?String(t):"",r="\n"===e[e.length-1];return n+(r&&("\n"===e[e.length-2]||"\n"===e)?"+":r?"":"-")+"\n"}function C(e){return"\n"===e[e.length-1]?e.slice(0,-1):e}function E(e,t){if(""===e||" "===e[0])return e;for(var n,r,i=/ [^ ]/g,o=0,s=0,a=0,c="";n=i.exec(e);)(a=n.index)-o>t&&(r=s>o?s:a,c+="\n"+e.slice(o,r),o=r+1),s=a;return c+="\n",e.length-o>t&&s>o?c+=e.slice(o,s)+"\n"+e.slice(s+1):c+=e.slice(o),c.slice(1)}function x(e,t,n,r){var i,o,s,a="",c=e.tag;for(i=0,o=n.length;i<o;i+=1)s=n[i],e.replacer&&(s=e.replacer.call(n,String(i),s)),(k(e,t+1,s,!0,!0,!1,!0)||void 0===s&&k(e,t+1,null,!0,!0,!1,!0))&&(r&&""===a||(a+=p(e,t)),e.dump&&10===e.dump.charCodeAt(0)?a+="-":a+="- ",a+=e.dump);e.tag=c,e.dump=a||"[]"}function S(e,n,o){var s,a,c,l,u,d;for(c=0,l=(a=o?e.explicitTypes:e.implicitTypes).length;c<l;c+=1)if(((u=a[c]).instanceOf||u.predicate)&&(!u.instanceOf||"object"==typeof n&&n instanceof u.instanceOf)&&(!u.predicate||u.predicate(n))){if(o?u.multi&&u.representName?e.tag=u.representName(n):e.tag=u.tag:e.tag="?",u.represent){if(d=e.styleMap[u.tag]||u.defaultStyle,"[object Function]"===r.call(u.represent))s=u.represent(n,d);else{if(!i.call(u.represent,d))throw new t("!<"+u.tag+'> tag resolver accepts not "'+d+'" style');s=u.represent[d](n,d)}e.dump=s}return!0}return!1}function k(e,n,i,o,s,a,c){e.tag=null,e.dump=i,S(e,i,!1)||S(e,i,!0);var l,u=r.call(e.dump),d=o;o&&(o=e.flowLevel<0||e.flowLevel>n);var f,_,m="[object Object]"===u||"[object Array]"===u;if(m&&(_=-1!==(f=e.duplicates.indexOf(i))),(null!==e.tag&&"?"!==e.tag||_||2!==e.indent&&n>0)&&(s=!1),_&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(m&&_&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),"[object Object]"===u)o&&0!==Object.keys(e.dump).length?(!function(e,n,r,i){var o,s,a,c,l,u,d="",f=e.tag,_=Object.keys(r);if(!0===e.sortKeys)_.sort();else if("function"==typeof e.sortKeys)_.sort(e.sortKeys);else if(e.sortKeys)throw new t("sortKeys must be a boolean or a function");for(o=0,s=_.length;o<s;o+=1)u="",i&&""===d||(u+=p(e,n)),c=r[a=_[o]],e.replacer&&(c=e.replacer.call(r,a,c)),k(e,n+1,a,!0,!0,!0)&&((l=null!==e.tag&&"?"!==e.tag||e.dump&&e.dump.length>1024)&&(e.dump&&10===e.dump.charCodeAt(0)?u+="?":u+="? "),u+=e.dump,l&&(u+=p(e,n)),k(e,n+1,c,!0,l)&&(e.dump&&10===e.dump.charCodeAt(0)?u+=":":u+=": ",d+=u+=e.dump));e.tag=f,e.dump=d||"{}"}(e,n,e.dump,s),_&&(e.dump="&ref_"+f+e.dump)):(!function(e,t,n){var r,i,o,s,a,c="",l=e.tag,u=Object.keys(n);for(r=0,i=u.length;r<i;r+=1)a="",""!==c&&(a+=", "),e.condenseFlow&&(a+='"'),s=n[o=u[r]],e.replacer&&(s=e.replacer.call(n,o,s)),k(e,t,o,!1,!1)&&(e.dump.length>1024&&(a+="? "),a+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),k(e,t,s,!1,!1)&&(c+=a+=e.dump));e.tag=l,e.dump="{"+c+"}"}(e,n,e.dump),_&&(e.dump="&ref_"+f+" "+e.dump));else if("[object Array]"===u)o&&0!==e.dump.length?(e.noArrayIndent&&!c&&n>0?x(e,n-1,e.dump,s):x(e,n,e.dump,s),_&&(e.dump="&ref_"+f+e.dump)):(!function(e,t,n){var r,i,o,s="",a=e.tag;for(r=0,i=n.length;r<i;r+=1)o=n[r],e.replacer&&(o=e.replacer.call(n,String(r),o)),(k(e,t,o,!1,!1)||void 0===o&&k(e,t,null,!1,!1))&&(""!==s&&(s+=","+(e.condenseFlow?"":" ")),s+=e.dump);e.tag=a,e.dump="["+s+"]"}(e,n,e.dump),_&&(e.dump="&ref_"+f+" "+e.dump));else{if("[object String]"!==u){if("[object Undefined]"===u)return!1;if(e.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+u)}"?"!==e.tag&&v(e,e.dump,n,a,d)}null!==e.tag&&"?"!==e.tag&&(l=encodeURI("!"===e.tag[0]?e.tag.slice(1):e.tag).replace(/!/g,"%21"),l="!"===e.tag[0]?"!"+l:"tag:yaml.org,2002:"===l.slice(0,18)?"!!"+l.slice(18):"!<"+l+">",e.dump=l+" "+e.dump)}return!0}function D(e,t){var n,r,i=[],o=[];for(w(e,i,o),n=0,r=o.length;n<r;n+=1)t.duplicates.push(i[o[n]]);t.usedDuplicates=new Array(r)}function w(e,t,n){var r,i,o;if(null!==e&&"object"==typeof e)if(-1!==(i=t.indexOf(e)))-1===n.indexOf(i)&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)w(e[i],t,n);else for(i=0,o=(r=Object.keys(e)).length;i<o;i+=1)w(e[r[i]],t,n)}return dumper.dump=function(e,t){var n=new u(t=t||{});n.noRefs||D(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),k(n,0,r,!0,!0)?n.dump+"\n":""},dumper}function requireJsYaml(){if(hasRequiredJsYaml)return jsYaml;hasRequiredJsYaml=1;var e=requireLoader(),t=requireDumper();function n(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}return jsYaml.Type=requireType(),jsYaml.Schema=requireSchema$1(),jsYaml.FAILSAFE_SCHEMA=requireFailsafe(),jsYaml.JSON_SCHEMA=requireJson$1(),jsYaml.CORE_SCHEMA=requireCore$3(),jsYaml.DEFAULT_SCHEMA=require_default$1(),jsYaml.load=e.load,jsYaml.loadAll=e.loadAll,jsYaml.dump=t.dump,jsYaml.YAMLException=requireException(),jsYaml.types={binary:requireBinary(),float:requireFloat(),map:requireMap$1(),null:require_null(),pairs:requirePairs(),set:requireSet(),timestamp:requireTimestamp(),bool:requireBool(),int:requireInt(),merge:requireMerge(),omap:requireOmap(),seq:requireSeq(),str:requireStr()},jsYaml.safeLoad=n("safeLoad","load"),jsYaml.safeLoadAll=n("safeLoadAll","loadAll"),jsYaml.safeDump=n("safeDump","dump"),jsYaml}function requireYaml$1(){if(hasRequiredYaml$1)return yaml_1;hasRequiredYaml$1=1;const e=requireJsYaml(),{JSON_SCHEMA:t}=requireJsYaml(),{ParserError:n}=requireErrors$1();return yaml_1={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(r){let i=r.data;if(Buffer.isBuffer(i)&&(i=i.toString()),"string"==typeof i)try{return e.load(i,{schema:t})}catch(e){throw new n(e.message,r.url)}return i}},yaml_1}function requireFile(){if(hasRequiredFile)return file;hasRequiredFile=1;const e=require$$0$7,{ono:t}=require$$0$1,{ResolverError:n}=requireErrors$1(),r=requireUrl();return file={order:100,canRead:e=>r.isFileSystemPath(e.url),read:i=>new Promise(((o,s)=>{let a;try{a=r.toFileSystemPath(i.url)}catch(e){s(new n(t.uri(e,`Malformed URI: ${i.url}`),i.url))}try{e.readFile(a,((e,r)=>{e?s(new n(t(e,`Error opening file "${a}"`),a)):o(r)}))}catch(e){s(new n(t(e,`Error opening file "${a}"`),a))}}))},file}function requireHttp$1(){if(hasRequiredHttp$1)return http_1$1;hasRequiredHttp$1=1;const e=require$$2$1,t=require$$1$4,{ono:n}=require$$0$1,{ResolverError:r}=requireErrors$1(),i=requireUrl();function o(s,a,c){return new Promise(((l,u)=>{s=i.parse(s),(c=c||[]).push(s.href),function(n,r){return new Promise(((i,o)=>{const s=("https:"===n.protocol?t:e).get({hostname:n.hostname,port:n.port,path:n.path,auth:n.auth,protocol:n.protocol,headers:r.headers||{},withCredentials:r.withCredentials});"function"==typeof s.setTimeout&&s.setTimeout(r.timeout),s.on("timeout",(()=>{s.abort()})),s.on("error",o),s.once("response",(e=>{e.body=Buffer.alloc(0),e.on("data",(t=>{e.body=Buffer.concat([e.body,Buffer.from(t)])})),e.on("error",o),e.on("end",(()=>{i(e)}))}))}))}(s,a).then((e=>{if(e.statusCode>=400)throw n({status:e.statusCode},`HTTP ERROR ${e.statusCode}`);if(e.statusCode>=300)if(c.length>a.redirects)u(new r(n({status:e.statusCode},`Error downloading ${c[0]}. \nToo many redirects: \n ${c.join(" \n ")}`)));else{if(!e.headers.location)throw n({status:e.statusCode},`HTTP ${e.statusCode} redirect with no location header`);o(i.resolve(s,e.headers.location),a,c).then(l,u)}else l(e.body||Buffer.alloc(0))})).catch((e=>{u(new r(n(e,`Error downloading ${s.href}`),s.href))}))}))}return http_1$1={order:200,headers:null,timeout:5e3,redirects:5,withCredentials:!1,canRead:e=>i.isHttp(e.url),read(e){const t=i.parse(e.url);return process.browser&&!t.protocol&&(t.protocol=i.parse(location.href).protocol),o(t,this)}},http_1$1}function requireOptions$1(){if(hasRequiredOptions$1)return options$1;hasRequiredOptions$1=1;const e=requireBinary$1(),t=requireJson$2(),n=requireText(),r=requireYaml$1(),i=requireFile(),o=requireHttp$1();function s(e){a(this,s.defaults),a(this,e)}function a(e,t){if(c(t)){const n=Object.keys(t);for(let r=0;r<n.length;r++){const i=n[r],o=t[i],s=e[i];c(o)?e[i]=a(s||{},o):void 0!==o&&(e[i]=o)}}return e}function c(e){return e&&"object"==typeof e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}return options$1=s,s.defaults={parse:{json:t,yaml:r,text:n,binary:e},resolve:{file:i,http:o,external:!0},continueOnError:!1,dereference:{circular:!0}},options$1}function requireNormalizeArgs(){if(hasRequiredNormalizeArgs)return normalizeArgs;hasRequiredNormalizeArgs=1;const e=requireOptions$1();return normalizeArgs=function(t){let n,r,i,o;return"function"==typeof(t=Array.prototype.slice.call(t))[t.length-1]&&(o=t.pop()),"string"==typeof t[0]?(n=t[0],"object"==typeof t[2]?(r=t[1],i=t[2]):(r=void 0,i=t[1])):(n="",r=t[0],i=t[1]),i instanceof e||(i=new e(i)),{path:n,schema:r,options:i,callback:o}},normalizeArgs}var plugins={},hasRequiredPlugins,parse$3,hasRequiredParse,refs,hasRequiredRefs,resolveExternal_1,hasRequiredResolveExternal,hasRequiredLib$d;function requirePlugins(){if(hasRequiredPlugins)return plugins;function e(e,t,n,r,i){const o=e[t];if("function"==typeof o)return o.apply(e,[n,r,i]);if(!r){if(o instanceof RegExp)return o.test(n.url);if("string"==typeof o)return o===n.extension;if(Array.isArray(o))return-1!==o.indexOf(n.extension)}return o}return hasRequiredPlugins=1,plugins.all=function(e){return Object.keys(e).filter((t=>"object"==typeof e[t])).map((t=>(e[t].name=t,e[t])))},plugins.filter=function(t,n,r){return t.filter((t=>!!e(t,n,r)))},plugins.sort=function(e){for(const t of e)t.order=t.order||Number.MAX_SAFE_INTEGER;return e.sort(((e,t)=>e.order-t.order))},plugins.run=function(t,n,r,i){let o,s,a=0;return new Promise(((c,l)=>{function u(){if(o=t[a++],!o)return l(s);try{const s=e(o,n,r,d,i);if(s&&"function"==typeof s.then)s.then(p,f);else if(void 0!==s)p(s);else if(a===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(e){f(e)}}function d(e,t){e?f(e):p(t)}function p(e){c({plugin:o,result:e})}function f(e){s={plugin:o,error:e},u()}u()}))},plugins}function requireParse(){if(hasRequiredParse)return parse$3;hasRequiredParse=1;const{ono:e}=require$$0$1,{ResolverError:t,ParserError:n,UnmatchedParserError:r,UnmatchedResolverError:i,isHandledError:o}=requireErrors$1(),s=requirePlugins(),a=requireUrl();return parse$3=async function(c,l,u){c=a.stripHash(c);const d=l._add(c),p={url:c,extension:a.getExtension(c)};try{const o=await function(n,r,o){return new Promise(((a,c)=>{let l=s.all(r.resolve);function u(o){!o&&r.continueOnError?c(new i(n.url)):o&&"error"in o?o.error instanceof t?c(o.error):c(new t(o,n.url)):c(e.syntax(`Unable to resolve $ref pointer "${n.url}"`))}l=s.filter(l,"canRead",n),s.sort(l),s.run(l,"read",n,o).then(a,u)}))}(p,u,l);d.pathType=o.plugin.name,p.data=o.result;const a=await function(t,i,o){return new Promise(((a,c)=>{const l=s.all(i.parse),u=s.filter(l,"canParse",t),d=u.length>0?u:l;function p(n){var r;!n.plugin.allowEmpty&&(void 0===(r=n.result)||"object"==typeof r&&0===Object.keys(r).length||"string"==typeof r&&0===r.trim().length||Buffer.isBuffer(r)&&0===r.length)?c(e.syntax(`Error parsing "${t.url}" as ${n.plugin.name}. \nParsed value is empty`)):a(n)}function f(o){!o&&i.continueOnError?c(new r(t.url)):o&&"error"in o?o.error instanceof n?c(o.error):c(new n(o.error.message,t.url)):c(e.syntax(`Unable to parse ${t.url}`))}s.sort(d),s.run(d,"parse",t,o).then(p,f)}))}(p,u,l);return d.value=a.result,a.result}catch(e){throw o(e)&&(d.value=e),e}},parse$3}function requireRefs(){if(hasRequiredRefs)return refs;hasRequiredRefs=1;const{ono:e}=require$$0$1,t=requireRef$1(),n=requireUrl();function r(){this.circular=!1,this.circularRefs=[],this._$refs={},this._root$Ref=null}function i(e,t){let r=Object.keys(e);return(t=Array.isArray(t[0])?t[0]:Array.prototype.slice.call(t)).length>0&&t[0]&&(r=r.filter((n=>-1!==t.indexOf(e[n].pathType)))),r.map((t=>({encoded:t,decoded:"file"===e[t].pathType?n.toFileSystemPath(t,!0):t})))}return refs=r,r.prototype.paths=function(e){return i(this._$refs,arguments).map((e=>e.decoded))},r.prototype.values=function(e){const t=this._$refs;return i(t,arguments).reduce(((e,n)=>(e[n.decoded]=t[n.encoded].value,e)),{})},r.prototype.toJSON=r.prototype.values,r.prototype.exists=function(e,t){try{return this._resolve(e,"",t),!0}catch(e){return!1}},r.prototype.get=function(e,t){return this._resolve(e,"",t).value},r.prototype.set=function(t,r){const i=n.resolve(this._root$Ref.path,t),o=n.stripHash(i),s=this._$refs[o];if(!s)throw e(`Error resolving $ref pointer "${t}". \n"${o}" not found.`);s.set(i,r)},r.prototype._add=function(e){const r=n.stripHash(e),i=new t;return i.path=r,i.$refs=this,this._$refs[r]=i,this._root$Ref=this._root$Ref||i,i},r.prototype._resolve=function(t,r,i){const o=n.resolve(this._root$Ref.path,t),s=n.stripHash(o),a=this._$refs[s];if(!a)throw e(`Error resolving $ref pointer "${t}". \n"${s}" not found.`);return a.resolve(o,i,t,r)},r.prototype._get$Ref=function(e){e=n.resolve(this._root$Ref.path,e);const t=n.stripHash(e);return this._$refs[t]},refs}function requireResolveExternal(){if(hasRequiredResolveExternal)return resolveExternal_1;hasRequiredResolveExternal=1;const e=requireParse(),t=requirePointer(),n=requireRef$1(),{isHandledError:r}=requireErrors$1(),i=requireUrl();function o(e,r,i,a,c){c=c||new Set;let l=[];if(e&&"object"==typeof e&&!ArrayBuffer.isView(e)&&!c.has(e))if(c.add(e),n.isExternal$Ref(e))l.push(s(e,r,i,a));else for(const u of Object.keys(e)){const d=t.join(r,u),p=e[u];n.isExternal$Ref(p)?l.push(s(p,d,i,a)):l=l.concat(o(p,d,i,a,c))}return l}async function s(t,n,s,a){const c=i.resolve(n,t.$ref),l=i.stripHash(c);if(t=s._$refs[l])return Promise.resolve(t.value);try{const t=o(await e(c,s,a),`${l}#`,s,a);return Promise.all(t)}catch(e){if(!a.continueOnError||!r(e))throw e;return s._$refs[l]&&(e.source=i.stripHash(n),e.path=i.safePointerToPath(i.getHash(n))),[]}}return resolveExternal_1=function(e,t){if(!t.resolve.external)return Promise.resolve();try{const n=o(e.schema,`${e.$refs._root$Ref.path}#`,e.$refs,t);return Promise.all(n)}catch(e){return Promise.reject(e)}},resolveExternal_1}function requireLib$d(){if(hasRequiredLib$d)return lib$e.exports;hasRequiredLib$d=1;const{ono:e}=require$$0$1,t=requireMaybe(),n=requireBundle(),r=requireDereference$1(),i=requireNormalizeArgs(),o=requireParse(),s=requireRefs(),a=requireResolveExternal(),{JSONParserError:c,InvalidPointerError:l,MissingPointerError:u,ResolverError:d,ParserError:p,UnmatchedParserError:f,UnmatchedResolverError:_,isHandledError:m,JSONParserErrorGroup:h}=requireErrors$1(),g=requireUrl();function A(){this.schema=null,this.$refs=new s}function y(e){if(h.getParserErrors(e).length>0)throw new h(e)}return lib$e.exports=A,lib$e.exports.default=A,lib$e.exports.JSONParserError=c,lib$e.exports.InvalidPointerError=l,lib$e.exports.MissingPointerError=u,lib$e.exports.ResolverError=d,lib$e.exports.ParserError=p,lib$e.exports.UnmatchedParserError=f,lib$e.exports.UnmatchedResolverError=_,A.parse=function(e,t,n,r){const i=new this;return i.parse.apply(i,arguments)},A.prototype.parse=async function(n,r,a,c){const l=i(arguments);let u;if(!l.path&&!l.schema){const n=e(`Expected a file path, URL, or object. Got ${l.path||l.schema}`);return t(l.callback,Promise.reject(n))}this.schema=null,this.$refs=new s;let d="http";if(g.isFileSystemPath(l.path)&&(l.path=g.fromFileSystemPath(l.path),d="file"),l.path=g.resolve(g.cwd(),l.path),l.schema&&"object"==typeof l.schema){const e=this.$refs._add(l.path);e.value=l.schema,e.pathType=d,u=Promise.resolve(l.schema)}else u=o(l.path,this.$refs,l.options);const p=this;try{const n=await u;if(null!==n&&"object"==typeof n&&!Buffer.isBuffer(n))return p.schema=n,t(l.callback,Promise.resolve(p.schema));if(l.options.continueOnError)return p.schema=null,t(l.callback,Promise.resolve(p.schema));throw e.syntax(`"${p.$refs._root$Ref.path||n}" is not a valid JSON Schema`)}catch(e){return l.options.continueOnError&&m(e)?(this.$refs._$refs[g.stripHash(l.path)]&&this.$refs._$refs[g.stripHash(l.path)].addError(e),t(l.callback,Promise.resolve(null))):t(l.callback,Promise.reject(e))}},A.resolve=function(e,t,n,r){const i=new this;return i.resolve.apply(i,arguments)},A.prototype.resolve=async function(e,n,r,o){const s=this,c=i(arguments);try{return await this.parse(c.path,c.schema,c.options),await a(s,c.options),y(s),t(c.callback,Promise.resolve(s.$refs))}catch(e){return t(c.callback,Promise.reject(e))}},A.bundle=function(e,t,n,r){const i=new this;return i.bundle.apply(i,arguments)},A.prototype.bundle=async function(e,r,o,s){const a=this,c=i(arguments);try{return await this.resolve(c.path,c.schema,c.options),n(a,c.options),y(a),t(c.callback,Promise.resolve(a.schema))}catch(e){return t(c.callback,Promise.reject(e))}},A.dereference=function(e,t,n,r){const i=new this;return i.dereference.apply(i,arguments)},A.prototype.dereference=async function(e,n,o,s){const a=this,c=i(arguments);try{return await this.resolve(c.path,c.schema,c.options),r(a,c.options),y(a),t(c.callback,Promise.resolve(a.schema))}catch(e){return t(c.callback,Promise.reject(e))}},lib$e.exports}var util$2={},hasRequiredUtil$2;function requireUtil$2(){if(hasRequiredUtil$2)return util$2;hasRequiredUtil$2=1;const e=require$$0__default,t=requireUrl();util$2.format=e.format,util$2.inherits=e.inherits,util$2.swaggerParamRegExp=/\{([^/}]+)}/g;const n=["get","post","put","delete","patch","options","head","trace"];function r(e,n){if(e.url&&e.url.startsWith("/")){const r=t.parse(n),i=`${r.protocol}//${r.hostname}${e.url}`;e.url=i}return e}return util$2.fixOasRelativeServers=function(e,t){e.openapi&&t&&(t.startsWith("http:")||t.startsWith("https:"))&&(e.servers&&e.servers.map((e=>r(e,t))),["paths","webhooks"].forEach((i=>{Object.keys(e[i]||[]).forEach((o=>{const s=e[i][o];Object.keys(s).forEach((e=>{"servers"===e?s[e].map((e=>r(e,t))):n.includes(e)&&s[e].servers&&s[e].servers.map((e=>r(e,t)))}))}))})))},util$2.getSpecificationName=function(e){return e.swagger?"Swagger":"OpenAPI"},util$2}var lib$d={exports:{}},interopRequireDefault={exports:{}},hasRequiredInteropRequireDefault;function requireInteropRequireDefault(){return hasRequiredInteropRequireDefault||(hasRequiredInteropRequireDefault=1,function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}(interopRequireDefault)),interopRequireDefault.exports}var api$1={},hasRequiredApi$1;function requireApi$1(){if(hasRequiredApi$1)return api$1;hasRequiredApi$1=1,Object.defineProperty(api$1,"__esModule",{value:!0});const e="true",t="false",n="null",r=new Map([["t",e],["f",t],["n",n]]),i=new Map([['"','"'],["\\","\\"],["/","/"],["b","\b"],["n","\n"],["f","\f"],["r","\r"],["t","\t"]]),o=new Map([["[","Punctuator"],["]","Punctuator"],["{","Punctuator"],["}","Punctuator"],[":","Punctuator"],[",","Punctuator"],[e,"Boolean"],[t,"Boolean"],[n,"Null"]]);class s extends Error{constructor(e,{line:t,column:n,index:r}){super(`${e} (${t}:${n})`),this.line=t,this.column=n,this.index=r}}class a extends s{constructor(e,t){super(`Unexpected character ${e} found.`,t)}}class c extends s{constructor(e){super(`Unexpected token ${e.type}(${e.value}) found.`,e.loc.start)}}class l extends s{constructor(e){super("Unexpected end of input found.",e)}}const u={comments:!1,ranges:!1};function d(e){return/[\s\n]/.test(e)}function p(e){return e>="0"&&e<="9"}function f(e){return p(e)||/[a-f]/i.test(e)}function _(e){return/[tfn]/.test(e)}function m(e){return p(e)||"."===e||"-"===e}function h(e,t){t=Object.freeze({...u,...t});let n=-1,s=1,c=0,h=!1;const g=[];function A(e,n,r,i){const o=r.offset+n.length;let s=t.ranges?{range:[r.offset,o]}:void 0;return{type:e,value:n,loc:{start:r,end:i||{line:r.line,column:r.column+n.length,offset:o}},...s}}function y(){let t=e.charAt(++n);return h?(s++,c=1,h=!1):c++,"\r"===t?(h=!0,"\n"===e.charAt(n+1)&&n++):"\n"===t&&(h=!0),t}function v(){return{line:s,column:c,offset:n}}function b(t){let i=r.get(t);if(e.slice(n,n+i.length)===i)return n+=i.length-1,c+=i.length-1,{value:i,c:y()};for(let t=1;t<i.length;t++)i[t]!==e.charAt(n+t)&&S(y())}function C(e){let t=e;for(e=y();e&&'"'!==e;){if("\\"===e)if(t+=e,e=y(),i.has(e))t+=e;else if("u"===e){t+=e;for(let n=0;n<4;n++)f(e=y())?t+=e:S(e)}else S(e);else t+=e;e=y()}return e||k(),t+=e,{value:t,c:y()}}function E(e){let t="";if("-"===e&&(t+=e,p(e=y())||S(e)),"0"===e)t+=e,p(e=y())&&S(e);else{(function(e){return e>="1"&&e<="9"})(e)||S(e);do{t+=e,e=y()}while(p(e))}if("."===e)do{t+=e,e=y()}while(p(e));if("e"===e||"E"===e)for(t+=e,"+"!==(e=y())&&"-"!==e||(t+=e,e=y()),p(e)||S(e);p(e);)t+=e,e=y();return{value:t,c:e}}function x(e){let t=e;if("/"===(e=y())){do{t+=e,e=y()}while(e&&"\r"!==e&&"\n"!==e);return{value:t,c:e}}if("*"===e){for(;e;)if(t+=e,"*"===(e=y())&&(t+=e,"/"===(e=y())))return t+=e,{value:t,c:e=y()};k()}S(e)}function S(e){throw new a(e,v())}function k(){throw new l(v())}let D=y();for(;n<e.length;){for(;d(D);)D=y();if(!D)break;const e=v();if(o.has(D))g.push(A(o.get(D),D,e)),D=y();else if(_(D)){const t=b(D);let n=t.value;D=t.c,g.push(A(o.get(n),n,e))}else if(m(D)){const t=E(D);let n=t.value;D=t.c,g.push(A("Number",n,e))}else if('"'===D){const t=C(D);let n=t.value;D=t.c,g.push(A("String",n,e))}else if("/"===D&&t.comments){const t=x(D);let n=t.value;D=t.c,g.push(A(n.startsWith("//")?"LineComment":"BlockComment",n,e,v()))}else S(D)}return g}const g={document:(e,t={})=>({type:"Document",body:e,...t}),string:(e,t={})=>({type:"String",value:e,...t}),number:(e,t={})=>({type:"Number",value:e,...t}),boolean:(e,t={})=>({type:"Boolean",value:e,...t}),null:(e={})=>({type:"Null",value:"null",...e}),array:(e,t={})=>({type:"Array",elements:e,...t}),object:(e,t={})=>({type:"Object",members:e,...t}),member:(e,t,n={})=>({type:"Member",name:e,value:t,...n})},A={tokens:!1,comments:!1,ranges:!1};function y(e){switch(e.type){case"Boolean":return"true"===e.value;case"Number":return Number(e.value);case"Null":return null;case"String":return function(e){let t=e.value.slice(1,-1),n="",r=t.indexOf("\\"),o=0;for(;r>=0;){n+=t.slice(o,r);const a=t.charAt(r+1);if(i.has(a))n+=i.get(a),o=r+2;else{if("u"!==a)throw new s(`Invalid escape \\${a}.`,{line:e.loc.start.line,column:e.loc.start.column+r,offset:e.loc.start.offset+r});{const i=t.slice(r+2,r+6);if(i.length<4||/[^0-9a-f]/i.test(i))throw new s(`Invalid unicode escape \\u${i}.`,{line:e.loc.start.line,column:e.loc.start.column+r,offset:e.loc.start.offset+r});n+=String.fromCharCode(parseInt(i,16)),o=r+6}}r=t.indexOf("\\",o)}return n+=t.slice(o),n}(e)}}const v=new Map([["Document",["body"]],["Object",["members"]],["Member",["name","value"]],["Array",["elements"]],["String",[]],["Number",[]],["Boolean",[]],["Null",[]]]);function b(e){return e&&"object"==typeof e}function C(e){return b(e)&&"string"==typeof e.type}function E(e,t){!function e(n,r){"function"==typeof t.enter&&t.enter(n,r);for(const t of v.get(n.type)){const r=n[t];b(r)&&(Array.isArray(r)?r.forEach((t=>e(t,n))):C(r)&&e(r,n))}"function"==typeof t.exit&&t.exit(n,r)}(e)}function x(e){switch(e.type){case"String":case"Number":case"Boolean":return e.value;case"Null":return null;case"Array":return e.elements.map(x);case"Object":{const t={};return e.members.forEach((e=>{t[x(e.name)]=x(e.value)})),t}case"Document":return x(e.body);case"Property":throw new Error("Cannot evaluate object property outside of an object.");default:throw new Error(`Unknown node type ${e.type}.`)}}return api$1.evaluate=x,api$1.iterator=function(e,t=()=>!0){const n=[];return E(e,{enter(e,t){n.push({node:e,parent:t,phase:"enter"})},exit(e,t){n.push({node:e,parent:t,phase:"exit"})}}),n.filter(t).values()},api$1.parse=function(e,t){const n=h(e,{comments:!!(t=Object.freeze({...A,...t})).comments,ranges:!!t.ranges});let r=0;const i=t.comments?function e(){const t=n[r++];return t&&t.type.endsWith("Comment")?e():t}:function(){return n[r++]};function o(e,t){if(!e||e.value!==t)throw new c(e)}function s(e,n){return t.ranges?{range:[e.offset,n.offset]}:void 0}function a(e){const t=s(e.loc.start,e.loc.end);return{type:e.type,value:y(e),loc:{start:{...e.loc.start},end:{...e.loc.end}},...t}}function l(e){!function(e,t){if(!e||e.type!==t)throw new c(e)}(e,"String");const t=a(e);o(e=i(),":");const n=u(),r=s(t.loc.start,n.loc.end);return g.member(t,n,{loc:{start:{...t.loc.start},end:{...n.loc.end}},...r})}function u(e){switch((e=e||i()).type){case"String":case"Boolean":case"Number":case"Null":return a(e);case"Punctuator":if("{"===e.value)return function(e){o(e,"{");const t=[];let n=i();if(n&&"}"!==n.value)do{if(t.push(l(n)),n=i(),","!==n.value)break;n=i()}while(n);o(n,"}");const r=s(e.loc.start,n.loc.end);return g.object(t,{loc:{start:{...e.loc.start},end:{...n.loc.end}},...r})}(e);if("["===e.value)return function(e){o(e,"[");const t=[];let n=i();if(n&&"]"!==n.value)do{if(t.push(u(n)),n=i(),","!==n.value)break;n=i()}while(n);o(n,"]");const r=s(e.loc.start,n.loc.end);return g.array(t,{type:"Array",elements:t,loc:{start:{...e.loc.start},end:{...n.loc.end}},...r})}(e);default:throw new c(e)}}const d=u(),p=i();if(p)throw new c(p);const f={loc:{start:{line:1,column:1,offset:0},end:{...d.loc.end}}};return t.tokens&&(f.tokens=n),t.ranges&&(f.range=s(f.loc.start,f.loc.end)),g.document(d,f)},api$1.print=function(e,{indent:t=0}={}){const n=x(e);return JSON.stringify(n,null,t)},api$1.tokenize=h,api$1.traverse=E,api$1.types=g,api$1}var helpers={},defineProperty={exports:{}},toPropertyKey={exports:{}},_typeof={exports:{}},hasRequired_typeof;function require_typeof(){return hasRequired_typeof||(hasRequired_typeof=1,function(e){function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(_typeof)),_typeof.exports}var toPrimitive={exports:{}},hasRequiredToPrimitive,hasRequiredToPropertyKey,hasRequiredDefineProperty;function requireToPrimitive(){return hasRequiredToPrimitive||(hasRequiredToPrimitive=1,function(e){var t=require_typeof().default;e.exports=function(e,n){if("object"!=t(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,n||"default");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(toPrimitive)),toPrimitive.exports}function requireToPropertyKey(){return hasRequiredToPropertyKey||(hasRequiredToPropertyKey=1,function(e){var t=require_typeof().default,n=requireToPrimitive();e.exports=function(e){var r=n(e,"string");return"symbol"==t(r)?r:r+""},e.exports.__esModule=!0,e.exports.default=e.exports}(toPropertyKey)),toPropertyKey.exports}function requireDefineProperty(){return hasRequiredDefineProperty||(hasRequiredDefineProperty=1,function(e){var t=requireToPropertyKey();e.exports=function(e,n,r){return(n=t(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports}(defineProperty)),defineProperty.exports}var toConsumableArray={exports:{}},arrayWithoutHoles={exports:{}},arrayLikeToArray={exports:{}},hasRequiredArrayLikeToArray,hasRequiredArrayWithoutHoles;function requireArrayLikeToArray(){return hasRequiredArrayLikeToArray||(hasRequiredArrayLikeToArray=1,function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports}(arrayLikeToArray)),arrayLikeToArray.exports}function requireArrayWithoutHoles(){return hasRequiredArrayWithoutHoles||(hasRequiredArrayWithoutHoles=1,function(e){var t=requireArrayLikeToArray();e.exports=function(e){if(Array.isArray(e))return t(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(arrayWithoutHoles)),arrayWithoutHoles.exports}var iterableToArray={exports:{}},hasRequiredIterableToArray;function requireIterableToArray(){return hasRequiredIterableToArray||(hasRequiredIterableToArray=1,function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(iterableToArray)),iterableToArray.exports}var unsupportedIterableToArray={exports:{}},hasRequiredUnsupportedIterableToArray;function requireUnsupportedIterableToArray(){return hasRequiredUnsupportedIterableToArray||(hasRequiredUnsupportedIterableToArray=1,function(e){var t=requireArrayLikeToArray();e.exports=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}(unsupportedIterableToArray)),unsupportedIterableToArray.exports}var nonIterableSpread={exports:{}},hasRequiredNonIterableSpread,hasRequiredToConsumableArray;function requireNonIterableSpread(){return hasRequiredNonIterableSpread||(hasRequiredNonIterableSpread=1,function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(nonIterableSpread)),nonIterableSpread.exports}function requireToConsumableArray(){return hasRequiredToConsumableArray||(hasRequiredToConsumableArray=1,function(e){var t=requireArrayWithoutHoles(),n=requireIterableToArray(),r=requireUnsupportedIterableToArray(),i=requireNonIterableSpread();e.exports=function(e){return t(e)||n(e)||r(e)||i()},e.exports.__esModule=!0,e.exports.default=e.exports}(toConsumableArray)),toConsumableArray.exports}var slicedToArray={exports:{}},arrayWithHoles={exports:{}},hasRequiredArrayWithHoles;function requireArrayWithHoles(){return hasRequiredArrayWithHoles||(hasRequiredArrayWithHoles=1,function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}(arrayWithHoles)),arrayWithHoles.exports}var iterableToArrayLimit={exports:{}},hasRequiredIterableToArrayLimit;function requireIterableToArrayLimit(){return hasRequiredIterableToArrayLimit||(hasRequiredIterableToArrayLimit=1,function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}},e.exports.__esModule=!0,e.exports.default=e.exports}(iterableToArrayLimit)),iterableToArrayLimit.exports}var nonIterableRest={exports:{}},hasRequiredNonIterableRest,hasRequiredSlicedToArray;function requireNonIterableRest(){return hasRequiredNonIterableRest||(hasRequiredNonIterableRest=1,function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}(nonIterableRest)),nonIterableRest.exports}function requireSlicedToArray(){return hasRequiredSlicedToArray||(hasRequiredSlicedToArray=1,function(e){var t=requireArrayWithHoles(),n=requireIterableToArrayLimit(),r=requireUnsupportedIterableToArray(),i=requireNonIterableRest();e.exports=function(e,o){return t(e)||n(e,o)||r(e,o)||i()},e.exports.__esModule=!0,e.exports.default=e.exports}(slicedToArray)),slicedToArray.exports}var utils$4={},hasRequiredUtils$4;function requireUtils$4(){if(hasRequiredUtils$4)return utils$4;hasRequiredUtils$4=1,Object.defineProperty(utils$4,"__esModule",{value:!0}),utils$4.notUndefined=utils$4.isRequiredError=utils$4.isEnumError=utils$4.isAnyOfError=utils$4.getSiblings=utils$4.getErrors=utils$4.getChildren=utils$4.concatAll=void 0;utils$4.notUndefined=function(e){return void 0!==e};var e=function(e){return function(t){return t.keyword===e}},t=e("required");utils$4.isRequiredError=t;var n=e("anyOf");utils$4.isAnyOfError=n;var r=e("enum");utils$4.isEnumError=r;utils$4.getErrors=function(e){return e&&e.errors||[]};var i=function(e){return e&&(t=e.children,Object.values(t))||[];var t};utils$4.getChildren=i;utils$4.getSiblings=function(e){return function(t){return i(e).filter((r=t,n=function(e){return r===e},function(e){return!n(e)}));var n,r}};return utils$4.concatAll=function(e){return function(t){return t.reduce((function(e,t){return e.concat(t)}),e)}},utils$4}var validationErrors={},additionalProp={exports:{}},taggedTemplateLiteral={exports:{}},hasRequiredTaggedTemplateLiteral;function requireTaggedTemplateLiteral(){return hasRequiredTaggedTemplateLiteral||(hasRequiredTaggedTemplateLiteral=1,function(e){e.exports=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))},e.exports.__esModule=!0,e.exports.default=e.exports}(taggedTemplateLiteral)),taggedTemplateLiteral.exports}var classCallCheck={exports:{}},hasRequiredClassCallCheck;function requireClassCallCheck(){return hasRequiredClassCallCheck||(hasRequiredClassCallCheck=1,function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports}(classCallCheck)),classCallCheck.exports}var createClass={exports:{}},hasRequiredCreateClass;function requireCreateClass(){return hasRequiredCreateClass||(hasRequiredCreateClass=1,function(e){var t=requireToPropertyKey();function n(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,t(i.key),i)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports}(createClass)),createClass.exports}var inherits={exports:{}},setPrototypeOf={exports:{}},hasRequiredSetPrototypeOf,hasRequiredInherits;function requireSetPrototypeOf(){return hasRequiredSetPrototypeOf||(hasRequiredSetPrototypeOf=1,function(e){function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(setPrototypeOf)),setPrototypeOf.exports}function requireInherits(){return hasRequiredInherits||(hasRequiredInherits=1,function(e){var t=requireSetPrototypeOf();e.exports=function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),n&&t(e,n)},e.exports.__esModule=!0,e.exports.default=e.exports}(inherits)),inherits.exports}var possibleConstructorReturn={exports:{}},assertThisInitialized={exports:{}},hasRequiredAssertThisInitialized,hasRequiredPossibleConstructorReturn;function requireAssertThisInitialized(){return hasRequiredAssertThisInitialized||(hasRequiredAssertThisInitialized=1,function(e){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports}(assertThisInitialized)),assertThisInitialized.exports}function requirePossibleConstructorReturn(){return hasRequiredPossibleConstructorReturn||(hasRequiredPossibleConstructorReturn=1,function(e){var t=require_typeof().default,n=requireAssertThisInitialized();e.exports=function(e,r){if(r&&("object"==t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports}(possibleConstructorReturn)),possibleConstructorReturn.exports}var getPrototypeOf={exports:{}},hasRequiredGetPrototypeOf;function requireGetPrototypeOf(){return hasRequiredGetPrototypeOf||(hasRequiredGetPrototypeOf=1,function(e){function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(getPrototypeOf)),getPrototypeOf.exports}var base={exports:{}},lib$c={},picocolors={exports:{}},hasRequiredPicocolors;function requirePicocolors(){if(hasRequiredPicocolors)return picocolors.exports;hasRequiredPicocolors=1;let e=process||{},t=e.argv||[],n=e.env||{},r=!(n.NO_COLOR||t.includes("--no-color"))&&(!!n.FORCE_COLOR||t.includes("--color")||"win32"===e.platform||(e.stdout||{}).isTTY&&"dumb"!==n.TERM||!!n.CI),i=(e,t,n=e)=>r=>{let i=""+r,s=i.indexOf(t,e.length);return~s?e+o(i,t,n,s)+t:e+i+t},o=(e,t,n,r)=>{let i="",o=0;do{i+=e.substring(o,r)+n,o=r+t.length,r=e.indexOf(t,o)}while(~r);return i+e.substring(o)},s=(e=r)=>{let t=e?i:()=>String;return{isColorSupported:e,reset:t("",""),bold:t("","",""),dim:t("","",""),italic:t("",""),underline:t("",""),inverse:t("",""),hidden:t("",""),strikethrough:t("",""),black:t("",""),red:t("",""),green:t("",""),yellow:t("",""),blue:t("",""),magenta:t("",""),cyan:t("",""),white:t("",""),gray:t("",""),bgBlack:t("",""),bgRed:t("",""),bgGreen:t("",""),bgYellow:t("",""),bgBlue:t("",""),bgMagenta:t("",""),bgCyan:t("",""),bgWhite:t("",""),blackBright:t("",""),redBright:t("",""),greenBright:t("",""),yellowBright:t("",""),blueBright:t("",""),magentaBright:t("",""),cyanBright:t("",""),whiteBright:t("",""),bgBlackBright:t("",""),bgRedBright:t("",""),bgGreenBright:t("",""),bgYellowBright:t("",""),bgBlueBright:t("",""),bgMagentaBright:t("",""),bgCyanBright:t("",""),bgWhiteBright:t("","")}};return picocolors.exports=s(),picocolors.exports.createColors=s,picocolors.exports}var jsTokens={},hasRequiredJsTokens;function requireJsTokens(){return hasRequiredJsTokens||(hasRequiredJsTokens=1,Object.defineProperty(jsTokens,"__esModule",{value:!0}),jsTokens.default=/((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g,jsTokens.matchToToken=function(e){var t={type:"invalid",value:e[0],closed:void 0};return e[1]?(t.type="string",t.closed=!(!e[3]&&!e[4])):e[5]?t.type="comment":e[6]?(t.type="comment",t.closed=!!e[7]):e[8]?t.type="regex":e[9]?t.type="number":e[10]?t.type="name":e[11]?t.type="punctuator":e[12]&&(t.type="whitespace"),t}),jsTokens}var lib$b={},identifier={},hasRequiredIdentifier;function requireIdentifier(){if(hasRequiredIdentifier)return identifier;hasRequiredIdentifier=1,Object.defineProperty(identifier,"__esModule",{value:!0}),identifier.isIdentifierChar=c,identifier.isIdentifierName=function(e){let t=!0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(55296==(64512&r)&&n+1<e.length){const t=e.charCodeAt(++n);56320==(64512&t)&&(r=65536+((1023&r)<<10)+(1023&t))}if(t){if(t=!1,!a(r))return!1}else if(!c(r))return!1}return!t},identifier.isIdentifierStart=a;let e="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",t="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";const n=new RegExp("["+e+"]"),r=new RegExp("["+e+t+"]");e=t=null;const i=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],o=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function s(e,t){let n=65536;for(let r=0,i=t.length;r<i;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function a(e){return e<65?36===e:e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&n.test(String.fromCharCode(e)):s(e,i)))}function c(e){return e<48?36===e:e<58||!(e<65)&&(e<=90||(e<97?95===e:e<=122||(e<=65535?e>=170&&r.test(String.fromCharCode(e)):s(e,i)||s(e,o))))}return identifier}var keyword$1={},hasRequiredKeyword$1,hasRequiredLib$c,hasRequiredLib$b,supportsColor_1,hasRequiredSupportsColor,util$1,hasRequiredUtil$1,templates,hasRequiredTemplates,source,hasRequiredSource;function requireKeyword$1(){if(hasRequiredKeyword$1)return keyword$1;hasRequiredKeyword$1=1,Object.defineProperty(keyword$1,"__esModule",{value:!0}),keyword$1.isKeyword=function(e){return n.has(e)},keyword$1.isReservedWord=o,keyword$1.isStrictBindOnlyReservedWord=a,keyword$1.isStrictBindReservedWord=function(e,t){return s(e,t)||a(e)},keyword$1.isStrictReservedWord=s;const e=["implements","interface","let","package","private","protected","public","static","yield"],t=["eval","arguments"],n=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"]),r=new Set(e),i=new Set(t);function o(e,t){return t&&"await"===e||"enum"===e}function s(e,t){return o(e,t)||r.has(e)}function a(e){return i.has(e)}return keyword$1}function requireLib$c(){return hasRequiredLib$c||(hasRequiredLib$c=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"isIdentifierChar",{enumerable:!0,get:function(){return t.isIdentifierChar}}),Object.defineProperty(e,"isIdentifierName",{enumerable:!0,get:function(){return t.isIdentifierName}}),Object.defineProperty(e,"isIdentifierStart",{enumerable:!0,get:function(){return t.isIdentifierStart}}),Object.defineProperty(e,"isKeyword",{enumerable:!0,get:function(){return n.isKeyword}}),Object.defineProperty(e,"isReservedWord",{enumerable:!0,get:function(){return n.isReservedWord}}),Object.defineProperty(e,"isStrictBindOnlyReservedWord",{enumerable:!0,get:function(){return n.isStrictBindOnlyReservedWord}}),Object.defineProperty(e,"isStrictBindReservedWord",{enumerable:!0,get:function(){return n.isStrictBindReservedWord}}),Object.defineProperty(e,"isStrictReservedWord",{enumerable:!0,get:function(){return n.isStrictReservedWord}});var t=requireIdentifier(),n=requireKeyword$1()}(lib$b)),lib$b}function requireLib$b(){if(hasRequiredLib$b)return lib$c;hasRequiredLib$b=1,Object.defineProperty(lib$c,"__esModule",{value:!0});var e=requirePicocolors(),t=requireJsTokens(),n=requireLib$c();const r=(e,t)=>n=>e(t(n));function i(e){return{keyword:e.cyan,capitalized:e.yellow,jsxIdentifier:e.yellow,punctuator:e.yellow,number:e.magenta,string:e.green,regex:e.magenta,comment:e.gray,invalid:r(r(e.white,e.bgRed),e.bold),gutter:e.gray,marker:r(e.red,e.bold),message:r(e.red,e.bold),reset:e.reset}}const o=i(e.createColors(!0)),s=i(e.createColors(!1));function a(e){return e?o:s}const c=new Set(["as","async","from","get","of","set"]),l=/\r\n|[\n\r\u2028\u2029]/,u=/^[()[\]{}]$/;let d;{const e=/^[a-z][\w-]*$/i,r=function(t,r,i){if("name"===t.type){if(n.isKeyword(t.value)||n.isStrictReservedWord(t.value,!0)||c.has(t.value))return"keyword";if(e.test(t.value)&&("<"===i[r-1]||"</"===i.slice(r-2,r)))return"jsxIdentifier";if(t.value[0]!==t.value[0].toLowerCase())return"capitalized"}return"punctuator"===t.type&&u.test(t.value)?"bracket":"invalid"!==t.type||"@"!==t.value&&"#"!==t.value?t.type:"punctuator"};d=function*(e){let n;for(;n=t.default.exec(e);){const i=t.matchToToken(n);yield{type:r(i,n.index,e),value:i.value}}}}function p(e){if(""===e)return"";const t=a(!0);let n="";for(const{type:r,value:i}of d(e))n+=r in t?i.split(l).map((e=>t[r](e))).join("\n"):i;return n}let f=!1;const _=/\r\n|[\n\r\u2028\u2029]/;function m(t,n,r={}){const i=r.forceColor||("object"!=typeof process||"0"!==process.env.FORCE_COLOR&&"false"!==process.env.FORCE_COLOR)&&e.isColorSupported&&r.highlightCode,o=a(i),s=t.split(_),{start:c,end:l,markerLines:u}=function(e,t,n){const r=Object.assign({column:0,line:-1},e.start),i=Object.assign({},r,e.end),{linesAbove:o=2,linesBelow:s=3}=n||{},a=r.line,c=r.column,l=i.line,u=i.column;let d=Math.max(a-(o+1),0),p=Math.min(t.length,l+s);-1===a&&(d=0),-1===l&&(p=t.length);const f=l-a,_={};if(f)for(let e=0;e<=f;e++){const n=e+a;if(c)if(0===e){const e=t[n-1].length;_[n]=[c,e-c+1]}else if(e===f)_[n]=[0,u];else{const r=t[n-e].length;_[n]=[0,r]}else _[n]=!0}else _[a]=c===u?!c||[c,0]:[c,u-c];return{start:d,end:p,markerLines:_}}(n,s,r),d=n.start&&"number"==typeof n.start.column,f=String(l).length;let m=(i?p(t):t).split(_,l).slice(c,l).map(((e,t)=>{const n=c+1+t,i=` ${` ${n}`.slice(-f)} |`,s=u[n],a=!u[n+1];if(s){let t="";if(Array.isArray(s)){const n=e.slice(0,Math.max(s[0]-1,0)).replace(/[^\t]/g," "),c=s[1]||1;t=["\n ",o.gutter(i.replace(/\d/g," "))," ",n,o.marker("^").repeat(c)].join(""),a&&r.message&&(t+=" "+o.message(r.message))}return[o.marker(">"),o.gutter(i),e.length>0?` ${e}`:"",t].join("")}return` ${o.gutter(i)}${e.length>0?` ${e}`:""}`})).join("\n");return r.message&&!d&&(m=`${" ".repeat(f+1)}${r.message}\n${m}`),i?o.reset(m):m}return lib$c.codeFrameColumns=m,lib$c.default=function(e,t,n,r={}){if(!f){f=!0;const e="Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";if(process.emitWarning)process.emitWarning(e,"DeprecationWarning");else{new Error(e).name="DeprecationWarning",console.warn(new Error(e))}}return m(e,{start:{column:n=Math.max(n,0),line:t}},r)},lib$c.highlight=p,lib$c}function requireSupportsColor(){if(hasRequiredSupportsColor)return supportsColor_1;hasRequiredSupportsColor=1;const e=require$$0$9,t=require$$1$1,n=requireHasFlag(),{env:r}=process;let i;function o(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function s(t,o){if(0===i)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!o&&void 0===i)return 0;const s=i||0;if("dumb"===r.TERM)return s;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in r))||"codeship"===r.CI_NAME?1:s;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:s}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?i=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(i=1),"FORCE_COLOR"in r&&(i="true"===r.FORCE_COLOR?1:"false"===r.FORCE_COLOR?0:0===r.FORCE_COLOR.length?1:Math.min(parseInt(r.FORCE_COLOR,10),3)),supportsColor_1={supportsColor:function(e){return o(s(e,e&&e.isTTY))},stdout:o(s(!0,t.isatty(1))),stderr:o(s(!0,t.isatty(2)))},supportsColor_1}function requireUtil$1(){if(hasRequiredUtil$1)return util$1;hasRequiredUtil$1=1;return util$1={stringReplaceAll:(e,t,n)=>{let r=e.indexOf(t);if(-1===r)return e;const i=t.length;let o=0,s="";do{s+=e.substr(o,r-o)+t+n,o=r+i,r=e.indexOf(t,o)}while(-1!==r);return s+=e.substr(o),s},stringEncaseCRLFWithFirstIndex:(e,t,n,r)=>{let i=0,o="";do{const s="\r"===e[r-1];o+=e.substr(i,(s?r-1:r)-i)+t+(s?"\r\n":"\n")+n,i=r+1,r=e.indexOf("\n",i)}while(-1!==r);return o+=e.substr(i),o}},util$1}function requireTemplates(){if(hasRequiredTemplates)return templates;hasRequiredTemplates=1;const e=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,t=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,n=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,r=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,i=new Map([["n","\n"],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a",""]]);function o(e){const t="u"===e[0],n="{"===e[1];return t&&!n&&5===e.length||"x"===e[0]&&3===e.length?String.fromCharCode(parseInt(e.slice(1),16)):t&&n?String.fromCodePoint(parseInt(e.slice(2,-1),16)):i.get(e)||e}function s(e,t){const i=[],s=t.trim().split(/\s*,\s*/g);let a;for(const t of s){const s=Number(t);if(Number.isNaN(s)){if(!(a=t.match(n)))throw new Error(`Invalid Chalk template style argument: ${t} (in style '${e}')`);i.push(a[2].replace(r,((e,t,n)=>t?o(t):n)))}else i.push(s)}return i}function a(e){t.lastIndex=0;const n=[];let r;for(;null!==(r=t.exec(e));){const e=r[1];if(r[2]){const t=s(e,r[2]);n.push([e].concat(t))}else n.push([e])}return n}function c(e,t){const n={};for(const e of t)for(const t of e.styles)n[t[0]]=e.inverse?null:t.slice(1);let r=e;for(const[e,t]of Object.entries(n))if(Array.isArray(t)){if(!(e in r))throw new Error(`Unknown Chalk style: ${e}`);r=t.length>0?r[e](...t):r[e]}return r}return templates=(t,n)=>{const r=[],i=[];let s=[];if(n.replace(e,((e,n,l,u,d,p)=>{if(n)s.push(o(n));else if(u){const e=s.join("");s=[],i.push(0===r.length?e:c(t,r)(e)),r.push({inverse:l,styles:a(u)})}else if(d){if(0===r.length)throw new Error("Found extraneous } in Chalk template literal");i.push(c(t,r)(s.join(""))),s=[],r.pop()}else s.push(p)})),i.push(s.join("")),r.length>0){const e=`Chalk template literal is missing ${r.length} closing bracket${1===r.length?"":"s"} (\`}\`)`;throw new Error(e)}return i.join("")},templates}function requireSource(){if(hasRequiredSource)return source;hasRequiredSource=1;const e=requireAnsiStyles(),{stdout:t,stderr:n}=requireSupportsColor(),{stringReplaceAll:r,stringEncaseCRLFWithFirstIndex:i}=requireUtil$1(),{isArray:o}=Array,s=["ansi","ansi","ansi256","ansi16m"],a=Object.create(null);class c{constructor(e){return l(e)}}const l=e=>{const n={};return((e,n={})=>{if(n.level&&!(Number.isInteger(n.level)&&n.level>=0&&n.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const r=t?t.level:0;e.level=void 0===n.level?r:n.level})(n,e),n.template=(...e)=>g(n.template,...e),Object.setPrototypeOf(n,u.prototype),Object.setPrototypeOf(n.template,n),n.template.constructor=()=>{throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},n.template.Instance=c,n.template};function u(e){return l(e)}for(const[t,n]of Object.entries(e))a[t]={get(){const e=_(this,f(n.open,n.close,this._styler),this._isEmpty);return Object.defineProperty(this,t,{value:e}),e}};a.visible={get(){const e=_(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:e}),e}};const d=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(const t of d)a[t]={get(){const{level:n}=this;return function(...r){const i=f(e.color[s[n]][t](...r),e.color.close,this._styler);return _(this,i,this._isEmpty)}}};for(const t of d){a["bg"+t[0].toUpperCase()+t.slice(1)]={get(){const{level:n}=this;return function(...r){const i=f(e.bgColor[s[n]][t](...r),e.bgColor.close,this._styler);return _(this,i,this._isEmpty)}}}}const p=Object.defineProperties((()=>{}),{...a,level:{enumerable:!0,get(){return this._generator.level},set(e){this._generator.level=e}}}),f=(e,t,n)=>{let r,i;return void 0===n?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},_=(e,t,n)=>{const r=(...e)=>o(e[0])&&o(e[0].raw)?m(r,g(r,...e)):m(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,p),r._generator=e,r._styler=t,r._isEmpty=n,r},m=(e,t)=>{if(e.level<=0||!t)return e._isEmpty?"":t;let n=e._styler;if(void 0===n)return t;const{openAll:o,closeAll:s}=n;if(-1!==t.indexOf(""))for(;void 0!==n;)t=r(t,n.close,n.open),n=n.parent;const a=t.indexOf("\n");return-1!==a&&(t=i(t,s,o,a)),o+t+s};let h;const g=(e,...t)=>{const[n]=t;if(!o(n)||!o(n.raw))return t.join(" ");const r=t.slice(1),i=[n.raw[0]];for(let e=1;e<n.length;e++)i.push(String(r[e-1]).replace(/[{}\\]/g,"\\$&"),String(n.raw[e]));return void 0===h&&(h=requireTemplates()),h(e,i.join(""))};Object.defineProperties(u.prototype,a);const A=u();return A.supportsColor=t,A.stderr=u({level:n?n.level:0}),A.stderr.supportsColor=n,source=A}var json={},getMetaFromPath={exports:{}},utils$3={},hasRequiredUtils$3,hasRequiredGetMetaFromPath;function requireUtils$3(){if(hasRequiredUtils$3)return utils$3;hasRequiredUtils$3=1,Object.defineProperty(utils$3,"__esModule",{value:!0}),utils$3.getPointers=void 0;return utils$3.getPointers=function(e){var t=e.split("/").slice(1);for(var n in t)t[n]=t[n].split("~1").join("/").split("~0").join("~");return t},utils$3}function requireGetMetaFromPath(){return hasRequiredGetMetaFromPath||(hasRequiredGetMetaFromPath=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){var i=(0,n.getPointers)(t),o=i.length-1;return i.reduce((function(e,n,i){switch(e.type){case"Object":var s=e.members.filter((function(e){return e.name.value===n}));if(1!==s.length)throw new Error("Couldn't find property ".concat(n," of ").concat(t));var a=s[0],c=a.name,l=a.value;return r&&i===o?c:l;case"Array":return e.elements[n];default:console.log(e)}}),e.body)};var n=requireUtils$3();e.exports=t.default}(getMetaFromPath,getMetaFromPath.exports)),getMetaFromPath.exports}var getDecoratedDataPath={exports:{}},hasRequiredGetDecoratedDataPath,hasRequiredJson,hasRequiredBase,hasRequiredAdditionalProp;function requireGetDecoratedDataPath(){return hasRequiredGetDecoratedDataPath||(hasRequiredGetDecoratedDataPath=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var r="";return(0,n.getPointers)(t).reduce((function(e,n){switch(e.type){case"Object":r+="/".concat(n);var i=e.members.filter((function(e){return e.name.value===n}));if(1!==i.length)throw new Error("Couldn't find property ".concat(n," of ").concat(t));return i[0].value;case"Array":return r+="/".concat(n).concat(function(e){if(!e||!e.elements)return"";var t=e.elements.filter((function(e){return e&&e.name&&"type"===e.name.value}));if(!t.length)return"";return t[0].value&&":".concat(t[0].value.value)||""}(e.elements[n])),e.elements[n];default:console.log(e)}}),e.body),r};var n=requireUtils$3();e.exports=t.default}(getDecoratedDataPath,getDecoratedDataPath.exports)),getDecoratedDataPath.exports}function requireJson(){return hasRequiredJson||(hasRequiredJson=1,function(e){var t=requireInteropRequireDefault();Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getDecoratedDataPath",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"getMetaFromPath",{enumerable:!0,get:function(){return n.default}});var n=t(requireGetMetaFromPath()),r=t(requireGetDecoratedDataPath())}(json)),json}function requireBase(){return hasRequiredBase||(hasRequiredBase=1,function(e,t){var n=requireInteropRequireDefault();Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(requireClassCallCheck()),i=n(requireCreateClass()),o=requireLib$b(),s=n(requireSource()),a=requireJson(),c=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isIdentifierLocation:!1},n=arguments.length>1?arguments[1]:void 0,i=n.colorize,o=n.data,s=n.schema,a=n.jsonAst,c=n.jsonRaw;(0,r.default)(this,e),this.options=t,this.colorize=!(!i&&void 0!==i),this.data=o,this.schema=s,this.jsonAst=a,this.jsonRaw=c}return(0,i.default)(e,[{key:"getChalk",value:function(){return this.colorize?s.default:new s.default.Instance({level:0})}},{key:"getLocation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.instancePath,t=this.options,n=t.isIdentifierLocation,r=t.isSkipEndLocation,i=(0,a.getMetaFromPath)(this.jsonAst,e,n).loc;return{start:i.start,end:r?void 0:i.end}}},{key:"getDecoratedPath",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.instancePath;return(0,a.getDecoratedDataPath)(this.jsonAst,e)}},{key:"getCodeFrame",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.instancePath;return(0,o.codeFrameColumns)(this.jsonRaw,this.getLocation(t),{highlightCode:!1,message:e})}},{key:"instancePath",get:function(){return void 0!==this.options.instancePath?this.options.instancePath:this.options.dataPath}},{key:"print",value:function(){throw new Error("Implement the 'print' method inside ".concat(this.constructor.name,"!"))}},{key:"getError",value:function(){throw new Error("Implement the 'getError' method inside ".concat(this.constructor.name,"!"))}}]),e}();t.default=c,e.exports=t.default}(base,base.exports)),base.exports}function requireAdditionalProp(){return hasRequiredAdditionalProp||(hasRequiredAdditionalProp=1,function(e,t){var n=requireInteropRequireDefault();Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i,o=n(requireDefineProperty()),s=n(requireTaggedTemplateLiteral()),a=n(requireClassCallCheck()),c=n(requireCreateClass()),l=n(requireInherits()),u=n(requirePossibleConstructorReturn()),d=n(requireGetPrototypeOf());function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,d.default)(e);if(t){var i=(0,d.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var m=function(e){(0,l.default)(n,e);var t=_(n);function n(){var e;(0,a.default)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).name="AdditionalPropValidationError",e.options.isIdentifierLocation=!0,e}return(0,c.default)(n,[{key:"print",value:function(){var e=this.options,t=e.message,n=e.params,o=this.getChalk();return[o(r||(r=(0,s.default)(["{red {bold ADDITIONAL PROPERTY} ","}\n"],["{red {bold ADDITIONAL PROPERTY} ","}\\n"])),t)].concat(this.getCodeFrame(o(i||(i=(0,s.default)(["😲 {magentaBright ","} is not expected to be here!"])),n.additionalProperty),"".concat(this.instancePath,"/").concat(n.additionalProperty)))}},{key:"getError",value:function(){var e=this.options.params;return f(f({},this.getLocation("".concat(this.instancePath,"/").concat(e.additionalProperty))),{},{error:"".concat(this.getDecoratedPath()," Property ").concat(e.additionalProperty," is not expected to be here"),path:this.instancePath})}}]),n}(n(requireBase()).default);t.default=m,e.exports=t.default}(additionalProp,additionalProp.exports)),additionalProp.exports}var _default={exports:{}},hasRequired_default;function require_default(){return hasRequired_default||(hasRequired_default=1,function(e,t){var n=requireInteropRequireDefault();Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i,o=n(requireDefineProperty()),s=n(requireTaggedTemplateLiteral()),a=n(requireClassCallCheck()),c=n(requireCreateClass()),l=n(requireInherits()),u=n(requirePossibleConstructorReturn()),d=n(requireGetPrototypeOf());function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,d.default)(e);if(t){var i=(0,d.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var m=function(e){(0,l.default)(n,e);var t=_(n);function n(){var e;(0,a.default)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).name="DefaultValidationError",e.options.isSkipEndLocation=!0,e}return(0,c.default)(n,[{key:"print",value:function(){var e=this.options,t=e.keyword,n=e.message,o=this.getChalk();return[o(r||(r=(0,s.default)(["{red {bold ","} ","}\n"],["{red {bold ","} ","}\\n"])),t.toUpperCase(),n)].concat(this.getCodeFrame(o(i||(i=(0,s.default)(["👈🏽 {magentaBright ","} ",""])),t,n)))}},{key:"getError",value:function(){var e=this.options,t=e.keyword,n=e.message;return f(f({},this.getLocation()),{},{error:"".concat(this.getDecoratedPath(),": ").concat(t," ").concat(n),path:this.instancePath})}}]),n}(n(requireBase()).default);t.default=m,e.exports=t.default}(_default,_default.exports)),_default.exports}var _enum$1={exports:{}},jsonpointer={},hasRequiredJsonpointer;function requireJsonpointer(){if(hasRequiredJsonpointer)return jsonpointer;hasRequiredJsonpointer=1;var e=/~/,t=/~[01]/g;function n(e){switch(e){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+e)}function r(r){return e.test(r)?r.replace(t,n):r}function i(e){if("string"==typeof e){if(""===(e=e.split("/"))[0])return e;throw new Error("Invalid JSON pointer.")}if(Array.isArray(e)){for(const t of e)if("string"!=typeof t&&"number"!=typeof t)throw new Error("Invalid JSON pointer. Must be of type string or number.");return e}throw new Error("Invalid JSON pointer.")}function o(e,t){if("object"!=typeof e)throw new Error("Invalid input object.");var n=(t=i(t)).length;if(1===n)return e;for(var o=1;o<n;){if(e=e[r(t[o++])],n===o)return e;if("object"!=typeof e||null===e)return}}function s(e,t,n){if("object"!=typeof e)throw new Error("Invalid input object.");if(0===(t=i(t)).length)throw new Error("Invalid JSON pointer for set.");return function(e,t,n){for(var i,o,s=1,a=t.length;s<a;){if("constructor"===t[s]||"prototype"===t[s]||"__proto__"===t[s])return e;if(i=r(t[s++]),o=a>s,void 0===e[i]&&(Array.isArray(e)&&"-"===i&&(i=e.length),o&&(""!==t[s]&&t[s]<1/0||"-"===t[s]?e[i]=[]:e[i]={})),!o)break;e=e[i]}var c=e[i];return void 0===n?delete e[i]:e[i]=n,c}(e,t,n)}return jsonpointer.get=o,jsonpointer.set=s,jsonpointer.compile=function(e){var t=i(e);return{get:function(e){return o(e,t)},set:function(e,n){return s(e,t,n)}}},jsonpointer}var leven={exports:{}},hasRequiredLeven,hasRequired_enum$1;function requireLeven(){if(hasRequiredLeven)return leven.exports;hasRequiredLeven=1;const e=[],t=[],n=(n,r)=>{if(n===r)return 0;const i=n;n.length>r.length&&(n=r,r=i);let o=n.length,s=r.length;for(;o>0&&n.charCodeAt(~-o)===r.charCodeAt(~-s);)o--,s--;let a,c,l,u,d=0;for(;d<o&&n.charCodeAt(d)===r.charCodeAt(d);)d++;if(o-=d,s-=d,0===o)return s;let p=0,f=0;for(;p<o;)t[p]=n.charCodeAt(d+p),e[p]=++p;for(;f<s;)for(a=r.charCodeAt(d+f),l=f++,c=f,p=0;p<o;p++)u=a===t[p]?l:l+1,l=e[p],c=e[p]=l>c?u>c?c+1:u:u>l?l+1:u;return c};return leven.exports=n,leven.exports.default=n,leven.exports}function require_enum$1(){return hasRequired_enum$1||(hasRequired_enum$1=1,function(e,t){var n=requireInteropRequireDefault();Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i,o,s,a=n(requireDefineProperty()),c=n(requireTaggedTemplateLiteral()),l=n(requireClassCallCheck()),u=n(requireCreateClass()),d=n(requireInherits()),p=n(requirePossibleConstructorReturn()),f=n(requireGetPrototypeOf()),_=n(requireJsonpointer()),m=n(requireLeven());function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,f.default)(e);if(t){var i=(0,f.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,p.default)(this,n)}}var y=function(e){(0,d.default)(n,e);var t=A(n);function n(){var e;(0,l.default)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).name="EnumValidationError",e}return(0,u.default)(n,[{key:"print",value:function(){var e=this.options,t=e.message,n=e.params.allowedValues,a=this.getChalk(),l=this.findBestMatch();return[a(r||(r=(0,c.default)(["{red {bold ENUM} ","}"])),t),a(i||(i=(0,c.default)(["{red (",")}\n"],["{red (",")}\\n"])),n.join(", "))].concat(this.getCodeFrame(null!==l?a(o||(o=(0,c.default)(["👈🏽 Did you mean {magentaBright ","} here?"])),l):a(s||(s=(0,c.default)(["👈🏽 Unexpected value, should be equal to one of the allowed values"])))))}},{key:"getError",value:function(){var e=this.options,t=e.message,n=e.params,r=this.findBestMatch(),i=n.allowedValues.join(", "),o=g(g({},this.getLocation()),{},{error:"".concat(this.getDecoratedPath()," ").concat(t,": ").concat(i),path:this.instancePath});return null!==r&&(o.suggestion="Did you mean ".concat(r,"?")),o}},{key:"findBestMatch",value:function(){var e=this.options.params.allowedValues,t=""===this.instancePath?this.data:_.default.get(this.data,this.instancePath);if(!t)return null;var n=e.map((function(e){return{value:e,weight:(0,m.default)(e,t.toString())}})).sort((function(e,t){return e.weight>t.weight?1:e.weight<t.weight?-1:0}))[0];return 1===e.length||n.weight<n.value.length?n.value:null}}]),n}(n(requireBase()).default);t.default=y,e.exports=t.default}(_enum$1,_enum$1.exports)),_enum$1.exports}var pattern$1={exports:{}},hasRequiredPattern$1;function requirePattern$1(){return hasRequiredPattern$1||(hasRequiredPattern$1=1,function(e,t){var n=requireInteropRequireDefault();Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i,o=n(requireDefineProperty()),s=n(requireTaggedTemplateLiteral()),a=n(requireClassCallCheck()),c=n(requireCreateClass()),l=n(requireInherits()),u=n(requirePossibleConstructorReturn()),d=n(requireGetPrototypeOf());function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,d.default)(e);if(t){var i=(0,d.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var m=function(e){(0,l.default)(n,e);var t=_(n);function n(){var e;(0,a.default)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).name="PatternValidationError",e.options.isIdentifierLocation=!0,e}return(0,c.default)(n,[{key:"print",value:function(){var e=this.options,t=e.message,n=e.params,o=e.propertyName,a=this.getChalk();return[a(r||(r=(0,s.default)(["{red {bold PROPERTY} ","}\n"],["{red {bold PROPERTY} ","}\\n"])),t)].concat(this.getCodeFrame(a(i||(i=(0,s.default)(["😲 must match pattern {magentaBright ","}"])),n.pattern),"".concat(this.instancePath,"/").concat(o)))}},{key:"getError",value:function(){var e=this.options,t=e.params,n=e.propertyName;return f(f({},this.getLocation()),{},{error:"".concat(this.getDecoratedPath(),' Property "').concat(n,'" must match pattern ').concat(t.pattern),path:this.instancePath})}}]),n}(n(requireBase()).default);t.default=m,e.exports=t.default}(pattern$1,pattern$1.exports)),pattern$1.exports}var required$2={exports:{}},get$1={exports:{}},superPropBase={exports:{}},hasRequiredSuperPropBase,hasRequiredGet$2,hasRequiredRequired$1;function requireSuperPropBase(){return hasRequiredSuperPropBase||(hasRequiredSuperPropBase=1,function(e){var t=requireGetPrototypeOf();e.exports=function(e,n){for(;!{}.hasOwnProperty.call(e,n)&&null!==(e=t(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports}(superPropBase)),superPropBase.exports}function requireGet$2(){return hasRequiredGet$2||(hasRequiredGet$2=1,function(e){var t=requireSuperPropBase();function n(){return e.exports=n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,n,r){var i=t(e,n);if(i){var o=Object.getOwnPropertyDescriptor(i,n);return o.get?o.get.call(arguments.length<3?e:r):o.value}},e.exports.__esModule=!0,e.exports.default=e.exports,n.apply(null,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}(get$1)),get$1.exports}function requireRequired$1(){return hasRequiredRequired$1||(hasRequiredRequired$1=1,function(e,t){var n=requireInteropRequireDefault();Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i,o=n(requireDefineProperty()),s=n(requireTaggedTemplateLiteral()),a=n(requireClassCallCheck()),c=n(requireCreateClass()),l=n(requireGet$2()),u=n(requireInherits()),d=n(requirePossibleConstructorReturn()),p=n(requireGetPrototypeOf());function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,p.default)(e);if(t){var i=(0,p.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,d.default)(this,n)}}var h=function(e){(0,u.default)(n,e);var t=m(n);function n(){var e;(0,a.default)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).name="RequiredValidationError",e}return(0,c.default)(n,[{key:"getLocation",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.instancePath;return{start:(0,l.default)((0,p.default)(n.prototype),"getLocation",this).call(this,e).start}}},{key:"print",value:function(){var e=this.options,t=e.message,n=e.params,o=this.getChalk();return[o(r||(r=(0,s.default)(["{red {bold REQUIRED} ","}\n"],["{red {bold REQUIRED} ","}\\n"])),t)].concat(this.getCodeFrame(o(i||(i=(0,s.default)(["☹️ {magentaBright ","} is missing here!"])),n.missingProperty)))}},{key:"getError",value:function(){var e=this.options.message;return _(_({},this.getLocation()),{},{error:"".concat(this.getDecoratedPath()," ").concat(e),path:this.instancePath})}}]),n}(n(requireBase()).default);t.default=h,e.exports=t.default}(required$2,required$2.exports)),required$2.exports}var unevaluatedProp={exports:{}},hasRequiredUnevaluatedProp,hasRequiredValidationErrors,hasRequiredHelpers,hasRequiredLib$a;function requireUnevaluatedProp(){return hasRequiredUnevaluatedProp||(hasRequiredUnevaluatedProp=1,function(e,t){var n=requireInteropRequireDefault();Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,i,o=n(requireDefineProperty()),s=n(requireTaggedTemplateLiteral()),a=n(requireClassCallCheck()),c=n(requireCreateClass()),l=n(requireInherits()),u=n(requirePossibleConstructorReturn()),d=n(requireGetPrototypeOf());function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){(0,o.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,d.default)(e);if(t){var i=(0,d.default)(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return(0,u.default)(this,n)}}var m=function(e){(0,l.default)(n,e);var t=_(n);function n(){var e;(0,a.default)(this,n);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).name="UnevaluatedPropValidationError",e.options.isIdentifierLocation=!0,e}return(0,c.default)(n,[{key:"print",value:function(){var e=this.options,t=e.message,n=e.params,o=this.getChalk();return[o(r||(r=(0,s.default)(["{red {bold UNEVALUATED PROPERTY} ","}\n"],["{red {bold UNEVALUATED PROPERTY} ","}\\n"])),t)].concat(this.getCodeFrame(o(i||(i=(0,s.default)(["😲 {magentaBright ","} is not expected to be here!"])),n.unevaluatedProperty),"".concat(this.instancePath,"/").concat(n.unevaluatedProperty)))}},{key:"getError",value:function(){var e=this.options.params;return f(f({},this.getLocation("".concat(this.instancePath,"/").concat(e.unevaluatedProperty))),{},{error:"".concat(this.getDecoratedPath()," Property ").concat(e.unevaluatedProperty," is not expected to be here"),path:this.instancePath})}}]),n}(n(requireBase()).default);t.default=m,e.exports=t.default}(unevaluatedProp,unevaluatedProp.exports)),unevaluatedProp.exports}function requireValidationErrors(){return hasRequiredValidationErrors||(hasRequiredValidationErrors=1,function(e){var t=requireInteropRequireDefault();Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"AdditionalPropValidationError",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"DefaultValidationError",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"EnumValidationError",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"PatternValidationError",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"RequiredValidationError",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"UnevaluatedPropValidationError",{enumerable:!0,get:function(){return a.default}});var n=t(requireAdditionalProp()),r=t(require_default()),i=t(require_enum$1()),o=t(requirePattern$1()),s=t(requireRequired$1()),a=t(requireUnevaluatedProp())}(validationErrors)),validationErrors}function requireHelpers(){return hasRequiredHelpers||(hasRequiredHelpers=1,function(e){var t=requireInteropRequireDefault();Object.defineProperty(e,"__esModule",{value:!0}),e.createErrorInstances=p,e.default=function(e,t){var n=u(e||[]);return d(n),p(n,t)},e.filterRedundantErrors=d,e.makeTree=u;var n=t(requireDefineProperty()),r=t(requireToConsumableArray()),i=t(requireSlicedToArray()),o=requireUtils$4(),s=requireValidationErrors();function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){(0,n.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var l=/\/[\w_-]+(\/\d+)?/g;function u(){var e={children:{}};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((function(t){var n=void 0!==t.instancePath?t.instancePath:t.dataPath,r=""===n?[""]:n.match(l);r&&r.reduce((function(e,n,i){return e.children[n]=e.children[n]||{children:{},errors:[]},i===r.length-1&&e.children[n].errors.push(t),e.children[n]}),e)})),e}function d(e,t,n){(0,o.getErrors)(e).forEach((function(t){(0,o.isRequiredError)(t)&&(e.errors=[t],e.children={})})),(0,o.getErrors)(e).some(o.isAnyOfError)&&Object.keys(e.children).length>0&&delete e.errors,e.errors&&e.errors.length&&(0,o.getErrors)(e).every(o.isEnumError)&&(0,o.getSiblings)(t)(e).filter(o.notUndefined).some(o.getErrors)&&delete t.children[n],Object.entries(e.children).forEach((function(t){var n=(0,i.default)(t,2),r=n[0];return d(n[1],e,r)}))}function p(e,t){var n=(0,o.getErrors)(e);if(n.length&&n.every(o.isEnumError)){var i=new Set((0,o.concatAll)([])(n.map((function(e){return e.params.allowedValues})))),a=(0,r.default)(i),l=n[0];return[new s.EnumValidationError(c(c({},l),{},{params:{allowedValues:a}}),t)]}return(0,o.concatAll)(n.reduce((function(e,n){switch(n.keyword){case"additionalProperties":return e.concat(new s.AdditionalPropValidationError(n,t));case"pattern":return e.concat(new s.PatternValidationError(n,t));case"required":return e.concat(new s.RequiredValidationError(n,t));case"unevaluatedProperties":return e.concat(new s.UnevaluatedPropValidationError(n,t));default:return e.concat(new s.DefaultValidationError(n,t))}}),[]))((0,o.getChildren)(e).map((function(e){return p(e,t)})))}}(helpers)),helpers}function requireLib$a(){return hasRequiredLib$a||(hasRequiredLib$a=1,function(e,t){var n=requireInteropRequireDefault();Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=o.colorize,a=void 0===s||s,c=o.format,l=void 0===c?"cli":c,u=o.indent,d=void 0===u?null:u,p=o.json,f=void 0===p?null:p,_=f||JSON.stringify(t,null,d),m=(0,r.parse)(_),h=(0,i.default)(n,{colorize:a,data:t,schema:e,jsonAst:m,jsonRaw:_});if("cli"===l)return h.map((function(e){return e.print().join("\n")})).join("\n\n");return h.map((function(e){return e.getError()}))};var r=requireApi$1(),i=n(requireHelpers());e.exports=t.default}(lib$d,lib$d.exports)),lib$d.exports}var dist$3={},hasRequiredDist$3;function requireDist$3(){if(hasRequiredDist$3)return dist$3;hasRequiredDist$3=1,Object.defineProperty(dist$3,"__esModule",{value:!0});var e={v1:{id:"https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/schemas/v1.2/apiDeclaration.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["swaggerVersion","basePath","apis"],properties:{swaggerVersion:{enum:["1.2"]},apiVersion:{type:"string"},basePath:{type:"string",format:"uri",pattern:"^https?://"},resourcePath:{type:"string",format:"uri",pattern:"^/"},apis:{type:"array",items:{$ref:"#/definitions/apiObject"}},models:{type:"object",additionalProperties:{$ref:"modelsObject.json#"}},produces:{$ref:"#/definitions/mimeTypeArray"},consumes:{$ref:"#/definitions/mimeTypeArray"},authorizations:{$ref:"authorizationObject.json#"}},additionalProperties:!1,definitions:{apiObject:{type:"object",required:["path","operations"],properties:{path:{type:"string",format:"uri-template",pattern:"^/"},description:{type:"string"},operations:{type:"array",items:{$ref:"operationObject.json#"}}},additionalProperties:!1},mimeTypeArray:{type:"array",items:{type:"string",format:"mime-type"},uniqueItems:!0}}},v2:{title:"A JSON Schema for Swagger 2.0 API.",id:"http://swagger.io/v2/schema.json#",$schema:"http://json-schema.org/draft-04/schema#",type:"object",required:["swagger","info","paths"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{swagger:{type:"string",enum:["2.0"],description:"The Swagger version of this document."},info:{$ref:"#/definitions/info"},host:{type:"string",pattern:"^[^{}/ :\\\\]+(?::\\d+)?$",description:"The host (name or ip) of the API. Example: 'swagger.io'"},basePath:{type:"string",pattern:"^/",description:"The base path to the API. Example: '/api'."},schemes:{$ref:"#/definitions/schemesList"},consumes:{description:"A list of MIME types accepted by the API.",allOf:[{$ref:"#/definitions/mediaTypeList"}]},produces:{description:"A list of MIME types the API can produce.",allOf:[{$ref:"#/definitions/mediaTypeList"}]},paths:{$ref:"#/definitions/paths"},definitions:{$ref:"#/definitions/definitions"},parameters:{$ref:"#/definitions/parameterDefinitions"},responses:{$ref:"#/definitions/responseDefinitions"},security:{$ref:"#/definitions/security"},securityDefinitions:{$ref:"#/definitions/securityDefinitions"},tags:{type:"array",items:{$ref:"#/definitions/tag"},uniqueItems:!0},externalDocs:{$ref:"#/definitions/externalDocs"}},definitions:{info:{type:"object",description:"General information about the API.",required:["version","title"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{title:{type:"string",description:"A unique and precise title of the API."},version:{type:"string",description:"A semantic version number of the API."},description:{type:"string",description:"A longer description of the API. Should be different from the title. GitHub Flavored Markdown is allowed."},termsOfService:{type:"string",description:"The terms of service for the API."},contact:{$ref:"#/definitions/contact"},license:{$ref:"#/definitions/license"}}},contact:{type:"object",description:"Contact information for the owners of the API.",additionalProperties:!1,properties:{name:{type:"string",description:"The identifying name of the contact person/organization."},url:{type:"string",description:"The URL pointing to the contact information.",format:"uri"},email:{type:"string",description:"The email address of the contact person/organization.",format:"email"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},license:{type:"object",required:["name"],additionalProperties:!1,properties:{name:{type:"string",description:"The name of the license type. It's encouraged to use an OSI compatible license."},url:{type:"string",description:"The URL pointing to the license.",format:"uri"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},paths:{type:"object",description:"Relative paths to the individual endpoints. They must be relative to the 'basePath'.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"},"^/":{$ref:"#/definitions/pathItem"}},additionalProperties:!1},definitions:{type:"object",additionalProperties:{$ref:"#/definitions/schema"},description:"One or more JSON objects describing the schemas being consumed and produced by the API."},parameterDefinitions:{type:"object",additionalProperties:{$ref:"#/definitions/parameter"},description:"One or more JSON representations for parameters"},responseDefinitions:{type:"object",additionalProperties:{$ref:"#/definitions/response"},description:"One or more JSON representations for responses"},externalDocs:{type:"object",additionalProperties:!1,description:"information about external documentation",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},examples:{type:"object",additionalProperties:!0},mimeType:{type:"string",description:"The MIME type of the HTTP message."},operation:{type:"object",required:["responses"],additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{tags:{type:"array",items:{type:"string"},uniqueItems:!0},summary:{type:"string",description:"A brief summary of the operation."},description:{type:"string",description:"A longer description of the operation, GitHub Flavored Markdown is allowed."},externalDocs:{$ref:"#/definitions/externalDocs"},operationId:{type:"string",description:"A unique identifier of the operation."},produces:{description:"A list of MIME types the API can produce.",allOf:[{$ref:"#/definitions/mediaTypeList"}]},consumes:{description:"A list of MIME types the API can consume.",allOf:[{$ref:"#/definitions/mediaTypeList"}]},parameters:{$ref:"#/definitions/parametersList"},responses:{$ref:"#/definitions/responses"},schemes:{$ref:"#/definitions/schemesList"},deprecated:{type:"boolean",default:!1},security:{$ref:"#/definitions/security"}}},pathItem:{type:"object",additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{$ref:{type:"string"},get:{$ref:"#/definitions/operation"},put:{$ref:"#/definitions/operation"},post:{$ref:"#/definitions/operation"},delete:{$ref:"#/definitions/operation"},options:{$ref:"#/definitions/operation"},head:{$ref:"#/definitions/operation"},patch:{$ref:"#/definitions/operation"},parameters:{$ref:"#/definitions/parametersList"}}},responses:{type:"object",description:"Response objects names can either be any valid HTTP status code or 'default'.",minProperties:1,additionalProperties:!1,patternProperties:{"^([0-9]{3})$|^(default)$":{$ref:"#/definitions/responseValue"},"^x-":{$ref:"#/definitions/vendorExtension"}},not:{type:"object",additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}}},responseValue:{oneOf:[{$ref:"#/definitions/response"},{$ref:"#/definitions/jsonReference"}]},response:{type:"object",required:["description"],properties:{description:{type:"string"},schema:{oneOf:[{$ref:"#/definitions/schema"},{$ref:"#/definitions/fileSchema"}]},headers:{$ref:"#/definitions/headers"},examples:{$ref:"#/definitions/examples"}},additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},headers:{type:"object",additionalProperties:{$ref:"#/definitions/header"}},header:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{type:"string",enum:["string","number","integer","boolean","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},vendorExtension:{description:"Any property starting with x- is valid.",additionalProperties:!0,additionalItems:!0},bodyParameter:{type:"object",required:["name","in","schema"],patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},in:{type:"string",description:"Determines the location of the parameter.",enum:["body"]},required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.",default:!1},schema:{$ref:"#/definitions/schema"}},additionalProperties:!1},headerParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.",default:!1},in:{type:"string",description:"Determines the location of the parameter.",enum:["header"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},type:{type:"string",enum:["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},queryParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.",default:!1},in:{type:"string",description:"Determines the location of the parameter.",enum:["query"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},allowEmptyValue:{type:"boolean",default:!1,description:"allows sending a parameter by name only or with an empty value."},type:{type:"string",enum:["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormatWithMulti"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},formDataParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{required:{type:"boolean",description:"Determines whether or not this parameter is required or optional.",default:!1},in:{type:"string",description:"Determines the location of the parameter.",enum:["formData"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},allowEmptyValue:{type:"boolean",default:!1,description:"allows sending a parameter by name only or with an empty value."},type:{type:"string",enum:["string","number","boolean","integer","array","file"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormatWithMulti"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},pathParameterSubSchema:{additionalProperties:!1,patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},required:["required"],properties:{required:{type:"boolean",enum:[!0],description:"Determines whether or not this parameter is required or optional."},in:{type:"string",description:"Determines the location of the parameter.",enum:["path"]},description:{type:"string",description:"A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed."},name:{type:"string",description:"The name of the parameter."},type:{type:"string",enum:["string","number","boolean","integer","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}}},nonBodyParameter:{type:"object",required:["name","in","type"],oneOf:[{$ref:"#/definitions/headerParameterSubSchema"},{$ref:"#/definitions/formDataParameterSubSchema"},{$ref:"#/definitions/queryParameterSubSchema"},{$ref:"#/definitions/pathParameterSubSchema"}]},parameter:{oneOf:[{$ref:"#/definitions/bodyParameter"},{$ref:"#/definitions/nonBodyParameter"}]},schema:{type:"object",description:"A deterministic version of a JSON Schema object.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},properties:{$ref:{type:"string"},format:{type:"string"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},default:{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},multipleOf:{$ref:"http://json-schema.org/draft-04/schema#/properties/multipleOf"},maximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/maximum"},exclusiveMaximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},minimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/minimum"},exclusiveMinimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},maxLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},pattern:{$ref:"http://json-schema.org/draft-04/schema#/properties/pattern"},maxItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},uniqueItems:{$ref:"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},maxProperties:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minProperties:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},required:{$ref:"http://json-schema.org/draft-04/schema#/definitions/stringArray"},enum:{$ref:"http://json-schema.org/draft-04/schema#/properties/enum"},additionalProperties:{anyOf:[{$ref:"#/definitions/schema"},{type:"boolean"}],default:{}},type:{$ref:"http://json-schema.org/draft-04/schema#/properties/type"},items:{anyOf:[{$ref:"#/definitions/schema"},{type:"array",minItems:1,items:{$ref:"#/definitions/schema"}}],default:{}},allOf:{type:"array",minItems:1,items:{$ref:"#/definitions/schema"}},properties:{type:"object",additionalProperties:{$ref:"#/definitions/schema"},default:{}},discriminator:{type:"string"},readOnly:{type:"boolean",default:!1},xml:{$ref:"#/definitions/xml"},externalDocs:{$ref:"#/definitions/externalDocs"},example:{}},additionalProperties:!1},fileSchema:{type:"object",description:"A deterministic version of a JSON Schema object.",patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}},required:["type"],properties:{format:{type:"string"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},default:{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},required:{$ref:"http://json-schema.org/draft-04/schema#/definitions/stringArray"},type:{type:"string",enum:["file"]},readOnly:{type:"boolean",default:!1},externalDocs:{$ref:"#/definitions/externalDocs"},example:{}},additionalProperties:!1},primitivesItems:{type:"object",additionalProperties:!1,properties:{type:{type:"string",enum:["string","number","integer","boolean","array"]},format:{type:"string"},items:{$ref:"#/definitions/primitivesItems"},collectionFormat:{$ref:"#/definitions/collectionFormat"},default:{$ref:"#/definitions/default"},maximum:{$ref:"#/definitions/maximum"},exclusiveMaximum:{$ref:"#/definitions/exclusiveMaximum"},minimum:{$ref:"#/definitions/minimum"},exclusiveMinimum:{$ref:"#/definitions/exclusiveMinimum"},maxLength:{$ref:"#/definitions/maxLength"},minLength:{$ref:"#/definitions/minLength"},pattern:{$ref:"#/definitions/pattern"},maxItems:{$ref:"#/definitions/maxItems"},minItems:{$ref:"#/definitions/minItems"},uniqueItems:{$ref:"#/definitions/uniqueItems"},enum:{$ref:"#/definitions/enum"},multipleOf:{$ref:"#/definitions/multipleOf"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},security:{type:"array",items:{$ref:"#/definitions/securityRequirement"},uniqueItems:!0},securityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"},uniqueItems:!0}},xml:{type:"object",additionalProperties:!1,properties:{name:{type:"string"},namespace:{type:"string"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},tag:{type:"object",additionalProperties:!1,required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/externalDocs"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},securityDefinitions:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/basicAuthenticationSecurity"},{$ref:"#/definitions/apiKeySecurity"},{$ref:"#/definitions/oauth2ImplicitSecurity"},{$ref:"#/definitions/oauth2PasswordSecurity"},{$ref:"#/definitions/oauth2ApplicationSecurity"},{$ref:"#/definitions/oauth2AccessCodeSecurity"}]}},basicAuthenticationSecurity:{type:"object",additionalProperties:!1,required:["type"],properties:{type:{type:"string",enum:["basic"]},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},apiKeySecurity:{type:"object",additionalProperties:!1,required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query"]},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2ImplicitSecurity:{type:"object",additionalProperties:!1,required:["type","flow","authorizationUrl"],properties:{type:{type:"string",enum:["oauth2"]},flow:{type:"string",enum:["implicit"]},scopes:{$ref:"#/definitions/oauth2Scopes"},authorizationUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2PasswordSecurity:{type:"object",additionalProperties:!1,required:["type","flow","tokenUrl"],properties:{type:{type:"string",enum:["oauth2"]},flow:{type:"string",enum:["password"]},scopes:{$ref:"#/definitions/oauth2Scopes"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2ApplicationSecurity:{type:"object",additionalProperties:!1,required:["type","flow","tokenUrl"],properties:{type:{type:"string",enum:["oauth2"]},flow:{type:"string",enum:["application"]},scopes:{$ref:"#/definitions/oauth2Scopes"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2AccessCodeSecurity:{type:"object",additionalProperties:!1,required:["type","flow","authorizationUrl","tokenUrl"],properties:{type:{type:"string",enum:["oauth2"]},flow:{type:"string",enum:["accessCode"]},scopes:{$ref:"#/definitions/oauth2Scopes"},authorizationUrl:{type:"string",format:"uri"},tokenUrl:{type:"string",format:"uri"},description:{type:"string"}},patternProperties:{"^x-":{$ref:"#/definitions/vendorExtension"}}},oauth2Scopes:{type:"object",additionalProperties:{type:"string"}},mediaTypeList:{type:"array",items:{$ref:"#/definitions/mimeType"},uniqueItems:!0},parametersList:{type:"array",description:"The parameters needed to send a valid API call.",additionalItems:!1,items:{oneOf:[{$ref:"#/definitions/parameter"},{$ref:"#/definitions/jsonReference"}]},uniqueItems:!0},schemesList:{type:"array",description:"The transfer protocol of the API.",items:{type:"string",enum:["http","https","ws","wss"]},uniqueItems:!0},collectionFormat:{type:"string",enum:["csv","ssv","tsv","pipes"],default:"csv"},collectionFormatWithMulti:{type:"string",enum:["csv","ssv","tsv","pipes","multi"],default:"csv"},title:{$ref:"http://json-schema.org/draft-04/schema#/properties/title"},description:{$ref:"http://json-schema.org/draft-04/schema#/properties/description"},default:{$ref:"http://json-schema.org/draft-04/schema#/properties/default"},multipleOf:{$ref:"http://json-schema.org/draft-04/schema#/properties/multipleOf"},maximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/maximum"},exclusiveMaximum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum"},minimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/minimum"},exclusiveMinimum:{$ref:"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum"},maxLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minLength:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},pattern:{$ref:"http://json-schema.org/draft-04/schema#/properties/pattern"},maxItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveInteger"},minItems:{$ref:"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0"},uniqueItems:{$ref:"http://json-schema.org/draft-04/schema#/properties/uniqueItems"},enum:{$ref:"http://json-schema.org/draft-04/schema#/properties/enum"},jsonReference:{type:"object",required:["$ref"],additionalProperties:!1,properties:{$ref:{type:"string"}}}}},v3:{id:"https://spec.openapis.org/oas/3.0/schema/2021-09-28",$schema:"http://json-schema.org/draft-04/schema#",description:"The description of OpenAPI v3.0.x documents, as defined by https://spec.openapis.org/oas/v3.0.3",type:"object",required:["openapi","info","paths"],properties:{openapi:{type:"string",pattern:"^3\\.0\\.\\d(-.+)?$"},info:{$ref:"#/definitions/Info"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},tags:{type:"array",items:{$ref:"#/definitions/Tag"},uniqueItems:!0},paths:{$ref:"#/definitions/Paths"},components:{$ref:"#/definitions/Components"}},patternProperties:{"^x-":{}},additionalProperties:!1,definitions:{Reference:{type:"object",required:["$ref"],patternProperties:{"^\\$ref$":{type:"string",format:"uri-reference"}}},Info:{type:"object",required:["title","version"],properties:{title:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri-reference"},contact:{$ref:"#/definitions/Contact"},license:{$ref:"#/definitions/License"},version:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Contact:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"},email:{type:"string",format:"email"}},patternProperties:{"^x-":{}},additionalProperties:!1},License:{type:"object",required:["name"],properties:{name:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Server:{type:"object",required:["url"],properties:{url:{type:"string"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/definitions/ServerVariable"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ServerVariable:{type:"object",required:["default"],properties:{enum:{type:"array",items:{type:"string"}},default:{type:"string"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},Components:{type:"object",properties:{schemas:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}}},responses:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Response"}]}}},parameters:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Parameter"}]}}},examples:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Example"}]}}},requestBodies:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/RequestBody"}]}}},headers:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Header"}]}}},securitySchemes:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/SecurityScheme"}]}}},links:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Link"}]}}},callbacks:{type:"object",patternProperties:{"^[a-zA-Z0-9\\.\\-_]+$":{oneOf:[{$ref:"#/definitions/Reference"},{$ref:"#/definitions/Callback"}]}}}},patternProperties:{"^x-":{}},additionalProperties:!1},Schema:{type:"object",properties:{title:{type:"string"},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{type:"integer",minimum:0},minLength:{type:"integer",minimum:0,default:0},pattern:{type:"string",format:"regex"},maxItems:{type:"integer",minimum:0},minItems:{type:"integer",minimum:0,default:0},uniqueItems:{type:"boolean",default:!1},maxProperties:{type:"integer",minimum:0},minProperties:{type:"integer",minimum:0,default:0},required:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},enum:{type:"array",items:{},minItems:1,uniqueItems:!1},type:{type:"string",enum:["array","boolean","integer","number","object","string"]},not:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},allOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},oneOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},anyOf:{type:"array",items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},items:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},properties:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]}},additionalProperties:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"},{type:"boolean"}],default:!0},description:{type:"string"},format:{type:"string"},default:{},nullable:{type:"boolean",default:!1},discriminator:{$ref:"#/definitions/Discriminator"},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},example:{},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},deprecated:{type:"boolean",default:!1},xml:{$ref:"#/definitions/XML"}},patternProperties:{"^x-":{}},additionalProperties:!1},Discriminator:{type:"object",required:["propertyName"],properties:{propertyName:{type:"string"},mapping:{type:"object",additionalProperties:{type:"string"}}}},XML:{type:"object",properties:{name:{type:"string"},namespace:{type:"string",format:"uri"},prefix:{type:"string"},attribute:{type:"boolean",default:!1},wrapped:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},Response:{type:"object",required:["description"],properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},links:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Link"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1},MediaType:{type:"object",properties:{schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}},encoding:{type:"object",additionalProperties:{$ref:"#/definitions/Encoding"}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"}]},Example:{type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:{},externalValue:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},Header:{type:"object",properties:{description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string",enum:["simple"],default:"simple"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"}]},Paths:{type:"object",patternProperties:{"^\\/":{$ref:"#/definitions/PathItem"},"^x-":{}},additionalProperties:!1},PathItem:{type:"object",properties:{$ref:{type:"string"},summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/definitions/Server"}},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0}},patternProperties:{"^(get|put|post|delete|options|head|patch|trace)$":{$ref:"#/definitions/Operation"},"^x-":{}},additionalProperties:!1},Operation:{type:"object",required:["responses"],properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"},operationId:{type:"string"},parameters:{type:"array",items:{oneOf:[{$ref:"#/definitions/Parameter"},{$ref:"#/definitions/Reference"}]},uniqueItems:!0},requestBody:{oneOf:[{$ref:"#/definitions/RequestBody"},{$ref:"#/definitions/Reference"}]},responses:{$ref:"#/definitions/Responses"},callbacks:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Callback"},{$ref:"#/definitions/Reference"}]}},deprecated:{type:"boolean",default:!1},security:{type:"array",items:{$ref:"#/definitions/SecurityRequirement"}},servers:{type:"array",items:{$ref:"#/definitions/Server"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Responses:{type:"object",properties:{default:{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]}},patternProperties:{"^[1-5](?:\\d{2}|XX)$":{oneOf:[{$ref:"#/definitions/Response"},{$ref:"#/definitions/Reference"}]},"^x-":{}},minProperties:1,additionalProperties:!1},SecurityRequirement:{type:"object",additionalProperties:{type:"array",items:{type:"string"}}},Tag:{type:"object",required:["name"],properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/definitions/ExternalDocumentation"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExternalDocumentation:{type:"object",required:["url"],properties:{description:{type:"string"},url:{type:"string",format:"uri-reference"}},patternProperties:{"^x-":{}},additionalProperties:!1},ExampleXORExamples:{description:"Example and examples are mutually exclusive",not:{required:["example","examples"]}},SchemaXORContent:{description:"Schema and content are mutually exclusive, at least one is required",not:{required:["schema","content"]},oneOf:[{required:["schema"]},{required:["content"],description:"Some properties are not allowed if content is present",allOf:[{not:{required:["style"]}},{not:{required:["explode"]}},{not:{required:["allowReserved"]}},{not:{required:["example"]}},{not:{required:["examples"]}}]}]},Parameter:{type:"object",properties:{name:{type:"string"},in:{type:"string"},description:{type:"string"},required:{type:"boolean",default:!1},deprecated:{type:"boolean",default:!1},allowEmptyValue:{type:"boolean",default:!1},style:{type:"string"},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1},schema:{oneOf:[{$ref:"#/definitions/Schema"},{$ref:"#/definitions/Reference"}]},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"},minProperties:1,maxProperties:1},example:{},examples:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Example"},{$ref:"#/definitions/Reference"}]}}},patternProperties:{"^x-":{}},additionalProperties:!1,required:["name","in"],allOf:[{$ref:"#/definitions/ExampleXORExamples"},{$ref:"#/definitions/SchemaXORContent"},{$ref:"#/definitions/ParameterLocation"}]},ParameterLocation:{description:"Parameter location",oneOf:[{description:"Parameter in path",required:["required"],properties:{in:{enum:["path"]},style:{enum:["matrix","label","simple"],default:"simple"},required:{enum:[!0]}}},{description:"Parameter in query",properties:{in:{enum:["query"]},style:{enum:["form","spaceDelimited","pipeDelimited","deepObject"],default:"form"}}},{description:"Parameter in header",properties:{in:{enum:["header"]},style:{enum:["simple"],default:"simple"}}},{description:"Parameter in cookie",properties:{in:{enum:["cookie"]},style:{enum:["form"],default:"form"}}}]},RequestBody:{type:"object",required:["content"],properties:{description:{type:"string"},content:{type:"object",additionalProperties:{$ref:"#/definitions/MediaType"}},required:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1},SecurityScheme:{oneOf:[{$ref:"#/definitions/APIKeySecurityScheme"},{$ref:"#/definitions/HTTPSecurityScheme"},{$ref:"#/definitions/OAuth2SecurityScheme"},{$ref:"#/definitions/OpenIdConnectSecurityScheme"}]},APIKeySecurityScheme:{type:"object",required:["type","name","in"],properties:{type:{type:"string",enum:["apiKey"]},name:{type:"string"},in:{type:"string",enum:["header","query","cookie"]},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},HTTPSecurityScheme:{type:"object",required:["scheme","type"],properties:{scheme:{type:"string"},bearerFormat:{type:"string"},description:{type:"string"},type:{type:"string",enum:["http"]}},patternProperties:{"^x-":{}},additionalProperties:!1,oneOf:[{description:"Bearer",properties:{scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}},{description:"Non Bearer",not:{required:["bearerFormat"]},properties:{scheme:{not:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}}}}]},OAuth2SecurityScheme:{type:"object",required:["type","flows"],properties:{type:{type:"string",enum:["oauth2"]},flows:{$ref:"#/definitions/OAuthFlows"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OpenIdConnectSecurityScheme:{type:"object",required:["type","openIdConnectUrl"],properties:{type:{type:"string",enum:["openIdConnect"]},openIdConnectUrl:{type:"string",format:"uri-reference"},description:{type:"string"}},patternProperties:{"^x-":{}},additionalProperties:!1},OAuthFlows:{type:"object",properties:{implicit:{$ref:"#/definitions/ImplicitOAuthFlow"},password:{$ref:"#/definitions/PasswordOAuthFlow"},clientCredentials:{$ref:"#/definitions/ClientCredentialsFlow"},authorizationCode:{$ref:"#/definitions/AuthorizationCodeOAuthFlow"}},patternProperties:{"^x-":{}},additionalProperties:!1},ImplicitOAuthFlow:{type:"object",required:["authorizationUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},PasswordOAuthFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},ClientCredentialsFlow:{type:"object",required:["tokenUrl","scopes"],properties:{tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},AuthorizationCodeOAuthFlow:{type:"object",required:["authorizationUrl","tokenUrl","scopes"],properties:{authorizationUrl:{type:"string",format:"uri-reference"},tokenUrl:{type:"string",format:"uri-reference"},refreshUrl:{type:"string",format:"uri-reference"},scopes:{type:"object",additionalProperties:{type:"string"}}},patternProperties:{"^x-":{}},additionalProperties:!1},Link:{type:"object",properties:{operationId:{type:"string"},operationRef:{type:"string",format:"uri-reference"},parameters:{type:"object",additionalProperties:{}},requestBody:{},description:{type:"string"},server:{$ref:"#/definitions/Server"}},patternProperties:{"^x-":{}},additionalProperties:!1,not:{description:"Operation Id and Operation Ref are mutually exclusive",required:["operationId","operationRef"]}},Callback:{type:"object",additionalProperties:{$ref:"#/definitions/PathItem"},patternProperties:{"^x-":{}}},Encoding:{type:"object",properties:{contentType:{type:"string"},headers:{type:"object",additionalProperties:{oneOf:[{$ref:"#/definitions/Header"},{$ref:"#/definitions/Reference"}]}},style:{type:"string",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{type:"boolean",default:!1}},patternProperties:{"^x-":{}},additionalProperties:!1}}},v31:{$id:"https://spec.openapis.org/oas/3.1/schema/2022-10-07",$schema:"https://json-schema.org/draft/2020-12/schema",description:"The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0",type:"object",properties:{openapi:{type:"string",pattern:"^3\\.1\\.\\d+(-.+)?$"},info:{$ref:"#/$defs/info"},jsonSchemaDialect:{type:"string",format:"uri",default:"https://spec.openapis.org/oas/3.1/dialect/base"},servers:{type:"array",items:{$ref:"#/$defs/server"},default:[{url:"/"}]},paths:{$ref:"#/$defs/paths"},webhooks:{type:"object",additionalProperties:{$ref:"#/$defs/path-item-or-reference"}},components:{$ref:"#/$defs/components"},security:{type:"array",items:{$ref:"#/$defs/security-requirement"}},tags:{type:"array",items:{$ref:"#/$defs/tag"}},externalDocs:{$ref:"#/$defs/external-documentation"}},required:["openapi","info"],anyOf:[{required:["paths"]},{required:["components"]},{required:["webhooks"]}],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1,$defs:{info:{$comment:"https://spec.openapis.org/oas/v3.1.0#info-object",type:"object",properties:{title:{type:"string"},summary:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri"},contact:{$ref:"#/$defs/contact"},license:{$ref:"#/$defs/license"},version:{type:"string"}},required:["title","version"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},contact:{$comment:"https://spec.openapis.org/oas/v3.1.0#contact-object",type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri"},email:{type:"string",format:"email"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},license:{$comment:"https://spec.openapis.org/oas/v3.1.0#license-object",type:"object",properties:{name:{type:"string"},identifier:{type:"string"},url:{type:"string",format:"uri"}},required:["name"],dependentSchemas:{identifier:{not:{required:["url"]}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},server:{$comment:"https://spec.openapis.org/oas/v3.1.0#server-object",type:"object",properties:{url:{type:"string",format:"uri-reference"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/$defs/server-variable"}}},required:["url"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"server-variable":{$comment:"https://spec.openapis.org/oas/v3.1.0#server-variable-object",type:"object",properties:{enum:{type:"array",items:{type:"string"},minItems:1},default:{type:"string"},description:{type:"string"}},required:["default"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},components:{$comment:"https://spec.openapis.org/oas/v3.1.0#components-object",type:"object",properties:{schemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"}},responses:{type:"object",additionalProperties:{$ref:"#/$defs/response-or-reference"}},parameters:{type:"object",additionalProperties:{$ref:"#/$defs/parameter-or-reference"}},examples:{type:"object",additionalProperties:{$ref:"#/$defs/example-or-reference"}},requestBodies:{type:"object",additionalProperties:{$ref:"#/$defs/request-body-or-reference"}},headers:{type:"object",additionalProperties:{$ref:"#/$defs/header-or-reference"}},securitySchemes:{type:"object",additionalProperties:{$ref:"#/$defs/security-scheme-or-reference"}},links:{type:"object",additionalProperties:{$ref:"#/$defs/link-or-reference"}},callbacks:{type:"object",additionalProperties:{$ref:"#/$defs/callbacks-or-reference"}},pathItems:{type:"object",additionalProperties:{$ref:"#/$defs/path-item-or-reference"}}},patternProperties:{"^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$":{$comment:"Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected",propertyNames:{pattern:"^[a-zA-Z0-9._-]+$"}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},paths:{$comment:"https://spec.openapis.org/oas/v3.1.0#paths-object",type:"object",patternProperties:{"^/":{$ref:"#/$defs/path-item"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"path-item":{$comment:"https://spec.openapis.org/oas/v3.1.0#path-item-object",type:"object",properties:{summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/$defs/server"}},parameters:{type:"array",items:{$ref:"#/$defs/parameter-or-reference"}},get:{$ref:"#/$defs/operation"},put:{$ref:"#/$defs/operation"},post:{$ref:"#/$defs/operation"},delete:{$ref:"#/$defs/operation"},options:{$ref:"#/$defs/operation"},head:{$ref:"#/$defs/operation"},patch:{$ref:"#/$defs/operation"},trace:{$ref:"#/$defs/operation"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"path-item-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/path-item"}},operation:{$comment:"https://spec.openapis.org/oas/v3.1.0#operation-object",type:"object",properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/$defs/external-documentation"},operationId:{type:"string"},parameters:{type:"array",items:{$ref:"#/$defs/parameter-or-reference"}},requestBody:{$ref:"#/$defs/request-body-or-reference"},responses:{$ref:"#/$defs/responses"},callbacks:{type:"object",additionalProperties:{$ref:"#/$defs/callbacks-or-reference"}},deprecated:{default:!1,type:"boolean"},security:{type:"array",items:{$ref:"#/$defs/security-requirement"}},servers:{type:"array",items:{$ref:"#/$defs/server"}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"external-documentation":{$comment:"https://spec.openapis.org/oas/v3.1.0#external-documentation-object",type:"object",properties:{description:{type:"string"},url:{type:"string",format:"uri"}},required:["url"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},parameter:{$comment:"https://spec.openapis.org/oas/v3.1.0#parameter-object",type:"object",properties:{name:{type:"string"},in:{enum:["query","header","path","cookie"]},description:{type:"string"},required:{default:!1,type:"boolean"},deprecated:{default:!1,type:"boolean"},schema:{$dynamicRef:"#meta"},content:{$ref:"#/$defs/content",minProperties:1,maxProperties:1}},required:["name","in"],oneOf:[{required:["schema"]},{required:["content"]}],if:{properties:{in:{const:"query"}},required:["in"]},then:{properties:{allowEmptyValue:{default:!1,type:"boolean"}}},dependentSchemas:{schema:{properties:{style:{type:"string"},explode:{type:"boolean"}},allOf:[{$ref:"#/$defs/examples"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie"},{$ref:"#/$defs/styles-for-form"}],$defs:{"styles-for-path":{if:{properties:{in:{const:"path"}},required:["in"]},then:{properties:{style:{default:"simple",enum:["matrix","label","simple"]},required:{const:!0}},required:["required"]}},"styles-for-header":{if:{properties:{in:{const:"header"}},required:["in"]},then:{properties:{style:{default:"simple",const:"simple"}}}},"styles-for-query":{if:{properties:{in:{const:"query"}},required:["in"]},then:{properties:{style:{default:"form",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},allowReserved:{default:!1,type:"boolean"}}}},"styles-for-cookie":{if:{properties:{in:{const:"cookie"}},required:["in"]},then:{properties:{style:{default:"form",const:"form"}}}}}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"parameter-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/parameter"}},"request-body":{$comment:"https://spec.openapis.org/oas/v3.1.0#request-body-object",type:"object",properties:{description:{type:"string"},content:{$ref:"#/$defs/content"},required:{default:!1,type:"boolean"}},required:["content"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"request-body-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/request-body"}},content:{$comment:"https://spec.openapis.org/oas/v3.1.0#fixed-fields-10",type:"object",additionalProperties:{$ref:"#/$defs/media-type"},propertyNames:{format:"media-range"}},"media-type":{$comment:"https://spec.openapis.org/oas/v3.1.0#media-type-object",type:"object",properties:{schema:{$dynamicRef:"#meta"},encoding:{type:"object",additionalProperties:{$ref:"#/$defs/encoding"}}},allOf:[{$ref:"#/$defs/specification-extensions"},{$ref:"#/$defs/examples"}],unevaluatedProperties:!1},encoding:{$comment:"https://spec.openapis.org/oas/v3.1.0#encoding-object",type:"object",properties:{contentType:{type:"string",format:"media-range"},headers:{type:"object",additionalProperties:{$ref:"#/$defs/header-or-reference"}},style:{default:"form",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{default:!1,type:"boolean"}},allOf:[{$ref:"#/$defs/specification-extensions"},{$ref:"#/$defs/styles-for-form"}],unevaluatedProperties:!1},responses:{$comment:"https://spec.openapis.org/oas/v3.1.0#responses-object",type:"object",properties:{default:{$ref:"#/$defs/response-or-reference"}},patternProperties:{"^[1-5](?:[0-9]{2}|XX)$":{$ref:"#/$defs/response-or-reference"}},minProperties:1,$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1,if:{$comment:"either default, or at least one response code property must exist",patternProperties:{"^[1-5](?:[0-9]{2}|XX)$":!1}},then:{required:["default"]}},response:{$comment:"https://spec.openapis.org/oas/v3.1.0#response-object",type:"object",properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{$ref:"#/$defs/header-or-reference"}},content:{$ref:"#/$defs/content"},links:{type:"object",additionalProperties:{$ref:"#/$defs/link-or-reference"}}},required:["description"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"response-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/response"}},callbacks:{$comment:"https://spec.openapis.org/oas/v3.1.0#callback-object",type:"object",$ref:"#/$defs/specification-extensions",additionalProperties:{$ref:"#/$defs/path-item-or-reference"}},"callbacks-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/callbacks"}},example:{$comment:"https://spec.openapis.org/oas/v3.1.0#example-object",type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:!0,externalValue:{type:"string",format:"uri"}},not:{required:["value","externalValue"]},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"example-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/example"}},link:{$comment:"https://spec.openapis.org/oas/v3.1.0#link-object",type:"object",properties:{operationRef:{type:"string",format:"uri-reference"},operationId:{type:"string"},parameters:{$ref:"#/$defs/map-of-strings"},requestBody:!0,description:{type:"string"},body:{$ref:"#/$defs/server"}},oneOf:[{required:["operationRef"]},{required:["operationId"]}],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"link-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/link"}},header:{$comment:"https://spec.openapis.org/oas/v3.1.0#header-object",type:"object",properties:{description:{type:"string"},required:{default:!1,type:"boolean"},deprecated:{default:!1,type:"boolean"},schema:{$dynamicRef:"#meta"},content:{$ref:"#/$defs/content",minProperties:1,maxProperties:1}},oneOf:[{required:["schema"]},{required:["content"]}],dependentSchemas:{schema:{properties:{style:{default:"simple",const:"simple"},explode:{default:!1,type:"boolean"}},$ref:"#/$defs/examples"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"header-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/header"}},tag:{$comment:"https://spec.openapis.org/oas/v3.1.0#tag-object",type:"object",properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/$defs/external-documentation"}},required:["name"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},reference:{$comment:"https://spec.openapis.org/oas/v3.1.0#reference-object",type:"object",properties:{$ref:{type:"string",format:"uri-reference"},summary:{type:"string"},description:{type:"string"}}},schema:{$comment:"https://spec.openapis.org/oas/v3.1.0#schema-object",$dynamicAnchor:"meta",type:["object","boolean"]},"security-scheme":{$comment:"https://spec.openapis.org/oas/v3.1.0#security-scheme-object",type:"object",properties:{type:{enum:["apiKey","http","mutualTLS","oauth2","openIdConnect"]},description:{type:"string"}},required:["type"],allOf:[{$ref:"#/$defs/specification-extensions"},{$ref:"#/$defs/security-scheme/$defs/type-apikey"},{$ref:"#/$defs/security-scheme/$defs/type-http"},{$ref:"#/$defs/security-scheme/$defs/type-http-bearer"},{$ref:"#/$defs/security-scheme/$defs/type-oauth2"},{$ref:"#/$defs/security-scheme/$defs/type-oidc"}],unevaluatedProperties:!1,$defs:{"type-apikey":{if:{properties:{type:{const:"apiKey"}},required:["type"]},then:{properties:{name:{type:"string"},in:{enum:["query","header","cookie"]}},required:["name","in"]}},"type-http":{if:{properties:{type:{const:"http"}},required:["type"]},then:{properties:{scheme:{type:"string"}},required:["scheme"]}},"type-http-bearer":{if:{properties:{type:{const:"http"},scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}},required:["type","scheme"]},then:{properties:{bearerFormat:{type:"string"}}}},"type-oauth2":{if:{properties:{type:{const:"oauth2"}},required:["type"]},then:{properties:{flows:{$ref:"#/$defs/oauth-flows"}},required:["flows"]}},"type-oidc":{if:{properties:{type:{const:"openIdConnect"}},required:["type"]},then:{properties:{openIdConnectUrl:{type:"string",format:"uri"}},required:["openIdConnectUrl"]}}}},"security-scheme-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/security-scheme"}},"oauth-flows":{type:"object",properties:{implicit:{$ref:"#/$defs/oauth-flows/$defs/implicit"},password:{$ref:"#/$defs/oauth-flows/$defs/password"},clientCredentials:{$ref:"#/$defs/oauth-flows/$defs/client-credentials"},authorizationCode:{$ref:"#/$defs/oauth-flows/$defs/authorization-code"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1,$defs:{implicit:{type:"object",properties:{authorizationUrl:{type:"string",format:"uri"},refreshUrl:{type:"string",format:"uri"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["authorizationUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},password:{type:"object",properties:{tokenUrl:{type:"string",format:"uri"},refreshUrl:{type:"string",format:"uri"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["tokenUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"client-credentials":{type:"object",properties:{tokenUrl:{type:"string",format:"uri"},refreshUrl:{type:"string",format:"uri"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["tokenUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"authorization-code":{type:"object",properties:{authorizationUrl:{type:"string",format:"uri"},tokenUrl:{type:"string",format:"uri"},refreshUrl:{type:"string",format:"uri"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["authorizationUrl","tokenUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1}}},"security-requirement":{$comment:"https://spec.openapis.org/oas/v3.1.0#security-requirement-object",type:"object",additionalProperties:{type:"array",items:{type:"string"}}},"specification-extensions":{$comment:"https://spec.openapis.org/oas/v3.1.0#specification-extensions",patternProperties:{"^x-":!0}},examples:{properties:{example:!0,examples:{type:"object",additionalProperties:{$ref:"#/$defs/example-or-reference"}}}},"map-of-strings":{type:"object",additionalProperties:{type:"string"}},"styles-for-form":{if:{properties:{style:{const:"form"}},required:["style"]},then:{properties:{explode:{default:!0}}},else:{properties:{explode:{default:!1}}}}}},v31legacy:{$id:"https://spec.openapis.org/oas/3.1/schema/2022-10-07",$schema:"https://json-schema.org/draft/2020-12/schema",description:"The description of OpenAPI v3.1.x documents without schema validation, as defined by https://spec.openapis.org/oas/v3.1.0",type:"object",properties:{openapi:{type:"string",pattern:"^3\\.1\\.\\d+(-.+)?$"},info:{$ref:"#/$defs/info"},jsonSchemaDialect:{type:"string",format:"uri",default:"https://spec.openapis.org/oas/3.1/dialect/base"},servers:{type:"array",items:{$ref:"#/$defs/server"},default:[{url:"/"}]},paths:{$ref:"#/$defs/paths"},webhooks:{type:"object",additionalProperties:{$ref:"#/$defs/path-item-or-reference"}},components:{$ref:"#/$defs/components"},security:{type:"array",items:{$ref:"#/$defs/security-requirement"}},tags:{type:"array",items:{$ref:"#/$defs/tag"}},externalDocs:{$ref:"#/$defs/external-documentation"}},required:["openapi","info"],anyOf:[{required:["paths"]},{required:["components"]},{required:["webhooks"]}],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1,$defs:{info:{$comment:"https://spec.openapis.org/oas/v3.1.0#info-object",type:"object",properties:{title:{type:"string"},summary:{type:"string"},description:{type:"string"},termsOfService:{type:"string",format:"uri"},contact:{$ref:"#/$defs/contact"},license:{$ref:"#/$defs/license"},version:{type:"string"}},required:["title","version"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},contact:{$comment:"https://spec.openapis.org/oas/v3.1.0#contact-object",type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri"},email:{type:"string",format:"email"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},license:{$comment:"https://spec.openapis.org/oas/v3.1.0#license-object",type:"object",properties:{name:{type:"string"},identifier:{type:"string"},url:{type:"string",format:"uri"}},required:["name"],dependentSchemas:{identifier:{not:{required:["url"]}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},server:{$comment:"https://spec.openapis.org/oas/v3.1.0#server-object",type:"object",properties:{url:{type:"string",format:"uri-reference"},description:{type:"string"},variables:{type:"object",additionalProperties:{$ref:"#/$defs/server-variable"}}},required:["url"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"server-variable":{$comment:"https://spec.openapis.org/oas/v3.1.0#server-variable-object",type:"object",properties:{enum:{type:"array",items:{type:"string"},minItems:1},default:{type:"string"},description:{type:"string"}},required:["default"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},components:{$comment:"https://spec.openapis.org/oas/v3.1.0#components-object",type:"object",properties:{schemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"}},responses:{type:"object",additionalProperties:{$ref:"#/$defs/response-or-reference"}},parameters:{type:"object",additionalProperties:{$ref:"#/$defs/parameter-or-reference"}},examples:{type:"object",additionalProperties:{$ref:"#/$defs/example-or-reference"}},requestBodies:{type:"object",additionalProperties:{$ref:"#/$defs/request-body-or-reference"}},headers:{type:"object",additionalProperties:{$ref:"#/$defs/header-or-reference"}},securitySchemes:{type:"object",additionalProperties:{$ref:"#/$defs/security-scheme-or-reference"}},links:{type:"object",additionalProperties:{$ref:"#/$defs/link-or-reference"}},callbacks:{type:"object",additionalProperties:{$ref:"#/$defs/callbacks-or-reference"}},pathItems:{type:"object",additionalProperties:{$ref:"#/$defs/path-item-or-reference"}}},patternProperties:{"^(schemas|responses|parameters|examples|requestBodies|headers|securitySchemes|links|callbacks|pathItems)$":{$comment:"Enumerating all of the property names in the regex above is necessary for unevaluatedProperties to work as expected",propertyNames:{pattern:"^[a-zA-Z0-9._-]+$"}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},paths:{$comment:"https://spec.openapis.org/oas/v3.1.0#paths-object",type:"object",patternProperties:{"^/":{$ref:"#/$defs/path-item"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"path-item":{$comment:"https://spec.openapis.org/oas/v3.1.0#path-item-object",type:"object",properties:{summary:{type:"string"},description:{type:"string"},servers:{type:"array",items:{$ref:"#/$defs/server"}},parameters:{type:"array",items:{$ref:"#/$defs/parameter-or-reference"}},get:{$ref:"#/$defs/operation"},put:{$ref:"#/$defs/operation"},post:{$ref:"#/$defs/operation"},delete:{$ref:"#/$defs/operation"},options:{$ref:"#/$defs/operation"},head:{$ref:"#/$defs/operation"},patch:{$ref:"#/$defs/operation"},trace:{$ref:"#/$defs/operation"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"path-item-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/path-item"}},operation:{$comment:"https://spec.openapis.org/oas/v3.1.0#operation-object",type:"object",properties:{tags:{type:"array",items:{type:"string"}},summary:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/$defs/external-documentation"},operationId:{type:"string"},parameters:{type:"array",items:{$ref:"#/$defs/parameter-or-reference"}},requestBody:{$ref:"#/$defs/request-body-or-reference"},responses:{$ref:"#/$defs/responses"},callbacks:{type:"object",additionalProperties:{$ref:"#/$defs/callbacks-or-reference"}},deprecated:{default:!1,type:"boolean"},security:{type:"array",items:{$ref:"#/$defs/security-requirement"}},servers:{type:"array",items:{$ref:"#/$defs/server"}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"external-documentation":{$comment:"https://spec.openapis.org/oas/v3.1.0#external-documentation-object",type:"object",properties:{description:{type:"string"},url:{type:"string",format:"uri"}},required:["url"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},parameter:{$comment:"https://spec.openapis.org/oas/v3.1.0#parameter-object",type:"object",properties:{name:{type:"string"},in:{enum:["query","header","path","cookie"]},description:{type:"string"},required:{default:!1,type:"boolean"},deprecated:{default:!1,type:"boolean"},schema:{$dynamicRef:"#meta"},content:{$ref:"#/$defs/content",minProperties:1,maxProperties:1}},required:["name","in"],oneOf:[{required:["schema"]},{required:["content"]}],if:{properties:{in:{const:"query"}},required:["in"]},then:{properties:{allowEmptyValue:{default:!1,type:"boolean"}}},dependentSchemas:{schema:{properties:{style:{type:"string"},explode:{type:"boolean"}},allOf:[{$ref:"#/$defs/examples"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-path"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-header"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-query"},{$ref:"#/$defs/parameter/dependentSchemas/schema/$defs/styles-for-cookie"},{$ref:"#/$defs/styles-for-form"}],$defs:{"styles-for-path":{if:{properties:{in:{const:"path"}},required:["in"]},then:{properties:{style:{default:"simple",enum:["matrix","label","simple"]},required:{const:!0}},required:["required"]}},"styles-for-header":{if:{properties:{in:{const:"header"}},required:["in"]},then:{properties:{style:{default:"simple",const:"simple"}}}},"styles-for-query":{if:{properties:{in:{const:"query"}},required:["in"]},then:{properties:{style:{default:"form",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},allowReserved:{default:!1,type:"boolean"}}}},"styles-for-cookie":{if:{properties:{in:{const:"cookie"}},required:["in"]},then:{properties:{style:{default:"form",const:"form"}}}}}}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"parameter-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/parameter"}},"request-body":{$comment:"https://spec.openapis.org/oas/v3.1.0#request-body-object",type:"object",properties:{description:{type:"string"},content:{$ref:"#/$defs/content"},required:{default:!1,type:"boolean"}},required:["content"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"request-body-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/request-body"}},content:{$comment:"https://spec.openapis.org/oas/v3.1.0#fixed-fields-10",type:"object",additionalProperties:{$ref:"#/$defs/media-type"},propertyNames:{format:"media-range"}},"media-type":{$comment:"https://spec.openapis.org/oas/v3.1.0#media-type-object",type:"object",properties:{schema:{$dynamicRef:"#meta"},encoding:{type:"object",additionalProperties:{$ref:"#/$defs/encoding"}}},allOf:[{$ref:"#/$defs/specification-extensions"},{$ref:"#/$defs/examples"}],unevaluatedProperties:!1},encoding:{$comment:"https://spec.openapis.org/oas/v3.1.0#encoding-object",type:"object",properties:{contentType:{type:"string",format:"media-range"},headers:{type:"object",additionalProperties:{$ref:"#/$defs/header-or-reference"}},style:{default:"form",enum:["form","spaceDelimited","pipeDelimited","deepObject"]},explode:{type:"boolean"},allowReserved:{default:!1,type:"boolean"}},allOf:[{$ref:"#/$defs/specification-extensions"},{$ref:"#/$defs/styles-for-form"}],unevaluatedProperties:!1},responses:{$comment:"https://spec.openapis.org/oas/v3.1.0#responses-object",type:"object",properties:{default:{$ref:"#/$defs/response-or-reference"}},patternProperties:{"^[1-5](?:[0-9]{2}|XX)$":{$ref:"#/$defs/response-or-reference"}},minProperties:1,$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1,if:{$comment:"either default, or at least one response code property must exist",patternProperties:{"^[1-5](?:[0-9]{2}|XX)$":!1}},then:{required:["default"]}},response:{$comment:"https://spec.openapis.org/oas/v3.1.0#response-object",type:"object",properties:{description:{type:"string"},headers:{type:"object",additionalProperties:{$ref:"#/$defs/header-or-reference"}},content:{$ref:"#/$defs/content"},links:{type:"object",additionalProperties:{$ref:"#/$defs/link-or-reference"}}},required:["description"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"response-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/response"}},callbacks:{$comment:"https://spec.openapis.org/oas/v3.1.0#callback-object",type:"object",$ref:"#/$defs/specification-extensions",additionalProperties:{$ref:"#/$defs/path-item-or-reference"}},"callbacks-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/callbacks"}},example:{$comment:"https://spec.openapis.org/oas/v3.1.0#example-object",type:"object",properties:{summary:{type:"string"},description:{type:"string"},value:!0,externalValue:{type:"string",format:"uri"}},not:{required:["value","externalValue"]},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"example-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/example"}},link:{$comment:"https://spec.openapis.org/oas/v3.1.0#link-object",type:"object",properties:{operationRef:{type:"string",format:"uri-reference"},operationId:{type:"string"},parameters:{$ref:"#/$defs/map-of-strings"},requestBody:!0,description:{type:"string"},body:{$ref:"#/$defs/server"}},oneOf:[{required:["operationRef"]},{required:["operationId"]}],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"link-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/link"}},header:{$comment:"https://spec.openapis.org/oas/v3.1.0#header-object",type:"object",properties:{description:{type:"string"},required:{default:!1,type:"boolean"},deprecated:{default:!1,type:"boolean"},schema:{type:["object","boolean"]},content:{$ref:"#/$defs/content",minProperties:1,maxProperties:1}},oneOf:[{required:["schema"]},{required:["content"]}],dependentSchemas:{schema:{properties:{style:{default:"simple",const:"simple"},explode:{default:!1,type:"boolean"}},$ref:"#/$defs/examples"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"header-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/header"}},tag:{$comment:"https://spec.openapis.org/oas/v3.1.0#tag-object",type:"object",properties:{name:{type:"string"},description:{type:"string"},externalDocs:{$ref:"#/$defs/external-documentation"}},required:["name"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},reference:{$comment:"https://spec.openapis.org/oas/v3.1.0#reference-object",type:"object",properties:{$ref:{type:"string",format:"uri-reference"},summary:{type:"string"},description:{type:"string"}}},schema:{$comment:"https://spec.openapis.org/oas/v3.1.0#schema-object",$dynamicAnchor:"meta",type:["object","boolean"]},"security-scheme":{$comment:"https://spec.openapis.org/oas/v3.1.0#security-scheme-object",type:"object",properties:{type:{enum:["apiKey","http","mutualTLS","oauth2","openIdConnect"]},description:{type:"string"}},required:["type"],allOf:[{$ref:"#/$defs/specification-extensions"},{$ref:"#/$defs/security-scheme/$defs/type-apikey"},{$ref:"#/$defs/security-scheme/$defs/type-http"},{$ref:"#/$defs/security-scheme/$defs/type-http-bearer"},{$ref:"#/$defs/security-scheme/$defs/type-oauth2"},{$ref:"#/$defs/security-scheme/$defs/type-oidc"}],unevaluatedProperties:!1,$defs:{"type-apikey":{if:{properties:{type:{const:"apiKey"}},required:["type"]},then:{properties:{name:{type:"string"},in:{enum:["query","header","cookie"]}},required:["name","in"]}},"type-http":{if:{properties:{type:{const:"http"}},required:["type"]},then:{properties:{scheme:{type:"string"}},required:["scheme"]}},"type-http-bearer":{if:{properties:{type:{const:"http"},scheme:{type:"string",pattern:"^[Bb][Ee][Aa][Rr][Ee][Rr]$"}},required:["type","scheme"]},then:{properties:{bearerFormat:{type:"string"}}}},"type-oauth2":{if:{properties:{type:{const:"oauth2"}},required:["type"]},then:{properties:{flows:{$ref:"#/$defs/oauth-flows"}},required:["flows"]}},"type-oidc":{if:{properties:{type:{const:"openIdConnect"}},required:["type"]},then:{properties:{openIdConnectUrl:{type:"string",format:"uri"}},required:["openIdConnectUrl"]}}}},"security-scheme-or-reference":{if:{type:"object",required:["$ref"]},then:{$ref:"#/$defs/reference"},else:{$ref:"#/$defs/security-scheme"}},"oauth-flows":{type:"object",properties:{implicit:{$ref:"#/$defs/oauth-flows/$defs/implicit"},password:{$ref:"#/$defs/oauth-flows/$defs/password"},clientCredentials:{$ref:"#/$defs/oauth-flows/$defs/client-credentials"},authorizationCode:{$ref:"#/$defs/oauth-flows/$defs/authorization-code"}},$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1,$defs:{implicit:{type:"object",properties:{authorizationUrl:{type:"string",format:"uri"},refreshUrl:{type:"string",format:"uri"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["authorizationUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},password:{type:"object",properties:{tokenUrl:{type:"string",format:"uri"},refreshUrl:{type:"string",format:"uri"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["tokenUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"client-credentials":{type:"object",properties:{tokenUrl:{type:"string",format:"uri"},refreshUrl:{type:"string",format:"uri"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["tokenUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1},"authorization-code":{type:"object",properties:{authorizationUrl:{type:"string",format:"uri"},tokenUrl:{type:"string",format:"uri"},refreshUrl:{type:"string",format:"uri"},scopes:{$ref:"#/$defs/map-of-strings"}},required:["authorizationUrl","tokenUrl","scopes"],$ref:"#/$defs/specification-extensions",unevaluatedProperties:!1}}},"security-requirement":{$comment:"https://spec.openapis.org/oas/v3.1.0#security-requirement-object",type:"object",additionalProperties:{type:"array",items:{type:"string"}}},"specification-extensions":{$comment:"https://spec.openapis.org/oas/v3.1.0#specification-extensions",patternProperties:{"^x-":!0}},examples:{properties:{example:!0,examples:{type:"object",additionalProperties:{$ref:"#/$defs/example-or-reference"}}}},"map-of-strings":{type:"object",additionalProperties:{type:"string"}},"styles-for-form":{if:{properties:{style:{const:"form"}},required:["style"]},then:{properties:{explode:{default:!0}}},else:{properties:{explode:{default:!1}}}}}}};return dist$3.openapi=e,dist$3}var _2020={exports:{}},core$2={},validate$1={},boolSchema={},errors={},codegen={},code$1={},hasRequiredCode$1;function requireCode$1(){return hasRequiredCode$1||(hasRequiredCode$1=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class r extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce(((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e)),{})}}function i(e,...t){const n=[e[0]];let i=0;for(;i<t.length;)a(n,t[i]),n.push(e[++i]);return new r(n)}e._Code=r,e.nil=new r(""),e._=i;const o=new r("+");function s(e,...t){const n=[l(e[0])];let i=0;for(;i<t.length;)n.push(o),a(n,t[i]),n.push(o,l(e[++i]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===o){const n=c(e[t-1],e[t+1]);if(void 0!==n){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}(n),new r(n)}function a(e,t){var i;t instanceof r?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(i=t)||"boolean"==typeof i||null===i?i:l(Array.isArray(i)?i.join(","):i))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function l(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=s,e.addCodeArg=a,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},e.stringify=function(e){return new r(l(e))},e.safeStringify=l,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new r(`.${t}`):i`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new r(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new r(e.toString())}}(code$1)),code$1}var scope={},hasRequiredScope,hasRequiredCodegen;function requireScope(){return hasRequiredScope||(hasRequiredScope=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=requireCode$1();class n extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var r;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class i{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,n;if((null===(n=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===n?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}e.Scope=i;class o extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=t._`.${new t.Name(n)}[${r}]`}}e.ValueScopeName=o;const s=t._`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?s:t.nil}}get(){return this._scope}name(e){return new o(e,this._newName(e))}value(e,t){var n;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(e),{prefix:i}=r,o=null!==(n=t.key)&&void 0!==n?n:t.ref;let s=this._values[i];if(s){const e=s.get(o);if(e)return e}else s=this._values[i]=new Map;s.set(o,r);const a=this._scope[i]||(this._scope[i]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:i,itemIndex:c}),r}getValue(e,t){const n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,(n=>{if(void 0===n.scopePath)throw new Error(`CodeGen: name "${n}" has no value`);return t._`${e}${n.scopePath}`}))}scopeCode(e=this._values,t,n){return this._reduceValues(e,(e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,n)}_reduceValues(i,o,s={},a){let c=t.nil;for(const l in i){const u=i[l];if(!u)continue;const d=s[l]=s[l]||new Map;u.forEach((i=>{if(d.has(i))return;d.set(i,r.Started);let s=o(i);if(s){const n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${n} ${i} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(i)))throw new n(i);c=t._`${c}${s}${this.opts._n}`}d.set(i,r.Completed)}))}return c}}}(scope)),scope}function requireCodegen(){return hasRequiredCodegen||(hasRequiredCodegen=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=requireCode$1(),n=requireScope();var r=requireCode$1();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=requireScope();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class s extends o{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){const r=e?n.varKinds.var:this.varKind,i=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=I(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends o{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=I(this.rhs,e,n),this}get names(){return w(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class c extends a{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class l extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class u extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=I(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class f extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce(((t,n)=>t+n.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:n}=this;let r=n.length;for(;r--;){const i=n[r];i.optimizeNames(e,t)||(T(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce(((e,t)=>D(e,t.names)),{})}}class _ extends f{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends f{}class h extends _{}h.kind="else";class g extends _{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new h(e):e}return t?!1===e?t instanceof g?t:t.nodes:this.nodes.length?this:new g(F(e),t instanceof g?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var n;if(this.else=null===(n=this.else)||void 0===n?void 0:n.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=I(this.condition,e,t),this}get names(){const e=super.names;return w(e,this.condition),this.else&&D(e,this.else.names),e}}g.kind="if";class A extends _{}A.kind="for";class y extends A{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=I(this.iteration,e,t),this}get names(){return D(super.names,this.iteration.names)}}class v extends A{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){const t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:o}=this;return`for(${t} ${r}=${i}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){const e=w(super.names,this.from);return w(e,this.to)}}class b extends A{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=I(this.iterable,e,t),this}get names(){return D(super.names,this.iterable.names)}}class C extends _{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}C.kind="func";class E extends f{render(e){return"return "+super.render(e)}}E.kind="return";class x extends _{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),null===(n=this.catch)||void 0===n||n.optimizeNames(e,t),null===(r=this.finally)||void 0===r||r.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&D(e,this.catch.names),this.finally&&D(e,this.finally.names),e}}class S extends _{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}S.kind="catch";class k extends _{render(e){return"finally"+super.render(e)}}k.kind="finally";function D(e,t){for(const n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function w(e,n){return n instanceof t._CodeOrName?D(e,n.names):e}function I(e,n,r){return e instanceof t.Name?o(e):(i=e)instanceof t._Code&&i._items.some((e=>e instanceof t.Name&&1===n[e.str]&&void 0!==r[e.str]))?new t._Code(e._items.reduce(((e,n)=>(n instanceof t.Name&&(n=o(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e)),[])):e;var i;function o(e){const t=r[e.str];return void 0===t||1!==n[e.str]?e:(delete n[e.str],t)}}function T(e,t){for(const n in t)e[n]=(e[n]||0)-(t[n]||0)}function F(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${B(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){const i=this._scope.toName(t);return void 0!==n&&r&&(this._constants[i.str]=n),this._leafNode(new s(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new a(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new p(e)),this}object(...e){const n=["{"];for(const[r,i]of e)n.length>1&&n.push(","),n.push(r),(r!==i||this.opts.es5)&&(n.push(":"),(0,t.addCodeArg)(n,i));return n.push("}"),new t._Code(n)}if(e,t,n){if(this._blockNode(new g(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new g(e))}else(){return this._elseNode(new h)}endIf(){return this._endBlockNode(g,h)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,o=(this.opts.es5?n.varKinds.var:n.varKinds.let)){const s=this._scope.toName(e);return this._for(new v(o,s,t,r),(()=>i(s)))}forOf(e,r,i,o=n.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=r instanceof t.Name?r:this.var("_arr",r);return this.forRange("_i",0,t._`${e}.length`,(n=>{this.var(s,t._`${e}[${n}]`),i(s)}))}return this._for(new b("of",o,s,r),(()=>i(s)))}forIn(e,r,i,o=(this.opts.es5?n.varKinds.var:n.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${r})`,i);const s=this._scope.toName(e);return this._for(new b("in",o,s,r),(()=>i(s)))}endFor(){return this._endBlockNode(A)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){const t=new E;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new x;if(this._blockNode(r),this.code(e),t){const e=this.name("e");this._currNode=r.catch=new S(e),t(e)}return n&&(this._currNode=r.finally=new k,this.code(n)),this._endBlockNode(S,k)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const n=this._nodes.length-t;if(n<0||void 0!==e&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new C(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(C)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=F;const R=N(e.operators.AND);e.and=function(...e){return e.reduce(R)};const P=N(e.operators.OR);function N(e){return(n,r)=>n===t.nil?r:r===t.nil?n:t._`${B(n)} ${e} ${B(r)}`}function B(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(P)}}(codegen)),codegen}var util={},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;hasRequiredUtil=1,Object.defineProperty(util,"__esModule",{value:!0}),util.checkStrictMode=util.getErrorPath=util.Type=util.useFunc=util.setEvaluated=util.evaluatedPropsToName=util.mergeEvaluated=util.eachItem=util.unescapeJsonPointer=util.escapeJsonPointer=util.escapeFragment=util.unescapeFragment=util.schemaRefOrVal=util.schemaHasRulesButRef=util.schemaHasRules=util.checkUnknownRules=util.alwaysValidSchema=util.toHash=void 0;const e=requireCodegen(),t=requireCode$1();function n(e,t=e.schema){const{opts:n,self:r}=e;if(!n.strictSchema)return;if("boolean"==typeof t)return;const i=r.RULES.keywords;for(const n in t)i[n]||d(e,`unknown keyword: "${n}"`)}function r(e,t){if("boolean"==typeof e)return!e;for(const n in e)if(t[n])return!0;return!1}function i(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function o(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function s({mergeNames:t,mergeToName:n,mergeValues:r,resultToName:i}){return(o,s,a,c)=>{const l=void 0===a?s:a instanceof e.Name?(s instanceof e.Name?t(o,s,a):n(o,s,a),a):s instanceof e.Name?(n(o,a,s),s):r(s,a);return c!==e.Name||l instanceof e.Name?l:i(o,l)}}function a(t,n){if(!0===n)return t.var("props",!0);const r=t.var("props",e._`{}`);return void 0!==n&&c(t,r,n),r}function c(t,n,r){Object.keys(r).forEach((r=>t.assign(e._`${n}${(0,e.getProperty)(r)}`,!0)))}util.toHash=function(e){const t={};for(const n of e)t[n]=!0;return t},util.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(n(e,t),!r(t,e.self.RULES.all))},util.checkUnknownRules=n,util.schemaHasRules=r,util.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const n in e)if("$ref"!==n&&t.all[n])return!0;return!1},util.schemaRefOrVal=function({topSchemaRef:t,schemaPath:n},r,i,o){if(!o){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return e._`${r}`}return e._`${t}${n}${(0,e.getProperty)(i)}`},util.unescapeFragment=function(e){return o(decodeURIComponent(e))},util.escapeFragment=function(e){return encodeURIComponent(i(e))},util.escapeJsonPointer=i,util.unescapeJsonPointer=o,util.eachItem=function(e,t){if(Array.isArray(e))for(const n of e)t(n);else t(e)},util.mergeEvaluated={props:s({mergeNames:(t,n,r)=>t.if(e._`${r} !== true && ${n} !== undefined`,(()=>{t.if(e._`${n} === true`,(()=>t.assign(r,!0)),(()=>t.assign(r,e._`${r} || {}`).code(e._`Object.assign(${r}, ${n})`)))})),mergeToName:(t,n,r)=>t.if(e._`${r} !== true`,(()=>{!0===n?t.assign(r,!0):(t.assign(r,e._`${r} || {}`),c(t,r,n))})),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:a}),items:s({mergeNames:(t,n,r)=>t.if(e._`${r} !== true && ${n} !== undefined`,(()=>t.assign(r,e._`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`))),mergeToName:(t,n,r)=>t.if(e._`${r} !== true`,(()=>t.assign(r,!0===n||e._`${r} > ${n} ? ${r} : ${n}`))),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},util.evaluatedPropsToName=a,util.setEvaluated=c;const l={};var u;function d(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,!0===n)throw new Error(t);e.self.logger.warn(t)}}return util.useFunc=function(e,n){return e.scopeValue("func",{ref:n,code:l[n.code]||(l[n.code]=new t._Code(n.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(u||(util.Type=u={})),util.getErrorPath=function(t,n,r){if(t instanceof e.Name){const i=n===u.Num;return r?i?e._`"[" + ${t} + "]"`:e._`"['" + ${t} + "']"`:i?e._`"/" + ${t}`:e._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,e.getProperty)(t).toString():"/"+i(t)},util.checkStrictMode=d,util}var names={},hasRequiredNames,hasRequiredErrors,hasRequiredBoolSchema;function requireNames(){if(hasRequiredNames)return names;hasRequiredNames=1,Object.defineProperty(names,"__esModule",{value:!0});const e=requireCodegen(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return names.default=t,names}function requireErrors(){return hasRequiredErrors||(hasRequiredErrors=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=requireCodegen(),n=requireUtil(),r=requireNames();function i(e,n){const i=e.const("err",n);e.if(t._`${r.default.vErrors} === null`,(()=>e.assign(r.default.vErrors,t._`[${i}]`)),t._`${r.default.vErrors}.push(${i})`),e.code(t._`${r.default.errors}++`)}function o(e,n){const{gen:r,validateName:i,schemaEnv:o}=e;o.$async?r.throw(t._`new ${e.ValidationError}(${n})`):(r.assign(t._`${i}.errors`,n),r.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?t.str`"${e}" keyword must be ${n} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(n,r=e.keywordError,s,c){const{it:l}=n,{gen:u,compositeRule:d,allErrors:p}=l,f=a(n,r,s);(null!=c?c:d||p)?i(u,f):o(l,t._`[${f}]`)},e.reportExtraError=function(t,n=e.keywordError,s){const{it:c}=t,{gen:l,compositeRule:u,allErrors:d}=c;i(l,a(t,n,s)),u||d||o(c,r.default.vErrors)},e.resetErrorsCount=function(e,n){e.assign(r.default.errors,n),e.if(t._`${r.default.vErrors} !== null`,(()=>e.if(n,(()=>e.assign(t._`${r.default.vErrors}.length`,n)),(()=>e.assign(r.default.vErrors,null)))))},e.extendErrors=function({gen:e,keyword:n,schemaValue:i,data:o,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,r.default.errors,(s=>{e.const(c,t._`${r.default.vErrors}[${s}]`),e.if(t._`${c}.instancePath === undefined`,(()=>e.assign(t._`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,a.errorPath)))),e.assign(t._`${c}.schemaPath`,t.str`${a.errSchemaPath}/${n}`),a.opts.verbose&&(e.assign(t._`${c}.schema`,i),e.assign(t._`${c}.data`,o))}))};const s={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function a(e,n,i){const{createErrors:o}=e.it;return!1===o?t._`{}`:function(e,n,i={}){const{gen:o,it:a}=e,u=[c(a,i),l(e,i)];return function(e,{params:n,message:i},o){const{keyword:a,data:c,schemaValue:l,it:u}=e,{opts:d,propertyName:p,topSchemaRef:f,schemaPath:_}=u;o.push([s.keyword,a],[s.params,"function"==typeof n?n(e):n||t._`{}`]),d.messages&&o.push([s.message,"function"==typeof i?i(e):i]);d.verbose&&o.push([s.schema,l],[s.parentSchema,t._`${f}${_}`],[r.default.data,c]);p&&o.push([s.propertyName,p])}(e,n,u),o.object(...u)}(e,n,i)}function c({errorPath:e},{instancePath:i}){const o=i?t.str`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,o)]}function l({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:o}){let a=o?r:t.str`${r}/${e}`;return i&&(a=t.str`${a}${(0,n.getErrorPath)(i,n.Type.Str)}`),[s.schemaPath,a]}}(errors)),errors}function requireBoolSchema(){if(hasRequiredBoolSchema)return boolSchema;hasRequiredBoolSchema=1,Object.defineProperty(boolSchema,"__esModule",{value:!0}),boolSchema.boolOrEmptySchema=boolSchema.topBoolOrEmptySchema=void 0;const e=requireErrors(),t=requireCodegen(),n=requireNames(),r={message:"boolean schema is false"};function i(t,n){const{gen:i,data:o}=t,s={gen:i,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,e.reportError)(s,r,void 0,n)}return boolSchema.topBoolOrEmptySchema=function(e){const{gen:r,schema:o,validateName:s}=e;!1===o?i(e,!1):"object"==typeof o&&!0===o.$async?r.return(n.default.data):(r.assign(t._`${s}.errors`,null),r.return(!0))},boolSchema.boolOrEmptySchema=function(e,t){const{gen:n,schema:r}=e;!1===r?(n.var(t,!1),i(e)):n.var(t,!0)},boolSchema}var dataType={},rules={},hasRequiredRules;function requireRules(){if(hasRequiredRules)return rules;hasRequiredRules=1,Object.defineProperty(rules,"__esModule",{value:!0}),rules.getRules=rules.isJSONType=void 0;const e=new Set(["string","number","integer","boolean","null","object","array"]);return rules.isJSONType=function(t){return"string"==typeof t&&e.has(t)},rules.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}},rules}var applicability={},hasRequiredApplicability,hasRequiredDataType;function requireApplicability(){if(hasRequiredApplicability)return applicability;function e(e,n){return n.rules.some((n=>t(e,n)))}function t(e,t){var n;return void 0!==e[t.keyword]||(null===(n=t.definition.implements)||void 0===n?void 0:n.some((t=>void 0!==e[t])))}return hasRequiredApplicability=1,Object.defineProperty(applicability,"__esModule",{value:!0}),applicability.shouldUseRule=applicability.shouldUseGroup=applicability.schemaHasRulesForType=void 0,applicability.schemaHasRulesForType=function({schema:t,self:n},r){const i=n.RULES.types[r];return i&&!0!==i&&e(t,i)},applicability.shouldUseGroup=e,applicability.shouldUseRule=t,applicability}function requireDataType(){if(hasRequiredDataType)return dataType;hasRequiredDataType=1,Object.defineProperty(dataType,"__esModule",{value:!0}),dataType.reportTypeError=dataType.checkDataTypes=dataType.checkDataType=dataType.coerceAndCheckDataType=dataType.getJSONTypes=dataType.getSchemaTypes=dataType.DataType=void 0;const e=requireRules(),t=requireApplicability(),n=requireErrors(),r=requireCodegen(),i=requireUtil();var o;function s(t){const n=Array.isArray(t)?t:t?[t]:[];if(n.every(e.isJSONType))return n;throw new Error("type must be JSONType or JSONType[]: "+n.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(o||(dataType.DataType=o={})),dataType.getSchemaTypes=function(e){const t=s(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},dataType.getJSONTypes=s,dataType.coerceAndCheckDataType=function(e,n){const{gen:i,data:s,opts:c}=e,u=function(e,t){return t?e.filter((e=>a.has(e)||"array"===t&&"array"===e)):[]}(n,c.coerceTypes),p=n.length>0&&!(0===u.length&&1===n.length&&(0,t.schemaHasRulesForType)(e,n[0]));if(p){const t=l(n,s,c.strictNumbers,o.Wrong);i.if(t,(()=>{u.length?function(e,t,n){const{gen:i,data:o,opts:s}=e,c=i.let("dataType",r._`typeof ${o}`),u=i.let("coerced",r._`undefined`);"array"===s.coerceTypes&&i.if(r._`${c} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,(()=>i.assign(o,r._`${o}[0]`).assign(c,r._`typeof ${o}`).if(l(t,o,s.strictNumbers),(()=>i.assign(u,o)))));i.if(r._`${u} !== undefined`);for(const e of n)(a.has(e)||"array"===e&&"array"===s.coerceTypes)&&p(e);function p(e){switch(e){case"string":return void i.elseIf(r._`${c} == "number" || ${c} == "boolean"`).assign(u,r._`"" + ${o}`).elseIf(r._`${o} === null`).assign(u,r._`""`);case"number":return void i.elseIf(r._`${c} == "boolean" || ${o} === null || (${c} == "string" && ${o} && ${o} == +${o})`).assign(u,r._`+${o}`);case"integer":return void i.elseIf(r._`${c} === "boolean" || ${o} === null || (${c} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(u,r._`+${o}`);case"boolean":return void i.elseIf(r._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(u,!1).elseIf(r._`${o} === "true" || ${o} === 1`).assign(u,!0);case"null":return i.elseIf(r._`${o} === "" || ${o} === 0 || ${o} === false`),void i.assign(u,null);case"array":i.elseIf(r._`${c} === "string" || ${c} === "number" diff --git a/dist-gha/run.cjs b/dist-gha/run.cjs index 26c73cf5d..dc1548b39 100644 --- a/dist-gha/run.cjs +++ b/dist-gha/run.cjs @@ -1,4 +1,4 @@ -#!/usr/bin/env -S node --no-warnings=ExperimentalWarning +#!/usr/bin/env node "use strict";var e=require("node:url"),t=require("node:fs"),n=require("node:fs/promises"),r=require("node:util"),i=require("node:path"),o=require("fs"),a=require("path"),s=require("os"),c=require("node:os"),l=require("tty"),u=require("util"),_=require("inspector"),d=require("node:perf_hooks"),p=require("stream"),f=require("events"),m=require("node:readline"),g="undefined"!=typeof document?document.currentScript:null;function h(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}function y(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=0;n<e.length;n++){var r=e[n];if("string"==typeof r)return r}}!async function(){const{execute:e}=await Promise.resolve().then((function(){return $_})),t={dir:"undefined"==typeof document?require("url").pathToFileURL(__filename).href:g&&"SCRIPT"===g.tagName.toUpperCase()&&g.src||new URL("run.cjs",document.baseURI).href};process.env.INPUT_RDME&&(t.args=function(e){var t,n=/([^\s'"]([^\s'"]*(['"])([^\3]*?)\3)+[^\s'"]*)|[^\s'"]+|(['"])([^\5]*?)\5/gi,r=e,i=[];do{null!==(t=n.exec(r))&&i.push(y(t[1],t[6],t[0]))}while(null!==t);return i}(process.env.INPUT_RDME)),await e(t).then((e=>{e&&"string"==typeof e&&console.log(e)}))}();var v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function b(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var x,S={},k={};function T(){if(x)return k;function e(t,n){if(t=void 0===t?0:t,n=void 0===n?0:n,Array.isArray(t)&&Array.isArray(n)){if(0===t.length&&0===n.length)return 0;const r=e(t[0],n[0]);return 0!==r?r:e(t.slice(1),n.slice(1))}return t<n?-1:t>n?1:0}return x=1,Object.defineProperty(k,"__esModule",{value:!0}),k.pickBy=function(e,t){return Object.entries(e).reduce(((e,[n,r])=>(t(r)&&(e[n]=r),e)),{})},k.compact=function(e){return e.filter((e=>Boolean(e)))},k.uniqBy=function(e,t){return e.filter(((n,r)=>{const i=t(n);return!e.some(((e,n)=>n>r&&t(e)===i))}))},k.last=function(e){if(!e)return;return e.at(-1)},k.sortBy=function(t,n){return t.sort(((t,r)=>e(n(t),n(r))))},k.castArray=function(e){return void 0===e?[]:Array.isArray(e)?e:[e]},k.isProd=function(){return!["development","test"].includes(process.env.NODE_ENV??"")},k.maxBy=function(e,t){if(0===e.length)return;return e.reduce(((e,n)=>t(n)>t(e)?n:e))},k.sumBy=function(e,t){return e.reduce(((e,n)=>e+t(n)),0)},k.capitalize=function(e){return e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():""},k.isTruthy=function(e){return["1","true","y","yes"].includes(e.toLowerCase())},k.isNotFalsy=function(e){return!["0","false","n","no"].includes(e.toLowerCase())},k.uniq=function(e){return[...new Set(e)].sort()},k.mapValues=function(e,t){return Object.entries(e).reduce(((e,[n,r])=>(e[n]=t(r,n),e)),{})},k.mergeNestedObjects=function(e,t){return Object.fromEntries(e.flatMap((e=>Object.entries(function(e,t){return t.split(".").reduce(((e,t)=>e?.[t]),e)}(e,t)??{}))).reverse())},k}var C,D,w,E,F,N,P,A,I,O,L,R,j,M,B,J,z,$,q,U,V,W,H,G,K,X,Q,Y,Z,ee,te,ne,re,ie,oe,ae,se,ce,le,ue,_e,de,pe,fe,me,ge,he,ye,ve,be,xe,Se,ke,Te,Ce,De,we,Ee,Fe,Ne,Pe,Ae,Ie,Oe,Le,Re,je,Me,Be,Je,ze,$e,qe,Ue,Ve,We,He,Ge,Ke,Xe,Qe,Ye,Ze,et,tt,nt,rt,it,ot,at={exports:{}};function st(){if(D)return C;D=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return C={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function ct(){if(E)return w;E=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return w=e}function lt(){return F||(F=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=st(),o=ct(),a=(t=e.exports={}).re=[],s=t.safeRe=[],c=t.src=[],l=t.t={};let u=0;const _="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[_,r]],p=(e,t,n)=>{const r=(e=>{for(const[t,n]of d)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=u++;o(e,i,t),l[e]=i,c[i]=t,a[i]=new RegExp(t,n?"g":void 0),s[i]=new RegExp(r,n?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${_}*`),p("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${_}+`),p("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),p("FULL",`^${c[l.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),p("LOOSE",`^${c[l.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),p("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?`+`(?:${c[l.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",c[l.COERCE],!0),p("COERCERTLFULL",c[l.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(at,at.exports)),at.exports}function ut(){if(P)return N;P=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return N=n=>n?"object"!=typeof n?e:n:t}function _t(){if(I)return A;I=1;const e=/^[0-9]+$/,t=(t,n)=>{const r=e.test(t),i=e.test(n);return r&&i&&(t=+t,n=+n),t===n?0:r&&!i?-1:i&&!r?1:t<n?-1:1};return A={compareIdentifiers:t,rcompareIdentifiers:(e,n)=>t(n,e)}}function dt(){if(L)return O;L=1;const e=ct(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=st(),{safeRe:r,t:i}=lt(),o=ut(),{compareIdentifiers:a}=_t();class s{constructor(a,c){if(c=o(c),a instanceof s){if(a.loose===!!c.loose&&a.includePrerelease===!!c.includePrerelease)return a;a=a.version}else if("string"!=typeof a)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);if(a.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",a,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const l=a.trim().match(c.loose?r[i.LOOSE]:r[i.FULL]);if(!l)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");l[4]?this.prerelease=l[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<n)return t}return e})):this.prerelease=[],this.build=l[5]?l[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof s)){if("string"==typeof t&&t===this.version)return 0;t=new s(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof s||(e=new s(e,this.options)),a(this.major,e.major)||a(this.minor,e.minor)||a(this.patch,e.patch)}comparePre(t){if(t instanceof s||(t=new s(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=t.prerelease[n];if(e("prerelease compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return a(r,i)}while(++n)}compareBuild(t){t instanceof s||(t=new s(t,this.options));let n=0;do{const r=this.build[n],i=t.build[n];if(e("build compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return a(r,i)}while(++n)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===a(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return O=s}function pt(){if(j)return R;j=1;const e=dt();return R=(t,n,r=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(e){if(!r)return null;throw e}},R}function ft(){if(te)return ee;te=1;const e=dt();return ee=(t,n,r)=>new e(t,r).compare(new e(n,r))}function mt(){if(se)return ae;se=1;const e=dt();return ae=(t,n,r)=>{const i=new e(t,r),o=new e(n,r);return i.compare(o)||i.compareBuild(o)}}function gt(){if(pe)return de;pe=1;const e=ft();return de=(t,n,r)=>e(t,n,r)>0}function ht(){if(me)return fe;me=1;const e=ft();return fe=(t,n,r)=>e(t,n,r)<0}function yt(){if(he)return ge;he=1;const e=ft();return ge=(t,n,r)=>0===e(t,n,r)}function vt(){if(ve)return ye;ve=1;const e=ft();return ye=(t,n,r)=>0!==e(t,n,r)}function bt(){if(xe)return be;xe=1;const e=ft();return be=(t,n,r)=>e(t,n,r)>=0}function xt(){if(ke)return Se;ke=1;const e=ft();return Se=(t,n,r)=>e(t,n,r)<=0}function St(){if(Ce)return Te;Ce=1;const e=yt(),t=vt(),n=gt(),r=bt(),i=ht(),o=xt();return Te=(a,s,c,l)=>{switch(s){case"===":return"object"==typeof a&&(a=a.version),"object"==typeof c&&(c=c.version),a===c;case"!==":return"object"==typeof a&&(a=a.version),"object"==typeof c&&(c=c.version),a!==c;case"":case"=":case"==":return e(a,c,l);case"!=":return t(a,c,l);case">":return n(a,c,l);case">=":return r(a,c,l);case"<":return i(a,c,l);case"<=":return o(a,c,l);default:throw new TypeError(`Invalid operator: ${s}`)}}}function kt(){if(Pe)return Ne;Pe=1;const e=/\s+/g;class t{constructor(n,o){if(o=r(o),n instanceof t)return n.loose===!!o.loose&&n.includePrerelease===!!o.includePrerelease?n:new t(n.raw,o);if(n instanceof i)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=n.trim().replace(e," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!f(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&d)|(this.options.loose&&p))+":"+e,r=n.get(t);if(r)return r;const a=this.options.loose,m=a?s[c.HYPHENRANGELOOSE]:s[c.HYPHENRANGE];e=e.replace(m,w(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(s[c.COMPARATORTRIM],l),o("comparator trim",e),e=e.replace(s[c.TILDETRIM],u),o("tilde trim",e),e=e.replace(s[c.CARETTRIM],_),o("caret trim",e);let g=e.split(" ").map((e=>h(e,this.options))).join(" ").split(/\s+/).map((e=>D(e,this.options)));a&&(g=g.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(s[c.COMPARATORLOOSE]))))),o("range list",g);const y=new Map,v=g.map((e=>new i(e,this.options)));for(const e of v){if(f(e))return[e];y.set(e.value,e)}y.size>1&&y.has("")&&y.delete("");const b=[...y.values()];return n.set(t,b),b}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some((t=>g(t,n)&&e.set.some((e=>g(e,n)&&t.every((t=>e.every((e=>t.intersects(e,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(E(this.set[t],e,this.options))return!0;return!1}}Ne=t;const n=new(Fe?Ee:(Fe=1,Ee=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}})),r=ut(),i=Tt(),o=ct(),a=dt(),{safeRe:s,t:c,comparatorTrimReplace:l,tildeTrimReplace:u,caretTrimReplace:_}=lt(),{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:p}=st(),f=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},h=(e,t)=>(o("comp",e,t),e=x(e,t),o("caret",e),e=v(e,t),o("tildes",e),e=k(e,t),o("xrange",e),e=C(e,t),o("stars",e),e),y=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map((e=>b(e,t))).join(" "),b=(e,t)=>{const n=t.loose?s[c.TILDELOOSE]:s[c.TILDE];return e.replace(n,((t,n,r,i,a)=>{let s;return o("tilde",e,t,n,r,i,a),y(n)?s="":y(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:y(i)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(o("replaceTilde pr",a),s=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",s),s}))},x=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{o("caret",e,t);const n=t.loose?s[c.CARETLOOSE]:s[c.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,a,s)=>{let c;return o("caret",e,t,n,i,a,s),y(n)?c="":y(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:y(a)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(o("replaceCaret pr",s),c="0"===n?"0"===i?`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`):(o("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),o("caret return",c),c}))},k=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>T(e,t))).join(" ")),T=(e,t)=>{e=e.trim();const n=t.loose?s[c.XRANGELOOSE]:s[c.XRANGE];return e.replace(n,((n,r,i,a,s,c)=>{o("xRange",e,n,r,i,a,s,c);const l=y(i),u=l||y(a),_=u||y(s),d=_;return"="===r&&d&&(r=""),c=t.includePrerelease?"-0":"",l?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(u&&(a=0),s=0,">"===r?(r=">=",u?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):"<="===r&&(r="<",u?i=+i+1:a=+a+1),"<"===r&&(c="-0"),n=`${r+i}.${a}.${s}${c}`):u?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:_&&(n=`>=${i}.${a}.0${c} <${i}.${+a+1}.0-0`),o("xRange return",n),n}))},C=(e,t)=>(o("replaceStars",e,t),e.trim().replace(s[c.STAR],"")),D=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(s[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),w=e=>(t,n,r,i,o,a,s,c,l,u,_,d)=>`${n=y(r)?"":y(i)?`>=${r}.0.0${e?"-0":""}`:y(o)?`>=${r}.${i}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=y(l)?"":y(u)?`<${+l+1}.0.0-0`:y(_)?`<${l}.${+u+1}.0-0`:d?`<=${l}.${u}.${_}-${d}`:e?`<${l}.${u}.${+_+1}-0`:`<=${c}`}`.trim(),E=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==i.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return Ne}function Tt(){if(Ie)return Ae;Ie=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),a("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new s(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(a("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new s(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,r).test(this.value):""===e.operator?""===e.value||new c(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}Ae=t;const n=ut(),{safeRe:r,t:i}=lt(),o=St(),a=ct(),s=dt(),c=kt();return Ae}function Ct(){if(Le)return Oe;Le=1;const e=kt();return Oe=(t,n,r)=>{try{n=new e(n,r)}catch(e){return!1}return n.test(t)},Oe}function Dt(){if(Ve)return Ue;Ve=1;const e=kt();return Ue=(t,n)=>{try{return new e(t,n).range||"*"}catch(e){return null}},Ue}function wt(){if(He)return We;He=1;const e=dt(),t=Tt(),{ANY:n}=t,r=kt(),i=Ct(),o=gt(),a=ht(),s=xt(),c=bt();return We=(l,u,_,d)=>{let p,f,m,g,h;switch(l=new e(l,d),u=new r(u,d),_){case">":p=o,f=s,m=a,g=">",h=">=";break;case"<":p=a,f=c,m=o,g="<",h="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(l,u,d))return!1;for(let e=0;e<u.set.length;++e){const r=u.set[e];let i=null,o=null;if(r.forEach((e=>{e.semver===n&&(e=new t(">=0.0.0")),i=i||e,o=o||e,p(e.semver,i.semver,d)?i=e:m(e.semver,o.semver,d)&&(o=e)})),i.operator===g||i.operator===h)return!1;if((!o.operator||o.operator===g)&&f(l,o.semver))return!1;if(o.operator===h&&m(l,o.semver))return!1}return!0},We}function Et(){if(ot)return it;ot=1;const e=lt(),t=st(),n=dt(),r=_t(),i=pt(),o=function(){if(B)return M;B=1;const e=pt();return M=(t,n)=>{const r=e(t,n);return r?r.version:null},M}(),a=function(){if(z)return J;z=1;const e=pt();return J=(t,n)=>{const r=e(t.trim().replace(/^[=v]+/,""),n);return r?r.version:null},J}(),s=function(){if(q)return $;q=1;const e=dt();return $=(t,n,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new e(t instanceof e?t.version:t,r).inc(n,i,o).version}catch(e){return null}},$}(),c=function(){if(V)return U;V=1;const e=pt();return U=(t,n)=>{const r=e(t,null,!0),i=e(n,null,!0),o=r.compare(i);if(0===o)return null;const a=o>0,s=a?r:i,c=a?i:r,l=!!s.prerelease.length;if(c.prerelease.length&&!l)return c.patch||c.minor?s.patch?"patch":s.minor?"minor":"major":"major";const u=l?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"}}(),l=function(){if(H)return W;H=1;const e=dt();return W=(t,n)=>new e(t,n).major}(),u=function(){if(K)return G;K=1;const e=dt();return G=(t,n)=>new e(t,n).minor}(),_=function(){if(Q)return X;Q=1;const e=dt();return X=(t,n)=>new e(t,n).patch}(),d=function(){if(Z)return Y;Z=1;const e=pt();return Y=(t,n)=>{const r=e(t,n);return r&&r.prerelease.length?r.prerelease:null},Y}(),p=ft(),f=function(){if(re)return ne;re=1;const e=ft();return ne=(t,n,r)=>e(n,t,r)}(),m=function(){if(oe)return ie;oe=1;const e=ft();return ie=(t,n)=>e(t,n,!0)}(),g=mt(),h=function(){if(le)return ce;le=1;const e=mt();return ce=(t,n)=>t.sort(((t,r)=>e(t,r,n))),ce}(),y=function(){if(_e)return ue;_e=1;const e=mt();return ue=(t,n)=>t.sort(((t,r)=>e(r,t,n))),ue}(),v=gt(),b=ht(),x=yt(),S=vt(),k=bt(),T=xt(),C=St(),D=function(){if(we)return De;we=1;const e=dt(),t=pt(),{safeRe:n,t:r}=lt();return De=(i,o)=>{if(i instanceof e)return i;if("number"==typeof i&&(i=String(i)),"string"!=typeof i)return null;let a=null;if((o=o||{}).rtl){const e=o.includePrerelease?n[r.COERCERTLFULL]:n[r.COERCERTL];let t;for(;(t=e.exec(i))&&(!a||a.index+a[0].length!==i.length);)a&&t.index+t[0].length===a.index+a[0].length||(a=t),e.lastIndex=t.index+t[1].length+t[2].length;e.lastIndex=-1}else a=i.match(o.includePrerelease?n[r.COERCEFULL]:n[r.COERCE]);if(null===a)return null;const s=a[2],c=a[3]||"0",l=a[4]||"0",u=o.includePrerelease&&a[5]?`-${a[5]}`:"",_=o.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${s}.${c}.${l}${u}${_}`,o)},De}(),w=Tt(),E=kt(),F=Ct(),N=function(){if(je)return Re;je=1;const e=kt();return Re=(t,n)=>new e(t,n).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" "))),Re}(),P=function(){if(Be)return Me;Be=1;const e=dt(),t=kt();return Me=(n,r,i)=>{let o=null,a=null,s=null;try{s=new t(r,i)}catch(e){return null}return n.forEach((t=>{s.test(t)&&(o&&-1!==a.compare(t)||(o=t,a=new e(o,i)))})),o},Me}(),A=function(){if(ze)return Je;ze=1;const e=dt(),t=kt();return Je=(n,r,i)=>{let o=null,a=null,s=null;try{s=new t(r,i)}catch(e){return null}return n.forEach((t=>{s.test(t)&&(o&&1!==a.compare(t)||(o=t,a=new e(o,i)))})),o},Je}(),I=function(){if(qe)return $e;qe=1;const e=dt(),t=kt(),n=gt();return $e=(r,i)=>{r=new t(r,i);let o=new e("0.0.0");if(r.test(o))return o;if(o=new e("0.0.0-0"),r.test(o))return o;o=null;for(let t=0;t<r.set.length;++t){const i=r.set[t];let a=null;i.forEach((t=>{const r=new e(t.semver.version);switch(t.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":a&&!n(r,a)||(a=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}})),!a||o&&!n(o,a)||(o=a)}return o&&r.test(o)?o:null},$e}(),O=Dt(),L=wt(),R=function(){if(Ke)return Ge;Ke=1;const e=wt();return Ge=(t,n,r)=>e(t,n,">",r),Ge}(),j=function(){if(Qe)return Xe;Qe=1;const e=wt();return Xe=(t,n,r)=>e(t,n,"<",r),Xe}(),ee=function(){if(Ze)return Ye;Ze=1;const e=kt();return Ye=(t,n,r)=>(t=new e(t,r),n=new e(n,r),t.intersects(n,r))}(),te=function(){if(tt)return et;tt=1;const e=Ct(),t=ft();return et=(n,r,i)=>{const o=[];let a=null,s=null;const c=n.sort(((e,n)=>t(e,n,i)));for(const t of c)e(t,r,i)?(s=t,a||(a=t)):(s&&o.push([a,s]),s=null,a=null);a&&o.push([a,null]);const l=[];for(const[e,t]of o)e===t?l.push(e):t||e!==c[0]?t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`):l.push("*");const u=l.join(" || "),_="string"==typeof r.raw?r.raw:String(r);return u.length<_.length?u:r},et}(),ae=function(){if(rt)return nt;rt=1;const e=kt(),t=Tt(),{ANY:n}=t,r=Ct(),i=ft(),o=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],s=(e,t,s)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===n){if(1===t.length&&t[0].semver===n)return!0;e=s.includePrerelease?o:a}if(1===t.length&&t[0].semver===n){if(s.includePrerelease)return!0;t=a}const u=new Set;let _,d,p,f,m,g,h;for(const t of e)">"===t.operator||">="===t.operator?_=c(_,t,s):"<"===t.operator||"<="===t.operator?d=l(d,t,s):u.add(t.semver);if(u.size>1)return null;if(_&&d){if(p=i(_.semver,d.semver,s),p>0)return null;if(0===p&&(">="!==_.operator||"<="!==d.operator))return null}for(const e of u){if(_&&!r(e,String(_),s))return null;if(d&&!r(e,String(d),s))return null;for(const n of t)if(!r(e,String(n),s))return!1;return!0}let y=!(!d||s.includePrerelease||!d.semver.prerelease.length)&&d.semver,v=!(!_||s.includePrerelease||!_.semver.prerelease.length)&&_.semver;y&&1===y.prerelease.length&&"<"===d.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(h=h||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,_)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if(f=c(_,e,s),f===e&&f!==_)return!1}else if(">="===_.operator&&!r(_.semver,String(e),s))return!1;if(d)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(m=l(d,e,s),m===e&&m!==d)return!1}else if("<="===d.operator&&!r(d.semver,String(e),s))return!1;if(!e.operator&&(d||_)&&0!==p)return!1}return!(_&&g&&!d&&0!==p||d&&h&&!_&&0!==p||v||y)},c=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},l=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};return nt=(t,n,r={})=>{if(t===n)return!0;t=new e(t,r),n=new e(n,r);let i=!1;e:for(const e of t.set){for(const t of n.set){const n=s(e,t,r);if(i=i||null!==n,n)continue e}if(i)return!1}return!0}}();return it={parse:i,valid:o,clean:a,inc:s,diff:c,major:l,minor:u,patch:_,prerelease:d,compare:p,rcompare:f,compareLoose:m,compareBuild:g,sort:h,rsort:y,gt:v,lt:b,eq:x,neq:S,gte:k,lte:T,cmp:C,coerce:D,Comparator:w,Range:E,satisfies:F,toComparators:N,maxSatisfying:P,minSatisfying:A,minVersion:I,validRange:O,outside:L,gtr:R,ltr:j,intersects:ee,simplifyRange:te,subset:ae,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers}}var Ft,Nt,Pt={},At={};function It(){if(Ft)return At;Ft=1,Object.defineProperty(At,"__esModule",{value:!0}),At.fileExists=At.dirExists=void 0,At.readJson=s,At.safeReadJson=async function(e,t=!0){try{return await s(e,t)}catch{}},At.existsSync=function(t){return(0,e.existsSync)(t)};const e=t,r=n,i=T();At.dirExists=async e=>{let t;try{t=await(0,r.stat)(e)}catch{throw new Error(`No directory found at ${e}`)}if(!t.isDirectory())throw new Error(`${e} exists but is not a directory`);return e};At.fileExists=async e=>{let t;try{t=await(0,r.stat)(e)}catch{throw new Error(`No file found at ${e}`)}if(!t.isFile())throw new Error(`${e} exists but is not a file`);return e};class o extends Map{set(e,t){return(0,i.isProd)()&&super.set(e,t),this}}const a=new o;async function s(e,t=!0){if(t&&a.has(e))return JSON.parse(a.get(e));const n=await(0,r.readFile)(e,"utf8");return a.set(e,n),JSON.parse(n)}return At}var Ot,Lt={},Rt={};function jt(){if(Ot)return Rt;Ot=1,Object.defineProperty(Rt,"__esModule",{value:!0});const e=t,n=i;class r extends Map{static instance;constructor(){super(),this.set("@oclif/core",this.getOclifCoreMeta())}static getInstance(){return r.instance||(r.instance=new r),r.instance}get(e){return super.get(e)}getOclifCoreMeta(){try{return{name:"@oclif/core",version:require("@oclif/core/package.json").version}}catch{try{return{name:"@oclif/core",version:JSON.parse((0,e.readFileSync)((0,n.join)(__dirname,"..","package.json"),"utf8")).version}}catch{return{name:"@oclif/core",version:"unknown"}}}}}return Rt.default=r,Rt}var Mt,Bt={},Jt={exports:{}},zt={},$t={};var qt,Ut="3.1.10";function Vt(){return qt||(qt=1,function(e){ /** * @file Embedded JavaScript templating engine. {@link http://ejs.co} diff --git a/package-lock.json b/package-lock.json index 7de460f4e..d701686dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "rdme", - "version": "9.0.1", + "version": "9.0.2-next.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "rdme", - "version": "9.0.1", + "version": "9.0.2-next.2", "license": "MIT", "dependencies": { "@actions/core": "^1.6.0", diff --git a/package.json b/package.json index 8f90481c6..90d9c84fb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rdme", - "version": "9.0.1", + "version": "9.0.2-next.2", "description": "ReadMe's official CLI and GitHub Action.", "license": "MIT", "author": "ReadMe <support@readme.io> (https://readme.com)", @@ -34,7 +34,7 @@ ], "repository": { "type": "git", - "url": "https://github.com/readmeio/rdme.git" + "url": "git+https://github.com/readmeio/rdme.git" }, "bugs": { "url": "https://github.com/readmeio/rdme/issues" diff --git a/src/commands/docs/prune.ts b/src/commands/docs/prune.ts index f21986d6c..c1272a997 100644 --- a/src/commands/docs/prune.ts +++ b/src/commands/docs/prune.ts @@ -26,7 +26,8 @@ export default class DocsPruneCommand extends BaseCommand<typeof DocsPruneComman message: `\`rdme ${this.id}\` is deprecated and will be removed in v10. For more information, please visit our migration guide: https://github.com/readmeio/rdme/tree/v9/documentation/migration-guide.md`, }; - static aliases = ['guides prune']; + // this needs to be separated by a colon in order for autocomplete to work properly + static aliases = ['guides:prune']; static description = 'Delete any docs from ReadMe if their slugs are not found in the target folder.'; diff --git a/src/lib/configstore.ts b/src/lib/configstore.ts index 7fc7fccc0..d4517a480 100644 --- a/src/lib/configstore.ts +++ b/src/lib/configstore.ts @@ -1,6 +1,6 @@ import Configstore from 'configstore'; -import pkg from '../package.json' with { type: 'json' }; +import { pkg } from './getPkg.js'; const configstore = new Configstore( /** diff --git a/src/lib/createGHA/index.ts b/src/lib/createGHA/index.ts index 539c428ff..ffa744099 100644 --- a/src/lib/createGHA/index.ts +++ b/src/lib/createGHA/index.ts @@ -8,7 +8,7 @@ import prompts from 'prompts'; import { simpleGit } from 'simple-git'; import configstore from '../configstore.js'; -import { getMajorPkgVersion } from '../getPkgVersion.js'; +import { getMajorPkgVersion } from '../getPkg.js'; import isCI, { isNpmScript, isTest } from '../isCI.js'; import { info } from '../logger.js'; import promptTerminal from '../promptWrapper.js'; diff --git a/src/lib/getPkgVersion.ts b/src/lib/getPkg.ts similarity index 55% rename from src/lib/getPkgVersion.ts rename to src/lib/getPkg.ts index 335f7929b..cf9c44266 100644 --- a/src/lib/getPkgVersion.ts +++ b/src/lib/getPkg.ts @@ -1,8 +1,8 @@ import type { Hook } from '@oclif/core'; -import semver from 'semver'; +import { readFileSync } from 'node:fs'; -import pkg from '../package.json' with { type: 'json' }; +import semver from 'semver'; import { error } from './logger.js'; @@ -13,6 +13,15 @@ const registryUrl = 'https://registry.npmjs.com/rdme'; */ type npmDistTag = 'latest'; +/** + * A synchronous function that reads the `package.json` file for use elsewhere. + * Until we drop support Node.js 20, we need to import this way to avoid ExperimentalWarning outputs. + * + * @see {@link https://nodejs.org/docs/latest-v20.x/api/esm.html#import-attributes} + * @see {@link https://www.stefanjudis.com/snippets/how-to-import-json-files-in-es-modules-node-js/} + */ +export const pkg = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), { encoding: 'utf-8' })); + /** * Return the major Node.js version specified in our `package.json` config. * @@ -27,6 +36,18 @@ export function getNodeVersion(): string { return parsedVersion.version; } +/** + * The current `rdme` version, as specified in the `package.json` + * or in the oclif hook context. + * + * @example "8.0.0" + * @note we mock this function in our snapshots + * @see {@link https://stackoverflow.com/a/54245672} + */ +export function getPkgVersion(this: Hook.Context | void): string { + return this?.config?.version || pkg.version; +} + /** * The current `rdme` version * @@ -34,20 +55,20 @@ export function getNodeVersion(): string { * the version from the `package.json` is returned. * @example "8.0.0" * @see {@link https://docs.npmjs.com/adding-dist-tags-to-packages} - * @note we mock this function in our snapshots, hence it's not the default + * @note we mock this function in our snapshots * @see {@link https://stackoverflow.com/a/54245672} */ -export async function getPkgVersion(this: Hook.Context | void, npmDistTag?: npmDistTag): Promise<string> { +export async function getPkgVersionFromNPM(this: Hook.Context | void, npmDistTag?: npmDistTag): Promise<string> { if (npmDistTag) { return fetch(registryUrl) .then(res => res.json() as Promise<{ 'dist-tags': Record<string, string> }>) .then(body => body['dist-tags'][npmDistTag]) .catch(err => { error(`error fetching version from npm registry: ${err.message}`); - return pkg.version; + return getPkgVersion.call(this); }); } - return this?.config?.version || pkg.version; + return getPkgVersion.call(this); } /** @@ -56,5 +77,5 @@ export async function getPkgVersion(this: Hook.Context | void, npmDistTag?: npmD * @example 8 */ export async function getMajorPkgVersion(this: Hook.Context | void, npmDistTag?: npmDistTag): Promise<number> { - return semver.major(await getPkgVersion.call(this, npmDistTag)); + return semver.major(await getPkgVersionFromNPM.call(this, npmDistTag)); } diff --git a/src/lib/readmeAPIFetch.ts b/src/lib/readmeAPIFetch.ts index 920ca2b79..56aab4b4e 100644 --- a/src/lib/readmeAPIFetch.ts +++ b/src/lib/readmeAPIFetch.ts @@ -5,11 +5,10 @@ import path from 'node:path'; import mime from 'mime-types'; import { ProxyAgent } from 'undici'; -import pkg from '../package.json' with { type: 'json' }; - import { APIv1Error } from './apiError.js'; import config from './config.js'; import { git } from './createGHA/index.js'; +import { getPkgVersion } from './getPkg.js'; import isCI, { ciName, isGHA } from './isCI.js'; import { debug, warn } from './logger.js'; @@ -90,7 +89,7 @@ function parseWarningHeader(header: string): WarningHeader[] { */ export function getUserAgent() { const gh = isGHA() ? '-github' : ''; - return `rdme${gh}/${pkg.version}`; + return `rdme${gh}/${getPkgVersion()}`; } /**